| org.xmpp.component.ComponentManager
All known Subclasses: org.jivesoftware.openfire.component.InternalComponentManager,
ComponentManager | public interface ComponentManager (Code) | | Manages components.
See Also: Component author: Matt Tucker |
Method Summary | |
public void | addComponent(String subdomain, Component component) Adds a component. | public Log | getLog() Returns a Log instance, which can be used by components for logging error,
warning, info, and debug messages. | public String | getProperty(String name) Returns a property value specified by name. | public String | getServerName() Returns the domain of the XMPP server. | public boolean | isExternalMode() Returns true if components managed by this component manager are external
components connected to the server over a network connection. | public IQ | query(Component component, IQ packet, int timeout) Sends an IQ packet to the XMPP server and waits to get an IQ of type result or error.
The "from" value of the packet must not be null. | public void | query(Component component, IQ packet, IQResultListener listener) Sends an IQ packet to the server and returns immediately. | public void | removeComponent(String subdomain) Removes a component. | public void | sendPacket(Component component, Packet packet) Sends a packet to the XMPP server. | public void | setProperty(String name, String value) Sets a property value. |
addComponent | public void addComponent(String subdomain, Component component) throws ComponentException(Code) | | Adds a component. The
Component.initialize(org.xmpp.packet.JIDComponentManager) method will be called on the component. The subdomain specifies the address of
the component on a server. For example, if the subdomain is "test" and the XMPP
server is at "example.com", then the component's address would be "test.example.com".
Parameters: subdomain - the subdomain of the component's address. Parameters: component - the component. |
getLog | public Log getLog()(Code) | | Returns a Log instance, which can be used by components for logging error,
warning, info, and debug messages.
a Log instance. |
getProperty | public String getProperty(String name)(Code) | | Returns a property value specified by name. Properties can be used by
components to store configuration data. It is recommended that each
component qualify property names to prevent overlap. For example a
component that broadcasts messages to groups of users, might prepend
all property names it uses with "broadcast.".
Parameters: name - the property name. the property value. |
getServerName | public String getServerName()(Code) | | Returns the domain of the XMPP server. The domain name may be the IP address or the host
name.
the domain of the XMPP server. |
isExternalMode | public boolean isExternalMode()(Code) | | Returns true if components managed by this component manager are external
components connected to the server over a network connection. Otherwise,
the components are internal to the server.
true if the managed components are external components. |
query | public IQ query(Component component, IQ packet, int timeout) throws ComponentException(Code) | | Sends an IQ packet to the XMPP server and waits to get an IQ of type result or error.
The "from" value of the packet must not be null. An IllegalArgumentException
will be thrown when the "from" value is null.
If no answer is received from the server before the specified timeout then an IQ
of type error will be returned.
Components are trusted by the server and may use any value in from address. Usually
the from address uses the component's address as the domain but this is not required.
Parameters: component - the component sending the packet. Parameters: packet - the IQ packet to send. Parameters: timeout - the number of milliseconds to wait before returning an IQ error. the answer sent by the server. The answer could be an IQ of type result orerror. |
query | public void query(Component component, IQ packet, IQResultListener listener) throws ComponentException(Code) | | Sends an IQ packet to the server and returns immediately. The specified IQResultListener
will be invoked when an answer is received.
Parameters: component - the component sending the packet. Parameters: packet - the IQ packet to send. Parameters: listener - the listener that will be invoked when an answer is received. |
removeComponent | public void removeComponent(String subdomain) throws ComponentException(Code) | | Removes a component. The
Component.shutdown method will be called on the
component.
Parameters: subdomain - the subdomain of the component's address. |
sendPacket | public void sendPacket(Component component, Packet packet) throws ComponentException(Code) | | Sends a packet to the XMPP server. The "from" value of the packet must not be null.
An IllegalArgumentException will be thrown when the "from" value is null.
Components are trusted by the server and may use any value in from address. Usually
the from address uses the component's address as the domain but this is not required.
Parameters: component - the component sending the packet. Parameters: packet - the packet to send. |
setProperty | public void setProperty(String name, String value)(Code) | | Sets a property value. Properties can be used by components to
store configuration data. It is recommended that each component
qualify property names to prevent overlap. For example a component
that broadcasts messages to groups of users, might prepend all
property names it uses with "broadcast.".
Parameters: name - the property name. Parameters: value - the property value. |
|
|