/** * 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 DiscoverInfo the discover info packet to check. * @return true if the server supports publishing of items. */ public static boolean canPublishItems(DiscoverInfo info) { return info.containsFeature("http://jabber.org/protocol/disco#publish"); }
/** * Checks if this gateway supports In-Band registration * @return true if In-Band registration is supported * @throws XMPPException */ public boolean canRegister() throws XMPPException{ if(info==null){ discoverInfo(); } return info.containsFeature("jabber:iq:register"); }
/** * 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"); }
/** * 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 Entity Caps are supported by a given JID * * @param jid * @return */ public boolean areEntityCapsSupported(String jid) { if (jid == null) return false; try { DiscoverInfo result = sdm.discoverInfo(jid); return result.containsFeature(NAMESPACE); } catch (XMPPException e) { return false; } }
/** * 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 true if XMPP Ping is supported by a given JID * * @param jid * @return */ public boolean isPingSupported(String jid) { try { DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(jid); return result.containsFeature(NAMESPACE); } catch (XMPPException e) { return false; } }
/** * Returns true if Delivery Receipts are supported by a given JID * * @param jid * @return true if supported */ public boolean isSupported(String jid) { try { DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(jid); return result.containsFeature(DeliveryReceipt.NAMESPACE); } catch (XMPPException e) { return false; } }
/** * 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); }
/** * Returns true if XMPP Carbons are supported by the server. * * @return true if supported */ public boolean isSupportedByServer() { try { DiscoverInfo result = ServiceDiscoveryManager .getInstanceFor(connection).discoverInfo(connection.getServiceName()); return result.containsFeature(Carbon.NAMESPACE); } catch (XMPPException e) { return false; } }
/** * Returns true if the specified user supports the Multi-User Chat protocol. * * @param connection the connection to use to perform the service discovery. * @param user the user to check. A fully qualified xmpp ID, e.g. jdoe@example.com. * @return a boolean indicating whether the specified user supports the MUC protocol. */ public static boolean isServiceEnabled(Connection connection, String user) { try { DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(user); return result.containsFeature(discoNamespace); } catch (XMPPException e) { e.printStackTrace(); return false; } }
/** * The workgroup service may be configured to send email. This queries the Workgroup Service * to see if the email service has been configured and is available. * * @return true if the email service is available, otherwise return false. */ public boolean isEmailAvailable() { ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection); try { String workgroupService = StringUtils.parseServer(workgroupJID); DiscoverInfo infoResult = discoManager.discoverInfo(workgroupService); return infoResult.containsFeature("jive:email:provider"); } catch (XMPPException e) { return false; } }
/** * Returns true if the specified user supports the Multi-User Chat protocol. * * @param connection the connection to use to perform the service discovery. * @param user the user to check. A fully qualified xmpp ID, e.g. jdoe@example.com. * @return a boolean indicating whether the specified user supports the MUC protocol. */ public static boolean isServiceEnabled(Connection connection, String user) { try { DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(user); return result.containsFeature(discoNamespace); } catch (XMPPException e) { e.printStackTrace(); return false; } }
/** * The workgroup service may be configured to send email. This queries the Workgroup Service * to see if the email service has been configured and is available. * * @return true if the email service is available, otherwise return false. */ public boolean isEmailAvailable() { ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection); try { String workgroupService = StringUtils.parseServer(workgroupJID); DiscoverInfo infoResult = discoManager.discoverInfo(workgroupService); return infoResult.containsFeature("jive:email:provider"); } catch (XMPPException e) { return false; } }