Try OpenEdge Now
skip to main content
Java Open Clients
Connecting to an AppServer : Client principal class : Methods of the ClientPrincipal class
 

Methods of the ClientPrincipal class

The following table lists the methods of the of the ClientPrincipal class.
Table 3. Methods for the ClientPrincipal class
Method
Description
exportPrincipal()
Serializes the ClientPrincipal object into a byte array. A serialized ClientPrincipal object can be deserialized using the importPrincipal() method. If errors occur during the serialization process, an exception will be thrown.
getProperty(String propertyName )
Returns a string containing the value of the specified user-defined property stored in the ClientPrincipal object. If the specified property is not found, null will be returned.
importPrincipal(Byte[] serializedCP )
A static method that deserializes a byte array into a ClientPrincipal object. If errors occur during the deserialization process (e.g., an improperly formatted byte array), an exception will be thrown.
seal(String domainAccessCode )
When called by a user-defined authentication system, this method asserts the authenticity of the user represented by the ClientPrincipal object. If successful, the method returns true.
Calling this method is the beginning of the user's login session, and as a result, the loginState attribute is set to, and the sealTimestamp attribute is also set.
The ClientPrincipal object is cryptographically sealed using the specified domain access code. Once sealed, any attempt to set attributes will throw an exception.
seal(OEDomainRegistry domainRegistry )
When called by a user-defined authentication system, this method asserts the authenticity of the user represented by the ClientPrincipal object. If successful, the method returns true.
Calling this method is the beginning of the user's login session, and as a result, the loginState attribute is set to, and the sealTimestamp attribute is also set.
The ClientPrincipal object is cryptographically sealed using the domain access code defined in the OEDomainRegistry object. Once sealed, any attempt to set attributes will throw an exception.
setProperty(String propertyName,
            String propertyValue )
Sets the value of the specified property in the unsealed ClientPrincipal object. If successful, the method returns true.
validateSeal(String domainAccessCode )
Validates that the the ClientPrincipal object was sealed with the specified domain access code. If successful, the method returns true.
The loginExpirationTimeout attribute is also checked, and if the ClientPrincipal object has expired, the loginState attribute is set to "EXPIRED".
validateSeal(OEDomainRegistry domainRegistry )
Validates that the the ClientPrincipal object was sealed using the domain access code defined in the OEDomainRegistry object. If successful, the method returns true.
The loginExpirationTimeout attribute is also checked, and if the ClientPrincipal object has expired, the loginState attribute is set to "EXPIRED".