Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.session.User Class Reference

List of all members.

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)

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
WRITE_ACCESS 
READONLY_ACCESS 

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.session.User.User ( JID  jid,
String  nickname,
boolean  isHost,
boolean  isLocal,
int  colorID,
int  favoriteColorID 
)

Member Function Documentation

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 ( )
Deprecated:
Will be replaced. Do not use this method in new code.
Returns:
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.

Returns:
the nickname of the user
Permission de.fu_berlin.inf.dpp.session.User.getPermission ( )

Gets current project User.Permission of this user.

Returns:
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

Returns:
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

Returns:
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.

Returns:
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

Parameters:
colorID
Deprecated:
this must only be called by the component that handles color changes
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.

Parameters:
permission
String de.fu_berlin.inf.dpp.session.User.toString ( )
 All Classes Namespaces Files Functions Variables Enumerations