|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--de.tubs.macs.control.floor.FloorControl
This class provides methods for a Session Controller to access and control the floor and floor control policy for each resource in one session. Thus, each session should have an own object of this class.
| Field Summary | |
protected Debug |
debug
|
(package private) static int |
FLOOR_GRANTED
|
(package private) static int |
FLOOR_LOOSE
|
(package private) static int |
FLOOR_LOOSE_RETURN
|
(package private) static int |
FLOOR_REDRAWN
|
(package private) static int |
FLOOR_RELEASE
|
(package private) static int |
FLOOR_REQUESTED
|
(package private) static int |
FLOORCHAIR_SET
|
(package private) static int |
GROUP_ADD
|
(package private) static int |
GROUP_REMOVE
|
static int |
PC_CHAIRGUIDED
|
static int |
PC_PREVIEW
|
static int |
PC_REQUESTS
|
static int |
PC_TIMEOUT
|
static int |
PC_USERGUIDED
|
static int |
PC_USERLIST
|
(package private) static int |
POLICY_SET
|
(package private) static int |
REQUEST_STATUS_ALL
|
(package private) static int |
RESOURCE_ADDED
|
(package private) static int |
RESOURCE_REMOVED
|
(package private) static int |
STATUS_ALL
|
(package private) static int |
TIMESLICE_HARD_SET
|
(package private) static int |
TIMESLICE_SOFT_RESET
|
(package private) static int |
TIMESLICE_SOFT_SET
|
(package private) static int |
USER_ADDED
|
(package private) static int |
USER_REMOVED
|
(package private) static int |
USERLIST_SET
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY,
values |
| Constructor Summary | |
FloorControl(Session session,
MacsSessionController controller)
Construct a new FloorControl-object for the specified
session and session controller. |
|
| Method Summary | |
void |
addToUserGroup(ObjectID groupid,
ObjectID user)
|
(package private) void |
addUser(long res_id)
Add the local user to list of users being able to share this resource actively. |
(package private) boolean |
amFloorChair()
|
(package private) boolean |
amInGroupWith(ObjectID user)
|
boolean |
audioFloorReleased(java.lang.Object channelID)
Release the floor for the audio-application handling the specified channel-id. |
boolean |
audioFloorRequested(java.lang.Object channelID)
Request the floor for the audio-application handling the specified channel-id. |
boolean |
closeAudioChannel(java.lang.Object channelID)
Close the specified audio channel. |
(package private) boolean |
deregisterResource(long res_id)
Deregister a resource that has previously been registered. |
java.lang.Object[] |
enumeratePolicies()
Returns an array with all policies that are known to the system. |
java.lang.Object[] |
enumeratePolicies(long res_id)
Returns an array with all policies that are valid for the specified resource. |
long[] |
enumerateResources()
Returns an array with all resource-ids currently known to the system. |
void |
exit()
This method must be called by the session when shutting down. |
(package private) FloorResource |
findRes(long res_id)
|
(package private) void |
floorRedrawn(long res_id)
|
(package private) void |
floorRelease(long res_id,
ObjectID releaser)
|
(package private) void |
floorRequested(long res_id,
ObjectID requester)
|
java.util.Vector |
getCurrentHolder(long res_id)
Returns the users who are the current Floor Holder for the specified resource. |
java.util.Vector |
getDeterminedUserlist(long res_id)
Returns the list of users who are allowed (by the floor chair) to set the floor holder. |
ObjectID |
getFloorChair()
Returns the current floor chair. |
(package private) Group |
getGroupOf(ObjectID user)
|
long |
getHardTimeslice(long res_id)
Returns the hard timeslice for the specified resource. |
java.util.Vector |
getNextHolder(long res_id)
Returns the user that is likely to be the next Floor Holder for the specified resource. |
int |
getPolicyCapabilities(long res_id)
Returns a bitvector containing the capabilities of a policy for the specified resource. |
java.lang.String |
getPolicyDescription(long res_id)
Returns a short textual description of the current Floor Control Policy for the specified resource. |
java.lang.String |
getPolicyName(long res_id)
Returns the name of the current Floor Control Policy for the specified resource. |
java.lang.String |
getPolicyName(java.lang.Object id)
Returns the name of the policy specified by its id. |
long |
getRemainingHardTime(long res_id)
Returns the remaining hard time for the current Floor Holder to keep the floor for the specified resource. This differs from the #getRemainingSoftTime()-method in that this is the maximum time, which cannot be extended by the user (only by the floor chair). |
long |
getRemainingSoftTime(long res_id)
Returns the remaining time for the current Floor Holder to keep the floor for the specified resource. This differs from the #getRemainingHardTime()-methode in that this timeout can be extended by the application by calling the resetTimeout()-method of its Floor-object
for this resource. |
java.lang.String |
getResourceName(long res_id)
Returns the name of the resource specified by its resource-id, or null if the resource doesn't exist. |
long |
getSoftTimeslice(long res_id)
Returns the timeslice for the specified resource. |
(package private) User |
getuser(ObjectID id)
|
java.util.Vector |
getUserRequests(long res_id)
Returns a list of users that have requested the floor for the specified resource. |
(package private) void |
groupAdd(ObjectID userid,
ObjectID groupid)
|
(package private) void |
groupRemove(ObjectID userid,
ObjectID groupid)
|
boolean |
isCurrentHolder(long res_id,
ObjectID user)
Returns if the specified user is the (or just one) current Floor Holder for the specified resource. |
(package private) boolean |
isInGroupWith(ObjectID user1,
ObjectID user2)
|
(package private) boolean |
isLocaluser(ObjectID userid)
|
boolean |
maySetHolder(long res_id,
ObjectID user)
Returns if the specified user is allowed to set a new floor holder for the specified resource. |
(package private) java.lang.Object |
notifyApplication(MacsApplication app,
int msgid,
long resid,
java.lang.Object data)
|
(package private) void |
notifyController(int msgid,
long res_id,
java.lang.Object data)
|
java.lang.Object |
openAudioChannel(java.util.Vector users,
boolean useFloorcontrol)
Open a new audio channel with the specified users participating. |
java.lang.Object |
openGenericAudioChannel(boolean useFloorcontrol)
Open the "generic" audio channel. |
void |
processSessionEvent(SessionEvent e)
Received a SessionEvent. |
void |
receive(java.lang.Object object)
This method gets called by Session.receiveData(), as soon as a received message in SessionNet.receiveObject() is recognized as a Floor-message. |
(package private) long |
registerResource(java.lang.String name,
MacsApplication app,
boolean isAudio,
int policyFilter)
|
(package private) void |
release(long res_id)
Notification by a local application that it doesn't need the floor for the specified resource anymore. |
void |
removeFromUserGroup(ObjectID groupid,
ObjectID user)
|
(package private) void |
removeUser(long res_id)
Remove the local user from list of users being able to share this resource actively. |
(package private) int |
request(long res_id)
Handle a floor-request by a local application for the specified resource. |
boolean |
requestFloorChair(ObjectID userid)
Request that the specified user becomes the floor chair. |
boolean |
requestHolder(long res_id,
ObjectID userid)
Request that the specified user obtains the floor for the specified resource. |
boolean |
requestHoldersInOrder(long res_id,
java.util.Vector users)
Set a list of users who are to obtain the floor, one after another. |
boolean |
requestPolicy(long res_id,
java.lang.Object id)
Request a new Floor Control Policy for the specified resource. |
boolean |
requestResourceGroupFloor(ObjectID userid)
Request that the specified user obtains the floor for all resources that have been specified in MACS.properties as belonging to a resource group for the current session type. |
(package private) java.util.Vector |
requestStatusAll()
|
(package private) void |
resetSoftTimeout(long res_id)
Reset the timeout for this resource to indicate that it's still being used. |
(package private) void |
resourceAdded(long res_id,
java.util.Vector data)
|
(package private) void |
resourceRemoved(long res_id)
|
void |
run()
Standard method called to execute this thread. |
(package private) void |
sendGranted(long res_id,
ObjectID userid,
java.lang.Object data)
|
(package private) void |
sendLoose(long res_id,
ObjectID nextHolder)
|
(package private) void |
sendRedrawn(long res_id)
|
(package private) void |
sendRelease(long res_id,
ObjectID userid)
|
(package private) void |
sendRequested(long res_id,
ObjectID userid)
|
(package private) void |
sendRequestStatusAll()
|
(package private) void |
sendUserlist(long res_id,
java.lang.Object data)
|
boolean |
setDeterminedUserlist(long res_id,
java.util.Vector ulist)
Set a list of users who are allowed to set the floor holder. |
(package private) void |
setFloorChair(ObjectID newChair)
|
boolean |
setHardTimeslice(long res_id,
long duration)
Set the length of a hard timeslice for specified resource to the specified amount of milliseconds. |
boolean |
setSoftTimeslice(long res_id,
long duration)
Set the length of a soft time slice for the specified resource to the specified amount of milliseconds. |
(package private) void |
statusAll(java.util.Vector rlist)
|
(package private) void |
timeHardSet(long res_id,
long duration)
|
(package private) void |
timeSoftReset(long res_id,
long last_time)
|
(package private) void |
timeSoftSet(long res_id,
long duration)
|
(package private) void |
userAdded(long res_id,
ObjectID userid)
|
(package private) void |
userlistSet(long res_id,
java.util.Vector data)
|
(package private) void |
userRemoved(long res_id,
ObjectID userid)
|
| Methods inherited from class java.lang.Thread |
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected Debug debug
public static int PC_TIMEOUT
public static int PC_USERLIST
public static int PC_CHAIRGUIDED
public static int PC_USERGUIDED
public static int PC_REQUESTS
public static int PC_PREVIEW
static final int RESOURCE_ADDED
static final int RESOURCE_REMOVED
static final int USER_ADDED
static final int USER_REMOVED
static final int FLOOR_REQUESTED
static final int FLOOR_RELEASE
static final int REQUEST_STATUS_ALL
static final int STATUS_ALL
static final int POLICY_SET
static final int FLOORCHAIR_SET
static final int FLOOR_GRANTED
static final int FLOOR_LOOSE
static final int FLOOR_LOOSE_RETURN
static final int FLOOR_REDRAWN
static final int GROUP_ADD
static final int GROUP_REMOVE
static final int TIMESLICE_SOFT_SET
static final int TIMESLICE_HARD_SET
static final int TIMESLICE_SOFT_RESET
static final int USERLIST_SET
| Constructor Detail |
public FloorControl(Session session,
MacsSessionController controller)
FloorControl-object for the specified
session and session controller.| Method Detail |
public void run()
public void exit()
public void processSessionEvent(SessionEvent e)
e - a SessionEvent.
long registerResource(java.lang.String name,
MacsApplication app,
boolean isAudio,
int policyFilter)
boolean deregisterResource(long res_id)
Floor.res_id - a long-value specifying a resource-id.true if a resource with this id had been registered,
false otherwise.void addUser(long res_id)
Floor.res_id - a long-value, specifying a resource-id.void removeUser(long res_id)
Floor.res_id - a resource-id.void resetSoftTimeout(long res_id)
Floor.int request(long res_id)
res_id - a resource-id.void release(long res_id)
res_id - a resource-id.boolean amFloorChair()
boolean isLocaluser(ObjectID userid)
public long[] enumerateResources()
public java.lang.String getResourceName(long res_id)
res_id - a resource-id.public java.lang.Object[] enumeratePolicies()
public java.lang.Object[] enumeratePolicies(long res_id)
res_id - a resource-id.public java.lang.String getPolicyName(java.lang.Object id)
id - a policy-identifier obtained by #enumeratePolicies()FloorResource findRes(long res_id)
public int getPolicyCapabilities(long res_id)
res_id - a resource-id.
public boolean maySetHolder(long res_id,
ObjectID user)
res_id - a resource-id.user - a user-id.true if the current policy on the specified
resource allows the specified user to set a new floor holder.
public boolean isCurrentHolder(long res_id,
ObjectID user)
res_id - a resource-id.user - a user.true if the user is a Floor Holder,
false otherwise.public java.util.Vector getCurrentHolder(long res_id)
res_id - a resource-id.public java.util.Vector getNextHolder(long res_id)
null if the resource
doesn't exist or the current Floor Policy doesn't allow for such insight.res_id - a resource-id.public java.lang.String getPolicyName(long res_id)
res_id - a resource-id.public java.lang.String getPolicyDescription(long res_id)
res_id - a resource-id.public java.util.Vector getUserRequests(long res_id)
res_id - a resource-id.public java.util.Vector getDeterminedUserlist(long res_id)
res_id - a resource-id.
public boolean setDeterminedUserlist(long res_id,
java.util.Vector ulist)
res_id - a resource-id.ulist - a Vector containing the user-ids (of class ObjectID).false if the user is not allowed to
provide a userlist (or the resource doesn't exist),
true otherwise.
public boolean requestPolicy(long res_id,
java.lang.Object id)
res_id - a resource-id.id - an Object, specifying a policy.true if the request is granted,
false if the request is rejected.public boolean requestFloorChair(ObjectID userid)
userid - a user-id.true if the request is granted,
false otherwise.public ObjectID getFloorChair()
public boolean requestHolder(long res_id,
ObjectID userid)
res_id - a resource-id.userid - the user that is to obtain the floor.true if the request is granted,
false if the request is rejected.
public boolean requestHoldersInOrder(long res_id,
java.util.Vector users)
res_id - a resource-id.users - the users that are to obtain the floor.true if the request is granted,
false if the request is rejected.public boolean requestResourceGroupFloor(ObjectID userid)
userid - the user that is to obtain the floors.true if the request is granted,
false if the request is rejected.public long getRemainingSoftTime(long res_id)
resetTimeout()-method of its Floor-object
for this resource.res_id - a resource-id.public long getRemainingHardTime(long res_id)
res_id - a resource-id.
public boolean setSoftTimeslice(long res_id,
long duration)
res_id - a resource-id.duration - the amount in milliseconds, or 0 (meaning "forever").false if the user is not allowed to
set the time slice (or the resource doesn't exist),
true otherwise.
public boolean setHardTimeslice(long res_id,
long duration)
res_id - a resource-id.duration - the amount in milliseconds, or 0 (meaning "forever").false if the user is not allowed to
set the time slice (or the resource doesn't exist),
true otherwise.public long getSoftTimeslice(long res_id)
res_id - a resource-id.public long getHardTimeslice(long res_id)
res_id - a resource-id.
public void addToUserGroup(ObjectID groupid,
ObjectID user)
public void removeFromUserGroup(ObjectID groupid,
ObjectID user)
Group getGroupOf(ObjectID user)
boolean amInGroupWith(ObjectID user)
boolean isInGroupWith(ObjectID user1,
ObjectID user2)
public java.lang.Object openAudioChannel(java.util.Vector users,
boolean useFloorcontrol)
public boolean closeAudioChannel(java.lang.Object channelID)
public java.lang.Object openGenericAudioChannel(boolean useFloorcontrol)
public boolean audioFloorRequested(java.lang.Object channelID)
public boolean audioFloorReleased(java.lang.Object channelID)
void notifyController(int msgid,
long res_id,
java.lang.Object data)
java.lang.Object notifyApplication(MacsApplication app,
int msgid,
long resid,
java.lang.Object data)
void setFloorChair(ObjectID newChair)
void resourceAdded(long res_id,
java.util.Vector data)
void resourceRemoved(long res_id)
void userAdded(long res_id,
ObjectID userid)
void userRemoved(long res_id,
ObjectID userid)
void floorRequested(long res_id,
ObjectID requester)
void floorRelease(long res_id,
ObjectID releaser)
void floorRedrawn(long res_id)
void groupAdd(ObjectID userid,
ObjectID groupid)
void groupRemove(ObjectID userid,
ObjectID groupid)
void timeSoftSet(long res_id,
long duration)
void timeHardSet(long res_id,
long duration)
void timeSoftReset(long res_id,
long last_time)
void userlistSet(long res_id,
java.util.Vector data)
java.util.Vector requestStatusAll()
void statusAll(java.util.Vector rlist)
void sendRequestStatusAll()
void sendGranted(long res_id,
ObjectID userid,
java.lang.Object data)
void sendLoose(long res_id,
ObjectID nextHolder)
void sendRedrawn(long res_id)
void sendRequested(long res_id,
ObjectID userid)
void sendRelease(long res_id,
ObjectID userid)
void sendUserlist(long res_id,
java.lang.Object data)
public void receive(java.lang.Object object)
object - the message-object.User getuser(ObjectID id)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||