org.pandora.client.servlet
Class PandoraBean

java.lang.Object
  extended by org.pandora.client.servlet.PandoraBean

public class PandoraBean
extends java.lang.Object


Nested Class Summary
static class PandoraBean.InstanceFilter
           
 
Field Summary
static int MAX_LOG
           
static int MAX_UPLOAD_SIZE
           
 
Constructor Summary
PandoraBean()
           
 
Method Summary
 void clearLog()
          Clear the log.
 void compile(java.lang.String code)
          Compile the Self code into a new state machine.
 void connect(java.lang.String user, java.lang.String password, java.lang.String instance)
          Connect to the specified pandora instance.
 boolean createInstance(java.lang.String user, java.lang.String password, java.lang.String instance, java.lang.String description, boolean isAdult, boolean isPrivate)
          Create a new pandora instance.
 boolean createUser(java.lang.String userId, java.lang.String password, java.lang.String hint, java.lang.String name, java.lang.String email, boolean over18)
          Create a new user.
 boolean deleteInstance(java.lang.String user, java.lang.String password, java.lang.String instance, boolean confirm)
          Create a new pandora instance.
 void disconnect()
          Disconnect from the Pandora instance.
 void finalize()
           
 boolean getAccess()
           
 java.util.List<PandoraInstance> getAllInstances()
          Return all pandora instances.
 java.lang.Exception getError()
           
 PandoraInstance getInstance()
           
 PandoraBean.InstanceFilter getInstanceFilter()
           
 java.lang.String getInstanceFilterCheckedString(PandoraBean.InstanceFilter filter)
           
 java.lang.String getInstanceName()
          Return the name of the instance.
 int getInstanceSize()
          Return the size of the instance database.
 java.util.List<Vertex> getLanguageStateMachines()
          Return the list of language state machines.
 java.lang.String getLog()
          Return the current log.
 java.lang.String getLogLevel()
          Return the log level.
 Pandora getPandora()
          Return the associated Pandora instance.
 Vertex getSelectedState()
           
 java.lang.String getStateCode()
           
 User getUser()
           
 boolean isAdmin()
           
 boolean isConnected()
           
 java.lang.String isLogLevelSelected(java.lang.String level)
          Return the html option selected attribute if the level is selected.
 void loadSelfFile(java.io.InputStream stream)
          Compile the uploaded self file.
 void outputAvatar(java.lang.String path)
           
 java.net.URL processHttp(java.lang.String input, java.lang.String site)
          Process the http submission.
 void removeSelectedState()
          Remove the selected state from the language state machines.
 void selectState(java.lang.Long id)
          Select the state machine for the Self page.
 void setAccess(boolean access)
           
 void setConnected(boolean isConnected)
           
 void setError(java.lang.Exception error)
           
 void setInstance(PandoraInstance instance)
           
 void setInstanceFilter(PandoraBean.InstanceFilter instanceFilter)
           
 void setLogLevel(java.lang.String level)
          Return the log level.
 void setPandora(Pandora pandora)
          Set the associated Pandora instance.
 void setSelectedState(Vertex selectedState)
           
 void setStateCode(java.lang.String stateCode)
           
 void setUser(User user)
           
 boolean updateInstance(java.lang.String user, java.lang.String password, java.lang.String instance, java.lang.String description, boolean isAdult, boolean isPrivate)
          Create a new pandora instance.
 boolean updateUser(java.lang.String userId, java.lang.String password, java.lang.String newPassword, java.lang.String hint, java.lang.String name, java.lang.String email, boolean over18)
          Update a user.
 boolean validateInstance(java.lang.String instance, java.lang.String user)
          Validate and set the instance.
 boolean validateUser(java.lang.String user, java.lang.String password)
          Validate and set the user and password.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LOG

public static int MAX_LOG

MAX_UPLOAD_SIZE

public static int MAX_UPLOAD_SIZE
Constructor Detail

PandoraBean

public PandoraBean()
Method Detail

getInstanceFilter

public PandoraBean.InstanceFilter getInstanceFilter()

