|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mega.gasp.platform.impl.PlatformImpl
Platform is the base of the GAming Services Platform(GASP), the container of all GP representing objects. So it contains all MasterApplicationInstance objects in a vector. It hold all of the service instances (Lobby,...) and system instances (DB manager, ID manager, ...).
Field Summary | |
org.apache.log4j.Category |
cat
|
private DBManager |
dbManager
|
boolean |
gaspDBOK
|
boolean |
gaspInstanciationOK
|
protected java.lang.String |
home_path
|
private IDManager |
idManager
|
private Lobby |
lobby
|
private java.util.Vector |
masterApplicationInstances
|
protected int |
platformTimeout
|
private PropertiesReader |
propertiesReader
|
private static PlatformImpl |
singleton
|
Constructor Summary | |
private |
PlatformImpl(java.lang.String path)
|
Method Summary | |
private boolean |
addMasterApplicationInstance(MasterApplicationInstance masterAppInstance)
Add the created MasterApplication to the MasterApplications vector. |
private int |
alreadyLogged(int aID)
Return the sID of the user requiring to log in if he's already logged, else 0. |
boolean |
containsMasterApplicationInstance(int applicationID)
Determine if the MasterApplicationInstance of the application associated with the application ID is initialized or not. |
int |
createAI(int sID,
int minActors,
int maxActors,
java.lang.String[] actors)
Provide to a user with a valid session ID to create an ApplicationInstance with a minimum start number of actors and a maximum number of actors. |
java.util.Iterator |
enumerateMasterApplicationInstance()
Returns an iterator on the MasterApplicationInstance vector. |
MasterApplicationInstance |
getActorOwner(int aID)
Return the MasterApplicationInstance containing the aID. |
ApplicationInstance |
getActorSessionOwner(int aSID)
Return the ApplicationInstance containing the aSID. |
DBManager |
getDBManager()
Return the platform DB manager . |
IDManager |
getIDManager()
Return the platform ID manager . |
private MasterApplicationInstance |
getLinkedSessionOwner(int aSID)
Return the MasterApplication hosts the Session linked to the ActorSession ID. |
Lobby |
getLobby()
Return the Lobby service. |
MasterApplicationInstance |
getMasterApplicationInstance(int applicationID)
Returns the MasterApplicationInstance associated with the application ID or if it is not already instantiates, initialize it. |
static PlatformImpl |
getPlatform()
|
static PlatformImpl |
getPlatform(java.lang.String path)
|
PropertiesReader |
getPropertiesReader()
Return the platform ID manager . |
MasterApplicationInstance |
getSessionOwner(int sID)
Return the MasterApplicationInstance containing the sID. |
boolean |
isMasterApplicationInstanceEmpty()
Determine if the vector of MasterApplicationInstance is empty or not. |
int |
joinAI(int sID,
int aIID)
Provide to a user with a valid session ID to join a specific ApplicationInstance of the application open by the user. |
int |
joinAIRnd(int sID)
Provide to a user with a valid session ID to join a random ApplicationInstance corresponded to tbe application opened by the user. |
int |
login(int aID,
java.lang.String username,
java.lang.String password)
Log a user in the platform, authentified by actorID, username and password. |
int |
masterApplicationInstanceSize()
Return the number of MasterApplicationInstance currently instantiated. |
void |
quit(int sID)
This method is called when a user quit the application. |
private int |
rejoinAI(MasterApplicationInstance masterApp,
int aSID)
Rejoin the linked AI after a deconnection. |
boolean |
removeMasterApplicationInstance(int applicationID)
Remove the MasterApplicationInstance associated with the application ID. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static PlatformImpl singleton
private Lobby lobby
private DBManager dbManager
private IDManager idManager
private PropertiesReader propertiesReader
private java.util.Vector masterApplicationInstances
public org.apache.log4j.Category cat
protected java.lang.String home_path
public boolean gaspDBOK
public boolean gaspInstanciationOK
protected int platformTimeout
Constructor Detail |
private PlatformImpl(java.lang.String path)
Method Detail |
public static PlatformImpl getPlatform()
public static PlatformImpl getPlatform(java.lang.String path)
public MasterApplicationInstance getMasterApplicationInstance(int applicationID)
getMasterApplicationInstance
in interface Platform
applicationID
- the application ID
private boolean addMasterApplicationInstance(MasterApplicationInstance masterAppInstance)
masterAppInstance
-
public boolean removeMasterApplicationInstance(int applicationID)
removeMasterApplicationInstance
in interface Platform
applicationID
- the application ID
public boolean isMasterApplicationInstanceEmpty()
isMasterApplicationInstanceEmpty
in interface Platform
public int masterApplicationInstanceSize()
masterApplicationInstanceSize
in interface Platform
public boolean containsMasterApplicationInstance(int applicationID)
containsMasterApplicationInstance
in interface Platform
applicationID
-
public Lobby getLobby()
getLobby
in interface Platform
public IDManager getIDManager()
getIDManager
in interface Platform
public PropertiesReader getPropertiesReader()
getPropertiesReader
in interface Platform
public DBManager getDBManager()
getDBManager
in interface Platform
public MasterApplicationInstance getSessionOwner(int sID)
getSessionOwner
in interface Platform
sID
- the session ID
public MasterApplicationInstance getActorOwner(int aID)
getActorOwner
in interface Platform
aID
- the actor ID
public int login(int aID, java.lang.String username, java.lang.String password)
login
in interface Platform
aID
- the Actor ID attributed at the first loginusername
- password
-
private int alreadyLogged(int aID)
aID
- the actor ID of the user
public int joinAI(int sID, int aIID)
joinAI
in interface Platform
sID
- the Session IDaIID
- the ApplicationInstance ID
private int rejoinAI(MasterApplicationInstance masterApp, int aSID)
masterApp
- public java.util.Iterator enumerateMasterApplicationInstance()
Platform
enumerateMasterApplicationInstance
in interface Platform
public int joinAIRnd(int sID)
joinAIRnd
in interface Platform
sID
- the Session ID
public int createAI(int sID, int minActors, int maxActors, java.lang.String[] actors)
createAI
in interface Platform
sID
- the Session IDminActors
- minimum number of actors for startingmaxActors
- maximum number of actorsactors
- a table of Actor ID
public void quit(int sID)
quit
in interface Platform
sID
- the Session IDprivate MasterApplicationInstance getLinkedSessionOwner(int aSID)
aSID
- the ActorSessionID
public ApplicationInstance getActorSessionOwner(int aSID)
getActorSessionOwner
in interface Platform
aSID
- the actor session ID
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |