Skip to main content

com.eruces.teadmin.PrincipalInfo

The PrincipalInfo class is an abstract class that keeps the common attribute for all principals.

Inheritance

Protected Attributes

TypeNameDescription
intm_nSystemIDAn integer representing the system ID.
longm_nPrincipalIDAn integer representing the principal ID.
PListm_listRoleIDA PList object representing the Role IDs.
intm_nFlagsAn integer representing the flags.
PListm_listGroupA PList object representing the list of groups to which this principal belongs.
PListm_listReviewerIDA PList object representing the list of reviewer IDs.
PListm_listAclTemplateIdA PList object representing the list of of ACL template IDs.
longm_defaultGroupAn integer representing the default group ID.

Public Member Functions

MemberDescription
PrincipalInfo()The PrincipalInfo constructor is the default class constructor.
PrincipalInfo(long nPrincipalID)The PrincipalInfo constructor specifies a principal ID.
PrincipalInfo(int nSystemID, long nPrincipalID)The PrincipalInfo constructor specifies a system ID and a principal ID.
long getPrincipalID()The getPrincipalID method gets a principal's unique identifier.
void setPrincipalID(long nPrincipalID)The setPrincipalID method sets a principal ID.
int getSystemID()The getSystemID method gets a system ID.
abstract String getPrincipalName()The getPrincipalName method gets a principal name.
PList getRoleIDs()The getRoleIDs method gets a list of role IDs.
void addRole(long nRoleID)The addRole method adds a role to a principal's information.
void removeRole(long nRoleID)The removeRole method removes a role from a principal's information.
void removeRole()The removeRole method removes an empty role from a principal's information.
void clearRoles()The clearRoles method removes all roles from a principal's information.
PList getGroupIDs()The getGroupIDs method gets a list of IDs for the groups to which the principal belongs.
long getGroupID()The getGroupID method gets the unique identifier for the group to which a principal belongs.
void addGroup(long nGroupID)The addGroup method adds a group ID to a principal's information.
void clearGroup()The clearGroup method removes all group IDs from a principal's information.
void removeGroup(long nGroupID)The removeGroup method removes the group ID from a principal's information.
boolean isBuiltIn()The isBuiltIn method checks whether a principal is preset or user-defined.
boolean isDisabled()The isDisabled method checks whether a principal is active or disabled.
void setDisableStatus(boolean bStatus)The setDisableStatus method sets a variable that disables or enables a principal.
abstract boolean equals(Object anotherInfo)The equals method compares two principals.
String toString()The toString method converts PrincipalInfo object data to a string.

Member Function Documentation

PrincipalInfo()

The PrincipalInfo constructor is the default class constructor.

PrincipalInfo(long nPrincipalID)

The PrincipalInfo constructor specifies a principal ID.

Parameters

ParameterDescription
nPrincipalIDAn integer representing a principal ID.

PrincipalInfo(int nSystemID, long nPrincipalID)

The PrincipalInfo constructor specifies a system ID and a principal ID.

Parameters

ParameterDescription
nSystemIDAn integer representing a system ID.
nPrincipalIDAn integer representing a principal ID.

long getPrincipalID()

The getPrincipalID method gets a principal's unique identifier.

Returns: Returns an integer representing a principal ID.

void setPrincipalID(long nPrincipalID)

The setPrincipalID method sets a principal ID.

Parameters

ParameterDescription
nPrincipalIDAn integer representing a principal ID.

int getSystemID()

The getSystemID method gets a system ID.

Returns: Returns an integer representing a system ID.

abstract String getPrincipalName()

The getPrincipalName method gets a principal name.

Returns: Returns a string representing a principal name.

PList getRoleIDs()

The getRoleIDs method gets a list of role IDs.

Returns: Returns a list of role IDs.

void addRole(long nRoleID)

The addRole method adds a role to a principal's information.

Parameters

ParameterDescription
nRoleIDAn integer representing a role ID.

void removeRole(long nRoleID)

The removeRole method removes a role from a principal's information.

Parameters

ParameterDescription
nRoleIDAn integer representing a role ID.

void removeRole()

The removeRole method removes an empty role from a principal's information.

void clearRoles()

The clearRoles method removes all roles from a principal's information.

PList getGroupIDs()

The getGroupIDs method gets a list of IDs for the groups to which the principal belongs.

Returns: A PList object representing the list of group IDs.

Remark: Because in current version, one principal can only have one group So only one group will be in list

long getGroupID()

The getGroupID method gets the unique identifier for the group to which a principal belongs.

Returns: An integer representing the group ID.

void addGroup(long nGroupID)

The addGroup method adds a group ID to a principal's information.

Parameters

ParameterDescription
nGroupIDAn integer representing a group ID.

void clearGroup()

The clearGroup method removes all group IDs from a principal's information.

void removeGroup(long nGroupID)

The removeGroup method removes the group ID from a principal's information.

Parameters

ParameterDescription
nGroupIDAn integer representing the group ID.

Remark: because one principal must belongs to one group, so the group cannot be removed, use set group instead

boolean isBuiltIn()

The isBuiltIn method checks whether a principal is preset or user-defined.

Returns: A boolean value representing the origination of a principal; True = preset principal, False = user-defined principal.

boolean isDisabled()

The isDisabled method checks whether a principal is active or disabled.

Returns: A boolean value representing the status of a principal; True = principal has been disabled, False = principal is active.

void setDisableStatus(boolean bStatus)

The setDisableStatus method sets a variable that disables or enables a principal.

Parameters

ParameterDescription
bStatusA boolean value indicating the action to be taken; True = disable the principal, False = enable the principal.

abstract boolean equals(Object anotherInfo)

The equals method compares two principals.

Parameters

ParameterDescription
anotherInfoA PrincipalInfo object to which the current PrincipalInfo object will be compared.

Returns: Returns a boolean value indicating whether the two principals are the same; True = principals are the same, False = principals are different.

Remark: Overrides the equals method in the java.lang.Object class.

String toString()

The toString method converts PrincipalInfo object data to a string.

Returns: Returns a string representing PrincipalInfo object data.

Remark: Overrides the toString method in the com.eruces.teadmin.UpdatableObject class.