Homepage

org.talos.model
Class SecureObject

java.lang.Object
  extended by org.talos.model.SecureObject
All Implemented Interfaces:
NamedObject

public class SecureObject
extends Object
implements NamedObject

This class represents a secure object. A secure object is the target or of an action for which a permission might be required.


Constructor Summary
protected SecureObject()
          Empty constructor needed by Hibernate
  SecureObject(String name)
          Public constructor that receives a name.
 
Method Summary
protected  void add(Category category)
          Adds this object to a category.
 boolean containsAll(Collection<Category> list)
          Checks if this object belongs to all categories in the list.
 SecureObject copy(String objectName)
          Creates a new, transient SecureObject with the given name, belonging to all categories that this object belongs to.
 boolean equals(Object obj)
           
 Set<Category> getCategories()
          Gets the set of categories to which this object belongs.
 String getName()
          Gets the name of the object
 int hashCode()
           
protected  void remove(Category category)
          Removes this object from a category.
protected  void setCategories(Set<Category> categories)
          Sets the categories to which this object belongs.
protected  void setName(String name)
          Sets the name of the SecureObject.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecureObject

protected SecureObject()
Empty constructor needed by Hibernate


SecureObject

public SecureObject(String name)
Public constructor that receives a name. The name must be not null.

Parameters:
name - the name for the secure object
Method Detail

getName

public String getName()
Description copied from interface: NamedObject
Gets the name of the object

Specified by:
getName in interface NamedObject
Returns:
the name of the object

setName

protected void setName(String name)
Sets the name of the SecureObject.

Parameters:
name - the name of the object

getCategories

public Set<Category> getCategories()
Gets the set of categories to which this object belongs.

Returns:
the categories to which this object belongs.

setCategories

protected void setCategories(Set<Category> categories)
Sets the categories to which this object belongs.

Parameters:
categories - a set of categories

add

protected void add(Category category)
Adds this object to a category. Must be a non-null, persistent Category instance.

Parameters:
category - the category to add this object to
See Also:
Category.add(SecureObject), remove(Category)

remove

protected void remove(Category category)
Removes this object from a category. Must be a non-null, persistent Category instance.

Parameters:
category - the category to remove this object from
See Also:
Category.remove(SecureObject), add(Category)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

containsAll

public boolean containsAll(Collection<Category> list)
Checks if this object belongs to all categories in the list.

Parameters:
list - a list of categories
Returns:
true if the object belongs to all categories, false otherwise
See Also:
add(Category), remove(Category)

copy

public SecureObject copy(String objectName)
Creates a new, transient SecureObject with the given name, belonging to all categories that this object belongs to.

Parameters:
objectName - the name of the new object
Returns:
a new SecureObject

Homepage