org.norther.tammi.root.db
Class DefaultBeanRepositoryClient

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.root.db.DefaultRepositoryClient
          extended by org.norther.tammi.root.db.DefaultMultiRepositoryClient
              extended by org.norther.tammi.root.db.DefaultBeanRepositoryClient
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, BeanRepositoryClient, MultiRepositoryClient, RepositoryClient
Direct Known Subclasses:
DefaultBeanRepositoryFilter

public class DefaultBeanRepositoryClient
extends DefaultMultiRepositoryClient
implements BeanRepositoryClient

A default implementation of BeanRepositoryClient.

Version:
$Id: DefaultBeanRepositoryClient.java,v 1.54 2009/10/06 18:05:10 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.root.db.DefaultRepositoryClient
AUTHENTICATED_SIGNATURE, DEFAULT_PERSISTER, KEY_SIGNATURE
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.root.db.BeanRepositoryClient
CLASS_NAME_ATTRIBUTE, GROUP_NAME_ATTRIBUTE, HIGH_ATTRIBUTE_PREFIX, IDENTITY_ATTRIBUTE, LOW_ATTRIBUTE_PREFIX, ORDER_BY_ATTRIBUTE, QUERY_LIMIT_ATTRIBUTE, QUERY_OFFSET_ATTRIBUTE, USERNAME_ATTRIBUTE
 
Constructor Summary
DefaultBeanRepositoryClient()
          Constructs a new repository client.
 
