|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ComponentManager
Manages components.
Component
Method Summary | |
---|---|
void |
addComponent(java.lang.String subdomain,
Component component)
Adds a component. |
java.lang.String |
getProperty(java.lang.String name)
Returns a property value specified by name. |
java.lang.String |
getServerName()
Returns the domain of the XMPP server. |
boolean |
isExternalMode()
Returns true if components managed by this component manager are external components connected to the server over a network connection. |
void |
query(Component component,
IQ packet,
IQResultListener listener)
Sends an IQ packet to the server and returns immediately. |
IQ |
query(Component component,
IQ packet,
long timeout)
Sends an IQ packet to the XMPP server and waits to get an IQ of type result or error. |
void |
removeComponent(java.lang.String subdomain)
Removes a component. |
void |
sendPacket(Component component,
Packet packet)
Sends a packet to the XMPP server. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property value. |
Method Detail |
---|
void addComponent(java.lang.String subdomain, Component component) throws ComponentException
Component.initialize(org.xmpp.packet.JID, ComponentManager)
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".
subdomain
- the subdomain of the component's address.component
- the component.
ComponentException
- if the component connection is lost and the component cannot be added.void removeComponent(java.lang.String subdomain) throws ComponentException
Component.shutdown()
method will be called on the
component.
subdomain
- the subdomain of the component's address.
ComponentException
- if the component connection is lost and the component cannot be removed.void sendPacket(Component component, Packet packet) throws ComponentException
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.
component
- the component sending the packet.packet
- the packet to send.
ComponentException
- if the component connection is lost or unavialble during the time of sending and
recieving packets.IQ query(Component component, IQ packet, long timeout) throws ComponentException
If no answer is received from the server before the specified timeout then null 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.
component
- the component sending the packet.packet
- the IQ packet to send.timeout
- the number of milliseconds to wait before returning an IQ error.
ComponentException
- if the component connection is lost or unavialble during the time of sending and
recieving packets.void query(Component component, IQ packet, IQResultListener listener) throws ComponentException
component
- the component sending the packet.packet
- the IQ packet to send.listener
- the listener that will be invoked when an answer is received.
ComponentException
- if the component connection is lost or unavialble during the time of sending and
recieving packets.java.lang.String getProperty(java.lang.String name)
name
- the property name.
void setProperty(java.lang.String name, java.lang.String value)
name
- the property name.value
- the property value.java.lang.String getServerName()
boolean isExternalMode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |