|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.server.context.BasicObject
org.elkoserver.server.context.User
public class User
A User represents a connection to someone entered into a context from a
client. It is one of the three basic object types (along with Context and Item).
| Field Summary |
|---|
| Fields inherited from class org.elkoserver.server.context.BasicObject |
|---|
VIS_CONTAINER, VIS_NONE, VIS_PERSONAL, VIS_PUBLIC |
| Constructor Summary | |
|---|---|
User(String name,
Mod[] mods,
Item[] contents,
String ref,
Position pos)
Direct constructor. |
|
| Method Summary | |
|---|---|
int |
connectionID()
Obtain this user's connection ID. |
Context |
context()
Obtain the context this user is currently contained by. |
JSONLiteral |
encode(EncodeControl control)
Encode this user for transmission or persistence. |
void |
exitContext(String why,
String whyCode,
boolean reload)
Remove this user from their context. |
void |
forceDisconnect()
Force this user to actually disconnect from the server. |
boolean |
isContainer()
Test if this object is a container. |
Deliverer |
neighbors()
Obtain a message deliverer for sending messages to the other users in this user's context. |
void |
pushNewContext(String contextRef)
Begin the sequence of events that will push this user to a different context. |
void |
send(JSONLiteral message)
Send a message to this user. |
void |
sendObjectDescription(Deliverer to,
Referenceable maker)
Transmit a description of this user as a series of 'make' messages, such that the receiver will be able to construct a local presence of it. |
void |
sendUserDescription(Deliverer to,
Referenceable maker,
boolean you)
Transmit a description of this user as a series of 'make' messages. |
String |
toString()
Obtain a printable string representation of this user. |
User |
user()
Obtain the user this object is currently associated with. |
| Methods inherited from class org.elkoserver.server.context.BasicObject |
|---|
baseRef, checkpoint, checkpoint, container, contents, contextor, createItem, findActualTarget, getMod, handleMessage, holder, isClone, isEphemeral, markAsChanged, markAsDeleted, markAsEphemeral, name, noteCodependent, objectIsComplete, position, ref, sendToClones, setName, setPosition, setVisibility, visibleTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public User(String name,
Mod[] mods,
Item[] contents,
String ref,
Position pos)
name - The name of the user.mods - Array of mods to attach to the user; can be null if no mods
are to be attached at initial creation time.contents - Array of inactive items that will be the initial
contents of this user, or null if there are no contents now.pos - Optional position of the user within its context.| Method Detail |
|---|
public int connectionID()
public Context context()
context in class BasicObjectpublic JSONLiteral encode(EncodeControl control)
encode in interface Encodablecontrol - Encode control determining what flavor of encoding
should be done.
public void exitContext(String why,
String whyCode,
boolean reload)
why - Explanation string to send to this user as the last thing
they see from the context.whyCode - Machine readable tag encoding 'why'.reload - true if the client should attempt a reload (i.e.,
immediately try to enter again), false if not.public void forceDisconnect()
public boolean isContainer()
isContainer in class BasicObjectpublic Deliverer neighbors()
public void pushNewContext(String contextRef)
contextRef - The ref of the context to push them to.public void send(JSONLiteral message)
send in interface Deliverermessage - The message to send.
public void sendObjectDescription(Deliverer to,
Referenceable maker)
sendObjectDescription in class BasicObjectto - Where to send the description.maker - Maker object to address the message(s) to.
public void sendUserDescription(Deliverer to,
Referenceable maker,
boolean you)
to - Where to send the description.maker - Maker object to address message to.you - If true, user description is being sent to the user being
described.public String toString()
toString in class Objectpublic User user()
user in class BasicObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||