setInstanceFilter

public void setInstanceFilter(PandoraBean.InstanceFilter instanceFilter)

getInstanceFilterCheckedString

public java.lang.String getInstanceFilterCheckedString(PandoraBean.InstanceFilter filter)

createInstance

public boolean createInstance(java.lang.String user,
                              java.lang.String password,
                              java.lang.String instance,
                              java.lang.String description,
                              boolean isAdult,
                              boolean isPrivate)
Create a new pandora instance.


updateInstance

public boolean updateInstance(java.lang.String user,
                              java.lang.String password,
                              java.lang.String instance,
                              java.lang.String description,
                              boolean isAdult,
                              boolean isPrivate)
Create a new pandora instance.


deleteInstance

public boolean deleteInstance(java.lang.String user,
                              java.lang.String password,
                              java.lang.String instance,
                              boolean confirm)
Create a new pandora instance.


getAllInstances

public java.util.List<PandoraInstance> getAllInstances()
Return all pandora instances.


isAdmin

public boolean isAdmin()

validateUser

public boolean validateUser(java.lang.String user,
                            java.lang.String password)
Validate and set the user and password.


validateInstance

public boolean validateInstance(java.lang.String instance,
                                java.lang.String user)
Validate and set the instance.


createUser

public boolean createUser(java.lang.String userId,
                          java.lang.String password,
                          java.lang.String hint,
                          java.lang.String name,
                          java.lang.String email,
                          boolean over18)
Create a new user.


updateUser

public boolean updateUser(java.lang.String userId,
                          java.lang.String password,
                          java.lang.String newPassword,
                          java.lang.String hint,
                          java.lang.String name,
                          java.lang.String email,
                          boolean over18)
Update a user.


connect

public void connect(java.lang.String user,
                    java.lang.String password,
                    java.lang.String instance)
Connect to the specified pandora instance.


finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

disconnect

public void disconnect()
Disconnect from the Pandora instance.


getLog

public java.lang.String getLog()
Return the current log.


getLogLevel

public java.lang.String getLogLevel()
Return the log level.


isLogLevelSelected

public java.lang.String isLogLevelSelected(java.lang.String level)
Return the html option selected attribute if the level is selected.


setLogLevel

public void setLogLevel(java.lang.String level)
Return the log level.


clearLog

public void clearLog()
Clear the log.


getPandora

public Pandora getPandora()
Return the associated Pandora instance.


getInstanceName

public java.lang.String getInstanceName()
Return the name of the instance.


getInstanceSize

public int getInstanceSize()
Return the size of the instance database.


setPandora

public void setPandora(Pandora pandora)
Set the associated Pandora instance.


isConnected

public boolean isConnected()

setConnected

public void setConnected(boolean isConnected)

getUser

public User getUser()

setUser

public void setUser(User user)

getError

public java.lang.Exception getError()

setError

public void setError(java.lang.Exception error)

getInstance

public PandoraInstance getInstance()

setInstance

public void setInstance(PandoraInstance instance)

getLanguageStateMachines

public java.util.List<Vertex> getLanguageStateMachines()
Return the list of language state machines.


compile

public void compile(java.lang.String code)
Compile the Self code into a new state machine.


loadSelfFile

public void loadSelfFile(java.io.InputStream stream)
Compile the uploaded self file.


processHttp

public java.net.URL processHttp(java.lang.String input,
                                java.lang.String site)
                         throws java.net.MalformedURLException
Process the http submission.

Throws:
java.net.MalformedURLException

selectState

public void selectState(java.lang.Long id)
Select the state machine for the Self page.


removeSelectedState

public void removeSelectedState()
Remove the selected state from the language state machines.


outputAvatar

public void outputAvatar(java.lang.String path)

getSelectedState

public Vertex getSelectedState()

setSelectedState

public void setSelectedState(Vertex selectedState)

getStateCode

public java.lang.String getStateCode()

setStateCode

public void setStateCode(java.lang.String stateCode)

getAccess

public boolean getAccess()

setAccess

public void setAccess(boolean access)