|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.tubs.macs.control.net.SystemNet
This class provides a convenient way for the control to handle its communication via the network. Basically, SystemNet implements a Protocol used for communication between different MACS-Controls. Coding, decoding and addressing are done by SystemNet, as well as the scheduling of the calling threads. SystemNet needs some of MacsControl public variables/services:
| Field Summary | |
static int |
CODE_EXPIRED
code constant for expire (timeout) |
static int |
CODE_IGNORE
code constant for command ignored |
static int |
CODE_INVITE_DELAYED
code constant for delayed invite |
static int |
CODE_INVITE_DENIED
code constant for denied invite |
static int |
CODE_JOIN_DELAYED
code constant for delayed join |
static int |
CODE_JOIN_DENIED
code constant for denied joins |
static int |
CODE_LEAVE_DENIED
code constant for denied leave |
static int |
CODE_OK
code constant for success |
static int |
CODE_RESOURCE_USED
code constant for command ignored |
static int |
CODE_SESSION_EXISTS
code constant for session exists |
static int |
CODE_TERMINATE_DENIED
code constant for denied terminate |
static int |
CODE_UNKNOWN_ERROR
code constant for some unknown error |
static java.lang.String[] |
codes
provide string represenatations of codes |
static java.lang.String |
DEBUG_KEY
key for debug info |
int |
net_periode_basic
|
static java.lang.String |
NET_PERIODE_BASIC
keys for net timings |
int |
net_periode_create
|
static java.lang.String |
NET_PERIODE_CREATE
|
static java.lang.String |
NET_PERIODE_EXPIRE_SESSION
|
static java.lang.String |
NET_PERIODE_EXPIRE_USER
|
int |
net_periode_others
|
static java.lang.String |
NET_PERIODE_OTHERS
|
static int |
STATE_ENTER
state constant for a new system/session/user |
static int |
STATE_LEAVE
state constant for a leaving system/session/user |
static int |
STATE_PERIOD
state constant for alive (heart-beat) of a system/session/user |
static int |
STATE_REFRESH
state constant for update-request of a REMOTE-system/session/user This indication MUST contain the remote-user to be updated |
static int |
STATE_UPDATE
state constant for a update about a system/session/user |
static java.lang.String[] |
states
provide string represenatations of states |
static int |
VERSION_MAJOR
version constant major |
static int |
VERSION_MINOR
version constant minor |
static java.lang.String |
VERSION_STRING
version constant as a string (V"MAJOR"."MINOR") |
| Constructor Summary | |
SystemNet(NetAddress address)
Initialize SystemNet. |
|
| Method Summary | |
void |
addSystemNetListener(SystemNetListener newlistener)
This method is used to register a new listener. |
SessionNet |
createSession(Session session)
Create the network stub for a session (SessionNet). |
void |
exit()
Send leave message and close connections. |
java.lang.String |
getType()
return the type of Net used. |
Status |
invite(ObjectID session_id,
ObjectID user,
long req_num,
java.io.Serializable user_data)
Invite a user. |
SessionNet |
joinSession(Session session,
long request,
java.io.Serializable user_data)
Join a existing session. |
void |
receiveException(NetException exception)
part of NetReceiver interface |
void |
receiveObject(java.lang.Object object,
Net net)
part of NetReceiver interface |
void |
removeSystemNetListener(SystemNetListener oldlistener)
This method is used to remove a registered listener. |
MACSResponse |
sendRequestAndWaitForResponse(MACSRequest req,
long timeout)
|
void |
sendSessionCreateResponse(MACSSessionCreateRequest req,
int result)
Similar to sendSessionIndication(Session,int), but with additional parameter to customize user. |
void |
sendSessionIndication(SessionData sdata,
int type,
ObjectID userID)
Similar to sendSessionIndication(Session,int), but with additional parameter to customize user. |
void |
sendSessionInviteResponse(MACSSessionInviteRequest req,
int result,
java.io.Serializable user_data)
|
void |
sendSystemIndication(User user,
int type)
send SystemIndication |
void |
sendSystemLeave(User user)
Send SystemIndication to announce this system left. |
void |
sendTestCreateUsers(int num)
|
void |
sendTestStart(int interval)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int VERSION_MAJOR
public static final int VERSION_MINOR
public static final java.lang.String VERSION_STRING
public static final int STATE_ENTER
public static final int STATE_LEAVE
public static final int STATE_UPDATE
public static final int STATE_PERIOD
public static final int STATE_REFRESH
public static final java.lang.String[] states
public static final int CODE_OK
public static final int CODE_EXPIRED
public static final int CODE_UNKNOWN_ERROR
public static final int CODE_SESSION_EXISTS
public static final int CODE_JOIN_DENIED
public static final int CODE_LEAVE_DENIED
public static final int CODE_TERMINATE_DENIED
public static final int CODE_INVITE_DENIED
public static final int CODE_JOIN_DELAYED
public static final int CODE_INVITE_DELAYED
public static final int CODE_IGNORE
public static final int CODE_RESOURCE_USED
public static final java.lang.String[] codes
public static final java.lang.String DEBUG_KEY
public static final java.lang.String NET_PERIODE_BASIC
public static final java.lang.String NET_PERIODE_CREATE
public static final java.lang.String NET_PERIODE_EXPIRE_USER
public static final java.lang.String NET_PERIODE_EXPIRE_SESSION
public static final java.lang.String NET_PERIODE_OTHERS
public int net_periode_basic
public int net_periode_create
public int net_periode_others
| Constructor Detail |
public SystemNet(NetAddress address)
throws NetException
group - string with address of network groupoptions - string with network options| Method Detail |
public void sendSystemIndication(User user,
int type)
public MACSResponse sendRequestAndWaitForResponse(MACSRequest req,
long timeout)
public void receiveObject(java.lang.Object object,
Net net)
object - receivednet - which did receive this object (allows one NetReceiver to be
used for more than one Net)public void receiveException(NetException exception)
exception - received from Netpublic void addSystemNetListener(SystemNetListener newlistener)
public void removeSystemNetListener(SystemNetListener oldlistener)
public Status invite(ObjectID session_id,
ObjectID user,
long req_num,
java.io.Serializable user_data)
public void sendSystemLeave(User user)
public void sendSessionIndication(SessionData sdata,
int type,
ObjectID userID)
session - the data describing the sessiontype - the type of indication send (e.g. SATE_ENTER)user - sending user
public void sendSessionCreateResponse(MACSSessionCreateRequest req,
int result)
throws NetException
session - the data describing the sessiontype - the type of indication send (e.g. STATE_ENTER)user - sending user
public void sendSessionInviteResponse(MACSSessionInviteRequest req,
int result,
java.io.Serializable user_data)
throws NetException
public void exit()
public SessionNet createSession(Session session)
session - the data describing the session
public SessionNet joinSession(Session session,
long request,
java.io.Serializable user_data)
session - the data describing the sessionuser_data - application/controller dependend data (optional)request - number of the invite request (if applicable, else 0)public java.lang.String getType()
public void sendTestCreateUsers(int num)
public void sendTestStart(int interval)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||