Class UserModel
java.lang.Object
com.highdeal.hci.UserModel
- All Implemented Interfaces:
IClientAware, XMLMarshallable
This
Java class represents a user of SAP Convergent Charging software; A user is any person (individual) or machine (service) allowed to
work with SAP CC according to his assigned roles
and resulting authorizations.
Each message sent via HCI must include a header with
the identifier of an SAP CC user as originator of the message.
A user is identified by a login/password.
If the advanced password management feature is enabled, each password has to conform to the complexity rules that have been defined by the administrator. Passwords may also have an expiration date after which they must be changed. A user can also be locked and thus prevented to do any operation if his password is wrongly entered several times.
SAP CC users are divided into two categories: individual (human) and service (non-human) users:
- Individual users are dialog users as opposed to service users. They have different policies regarding passwords. Dialog users can be locked because of a number of failed authentication attempts, and must modify their password regularly. On the other hand, service users cannot be locked for unsuccessful login attempts and their password never expire.
- Service users are intended for automated processes where such restrictions could cause an interruption of service.
Caution
Consult the SAP CC Security Guide about the role and authorization concept of SAP Convergent Charging.
- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="user">
<xs:complexType>
<xs:sequence>
<xs:element name="permission" minOccurs="0" maxOccurs="unbounded"> <!-- i.e. a role -->
<xs:complexType>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element ref="assignment" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="login" type="xs:string"/>
<xs:attribute name="password" type="xs:string"/>
<xs:attribute name="clientNumber" type="xs:integer"/>
<xs:attribute name="catalogName" type="xs:string"/>
<xs:attribute name="locked" type="xs:boolean"/>
<xs:attribute name="human" type="xs:boolean" use="optional" default="true" /> <!-- deprecated -->
<xs:attribute name="technical" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="passwordAuthEnabled" type="xs:boolean" use="optional" default="true" />
<xs:attribute name="passwordRevoked" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="samlAuthEnabled" type="xs:boolean" use="optional" default="true" />
<xs:attribute name="oauthTokenEnabled" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="oauthAuthEnabled" type="xs:boolean" use="optional" default="false" />
<xs:attribute name="creationDate" type="xs:dateTime"/>
<xs:attribute name="lastModificationDate" type="xs:dateTime"/>
<xs:attribute name="validFrom" type="xs:dateTime"/>
<xs:attribute name="validTo" type="xs:dateTime"/>
<xs:attribute name="globalUserId" type="xs:string"/>
<xs:attribute name="displayName" type="xs:string"/>
</xs:complexType>
</xs:element>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe XML attribute name for OAuth authentication enabledstatic final StringThe XML attribute name for OAuth authentication enabledstatic final StringThe XML attribute name for password-based authentication enabledstatic final StringThe XML attribute name for password revokedstatic final StringThe XML attribute name for SAML authentication enabledstatic final StringThe XML node tag name for the user model: "user"Fields inherited from interface IClientAware
CLIENT_NUMBER_100, NO_CLIENT_NUMBER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.voidaddUserRightAssignment(UserRightAssignmentModel assignment) Adds a single assignment to the list.Deprecated.Deprecated.UsegetUserRightAssignments()and access client number per assignment.Returns the date when this SAP CC user has been created.Returns the display name.Returns the effective list of assignments, regardless of whether this model uses legacy flat fields or explicit multi-assignment mode.Returns the global user ID.getId()Returns the ID of this SAP CC user.Returns the date of the last modification of this SAP CC user through themodify user operation.Returns the login of this SAP CC user.Returns the password of this SAP CC user.Deprecated.UsegetUserRightAssignments()and access permissions per assignment.Returns the explicit multi-assignment list.Returns the start date of the validity period for this SAP CC user.Returns the end date of the validity period for this SAP CC user.booleanisHuman()Deprecated.UseisTechnical()instead.booleanisLocked()Returns whether the SAP CC user is locked.booleanReturnstrueif the XML input mixed legacy flat attributes (clientNumber,catalogName, or<permission>children directly on<user>) with explicit<assignment>child elements.booleanReturns whether this model has more than one assignment.booleanGets the flag that enable or disable the OAuth authentication for this SAP CC user.booleanGets the flag that enable or disable the OAuth token generation for this SAP CC user.booleanReturns whether the password-based authentication is enabled for this SAP CC user.booleanTells whether or not this SAP CC user must change his password on next login.booleanReturns whether the SAML authentication is enabled for this SAP CC user.booleanGets whether the SAP CC user is a technical user (service user).voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetCatalogName(String catalogName) Deprecated.UsegetUserRightAssignments()and set catalog per assignment.voidsetClientNumber(Integer clientNumber) Deprecated.UsegetUserRightAssignments()and set client number per assignment.voidsetCreationDate(Date creationDate) Sets the creation date for this SAP CC user.voidsetDisplayName(String displayName) Sets the display name.voidsetGlobalUserId(String globalUserId) Sets the global user ID.voidsetHuman(boolean human) Deprecated.UsesetTechnical(boolean)instead.voidSets the ID for this SAP CC user.voidsetLastModificationDate(Date lastModificationDate) Sets the last modification date for this SAP CC user.voidsetLocked(boolean locked) Sets whether the SAP CC user is locked.voidsetLoginID(String id) Sets the login for this SAP CC user.voidsetOauthAuthEnabled(boolean oauthAuthEnabled) Sets the flag that enable or disable the OAuth authentication for this SAP CC user.voidsetOauthTokenEnabled(boolean oauthTokenEnabled) Sets the flag that enable or disable the OAuth token generation for this SAP CC user.voidsetPassword(String pw) Sets the password for this SAP CC user.voidsetPasswordAuthEnabled(boolean value) Sets the flag that enable or disable the password-based authentication for this SAP CC user.voidsetPasswordRevoked(boolean passwordRevoked) Sets the flag that force this SAP CC user to change his password.voidsetSamlAuthEnabled(boolean value) Sets the flag that enable or disable the SAML authentication for this SAP CC user.voidsetTechnical(boolean technical) Sets whether the SAP CC user is a technical user.voidsetUserRightAssignments(List<UserRightAssignmentModel> assignments) Sets the assignment list and enables multi-assignment mode.voidsetValidFrom(Date validFrom) Sets the validity period start date for this SAP CC user.voidsetValidTo(Date validTo) Sets the validity period end date for this SAP CC user.
-
Field Details
-
TAG_NAME
-
PASSWORD_REVOKED_ATTRIBUTE_NAME
The XML attribute name for password revoked- See Also:
-
PASSWORD_AUTH_ENABLED_ATTRIBUTE_NAME
The XML attribute name for password-based authentication enabled- See Also:
-
SAML_AUTH_ENABLED_ATTRIBUTE_NAME
The XML attribute name for SAML authentication enabled- See Also:
-
OAUTH_TOKEN_ENABLED_ATTRIBUTE_NAME
The XML attribute name for OAuth authentication enabled- See Also:
-
OAUTH_AUTH_ENABLED_ATTRIBUTE_NAME
The XML attribute name for OAuth authentication enabled- See Also:
-
-
Constructor Details
-
UserModel
public UserModel()
-
-
Method Details
-
getId
-
setId
Sets the ID for this SAP CC user.- Parameters:
id- The ID for this SAP CC user
-
getLoginID
Returns the login of this SAP CC user.- Returns:
- The login of this SAP CC user
-
setLoginID
Sets the login for this SAP CC user.- Parameters:
id- The login for this SAP CC user
-
getPassword
Returns the password of this SAP CC user.- Returns:
- The password of this SAP CC user
-
setPassword
Sets the password for this SAP CC user.- Parameters:
pw- The password for this SAP CC user
-
getPermissions
Deprecated.UsegetUserRightAssignments()and access permissions per assignment.Returns the list of role(s)/permission(s) assigned to this SAP CC user. Returns a live mutable list -- callers may add permissions directly to the returned list. Creates a default assignment if none exists, so the returned list is always backed by storage.- Returns:
- A mutable list of String representing existing role names
- Throws:
IllegalStateException- if the user is in multi-assignment mode
-
getCatalogName
Deprecated.UsegetUserRightAssignments()and access catalog per assignment.Returns the name of the pricing catalog associated to this SAP CC user.- Returns:
- The name of the catalog associated to this user, or
null - Throws:
IllegalStateException- if the user is in multi-assignment mode
-
setCatalogName
Deprecated.UsegetUserRightAssignments()and set catalog per assignment.Sets the name of the catalog associated to this SAP CC user.- Parameters:
catalogName- The name of the catalog, ornull- Throws:
IllegalStateException- if the user is in multi-assignment mode
-
getClientNumber
Deprecated.UsegetUserRightAssignments()and access client number per assignment.Description copied from interface:IClientAwareReturns the client number, could be null.- Specified by:
getClientNumberin interfaceIClientAware- Returns:
- the client number
-
setClientNumber
Deprecated.UsegetUserRightAssignments()and set client number per assignment.Sets the client number associated to this SAP CC user.- Parameters:
clientNumber- the client number- Throws:
IllegalStateException- if the user is in multi-assignment mode
-
isLocked
public boolean isLocked()Returns whether the SAP CC user is locked.- Returns:
- Whether the SAP CC user is locked
-
setLocked
public void setLocked(boolean locked) Sets whether the SAP CC user is locked.- Parameters:
locked- Whether the SAP CC user is locked
-
isHuman
Deprecated.UseisTechnical()instead.Gets whether the SAP CC user is not a technical user.- Returns:
trueif the user is not a technical user,falseotherwise
-
setHuman
Deprecated.UsesetTechnical(boolean)instead.Sets whether the user is not a technical user.- Parameters:
human- Whether the user is not a technical user
-
isTechnical
public boolean isTechnical()Gets whether the SAP CC user is a technical user (service user).- Returns:
trueif the user is a technical user,falseotherwise
-
setTechnical
public void setTechnical(boolean technical) Sets whether the SAP CC user is a technical user.- Parameters:
technical- Whether the SAP CC user is a technical user
-
isPasswordAuthEnabled
public boolean isPasswordAuthEnabled()Returns whether the password-based authentication is enabled for this SAP CC user.- Returns:
trueif the password-based authentication is enabled for this user
-
setPasswordAuthEnabled
public void setPasswordAuthEnabled(boolean value) Sets the flag that enable or disable the password-based authentication for this SAP CC user.- Parameters:
value-trueif the password-based authentication is enabled for this user
-
isSamlAuthEnabled
public boolean isSamlAuthEnabled()Returns whether the SAML authentication is enabled for this SAP CC user.- Returns:
trueif the SAML authentication is enabled for this user
-
setSamlAuthEnabled
public void setSamlAuthEnabled(boolean value) Sets the flag that enable or disable the SAML authentication for this SAP CC user.- Parameters:
value-trueif the SAML authentication is enabled for this user
-
isOauthTokenEnabled
public boolean isOauthTokenEnabled()Gets the flag that enable or disable the OAuth token generation for this SAP CC user.- Returns:
trueif the SAP CC user is allowed to request an OAuth (JWT) token from the token generation endpoint
-
setOauthTokenEnabled
public void setOauthTokenEnabled(boolean oauthTokenEnabled) Sets the flag that enable or disable the OAuth token generation for this SAP CC user.- Parameters:
oauthTokenEnabled-trueto allow the user to request an OAuth (JWT) token from the token generation endpoint
-
isOauthAuthEnabled
public boolean isOauthAuthEnabled()Gets the flag that enable or disable the OAuth authentication for this SAP CC user.- Returns:
trueif the SAP CC user is allowed to be authenticated on the WS/REST channels by a JWT bearer token resolved from the SAP CC Users
-
setOauthAuthEnabled
public void setOauthAuthEnabled(boolean oauthAuthEnabled) Sets the flag that enable or disable the OAuth authentication for this SAP CC user.- Parameters:
oauthAuthEnabled-trueto allow the user to be authenticated by a JWT bearer token resolved from the SAP CC Users
-
isPasswordRevoked
public boolean isPasswordRevoked()Tells whether or not this SAP CC user must change his password on next login.- Returns:
trueif this SAP CC user must change his password
-
setPasswordRevoked
public void setPasswordRevoked(boolean passwordRevoked) Sets the flag that force this SAP CC user to change his password.- Parameters:
passwordRevoked-trueif this user must change his password
-
getCreationDate
Returns the date when this SAP CC user has been created.- Returns:
- the date when this SAP CC user has been created.
-
setCreationDate
Sets the creation date for this SAP CC user. The creation date is managed by SAP CC, modified value will be ignored.- Parameters:
creationDate- the creation date.
-
getLastModificationDate
Returns the date of the last modification of this SAP CC user through themodify user operation.- Returns:
- the date of the last modification of this SAP CC user.
-
setLastModificationDate
Sets the last modification date for this SAP CC user. The last modification date is managed by SAP CC, modified value will be ignored.- Parameters:
lastModificationDate- the last modification date.
-
getValidFrom
Returns the start date of the validity period for this SAP CC user. A null value indicates that the validity period starts at the beginning of time. The validity period start date must be before the end date. The validity period is not available for technical users, any modification will be ignored. A SAP CC user interaction out of the defined validity period will be rejected.- Returns:
- the start date of the validity period for this SAP CC user, could be null.
-
setValidFrom
Sets the validity period start date for this SAP CC user.- Parameters:
validFrom- the validity period start date, could be null.
-
getValidTo
Returns the end date of the validity period for this SAP CC user. A null value indicates that the validity period never ends. The validity period end date must be after the start date. The validity period is not available for technical users, any modification will be ignored. A SAP CC user interaction out of the defined validity period will be rejected.- Returns:
- the end date of the validity period for this SAP CC user.
-
setValidTo
Sets the validity period end date for this SAP CC user.- Parameters:
validTo- the validity period end date, could be null.
-
getGlobalUserId
Returns the global user ID. The Global User ID uniquely identifies a user across applications and services.- Returns:
- the global user ID
-
setGlobalUserId
Sets the global user ID.- Parameters:
globalUserId- the global user ID
-
getDisplayName
Returns the display name. The display name is used in user interfaces to represent the user.- Returns:
- the display name
-
setDisplayName
Sets the display name.- Parameters:
displayName- the display name
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
isMixedFlatAndAssignments
public boolean isMixedFlatAndAssignments()Returnstrueif the XML input mixed legacy flat attributes (clientNumber,catalogName, or<permission>children directly on<user>) with explicit<assignment>child elements. These two models are mutually exclusive and this flag triggers a validation error. -
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
getUserRightAssignments
Returns the explicit multi-assignment list. If non-empty, these take precedence over the flatgetClientNumber()/getPermissions(). If empty, the model represents a single assignment (backward compatible). -
setUserRightAssignments
Sets the assignment list and enables multi-assignment mode. -
addUserRightAssignment
Adds a single assignment to the list. -
isMultiAssignment
public boolean isMultiAssignment()Returns whether this model has more than one assignment. -
getEffectiveAssignments
Returns the effective list of assignments, regardless of whether this model uses legacy flat fields or explicit multi-assignment mode.- Multi-assignment mode: returns the explicit assignment list (same as
getUserRightAssignments()). - Legacy mode: returns a singleton list containing the default assignment built from the
flat
clientNumber/catalogName/permissionfields.
null. - Multi-assignment mode: returns the explicit assignment list (same as
-
getUserRightAssignments()and access catalog per assignment.