Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire
Class XMPPServer

    java.lang.Object
      org.jivesoftware.openfire.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 openfire.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 openfireHome 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. openfire_init.xml file - Attempt to load the value from openfire_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.
`JID` | `createJID(String username, String resource, boolean skipStringprep)` 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.
`FlashCrossDomainHandler` | `getFlashCrossDomainHandler()` Returns the `FlashCrossDomainHandler` 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.
`IQPEPHandler` | `getIQPEPHandler()` Returns the `IQPEPHandler` registered with this server.
`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.
`NodeID` | `getNodeID()` Returns an ID that uniquely identifies this server in a cluster.
`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.
`RemoteSessionLocator` | `getRemoteSessionLocator()` Returns the locator to use to find sessions hosted in other cluster nodes.
`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.
`List<ServerIdentitiesProvider>` | `getServerIdentitiesProviders()` Returns a list with all the modules that provide "discoverable" identities.
`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.
`List<UserIdentitiesProvider>` | `getUserIdentitiesProviders()` Returns a list with all the modules that provide "discoverable" user identities.
`List<UserItemsProvider>` | `getUserItemsProviders()` Returns a list with all the modules that provide "discoverable" items associated with users.
`UserManager` | `getUserManager()` Returns the `UserManager` registered with this server.
`VCardManager` | `getVCardManager()` Returns the `VCardManager` 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` | `isShuttingDown()` Returns true if the server is being shutdown.
`boolean` | `isStandAlone()` Returns if the server is running in standalone mode.
`boolean` | `isStarted()` Returns whether or not the server has been started.
`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` | `setNodeID(NodeID nodeID)` Sets an ID that uniquely identifies this server in a cluster.
`void` | `setRemoteSessionLocator(RemoteSessionLocator remoteSessionLocator)` Sets the locator to use to find sessions hosted in other cluster nodes.
`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.

### getNodeID

    public NodeID getNodeID()

  Returns an ID that uniquely identifies this server in a cluster. When not running in cluster mode the returned value is always the same. However, when in cluster mode the value should be set when joining the cluster and must be unique even upon restarts of this node.

  Returns:
    an ID that uniquely identifies this server in a cluster.

### setNodeID

    public void setNodeID(NodeID nodeID)

  Sets an ID that uniquely identifies this server in a cluster. When not running in cluster mode the returned value is always the same. However, when in cluster mode the value should be set when joining the cluster and must be unique even upon restarts of this node.

  Parameters:
    `nodeID` - an ID that uniquely identifies this server in a cluster or null if not in a cluster.

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

### createJID

    public JID createJID(String username,
                         String resource,
                         boolean skipStringprep)

  Creates an XMPPAddress local to this server. The construction of the new JID can be optimized by skipping stringprep operations.

  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.
    `skipStringprep` - true if stringprep should not be applied.
  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.openfire.starter.ServerStarter" class is present in the system.

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

### isShuttingDown

    public boolean isShuttingDown()

  Returns true if the server is being shutdown.

  Returns:
    true if the server is being shutdown.

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

### getIQPEPHandler

    public IQPEPHandler getIQPEPHandler()

  Returns the `IQPEPHandler` registered with this server. The `IQPEPHandler` was registered with the server as a module while starting up the server.

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

### getServerIdentitiesProviders

    public List<ServerIdentitiesProvider> getServerIdentitiesProviders()

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

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

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

### getUserIdentitiesProviders

    public List<UserIdentitiesProvider> getUserIdentitiesProviders()

  Returns a list with all the modules that provide "discoverable" user identities.

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

### getUserItemsProviders

    public List<UserItemsProvider> getUserItemsProviders()

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

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

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

### getFlashCrossDomainHandler

    public FlashCrossDomainHandler getFlashCrossDomainHandler()

  Returns the `FlashCrossDomainHandler` registered with this server. The `FlashCrossDomainHandler` was registered with the server as a module while starting up the server.

  Returns:
    the `FlashCrossDomainHandler` registered with this server.

### getVCardManager

    public VCardManager getVCardManager()

  Returns the `VCardManager` registered with this server. The `VCardManager` was registered with the server as a module while starting up the server.

  Returns:
    the `VCardManager` registered with this server.

### getRemoteSessionLocator

    public RemoteSessionLocator getRemoteSessionLocator()

  Returns the locator to use to find sessions hosted in other cluster nodes. When not running in a cluster a `null` value is returned.

  Returns:
    the locator to use to find sessions hosted in other cluster nodes.

### setRemoteSessionLocator

    public void setRemoteSessionLocator(RemoteSessionLocator remoteSessionLocator)

  Sets the locator to use to find sessions hosted in other cluster nodes. When not running in a cluster set a `null` value.

  Parameters:
    `remoteSessionLocator` - the locator to use to find sessions hosted in other cluster nodes.

### isStarted

    public boolean isStarted()

  Returns whether or not the server has been started.

  Returns:
    whether or not the server has been started.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.4.3 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Jive Software.