Java Code Examples for org.jivesoftware.smack.provider.ProviderManager#getInstance()

The following examples show how to use org.jivesoftware.smack.provider.ProviderManager#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RemoteGroupCreationOverXMPP.java    From olat with Apache License 2.0 5 votes vote down vote up
protected RemoteGroupCreationOverXMPP() {

        final ProviderManager providerMgr = ProviderManager.getInstance();
        // register iq handler
        providerMgr.addIQProvider("query", GroupCreate.NAMESPACE, new GroupCreate.Provider());
        providerMgr.addIQProvider("query", GroupDelete.NAMESPACE, new GroupDelete.Provider());

        providerMgr.addIQProvider("query", AddUserToGroup.NAMESPACE, new AddUserToGroup.Provider());
        providerMgr.addIQProvider("query", RemoveUserFromGroup.NAMESPACE, new RemoveUserFromGroup.Provider());
    }
 
Example 2
Source File: RemoteAccountCreationOverXMPP.java    From olat with Apache License 2.0 5 votes vote down vote up
protected RemoteAccountCreationOverXMPP() {
    final ProviderManager providerMgr = ProviderManager.getInstance();
    // register iq handlers
    providerMgr.addIQProvider("query", UserCreate.NAMESPACE, new UserCreate.Provider());
    providerMgr.addIQProvider("query", UserDelete.NAMESPACE, new UserDelete.Provider());
    providerMgr.addIQProvider("query", UserCheck.NAMESPACE, new UserCheck.Provider());

}
 
Example 3
Source File: RemoteGroupCreationOverXMPP.java    From olat with Apache License 2.0 5 votes vote down vote up
protected RemoteGroupCreationOverXMPP() {

        final ProviderManager providerMgr = ProviderManager.getInstance();
        // register iq handler
        providerMgr.addIQProvider("query", GroupCreate.NAMESPACE, new GroupCreate.Provider());
        providerMgr.addIQProvider("query", GroupDelete.NAMESPACE, new GroupDelete.Provider());

        providerMgr.addIQProvider("query", AddUserToGroup.NAMESPACE, new AddUserToGroup.Provider());
        providerMgr.addIQProvider("query", RemoveUserFromGroup.NAMESPACE, new RemoveUserFromGroup.Provider());
    }
 
Example 4
Source File: RemoteAccountCreationOverXMPP.java    From olat with Apache License 2.0 5 votes vote down vote up
protected RemoteAccountCreationOverXMPP() {
    final ProviderManager providerMgr = ProviderManager.getInstance();
    // register iq handlers
    providerMgr.addIQProvider("query", UserCreate.NAMESPACE, new UserCreate.Provider());
    providerMgr.addIQProvider("query", UserDelete.NAMESPACE, new UserDelete.Provider());
    providerMgr.addIQProvider("query", UserCheck.NAMESPACE, new UserCheck.Provider());

}
 
Example 5
Source File: XStreamExtensionProvider.java    From saros with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new XStreamExtensionProvider using the given element name as the XML root element with
 * the given namespace. The Provider is able to understand the given classes, which should be
 * annotated using XStream annotations.
 *
 * <p><b>Important</b>: use valid XML element names and namespaces or the receiving side will be
 * unable to decode the extension !
 */
public XStreamExtensionProvider(String namespace, String elementName, Class<?>... classes) {

  if (namespace == null) throw new NullPointerException("namespace is null");

  ClassLoader classLoader = currentClassloader;

  this.elementName = elementName;
  this.namespace = namespace;

  xstream = XStreamFactory.getSecureXStream();

  if (classLoader != null) xstream.setClassLoader(classLoader);
  else xstream.setClassLoader(getClass().getClassLoader());

  xstream.registerConverter(BooleanConverter.BINARY);
  xstream.registerConverter(new UrlEncodingStringConverter());
  xstream.processAnnotations(XStreamPacketExtension.class);
  xstream.processAnnotations(classes);
  xstream.alias(elementName, XStreamPacketExtension.class);

  ProviderManager providerManager = ProviderManager.getInstance();
  providerManager.addExtensionProvider(getElementName(), getNamespace(), this);
  providerManager.addIQProvider(getElementName(), getNamespace(), this);

  // TODO Validate that elementName is a valid XML identifier

  replaceables = new HashMap<Class<? extends Converter>, ReplaceableConverter>();
  replaceableSingles =
      new HashMap<Class<? extends SingleValueConverter>, ReplaceableSingleValueConverter>();
}
 
Example 6
Source File: RemoteSessionCountOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
RemoteSessionCountOverXMPP() {
    // register IQ handler
    final ProviderManager providerMgr = ProviderManager.getInstance();
    providerMgr.addIQProvider("query", SessionCount.NAMESPACE, new SessionCount.Provider());

}
 
Example 7
Source File: RemoteSessionsOnIMServerOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
protected RemoteSessionsOnIMServerOverXMPP(final ImPrefsManager imPrefsManager) {
    this.imPrefsManager = imPrefsManager;
    final ProviderManager providerMgr = ProviderManager.getInstance();
    // register iq handler
    providerMgr.addIQProvider("query", SessionItems.NAMESPACE, new SessionItems.Provider());
}
 
Example 8
Source File: RemotePluginVersionOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
RemotePluginVersionOverXMPP() {
    // register IQ handler
    final ProviderManager providerMgr = ProviderManager.getInstance();
    providerMgr.addIQProvider("query", PluginVersion.NAMESPACE, new PluginVersion.Provider());

}
 
Example 9
Source File: RemoteSessionCountOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
RemoteSessionCountOverXMPP() {
    // register IQ handler
    final ProviderManager providerMgr = ProviderManager.getInstance();
    providerMgr.addIQProvider("query", SessionCount.NAMESPACE, new SessionCount.Provider());

}
 
Example 10
Source File: RemoteSessionsOnIMServerOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
protected RemoteSessionsOnIMServerOverXMPP(final ImPrefsManager imPrefsManager) {
    this.imPrefsManager = imPrefsManager;
    final ProviderManager providerMgr = ProviderManager.getInstance();
    // register iq handler
    providerMgr.addIQProvider("query", SessionItems.NAMESPACE, new SessionItems.Provider());
}
 
Example 11
Source File: RemotePluginVersionOverXMPP.java    From olat with Apache License 2.0 4 votes vote down vote up
RemotePluginVersionOverXMPP() {
    // register IQ handler
    final ProviderManager providerMgr = ProviderManager.getInstance();
    providerMgr.addIQProvider("query", PluginVersion.NAMESPACE, new PluginVersion.Provider());

}