Package com.sun.identity.policy.jaas
Class ISPermissionCollection
- java.lang.Object
-
- java.security.PermissionCollection
-
- com.sun.identity.policy.jaas.ISPermissionCollection
-
- All Implemented Interfaces:
Serializable
public class ISPermissionCollection extends PermissionCollection
This class represents a collection ofISPermissionobjects. It extends fromPermissionCollectionproviding implementation of abstract methods likeadd,implieselements. The rest of the required methods are used from the parent class.With any PermissionCollection, you can:
- add a permission to the collection using the
addmethod. - check to see if a particular permission is implied in the
collection, using the
impliesmethod. - enumerate all the permissions, using the
elementsmethod.
When it is desirable to group together a number of Permission objects of the same type, the
newPermissionCollectionmethod on that particular type of Permission object should first be called. The default behavior of the ISPermission class is to simply return a new instance ofISPermissionCollection(). The caller ofnewPermissionCollectionwould need to store permissions of the ISPermission in ISPermissionCollection returned.The ISPermissionCollection returned by the
Permission.newPermissionCollectionmethod is a homogeneous collection, which stores only ISPermission objects.- See Also:
Permission,PermissionCollection,Permissions, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ISPermissionCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Permission perm)Adds a permission object to the current collection of ISPermission objects.Enumerationelements()This method returns an Enumeration of permissions in this collection, which is ISPermission in our case.booleanimplies(Permission perm)Checks to see if the specified permission is implied by the collection of ISPermission objects held in this ISPermissionCollection.-
Methods inherited from class java.security.PermissionCollection
elementsAsStream, isReadOnly, setReadOnly, toString
-
-
-
-
Method Detail
-
add
public void add(Permission perm)
Adds a permission object to the current collection of ISPermission objects.- Specified by:
addin classPermissionCollection- Parameters:
perm- the ISPermission object to add.- Throws:
SecurityException- if this PermissionCollection object has been marked readonly exception IllegalArgumentException if the passed permission is not of ISPermission instance.
-
elements
public Enumeration elements()
This method returns an Enumeration of permissions in this collection, which is ISPermission in our case. This method gets called internally by java security code, to get all the permissions stored in this permission collection.- Specified by:
elementsin classPermissionCollection- Returns:
- Enumeration of all the ISPermissions held in this collection.
-
implies
public boolean implies(Permission perm)
Checks to see if the specified permission is implied by the collection of ISPermission objects held in this ISPermissionCollection. This method takes in a permission and loops through all the permissions in its store and call theirimplies>to evaluate the result.- Specified by:
impliesin classPermissionCollection- Parameters:
perm- the Permission object to compare.- Returns:
- true if "permission" is implied by the permissions in the collection, false if not.
-
-