Method Summary
 boolean add1NForeignReferences(Object node, String className, String fkField, Object[] fks, Persister persister)
          Adds foreign references to 1:n relations in a tree.
 boolean add1NNullReferences(String className, String fkField, Object[] fks, Persister persister)
          Adds null references to 1:n relations in a tree.
 boolean add1NObjectReferences(Object node, String relField, String fkField, Object[] fks, Persister persister)
          Adds object references to 1:n relations in a tree formed by nodes of the same class.
 boolean addAttributeValues(Object node, String field, Persister persister, List<Object> result)
          Adds nested attribute values in a tree to a list.
 boolean addTo1NRelationMap(Object node, String fkField, DBCriteria<?> criteria, Persister persister, ConcurrentMap<Object,Object> map)
          Adds referenced objects fulfilling the specified criteria in a 1:n tree to a map.
 boolean addTo1NRelationMap(Object node, String relField, String fkField, DBCriteria<?> criteria, Persister persister, ConcurrentMap<Object,Object> map)
          Adds referenced objects fulfilling the specified criteria in a 1:n tree to a map.
 boolean addToAttributeChain(Object node, String relField, String valueField, Persister persister, List<Object> list)
          Adds attribute values of a chain of referenced objects in a tree into a list, the attribute of the end object at the lowest index.
 boolean addToAttributeMap(Object node, String relField, String valueField, Persister persister, ConcurrentMap<Object,Object> map)
          Adds attribute values of referenced nodes in a tree into a map.
 boolean addToIdentityList(Collection<? extends Variable> vars, int index, String[] nameFields, Persister persister, OrderedSet<? super EnumeratedIdentity> list)
          Adds a collection of variables as enumerated identities to an ordered set.
 boolean addToIdentityList(Variable var, int index, String[] nameFields, Persister persister, OrderedSet<? super EnumeratedIdentity> list)
          Adds the specified variable as an enumerated identity to an ordered set.
 boolean addToIdentityTree(Collection<? extends Variable> roots, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds a collection of root variables to an ordered map.
 boolean addToIdentityTree(Collection<? extends Variable> vars, String parentField, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds the variable chains of the selected variables to an ordered map.
 boolean addToIdentityTree(Identity[] ids, String parentField, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds the variable chains of the selected identities to an ordered map.
 boolean addToIdentityTree(Identity id, String parentField, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds the variable chain of the selected identity to an ordered map.
 boolean addToIdentityTree(Variable root, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds the specified root variable to an ordered map.
 boolean addToIdentityTree(Variable var, String parentField, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Adds the variable chain of the selected variable to an ordered map.
 boolean addToMNRelationMap(Object node, String indirection, String fkField1, String fkField2, DBCriteria<?> criteria, Persister persister, ConcurrentMap<Object,Object> map)
          Adds referenced objects fulfilling the specified criteria in a m:n tree to a map.
 boolean addToMNRelationMap(Object node, String relField, String indirection, String fkField1, String fkField2, DBCriteria<?> criteria, Persister persister, ConcurrentMap<Object,Object> map)
          Adds referenced objects fulfilling the specified criteria in a m:n tree to a map.
 boolean addToRelationChain(Object node, String relField, Persister persister, List<Object> list)
          Adds a chain of referenced objects in a tree to a list, the end node at the lowest index.
 boolean addToRelationMap(Object node, String relField, Persister persister, ConcurrentMap<Object,Object> map)
          Adds referenced objects in a tree to a map.
 boolean addToVariableChain(Variable var, String relField, Collection<? extends Identity> filter, Persister persister, List<? super Variable> list)
          Adds a chain of referenced variables in a tree to a list, the end variable at the lowest index.
 boolean addToVariableChain(Variable var, String relField, Persister persister, List<? super Variable> list)
          Adds a chain of referenced variables in a tree to a list, the end variable at the lowest index.
 void buildSearchVariable(Variable var, String className, Persister persister)
          Builds a search variable with attributes for searching instances of the specified target variable class.
 boolean checkMetaElement(Variable element, Permission permission, Persister persister)
          Checks a meta element with the specified permissions.
 void collapseInIdentityTree(Identity id, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Collapses the specified identity in the ordered map representing an identity tree.
 Introspector createIntrospector()
          Creates a variable introspector.
 Variable createMetaDesktop(String name, Object uid, Object gid, Persister persister)
          Creates a default desktop.
 Variable createMetaElement(Variable namespace, String type, String name)
          Creates a new meta element instance of the specified type and in the specified namespace.
 Variable createMetaFolder(String name, Object uid, Object gid, Persister persister)
          Creates a default folder.
protected  DBCriteria<Variable> createPermissionCriteria(String className, Object oid, Object uid, Object[] gids, boolean others, boolean recordp, Permission permission, Persister persister)
          Creates the specified meta permission criteria for a query.
 DBCriteria<Variable> createPermissionCriteria(String className, Object oid, Object uid, Object[] gids, boolean others, Permission permission, Persister persister)
          Creates the specified permission criteria for a meta element query.
 DBCriteria<? extends Variable> createUserPermissionCriteria(String className, Permission permission, Persister persister)
          Creates the specified user permission criteria for a meta element query.
<T extends Variable>
T
createVariable(Class<T> clazz)
          Creates a new variable instance of the specified class.
 Variable createVariable(String type)
          Creates a new variable instance of the specified type.
 void expandInIdentityTree(Identity id, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Expands the specified identity in the ordered map representing an identity tree.
 DBQuery<? extends Variable> fillQueryCriteria(Variable search, DBCriteria<? extends Variable> criteria, Persister persister)
          Fills query criteria for searching instances defined by the specified search variable.
 VariableAttributeInfo getAttributeInfo(Variable node, String field, Persister persister)
          Gets a nested attribute info in a tree.
 List<Object> getAttributeValues(Object node, String field, Persister persister)
          Gets a list of nested attribute values in a tree.
 Variable getMetaDesktop(Persister persister)
          Gets a default desktop.
 Variable getMetaFolder(Persister persister)
          Gets a default folder.
 int getReferenceDepth(Object node, String relField, Persister persister)
          Gets the depth of a node in a tree.
 Object getReferenceValue(Object node, int index, String relField, Persister persister)
          Gets the indexed node in a tree.
protected  ResourceMap getResourceMap()
          Gets the resource map.
 ObjectName getResourceMapName()
          Gets the bean resource map.
 Variable getRootFolder(Persister persister)
          Gets the root folder.
 List<Object> getRootReferences(Object node, String relField, Persister persister)
          Gets a list of root nodes in a tree.
 VariableInfo getVariableInfo(String type)
          Gets the variable info of the specified type.
protected  VariableRegistry getVariableRegistry()
          Gets the variable registry.
 ObjectName getVariableRegistryName()
          Gets the the variable registry to be applied by contexts of this filter.
 boolean isLocalizedBeans()
          Gets the localized beans flag.
 boolean isRelatedTo(Object node, String relField, Object xpk, Persister persister)
          Checks whether the specified key is related to the specified node.
 int[] orderObjects(Collection<?> objects, String[] sortFields, Persister persister)
          Orders a collection of objects with the specified fields.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
<T> Map<Object,T>
queryAllMemberGroups(String className, String[] sortFields, Persister persister)
          Queries all member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields.
<T> Collection<T>
queryAllObjects(DBCriteria<T> criteria, String[] sortFields, Persister persister, Object... clazz)
          Queries all objects fulfilling the specified criteria and may sort them by optional sort fields.
<T> Collection<T>
queryAllObjects(DBQuery<T> query, String[] sortFields, Persister persister)
          Queries all objects of the specified query and may sort them by optional sort fields.
<T> Map<Object,T>
queryChildMemberGroups(String className, String[] sortFields, Persister persister)
          Queries child member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields.
 Variable queryMetaElement(Identity id, Permission permission, Persister persister)
          Queries a meta element with the specified permissions.
<T> Map<Object,T>
queryParentMemberGroups(String className, String[] sortFields, Persister persister)
          Queries parent member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields.
<T> Collection<T>
queryTreeObjects(DBCriteria<T> criteria, String relField, Object rpk, int depth, String[] sortFields, Persister persister, Object... clazz)
          Queries objects to the specified depth in a relation tree fulfilling the specified criteria and may sort them by optional sort fields.
 boolean restoreIdentityTree(List<? extends EnumeratedAttribute> enums, int depth, String parentField, String childField, String[] nameFields, Persister persister, OrderedMap<Identity,EnumeratedIdentity> tree)
          Restores the specified enumerated identities to an ordered map.
 void setLocalizedBeans(boolean flag)
          Sets the localized beans flag.
 Object[] setMNForeignReferences(Object node, String indirection, String fkField1, String fkField2, Object[] fks, Persister persister)
          Sets foreign references in m:n relations in a tree.
 Object[] setMNObjectReferences(Object node, String relField, String indirection, String fkField1, String fkField2, Object[] fks, Persister persister)
          Sets object references in m:n relations in a tree formed by nodes of the same class.
 void setResourceMapName(ObjectName map)
          Sets the bean resource map.
 void setVariableRegistryName(ObjectName registry)
          Sets the variable registry to be applied by contexts this filter.
<T> Collection<T>
sortObjects(Collection<T> objects, String[] sortFields, Persister persister)
          Sorts a collection of objects with the specified fields.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 
Methods inherited from class org.norther.tammi.root.db.DefaultMultiRepositoryClient
acquirePersister, acquirePersister, acquirePersister, clearConnections, connectionAliasSet, containsConnection, getAuthenticatedPasswordKey, getAuthenticatedUsernameKey, getAuthenticationConnectionAlias, getConnection, getConnection, getConnectionAlias, getConnectionAlias, getConnectionUsername, getInternalConnection, getInternalConnection, getPersisterClassName, isConnectionAuthenticated, removeConnection, setAuthenticationConnection, setConnectionAlias, setConnectionAlias, setConnectionAuthenticated, setConnectionPassword, setConnectionUsername, setInternalConnection, setInternalConnection, setPersisterClassName
 
Methods inherited from class org.norther.tammi.root.db.DefaultRepositoryClient
acquirePersister, acquirePersister, acquirePersister, createUserPermissionCriteria, createUserPermissionCriteria, getAuthenticatedPasswordKey, getAuthenticatedUsernameKey, getAuthenticationConnectionAlias, getConnectionUsername, getPersisterClassName, getRepositoryClientMBean, isConnectionAuthenticated, setAuthenticationConnection, setConnectionAuthenticated, setConnectionPassword, setConnectionUsername, setPersisterClassName
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.root.db.MultiRepositoryClient
clearConnections, connectionAliasSet, containsConnection, getAuthenticatedPasswordKey, getAuthenticatedUsernameKey, getAuthenticationConnectionAlias, getConnectionAlias, getConnectionUsername, getPersisterClassName, isConnectionAuthenticated, removeConnection, setAuthenticationConnection, setConnectionAlias, setConnectionAuthenticated, setConnectionPassword, setConnectionUsername, setPersisterClassName
 
Methods inherited from interface org.norther.tammi.root.db.RepositoryClient
acquirePersister, acquirePersister, acquirePersister, acquirePersister, acquirePersister, acquirePersister, createUserPermissionCriteria, createUserPermissionCriteria, getAuthenticatedPasswordKey, getAuthenticatedUsernameKey, getAuthenticationConnectionAlias, getConnection, getConnection, getConnectionAlias, getConnectionUsername, getPersisterClassName, isConnectionAuthenticated, setAuthenticationConnection, setConnectionAlias, setConnectionAuthenticated, setConnectionPassword, setConnectionUsername, setPersisterClassName
 

Constructor Detail

DefaultBeanRepositoryClient

public DefaultBeanRepositoryClient()
Constructs a new repository client.

Method Detail

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class Adaptee

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class Adaptee
Throws:
Exception - if the adaptee refused to be unmanaged.

createIntrospector

public Introspector createIntrospector()
Description copied from interface: BeanRepositoryClient
Creates a variable introspector.

Specified by:
createIntrospector in interface BeanRepositoryClient
Returns:
the introspector.

getResourceMapName

public ObjectName getResourceMapName()
Description copied from interface: BeanRepositoryClient
Gets the bean resource map.

Specified by:
getResourceMapName in interface BeanRepositoryClient
Returns:
the name of the map or a query.

setResourceMapName

public void setResourceMapName(ObjectName map)
Description copied from interface: BeanRepositoryClient
Sets the bean resource map.

Specified by:
setResourceMapName in interface BeanRepositoryClient
Parameters:
map - the name of the map or a query.

isLocalizedBeans

public boolean isLocalizedBeans()
Description copied from interface: BeanRepositoryClient
Gets the localized beans flag.

Specified by:
isLocalizedBeans in interface BeanRepositoryClient
Returns:
the localized beans flag.

setLocalizedBeans

public void setLocalizedBeans(boolean flag)
Description copied from interface: BeanRepositoryClient
Sets the localized beans flag.

Specified by:
setLocalizedBeans in interface BeanRepositoryClient
Parameters:
flag - the localized beans flag.

getVariableRegistryName

public ObjectName getVariableRegistryName()
Description copied from interface: BeanRepositoryClient
Gets the the variable registry to be applied by contexts of this filter.

Specified by:
getVariableRegistryName in interface BeanRepositoryClient
Returns:
the object name of the variable registry or a query.

setVariableRegistryName

public void setVariableRegistryName(ObjectName registry)
Description copied from interface: BeanRepositoryClient
Sets the variable registry to be applied by contexts this filter. If it is not set, the default one will be used.

Specified by:
setVariableRegistryName in interface BeanRepositoryClient
Parameters:
registry - the object name of the variable registry or a query.

createVariable

public <T extends Variable> T createVariable(Class<T> clazz)
                                  throws ConstructionException
Description copied from interface: BeanRepositoryClient
Creates a new variable instance of the specified class.

Specified by:
createVariable in interface BeanRepositoryClient
Type Parameters:
T - the variable type.
Parameters:
clazz - the class of the variable.
Returns:
the variable MBean instance.
Throws:
ConstructionException - if construction fails.

createVariable

public Variable createVariable(String type)
                        throws ConstructionException
Description copied from interface: BeanRepositoryClient
Creates a new variable instance of the specified type.

Specified by:
createVariable in interface BeanRepositoryClient
Parameters:
type - the type of the variable.
Returns:
the variable MBean instance.
Throws:
ConstructionException - if construction fails.

createMetaElement

public Variable createMetaElement(Variable namespace,
                                  String type,
                                  String name)
                           throws AttributeNotFoundException,
                                  InvalidAttributeValueException,
                                  ConstructionException
Description copied from interface: BeanRepositoryClient
Creates a new meta element instance of the specified type and in the specified namespace.

Specified by:
createMetaElement in interface BeanRepositoryClient
Parameters:
namespace - the namespace of the element.
type - the type of the element.
name - the name of the element.
Returns:
the variable MBean instance.
Throws:
AttributeNotFoundException - for a missing field.
InvalidAttributeValueException - if the value is invalid.
ConstructionException - if construction fails.

getVariableInfo

public VariableInfo getVariableInfo(String type)
Description copied from interface: BeanRepositoryClient
Gets the variable info of the specified type.

Specified by:
getVariableInfo in interface BeanRepositoryClient
Parameters:
type - the type of the variable.
Returns:
the variable info or null.

getAttributeInfo

public VariableAttributeInfo getAttributeInfo(Variable node,
                                              String field,
                                              Persister persister)
                                       throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Gets a nested attribute info in a tree.

Specified by:
getAttributeInfo in interface BeanRepositoryClient
Parameters:
node - the node variable.
field - the attribute field(s).
persister - the persister.
Returns:
the attribute info or null.
Throws:
AttributeNotFoundException - for a missing field.

getAttributeValues

public List<Object> getAttributeValues(Object node,
                                       String field,
                                       Persister persister)
                                throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Gets a list of nested attribute values in a tree.

Specified by:
getAttributeValues in interface BeanRepositoryClient
Parameters:
node - the node object.
field - the attribute field(s).
persister - the persister.
Returns:
a list of attribute values.
Throws:
AttributeNotFoundException - for a missing field.

addAttributeValues

public boolean addAttributeValues(Object node,
                                  String field,
                                  Persister persister,
                                  List<Object> result)
                           throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Adds nested attribute values in a tree to a list.

Specified by:
addAttributeValues in interface BeanRepositoryClient
Parameters:
node - the node object.
field - the attribute field(s).
persister - the persister.
result - a list of attribute values.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.

getReferenceDepth

public int getReferenceDepth(Object node,
                             String relField,
                             Persister persister)
                      throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Gets the depth of a node in a tree.

Specified by:
getReferenceDepth in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
persister - the persister.
Returns:
the depth.
Throws:
AttributeNotFoundException - for a missing field.

getRootReferences

public List<Object> getRootReferences(Object node,
                                      String relField,
                                      Persister persister)
                               throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Gets a list of root nodes in a tree. The root level is one level below the end level.

Specified by:
getRootReferences in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
persister - the persister.
Returns:
a list of referenced nodes.
Throws:
AttributeNotFoundException - for a missing field.

getReferenceValue

public Object getReferenceValue(Object node,
                                int index,
                                String relField,
                                Persister persister)
                         throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Gets the indexed node in a tree. The first one is applied at each level in 1:n relations.

Note that a negative index is calculated from the bottom of the reference chain.

Specified by:
getReferenceValue in interface BeanRepositoryClient
Parameters:
node - the node object.
index - the node index.
relField - the relation field.
persister - the persister.
Returns:
the indexed node or null.
Throws:
AttributeNotFoundException - for a missing field.

isRelatedTo

public boolean isRelatedTo(Object node,
                           String relField,
                           Object xpk,
                           Persister persister)
                    throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Checks whether the specified key is related to the specified node.

Specified by:
isRelatedTo in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
xpk - the primary key to check.
persister - the persister.
Returns:
true if referenced, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.

addToRelationChain

public boolean addToRelationChain(Object node,
                                  String relField,
                                  Persister persister,
                                  List<Object> list)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds a chain of referenced objects in a tree to a list, the end node at the lowest index. The first one is applied at each level in 1:n and m:n relations.

Specified by:
addToRelationChain in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
persister - the persister.
list - the result list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToRelationMap

public boolean addToRelationMap(Object node,
                                String relField,
                                Persister persister,
                                ConcurrentMap<Object,Object> map)
                         throws AttributeNotFoundException,
                                PersistenceException
Description copied from interface: BeanRepositoryClient
Adds referenced objects in a tree to a map. All objects at all levels are included. Objects are mapped by their primary keys.

Specified by:
addToRelationMap in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addTo1NRelationMap

public boolean addTo1NRelationMap(Object node,
                                  String fkField,
                                  DBCriteria<?> criteria,
                                  Persister persister,
                                  ConcurrentMap<Object,Object> map)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds referenced objects fulfilling the specified criteria in a 1:n tree to a map. Only the next level is included. Objects are mapped by their primary keys.

Specified by:
addTo1NRelationMap in interface BeanRepositoryClient
Parameters:
node - the node object.
fkField - the foreign key field.
criteria - the selection criteria.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addTo1NRelationMap

public boolean addTo1NRelationMap(Object node,
                                  String relField,
                                  String fkField,
                                  DBCriteria<?> criteria,
                                  Persister persister,
                                  ConcurrentMap<Object,Object> map)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds referenced objects fulfilling the specified criteria in a 1:n tree to a map. All objects at all levels are included. Objects are mapped by their primary keys.

Specified by:
addTo1NRelationMap in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
fkField - the foreign key field.
criteria - the selection criteria.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToMNRelationMap

public boolean addToMNRelationMap(Object node,
                                  String indirection,
                                  String fkField1,
                                  String fkField2,
                                  DBCriteria<?> criteria,
                                  Persister persister,
                                  ConcurrentMap<Object,Object> map)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds referenced objects fulfilling the specified criteria in a m:n tree to a map. Only the next level is included. Objects are mapped by their primary keys.

Specified by:
addToMNRelationMap in interface BeanRepositoryClient
Parameters:
node - the node object.
indirection - the indirection class name.
fkField1 - the foreign key field to the node.
fkField2 - the foreign key field to the reference.
criteria - the selection criteria.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToMNRelationMap

public boolean addToMNRelationMap(Object node,
                                  String relField,
                                  String indirection,
                                  String fkField1,
                                  String fkField2,
                                  DBCriteria<?> criteria,
                                  Persister persister,
                                  ConcurrentMap<Object,Object> map)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds referenced objects fulfilling the specified criteria in a m:n tree to a map. All objects at all levels are included. Objects are mapped by their primary keys.

Specified by:
addToMNRelationMap in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
indirection - the indirection class name.
fkField1 - the foreign key field to the node.
fkField2 - the foreign key field to the reference.
criteria - the selection criteria.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToAttributeChain

public boolean addToAttributeChain(Object node,
                                   String relField,
                                   String valueField,
                                   Persister persister,
                                   List<Object> list)
                            throws AttributeNotFoundException,
                                   PersistenceException
Description copied from interface: BeanRepositoryClient
Adds attribute values of a chain of referenced objects in a tree into a list, the attribute of the end object at the lowest index. The first one is applied at each level in 1:n relations.

Specified by:
addToAttributeChain in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
valueField - the value field.
persister - the persister.
list - the result list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToAttributeMap

public boolean addToAttributeMap(Object node,
                                 String relField,
                                 String valueField,
                                 Persister persister,
                                 ConcurrentMap<Object,Object> map)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds attribute values of referenced nodes in a tree into a map. Attribute values of all objects at all levels are included. Attributes are mapped by primary keys of the corresponding variables.

Specified by:
addToAttributeMap in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
valueField - the value field.
persister - the persister.
map - the result map.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

add1NNullReferences

public boolean add1NNullReferences(String className,
                                   String fkField,
                                   Object[] fks,
                                   Persister persister)
                            throws AttributeNotFoundException,
                                   InvalidAttributeValueException,
                                   PersistenceException
Description copied from interface: BeanRepositoryClient
Adds null references to 1:n relations in a tree.

Specified by:
add1NNullReferences in interface BeanRepositoryClient
Parameters:
className - the data class name.
fkField - the foreign key field.
fks - an array of new foreign keys or identities.
persister - the persister.
Returns:
true if references were added.
Throws:
AttributeNotFoundException - for a missing field.
InvalidAttributeValueException - if the value is invalid.
PersistenceException - if a persister operation fails.

add1NForeignReferences

public boolean add1NForeignReferences(Object node,
                                      String className,
                                      String fkField,
                                      Object[] fks,
                                      Persister persister)
                               throws AttributeNotFoundException,
                                      InvalidAttributeValueException,
                                      PersistenceException
Description copied from interface: BeanRepositoryClient
Adds foreign references to 1:n relations in a tree.

Specified by:
add1NForeignReferences in interface BeanRepositoryClient
Parameters:
node - the node object.
className - the data class name.
fkField - the foreign key field.
fks - an array of new foreign keys or identities.
persister - the persister.
Returns:
true if references were added.
Throws:
AttributeNotFoundException - for a missing field.
InvalidAttributeValueException - if the value is invalid.
PersistenceException - if a persister operation fails.

add1NObjectReferences

public boolean add1NObjectReferences(Object node,
                                     String relField,
                                     String fkField,
                                     Object[] fks,
                                     Persister persister)
                              throws AttributeNotFoundException,
                                     InvalidAttributeValueException,
                                     PersistenceException
Description copied from interface: BeanRepositoryClient
Adds object references to 1:n relations in a tree formed by nodes of the same class.

Specified by:
add1NObjectReferences in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
fkField - the foreign key field.
fks - an array of new foreign keys or identities.
persister - the persister.
Returns:
true if references were added.
Throws:
AttributeNotFoundException - for a missing field.
InvalidAttributeValueException - if the value is invalid.
PersistenceException - if a persister operation fails.

setMNForeignReferences

public Object[] setMNForeignReferences(Object node,
                                       String indirection,
                                       String fkField1,
                                       String fkField2,
                                       Object[] fks,
                                       Persister persister)
                                throws AttributeNotFoundException,
                                       InvalidAttributeValueException,
                                       ConstructionException,
                                       PersistenceException
Description copied from interface: BeanRepositoryClient
Sets foreign references in m:n relations in a tree.

Specified by:
setMNForeignReferences in interface BeanRepositoryClient
Parameters:
node - the node object.
indirection - the indirection class name.
fkField1 - the foreign key field to the node.
fkField2 - the foreign key field to the reference.
fks - an array of new foreign keys or identities.
persister - the persister.
Returns:
an array of previous foreign keys or null if nothing changed.
Throws:
AttributeNotFoundException - for a missing field.
InvalidAttributeValueException - if the value is invalid.
ConstructionException - if object construction fails.
PersistenceException - if a persister operation fails.

setMNObjectReferences

public Object[] setMNObjectReferences(Object node,
                                      String relField,
                                      String indirection,
                                      String fkField1,
                                      String fkField2,
                                      Object[] fks,
                                      Persister persister)
                               throws AttributeNotFoundException,
                                      InvalidAttributeValueException,
                                      ConstructionException,
                                      PersistenceException
Description copied from interface: BeanRepositoryClient
Sets object references in m:n relations in a tree formed by nodes of the same class.

Specified by:
setMNObjectReferences in interface BeanRepositoryClient
Parameters:
node - the node object.
relField - the relation field.
indirection - the indirection class name.
fkField1 - the foreign key field to the node.
fkField2 - the foreign key field to the reference.
fks - an array of new foreign keys or identities.
persister - the persister.
Returns:
an array of previous foreign keys or null if nothing changed.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.
ConstructionException - if object construction fails.
PersistenceException - if a persister operation fails.

orderObjects

public int[] orderObjects(Collection<?> objects,
                          String[] sortFields,
                          Persister persister)
Description copied from interface: BeanRepositoryClient
Orders a collection of objects with the specified fields.

Specified by:
orderObjects in interface BeanRepositoryClient
Parameters:
objects - a collection of objects.
sortFields - the sort fields.
persister - the persister.
Returns:
an ordered array of indices.

sortObjects

public <T> Collection<T> sortObjects(Collection<T> objects,
                                     String[] sortFields,
                                     Persister persister)
Description copied from interface: BeanRepositoryClient
Sorts a collection of objects with the specified fields.

Specified by:
sortObjects in interface BeanRepositoryClient
Type Parameters:
T - the object type.
Parameters:
objects - a collection of objects.
sortFields - optional sort fields.
persister - the persister.
Returns:
a sorted collection of objects.

addToVariableChain

public boolean addToVariableChain(Variable var,
                                  String relField,
                                  Persister persister,
                                  List<? super Variable> list)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds a chain of referenced variables in a tree to a list, the end variable at the lowest index. The first one is applied at each level in 1:n and m:n relations.

Specified by:
addToVariableChain in interface BeanRepositoryClient
Parameters:
var - the node variable.
relField - the relation field.
persister - the persister.
list - the result list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToVariableChain

public boolean addToVariableChain(Variable var,
                                  String relField,
                                  Collection<? extends Identity> filter,
                                  Persister persister,
                                  List<? super Variable> list)
                           throws AttributeNotFoundException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Adds a chain of referenced variables in a tree to a list, the end variable at the lowest index. The chain containing any one of the filtered identities at some level of the chain is applied in 1:n and m:n relations.

Specified by:
addToVariableChain in interface BeanRepositoryClient
Parameters:
var - the node variable.
relField - the relation field.
filter - the identity filter.
persister - the persister.
list - the result list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityList

public boolean addToIdentityList(Variable var,
                                 int index,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedSet<? super EnumeratedIdentity> list)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the specified variable as an enumerated identity to an ordered set.

Specified by:
addToIdentityList in interface BeanRepositoryClient
Parameters:
var - the variable.
index - the index (-1 = append).
nameFields - optional name fields.
persister - the persister.
list - the selection list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityList

public boolean addToIdentityList(Collection<? extends Variable> vars,
                                 int index,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedSet<? super EnumeratedIdentity> list)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds a collection of variables as enumerated identities to an ordered set.

Specified by:
addToIdentityList in interface BeanRepositoryClient
Parameters:
vars - a collection of variables.
index - the index (-1 = append).
nameFields - optional name fields.
persister - the persister.
list - the selection list.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Variable root,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the specified root variable to an ordered map. The identity of the variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
root - the root variable.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Collection<? extends Variable> roots,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds a collection of root variables to an ordered map. The identity of each variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
roots - a collection of root variables.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Variable var,
                                 String parentField,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the variable chain of the selected variable to an ordered map. The root variable of the selection must be present in the map. The identity of each variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
var - the selected variable.
parentField - the parent field.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Collection<? extends Variable> vars,
                                 String parentField,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the variable chains of the selected variables to an ordered map. The root variables of the selections must be present in the map. The identity of each variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
vars - the selected variables.
parentField - the parent field.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Identity id,
                                 String parentField,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the variable chain of the selected identity to an ordered map. The root variable of the selection must be present in the map. The identity of each variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
id - the selected identity.
parentField - the parent field.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

addToIdentityTree

public boolean addToIdentityTree(Identity[] ids,
                                 String parentField,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Adds the variable chains of the selected identities to an ordered map. The root variables of the selections must be present in the map. The identity of each variable acts as a key and an enumerated identity with a tree property as a value.

Specified by:
addToIdentityTree in interface BeanRepositoryClient
Parameters:
ids - the selected identities.
parentField - the parent field.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if added, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

restoreIdentityTree

public boolean restoreIdentityTree(List<? extends EnumeratedAttribute> enums,
                                   int depth,
                                   String parentField,
                                   String childField,
                                   String[] nameFields,
                                   Persister persister,
                                   OrderedMap<Identity,EnumeratedIdentity> tree)
                            throws AttributeNotFoundException,
                                   PersistenceException
Description copied from interface: BeanRepositoryClient
Restores the specified enumerated identities to an ordered map. The identities must appear in the corresponding tree order. Only expanded subtrees with an existing root variable are restored.

Specified by:
restoreIdentityTree in interface BeanRepositoryClient
Parameters:
enums - the enumerated identities.
depth - the depth of the tree.
parentField - the parent field.
childField - the parent field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Returns:
true if restored, false otherwise.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

expandInIdentityTree

public void expandInIdentityTree(Identity id,
                                 String childField,
                                 String[] nameFields,
                                 Persister persister,
                                 OrderedMap<Identity,EnumeratedIdentity> tree)
                          throws AttributeNotFoundException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Expands the specified identity in the ordered map representing an identity tree.

Specified by:
expandInIdentityTree in interface BeanRepositoryClient
Parameters:
id - the selected identity.
childField - the child field.
nameFields - optional name fields.
persister - the persister.
tree - the selection tree.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

collapseInIdentityTree

public void collapseInIdentityTree(Identity id,
                                   Persister persister,
                                   OrderedMap<Identity,EnumeratedIdentity> tree)
                            throws AttributeNotFoundException,
                                   PersistenceException
Description copied from interface: BeanRepositoryClient
Collapses the specified identity in the ordered map representing an identity tree.

Specified by:
collapseInIdentityTree in interface BeanRepositoryClient
Parameters:
id - the selected identity.
persister - the persister.
tree - the selection tree.
Throws:
AttributeNotFoundException - for a missing field.
PersistenceException - if a persister operation fails.

getMetaDesktop

public Variable getMetaDesktop(Persister persister)
                        throws AttributeNotFoundException,
                               InvalidAttributeValueException,
                               ConstructionException,
                               PersistenceException
Description copied from interface: BeanRepositoryClient
Gets a default desktop. If missing, a new one is created and saved when applicable.

Specified by:
getMetaDesktop in interface BeanRepositoryClient
Parameters:
persister - the persister.
Returns:
the default desktop or null.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid values.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

createMetaDesktop

public Variable createMetaDesktop(String name,
                                  Object uid,
                                  Object gid,
                                  Persister persister)
                           throws AttributeNotFoundException,
                                  InvalidAttributeValueException,
                                  ConstructionException,
                                  PersistenceException
Description copied from interface: BeanRepositoryClient
Creates a default desktop.

Specified by:
createMetaDesktop in interface BeanRepositoryClient
Parameters:
name - the folder name.
uid - the user id.
gid - the group id.
persister - the persister.
Returns:
the default desktop.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid values.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

getRootFolder

public Variable getRootFolder(Persister persister)
                       throws AttributeNotFoundException,
                              InvalidAttributeValueException,
                              ConstructionException,
                              PersistenceException
Description copied from interface: BeanRepositoryClient
Gets the root folder.

Specified by:
getRootFolder in interface BeanRepositoryClient
Parameters:
persister - the persister.
Returns:
the root folder or null.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid values.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

getMetaFolder

public Variable getMetaFolder(Persister persister)
                       throws AttributeNotFoundException,
                              InvalidAttributeValueException,
                              ConstructionException,
                              PersistenceException
Description copied from interface: BeanRepositoryClient
Gets a default folder. If missing, a new one is created and saved when applicable.

Specified by:
getMetaFolder in interface BeanRepositoryClient
Parameters:
persister - the persister.
Returns:
the default folder or null.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid values.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

createMetaFolder

public Variable createMetaFolder(String name,
                                 Object uid,
                                 Object gid,
                                 Persister persister)
                          throws AttributeNotFoundException,
                                 InvalidAttributeValueException,
                                 ConstructionException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Creates a default folder.

Specified by:
createMetaFolder in interface BeanRepositoryClient
Parameters:
name - the folder name.
uid - the user id.
gid - the group id.
persister - the persister.
Returns:
the default folder.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid values.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

buildSearchVariable

public void buildSearchVariable(Variable var,
                                String className,
                                Persister persister)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException,
                                ConstructionException,
                                PersistenceException
Description copied from interface: BeanRepositoryClient
Builds a search variable with attributes for searching instances of the specified target variable class.

Specified by:
buildSearchVariable in interface BeanRepositoryClient
Parameters:
var - the search variable.
className - the search class name.
persister - the persister.
Throws:
AttributeNotFoundException - for missing attributes.
InvalidAttributeValueException - for invalid attributes.
ConstructionException - for construction errors.
PersistenceException - for persister errors.

fillQueryCriteria

public DBQuery<? extends Variable> fillQueryCriteria(Variable search,
                                                     DBCriteria<? extends Variable> criteria,
                                                     Persister persister)
                                              throws AttributeNotFoundException
Description copied from interface: BeanRepositoryClient
Fills query criteria for searching instances defined by the specified search variable.

Specified by:
fillQueryCriteria in interface BeanRepositoryClient
Parameters:
search - the search variable.
criteria - the criteria.
persister - the persister.
Returns:
the filled query.
Throws:
AttributeNotFoundException - for missing attributes.

queryAllObjects

public <T> Collection<T> queryAllObjects(DBQuery<T> query,
                                         String[] sortFields,
                                         Persister persister)
                              throws PersistenceException
Description copied from interface: BeanRepositoryClient
Queries all objects of the specified query and may sort them by optional sort fields.

Specified by:
queryAllObjects in interface BeanRepositoryClient
Type Parameters:
T - the object type.
Parameters:
query - the query.
sortFields - optional sort fields.
persister - the persister.
Returns:
a collection of objects.
Throws:
PersistenceException - for persister errors.

queryAllObjects

public <T> Collection<T> queryAllObjects(DBCriteria<T> criteria,
                                         String[] sortFields,
                                         Persister persister,
                                         Object... clazz)
                              throws PersistenceException
Description copied from interface: BeanRepositoryClient
Queries all objects fulfilling the specified criteria and may sort them by optional sort fields.

Specified by:
queryAllObjects in interface BeanRepositoryClient
Type Parameters:
T - the object type.
Parameters:
criteria - optional criteria.
sortFields - optional sort fields.
persister - the persister.
clazz - an alternate class or class name.
Returns:
a collection of objects.
Throws:
PersistenceException - for persister errors.

queryTreeObjects

public <T> Collection<T> queryTreeObjects(DBCriteria<T> criteria,
                                          String relField,
                                          Object rpk,
                                          int depth,
                                          String[] sortFields,
                                          Persister persister,
                                          Object... clazz)
                               throws AttributeNotFoundException,
                                      PersistenceException
Description copied from interface: BeanRepositoryClient
Queries objects to the specified depth in a relation tree fulfilling the specified criteria and may sort them by optional sort fields.

Specified by:
queryTreeObjects in interface BeanRepositoryClient
Type Parameters:
T - the object type.
Parameters:
criteria - optional criteria.
relField - the relation field.
rpk - an optional root primary key.
depth - the tree depth (-1 = bottom).
sortFields - optionals sort field.
persister - the persister.
clazz - an alternate class or class name.
Returns:
a collection of objects.
Throws:
AttributeNotFoundException - for missing attributes.
PersistenceException - for persister errors.

queryAllMemberGroups

public <T> Map<Object,T> queryAllMemberGroups(String className,
                                              String[] sortFields,
                                              Persister persister)
                                   throws AttributeNotFoundException,
                                          PersistenceException
Description copied from interface: BeanRepositoryClient
Queries all member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields. Groups owned by the user are included.

Specified by:
queryAllMemberGroups in interface BeanRepositoryClient
Type Parameters:
T - the group type.
Parameters:
className - the class name.
sortFields - optional sort fields.
persister - the persister.
Returns:
a map of objects.
Throws:
AttributeNotFoundException - for missing attributes.
PersistenceException - for persister errors.

queryParentMemberGroups

public <T> Map<Object,T> queryParentMemberGroups(String className,
                                                 String[] sortFields,
                                                 Persister persister)
                                      throws AttributeNotFoundException,
                                             PersistenceException
Description copied from interface: BeanRepositoryClient
Queries parent member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields. Groups owned by the user are included.

Specified by:
queryParentMemberGroups in interface BeanRepositoryClient
Type Parameters:
T - the group type.
Parameters:
className - the class name.
sortFields - optional sort fields.
persister - the persister.
Returns:
a map of objects.
Throws:
AttributeNotFoundException - for missing attributes.
PersistenceException - for persister errors.

queryChildMemberGroups

public <T> Map<Object,T> queryChildMemberGroups(String className,
                                                String[] sortFields,
                                                Persister persister)
                                     throws AttributeNotFoundException,
                                            PersistenceException
Description copied from interface: BeanRepositoryClient
Queries child member groups of the current user in a relation tree fulfilling the specified criteria, and may sort them by optional sort fields. Groups owned by the user are included.

Specified by:
queryChildMemberGroups in interface BeanRepositoryClient
Type Parameters:
T - the group type.
Parameters:
className - the class name.
sortFields - optional sort fields.
persister - the persister.
Returns:
a map of objects.
Throws:
AttributeNotFoundException - for missing attributes.
PersistenceException - for persister errors.

queryMetaElement

public Variable queryMetaElement(Identity id,
                                 Permission permission,
                                 Persister persister)
                          throws AccessDeniedException,
                                 PersistenceException
Description copied from interface: BeanRepositoryClient
Queries a meta element with the specified permissions.

Specified by:
queryMetaElement in interface BeanRepositoryClient
Parameters:
id - the meta element identity.
permission - the requested permission.
persister - the persister.
Returns:
the meta element or null.
Throws:
AccessDeniedException - for missing rights.
PersistenceException - for persister errors.

checkMetaElement

public boolean checkMetaElement(Variable element,
                                Permission permission,
                                Persister persister)
Description copied from interface: BeanRepositoryClient
Checks a meta element with the specified permissions.

Specified by:
checkMetaElement in interface BeanRepositoryClient
Parameters:
element - the meta element.
permission - the requested permission.
persister - the persister.
Returns:
true if allowed, false otherwise.

createPermissionCriteria

public DBCriteria<Variable> createPermissionCriteria(String className,
                                                     Object oid,
                                                     Object uid,
                                                     Object[] gids,
                                                     boolean others,
                                                     Permission permission,
                                                     Persister persister)
Description copied from interface: RepositoryClient
Creates the specified permission criteria for a meta element query.

Specified by:
createPermissionCriteria in interface RepositoryClient
Overrides:
createPermissionCriteria in class DefaultRepositoryClient
Parameters:
className - the variable class name.
oid - the owner id.
uid - the user id.
gids - the group ids.
others - the others option.
permission - the reuqested permission.
persister - the persister.
Returns:
the created criteria.

createUserPermissionCriteria

public DBCriteria<? extends Variable> createUserPermissionCriteria(String className,
                                                                   Permission permission,
                                                                   Persister persister)
                                                            throws AttributeNotFoundException,
                                                                   PersistenceException
Description copied from interface: RepositoryClient
Creates the specified user permission criteria for a meta element query.

Specified by:
createUserPermissionCriteria in interface RepositoryClient
Overrides:
createUserPermissionCriteria in class DefaultRepositoryClient
Parameters:
className - the element class name.
permission - the permission.
persister - the persister.
Returns:
the search criteria.
Throws:
AttributeNotFoundException - for missing attributes.
PersistenceException - for persister errors.

getResourceMap

protected ResourceMap getResourceMap()
Gets the resource map.

Returns:
the resource map.

getVariableRegistry

protected VariableRegistry getVariableRegistry()
Gets the variable registry.

Returns:
the variable registry.

createPermissionCriteria

protected DBCriteria<Variable> createPermissionCriteria(String className,
                                                        Object oid,
                                                        Object uid,
                                                        Object[] gids,
                                                        boolean others,
                                                        boolean recordp,
                                                        Permission permission,
                                                        Persister persister)
Creates the specified meta permission criteria for a query.

Parameters:
className - the meta element class name.
oid - the owner id.
uid - the user id.
gids - the group ids.
others - the others option.
recordp - the record option.
permission - the permission.
persister - the persister.
Returns:
the built criteria.


Copyright © 2004 The Norther Organization. All rights reserved.