/** * Returns the discovered information of a given XMPP entity addressed by its JID. * * @param entityID the address of the XMPP entity. * @return the discovered information. * @throws XMPPException if the operation failed for some reason. */ public DiscoverInfo discoverInfo(String entityID) throws XMPPException { return discoverInfo(entityID, null); }
/** * Returns the discovered information of a given XMPP entity addressed by its JID. * * @param entityID the address of the XMPP entity. * @return the discovered information. * @throws XMPPException if the operation failed for some reason. */ public DiscoverInfo discoverInfo(String entityID) throws XMPPException { return discoverInfo(entityID, null); }
/** * Returns the discovered information of a given XMPP entity addressed by its JID. * * @param entityID the address of the XMPP entity. * @return the discovered information. * @throws XMPPException if the operation failed for some reason. */ public DiscoverInfo discoverInfo(String entityID) throws XMPPException { return discoverInfo(entityID, null); }
/** * Gets the supported features of the servers pubsub implementation * as a standard {@link DiscoverInfo} instance. * * @return The supported features * * @throws XMPPException */ public DiscoverInfo getSupportedFeatures() throws XMPPException { ServiceDiscoveryManager mgr = ServiceDiscoveryManager.getInstanceFor(con); return mgr.discoverInfo(to); }
/** * Gets the supported features of the servers pubsub implementation * as a standard {@link DiscoverInfo} instance. * * @return The supported features * * @throws XMPPException */ public DiscoverInfo getSupportedFeatures() throws XMPPException { ServiceDiscoveryManager mgr = ServiceDiscoveryManager.getInstanceFor(con); return mgr.discoverInfo(to); }
/** * Returns true if the server supports publishing of items. A client may wish to publish items * to the server so that the server can provide items associated to the client. These items will * be returned by the server whenever the server receives a disco request targeted to the bare * address of the client (i.e. user@host.com). * * @param entityID the address of the XMPP entity. * @return true if the server supports publishing of items. * @throws XMPPException if the operation failed for some reason. */ public boolean canPublishItems(String entityID) throws XMPPException { DiscoverInfo info = discoverInfo(entityID); return info.containsFeature("http://jabber.org/protocol/disco#publish"); }
/** * Returns true if the server supports publishing of items. A client may wish to publish items * to the server so that the server can provide items associated to the client. These items will * be returned by the server whenever the server receives a disco request targeted to the bare * address of the client (i.e. user@host.com). * * @param entityID the address of the XMPP entity. * @return true if the server supports publishing of items. * @throws XMPPException if the operation failed for some reason. */ public boolean canPublishItems(String entityID) throws XMPPException { DiscoverInfo info = discoverInfo(entityID); return info.containsFeature("http://jabber.org/protocol/disco#publish"); }
/** * Gets the supported features of the servers pubsub implementation * as a standard {@link DiscoverInfo} instance. * * @return The supported features * * @throws XMPPException */ public DiscoverInfo getSupportedFeatures() throws XMPPException { ServiceDiscoveryManager mgr = ServiceDiscoveryManager.getInstanceFor(con); return mgr.discoverInfo(to); }
private void discoverInfo() throws XMPPException{ info = sdManager.discoverInfo(entityJID); Iterator<Identity> iterator = info.getIdentities(); while(iterator.hasNext()){ Identity temp = iterator.next(); if(temp.getCategory().equalsIgnoreCase("gateway")){ this.identity = temp; break; } } }
/** * Returns true if the server supports Flexible Offline Message Retrieval. When the server * supports Flexible Offline Message Retrieval it is possible to get the header of the offline * messages, get specific messages, delete specific messages, etc. * * @return a boolean indicating if the server supports Flexible Offline Message Retrieval. * @throws XMPPException If the user is not allowed to make this request. */ public boolean supportsFlexibleRetrieval() throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null); return info.containsFeature(namespace); }
/** * Returns true if the server supports Flexible Offline Message Retrieval. When the server * supports Flexible Offline Message Retrieval it is possible to get the header of the offline * messages, get specific messages, delete specific messages, etc. * * @return a boolean indicating if the server supports Flexible Offline Message Retrieval. * @throws XMPPException If the user is not allowed to make this request. */ public boolean supportsFlexibleRetrieval() throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null); return info.containsFeature(namespace); }
/** * Returns <code>true</code> if the given target JID supports feature SOCKS5 Bytestream. * * @param targetJID the target JID * @return <code>true</code> if the given target JID supports feature SOCKS5 Bytestream * otherwise <code>false</code> * @throws XMPPException if there was an error querying target for supported features */ private boolean supportsSocks5(String targetJID) throws XMPPException { ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(this.connection); DiscoverInfo discoverInfo = serviceDiscoveryManager.discoverInfo(targetJID); return discoverInfo.containsFeature(NAMESPACE); }
/** * Returns true if the server supports Flexible Offline Message Retrieval. When the server * supports Flexible Offline Message Retrieval it is possible to get the header of the offline * messages, get specific messages, delete specific messages, etc. * * @return a boolean indicating if the server supports Flexible Offline Message Retrieval. * @throws XMPPException If the user is not allowed to make this request. */ public boolean supportsFlexibleRetrieval() throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null); return info.containsFeature(namespace); }
/** * Returns <code>true</code> if the given target JID supports feature SOCKS5 Bytestream. * * @param targetJID the target JID * @return <code>true</code> if the given target JID supports feature SOCKS5 Bytestream * otherwise <code>false</code> * @throws XMPPException if there was an error querying target for supported features */ private boolean supportsSocks5(String targetJID) throws XMPPException { ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(this.connection); DiscoverInfo discoverInfo = serviceDiscoveryManager.discoverInfo(targetJID); return discoverInfo.containsFeature(NAMESPACE); }
/** * Returns <code>true</code> if the given target JID supports feature SOCKS5 Bytestream. * * @param targetJID the target JID * @return <code>true</code> if the given target JID supports feature SOCKS5 Bytestream * otherwise <code>false</code> * @throws XMPPException if there was an error querying target for supported features */ private boolean supportsSocks5(String targetJID) throws XMPPException { ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(this.connection); DiscoverInfo discoverInfo = serviceDiscoveryManager.discoverInfo(targetJID); return discoverInfo.containsFeature(NAMESPACE); }
/** * Returns the discovered information of a given room without actually having to join the room. * The server will provide information only for rooms that are public. * * @param connection the XMPP connection to use for discovering information about the room. * @param room the name of the room in the form "roomName@service" of which we want to discover * its information. * @return the discovered information of a given room without actually having to join the room. * @throws XMPPException if an error occured while trying to discover information of a room. */ public static RoomInfo getRoomInfo(Connection connection, String room) throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(room); return new RoomInfo(info); }
/** * Returns the discovered information of a given room without actually having to join the room. * The server will provide information only for rooms that are public. * * @param connection the XMPP connection to use for discovering information about the room. * @param room the name of the room in the form "roomName@service" of which we want to discover * its information. * @return the discovered information of a given room without actually having to join the room. * @throws XMPPException if an error occured while trying to discover information of a room. */ public static RoomInfo getRoomInfo(Connection connection, String room) throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(room); return new RoomInfo(info); }
/** * Returns the discovered information of a given room without actually having to join the room. * The server will provide information only for rooms that are public. * * @param connection the XMPP connection to use for discovering information about the room. * @param room the name of the room in the form "roomName@service" of which we want to discover * its information. * @return the discovered information of a given room without actually having to join the room. * @throws XMPPException if an error occured while trying to discover information of a room. */ public static RoomInfo getRoomInfo(XMPPConnection connection, String room) throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(room); return new RoomInfo(info); }
/** * Returns the number of offline messages for the user of the connection. * * @return the number of offline messages for the user of the connection. * @throws XMPPException If the user is not allowed to make this request or the server does * not support offline message retrieval. */ public int getMessageCount() throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null, namespace); Form extendedInfo = Form.getFormFrom(info); if (extendedInfo != null) { String value = extendedInfo.getField("number_of_messages").getValues().next(); return Integer.parseInt(value); } return 0; }
/** * Returns true if the server supports Flexible Offline Message Retrieval. When the server * supports Flexible Offline Message Retrieval it is possible to get the header of the offline * messages, get specific messages, delete specific messages, etc. * * @return a boolean indicating if the server supports Flexible Offline Message Retrieval. * @throws XMPPException If the user is not allowed to make this request. */ public boolean supportsFlexibleRetrieval() throws XMPPException { DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(connection.getServiceName()); return info.containsFeature(namespace); }