KickJava   Java API By Example, From Geeks To Geeks.

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


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.AssociationRef;
20 import org.alfresco.service.namespace.QName;
21
22 /**
23  * Represents a generic association between two nodes. The association is named
24  * and bidirectional by default.
25  *
26  * @author Derek Hulley
27  */

28 public interface NodeAssoc
29 {
30     public long getId();
31
32     /**
33      * Wires up the necessary bits on the source and target nodes so that the association
34      * is immediately bidirectional.
35      * <p>
36      * The association attributes still have to be set.
37      *
38      * @param sourceNode
39      * @param targetNode
40      *
41      * @see #setName(String)
42      */

43     public void buildAssociation(Node sourceNode, Node targetNode);
44
45     /**
46      * Performs the necessary work on the {@link #getSource()() source} and
47      * {@link #getTarget()() target} nodes to maintain the inverse association sets
48      */

49     public void removeAssociation();
50
51     public AssociationRef getNodeAssocRef();
52     
53     public Node getSource();
54
55     public Node getTarget();
56
57     /**
58      * @return Returns the qualified name of this association type
59      */

60     public QName getTypeQName();
61
62     /**
63      * @param qname the qualified name of the association type
64      */

65     public void setTypeQName(QName qname);
66 }
67
Popular Tags