pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.accesscontrol
Class AbstractAccessControlObject

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.AbstractNamedEntity
          extended by org.torweg.pulse.util.entity.AbstractNamableEntity
              extended by org.torweg.pulse.accesscontrol.AbstractAccessControlObject
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed
Direct Known Subclasses:
AbstractUserBase, Group, Permission, Role

public abstract class AbstractAccessControlObject
extends AbstractNamableEntity
implements JDOMable

Defines JSON-support and helper-methods for entities in the access-control.

Version:
$Revision: 2013 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
AbstractAccessControlObject()
           
 
Method Summary
protected  java.util.List<? extends AbstractAccessControlObject> getAssociatedAbstractAccessControlObjects(org.hibernate.Session s, java.lang.Class<? extends AbstractAccessControlObject> clazz, java.lang.String alias, java.lang.Long id)
          Loads the {@code
protected  org.hibernate.Criteria getLoadCriteriaForClassWithAlias(org.hibernate.Session s, java.lang.Class<? extends AbstractAccessControlObject> c, java.lang.String alias, java.lang.Long id)
          Returns a Criteria to load the AbstractAccessControlObjects associated with the given {@code Class
 net.sf.json.JSONObject toJSON()
          Serializes the state of the AbstractAccessControlObject to a JSONObject.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity
setName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity
getName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.torweg.pulse.bundle.JDOMable
deserializeToJDOM
 
Methods inherited from interface org.torweg.pulse.util.INamed
getName
 

Constructor Detail

AbstractAccessControlObject

public AbstractAccessControlObject()
Method Detail

toJSON

public net.sf.json.JSONObject toJSON()
Serializes the state of the AbstractAccessControlObject to a JSONObject.

Is supposed to be overridden by extending sub-classes.

Returns:
the AbstractAccessControlObject as a JSONObject

getAssociatedAbstractAccessControlObjects

protected final java.util.List<? extends AbstractAccessControlObject> getAssociatedAbstractAccessControlObjects(org.hibernate.Session s,
                                                                                                                java.lang.Class<? extends AbstractAccessControlObject> clazz,
                                                                                                                java.lang.String alias,
                                                                                                                java.lang.Long id)
Loads the <? extends AbstractAccessControlObject>s specified by clazz associated with the <? extends AbstractAccessControlObject> s specified by alias specified further by id.

Parameters:
s - the hibernateTM-Session
clazz - the Class<? extends AbstractAccessControlObject>
alias - the alias
id - the id
Returns:
a List<? extends AbstractAccessControlObject>

getLoadCriteriaForClassWithAlias

protected final org.hibernate.Criteria getLoadCriteriaForClassWithAlias(org.hibernate.Session s,
                                                                        java.lang.Class<? extends AbstractAccessControlObject> c,
                                                                        java.lang.String alias,
                                                                        java.lang.Long id)
Returns a Criteria to load the AbstractAccessControlObjects associated with the given Class<? extends AbstractBasicEntity>.

Parameters:
s - the hibernateTM Session
c - the Class<? extends AbstractBasicEntity> to build the Criteria for
alias - the alias to be used
id - the id of the AbstractAccessControlObject
Returns:
a Criteria to load the AbstractAccessControlObjects associated with the given Class<? extends AbstractBasicEntity>