org.frogx.service.api
Interface MUGService

All Superinterfaces:
org.xmpp.component.Component

public interface MUGService
extends org.xmpp.component.Component

A Multi-User Gaming service is a XMPP component which manages game rooms and users.

Author:
Günther Nieß

Field Summary
static java.lang.String mugNS
          The xml namespace of the multi-user game service.
static java.lang.String mugOwnerNS
          The Suffix of the owner xml namespace.
static java.lang.String mugUserNS
          The Suffix of the user xml namespace.
 
Method Summary
 void addExtraFeature(java.lang.String feature)
          Add additional service discovery features for this service.
 void addExtraIdentity(java.lang.String category, java.lang.String name, java.lang.String type)
          Add an additional service discovery identity to the service.
 org.xmpp.packet.JID getAddress()
          Get the JID of the multi-user game service with the full service domain.
 java.util.Collection<org.xmpp.packet.JID> getAdmins()
          Get a collection of the administrators JIDs.
 java.lang.String getDescription()
          Get a human readable description of the multi-user game service.
 java.lang.String getDomain()
          Get the domain of the service e.g. gaming.example.com.
 java.util.Collection<java.lang.String> getExtraFeatures()
          Obtains a collection of additional service discovery features.
 java.util.Collection<org.dom4j.Element> getExtraIdentities()
          Obtains a collection of additional service discovery identities.
 MUGRoom getGameRoom(java.lang.String roomName, java.lang.String gameNamespace, org.xmpp.packet.JID userJID)
          Obtains a game room.
 java.util.Collection<MUGRoom> getGameRooms()
          Get a collection of all game rooms hosted by the service.
 java.lang.String getName()
          Get the name of the service e.g. gaming for the domain gaming.example.com.
 int getNumberActiveRooms()
          Get the number of active multi-user rooms.
 int getNumberRooms()
          Retuns the number of existing Rooms on the server (i.e. active or not, in memory or not).
 int getNumberSavedRooms()
          Get the number of saved multi-user rooms.
 int getNumberUserSessions()
          Retuns the total number of user sessions on this service.
 java.util.Map<java.lang.String,MultiUserGame> getSupportedGames()
          Get the games supported by the service.
 boolean hasRoom(java.lang.String roomName)
          If a game room with the specified name exists this method returns true.
 boolean isServiceEnabled()
          Get true if the the multi-user game service is started and running.
 void registerMultiUserGame(java.lang.String namespace, MultiUserGame gameClass)
          Registers a new MultiUserGame implementation to the service.
 void removeExtraFeature(java.lang.String feature)
          Remove an additional service discovery feature from the service.
 void removeExtraIdentity(java.lang.String name)
          Remove an additional service discovery identity from the service (if exists).
 void removeGameRoom(java.lang.String roomName)
          Remove a game room from this service.
 void setDescription(java.lang.String description)
          Assign the human readable description of multi-user game service.
 void unregisterMultiUserGame(java.lang.String namespace)
          Unregisters a MultiUserGame implementation.
 
Methods inherited from interface org.xmpp.component.Component
initialize, processPacket, shutdown, start
 

Field Detail

mugNS

static final java.lang.String mugNS
The xml namespace of the multi-user game service.

See Also:
Constant Field Values

mugOwnerNS

static final java.lang.String mugOwnerNS
The Suffix of the owner xml namespace.

See Also:
Constant Field Values

mugUserNS

static final java.lang.String mugUserNS
The Suffix of the user xml namespace.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Get the name of the service e.g. gaming for the domain gaming.example.com.

Specified by:
getName in interface org.xmpp.component.Component
Returns:
the name of the multi-user game service.

getDomain

java.lang.String getDomain()
Get the domain of the service e.g. gaming.example.com.

Returns:
the domain of the multi-user game service.

getAddress

org.xmpp.packet.JID getAddress()
Get the JID of the multi-user game service with the full service domain.

Returns:
the domain of the service.

getAdmins

java.util.Collection<org.xmpp.packet.JID> getAdmins()
Get a collection of the administrators JIDs.

Returns:
A collection of the administrators JIDs.

getDescription

java.lang.String getDescription()
Get a human readable description of the multi-user game service.

Specified by:
getDescription in interface org.xmpp.component.Component
Returns:
the description of the service.

setDescription

void setDescription(java.lang.String description)
Assign the human readable description of multi-user game service. This short description of service is used for disco queries and such.

Parameters:
description - Description of the service.

isServiceEnabled

boolean isServiceEnabled()
Get true if the the multi-user game service is started and running.

Returns:
true if the service is running, otherwise false.

getNumberRooms

int getNumberRooms()
Retuns the number of existing Rooms on the server (i.e. active or not, in memory or not).

Returns:
the number of rooms provided by the service.

getNumberActiveRooms

int getNumberActiveRooms()
Get the number of active multi-user rooms.

Returns:
the number of rooms.

getNumberSavedRooms

int getNumberSavedRooms()
Get the number of saved multi-user rooms.

Returns:
the number of rooms.

getNumberUserSessions

int getNumberUserSessions()
Retuns the total number of user sessions on this service.

Returns:
the number of user sessions on the server.

registerMultiUserGame

void registerMultiUserGame(java.lang.String namespace,
                           MultiUserGame gameClass)
Registers a new MultiUserGame implementation to the service.

Parameters:
namespace - the MultiUserGame disco feature namespace.
gameClass - the class which implements the MultiUserGame.

unregisterMultiUserGame

void unregisterMultiUserGame(java.lang.String namespace)
Unregisters a MultiUserGame implementation.

Parameters:
namespace - the MultiUserGame disco feature namespace.

getSupportedGames

java.util.Map<java.lang.String,MultiUserGame> getSupportedGames()
Get the games supported by the service.

Returns:
the namespaces and classes that are supported.

getGameRoom

MUGRoom getGameRoom(java.lang.String roomName,
                    java.lang.String gameNamespace,
                    org.xmpp.packet.JID userJID)
                    throws NotAllowedException,
                           UnsupportedGameException
Obtains a game room.

Parameters:
roomName - the name of the room.
gameNamespace - the namespace of the game played within the room.
userJID - the user which wants to get the room.
Returns:
the game room for the given name.
Throws:
NotAllowedException - if the room doesn't exist yet and there are restrictions on this service to create a new room
UnsupportedGameException - if the game isn't supported by this service.

getGameRooms

java.util.Collection<MUGRoom> getGameRooms()
Get a collection of all game rooms hosted by the service.

Returns:
a collection of game rooms.

hasRoom

boolean hasRoom(java.lang.String roomName)
If a game room with the specified name exists this method returns true.

Parameters:
roomName - the name of the game room.
Returns:
true if the room already exists otherwise false.

addExtraIdentity

void addExtraIdentity(java.lang.String category,
                      java.lang.String name,
                      java.lang.String type)
Add an additional service discovery identity to the service.

Parameters:
name - the name of the identity.
type - the type of the identity (see XMPP Registrar for more details).
category - the category of the identity (see XMPP Registrar for more details).

removeExtraIdentity

void removeExtraIdentity(java.lang.String name)
Remove an additional service discovery identity from the service (if exists).

Parameters:
name - the name of the identity.

getExtraIdentities

java.util.Collection<org.dom4j.Element> getExtraIdentities()
Obtains a collection of additional service discovery identities.

Returns:
a collection of additional service discovery identities.

addExtraFeature

void addExtraFeature(java.lang.String feature)
Add additional service discovery features for this service.

Parameters:
feature - the namespace of the feature which wants to be added.

removeExtraFeature

void removeExtraFeature(java.lang.String feature)
Remove an additional service discovery feature from the service.

Parameters:
feature - the namespace of the feature which wants to be removed.

getExtraFeatures

java.util.Collection<java.lang.String> getExtraFeatures()
Obtains a collection of additional service discovery features.

Returns:
a collection of additional service discovery features.

removeGameRoom

void removeGameRoom(java.lang.String roomName)
Remove a game room from this service.

Parameters:
roomName - The name of the room.


Copyright © 2009. All Rights Reserved.