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

Holds the attributes for an AccuRev user session: principal name, host machine IP address, and length of time logged in. AcSession objects are instantiated during AcSessions construction. More...

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

Public Member Functions

string ToString (string format, IFormatProvider provider)
 The ToString implementation. More...
 
Equality comparison
bool Equals (AcSession other)
 IEquatable implementation to determine the equality of instances of type AcSession. Uses AccuRev principal name and IP address of the host machine to compare instances. More...
 
override bool Equals (object other)
 Overridden to determine equality. More...
 
override int GetHashCode ()
 Override appropriate for type AcSession. More...
 

Internal Functions

 AcSession ()
 Constructor used during AcSessions list construction. It is called internally and not by user code. More...
 

Properties

string Name [get, set]
 User's AccuRev principal name. More...
 
string Host [get, set]
 IP address of the host machine. More...
 
AcDuration Duration [get, set]
 Length of time the user has been logged on. More...
 

Order comparison

int CompareTo (AcSession other)
 Generic IComparable implementation (default) for comparing AcSession objects to sort by Duration and then Name. More...
 
int IComparable. CompareTo (object other)
 Pre-generic interface implementation for code using reflection. More...
 

Detailed Description

Holds the attributes for an AccuRev user session: principal name, host machine IP address, and length of time logged in. AcSession objects are instantiated during AcSessions construction.

AccuNote:
A server IP address change requires renewing the session token for the service account that runs the AccuRev service, otherwise trigger operations will fail. To do so, reissue the persistent login command login -n for the service account.

Definition at line 33 of file AcSessions.cs.

Constructor & Destructor Documentation

AcUtils.AcSession.AcSession ( )
inlinepackage

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

Definition at line 44 of file AcSessions.cs.

Referenced by AcUtils.AcSession.CompareTo().

Member Function Documentation

int AcUtils.AcSession.CompareTo ( AcSession  other)
inline

Generic IComparable implementation (default) for comparing AcSession objects to sort by Duration and then Name.

Parameters
otherAn AcSession object to compare with this instance.
Returns
Value indicating the relative order of the AcSession objects being compared.
See also
AcSessions example

Definition at line 98 of file AcSessions.cs.

Referenced by AcUtils.AcSession.CompareTo().

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

Pre-generic interface implementation for code using reflection.

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

Definition at line 120 of file AcSessions.cs.

bool AcUtils.AcSession.Equals ( AcSession  other)
inline

IEquatable implementation to determine the equality of instances of type AcSession. Uses AccuRev principal name and IP address of the host machine to compare instances.

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

Definition at line 55 of file AcSessions.cs.

Referenced by AcUtils.AcSession.Equals().

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

Overridden to determine equality.

Returns
Return value of generic Equals(AcSession) version.

Definition at line 68 of file AcSessions.cs.

override int AcUtils.AcSession.GetHashCode ( )
inline

Override appropriate for type AcSession.

Returns
Hash of AccuRev principal name and IP address of the host machine.

Definition at line 80 of file AcSessions.cs.

string AcUtils.AcSession.ToString ( string  format,
IFormatProvider  provider 
)
inline

The ToString implementation.

Parameters
formatThe format specifier to use, e.g. Console.WriteLine(rule.ToString("n"));
providerAllow clients to format output for their own types using ICustomFormatter.
Returns
The formatted string.
Exceptions
FormatExceptionthrown if an invalid format string is specified.
Format specifiers:
  • G Default when not using a format specifier.
  • N Name - User's AccuRev principal name.
  • H Host - IP address of the host machine.
  • D Duration - Length of time the user has been logged on.

Definition at line 173 of file AcSessions.cs.

Property Documentation

AcDuration AcUtils.AcSession.Duration
getset

Length of time the user has been logged on.

See also
AcDuration.ToString

Definition at line 153 of file AcSessions.cs.

Referenced by AcUtils.AcSession.CompareTo(), and AcUtils.AcSessions.initAsync().

string AcUtils.AcSession.Host
getset

IP address of the host machine.

Definition at line 143 of file AcSessions.cs.

Referenced by AcUtils.AcSession.GetHashCode(), and AcUtils.AcSessions.initAsync().

string AcUtils.AcSession.Name
getset

User's AccuRev principal name.

Definition at line 134 of file AcSessions.cs.

Referenced by AcUtils.AcSession.CompareTo(), AcUtils.AcSession.GetHashCode(), and AcUtils.AcSessions.initAsync().