View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3    
4    Copyright (c) 2004-2005, OntoText Lab. / SIRMA
5    
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  
19  /**
20   * <p>Title: WSMO4J</p>
21   * <p>Description: WSMO API and a Reference Implementation</p>
22   * <p>Copyright:  Copyright (c) 2004-2005</p>
23   * <p>Company: OntoText Lab. / SIRMA </p>
24   */
25  
26  package com.ontotext.wsmo4j.service;
27  
28  
29  import org.wsmo.common.*;
30  import org.wsmo.service.Choreography;
31  import org.wsmo.service.Interface;
32  import org.wsmo.service.Orchestration;
33  
34  import com.ontotext.wsmo4j.common.TopEntityImpl;
35  
36  /**
37   * This java interface represents a WSMO
38   * web service interface.
39   *
40   * @author not attributable
41   * @version $Revision: 1574 $ $Date: 2006-02-13 12:41:05 +0200 (Mon, 13 Feb 2006) $
42   */
43  
44  public class InterfaceImpl extends TopEntityImpl
45          implements Interface {
46  
47      private Choreography chor;
48      private Orchestration orch;
49      
50      public InterfaceImpl(IRI interfaceIRI) {
51          super(interfaceIRI);
52      }
53      
54      /**
55       * Returns the orchestration of this interface.
56       * @return The orchestration of this interface.
57       * @see #setOrchestration(org.wsmo.service.Orchestration)
58       * @throws org.wsmo.common.exception.SynchronisationException
59       */
60      public Orchestration getOrchestration() {
61          return orch;
62      }
63  
64      /**
65       * Sets the orchestration of this interface.
66       * @param orch The new orchestration.
67       * @see #getOrchestration()
68       * @throws org.wsmo.common.exception.SynchronisationException
69       * @throws org.wsmo.common.exception.InvalidModelException
70       */
71      public void setOrchestration(Orchestration orch) {
72          this.orch = orch; 
73      }
74  
75      /**
76       * Returns the choreography of this interface.
77       * @return The choreography of this interface.
78       * @see #setChoreography(org.wsmo.service.Choreography)
79       * @throws org.wsmo.common.exception.SynchronisationException
80       */
81      public Choreography getChoreography() {
82          return chor;
83      }
84  
85      /**
86       * Sets the choreography of the this interface.
87       * @param chor A reference to the new choreography.
88       * @see #getChoreography()
89       * @throws org.wsmo.common.exception.SynchronisationException
90       * @throws org.wsmo.common.exception.InvalidModelException
91       */
92      public void setChoreography(Choreography chor) {
93          this.chor = chor;
94      }
95  
96      /**
97       * Creates a new Choreography object.
98       * @param id The ID of the new Choreography object
99       * @return The newly created Choreography object.
100      */
101     public Choreography createChoreography(Identifier id) {
102         ChoreographyImpl chor = new ChoreographyImpl(id);
103         this.chor = chor;
104         return chor;
105 //        throw new RuntimeException("Method not implemented! - createChoreography");
106     }
107 
108     /**
109      * Creates a new Orchestration object.
110      * @param id The ID of the new Orchestration object.
111      * @return The newly created Orchestration object.
112      */
113     public Orchestration createOrchestration(Identifier id) {
114         OrchestrationImpl orch = new OrchestrationImpl(id);
115         this.orch = orch;
116         return orch;
117 //        throw new RuntimeException("Method not implemented! - createOrchestration");
118     }
119     
120     public boolean equals(Object object) {
121         if (object == this) {
122             return true;
123         }
124         if (object == null
125                 || false == object instanceof Interface) {
126             return false;
127         }
128         return super.equals(object);
129     }
130 }
131 
132 /*
133  * $Log$
134  * Revision 1.16  2006/02/13 10:41:05  vassil_momtchev
135  * the constructors of the topentities to disallow Identifier; see WsmoFactoryImpl
136  *
137  * Revision 1.15  2005/10/07 13:55:51  vassil_momtchev
138  * createXXX(Identifier) set the result to chor/orch hanlde; fix of 1315669
139  *
140  * Revision 1.14  2005/06/22 09:16:06  alex_simov
141  * Simplified equals() method. Identity strongly relies on identifier string
142  *
143  * Revision 1.13  2005/06/06 17:34:06  alex_simov
144  * no message
145  *
146  * Revision 1.12  2005/06/01 12:14:23  marin_dimitrov
147  * v0.4.0
148  *
149  * Revision 1.1  2005/05/13 12:34:06  alex
150  * initial commit
151  *
152  */
153