public class ExternalComponentManager extends Object implements org.xmpp.component.ComponentManager
| Constructor and Description |
|---|
ExternalComponentManager(String host)
Constructs a new ExternalComponentManager that will make connections to
the specified XMPP server on the default port (5222).
|
ExternalComponentManager(String host,
int port)
Constructs a new ExternalComponentManager that will make connections to
the specified XMPP server on the given port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(String subdomain,
org.xmpp.component.Component component) |
void |
addComponent(String subdomain,
org.xmpp.component.Component component,
Integer port) |
int |
getConnectTimeout()
Returns the timeout (in milliseconds) to use when trying to connect to
the server.
|
org.apache.log4j.Logger |
getLog() |
String |
getProperty(String name) |
String |
getSecretKey(String subdomain)
Returns the secret key for a sub-domain.
|
String |
getServerName()
Returns the domain of the XMPP server where we are connected to or
null if this value was never configured.
|
boolean |
isExternalMode() |
boolean |
isMultipleAllowed(String subdomain)
Returns if we want components to be able to connect multiple times to the
same JID.
|
void |
query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
IQResultListener listener) |
void |
query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
org.xmpp.component.IQResultListener listener) |
org.xmpp.packet.IQ |
query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
long timeout) |
void |
removeComponent(String subdomain) |
void |
sendPacket(org.xmpp.component.Component component,
org.xmpp.packet.Packet packet) |
void |
setConnectTimeout(int connectTimeout)
Sets the timeout (in milliseconds) to use when trying to connect to the
server.
|
void |
setDefaultSecretKey(String secretKey)
Sets the default secret key, which will be used when connecting if a
specific secret key for the component hasn't been sent.
|
void |
setMultipleAllowed(String subdomain,
boolean allowMultiple)
Sets whether we will tell the XMPP server that we want multiple
components to be able to connect to the same JID.
|
void |
setProperty(String name,
String value) |
void |
setSecretKey(String subdomain,
String secretKey)
Sets a secret key for a sub-domain, for future use by a component
connecting to the server.
|
void |
setServerName(String domain)
Sets the domain of the XMPP server.
|
public ExternalComponentManager(String host)
host - the IP address or name of the XMPP server to connect to (e.g.
"example.com").public ExternalComponentManager(String host, int port)
host - the IP address or name of the XMPP server to connect to (e.g.
"example.com").port - the port to connect on.public void setSecretKey(String subdomain, String secretKey)
subdomain - the sub-domain.secretKey - the secret keypublic String getSecretKey(String subdomain)
subdomain - the subdomain to return its secret key.public void setDefaultSecretKey(String secretKey)
secretKey - the default secret key.public boolean isMultipleAllowed(String subdomain)
subdomain - the sub-domain.public void setMultipleAllowed(String subdomain, boolean allowMultiple)
subdomain - the sub-domain.allowMultiple - Set to true if we want to allow multiple connections to same
JID.public void addComponent(String subdomain, org.xmpp.component.Component component) throws org.xmpp.component.ComponentException
addComponent in interface org.xmpp.component.ComponentManagerorg.xmpp.component.ComponentExceptionpublic void addComponent(String subdomain, org.xmpp.component.Component component, Integer port) throws org.xmpp.component.ComponentException
org.xmpp.component.ComponentExceptionpublic void removeComponent(String subdomain) throws org.xmpp.component.ComponentException
removeComponent in interface org.xmpp.component.ComponentManagerorg.xmpp.component.ComponentExceptionpublic void sendPacket(org.xmpp.component.Component component,
org.xmpp.packet.Packet packet)
sendPacket in interface org.xmpp.component.ComponentManagerpublic org.xmpp.packet.IQ query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
long timeout)
throws org.xmpp.component.ComponentException
query in interface org.xmpp.component.ComponentManagerorg.xmpp.component.ComponentExceptionpublic void query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
IQResultListener listener)
throws org.xmpp.component.ComponentException
org.xmpp.component.ComponentExceptionpublic void setServerName(String domain)
domain - the domain of the XMPP server.public String getServerName()
getServerName in interface org.xmpp.component.ComponentManagerpublic int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
connectTimeout - the timeout, in milliseconds, to use when trying to connect to
the server.public boolean isExternalMode()
isExternalMode in interface org.xmpp.component.ComponentManagerpublic org.apache.log4j.Logger getLog()
public void query(org.xmpp.component.Component component,
org.xmpp.packet.IQ packet,
org.xmpp.component.IQResultListener listener)
throws org.xmpp.component.ComponentException
query in interface org.xmpp.component.ComponentManagerorg.xmpp.component.ComponentExceptionpublic String getProperty(String name)
getProperty in interface org.xmpp.component.ComponentManagerCopyright © 2014. All Rights Reserved.