Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire
Class XMPPServer

java.lang.Object
  extended by org.jivesoftware.wildfire.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 wildfire.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 wildfireHome 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. wildfire_init.xml file - Attempt to load the value from wildfire_init.xml which must be in the classpath

Author:
Gaston Dombiak

Constructor Summary
XMPPServer()
          Creates a server and starts it.
 
Method Summary
 void addServerListener(XMPPServerListener listener)
          Adds a new server listener that will be notified when the server has been started or is about to be stopped.
 JID createJID(String username, String resource)
          Creates an XMPPAddress local to this server.
 void finishSetup()
          Finish the setup process.
 AdHocCommandHandler getAdHocCommandHandler()
          Returns the AdHocCommandHandler registered with this server.
 Collection<JID> getAdmins()
          Returns a collection with the JIDs of the server's admins.
 AuditManager getAuditManager()
          Returns the AuditManager registered with this server.
 ConnectionManager getConnectionManager()
          Returns the ConnectionManager registered with this server.
 FileTransferManager getFileTransferManager()
          Returns the FileTransferManager registered with this server.
 FileTransferProxy getFileTransferProxy()
          Returns the FileTransferProxy registered with this server.
static XMPPServer getInstance()
          Returns a singleton instance of XMPPServer.
 IQAuthHandler getIQAuthHandler()
          Returns the IQAuthHandler registered with this server.
 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.
 MediaProxyService getMediaProxyService()
          Returns the MediaProxyService registered with this server.
 MessageRouter getMessageRouter()
          Returns the MessageRouter registered with this server.
 MulticastRouter getMulticastRouter()
          Returns the MulticastRouter 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.
 PubSubModule getPubSubModule()
          Returns the PubSubModule 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.
 STUNService getSTUNService()
          Returns the STUNService registered with this server.
 TransportHandler getTransportHandler()
          Returns the TransportHandler registered with this server.
 UpdateManager getUpdateManager()
          Returns the UpdateManager 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 removeServerListener(XMPPServerListener listener)
          Removes a server listener that was being notified when the server was being started or was about to be stopped.
 void restart()
          Restarts the server and all it's modules only if the server is restartable.
 void restartHTTPServer()
          Restarts the HTTP server only when running in stand alone mode.
 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.

getAdmins

public Collection<JID> getAdmins()
Returns a collection with the JIDs of the server's admins. The collection may include JIDs of local users and users of remote servers.

Returns:
a collection with the JIDs of the server's admins.

addServerListener

public void addServerListener(XMPPServerListener listener)
Adds a new server listener that will be notified when the server has been started or is about to be stopped.

Parameters:
listener - the new server listener to add.

removeServerListener

public void removeServerListener(XMPPServerListener listener)
Removes a server listener that was being notified when the server was being started or was about to be stopped.

Parameters:
listener - the server listener to remove.

finishSetup

public void finishSetup()
Finish the setup process. Because this method is meant to be called from inside the Admin console plugin, it spawns its own thread to do the work so that the class loader is correct.


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.


restartHTTPServer

public void restartHTTPServer()
Restarts the HTTP server only when running in stand alone mode. The restart process will be done in another thread that will wait 1 second before doing the actual restart. The delay will give time to the page that requested the restart to fully render its content.


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.wildfire.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.

getIQAuthHandler

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

Returns:
the IQAuthHandler registered with this server.

getPluginManager

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

Returns:
the PluginManager instance.

getPubSubModule

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

Returns:
the PubSubModule registered with this server.

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.

getMulticastRouter

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

Returns:
the MulticastRouter 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.

getUpdateManager

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

Returns:
the UpdateManager 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.

getAdHocCommandHandler

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

Returns:
the AdHocCommandHandler registered with this server.

getFileTransferProxy

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

Returns:
the FileTransferProxy registered with this server.

getFileTransferManager

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

Returns:
the FileTransferProxy registered with this server.

getMediaProxyService

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

Returns:
the MediaProxyService registered with this server.

getSTUNService

public STUNService getSTUNService()
Returns the STUNService registered with this server. The MediaProxyService was registered with the server as a module while starting up the server.

Returns:
the STUNService registered with this server.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.