info.magnolia.jaas.principal
Class PrincipalCollectionImpl

java.lang.Object
  extended by info.magnolia.jaas.principal.PrincipalCollectionImpl
All Implemented Interfaces:
PrincipalCollection, Serializable, Principal

public class PrincipalCollectionImpl
extends Object
implements PrincipalCollection

Principal collection implementation based on simple list. Collection is managed externally. Date: Jun 29, 2005

Author:
Sameer Charles $Id: PrincipalCollectionImpl.java 41137 2011-01-06 18:19:25Z gjoseph $
See Also:
Serialized Form

Constructor Summary
PrincipalCollectionImpl()
           
 
Method Summary
 void add(Principal principal)
          Adds principal to the internal collection of principals.
 void clearAll()
          removes all principals from the collection.
 boolean contains(Principal principal)
          Checks if this collection contains specified principal.
 boolean contains(String name)
          Checks if this collection contains principal with the specified name.
 Principal get(String name)
          Gets principal associated to the specified name from the collection.
 String getName()
          Gets name given to this principal.
 Iterator iterator()
          Returns an iterator over the collection of principals.
 void remove(Principal principal)
          Removes principal from the collection if present or does nothing in case principal was not present in the collection.
 void set(Collection collection)
          Sets internal collection of principals.
 void setName(String name)
          Sets this principal name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Constructor Detail

PrincipalCollectionImpl

public PrincipalCollectionImpl()
Method Detail

getName

public String getName()
Gets name given to this principal.

Specified by:
getName in interface PrincipalCollection
Specified by:
getName in interface Principal
Returns:
name

setName

public void setName(String name)
Sets this principal name.

Specified by:
setName in interface PrincipalCollection

set

public void set(Collection collection)
Sets internal collection of principals.

Specified by:
set in interface PrincipalCollection
Parameters:
collection -

add

public void add(Principal principal)
Adds principal to the internal collection of principals.

Specified by:
add in interface PrincipalCollection
Parameters:
principal - to be added to the collection

remove

public void remove(Principal principal)
Removes principal from the collection if present or does nothing in case principal was not present in the collection.

Specified by:
remove in interface PrincipalCollection
Parameters:
principal - to be removed from the collection

clearAll

public void clearAll()
removes all principals from the collection.

Specified by:
clearAll in interface PrincipalCollection

contains

public boolean contains(Principal principal)
Checks if this collection contains specified principal.

Specified by:
contains in interface PrincipalCollection
Returns:
true if the specified object exist in the collection, false otherwise.

contains

public boolean contains(String name)
Checks if this collection contains principal with the specified name.

Specified by:
contains in interface PrincipalCollection
Parameters:
name -
Returns:
true if the collection contains the principal by the specified name, false otherwise.

get

public Principal get(String name)
Gets principal associated to the specified name from the collection.

Specified by:
get in interface PrincipalCollection
Parameters:
name -
Returns:
principal object associated to the specified name.

iterator

public Iterator iterator()
Returns an iterator over the collection of principals.

Returns:
iterator for Principal objects

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.