info.magnolia.jaas.principal
Class PrincipalCollectionImpl

java.lang.Object
  extended by info.magnolia.jaas.principal.PrincipalCollectionImpl
All Implemented Interfaces:
info.magnolia.cms.security.auth.PrincipalCollection, Serializable, Iterable<Principal>, Principal

public class PrincipalCollectionImpl
extends Object
implements info.magnolia.cms.security.auth.PrincipalCollection

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

Author:
Sameer Charles $Id: PrincipalCollectionImpl.java 48388 2011-08-17 08:29:13Z dlipp $
See Also:
Serialized Form

Constructor Summary
PrincipalCollectionImpl()
           
 
Method Summary
 void add(Principal principal)
          Adds principal to the internal collection of principals.
 void addAll(Collection<Principal> principal)
          Adds principals 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<Principal> 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<Principal> collection)
          Deprecated. since 4.5
 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 info.magnolia.cms.security.auth.PrincipalCollection
Specified by:
getName in interface Principal
Returns:
name

setName

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

Specified by:
setName in interface info.magnolia.cms.security.auth.PrincipalCollection

set

@Deprecated
public void set(Collection<Principal> collection)
Deprecated. since 4.5

Sets internal collection of principals.

Specified by:
set in interface info.magnolia.cms.security.auth.PrincipalCollection

add

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

Specified by:
add in interface info.magnolia.cms.security.auth.PrincipalCollection
Parameters:
principal - to be added to the collection

addAll

public void addAll(Collection<Principal> principal)
Adds principals to the internal collection of principals.

Specified by:
addAll in interface info.magnolia.cms.security.auth.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 info.magnolia.cms.security.auth.PrincipalCollection
Parameters:
principal - to be removed from the collection

clearAll

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

Specified by:
clearAll in interface info.magnolia.cms.security.auth.PrincipalCollection

contains

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

Specified by:
contains in interface info.magnolia.cms.security.auth.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 info.magnolia.cms.security.auth.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 info.magnolia.cms.security.auth.PrincipalCollection
Parameters:
name -
Returns:
principal object associated to the specified name.

iterator

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

Specified by:
iterator in interface info.magnolia.cms.security.auth.PrincipalCollection
Specified by:
iterator in interface Iterable<Principal>
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-2011 Magnolia International Ltd.. All Rights Reserved.