org.apache.jackrabbit.core.security.authorization.acl
Class EntryCollector

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authorization.AccessControlObserver
      extended by org.apache.jackrabbit.core.security.authorization.acl.EntryCollector
All Implemented Interfaces:
EventListener, SynchronousEventListener, AccessControlConstants

public class EntryCollector
extends AccessControlObserver
implements AccessControlConstants

EntryCollector collects ACEs defined and effective for a given Node and listens to access control modifications in order to inform listeners.


Field Summary
protected  NodeId rootID
          The root id.
protected  SessionImpl systemSession
          The system session used to register an event listener and process the events as well as collect AC entries.
 
Fields inherited from class org.apache.jackrabbit.core.security.authorization.AccessControlObserver
POLICY_ADDED, POLICY_MODIFIED, POLICY_REMOVED
 
Fields inherited from interface org.apache.jackrabbit.core.security.authorization.AccessControlConstants
N_ACCESSCONTROL, N_POLICY, NT_REP_ACCESS_CONTROL, NT_REP_ACCESS_CONTROLLABLE, NT_REP_ACE, NT_REP_ACL, NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_PRINCIPAL_ACCESS_CONTROL, P_GLOB, P_PRINCIPAL_NAME, P_PRIVILEGES
 
Constructor Summary
protected EntryCollector(SessionImpl systemSession, NodeId rootID)
           
 
Method Summary
protected  void close()
          Release all resources contained by this instance.
protected  List<AccessControlEntry> collectEntries(NodeImpl node, EntryFilter filter)
          Collect the ACEs effective at the given node applying the specified filter.
protected  List<AccessControlEntry> getEntries(NodeId nodeId)
           
protected  List<AccessControlEntry> getEntries(NodeImpl node)
          Retrieve the access control entries defined for the given node.
protected  NodeId getParentId(NodeId nodeId)
          Returns the parentId of the given nodeId.
 void onEvent(EventIterator events)
          Collect is of access controlled nodes that are effected by access control modification together with the corresponding modification type and finally inform listeners about the modifications.
 
Methods inherited from class org.apache.jackrabbit.core.security.authorization.AccessControlObserver
addListener, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemSession

protected final SessionImpl systemSession
The system session used to register an event listener and process the events as well as collect AC entries.


rootID

protected final NodeId rootID
The root id.

Constructor Detail

EntryCollector

protected EntryCollector(SessionImpl systemSession,
                         NodeId rootID)
                  throws RepositoryException
Parameters:
systemSession -
rootID -
Throws:
RepositoryException
Method Detail

close

protected void close()
Release all resources contained by this instance. It will no longer be used. This implementation only stops listening to ac modification events.

Overrides:
close in class AccessControlObserver

collectEntries

protected List<AccessControlEntry> collectEntries(NodeImpl node,
                                                  EntryFilter filter)
                                           throws RepositoryException
Collect the ACEs effective at the given node applying the specified filter.

Parameters:
node -
filter -
Returns:
Throws:
RepositoryException

getEntries

protected List<AccessControlEntry> getEntries(NodeImpl node)
                                       throws RepositoryException
Retrieve the access control entries defined for the given node. If the node is not access controlled or if the ACL is empty this method returns an empty list.

Parameters:
node -
Returns:
Throws:
RepositoryException

getEntries

protected List<AccessControlEntry> getEntries(NodeId nodeId)
                                       throws RepositoryException
Parameters:
nodeId -
Returns:
Throws:
RepositoryException

getParentId

protected NodeId getParentId(NodeId nodeId)
                      throws RepositoryException
Returns the parentId of the given nodeId.

Parameters:
nodeId -
Returns:
Throws:
RepositoryException

onEvent

public void onEvent(EventIterator events)
Collect is of access controlled nodes that are effected by access control modification together with the corresponding modification type and finally inform listeners about the modifications.

Specified by:
onEvent in interface EventListener
Parameters:
events -


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.