|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.server.CommandExecutor biz.chitec.quarterback.gjsa.server.BasicAdminExecutor
Administrative commands for setting global properties of a GJSA server. The commands in this executor serve for three purposes:
Shutting down is controlled via the several EXIT commands. EXIT0 and EXIT1 end the server with status code 0 and 1 respectively. EXIT takes the status code number as parameter and can therefore end the server with any code. All these commands take two additional parameters: "prekilltime" and "message". If "prekilltime" is greater than zero. The server will not start the shutdown immediately but wait for the given amount of seconds before shutdown starts. During this time, WAITTOKILL messages will be sent to all connected clients every 10 seconds. If "message" is set, all clients will receive a KILLSTARTED message with the message and the prekilltime as parameter (as a Map with keys MESSAGE and TIMEOUT).
As long as a pending shutdown is in prekill state (e.g. "prekilltime" is still counting down), it can be CANCELLED with the STOPEXIT command. A KILLKILLED message will be sent to all clients.
GJSAServer
,
Killer
Nested Class Summary | |
class |
BasicAdminExecutor.HandlingIndirections
Preprocessor for property changes Implementations of this class can influence the transmission of properties in both directions. |
Field Summary | |
private java.util.List |
changedprops
|
private java.lang.String |
configloggername
|
private static EncryptionRulesSymbols |
ers
|
private java.util.List |
indirlist
|
protected Logger |
mess
|
protected ChangeListener |
mycl
|
private java.util.Map |
properties
|
Fields inherited from class biz.chitec.quarterback.gjsa.server.CommandExecutor |
myserv, mythreadbase, rb |
Constructor Summary | |
BasicAdminExecutor(ServerThreadBase thethreadbase)
Create the executor with link to server only |
|
BasicAdminExecutor(ServerThreadBase thethreadbase,
java.lang.String configloggernamex)
Create the executor with environment and name of server logger for configuration messages The logger will be used to send shutdown messages to all connected clients in case of shutdown commands |
Method Summary | |
void |
addChangeListener(ChangeListener cl)
Add a change listener NOTE: The implementation is actually a fake. |
protected void |
addHandlingIndirections(BasicAdminExecutor.HandlingIndirections hi)
Add an indirection handler which serves as kind of a preprocessor |
static java.util.List |
createReturnableEncryptionRules(java.util.List x)
Transform a list of encryption rules from numeric to symbolic encryption states. |
java.util.Map |
getCookedProperties()
Get all properties with full preprocessing |
java.lang.Object |
getCookedProperty(java.lang.String key)
Get one preprocessed property |
protected java.lang.Object |
getToClient(java.lang.String propname,
java.lang.Object value)
Prepare a configuration setting for sending to the client. |
protected java.lang.Object |
putFromClient(java.lang.String propname,
java.lang.Object value)
Prepare a configuration setting for inserting in the server. |
ServerReply |
query(ServerRequest sq)
|
private void |
sendAdminMessage(java.lang.Object messagetype,
java.util.Map params)
Send a message to all connected clients The message can have an arbitrary type and any parameters. |
void |
setCookedProperty(java.lang.String key,
java.lang.Object property)
Set a properties value The property is checked against the property constraints for correct type. |
protected void |
storageInsertion(java.lang.String propname,
java.lang.Object value)
Inform all HandlingIndirections that a property is stored into the server. |
protected void |
storageSaving(java.util.List propnames)
Inform all HandlingIndirections that the property storage is saved to disk. |
Methods inherited from class biz.chitec.quarterback.gjsa.server.CommandExecutor |
getServerThreadBase, leavingActions, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static EncryptionRulesSymbols ers
protected Logger mess
protected ChangeListener mycl
private java.util.List indirlist
private java.util.List changedprops
private java.util.Map properties
private java.lang.String configloggername
Constructor Detail |
public BasicAdminExecutor(ServerThreadBase thethreadbase)
thethreadbase
- Connection environmentpublic BasicAdminExecutor(ServerThreadBase thethreadbase, java.lang.String configloggernamex)
thethreadbase
- Connection environmentconfigloggernamex
- Name of logger to send shutdown-related messages toMethod Detail |
protected void addHandlingIndirections(BasicAdminExecutor.HandlingIndirections hi)
protected java.lang.Object getToClient(java.lang.String propname, java.lang.Object value)
propname
- Name of the property to sendvalue
- Property's value before preprocessing
protected java.lang.Object putFromClient(java.lang.String propname, java.lang.Object value)
propname
- Name of the property to be insertedvalue
- Property's value before preprocessing (i.e. as the client sent it)
protected void storageInsertion(java.lang.String propname, java.lang.Object value)
propname
- Name of the propertyvalue
- Value that is stored into the serverprotected void storageSaving(java.util.List propnames)
propnames
- Names of all changed propertiespublic static java.util.List createReturnableEncryptionRules(java.util.List x)
x
- List of encryption rules
public java.util.Map getCookedProperties()
public java.lang.Object getCookedProperty(java.lang.String key)
key
- Name of the property in question
public void setCookedProperty(java.lang.String key, java.lang.Object property)
key
- Name of the propertyproperty
- New valueprivate void sendAdminMessage(java.lang.Object messagetype, java.util.Map params)
messagetype
- Type of the messageparams
- Parameters which make the message uppublic ServerReply query(ServerRequest sq)
query
in class CommandExecutor
public void addChangeListener(ChangeListener cl)
cl
- Listener to add/store
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |