View Javadoc

1   /* 
2    * Copyright (c) 2007, Fraunhofer-Gesellschaft
3    * All rights reserved.
4    * 
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are
7    * met:
8    * 
9    * (1) Redistributions of source code must retain the above copyright
10   *     notice, this list of conditions and the disclaimer at the end.
11   *     Redistributions in binary form must reproduce the above copyright
12   *     notice, this list of conditions and the following disclaimer in
13   *     the documentation and/or other materials provided with the
14   *     distribution.
15   * 
16   * (2) Neither the name of Fraunhofer nor the names of its
17   *     contributors may be used to endorse or promote products derived
18   *     from this software without specific prior written permission.
19   * 
20   * DISCLAIMER
21   * 
22   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33   *  
34   */
35  package org.ogf.graap.wsag.api.client;
36  
37  import org.ogf.graap.wsag.api.exceptions.ResourceUnavailableException;
38  import org.ogf.graap.wsag.api.exceptions.ResourceUnknownException;
39  import org.ogf.schemas.graap.wsAgreement.AgreementContextType;
40  import org.ogf.schemas.graap.wsAgreement.AgreementStateType;
41  import org.ogf.schemas.graap.wsAgreement.GuaranteeTermStateType;
42  import org.ogf.schemas.graap.wsAgreement.ServiceTermStateType;
43  import org.ogf.schemas.graap.wsAgreement.TermTreeType;
44  import org.ogf.schemas.graap.wsAgreement.TerminateInputType;
45  
46  /**
47   * AgreementService
48   * 
49   * @author Oliver Waeldrich
50   */
51  public interface AgreementService
52  {
53  
54      /**
55       * Returns the web-service client used for communication with the SLA management server.
56       * 
57       * @return the web service client for this service.
58       */
59      WsClient getWebServiceClient();
60  
61      //
62      // from the ArgreementPortType
63      //
64  
65      /**
66       * Returns the name of the agreement instance.
67       * 
68       * @return the agreement name
69       * @throws ResourceUnknownException
70       *             the remote resource is unknown
71       * @throws ResourceUnavailableException
72       *             the remote resource is unavailable
73       */
74      String getName() throws ResourceUnknownException, ResourceUnavailableException;
75  
76      /**
77       * Returns the id of the agreement instance.
78       * 
79       * @return the agreement id
80       * @throws ResourceUnknownException
81       *             the remote resource is unknown
82       * @throws ResourceUnavailableException
83       *             the remote resource is unavailable
84       */
85      String getAgreementId() throws ResourceUnknownException, ResourceUnavailableException;
86  
87      /**
88       * Returns the context of the agreement instance.
89       * 
90       * @return the agreement context
91       * @throws ResourceUnknownException
92       *             the remote resource is unknown
93       * @throws ResourceUnavailableException
94       *             the remote resource is unavailable
95       */
96      AgreementContextType getContext() throws ResourceUnknownException, ResourceUnavailableException;
97  
98      /**
99       * Returns the terms of the agreement instance.
100      * 
101      * @return the agreement terms
102      * @throws ResourceUnknownException
103      *             the remote resource is unknown
104      * @throws ResourceUnavailableException
105      *             the remote resource is unavailable
106      */
107     TermTreeType getTerms() throws ResourceUnknownException, ResourceUnavailableException;
108 
109     /**
110      * Terminates the agreement instance.
111      * 
112      * @param reason
113      *            a domain-specific termination reason
114      * @throws ResourceUnknownException
115      *             the remote resource is unknown
116      * @throws ResourceUnavailableException
117      *             the remote resource is unavailable
118      */
119     void terminate( TerminateInputType reason ) throws ResourceUnknownException, ResourceUnavailableException;
120 
121     //
122     // from the ArgreementStatePortType
123     //
124 
125     /**
126      * Returns the state of the agreement instance.
127      * 
128      * @return the agreement state
129      * @throws ResourceUnknownException
130      *             the remote resource is unknown
131      * @throws ResourceUnavailableException
132      *             the remote resource is unavailable
133      */
134     AgreementStateType getState() throws ResourceUnknownException, ResourceUnavailableException;
135 
136     /**
137      * Returns the state for the individual guarantee terms of the agreement instance.
138      * 
139      * @return the guarantee term states
140      * 
141      * @throws ResourceUnknownException
142      *             the remote resource is unknown
143      * @throws ResourceUnavailableException
144      *             the remote resource is unavailable
145      */
146     GuaranteeTermStateType[] getGuaranteeTermStates()
147         throws ResourceUnknownException, ResourceUnavailableException;
148 
149     /**
150      * Returns the state for the individual service terms of the agreement instance.
151      * 
152      * @return the service term states
153      * 
154      * @throws ResourceUnknownException
155      *             the remote resource is unknown
156      * @throws ResourceUnavailableException
157      *             the remote resource is unavailable
158      */
159     ServiceTermStateType[] getServiceTermStates()
160         throws ResourceUnknownException, ResourceUnavailableException;
161 
162     //
163     // from WS resource specification
164     //
165 
166     /**
167      * Destroys agreement instance.
168      * 
169      * @throws ResourceUnknownException
170      *             the remote resource is unknown
171      * @throws ResourceUnavailableException
172      *             the remote resource is unavailable
173      */
174     void destroy() throws ResourceUnknownException, ResourceUnavailableException;
175 
176 }