KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > domain > ChildAssoc


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.domain;
18
19 import org.alfresco.service.cmr.repository.ChildAssociationRef;
20 import org.alfresco.service.namespace.QName;
21
22 /**
23  * Represents a special type of association between nodes, that of the
24  * parent-child relationship.
25  *
26  * @author Derek Hulley
27  */

28 public interface ChildAssoc extends Comparable JavaDoc<ChildAssoc>
29 {
30     /**
31      * Performs the necessary work on the provided nodes to ensure that a bidirectional
32      * association is properly set up.
33      * <p>
34      * The association attributes still have to be set up.
35      *
36      * @param parentNode
37      * @param childNode
38      *
39      * @see #setName(String)
40      * @see #setIsPrimary(boolean)
41      */

42     public void buildAssociation(Node parentNode, Node childNode);
43     
44     /**
45      * Performs the necessary work on the {@link #getParent() parent} and
46      * {@link #getChild() child} nodes to maintain the inverse association sets
47      */

48     public void removeAssociation();
49     
50     public ChildAssociationRef getChildAssocRef();
51
52     public Long JavaDoc getId();
53
54     public Node getParent();
55
56     public Node getChild();
57     
58     /**
59      * @return Returns the qualified name of the association type
60      */

61     public QName getTypeQName();
62     
63     /**
64      * @param assocTypeQName the qualified name of the association type as defined
65      * in the data dictionary
66      */

67     public void setTypeQName(QName assocTypeQName);
68
69     /**
70      * @return Returns the qualified name of this association
71      */

72     public QName getQname();
73
74     /**
75      * @param qname the qualified name of the association
76      */

77     public void setQname(QName qname);
78
79     public boolean getIsPrimary();
80
81     public void setIsPrimary(boolean isPrimary);
82     
83     /**
84      * @return Returns the user-assigned index
85      */

86     public int getIndex();
87     
88     /**
89      * Set the index of this association
90      *
91      * @param index the association index
92      */

93     public void setIndex(int index);
94 }
95
Popular Tags