Android Open Source - msf-spaces-sdk-android Provider Initializer






From Project

Back to project page msf-spaces-sdk-android.

License

The source code is released under:

Apache License

If you think the Android project msf-spaces-sdk-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.imc.mirror.sdk.android;
/*  w w  w.j  av a  2 s .c  om*/
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smackx.provider.DataFormProvider;
import org.jivesoftware.smackx.provider.DiscoverInfoProvider;
import org.jivesoftware.smackx.provider.DiscoverItemsProvider;
import org.jivesoftware.smackx.provider.HeaderProvider;
import org.jivesoftware.smackx.provider.HeadersProvider;
import org.jivesoftware.smackx.pubsub.provider.AffiliationProvider;
import org.jivesoftware.smackx.pubsub.provider.AffiliationsProvider;
import org.jivesoftware.smackx.pubsub.provider.ConfigEventProvider;
import org.jivesoftware.smackx.pubsub.provider.EventProvider;
import org.jivesoftware.smackx.pubsub.provider.FormNodeProvider;
import org.jivesoftware.smackx.pubsub.provider.ItemProvider;
import org.jivesoftware.smackx.pubsub.provider.ItemsProvider;
import org.jivesoftware.smackx.pubsub.provider.PubSubProvider;
import org.jivesoftware.smackx.pubsub.provider.RetractEventProvider;
import org.jivesoftware.smackx.pubsub.provider.SimpleNodeProvider;
import org.jivesoftware.smackx.pubsub.provider.SubscriptionProvider;
import org.jivesoftware.smackx.pubsub.provider.SubscriptionsProvider;

import de.imc.mirror.sdk.config.NamespaceConfig;
import de.imc.mirror.sdk.android.packet.PersistenceServiceDeleteProvider;
import de.imc.mirror.sdk.android.packet.PersistenceServiceQueryProvider;

/**
 * This class provides a static method to initialize the provider manager.
 * It is used internally by the connection handler.
 * 
 * {@link ConnectionHandler}
 * @author mach
 */
public class ProviderInitializer {
  
  private ProviderInitializer() {}
  
  /**
   * Adds all IQProvider to the ProviderManager so receiving datapackages will be parsed correctly.
   */
  public static void initializeProviderManager(){
        /* These rows creates the provider manager that handles different extensions for XMPP
         * basically this tells smack how to handle different XML objects.
         */
        ProviderManager pm = ProviderManager.getInstance();
    pm.addIQProvider("spaces", NamespaceConfig.SPACES_SERVICE, new SpacesProvider());
        pm.addIQProvider("pubsub", NamespaceConfig.XMPP_PUBSUB, new PubSubProvider());
        pm.addIQProvider("pubsub", NamespaceConfig.XMPP_PUBSUB + "#owner", new PubSubProvider());
        pm.addExtensionProvider("subscription", NamespaceConfig.XMPP_PUBSUB, new SubscriptionProvider());
        pm.addExtensionProvider("subscriptions", NamespaceConfig.XMPP_PUBSUB, new SubscriptionsProvider());
        pm.addExtensionProvider("subscriptions", NamespaceConfig.XMPP_PUBSUB + "#owner", new SubscriptionsProvider());
        pm.addExtensionProvider("affiliations", NamespaceConfig.XMPP_PUBSUB, new AffiliationsProvider());
        pm.addExtensionProvider("affiliation", NamespaceConfig.XMPP_PUBSUB, new AffiliationProvider());
        pm.addExtensionProvider("options", NamespaceConfig.XMPP_PUBSUB, new FormNodeProvider());
        pm.addExtensionProvider("options", NamespaceConfig.XMPP_PUBSUB + "#event", new FormNodeProvider());
        pm.addExtensionProvider("configure", NamespaceConfig.XMPP_PUBSUB + "#owner", new FormNodeProvider());
        pm.addExtensionProvider("default", NamespaceConfig.XMPP_PUBSUB + "#owner", new FormNodeProvider());
        pm.addExtensionProvider("event", NamespaceConfig.XMPP_PUBSUB + "#event", new EventProvider());
        pm.addExtensionProvider("configuration", NamespaceConfig.XMPP_PUBSUB + "#event", new ConfigEventProvider());
        pm.addExtensionProvider("delete", NamespaceConfig.XMPP_PUBSUB + "#event", new SimpleNodeProvider());
        pm.addExtensionProvider("create", NamespaceConfig.XMPP_PUBSUB, new SimpleNodeProvider());
        pm.addExtensionProvider("retract", NamespaceConfig.XMPP_PUBSUB + "#event", new RetractEventProvider());
        pm.addExtensionProvider("purge", NamespaceConfig.XMPP_PUBSUB + "#event", new SimpleNodeProvider());
        pm.addExtensionProvider("items", NamespaceConfig.XMPP_PUBSUB, new ItemsProvider());
        pm.addExtensionProvider("items", NamespaceConfig.XMPP_PUBSUB + "#event", new ItemsProvider());
        pm.addExtensionProvider("item", NamespaceConfig.XMPP_PUBSUB, new ItemProvider());
        pm.addExtensionProvider("item", NamespaceConfig.XMPP_PUBSUB + "#event", new ItemProvider());
        pm.addExtensionProvider("item", "", new ItemProvider());
        
        pm.addExtensionProvider("headers", "http://jabber.org/protocol/shim", new HeadersProvider());
        pm.addExtensionProvider("header", "http://jabber.org/protocol/shim", new HeaderProvider());
        
        pm.addExtensionProvider("x", "jabber:x:data", new DataFormProvider());
        
        pm.addIQProvider("query", "http://jabber.org/protocol/disco#items", new DiscoverItemsProvider());
        pm.addIQProvider("query", "http://jabber.org/protocol/disco#info", new DiscoverInfoProvider());
        pm.addIQProvider("query", NamespaceConfig.PERSISTENCE_SERVICE, new PersistenceServiceQueryProvider());
        pm.addIQProvider("delete", NamespaceConfig.PERSISTENCE_SERVICE, new PersistenceServiceDeleteProvider());
  }
}




