public class User extends CloneableDataObject implements ComponentOwner
Title: Service Event Fabric Core
Description: Defines a Security User.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CREATION_TIMESTAMP_ATTRIBUTE |
static java.lang.String |
DEFAULT_MNODE_ATTRIBUTE |
static java.lang.String |
DROPBOX_OWNER_ATTRIBUTE |
static java.lang.String |
LAST_ACCESS_TIMESTAMP_ATTRIBUTE |
static java.lang.String |
LAST_FAILED_ATTEMPT_TIMESTAMP_ATTRIBUTE |
DEFAULT_SERIAL_VERSION_ID
Modifier and Type | Method and Description |
---|---|
User |
clone()
Clones the user.
|
int |
compareTo(com.streamscape.sef.security.AbstractEntity other) |
java.lang.String |
getAlias()
Returns the alias of the user.
|
java.lang.String |
getAttribute(java.lang.String key)
Returns a value of an attribute with the specified key.
|
java.util.Date |
getCreationTimestamp()
Returns a timestamp indicating when the user was created.
|
java.lang.String |
getDescription()
Returns the description of the user.
|
java.lang.String |
getDNRecord()
Returns the Distinguished Name record.
|
java.lang.String |
getDNRecordWithoutSystemAttributes()
Returns the Distinguished Name record that does not contain system attributes.
|
java.util.Date |
getLastAccessTimestamp()
Returns a timestamp indicating when the user accessed the sysplex for the last time.
|
java.util.Date |
getLastFailedAttemptTimestamp()
Returns a timestamp indicating when the user tried unsuccessfully to access the sysplex for the last time.
|
CIString |
getName()
Returns the name of the user.
|
CIString |
getOrganization()
Returns the name of the organization associated with the user.
|
SecurityContext |
getSecurityContext()
Returns a Security Context associated with the user.
|
UserState |
getState()
Returns a current state of the user.
|
boolean |
hasOwnPermissions()
Checks if the user has own permissions (not only inherited from the corresponding groups).
|
boolean |
isAdministrator()
Checks if the user has administrator rights.
|
boolean |
isAnonymous()
Checks if the user is anonymous.
|
boolean |
isDistinguishedEntity()
Checks if the user is distinguished entity.
|
boolean |
isDropBoxOwner()
Checks if the user can be DropBox owner (such user can create new DropBoxes).
|
boolean |
isMemberOf(java.lang.String groupName)
Checks if the user is a member of a group with the specified name.
|
boolean |
isSudoCapable()
Checks if the user is sudo capable.
|
static boolean |
isSystemAttribute(java.lang.String name)
Checks if the specified attribute is a system one.
|
java.util.List |
listAttributes()
Returns the list of all attribute names.
|
java.util.List |
listGroups()
Returns a sorted list of names of all groups in which the user consists.
|
void |
removeAttribute(java.lang.String key)
Removes the specified value to an attribute with the specified key.
|
void |
setAlias(java.lang.String alias)
Sets the specified user alias.
|
void |
setAttribute(java.lang.String key,
java.lang.String value)
Sets the specified value to an attribute with the specified key.
|
void |
setDescription(java.lang.String description)
Sets the specified description of the user.
|
void |
setDistinguishedEntity(boolean distinguishedEntity)
Sets a flag indicating if the user is distinguished entity.
|
void |
setDropBoxOwner(boolean dropBoxOwner)
Sets a flag indicating if the user can be DropBox owner.
|
void |
setSudoCapable(boolean sudoCapable)
Sets a flag indicating if the user is sudo capable.
|
java.lang.String |
toString() |
getSerialVersionUID
public static final java.lang.String DEFAULT_MNODE_ATTRIBUTE
public static final java.lang.String CREATION_TIMESTAMP_ATTRIBUTE
public static final java.lang.String LAST_ACCESS_TIMESTAMP_ATTRIBUTE
public static final java.lang.String LAST_FAILED_ATTEMPT_TIMESTAMP_ATTRIBUTE
public static final java.lang.String DROPBOX_OWNER_ATTRIBUTE
public CIString getName()
getName
in interface ComponentOwner
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description to be set.public boolean isSudoCapable()
isSudoCapable
in interface ComponentOwner
true
if the user is sudo capable, false
otherwise.public void setSudoCapable(boolean sudoCapable)
sudoCapable
- the flag to be set.public boolean isDropBoxOwner()
true
if the user can be DropBox owner, false
otherwise.public void setDropBoxOwner(boolean dropBoxOwner)
dropBoxOwner
- the flag to be set.public boolean isDistinguishedEntity()
true
if the user is distinguished entity, false
otherwise.public void setDistinguishedEntity(boolean distinguishedEntity)
distinguishedEntity
- the flag to be set.public boolean isMemberOf(java.lang.String groupName)
groupName
- the name of a group to be checked.true
if the user is a member of the specified group, false
otherwise.public java.util.List listGroups()
public CIString getOrganization()
public void setAttribute(java.lang.String key, java.lang.String value) throws SecurityManagerException
CREATION_TIMESTAMP_ATTRIBUTE
, LAST_ACCESS_TIMESTAMP_ATTRIBUTE
,
LAST_FAILED_ATTEMPT_TIMESTAMP_ATTRIBUTE
and DROPBOX_OWNER_ATTRIBUTE
cannot be changed.key
- the attribute key.value
- the value to be set.SecurityManagerException
- if the specified attribute key matches a system attribute.public void removeAttribute(java.lang.String key) throws SecurityManagerException
CREATION_TIMESTAMP_ATTRIBUTE
, LAST_ACCESS_TIMESTAMP_ATTRIBUTE
,
LAST_FAILED_ATTEMPT_TIMESTAMP_ATTRIBUTE
and DROPBOX_OWNER_ATTRIBUTE
cannot be changed.key
- the key of an attribute to be removed.SecurityManagerException
- if the specified attribute key matches a system attribute.public static boolean isSystemAttribute(java.lang.String name)
name
- the attribute name.true
if the specified attribute is a system one, false
otherwise.public java.lang.String getAttribute(java.lang.String key)
key
- the key of an attribute to be looked up.null
if the attribute was not found.public java.util.List listAttributes()
public java.lang.String getDNRecord()
null
if the user has no attributes.public java.lang.String getDNRecordWithoutSystemAttributes()
null
if the user has no non-system attributes.public java.lang.String getAlias()
public void setAlias(java.lang.String alias)
alias
- the user alias to be set.public boolean isAdministrator()
isAdministrator
in interface ComponentOwner
true
if the user has administrator rights, false
otherwise.public boolean isAnonymous()
true
if the user is anonymous, false
otherwise.public boolean hasOwnPermissions()
true
if permissions of the user have been changed manually (granted or revoked).
See methods SecurityManager.addUserPermission(String, AccessControlOperation)
or
SecurityManager.removeUserPermission(String, AccessControlOperation)
for further details.
SecurityManager.resetUserPermissions(String)
should be used to cancel all manual changes.
After that the user will have only permissions inherited from its groups.true
if the user has own permissions, false
otherwise.public UserState getState()
public SecurityContext getSecurityContext()
null
.getSecurityContext
in interface ComponentOwner
null
if the user has no active Fabric components bound to it.public java.util.Date getCreationTimestamp()
null
if this timestamp is not available.public java.util.Date getLastAccessTimestamp()
null
if this timestamp is not available.public java.util.Date getLastFailedAttemptTimestamp()
null
if this timestamp is not available.public User clone()
clone
in interface CloneableObject
clone
in class CloneableDataObject
public int compareTo(com.streamscape.sef.security.AbstractEntity other)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.