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.producer.provider;
022:
023: import oasis.names.tc.wsrp.v1.types.PortletDescription;
024: import oasis.names.tc.wsrp.v1.types.RegistrationContext;
025: import oasis.names.tc.wsrp.v1.types.ServiceDescription;
026: import oasis.names.tc.wsrp.v1.types.UserContext;
027:
028: import org.apache.wsrp4j.exception.WSRPException;
029:
030: /**
031: * This interface provides methods to access portlet descriptions as well as
032: * the service description.
033: *
034: * @author Stefan Behl
035: *
036: */
037: public interface DescriptionHandler {
038:
039: /**
040: * Returns a ServiceDescription, based on the input arguments.
041: * See the getProducerOfferedPortletDescriptions() method for more details.
042: *
043: * @param regContext contains data related to a particular registration
044: * (e.g. the registration handle and state)
045: * @param desiredLocales array of requested locales, if null request all available locales
046: *
047: */
048: public ServiceDescription getServiceDescription(
049: RegistrationContext regContext, String[] desiredLocales)
050: throws WSRPException;
051:
052: /**
053: * Indicates whether registration is required (for this Producer) or not.
054: *
055: * @return Returns true if registration is required, otherwise false.
056: */
057: public boolean isRegistrationRequired() throws WSRPException;
058:
059: /**
060: * Returns an array containing all portlet descriptions, i.e. one portlet
061: * description per producer offered portlet.
062: *
063: * @param regContext contains data related to a particular registration
064: * (e.g. the registration handle and state)
065: * @param desiredLocales array of requested locales, if null request all available locales
066: *
067: * @return Array of PortletDescription-objects.
068: */
069: public PortletDescription[] getProducerOfferedPortletDescriptions(
070: RegistrationContext regContext, String[] desiredLocales)
071: throws WSRPException;
072:
073: /**
074: * Returns an PortletDescription for the given PortletHandle based on the input
075: * arguments. On how the desiredLocales and sendAllLocales parameter affects the
076: * returned PortletDescription, please see the method getProducerOfferedPortletDescriptions().
077: *
078: * @param portletHandle the handle of a particular portlet
079: * @param regContext contains data related to a particular registration
080: * (e.g. the registration handle and state)
081: * @param userContext contains the user context
082: * @param desiredLocales array of requested locales, if null request all available locales
083: *
084: * @return PortletDescription
085: */
086: public PortletDescription getPortletDescription(
087: String portletHandle, RegistrationContext regContext,
088: UserContext userContext, String[] desiredLocales)
089: throws WSRPException;
090:
091: /**
092: * Returns a complete PortletDescription for the given PortletHandle.
093: *
094: * @param portletHandle the handle of a particular portlet
095: *
096: * @return PortletDescription
097: */
098: public PortletDescription getPortletDescription(String portletHandle)
099: throws WSRPException;
100:
101: }
|