Class User
- All Implemented Interfaces:
IServerResource,IUser,IUserSummary
-
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, typeFields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable -
Constructor Summary
ConstructorsConstructorDescriptionUser()Default constructor -- sets all summary and extended fields to null.User(String loginName, String email, String fullName, Date access, Date update, String password, String jobView, IUserSummary.UserType type, ViewMap<IReviewSubscription> reviewSubscriptions) Explicit-value constructor.User(String loginName, String email, String fullName, Date access, Date update, String password, String jobView, ViewMap<IReviewSubscription> reviewSubscriptions) Explicit-value constructor.Constructs a User from the passed-in map. -
Method Summary
Modifier and TypeMethodDescriptionstatic UserSimple convenience factory method to create a new local User object with default (null) jobView and reviewSubscriptions fields.voidrefresh()Refresh the underlying object from the Perforce server.voidsetJobView(String jobView) voidsetPassword(String password) voidsetReviewSubscriptions(ViewMap<IReviewSubscription> reviewSubscriptions) voidupdate()Update the Perforce server object associated with the underlying P4Java object, if possible.voidupdate(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, setUpdateMethods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, setRawField, setRawFields, setRefreshable, setServer, toDateString, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.perforce.p4java.core.IServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, setRawField, setRawFields, setServer, updateMethods inherited from interface com.perforce.p4java.core.IUserSummary
getAccess, getEmail, getFullName, getLoginName, getPasswordChange, getTicketExpiration, getType, getUpdate, setAccess, setEmail, setFullName, setLoginName, setType, setUpdate
-
Constructor Details
-
User
public User()Default constructor -- sets all summary and extended fields to null. -
User
public User(String loginName, String email, String fullName, Date access, Date update, String password, String jobView, ViewMap<IReviewSubscription> reviewSubscriptions) Explicit-value constructor.- Parameters:
loginName- loginNameemail- emailfullName- fullNameaccess- accessupdate- updatepassword- passwordjobView- jobViewreviewSubscriptions- reviewSubscriptions
-
User
public User(String loginName, String email, String fullName, Date access, Date update, String password, String jobView, IUserSummary.UserType type, ViewMap<IReviewSubscription> reviewSubscriptions) Explicit-value constructor.- Parameters:
loginName- loginNameemail- emailfullName- fullNameaccess- accessupdate- updatepassword- passwordjobView- jobViewtype- typereviewSubscriptions- reviewSubscriptions
-
User
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 Details
-
newUser
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
- Specified by:
getPasswordin interfaceIUser- See Also:
-
setPassword
- Specified by:
setPasswordin interfaceIUser- See Also:
-
getJobView
- Specified by:
getJobViewin interfaceIUser- See Also:
-
setJobView
- Specified by:
setJobViewin interfaceIUser- See Also:
-
getReviewSubscriptions
- Specified by:
getReviewSubscriptionsin interfaceIUser- See Also:
-
setReviewSubscriptions
- Specified by:
setReviewSubscriptionsin interfaceIUser- See Also:
-
refresh
Description copied from interface:IServerResourceRefresh 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:
refreshin interfaceIServerResource- Overrides:
refreshin 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:
-
update
Description copied from interface:IServerResourceUpdate 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:
updatein interfaceIServerResource- Overrides:
updatein 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:
-
update
Description copied from interface:IServerResourceForce (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:
updatein interfaceIServerResource- Specified by:
updatein interfaceIUser- Overrides:
updatein 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:
-