Class User
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- com.perforce.p4java.impl.generic.core.UserSummary
-
- com.perforce.p4java.impl.generic.core.User
-
- All Implemented Interfaces:
IServerResource
,IUser
,IUserSummary
public class User extends UserSummary implements IUser
Simple default IUser implementation class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IUserSummary
IUserSummary.UserType
-
-
Field Summary
-
Fields inherited from class com.perforce.p4java.impl.generic.core.UserSummary
passwordChange, ticketExpiration, type
-
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
-
-
Constructor Summary
Constructors Constructor Description User()
Default constructor -- sets all summary and extended fields to null.User(java.lang.String loginName, java.lang.String email, java.lang.String fullName, java.util.Date access, java.util.Date update, java.lang.String password, java.lang.String jobView, IUserSummary.UserType type, ViewMap<IReviewSubscription> reviewSubscriptions)
Explicit-value constructor.User(java.lang.String loginName, java.lang.String email, java.lang.String fullName, java.util.Date access, java.util.Date update, java.lang.String password, java.lang.String jobView, ViewMap<IReviewSubscription> reviewSubscriptions)
Explicit-value constructor.User(java.util.Map<java.lang.String,java.lang.Object> map, IServer server)
Constructs a User from the passed-in map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getJobView()
java.lang.String
getPassword()
ViewMap<IReviewSubscription>
getReviewSubscriptions()
static User
newUser(java.lang.String name, java.lang.String email, java.lang.String fullName, java.lang.String password)
Simple convenience factory method to create a new local User object with default (null) jobView and reviewSubscriptions fields.void
refresh()
Refresh the underlying object from the Perforce server.void
setJobView(java.lang.String jobView)
void
setPassword(java.lang.String password)
void
setReviewSubscriptions(ViewMap<IReviewSubscription> reviewSubscriptions)
void
update()
Update the Perforce server object associated with the underlying P4Java object, if possible.void
update(boolean force)
Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible.-
Methods inherited from class com.perforce.p4java.impl.generic.core.UserSummary
getAccess, getEmail, getFullName, getLoginName, getPasswordChange, getTicketExpiration, getType, getUpdate, setAccess, setEmail, setFullName, setLoginName, setType, setUpdate
-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, update
-
Methods inherited from interface com.perforce.p4java.core.IUserSummary
getAccess, getEmail, getFullName, getLoginName, getPasswordChange, getTicketExpiration, getType, getUpdate, setAccess, setEmail, setFullName, setLoginName, setType, setUpdate
-
-
-
-
Constructor Detail
-
User
public User()
Default constructor -- sets all summary and extended fields to null.
-
User
public User(java.lang.String loginName, java.lang.String email, java.lang.String fullName, java.util.Date access, java.util.Date update, java.lang.String password, java.lang.String jobView, ViewMap<IReviewSubscription> reviewSubscriptions)
Explicit-value constructor.- Parameters:
loginName
- loginNameemail
- emailfullName
- fullNameaccess
- accessupdate
- updatepassword
- passwordjobView
- jobViewreviewSubscriptions
- reviewSubscriptions
-
User
public User(java.lang.String loginName, java.lang.String email, java.lang.String fullName, java.util.Date access, java.util.Date update, java.lang.String password, java.lang.String jobView, IUserSummary.UserType type, ViewMap<IReviewSubscription> reviewSubscriptions)
Explicit-value constructor.- Parameters:
loginName
- loginNameemail
- emailfullName
- fullNameaccess
- accessupdate
- updatepassword
- passwordjobView
- jobViewtype
- typereviewSubscriptions
- reviewSubscriptions
-
User
public User(java.util.Map<java.lang.String,java.lang.Object> map, IServer server)
Constructs a User from the passed-in map. The map is assumed to come from a suitable call on IServer; if the map is null this is equivalent to calling the default constructor.- Parameters:
map
- spec mapserver
- server
-
-
Method Detail
-
newUser
public static User newUser(java.lang.String name, java.lang.String email, java.lang.String fullName, java.lang.String password)
Simple convenience factory method to create a new local User object with default (null) jobView and reviewSubscriptions fields.- Parameters:
name
- non-null user name.email
- user's email address.fullName
- user's full name.password
- user's password (usually ignored).- Returns:
- new local user object.
-
getPassword
public java.lang.String getPassword()
- Specified by:
getPassword
in interfaceIUser
- See Also:
IUser.getPassword()
-
setPassword
public void setPassword(java.lang.String password)
- Specified by:
setPassword
in interfaceIUser
- See Also:
IUser.setPassword(java.lang.String)
-
getJobView
public java.lang.String getJobView()
- Specified by:
getJobView
in interfaceIUser
- See Also:
IUser.getJobView()
-
setJobView
public void setJobView(java.lang.String jobView)
- Specified by:
setJobView
in interfaceIUser
- See Also:
IUser.setJobView(java.lang.String)
-
getReviewSubscriptions
public ViewMap<IReviewSubscription> getReviewSubscriptions()
- Specified by:
getReviewSubscriptions
in interfaceIUser
- See Also:
IUser.getReviewSubscriptions()
-
setReviewSubscriptions
public void setReviewSubscriptions(ViewMap<IReviewSubscription> reviewSubscriptions)
- Specified by:
setReviewSubscriptions
in interfaceIUser
- See Also:
IUser.setReviewSubscriptions(com.perforce.p4java.core.ViewMap)
-
refresh
public void refresh() throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Refresh the underlying object from the Perforce server.The details of what "refreshable" means in this context are always object-dependent, but typically mean that "live" data and metadata will be updated from the server.
The results of calling this method on objects whose canRefresh method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
refresh
in interfaceIServerResource
- Overrides:
refresh
in classServerResource
- Throws:
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its processing of the requestAccessException
- if the Perforce server denies access to the caller- See Also:
ServerResource.refresh()
-
update
public void update() throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
update
in interfaceIServerResource
- Overrides:
update
in classServerResource
- Throws:
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its processing of the requestAccessException
- if the Perforce server denies access to the caller- See Also:
ServerResource.update()
-
update
public void update(boolean force) throws ConnectionException, RequestException, AccessException
Description copied from interface:IServerResource
Force (if true) update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.Note, in order to force the change it may require super user / admin privileges to work properly.
The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).
- Specified by:
update
in interfaceIServerResource
- Specified by:
update
in interfaceIUser
- Overrides:
update
in classServerResource
- Parameters:
force
- if true, force the update of the object on the server.- Throws:
ConnectionException
- if the Perforce server is unreachable or is not connected.RequestException
- if the Perforce server encounters an error during its processing of the requestAccessException
- if the Perforce server denies access to the caller- See Also:
IServerResource.update(boolean)
-
-