KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > policy > BehaviourFilter


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.policy;
18
19 import org.alfresco.service.cmr.repository.NodeRef;
20 import org.alfresco.service.namespace.QName;
21
22 /**
23  * Contract disabling and enabling policy behaviours.
24  *
25  * @author David Caruana
26  */

27 public interface BehaviourFilter
28 {
29     /**
30      * Disable behaviour for all nodes
31      *
32      * @param className the type/aspect behaviour to disable
33      * @return true => already disabled
34      */

35     public boolean disableBehaviour(QName className);
36
37     /**
38      * Disable behaviour for specific node
39      *
40      * @param nodeRef the node to disable for
41      * @param className the type/aspect behaviour to disable
42      * @return true => already disabled
43      */

44     public boolean disableBehaviour(NodeRef nodeRef, QName className);
45
46     /**
47      * Enable behaviour for all nodes
48      *
49      * @param className the type/aspect behaviour to enable
50      */

51     public void enableBehaviour(QName className);
52     
53     /**
54      * Enable behaviour for specific node
55      *
56      * @param nodeRef the node to enable for
57      * @param className the type/aspect behaviour to enable
58      */

59     public void enableBehaviour(NodeRef nodeRef, QName className);
60
61     /**
62      * Enable all behaviours for specific node
63      *
64      * @param nodeRef the node to enable for
65      */

66     public void enableBehaviours(NodeRef nodeRef);
67     
68     /**
69      * Enable all behaviours
70      */

71     public void enableAllBehaviours();
72     
73     /**
74      * Determine if behaviour is enabled across all nodes.
75      *
76      * @param className the behaviour to test for
77      * @return true => behaviour is enabled
78      */

79     public boolean isEnabled(QName className);
80     
81     /**
82      * Determine if behaviour is enabled for specific node.
83      *
84      * Note: A node behaviour is enabled only when:
85      * a) the behaviour is not disabled across all nodes
86      * b) the behaviour is not disabled specifically for the provided node
87      *
88      * @param nodeRef the node to test for
89      * @param className the behaviour to test for
90      * @return true => behaviour is enabled
91      */

92     public boolean isEnabled(NodeRef nodeRef, QName className);
93     
94     /**
95      * Determine if any behaviours have been disabled?
96      *
97      * @return true => behaviours have been filtered
98      */

99     public boolean isActivated();
100 }
101
Popular Tags