org.alfresco.repo.policy
Interface PolicyComponent

All Known Implementing Classes:
PolicyComponentImpl

public interface PolicyComponent

Policy Component for managing Policies and Behaviours.

This component provides the ability to:

A behaviour may be bound to a Policy before the Policy is registered. In this case, the behaviour is not validated (i.e. checked to determine if it supports the policy interface) until the Policy is registered. Otherwise, the behaviour is validated at bind-time.


Method Summary
 BehaviourDefinition bindAssociationBehaviour(QName policy, java.lang.Object service, Behaviour behaviour)
          Bind a Service specific behaviour to an Association-level Policy
 BehaviourDefinition bindAssociationBehaviour(QName policy, QName className, Behaviour behaviour)
          Bind an Association specific behaviour to an Association-level Policy (for all associations of a Class)
 BehaviourDefinition bindAssociationBehaviour(QName policy, QName className, QName assocName, Behaviour behaviour)
          Bind an Association specific behaviour to an Association-level Policy
 BehaviourDefinition bindClassBehaviour(QName policy, java.lang.Object service, Behaviour behaviour)
          Bind a Service behaviour to a Class-level Policy
 BehaviourDefinition bindClassBehaviour(QName policy, QName classRef, Behaviour behaviour)
          Bind a Class specific behaviour to a Class-level Policy
 BehaviourDefinition bindPropertyBehaviour(QName policy, java.lang.Object service, Behaviour behaviour)
          Bind a Service specific behaviour to a Property-level Policy
 BehaviourDefinition bindPropertyBehaviour(QName policy, QName className, Behaviour behaviour)
          Bind a Property specific behaviour to a Property-level Policy (for all properties of a Class)
 BehaviourDefinition bindPropertyBehaviour(QName policy, QName className, QName propertyName, Behaviour behaviour)
          Bind a Property specific behaviour to a Property-level Policy
 java.util.Collection getRegisteredPolicies()
          Gets all registered Policies
 PolicyDefinition getRegisteredPolicy(PolicyType policyType, QName policy)
          Gets the specified registered Policy
 boolean isRegisteredPolicy(PolicyType policyType, QName policy)
          Determine if the specified policy has been registered
 AssociationPolicyDelegate registerAssociationPolicy(java.lang.Class policy)
          Register a Association-level Policy
 ClassPolicyDelegate registerClassPolicy(java.lang.Class policy)
          Register a Class-level Policy
 PropertyPolicyDelegate registerPropertyPolicy(java.lang.Class policy)
          Register a Property-level Policy
 

Method Detail

registerClassPolicy

ClassPolicyDelegate registerClassPolicy(java.lang.Class policy)
Register a Class-level Policy

Parameters:
policy - the policy interface class
Returns:
A delegate for the class-level policy (typed by the policy interface)

registerPropertyPolicy

PropertyPolicyDelegate registerPropertyPolicy(java.lang.Class policy)
Register a Property-level Policy

Parameters:
policy - the policy interface class
Returns:
A delegate for the property-level policy (typed by the policy interface)

registerAssociationPolicy

AssociationPolicyDelegate registerAssociationPolicy(java.lang.Class policy)
Register a Association-level Policy

Parameters:
policy - the policy interface class
Returns:
A delegate for the association-level policy (typed by the policy interface)

getRegisteredPolicies

java.util.Collection getRegisteredPolicies()
Gets all registered Policies

Returns:
the collection of registered policy definitions

getRegisteredPolicy

PolicyDefinition getRegisteredPolicy(PolicyType policyType,
                                     QName policy)
Gets the specified registered Policy

Parameters:
policyType - the policy type
policy - the policy name
Returns:
the policy definition (or null, if it has not been registered)

isRegisteredPolicy

boolean isRegisteredPolicy(PolicyType policyType,
                           QName policy)
Determine if the specified policy has been registered

Parameters:
policyType - the policy type
policy - the policy name
Returns:
true => registered, false => not yet

bindClassBehaviour

BehaviourDefinition bindClassBehaviour(QName policy,
                                       QName classRef,
                                       Behaviour behaviour)
Bind a Class specific behaviour to a Class-level Policy

Parameters:
policy - the policy name
behaviour - the behaviour
Returns:
the registered behaviour definition

bindClassBehaviour

BehaviourDefinition bindClassBehaviour(QName policy,
                                       java.lang.Object service,
                                       Behaviour behaviour)
Bind a Service behaviour to a Class-level Policy

Parameters:
policy - the policy name
service - the service (any object, in fact)
behaviour - the behaviour
Returns:
the registered behaviour definition

bindPropertyBehaviour

BehaviourDefinition bindPropertyBehaviour(QName policy,
                                          QName className,
                                          QName propertyName,
                                          Behaviour behaviour)
Bind a Property specific behaviour to a Property-level Policy

Parameters:
policy - the policy name
className - the class to bind against
propertyName - the property to bind against
behaviour - the behaviour
Returns:
the registered behaviour definition

bindPropertyBehaviour

BehaviourDefinition bindPropertyBehaviour(QName policy,
                                          QName className,
                                          Behaviour behaviour)
Bind a Property specific behaviour to a Property-level Policy (for all properties of a Class)

Parameters:
policy - the policy name
className - the class to bind against
behaviour - the behaviour
Returns:
the registered behaviour definition

bindPropertyBehaviour

BehaviourDefinition bindPropertyBehaviour(QName policy,
                                          java.lang.Object service,
                                          Behaviour behaviour)
Bind a Service specific behaviour to a Property-level Policy

Parameters:
policy - the policy name
service - the binding service
behaviour - the behaviour
Returns:
the registered behaviour definition

bindAssociationBehaviour

BehaviourDefinition bindAssociationBehaviour(QName policy,
                                             QName className,
                                             QName assocName,
                                             Behaviour behaviour)
Bind an Association specific behaviour to an Association-level Policy

Parameters:
policy - the policy name
className - the class to bind against
assocRef - the association to bind against
behaviour - the behaviour
Returns:
the registered behaviour definition

bindAssociationBehaviour

BehaviourDefinition bindAssociationBehaviour(QName policy,
                                             QName className,
                                             Behaviour behaviour)
Bind an Association specific behaviour to an Association-level Policy (for all associations of a Class)

Parameters:
policy - the policy name
className - the class to bind against
behaviour - the behaviour
Returns:
the registered behaviour definition

bindAssociationBehaviour

BehaviourDefinition bindAssociationBehaviour(QName policy,
                                             java.lang.Object service,
                                             Behaviour behaviour)
Bind a Service specific behaviour to an Association-level Policy

Parameters:
policy - the policy name
service - the binding service
behaviour - the behaviour
Returns:
the registered behaviour definition


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.