001: /*
002: * Copyright 2000-2001,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: /*
018:
019: */
020:
021: package org.apache.wsrp4j.consumer;
022:
023: import oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType;
024: import oasis.names.tc.wsrp.v1.intf.WSRP_v1_Registration_PortType;
025: import oasis.names.tc.wsrp.v1.intf.WSRP_v1_ServiceDescription_PortType;
026: import oasis.names.tc.wsrp.v1.types.PortletDescription;
027: import oasis.names.tc.wsrp.v1.types.RegistrationContext;
028: import oasis.names.tc.wsrp.v1.types.RegistrationData;
029: import oasis.names.tc.wsrp.v1.types.RegistrationState;
030: import oasis.names.tc.wsrp.v1.types.ReturnAny;
031: import oasis.names.tc.wsrp.v1.types.ServiceDescription;
032:
033: import org.apache.wsrp4j.exception.WSRPException;
034:
035: /**
036: * A consumer representation of a WSRP-producer providing WSRP-portlets.
037: * Generally a producer can expose up to four WSRP-Interfaces. These interfaces are
038: * Markup-, Service Description-,Registration- and Portlet Management Interface. Whereas
039: * the Registration- and Portlet Management Interface are optional.
040: *
041: * @author Stephan Laertz
042: **/
043: public interface Producer {
044:
045: /**
046: * Get the name of the producer.
047: *
048: * @return The name of the producer
049: **/
050: public String getName();
051:
052: /**
053: * Set the name of the producer.
054: *
055: * @param name The name of the producer
056: **/
057: public void setName(String name);
058:
059: /**
060: * Get the ID of the producer.
061: *
062: * @return The ID of the producer
063: **/
064: public String getID();
065:
066: /**
067: * Set the ID of the producer to he given value.
068: *
069: * @param id ID of the producer.
070: **/
071: public void setID(String id);
072:
073: /**
074: * Get a description of the producer.
075: *
076: * @return A description of the producer
077: **/
078: public String getDescription();
079:
080: /**
081: * Set a description of the producer.
082: *
083: * @param description Some descriptive information about the producer
084: **/
085: public void setDescription(String description);
086:
087: /**
088: * Get the URL of the producers service description interface.
089: *
090: * @return URL of the service description interface.
091: **/
092: public String getServiceDescriptionInterfaceEndpoint();
093:
094: /**
095: * Set the URL of the producers service description interface.
096: *
097: * @param url of the service description interface.
098: **/
099: public void setServiceDescriptionInterfaceEndpoint(String url);
100:
101: /**
102: * Get the producers service description interface.
103: *
104: * @return service description interface.
105: **/
106: public WSRP_v1_ServiceDescription_PortType getServiceDescriptionInterface();
107:
108: /**
109: * Get the URL of the producers markup interface.
110: *
111: * @return URL of the markup interface.
112: **/
113: public String getMarkupInterfaceEndpoint();
114:
115: /**
116: * Set the URL of the producers markup interface.
117: *
118: * @param url of the markup interface.
119: **/
120: public void setMarkupInterfaceEndpoint(String url);
121:
122: /**
123: * Get the URL of the producers portlet management interface.
124: *
125: * @return URL of the portlet management interface.
126: **/
127: public String getPortletManagementInterfaceEndpoint();
128:
129: /**
130: * Set the URL of the producers portlet management interface.
131: *
132: * @param url of the portlet management interface.
133: **/
134: public void setPortletManagementInterfaceEndpoint(String url);
135:
136: /**
137: * Get the producers portlet management interface.
138: *
139: * @return portlet management interface.
140: **/
141: public WSRP_v1_PortletManagement_PortType getPortletManagementInterface();
142:
143: /**
144: * Get the URL of the producers registration interface.
145: *
146: * @return URL of the registration interface.
147: **/
148: public String getRegistrationInterfaceEndpoint();
149:
150: /**
151: * Set the URL of the producers registration interface.
152: *
153: * @param url of the registration interface.
154: **/
155: public void setRegistrationInterfaceEndpoint(String url);
156:
157: /**
158: * Get the producers registration interface.
159: *
160: * @return registration interface.
161: **/
162: public WSRP_v1_Registration_PortType getRegistrationInterface();
163:
164: /**
165: * Indicates wether or not the producer requires consumer registration.
166: *
167: * @return True if consumer registration is required.
168: **/
169: public boolean isRegistrationRequired();
170:
171: /**
172: * Define if the producer requires in-band registration or not.
173: *
174: * @param registrationRequired True if the producer requires in-band registration
175: **/
176: public void setIsRegistrationRequired(boolean registrationRequired);
177:
178: /**
179: * Get the registration data the consumer uses to register at this producer.
180: *
181: * @return The consumer registration data
182: **/
183: public RegistrationData getRegistrationData();
184:
185: /**
186: * Set the registration the consumer uses the register at this producer.
187: *
188: * @param regData The registration data which is used to register at this producer
189: **/
190: public void setRegistrationData(RegistrationData regData);
191:
192: /**
193: * Get the service description of the producer
194: *
195: * @param newRequest If set to true a new request is send to the producer otherwise a cached service description
196: * is used if available
197: *
198: * @return Service description of the producer
199: **/
200: public ServiceDescription getServiceDescription(boolean newRequest)
201: throws WSRPException;
202:
203: /**
204: * Same as getServiceDescription(false)
205: **/
206: public ServiceDescription getServiceDescription()
207: throws WSRPException;
208:
209: /**
210: * Get the portlet description of the portlet with the given handle or
211: * null if the producer doesn't know an portlet with this handle.
212: *
213: * @param portletHandle The portlet handle of the portlet
214: *
215: * @return The portlet description of the portlet with the given handle
216: **/
217: public PortletDescription getPortletDescription(String portletHandle)
218: throws WSRPException;
219:
220: /**
221: * Add an portlet description to the producer. This portlet description is
222: * accessable through the portlet handle in the portlet description. If the
223: * producer has already an portlet description with this portlet handle than
224: * the old description will be overwritten.
225: *
226: * @param portletDescription New portlet description
227: **/
228: public void addPortletDescription(
229: PortletDescription portletDescription);
230:
231: /**
232: * Get the current registration context of the consumer registered at this producer or null
233: * if no registration is required or happend so far.
234: *
235: * @return The current registration context of the consumer at this producer or null.
236: **/
237: public RegistrationContext getRegistrationContext();
238:
239: /**
240: * Set the registration context.
241: *
242: * @param registrationContext The registration context of a consumer registered at the producer.
243: **/
244: public void setRegistrationContext(
245: RegistrationContext registrationContext);
246:
247: /**
248: * Method establishes a relationship between consumer and producer.
249: *
250: * Note: A additional call of setRegistrationContext() is not neccesary
251: *
252: * @param registrationData Data which is used to register the consumer
253: *
254: * @return The registration context received by the producer
255: **/
256: public RegistrationContext register(
257: RegistrationData registrationData) throws WSRPException;
258:
259: /**
260: * Can be used to modify the relationship between consumer and producer.
261: *
262: * Note: A additional call of setRegistrationContext() is not neccesary
263: *
264: * @param registrationData The new registration data
265: *
266: * @return New registration context
267: **/
268: public RegistrationState modifyRegistration(
269: RegistrationData registrationData) throws WSRPException;
270:
271: /**
272: * End an existing consumer producer relationship and remove the registration context
273: *
274: * @return Can be anything
275: **/
276: public ReturnAny deregister() throws WSRPException;
277:
278: /**
279: * Check wether the optional registration interface is supported
280: *
281: * @return true if a registration interface endpoint URL is set
282: */
283: public boolean isRegistrationInterfaceSupported();
284:
285: /**
286: * Check wether the optional portlet management interface is supported
287: *
288: * @return true if a portlet management interface endpoint URL is set
289: */
290: public boolean isPortletManagementInferfaceSupported();
291:
292: }
|