private CarbonManager(Connection connection) { ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); sdm.addFeature(Carbon.NAMESPACE); this.connection = connection; instances.put(connection, this); }
public void enableEntityCaps() { // Add Entity Capabilities (XEP-0115) feature node. sdm.addFeature(NAMESPACE); updateLocalEntityCaps(); entityCapsEnabled = true; }
/** * Adds the SOCKS5 Bytestream feature to the service discovery. */ private void enableService() { ServiceDiscoveryManager manager = ServiceDiscoveryManager.getInstanceFor(this.connection); if (!manager.includesFeature(NAMESPACE)) { manager.addFeature(NAMESPACE); } }
/** * Adds the SOCKS5 Bytestream feature to the service discovery. */ private void enableService() { ServiceDiscoveryManager manager = ServiceDiscoveryManager.getInstanceFor(this.connection); if (!manager.includesFeature(NAMESPACE)) { manager.addFeature(NAMESPACE); } }
/** * Adds the SOCKS5 Bytestream feature to the service discovery. */ private void enableService() { ServiceDiscoveryManager manager = ServiceDiscoveryManager.getInstanceFor(this.connection); if (!manager.includesFeature(NAMESPACE)) { manager.addFeature(NAMESPACE); } }
private PingManager(Connection connection) { ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); sdm.addFeature(NAMESPACE); this.connection = connection; init(); }
private DeliveryReceiptManager(Connection connection) { ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); sdm.addFeature(DeliveryReceipt.NAMESPACE); this.connection = connection; instances.put(connection, this); // register listener for delivery receipts and requests connection.addPacketListener(this, new PacketExtensionFilter(DeliveryReceipt.NAMESPACE)); }
/** * Enable the Jabber services related to file transfer on the particular * connection. * * @param connection The connection on which to enable or disable the services. * @param isEnabled True to enable, false to disable. */ public static void setServiceEnabled(final XMPPConnection connection, final boolean isEnabled) { ServiceDiscoveryManager manager = ServiceDiscoveryManager .getInstanceFor(connection); for (int i = 0; i < NAMESPACE.length; i++) { if (isEnabled) { manager.addFeature(NAMESPACE[i]); } else { manager.removeFeature(NAMESPACE[i]); } } }
/** * Enable the Jabber services related to file transfer on the particular * connection. * * @param connection The connection on which to enable or disable the services. * @param isEnabled True to enable, false to disable. */ public static void setServiceEnabled(final Connection connection, final boolean isEnabled) { ServiceDiscoveryManager manager = ServiceDiscoveryManager .getInstanceFor(connection); List<String> namespaces = new ArrayList<String>(); namespaces.addAll(Arrays.asList(NAMESPACE)); namespaces.add(InBandBytestreamManager.NAMESPACE); if (!IBB_ONLY) { namespaces.add(Socks5BytestreamManager.NAMESPACE); } for (String namespace : namespaces) { if (isEnabled) { if (!manager.includesFeature(namespace)) { manager.addFeature(namespace); } } else { manager.removeFeature(namespace); } } }
public void connectionEstablished(final XMPPConnection connection) { // Set on every established connection that this client supports the Multi-User // Chat protocol. This information will be used when another client tries to // discover whether this client supports MUC or not. ServiceDiscoveryManager.getInstanceFor(connection).addFeature(discoNamespace); // Set the NodeInformationProvider that will provide information about the // joined rooms whenever a disco request is received ServiceDiscoveryManager.getInstanceFor(connection).setNodeInformationProvider( discoNode, new NodeInformationProvider() { public Iterator getNodeItems() { ArrayList answer = new ArrayList(); Iterator rooms=MultiUserChat.getJoinedRooms(connection); while (rooms.hasNext()) { answer.add(new DiscoverItems.Item((String)rooms.next())); } return answer.iterator(); } }); } });
public void connectionCreated(final Connection connection) { // Set on every established connection that this client supports the Multi-User // Chat protocol. This information will be used when another client tries to // discover whether this client supports MUC or not. ServiceDiscoveryManager.getInstanceFor(connection).addFeature(discoNamespace); // Set the NodeInformationProvider that will provide information about the // joined rooms whenever a disco request is received ServiceDiscoveryManager.getInstanceFor(connection).setNodeInformationProvider( discoNode, new NodeInformationProvider() { public List<DiscoverItems.Item> getNodeItems() { List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>(); Iterator<String> rooms=MultiUserChat.getJoinedRooms(connection); while (rooms.hasNext()) { answer.add(new DiscoverItems.Item(rooms.next())); } return answer; } public List<String> getNodeFeatures() { return null; } public List<DiscoverInfo.Identity> getNodeIdentities() { return null; } }); } });
public void connectionCreated(final Connection connection) { // Set on every established connection that this client supports the Multi-User // Chat protocol. This information will be used when another client tries to // discover whether this client supports MUC or not. ServiceDiscoveryManager.getInstanceFor(connection).addFeature(discoNamespace); // Set the NodeInformationProvider that will provide information about the // joined rooms whenever a disco request is received ServiceDiscoveryManager.getInstanceFor(connection).setNodeInformationProvider( discoNode, new NodeInformationProvider() { public List<DiscoverItems.Item> getNodeItems() { List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>(); Iterator<String> rooms=MultiUserChat.getJoinedRooms(connection); while (rooms.hasNext()) { answer.add(new DiscoverItems.Item(rooms.next())); } return answer; } public List<String> getNodeFeatures() { return null; } public List<DiscoverInfo.Identity> getNodeIdentities() { return null; } }); } });
/** * Enables or disables the XHTML support on a given connection.<p> * * Before starting to send XHTML messages to a user, check that the user can handle XHTML * messages. Enable the XHTML support to indicate that this client handles XHTML messages. * * @param connection the connection where the service will be enabled or disabled * @param enabled indicates if the service will be enabled or disabled */ public synchronized static void setServiceEnabled(XMPPConnection connection, boolean enabled) { if (isServiceEnabled(connection) == enabled) return; if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(namespace); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(namespace); } }
private void init() { connection.getChatManager().addOutgoingMessageInterceptor(outgoingInterceptor, filter); connection.getChatManager().addChatListener(incomingInterceptor); ServiceDiscoveryManager.getInstanceFor(connection) .addFeature("http://jabber.org/protocol/chatstates"); }
private void init() { connection.getChatManager().addOutgoingMessageInterceptor(outgoingInterceptor, filter); connection.getChatManager().addChatListener(incomingInterceptor); ServiceDiscoveryManager.getInstanceFor(connection) .addFeature("http://jabber.org/protocol/chatstates"); }
private void init() { connection.getChatManager().addOutgoingMessageInterceptor(outgoingInterceptor, filter); connection.getChatManager().addChatListener(incomingInterceptor); ServiceDiscoveryManager.getInstanceFor(connection) .addFeature("http://jabber.org/protocol/chatstates"); }
/** * Enables or disables the XHTML support on a given connection.<p> * * Before starting to send XHTML messages to a user, check that the user can handle XHTML * messages. Enable the XHTML support to indicate that this client handles XHTML messages. * * @param connection the connection where the service will be enabled or disabled * @param enabled indicates if the service will be enabled or disabled */ public synchronized static void setServiceEnabled(Connection connection, boolean enabled) { if (isServiceEnabled(connection) == enabled) return; if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(namespace); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(namespace); } }
/** * Enables or disables the XHTML support on a given connection.<p> * * Before starting to send XHTML messages to a user, check that the user can handle XHTML * messages. Enable the XHTML support to indicate that this client handles XHTML messages. * * @param connection the connection where the service will be enabled or disabled * @param enabled indicates if the service will be enabled or disabled */ public synchronized static void setServiceEnabled(Connection connection, boolean enabled) { if (isServiceEnabled(connection) == enabled) return; if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(namespace); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(namespace); } }
/** * Enables or disables the XHTML support on a given connection.<p> * * Before starting to send XHTML messages to a user, check that the user can handle XHTML * messages. Enable the XHTML support to indicate that this client handles XHTML messages. * * @param connection the connection where the service will be enabled or disabled * @param enabled indicates if the service will be enabled or disabled */ public synchronized static void setServiceEnabled(Connection connection, boolean enabled) { if (isServiceEnabled(connection) == enabled) return; if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(namespace); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(namespace); } }
/** * Enables or disables the Jingle support on a given connection. * <p/> * <p/> * Before starting any Jingle jmf session, check that the user can handle * it. Enable the Jingle support to indicate that this client handles Jingle * messages. * * @param connection the connection where the service will be enabled or * disabled * @param enabled indicates if the service will be enabled or disabled */ public synchronized static void setServiceEnabled(Connection connection, boolean enabled) { if (isServiceEnabled(connection) == enabled) { return; } if (enabled) { ServiceDiscoveryManager.getInstanceFor(connection).addFeature(Jingle.NAMESPACE); } else { ServiceDiscoveryManager.getInstanceFor(connection).removeFeature(Jingle.NAMESPACE); } }