Java Source Code List

de.imc.mirror.sdk.android.CDMDataBuilder.java
de.imc.mirror.sdk.android.CDMData.java
de.imc.mirror.sdk.android.CommandType.java
de.imc.mirror.sdk.android.ConnectionConfigurationBuilder.java
de.imc.mirror.sdk.android.ConnectionConfiguration.java
de.imc.mirror.sdk.android.ConnectionHandler.java
de.imc.mirror.sdk.android.DataHandler.java
de.imc.mirror.sdk.android.DataModel.java
de.imc.mirror.sdk.android.DataObjectBuilder.java
de.imc.mirror.sdk.android.DataObject.java
de.imc.mirror.sdk.android.DataWrapper.java
de.imc.mirror.sdk.android.NetworkInformation.java
de.imc.mirror.sdk.android.OrgaSpace.java
de.imc.mirror.sdk.android.PrivateSpace.java
de.imc.mirror.sdk.android.ProviderInitializer.java
de.imc.mirror.sdk.android.RequestFuture.java
de.imc.mirror.sdk.android.SpaceChannel.java
de.imc.mirror.sdk.android.SpaceConfiguration.java
de.imc.mirror.sdk.android.SpaceHandler.java
de.imc.mirror.sdk.android.SpaceMember.java
de.imc.mirror.sdk.android.Space.java
de.imc.mirror.sdk.android.SpacesProvider.java
de.imc.mirror.sdk.android.TeamSpace.java
de.imc.mirror.sdk.android.UserInfo.java
de.imc.mirror.sdk.android.cdm.CDMData_0_1.java
de.imc.mirror.sdk.android.cdm.CDMData_0_2.java
de.imc.mirror.sdk.android.cdm.CDMData_1_0.java
de.imc.mirror.sdk.android.cdm.CDMData_2_0.java
de.imc.mirror.sdk.android.cdm.CreationInfo.java
de.imc.mirror.sdk.android.cdm.Reference.java
de.imc.mirror.sdk.android.cdm.References.java
de.imc.mirror.sdk.android.cdm.Summary.java
de.imc.mirror.sdk.android.data.ChannelsTable.java
de.imc.mirror.sdk.android.data.DataDB.java
de.imc.mirror.sdk.android.data.DataTable.java
de.imc.mirror.sdk.android.data.MembersTable.java
de.imc.mirror.sdk.android.data.SendTable.java
de.imc.mirror.sdk.android.data.SpacesTable.java
de.imc.mirror.sdk.android.exceptions.InvalidBuildException.java
de.imc.mirror.sdk.android.exceptions.RequestException.java
de.imc.mirror.sdk.android.filter.AndFilter.java
de.imc.mirror.sdk.android.filter.DataModelFilter.java
de.imc.mirror.sdk.android.filter.NamespaceFilter.java
de.imc.mirror.sdk.android.filter.OrFilter.java
de.imc.mirror.sdk.android.filter.PeriodFilter.java
de.imc.mirror.sdk.android.filter.PublisherFilter.java
de.imc.mirror.sdk.android.filter.ReferencesFilter.java
de.imc.mirror.sdk.android.packet.DeleteRequestIQ.java
de.imc.mirror.sdk.android.packet.DeleteResponseIQ.java
de.imc.mirror.sdk.android.packet.PersistenceServiceDeleteProvider.java
de.imc.mirror.sdk.android.packet.PersistenceServiceQueryProvider.java
de.imc.mirror.sdk.android.packet.QueryRequestIQ.java
de.imc.mirror.sdk.android.packet.QueryResponseIQ.java
de.imc.mirror.sdk.android.utils.DatatypeConverter.java
de.imc.mirror.sdk.android.utils.DateToXsdDatetimeFormatter.java
org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.java
org.apache.xerces.jaxp.datatype.DurationImpl.java
org.apache.xerces.jaxp.datatype.SerializedDuration.java
org.apache.xerces.jaxp.datatype.SerializedXMLGregorianCalendar.java
org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl.java
org.apache.xerces.util.DatatypeMessageFormatter.java