Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger
Class XMPPServer

java.lang.Object
  extended by org.jivesoftware.messenger.XMPPServer

public class XMPPServer
extends Object

The main XMPP server that will load, initialize and start all the server's modules. The server is unique in the JVM and could be obtained by using the getInstance() method.

The loaded modules will be initialized and may access through the server other modules. This means that the only way for a module to locate another module is through the server. The server maintains a list of loaded modules.

After starting up all the modules the server will load any available plugin. For more information see: PluginManager.

A configuration file keeps the server configuration. This information is required for the server to work correctly. The server assumes that the configuration file is named jive-messenger.xml and is located in the conf folder. The folder that keeps the configuration file must be located under the home folder. The server will try different methods to locate the home folder.

  1. system property - The server will use the value defined in the messengerHome system property.
  2. working folder - The server will check if there is a conf folder in the working directory. This is the case when running in standalone mode.
  3. messenger_init.xml file - Attempt to load the value from messenger_init.xml which must be in the classpath

Author:
Gaston Dombiak

Constructor Summary
XMPPServer()
          Creates a server and starts it.
 
Method Summary
 JID createJID(String username, String resource)
          Creates an XMPPAddress local to this server.
 void finishSetup()
           
 AuditManager getAuditManager()
          Returns the AuditManager registered with this server.
 ConnectionManager getConnectionManager()
          Returns the ConnectionManager registered with this server.
static XMPPServer getInstance()
          Returns a singleton instance of XMPPServer.
 IQDiscoInfoHandler getIQDiscoInfoHandler()
          Returns the IQDiscoInfoHandler registered with this server.
 IQDiscoItemsHandler getIQDiscoItemsHandler()
          Returns the IQDiscoItemsHandler registered with this server.
 List<IQHandler> getIQHandlers()
          Returns a list with all the modules registered with the server that inherit from IQHandler.
 IQRegisterHandler getIQRegisterHandler()
          Returns the IQRegisterHandler registered with this server.
 IQRouter getIQRouter()
          Returns the IQRouter registered with this server.
 MessageRouter getMessageRouter()
          Returns the MessageRouter registered with this server.
 MultiUserChatServer getMultiUserChatServer()
          Returns the MultiUserChatServer registered with this server.
 OfflineMessageStore getOfflineMessageStore()
          Returns the OfflineMessageStore registered with this server.
 OfflineMessageStrategy getOfflineMessageStrategy()
          Returns the OfflineMessageStrategy registered with this server.
 PacketDeliverer getPacketDeliverer()
          Returns the PacketDeliverer registered with this server.
 PacketRouter getPacketRouter()
          Returns the PacketRouter registered with this server.
 PluginManager getPluginManager()
          Returns the PluginManager instance registered with this server.
 PresenceManager getPresenceManager()
          Returns the PresenceManager registered with this server.
 PresenceRouter getPresenceRouter()
          Returns the PresenceRouter registered with this server.
 PresenceSubscribeHandler getPresenceSubscribeHandler()
          Returns the PresenceSubscribeHandler registered with this server.
 PresenceUpdateHandler getPresenceUpdateHandler()
          Returns the PresenceUpdateHandler registered with this server.
 PrivateStorage getPrivateStorage()
          Returns the PrivateStorage registered with this server.
 RosterManager getRosterManager()
          Returns the RosterManager registered with this server.
 RoutingTable getRoutingTable()
          Returns the RoutingTable registered with this server.
 List<ServerFeaturesProvider> getServerFeaturesProviders()
          Returns a list with all the modules that provide "discoverable" features.
 XMPPServerInfo getServerInfo()
          Returns a snapshot of the server's status.
 List<ServerItemsProvider> getServerItemsProviders()
          Returns a list with all the modules that provide "discoverable" items associated with the server.
 SessionManager getSessionManager()
          Returns the SessionManager registered with this server.
 TransportHandler getTransportHandler()
          Returns the TransportHandler registered with this server.
 UserManager getUserManager()
          Returns the UserManager registered with this server.
 boolean isLocal(JID jid)
          Returns true if the given address is local to the server (managed by this server domain).
 boolean isRemote(JID jid)
          Returns true if the given address does not match the local server hostname and does not match a component service JID.
 boolean isRestartable()
           
 boolean isSetupMode()
           
 boolean isStandAlone()
          Returns if the server is running in standalone mode.
 boolean matchesComponent(JID jid)
          Returns true if the given address matches a component service JID.
 void restart()
          Restarts the server and all it's modules only if the server is restartable.
 void start()
           
 void stop()
          Stops the server only if running in standalone mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMPPServer

