@Override public void connectionCreated(XMPPConnection connection) { getInstanceFor(connection); } });
/** * Create a new SpoilerManager and add Spoiler to disco features. * * @param connection xmpp connection */ private SpoilerManager(XMPPConnection connection) { super(connection); serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); }
public EntityCapsTest(SmackIntegrationTestEnvironment environment) { super(environment); ecmTwo = EntityCapsManager.getInstanceFor(environment.conTwo); sdmOne = ServiceDiscoveryManager.getInstanceFor(environment.conOne); sdmTwo = ServiceDiscoveryManager.getInstanceFor(environment.conTwo); }
@Override public void connectionCreated(XMPPConnection connection) { ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); serviceDiscoveryManager.addFeature(ValidateElement.NAMESPACE); } });
/** * Returns true if the XHTML support is enabled for the given connection. * * @param connection the connection to look for XHTML support * @return a boolean indicating if the XHTML support is enabled for the given connection */ public static boolean isServiceEnabled(XMPPConnection connection) { return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(XHTMLExtension.NAMESPACE); }
/** * Returns true if the Jingle support is enabled for the given connection. * * @param connection the connection to look for Jingle support * @return a boolean indicating if the Jingle support is enabled for the * given connection */ public static boolean isServiceEnabled(XMPPConnection connection) { return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(Jingle.NAMESPACE); }
@Override public void connectionCreated(XMPPConnection connection) { ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); serviceDiscoveryManager.addFeature(DataLayout.NAMESPACE); } });
private XDataManager(XMPPConnection connection) { super(connection); ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); serviceDiscoveryManager.addFeature(NAMESPACE); }
public boolean isSupported(Jid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(jid, Version.NAMESPACE); }
public synchronized void disable() { if (!enabled) return; ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection()); sdm.removeFeature(Time.NAMESPACE); enabled = false; }
/** * Returns true if XMPP Carbons are supported by the server. * * @return true if supported * @throws NotConnectedException * @throws XMPPErrorException * @throws NoResponseException * @throws InterruptedException */ public boolean isSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(CarbonExtension.NAMESPACE); }
/** * Add the OX:IM namespace as a feature to our disco features. */ public void announceSupportForOxInstantMessaging() { ServiceDiscoveryManager.getInstanceFor(connection()) .addFeature(NAMESPACE_0); }
/** * Return true, if we automatically append origin-id elements to outgoing stanzas. * * @return true if functionality is enabled, otherwise false. */ public synchronized boolean isEnabled() { ServiceDiscoveryManager disco = ServiceDiscoveryManager.getInstanceFor(connection()); return disco.includesFeature(NAMESPACE); } }
public synchronized void enable() { if (enabled) return; ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection()); sdm.addFeature(Time.NAMESPACE); enabled = true; }
/** * Returns true if the AMP support is enabled for the given connection. * * @param connection the connection to look for AMP support * @return a boolean indicating if the AMP support is enabled for the given connection */ public static boolean isServiceEnabled(XMPPConnection connection) { connection.getXMPPServiceDomain(); return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(AMPExtension.NAMESPACE); }
/** * Constructor of the HashManager. * * @param connection connection */ private HashManager(XMPPConnection connection) { super(connection); ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); sdm.addFeature(NAMESPACE.V2.toString()); addAlgorithmsToFeatures(RECOMMENDED); }
/** * Announce support for the given list of algorithms. * @param algorithms */ public void addAlgorithmsToFeatures(List<ALGORITHM> algorithms) { ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection()); for (ALGORITHM algo : algorithms) { sdm.addFeature(asFeature(algo)); } }
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { XMPPConnection connection = connection(); ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); BareJid localBareJid = connection.getUser().asBareJid(); return serviceDiscoveryManager.supportsFeatures(localBareJid, REQUIRED_FEATURES); } }
/** * Stop appending origin-id elements to outgoing stanzas and remove the feature from disco. */ public synchronized void disable() { ServiceDiscoveryManager.getInstanceFor(connection()).removeFeature(NAMESPACE); connection().removeStanzaInterceptor(stanzaListener); }
/** * Start appending origin-id elements to outgoing stanzas and add the feature to disco. */ public synchronized void enable() { ServiceDiscoveryManager.getInstanceFor(connection()).addFeature(NAMESPACE); StanzaFilter filter = new AndFilter(OUTGOING_FILTER, new NotFilter(OUTGOING_FILTER)); connection().addStanzaInterceptor(stanzaListener, filter); }