1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 package org.ogf.graap.wsag.client.local;
36
37 import java.util.Properties;
38
39 import org.ogf.graap.wsag.api.Agreement;
40 import org.ogf.graap.wsag.api.AgreementFactory;
41 import org.ogf.graap.wsag.api.AgreementOffer;
42 import org.ogf.graap.wsag.api.client.AgreementClient;
43 import org.ogf.graap.wsag.api.client.AgreementFactoryClient;
44 import org.ogf.graap.wsag.api.client.NegotiationClient;
45 import org.ogf.graap.wsag.api.client.WsClient;
46 import org.ogf.graap.wsag.api.exceptions.AgreementFactoryException;
47 import org.ogf.graap.wsag.api.exceptions.NegotiationFactoryException;
48 import org.ogf.graap.wsag.api.exceptions.ResourceUnavailableException;
49 import org.ogf.graap.wsag.api.exceptions.ResourceUnknownException;
50 import org.ogf.graap.wsag.api.security.ISecurityProperties;
51 import org.ogf.graap.wsag.api.security.SecurityProperties;
52 import org.ogf.graap.wsag.client.impl.AgreementFactoryFacade;
53 import org.ogf.schemas.graap.wsAgreement.AgreementTemplateType;
54 import org.ogf.schemas.graap.wsAgreement.negotiation.NegotiationContextType;
55 import org.w3.x2005.x08.addressing.EndpointReferenceType;
56
57
58
59
60
61
62
63 public class LocalAgreementFactoryClientImpl
64 implements AgreementFactoryClient
65 {
66
67 private final Agreement[] agreements = new Agreement[0];
68
69 private final AgreementFactory factory;
70
71 private final AgreementFactoryFacade facade;
72
73
74
75
76
77
78
79 public LocalAgreementFactoryClientImpl( AgreementFactory factory )
80 {
81 this.factory = factory;
82 this.facade =
83 new AgreementFactoryFacade( new LocalAgreementFactoryServiceImpl( factory ),
84 new LocalAgreementFactoryRegistryImpl( agreements ), new SecurityProperties( null ) );
85 }
86
87
88
89
90 @Override
91 public AgreementFactoryClient clone() throws CloneNotSupportedException
92 {
93 return new LocalAgreementFactoryClientImpl( factory );
94 }
95
96
97
98
99
100
101 public WsClient getWebServiceClient()
102 {
103 return facade.getWebServiceClient();
104 }
105
106
107
108
109 public AgreementClient createAgreement( AgreementOffer offer )
110 throws AgreementFactoryException, ResourceUnknownException, ResourceUnavailableException
111 {
112 return facade.createAgreement( offer );
113 }
114
115
116
117
118 public AgreementClient createPendingAgreement( AgreementOffer offer )
119 throws AgreementFactoryException, ResourceUnknownException, ResourceUnavailableException
120 {
121 return facade.createPendingAgreement( offer );
122 }
123
124
125
126
127 public AgreementClient createPendingAgreement( AgreementOffer offer, EndpointReferenceType acceptanceEPR )
128 throws AgreementFactoryException, ResourceUnknownException, ResourceUnavailableException
129 {
130 return facade.createPendingAgreement( offer, acceptanceEPR );
131 }
132
133
134
135
136 public NegotiationClient initiateNegotiation( NegotiationContextType context )
137 throws NegotiationFactoryException, ResourceUnknownException, ResourceUnavailableException
138 {
139 return facade.initiateNegotiation( context );
140 }
141
142
143
144
145 public EndpointReferenceType getEndpoint()
146 {
147 return facade.getEndpoint();
148 }
149
150
151
152
153 public Properties getProperties()
154 {
155 return facade.getProperties();
156 }
157
158
159
160
161 public String getResourceId() throws ResourceUnknownException, ResourceUnavailableException
162 {
163 return facade.getResourceId();
164 }
165
166
167
168
169 public ISecurityProperties getSecurityProperties()
170 {
171 return facade.getSecurityProperties();
172 }
173
174
175
176
177 public AgreementTemplateType getTemplate( String name, String id )
178 throws ResourceUnknownException, ResourceUnavailableException
179 {
180 return facade.getTemplate( name, id );
181 }
182
183
184
185
186 public AgreementTemplateType[] getTemplates()
187 throws ResourceUnknownException, ResourceUnavailableException
188 {
189 return facade.getTemplates();
190 }
191
192
193
194
195 public boolean isUsingTrace()
196 {
197 return facade.isUsingTrace();
198 }
199
200
201
202
203 public AgreementClient[] listAgreements() throws ResourceUnknownException, ResourceUnavailableException
204 {
205 return facade.listAgreements();
206 }
207
208
209
210
211 public void setProperties( Properties properties )
212 {
213 facade.setProperties( properties );
214 }
215
216
217
218
219 public void setTrace( boolean trace )
220 {
221 facade.setTrace( trace );
222 }
223
224 }