Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Types | |
enum | Permission { WRITE_ACCESS, READONLY_ACCESS } |
Public Member Functions | |
User (JID jid, String nickname, boolean isHost, boolean isLocal, int colorID, int favoriteColorID) | |
JID | getJID () |
String | getNickname () |
void | setPermission (Permission permission) |
Permission | getPermission () |
boolean | hasWriteAccess () |
boolean | hasReadOnlyAccess () |
boolean | isInSession () |
String | toString () |
int | hashCode () |
boolean | equals (Object obj) |
int | getColorID () |
int | getFavoriteColorID () |
boolean | isLocal () |
boolean | isRemote () |
boolean | isHost () |
boolean | isClient () |
void | setColorID (int colorID) |
void | setInSession (boolean isInSession) |
A user is a representation of a person sitting in front of an eclipse instance for the use in one Saros session.
A user object always has the following immutable characteristics: He/she has a favorite color, is either host or client, is either local or remote and has fixed JID.
There is one user who is the host, all others are clients.
There is one local user representing the person in front of the current eclipse instance, all others are remote users.
The public and mutable properties are the User.Permission and isInSession().
A user is a entity object, i.e. it can change over time.
de.fu_berlin.inf.dpp.session.User.User | ( | JID | jid, |
String | nickname, | ||
boolean | isHost, | ||
boolean | isLocal, | ||
int | colorID, | ||
int | favoriteColorID | ||
) |
boolean de.fu_berlin.inf.dpp.session.User.equals | ( | Object | obj | ) |
int de.fu_berlin.inf.dpp.session.User.getColorID | ( | ) |
int de.fu_berlin.inf.dpp.session.User.getFavoriteColorID | ( | ) |
JID de.fu_berlin.inf.dpp.session.User.getJID | ( | ) |
String de.fu_berlin.inf.dpp.session.User.getNickname | ( | ) |
Returns the nickname of the user. The nickname persist through the whole session and will therefore not change.
Permission de.fu_berlin.inf.dpp.session.User.getPermission | ( | ) |
Gets current project User.Permission of this user.
int de.fu_berlin.inf.dpp.session.User.hashCode | ( | ) |
boolean de.fu_berlin.inf.dpp.session.User.hasReadOnlyAccess | ( | ) |
Utility method to determine whether this user has User.Permission#READONLY_ACCESS
true
if this User has User.Permission#READONLY_ACCESS, false
otherwise.This is always !hasWriteAccess()
boolean de.fu_berlin.inf.dpp.session.User.hasWriteAccess | ( | ) |
Utility method to determine whether this user has User.Permission#WRITE_ACCESS
true
if this User has User.Permission#WRITE_ACCESS, false
otherwise.This is always !hasReadOnlyAccess()
boolean de.fu_berlin.inf.dpp.session.User.isClient | ( | ) |
Returns true if this user is not the host.
boolean de.fu_berlin.inf.dpp.session.User.isHost | ( | ) |
Returns true if this user is the one that initiated the SarosSession session and thus is responsible for synchronization, User.Permission management,
boolean de.fu_berlin.inf.dpp.session.User.isInSession | ( | ) |
Checks if the user is still part of the session. A user object that is no longer part of the session will never be part of the session again. In other words: userA.equals(userB) <=> true but userA == userB <=> false.
true
if the user is part of the session, false
otherwise boolean de.fu_berlin.inf.dpp.session.User.isLocal | ( | ) |
Returns true if this User object identifies the user which is using the local Eclipse instance as opposed to the remote users in different Eclipse instances.
boolean de.fu_berlin.inf.dpp.session.User.isRemote | ( | ) |
Returns true if this User is not the local user.
void de.fu_berlin.inf.dpp.session.User.setColorID | ( | int | colorID | ) |
FOR INTERNAL USE ONLY
colorID |
void de.fu_berlin.inf.dpp.session.User.setInSession | ( | boolean | isInSession | ) |
FOR INTERNAL USE ONLY
void de.fu_berlin.inf.dpp.session.User.setPermission | ( | Permission | permission | ) |
set the current user User.Permission of this user inside the current project.
permission |
String de.fu_berlin.inf.dpp.session.User.toString | ( | ) |