|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.server.context.Mod
org.elkoserver.server.context.mods.Dictionary
public class Dictionary
Mod to associate a server-moderated hashtable with its object. This mod may be attached to a context, user or item.
| Constructor Summary | |
|---|---|
Dictionary(String[] names,
String[] values,
OptBoolean persist)
JSON-driven constructor. |
|
| Method Summary | |
|---|---|
void |
delvar(User from,
String[] names)
Message handler for the 'delvar' message. |
JSONLiteral |
encode(EncodeControl control)
Encode this mod for transmission or persistence. |
void |
setvar(User from,
String[] names,
String[] values)
Message handle for the 'setvar' message. |
| Methods inherited from class org.elkoserver.server.context.Mod |
|---|
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@JSONMethod(value={"names","values","persist"})
public Dictionary(String[] names,
String[] values,
OptBoolean persist)
names - Array of variable names.values - Parallel array of values for those variables.persist - If true, make sure any changes get saved to disk; if
false (the default), changes are ephemeral.| Method Detail |
|---|
public JSONLiteral encode(EncodeControl control)
encode in interface Encodablecontrol - Encode control determining what flavor of encoding
should be done.
@JSONMethod(value="names")
public void delvar(User from,
String[] names)
throws MessageHandlerException
This message is a request to delete of one or more of the variables from the set. If the operation is successful, a corresponding 'delvar' message is broadcast to the context.
Warning: This message is not secure. As implemented today, anyone can delete variables.
recv: { to:REF, op:"delvar",
names:STR[] }
send: { to:REF, op:"delvar",
names:STR[[ }
from - The user who sent the message.names - Names of the variables to remove.
MessageHandlerException - if 'from' is not in the same context as
this mod.
@JSONMethod(value={"names","values"})
public void setvar(User from,
String[] names,
String[] values)
throws MessageHandlerException
This message is a request to change the value of one or more of the variables (or to assign a new variable). If the operation is successfull, a corresponding 'setvar' message is broadcast to the context.
Warning: This message is not secure. As implemented today, anyone can modify variables.
recv: { to:REF, op:"setvar", names:STR[],
values:STR[] }
send: { to:REF, op:"setvar", names:STR[],
values:STR[] }
from - The user who sent the message.names - Names of the variables to assign.values - The values to set them to. Each element of the array is
the value for the corresponding element of 'names.
MessageHandlerException - if 'from' is not in the same context as
this mod.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||