public XMPPServer()
Creates a server and starts it.

Method Detail

getInstance

public static XMPPServer getInstance()
Returns a singleton instance of XMPPServer.

Returns:
an instance.

getServerInfo

public XMPPServerInfo getServerInfo()
Returns a snapshot of the server's status.

Returns:
the server information current at the time of the method call.

isLocal

public boolean isLocal(JID jid)
Returns true if the given address is local to the server (managed by this server domain). Return false even if the jid's domain matches a local component's service JID.

Parameters:
jid - the JID to check.
Returns:
true if the address is a local address to this server.

isRemote

public boolean isRemote(JID jid)
Returns true if the given address does not match the local server hostname and does not match a component service JID.

Parameters:
jid - the JID to check.
Returns:
true if the given address does not match the local server hostname and does not match a component service JID.

matchesComponent

public boolean matchesComponent(JID jid)
Returns true if the given address matches a component service JID.

Parameters:
jid - the JID to check.
Returns:
true if the given address matches a component service JID.

createJID

public JID createJID(String username,
                     String resource)
Creates an XMPPAddress local to this server.

Parameters:
username - the user name portion of the id or null to indicate none is needed.
resource - the resource portion of the id or null to indicate none is needed.
Returns:
an XMPPAddress for the server.

finishSetup

public void finishSetup()

start

public void start()

restart

public void restart()
Restarts the server and all it's modules only if the server is restartable. Otherwise do nothing.


stop

public void stop()
Stops the server only if running in standalone mode. Do nothing if the server is running inside of another server.


isSetupMode

public boolean isSetupMode()

isRestartable

public boolean isRestartable()

isStandAlone

public boolean isStandAlone()
Returns if the server is running in standalone mode. We consider that it's running in standalone if the "org.jivesoftware.messenger.starter.ServerStarter" class is present in the system.

Returns:
true if the server is running in standalone mode.

getConnectionManager

public ConnectionManager getConnectionManager()
Returns the ConnectionManager registered with this server. The ConnectionManager was registered with the server as a module while starting up the server.

Returns:
the ConnectionManager registered with this server.

getRoutingTable

public RoutingTable getRoutingTable()
Returns the RoutingTable registered with this server. The RoutingTable was registered with the server as a module while starting up the server.

Returns:
the RoutingTable registered with this server.

getPacketDeliverer

public PacketDeliverer getPacketDeliverer()
Returns the PacketDeliverer registered with this server. The PacketDeliverer was registered with the server as a module while starting up the server.

Returns:
the PacketDeliverer registered with this server.

getRosterManager

public RosterManager getRosterManager()
Returns the RosterManager registered with this server. The RosterManager was registered with the server as a module while starting up the server.

Returns:
the RosterManager registered with this server.

getPresenceManager

public PresenceManager getPresenceManager()
Returns the PresenceManager registered with this server. The PresenceManager was registered with the server as a module while starting up the server.

Returns:
the PresenceManager registered with this server.

getOfflineMessageStore

public OfflineMessageStore getOfflineMessageStore()
Returns the OfflineMessageStore registered with this server. The OfflineMessageStore was registered with the server as a module while starting up the server.

Returns:
the OfflineMessageStore registered with this server.

getOfflineMessageStrategy

public OfflineMessageStrategy getOfflineMessageStrategy()
Returns the OfflineMessageStrategy registered with this server. The OfflineMessageStrategy was registered with the server as a module while starting up the server.

Returns:
the OfflineMessageStrategy registered with this server.

getPacketRouter

public PacketRouter getPacketRouter()
Returns the PacketRouter registered with this server. The PacketRouter was registered with the server as a module while starting up the server.

Returns:
the PacketRouter registered with this server.

getIQRegisterHandler

public IQRegisterHandler getIQRegisterHandler()
Returns the IQRegisterHandler registered with this server. The IQRegisterHandler was registered with the server as a module while starting up the server.

Returns:
the IQRegisterHandler registered with this server.

getPluginManager

public PluginManager getPluginManager()
Returns the PluginManager instance registered with this server.

Returns:
the PluginManager instance.

getIQHandlers

public List<IQHandler> getIQHandlers()
Returns a list with all the modules registered with the server that inherit from IQHandler.

Returns:
a list with all the modules registered with the server that inherit from IQHandler.

getSessionManager

public SessionManager getSessionManager()
Returns the SessionManager registered with this server. The SessionManager was registered with the server as a module while starting up the server.

Returns:
the SessionManager registered with this server.

getTransportHandler

public TransportHandler getTransportHandler()
Returns the TransportHandler registered with this server. The TransportHandler was registered with the server as a module while starting up the server.

Returns:
the TransportHandler registered with this server.

getPresenceUpdateHandler

public PresenceUpdateHandler getPresenceUpdateHandler()
Returns the PresenceUpdateHandler registered with this server. The PresenceUpdateHandler was registered with the server as a module while starting up the server.

Returns:
the PresenceUpdateHandler registered with this server.

getPresenceSubscribeHandler

public PresenceSubscribeHandler getPresenceSubscribeHandler()
Returns the PresenceSubscribeHandler registered with this server. The PresenceSubscribeHandler was registered with the server as a module while starting up the server.

Returns:
the PresenceSubscribeHandler registered with this server.

getIQRouter

public IQRouter getIQRouter()
Returns the IQRouter registered with this server. The IQRouter was registered with the server as a module while starting up the server.

Returns:
the IQRouter registered with this server.

getMessageRouter

public MessageRouter getMessageRouter()
Returns the MessageRouter registered with this server. The MessageRouter was registered with the server as a module while starting up the server.

Returns:
the MessageRouter registered with this server.

getPresenceRouter

public PresenceRouter getPresenceRouter()
Returns the PresenceRouter registered with this server. The PresenceRouter was registered with the server as a module while starting up the server.

Returns:
the PresenceRouter registered with this server.

getUserManager

public UserManager getUserManager()
Returns the UserManager registered with this server. The UserManager was registered with the server as a module while starting up the server.

Returns:
the UserManager registered with this server.

getAuditManager

public AuditManager getAuditManager()
Returns the AuditManager registered with this server. The AuditManager was registered with the server as a module while starting up the server.

Returns:
the AuditManager registered with this server.

getServerFeaturesProviders

public List<ServerFeaturesProvider> getServerFeaturesProviders()
Returns a list with all the modules that provide "discoverable" features.

Returns:
a list with all the modules that provide "discoverable" features.

getServerItemsProviders

public List<ServerItemsProvider> getServerItemsProviders()
Returns a list with all the modules that provide "discoverable" items associated with the server.

Returns:
a list with all the modules that provide "discoverable" items associated with the server.

getIQDiscoInfoHandler

public IQDiscoInfoHandler getIQDiscoInfoHandler()
Returns the IQDiscoInfoHandler registered with this server. The IQDiscoInfoHandler was registered with the server as a module while starting up the server.

Returns:
the IQDiscoInfoHandler registered with this server.

getIQDiscoItemsHandler

public IQDiscoItemsHandler getIQDiscoItemsHandler()
Returns the IQDiscoItemsHandler registered with this server. The IQDiscoItemsHandler was registered with the server as a module while starting up the server.

Returns:
the IQDiscoItemsHandler registered with this server.

getPrivateStorage

public PrivateStorage getPrivateStorage()
Returns the PrivateStorage registered with this server. The PrivateStorage was registered with the server as a module while starting up the server.

Returns:
the PrivateStorage registered with this server.

getMultiUserChatServer

public MultiUserChatServer getMultiUserChatServer()
Returns the MultiUserChatServer registered with this server. The MultiUserChatServer was registered with the server as a module while starting up the server.

Returns:
the MultiUserChatServer registered with this server.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.