|
Openfire 3.5.0.rc1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.container.BasicModule org.jivesoftware.openfire.component.InternalComponentManager
public class InternalComponentManager
Manages the registration and delegation of Components. The ComponentManager
is responsible for managing registration and delegation of Components
,
as well as offering a facade around basic server functionallity such as sending and
receiving of packets.
This component manager will be an internal service whose JID will be component.[domain]. So the component manager will be able to send packets to other internal or external components and also receive packets from other components or even from trusted clients (e.g. ad-hoc commands).
Constructor Summary | |
---|---|
InternalComponentManager()
|
Method Summary | |
---|---|
void |
addComponent(String subdomain,
Component component)
Adds a component. |
void |
addListener(ComponentEventListener listener)
Adds a new listener that will be notified of component events. |
void |
addPresenceRequest(JID prober,
JID probee)
Registers Probeers who have not yet been serviced. |
JID |
getAddress()
Returns the XMPP address. |
String |
getHomeDirectory()
|
static InternalComponentManager |
getInstance()
|
Log |
getLog()
Returns a Log instance, which can be used by components for logging error, warning, info, and debug messages. |
String |
getProperty(String name)
Returns a property value specified by name. |
String |
getServerName()
Returns the domain of the XMPP server. |
boolean |
hasComponent(JID componentJID)
Returns true if a component is associated to the specified address. |
void |
initialize(XMPPServer server)
Initializes the basic module. |
boolean |
isExternalMode()
Returns true if components managed by this component manager are external components connected to the server over a network connection. |
void |
process(Packet packet)
Processes packets that were sent to this service. |
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. |
void |
query(Component component,
IQ packet,
IQResultListener listener)
Sends an IQ packet to the server and returns immediately. |
void |
removeComponent(String subdomain)
Removes a component. |
void |
removeComponent(String subdomain,
Component component)
Removes a given component. |
void |
removeListener(ComponentEventListener listener)
Removes the specified listener from the listeners being notified of component events. |
void |
sendPacket(Component component,
Packet packet)
Sends a packet to the XMPP server. |
void |
setProperty(String name,
String value)
Sets a property value. |
void |
start()
Starts the basic module. |
void |
stop()
Stops the basic module. |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InternalComponentManager()
Method Detail |
---|
public static InternalComponentManager getInstance()
public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void start()
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
public void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public void addComponent(String subdomain, Component component) throws ComponentException
ComponentManager
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".
addComponent
in interface ComponentManager
subdomain
- the subdomain of the component's address.component
- the component.
ComponentException
public void removeComponent(String subdomain)
Component.shutdown()
method will be called on the
component. Note that if the component was an external component that was connected
several times then all its connections will be terminated.
removeComponent
in interface ComponentManager
subdomain
- the subdomain of the component's address.public void removeComponent(String subdomain, Component component)
removeComponent(String)
this method will just
remove a single component instead of all components associated to the subdomain. External
components may connect several times and register for the same subdomain. This method
just removes a singled connection not all of them.
subdomain
- the subdomain of the component's address.component
- specific component to remove.public void sendPacket(Component component, Packet packet)
ComponentManager
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.
sendPacket
in interface ComponentManager
component
- the component sending the packet.packet
- the packet to send.public IQ query(Component component, IQ packet, int timeout) throws ComponentException
ComponentManager
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.
query
in interface ComponentManager
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
public void query(Component component, IQ packet, IQResultListener listener) throws ComponentException
ComponentManager
query
in interface ComponentManager
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
public void addListener(ComponentEventListener listener)
listener
- the new listener to notify of component events.public void removeListener(ComponentEventListener listener)
listener
- the listener to remove.public String getProperty(String name)
ComponentManager
getProperty
in interface ComponentManager
name
- the property name.
public void setProperty(String name, String value)
ComponentManager
setProperty
in interface ComponentManager
name
- the property name.value
- the property value.public String getServerName()
ComponentManager
getServerName
in interface ComponentManager
public String getHomeDirectory()
public boolean isExternalMode()
ComponentManager
isExternalMode
in interface ComponentManager
public Log getLog()
ComponentManager
getLog
in interface ComponentManager
public boolean hasComponent(JID componentJID)
componentJID
- the address of the component. This is the complete domain.
public void addPresenceRequest(JID prober, JID probee)
prober
- the jid probing.probee
- the presence being probed.public JID getAddress()
RoutableChannelHandler
getAddress
in interface RoutableChannelHandler
public void process(Packet packet) throws PacketException
process
in interface ChannelHandler
packet
- the packet to process.
PacketException
- thrown if the packet is malformed (results in the sender's
session being shutdown).
|
Openfire 3.5.0.rc1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |