PaP
Class RepertoireBase

java.lang.Object
  |
  +--PaP.RepertoireBase
All Implemented Interfaces:
java.io.Serializable

public class RepertoireBase
extends java.lang.Object
implements java.io.Serializable

Implementation of the repertoire base service, Director has an instance of it.

See Also:
Serialized Form

Field Summary
private  java.util.Hashtable playInstances
          To store active plays along with their manuscripts
 
Constructor Summary
RepertoireBase()
          Constructor to fill data field values.
 
Method Summary
 boolean empty()
          Simple utility to check if the numer of active Plays are zero
 Item listPlays()
          Utility to list all active Plays for Debug purposes
 Play playPluggedIn(java.lang.String pPlayId, java.lang.String pPlayVer)
          Looks up a specified version of a specified play among the active plays.
 RequestResult playPlugIn(Play pPlay)
          Inserts a specified Play into the RepertoireBase if not already there
 RequestResult playPlugOut(java.lang.String pPlayId, java.lang.String pPlayVer)
          Removes a specified or all versions of a specified Play from the RepertoireBase if it was there
 Play[] playsPluggedIn(java.lang.String pPlayId)
          Looks up all versions of a specified play among the active plays.
 Play validRole(java.lang.String pRole)
          Checks validity of a specified Role by finding the corresponding Play for it
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

playInstances

private java.util.Hashtable playInstances
To store active plays along with their manuscripts
Constructor Detail

RepertoireBase

public RepertoireBase()
Constructor to fill data field values.
Method Detail

playPluggedIn

public Play playPluggedIn(java.lang.String pPlayId,
                          java.lang.String pPlayVer)
Looks up a specified version of a specified play among the active plays.
Parameters:
pPlayId - Play identifier of the play to be found.
pPlayVer - Play version of the play to be found.
Returns:
The play that was found.

playsPluggedIn

public Play[] playsPluggedIn(java.lang.String pPlayId)
Looks up all versions of a specified play among the active plays.
Parameters:
pPlayId - Play identifier of the play of which all versions to be found.
Returns:
Array of plays that were found.

playPlugIn

public RequestResult playPlugIn(Play pPlay)
                         throws java.lang.Exception
Inserts a specified Play into the RepertoireBase if not already there
Parameters:
pPlay - The Play to be inserted
Returns:
PaP style result of the operation

playPlugOut

public RequestResult playPlugOut(java.lang.String pPlayId,
                                 java.lang.String pPlayVer)
                          throws java.lang.Exception
Removes a specified or all versions of a specified Play from the RepertoireBase if it was there
Parameters:
pPlayId - Identifier of the Play to be removed
pPlayVer - Version of the Play to be removed, null means all versions of the Play to be removed
Returns:
PaP style result of the operation

validRole

public Play validRole(java.lang.String pRole)
Checks validity of a specified Role by finding the corresponding Play for it
Parameters:
pRole - Role to look up corresponding Play for
Returns:
Corresponding PlayId for the Role, null if the specifeid role is not valid, i.e. no active play has it NOTE: The procedure for selection among versions within plays is not implemented(?).

empty

public boolean empty()
Simple utility to check if the numer of active Plays are zero
Returns:
true if there are no active Plays

listPlays

public Item listPlays()
Utility to list all active Plays for Debug purposes