com.ibm.security.auth
Class LinuxNumericGroupPrincipal
- java.lang.Object
com.ibm.security.auth.LinuxNumericGroupPrincipal
All implemented interfaces:
java.io.Serializable, java.security.Principal
- public class LinuxNumericGroupPrincipal
- extends java.lang.Object
- implements java.security.Principal, java.io.Serializable
This class represents a user's Linux group identification number (GID).
Principals such as this LinuxNumericGroupPrincipal
may be associated with a particular Subject
to augment that Subject
with an additional
identity. Refer to the Subject
class for more information
on how to achieve this. Authorization decisions can then be based upon
the Principals associated with a Subject
.
This class will be replaced by GroupIDPrincipal
and
PrimaryGroupIDPrincipal
in future releases of JAAS.
See Also:
Constructor Summary
Constructor and Description |
---|
LinuxNumericGroupPrincipal(long name,boolean primaryGroup)
Create a
LinuxNumericGroupPrincipal using a
long representation of the user's group identification number (GID).
|
LinuxNumericGroupPrincipal(java.lang.String name,boolean primaryGroup)
Create a
LinuxNumericGroupPrincipal using a
String representation of the user's
group identification number (GID).
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
equals(java.lang.Object o)
Compares the specified Object with this
LinuxNumericGroupPrincipal
for equality.
|
|
getName()
Return the user's group identification number (GID) for this
LinuxNumericGroupPrincipal .
|
|
hashCode()
Return a hash code for this
LinuxNumericGroupPrincipal .
|
|
isPrimaryGroup()
Return whether this group identification number (GID) represents
the primary group to which this user belongs.
|
|
longValue()
Return the user's group identification number (GID) for this
LinuxNumericGroupPrincipal as a long.
|
|
toString()
Return a string representation of this
LinuxNumericGroupPrincipal .
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail
LinuxNumericGroupPrincipal
- public LinuxNumericGroupPrincipal( java.lang.String name,
- boolean primaryGroup)
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 the name
is null
. LinuxNumericGroupPrincipal
- public LinuxNumericGroupPrincipal( long name,
- boolean primaryGroup)
Create a
LinuxNumericGroupPrincipal
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 this
LinuxNumericGroupPrincipal
.
Specified by:
getName
in interface java.security.Principal
Returns:
the user's group identification number (GID) for this
LinuxNumericGroupPrincipal
longValue
- public long longValue()
Return the user's group identification number (GID) for this
LinuxNumericGroupPrincipal
as a long.
Returns:
the user's group identification number (GID) for this
LinuxNumericGroupPrincipal
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 this
LinuxNumericGroupPrincipal
.
Specified by:
toString
in interface java.security.Principal
Overrides:
toString
in class java.lang.Object
Returns:
a string representation of this
LinuxNumericGroupPrincipal
. equals
- public boolean equals(java.lang.Object o)
Compares the specified Object with this
LinuxNumericGroupPrincipal
for equality. Returns true if the given object is also a
LinuxNumericGroupPrincipal
and the two
LinuxNumericGroupPrincipals
have the same group identification number (GID).
Specified by:
equals
in interface java.security.Principal
Overrides:
equals
in class java.lang.Object
Parameters:
o
- Object to be compared for equality with this
LinuxNumericGroupPrincipal
. Returns:
true if the specified Object is equal equal to this
LinuxNumericGroupPrincipal
. hashCode
- public int hashCode()
Return a hash code for this
LinuxNumericGroupPrincipal
.
Specified by:
hashCode
in interface java.security.Principal
Overrides:
hashCode
in class java.lang.Object
Returns:
a hash code for this
LinuxNumericGroupPrincipal
.
LinuxNumericGroupPrincipal
using aString
representation of the user's group identification number (GID).