Package com.sun.grid.security.login
Class NumericGroupPrincipal
- java.lang.Object
-
- com.sun.grid.security.login.NumericGroupPrincipal
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Principal
public class NumericGroupPrincipal extends java.lang.Object implements java.security.Principal, java.io.Serializable
Prinicipal
indentifing a group users. The name of the group is the group id.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NumericGroupPrincipal(long name, boolean primaryGroup)
Create aNumericGroupPrincipal
using a long representation of the user's group identification number (GID).NumericGroupPrincipal(java.lang.String name, boolean primaryGroup)
Create aNumericGroupPrincipal
using aString
representation of the user's group identification number (GID).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Compares the specified Object with thisNumericGroupPrincipal
for equality.java.lang.String
getName()
Return the user's group identification number (GID) for thisNumericGroupPrincipal
.int
hashCode()
Return a hash code for thisNumericGroupPrincipal
.boolean
isPrimaryGroup()
Return whether this group identification number (GID) represents the primary group to which this user belongs.long
longValue()
Return the user's group identification number (GID) for thisNumericGroupPrincipal
as a long.java.lang.String
toString()
Return a string representation of thisNumericGroupPrincipal
.
-
-
-
Constructor Detail
-
NumericGroupPrincipal
public NumericGroupPrincipal(java.lang.String name, boolean primaryGroup)
Create aNumericGroupPrincipal
using aString
representation of the user's group identification number (GID).- Parameters:
name
- the user's group identification number (GID) for this user.primaryGroup
- true if the specified GID represents the primary group to which this user belongs.- Throws:
java.lang.NullPointerException
- if thename
isnull
.
-
NumericGroupPrincipal
public NumericGroupPrincipal(long name, boolean primaryGroup)
Create aNumericGroupPrincipal
using a long representation of the user's group identification number (GID).- Parameters:
name
- the user's group identification number (GID) for this user represented as a long.primaryGroup
- true if the specified GID represents the primary group to which this user belongs.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the user's group identification number (GID) for thisNumericGroupPrincipal
.- Specified by:
getName
in interfacejava.security.Principal
- Returns:
- the user's group identification number (GID) for this
NumericGroupPrincipal
-
longValue
public long longValue()
Return the user's group identification number (GID) for thisNumericGroupPrincipal
as a long.- Returns:
- the user's group identification number (GID) for this
NumericGroupPrincipal
as a long.
-
isPrimaryGroup
public boolean isPrimaryGroup()
Return whether this group identification number (GID) represents the primary group to which this user belongs.- Returns:
- true if this group identification number (GID) represents the primary group to which this user belongs, or false otherwise.
-
toString
public java.lang.String toString()
Return a string representation of thisNumericGroupPrincipal
.- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
NumericGroupPrincipal
.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisNumericGroupPrincipal
for equality. Returns true if the given object is also aNumericGroupPrincipal
and the two NumericGroupPrincipals have the same group identification number (GID).- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Object to be compared for equality with thisNumericGroupPrincipal
.- Returns:
- true if the specified Object is equal equal to this
NumericGroupPrincipal
.
-
hashCode
public int hashCode()
Return a hash code for thisNumericGroupPrincipal
.- Specified by:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this
NumericGroupPrincipal
.
-
-