com.ace.moab.api.acl
Class ACL

java.lang.Object
  extended by com.ace.moab.api.acl.ACL
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ACL>, java.lang.Iterable<ACLRule>

public class ACL
extends java.lang.Object
implements java.lang.Comparable<ACL>, java.lang.Iterable<ACLRule>, java.io.Serializable

This class represents the complete access control list for a given object. This is a collection of ACLRule classes that describe the rules of access to an object inside of Moab.

Author:
Brady Kimball
See Also:
Serialized Form

Constructor Summary
ACL()
          Initializes a new ACL class with no behavior.
ACL(java.util.Collection<ACLRule> acl)
          Initializes a new ACL class with the collection of ACLRule classes describing the ACL's behavior.
 
Method Summary
 void addACLRule(ACLRule aclObject)
          Adds an ACLRule to the collection describing access.
 void clearACL()
          Removes all rules from the access control list.
 int compareTo(ACL o)
          
 boolean contains(ACLRule aclObject)
          Returns true if the access control list contains the ACLRule rule.
 boolean equals(java.lang.Object o)
          
 java.util.Set<java.lang.String> getAccountsInACL()
           Returns a set of account names in alphabetical order that are found in this ACL.
 java.util.Set<java.lang.String> getClassesInACL()
           Returns a set of user names in alphabetical order that are found in this ACL.
 java.util.Set<java.lang.String> getGroupsInACL()
           Returns a set of group names in alphabetical order that are found in this ACL.
 java.util.Set<java.lang.String> getQOSInACL()
           Returns a set of QoS names in alphabetical order that are found in this ACL.
 java.util.Set<java.lang.String> getUsersInACL()
           Returns a set of user names in alphabetical order that are found in this ACL.
 boolean hasAccess(Credential cred)
          Check to see if the user represented by the Credential object parameter has access to the this ACL object (or the object that owns this ACL).
 java.util.Iterator<ACLRule> iterator()
          
 void removeACLRule(ACLRule aclObject)
           Removes a specified ACLRule from the collection describing access.
 int size()
          Returns the number of rules inside the access control list.
 java.lang.String toMoabVPCCommandString()
          Builds a string representation of the VPC ACL for use in Moab commands.
 java.util.Set<ACLRule> toSet()
          Returns a set of the rules describing the access control list.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ACL

public ACL()
Initializes a new ACL class with no behavior. By default, this ACL describes that no access is granted to a given object within Moab.


ACL

public ACL(java.util.Collection<ACLRule> acl)
Initializes a new ACL class with the collection of ACLRule classes describing the ACL's behavior.

Parameters:
acl - the collection describing the ACL's behavior.
Method Detail

addACLRule

public void addACLRule(ACLRule aclObject)
Adds an ACLRule to the collection describing access.

Parameters:
aclObject - the ACLRule rule ot add.

removeACLRule

public void removeACLRule(ACLRule aclObject)

Removes a specified ACLRule from the collection describing access.

If the ACLRule is not part of the ACL, the remove request is ignored.

Parameters:
aclObject - the ACLRule rule to remove.

clearACL

public void clearACL()
Removes all rules from the access control list.


contains

public boolean contains(ACLRule aclObject)
Returns true if the access control list contains the ACLRule rule.

Parameters:
aclObject - the rule to check if in access control list.
Returns:
true if the access control list contains the ACLRule rule; false, otherwise.

size

public int size()
Returns the number of rules inside the access control list.

Returns:
the number of rules inside the access control list.

toSet

public java.util.Set<ACLRule> toSet()
Returns a set of the rules describing the access control list.

Returns:
a set of the rules describing the access control list.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toMoabVPCCommandString

public java.lang.String toMoabVPCCommandString()
Builds a string representation of the VPC ACL for use in Moab commands.

Returns:
a string representation of the VPC ACL for use in Moab commands.

iterator

public java.util.Iterator<ACLRule> iterator()

Specified by:
iterator in interface java.lang.Iterable<ACLRule>

getUsersInACL

public java.util.Set<java.lang.String> getUsersInACL()

Returns a set of user names in alphabetical order that are found in this ACL.

If no users are found in the ACL, an empty set is returned.

Returns:
a set of user names in alphabetical order that are found in this ACL.

getClassesInACL

public java.util.Set<java.lang.String> getClassesInACL()

Returns a set of user names in alphabetical order that are found in this ACL.

If no users are found in the ACL, an empty set is returned.

Returns:
a set of user names in alphabetical order that are found in this ACL.

getAccountsInACL

public java.util.Set<java.lang.String> getAccountsInACL()

Returns a set of account names in alphabetical order that are found in this ACL.

If no accounts are found in the ACL, an empty set is returned.

Returns:
a set of account names in alphabetical order that are found in this ACL.

getQOSInACL

public java.util.Set<java.lang.String> getQOSInACL()

Returns a set of QoS names in alphabetical order that are found in this ACL.

If no QoSes are found in the ACL, an empty set is returned.

Returns:
a set of QoS names in alphabetical order that are found in this ACL.

getGroupsInACL

public java.util.Set<java.lang.String> getGroupsInACL()

Returns a set of group names in alphabetical order that are found in this ACL.

If no groups are found in the ACL, an empty set is returned.

Returns:
a set of group names in alphabetical order that are found in this ACL.

hasAccess

public boolean hasAccess(Credential cred)
Check to see if the user represented by the Credential object parameter has access to the this ACL object (or the object that owns this ACL).

Parameters:
cred - The current user credential
Returns:
true if the user represented by the credential parameter has access to this ACL, false otherwise

compareTo

public int compareTo(ACL o)

Specified by:
compareTo in interface java.lang.Comparable<ACL>

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.