public class User extends Entity implements java.lang.Cloneable
User
object in the Oracle Lite Mobile
Server repository.AUTH_TYPE, CONN_MAX_EXCEEDED, DEVICE_DELETE, DEVICE_REGISTER, EMPTY_STR, INVALID_ADDRESS, INVALID_DEVICE, INVALID_DIR, INVALID_ID, INVALID_INF, INVALID_NAME, INVALID_PARAM, INVALID_PLATFORM, INVALID_PROVIDER, INVALID_RESOURCE, INVALID_TYPE, INVALID_URL, NOT_FOUND, NOT_INITIALIZED, NOTIFY_CLASS, NOTIFY_ON_STATUS, NOTIFY_ON_VERIFY, RESOURCE_ENABLED, RESOURCE_VALID, SEP, STR_ANY, STR_BASE_NAME, STR_DMC, STR_EMPTY, STR_FALSE, STR_INF, STR_INF_EXT, STR_ONE, STR_TRUE, STR_WILD, STR_ZERO, SYSTEM_ID, TIME, UPDATE_MAJOR, UPDATE_MINOR, UPDATE_SOFTWARE, UPDATE_SOFTWARE_APPS, UPDATE_SOFTWARE_DMC
Constructor and Description |
---|
User(java.lang.String name,
java.lang.String pwd,
java.lang.String dispName)
Construct a User object from the given information.
|
Modifier and Type | Method and Description |
---|---|
void |
addLog(java.lang.String msg)
Log a user level message.
|
boolean |
canUpdate()
Check if the User has enough privilege for software/data update
|
void |
changePassword(java.lang.String pwd)
Change the existing password of the user.
|
boolean |
checkPassword(java.lang.String pwd)
Check to see if the passwords are identical.
|
java.lang.Object |
clone(oracle.lite.dm.Context ctx)
Clone
oracle.lite.resource.User object. |
boolean |
equals(java.lang.Object o)
Check if the given Resource object is same as this object.
|
Application |
getApplication(java.lang.String name,
java.lang.String platform)
Retrieve an application that matches the platform type.
|
java.util.Hashtable |
getApplications()
Retrieve all provisioned applications for this user.
|
oracle.lite.dm.Context |
getAuthenticationContext()
Retrieve the authentication context object associated with the
User object. |
byte[] |
getContext()
Retrieve the temporary context string as a
byte array. |
Device |
getDevice(java.lang.String id)
Retrieve a device object registered to this user; given a device id.
|
Device |
getDeviceByName(java.lang.String name)
Retrieve a device object registered to this user; given a device name.
|
Device |
getDeviceByUdid(java.lang.String udid)
Retrieve a iOS device object registered to this user; given a device udid.
|
java.util.Enumeration |
getDevices()
Retrieve all devices associated with this user object.
|
java.lang.String |
getDisplayName()
Retrieve the display name of the user
|
java.util.ArrayList |
getGroups()
Retrieve all group objects this user belongs to.
|
java.lang.String |
getGUID()
Get GUID of the user (Note: GUID may be null for some users)
|
java.util.Enumeration |
getLogs()
Retrieve all the logs of this user from the repository.
|
java.lang.String |
getOldHash()
Return the 'old' style password hash.
|
java.lang.String |
getPassword()
Get the encoded password string of the User.
|
java.lang.String |
getRole()
Get user's role as a string value.
|
boolean |
hasAccess(Application app)
Check if the user has access rights to a given Application.
|
int |
hashCode() |
boolean |
hasMemberAssociation(User memberUser)
Check if the given member user is associated with this user.
|
boolean |
hasPolicy(java.lang.String name,
java.lang.String val)
Check if the user has the policy string set.
|
boolean |
hasValidPassword()
Check to see if the User has a valid password or not.
|
boolean |
isExternal()
Check if the user is external.
|
boolean |
isMemberUser()
Check if the user is a member user.
|
void |
registerDevice(Device device,
java.lang.String cid)
Registration process makes this user as the owner of the device.
|
void |
setDisplayName(java.lang.String name)
Set a new display name
|
void |
setExternal(boolean isExternal)
Set a flag indicating if the user is external.
|
void |
setGUID(java.lang.String guid)
Set a new GUID.
|
void |
setPassword(java.lang.String pwd)
Set a temporary password for the user.
|
void |
setRole(java.lang.String role)
Set a new role.
|
delete, getAttribute, getId, getKey, isEnabled, isSystemResource, isValid, removeAttribute, save, setAttribute, setEnabled, setNew, validateAttribute
public User(java.lang.String name, java.lang.String pwd, java.lang.String dispName)
name
- User name (Unique short name)pwd
- Password stringdispName
- Human readable namepublic void addLog(java.lang.String msg) throws ResourceException
msg
- Message string.oracle.lite.resource.ResourceException
ResourceException
public boolean canUpdate()
public void changePassword(java.lang.String pwd) throws ResourceException
pwd
- Password string.oracle.lite.resource.ResourceException
ResourceException
public boolean checkPassword(java.lang.String pwd)
pwd
- Password string to be checked against.public java.lang.Object clone(oracle.lite.dm.Context ctx) throws java.lang.CloneNotSupportedException
oracle.lite.resource.User
object.ctx
- Context objectCloneNotSupportedException
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object o)
Resource
public Application getApplication(java.lang.String name, java.lang.String platform) throws ResourceException
name
- Application nameplatform
- Platform typenull
if one does not existoracle.lite.resource.ResourceException
ResourceException
public java.util.Hashtable getApplications() throws ResourceException
getApplications
in class Entity
oracle.lite.resource.ResourceException
ResourceException
public oracle.lite.dm.Context getAuthenticationContext()
User
object.oracle.lite.dm.Context
object or null
if a context does not exist.public byte[] getContext()
byte
array.
If an authentication context does not exist, this method will return
null
.public Device getDevice(java.lang.String id) throws ResourceException
id
- Device Idoracle.lite.resource.ResourceException
ResourceException
public Device getDeviceByName(java.lang.String name) throws ResourceException
name
- Device nameoracle.lite.resource.ResourceException
ResourceException
public Device getDeviceByUdid(java.lang.String udid) throws ResourceException
udid
- Device udidoracle.lite.resource.ResourceException
ResourceException
public java.util.Enumeration getDevices() throws ResourceException
java.util.Enumeration
object containing all Devices.oracle.lite.resource.ResourceException
ResourceException
public java.lang.String getDisplayName()
String
public java.util.ArrayList getGroups() throws ResourceException
java.util.ArrayList
containing Group objects.oracle.lite.resource.ResourceException
ResourceException
public java.lang.String getGUID()
String
public java.util.Enumeration getLogs() throws ResourceException
oracle.lite.resource.ResourceException
ResourceException
public java.lang.String getOldHash()
public java.lang.String getPassword()
String
public java.lang.String getRole()
String
public boolean hasAccess(Application app)
public boolean hasMemberAssociation(User memberUser)
memberUser
- member userpublic boolean hasPolicy(java.lang.String name, java.lang.String val)
name
- Policy nameval
- Expected valuetrue
if the policy string existspublic boolean hasValidPassword()
public boolean isExternal()
public boolean isMemberUser()
public void registerDevice(Device device, java.lang.String cid) throws ResourceException
ResourceException
.device
- Device objectcid
- Device generated client idoracle.lite.resource.ResourceException
ResourceException
public void setDisplayName(java.lang.String name)
name
- Display Namepublic void setExternal(boolean isExternal)
isExternal
- true for external users, false for internal userspublic void setGUID(java.lang.String guid)
guid
- GUID of the userpublic void setPassword(java.lang.String pwd)
pwd
- Password string.public void setRole(java.lang.String role)
role
- String value of user role.