AcUtils
A high performance abstraction layer for AccuRev
Public Member Functions | Internal Functions | Properties | List of all members
AcUtils.AcPrincipal Class Reference

Contains the AccuRev principal attributes name, ID and status (active or inactive) for users and groups. Additionally, lists of group members and user group memberships are initialized optionally as per AcGroups and AcUsers constructor parameters includeMembersList and includeGroupsList respectively. More...

Collaboration diagram for AcUtils.AcPrincipal:
Collaboration graph
[legend]

Public Member Functions

override string ToString ()
 Returns the AccuRev principal name. More...
 
Equality comparison
bool Equals (AcPrincipal other)
 IEquatable implementation to determine the equality of instances of type AcPrincipal. Uses the AccuRev principal ID number to compare instances. More...
 
override bool Equals (object other)
 Overridden to determine equality. More...
 
override int GetHashCode ()
 Override appropriate for type AcPrincipal. More...
 

Internal Functions

 AcPrincipal ()
 Constructor used during AcUsers and AcGroups list construction. It is called internally and not by user code. More...
 

Properties

int ID [get, set]
 AccuRev principal ID number for the user or group. More...
 
string Name [get, set]
 AccuRev principal name for the user or group. More...
 
PrinStatus Status [get, set]
 Whether the principal is active or inactive in AccuRev. More...
 
SortedSet< string > Members [get, set]
 The list of groups a user has membership in, or the list of principals (users and groups) in a group. Both initialized optionally as per AcGroups and AcUsers constructor parameters includeMembersList and includeGroupsList respectively. More...
 

Order comparison

int CompareTo (AcPrincipal other)
 Generic IComparable implementation (default) for comparing AcPrincipal objects to sort by AccuRev principal name. More...
 
int IComparable. CompareTo (object other)
 Pre-generic interface implementation for code using reflection. More...
 

Detailed Description

Contains the AccuRev principal attributes name, ID and status (active or inactive) for users and groups. Additionally, lists of group members and user group memberships are initialized optionally as per AcGroups and AcUsers constructor parameters includeMembersList and includeGroupsList respectively.

Definition at line 52 of file AcPrincipal.cs.

Constructor & Destructor Documentation

AcUtils.AcPrincipal.AcPrincipal ( )
inlinepackage

Constructor used during AcUsers and AcGroups list construction. It is called internally and not by user code.

Definition at line 65 of file AcPrincipal.cs.

Referenced by AcUtils.AcPrincipal.CompareTo().

Member Function Documentation

int AcUtils.AcPrincipal.CompareTo ( AcPrincipal  other)
inline

Generic IComparable implementation (default) for comparing AcPrincipal objects to sort by AccuRev principal name.

Parameters
otherAn AcPrincipal object to compare with this instance.
Returns
Value indicating the relative order of the AcPrincipal objects being compared.

Definition at line 115 of file AcPrincipal.cs.

Referenced by AcUtils.AcPrincipal.CompareTo().

int IComparable. AcUtils.AcPrincipal.CompareTo ( object  other)
inlineprivate

Pre-generic interface implementation for code using reflection.

Parameters
otherAn AcPrincipal object to compare with this instance.
Returns
Return value of generic CompareTo(AcPrincipal) version.
Exceptions
ArgumentExceptionthrown if argument is not an AcPrincipal object.

Definition at line 131 of file AcPrincipal.cs.

bool AcUtils.AcPrincipal.Equals ( AcPrincipal  other)
inline

IEquatable implementation to determine the equality of instances of type AcPrincipal. Uses the AccuRev principal ID number to compare instances.

Parameters
otherThe AcPrincipal object being compared to this instance.
Returns
true if AcPrincipal other is the same, false otherwise.

Definition at line 77 of file AcPrincipal.cs.

Referenced by AcUtils.AcPrincipal.Equals().

override bool AcUtils.AcPrincipal.Equals ( object  other)
inline

Overridden to determine equality.

Returns
Return value of generic Equals(AcPrincipal) version.

Definition at line 88 of file AcPrincipal.cs.

override int AcUtils.AcPrincipal.GetHashCode ( )
inline

Override appropriate for type AcPrincipal.

Returns
AccuRev principal ID number since it's immutable and unique across both users and groups.

Definition at line 100 of file AcPrincipal.cs.

override string AcUtils.AcPrincipal.ToString ( )
inline

Returns the AccuRev principal name.

Definition at line 185 of file AcPrincipal.cs.

Property Documentation

int AcUtils.AcPrincipal.ID
getset

AccuRev principal ID number for the user or group.

Definition at line 145 of file AcPrincipal.cs.

Referenced by AcUtils.AcPrincipal.GetHashCode(), AcUtils.AcUser.GetHashCode(), AcUtils.AcGroups.initAsync(), and AcUtils.AcWorkspaces.storeWSpaces().

SortedSet<string> AcUtils.AcPrincipal.Members
getset

The list of groups a user has membership in, or the list of principals (users and groups) in a group. Both initialized optionally as per AcGroups and AcUsers constructor parameters includeMembersList and includeGroupsList respectively.

AccuNote:
We use a set object as a workaround for show -fx -u <user> groups where the same group names are repeated multiple times. AccuRev defect 28001.

Definition at line 177 of file AcPrincipal.cs.

Referenced by AcUtils.AcDepots.canViewAsync(), AcUtils.AcUser.getGroups(), AcUtils.AcGroups.getMembers(), AcUtils.AcUser.initGroupsListAsync(), and AcUtils.AcGroups.initMembersListAsync().

string AcUtils.AcPrincipal.Name
getset
PrinStatus AcUtils.AcPrincipal.Status
getset

Whether the principal is active or inactive in AccuRev.

Definition at line 163 of file AcPrincipal.cs.

Referenced by AcUtils.AcGroups.initAsync().