You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by dl...@apache.org on 2005/08/03 22:13:48 UTC

cvs commit: ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/user User.java UserRegistry.java

dlouzan     2005/08/03 13:13:48

  Added:       sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/consumer
                        Consumer.java ConsumerCapabilities.java
                        ConsumerEnvironment.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portlet
                        PortletKey.java PortletRegistry.java
                        WSRPPortlet.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portletdriver
                        PortletDriver.java PortletDriverRegistry.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/producer
                        Producer.java ProducerRegistry.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/request
                        InteractionRequest.java MarkupRequest.java
                        WSRPBaseRequest.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/urlgenerator
                        URLGenerator.java URLRewriter.java
                        URLTemplateComposer.java
               sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/user
                        User.java UserRegistry.java
  Log:
  Initial commit.
  
  Revision  Changes    Path
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/consumer/Consumer.java
  
  Index: Consumer.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.consumer;
  
  
  import org.apache.wsrp4j.consumer.interfaces.SessionHandler;
  import org.apache.wsrp4j.consumer.interfaces.portlet.PortletRegistry;
  import org.apache.wsrp4j.consumer.interfaces.portletdriver.PortletDriverRegistry;
  import org.apache.wsrp4j.consumer.interfaces.producer.ProducerRegistry;
  import org.apache.wsrp4j.consumer.interfaces.user.UserRegistry;
  import org.apache.wsrp4j.consumer.interfaces.urlgenerator.URLRewriter;
  import org.apache.wsrp4j.consumer.interfaces.urlgenerator.URLTemplateComposer;
  
  /**
   * The consumer provides access to consumer specific components.
   * 
   * @author <a href='mailto:peter.fischer@de.ibm.com'>Peter Fischer</a>
   */
  public interface Consumer {
  
      /**
       * Get the session handler of the consumer.
       * 
       * @return Interface to the consumer specific session handler
       **/
      SessionHandler getSessionHandler();
  
      /**
       * Get the portlet registry of the consumer.
       * 
       * @return Interface to the consumer specific portlet registry
       **/
      PortletRegistry getPortletRegistry();
  
      /**
       * Get the portlet driver registry of the consumer.
       * 
       * @return Interface to the consumer specific portlet driver registry
       **/
      PortletDriverRegistry getPortletDriverRegistry();
  
      /**
       * Get the producer registry of the consumer.
       * 
       * @return The consumer specific producer registry
       **/
      ProducerRegistry getProducerRegistry();
  
      /**
       * Get the user registry of the consumer.
       * 
       * @return The consumer specific user registry
       **/
      UserRegistry getUserRegistry();
  
      /**
       * Get the url template composer for template proccessing
       * 
       * @return Interface to the consumer specific template composer
       **/
      URLTemplateComposer getTemplateComposer();
  
      /**
       * Get the url rewriter for consumer url-rewriting
       * 
       * @return The consumer specific url rewriter
       **/
      URLRewriter getURLRewriter();
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/consumer/ConsumerCapabilities.java
  
  Index: ConsumerCapabilities.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.consumer;
  
  
  import oasis.names.tc.wsrp.v1.types.StateChange;
  
  
  /**
   * The consumer capababilities provides access to consumer related information.
   * 
   * @author <a href='mailto:peter.fischer@de.ibm.com'>Peter Fischer</a>
   */
  public interface ConsumerCapabilities {
  
      /**
       * Get the name of the consumer
       * 
       * @return The name of the consumer
       **/
      String getConsumerAgent();
  
      /**
       * Get the method which is used by the consumer to authenticate its users.
       *      
       * @return String indicating how end-users were authenticated by the 
       * consumer.
       **/
      String getUserAuthentication();
  
      /**
       * Get the locales which are supported by the consumer.
       * (ISO-639 + "_" + ISO-3166)
       * 
       * @return Array with string representations of the locales which are
       * supported by the consumer
       **/
      String[] getSupportedLocales();
  
      /**
       * Get the portlet modes the consumer is willing to manage.     
       * 
       * @return Array with string representations of the portlet modes which are
       * supported by the consumer
       **/
      String[] getSupportedModes();
  
      /**
       * Get the window states the consumer is willing to manage.     
       * 
       * @return Array with string representations of the window states which are
       * supported by the consumer
       **/
      String[] getSupportedWindowStates();
  
      /**
       * Returns a flag which is used to indicate the producer wether or not
       * the processing of portlets is allowed to modify the portlet state.
       * 
       * @return A flag
       **/
      StateChange getPortletStateChange();
  
      /**
       * Get the character sets the consumer wants the remote portlet to use 
       * for encoding the markup.
       * Valid character sets are defined 
       * <a href='http://www.iana.org/assignments/character-sets'>here</a>
       * 
       * @return Array of string representations of the character encoding.
       **/
      String[] getCharacterEncodingSet();
  
      /**
       * Get an array of mime types which are supported by the consumer.
       * The order in the array defines the order of preference of the consumer.
       * 
       * @return An array of mimes types the consumer supports.
       **/
      String[] getMimeTypes();
  
      /**
       * Set the name of the consumer
       * 
       * @param name The new name of the consumer    
       **/
      void setConsumerAgent(String name);
  
      /**
       * Set the method of end user authentication used by the consumer..
       *      
       * @param authMethod indicating how end-users are authenticated by the 
       * consumer.
       **/
      void setUserAuthentication(String authMethod);
  
      /**
       * Set the mime types the consumer supports
       * The order in the array defines the order of preference of the consumer.
       * 
       * @param mimeTypes An array of mimes types the consumer supports.
       **/
      void setMimeTypes(String[] mimeTypes);
  
      /**
       * Set the locales which are supported by the consumer.
       * Pattern: ISO-639 + "_" + ISO-3166
       * 
       * @param locales Array of string representations of supported locales     
       **/
      void setSupportedLocales(String[] locales);
  
      /**
       * Set the portlet modes which are supported by the consumer.     
       * 
       * @param modes Array of string representations of portlet modes
       **/
      void setSupportedModes(String[] modes);
  
      /**
       * Set the window states which are supported by the consumer.     
       * 
       * @param states Array of string representations of window states
       **/
      void setSupportedWindowStates(String[] states);
  
      /**
       * Set a flag which is used to indicate the producer wether or not
       * the processing of portlets is allowed to modify the portlet state.
       * 
       * @param portletStateChange A flag with one of the following values:
       * StateChange.OK, StateChange.Clone, StateChange.Fault
       **/
      void setPortletStateChange(StateChange portletStateChange);
  
      /**
       * Set the character set the consumer wants the remote portlet to use for 
       * encoding the markup.
       * Valid character sets are defined 
       * <a href='http://www.iana.org/assignments/character-sets'>here</a>
       * 
       * @param charEncoding Array of string representations of the character 
       * encoding.
       **/
      void setCharacterEncodingSet(String[] charEncoding);
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/consumer/ConsumerEnvironment.java
  
  Index: ConsumerEnvironment.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.consumer;
  
  
  
  /**
   * The consumer environment provides access to consumer specific components 
   * and data.
   * 
   * @author Stephan.Laertz@de.ibm.com
   * @author <a href='mailto:peter.fischer@de.ibm.com'>Peter Fischer</a>
   */
  public interface ConsumerEnvironment extends Consumer, ConsumerCapabilities 
  {
      // just a combination of the two interfaces
  }  
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portlet/PortletKey.java
  
  Index: PortletKey.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.portlet;
  
  
  /**
   * Defines the information which uniquely identifies an portlet provided by a 
   * producer.
   * The portlet key does not identify a use of an portlet
   * 
   * @author <a href='mailto:Stephan.Laertz@de.ibm.com'>Stephan Laertz</a>
   **/
  public interface PortletKey {
  
      /**
       * Get the portlet handle which identifies an portlet in the scope of one 
       * producer
       * 
       * @return The portlet handle
       **/
      String getPortletHandle();
  
      /**
       * Set the portlet handle which identifies an portlet in the scope of 
       * one producer
       * 
       * @param portletHandle The portlet handle
       **/
      void setPortletHandle(String portletHandle);
  
      /**
       * Get the ID of the producer providing the portlet
       * 
       * @return The ID of the producer
       **/
      String getProducerId();
  
      /**
       * Set the ID of the producer providing the portlet
       * 
       * @param id The ID of the producer
       **/
      void setProducerId(String id);
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portlet/PortletRegistry.java
  
  Index: PortletRegistry.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.portlet;
  
  
  import java.util.Iterator;
  
  import org.apache.wsrp4j.commons.exception.WSRPException;
  
  
  /**
   * This interface defines a registry which holds portlet objects.
   *
   * @author Stephan Laertz 
   **/
  public interface PortletRegistry {
  
      /**
       * Add a portlet to the registry
       *
       * @param portlet The portlet to add
       */
      void addPortlet(WSRPPortlet portlet) throws WSRPException;
  
      /**
       * Get the portlet for the given producer and portlet handle
       *
       * @param portletKey The portlet key identifying the portlet
       *
       * @return The portlet with the given portlet key
       **/
      WSRPPortlet getPortlet(PortletKey portletKey);
  
      /**
       * Remove the portlet with the given portlet key
       *
       * @param portletKey The portlet key identifying the portlet
       * @return The portlet which has been removed or null
       **/
      WSRPPortlet removePortlet(PortletKey portletKey);
  
      /**
       * Tests if a portlet with the given portlet key
       * 
       * @param portletKey The portlet key identifying the portlet
       * 
       * @return True if portlet exists with this portlet key
       **/
      boolean existsPortlet(PortletKey portletKey);
  
      /**
       * Get all the portlets in the register
       * 
       * @return Iterator with all portlets in the registry
       **/
      Iterator getAllPortlets();
  
      /**
       * Remove all portlets from the registry
       **/
      void removeAllPortlets();
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portlet/WSRPPortlet.java
  
  Index: WSRPPortlet.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.portlet;
  
  
  import oasis.names.tc.wsrp.v1.types.PortletContext;
  
  
  
  /**
   * Defines a consumer-side representation of a remote portlet.
   * A portlet is uniquely identified by its portlet key.
   * Consumer configured portlets are the result of clone operations on
   * existing portlets (parents).
   * 
   * @author Stephan Laertz 
   **/
  public interface WSRPPortlet {
  
      /**
       * Get the portlet key of the portlet. The key can be used to reference
       * to the portlet.
       * 
       * @return a portlet key object
       **/
      PortletKey getPortletKey();
  
      /**
       * Set the portlet key of the portlet.
       * 
       * @param portletKey The portlet key of the portlet
       **/
      void setPortletKey(PortletKey portletKey);
  
      /**
       * Get the portlet context object which contains information about
       * the portlet state.
       * 
       * @return the portlet context object of the portlet.
       **/
      PortletContext getPortletContext();
  
      /**
       * Set the portlet context of the portlet.
       * 
       * @param portletContext The portlet context of the portlet
       **/
      void setPortletContext(PortletContext portletContext);
  
      /**
       * Checks if a portlet is consumer configured portlet.
       * 
       * @return True if the result <code>getParent()</code> is not equal 
       *         to the portlet handle of the portlet key.
       **/
      boolean isConsumerConfigured();
  
      /**
       * Get the portlet handle of the parent portlet. If the portlet
       * is not a consumer configured portlet the handle returned by this method
       * should be the same as the handle in the portlet key returned 
       * by <code>getPortletKey</code>.
       * 
       * @return the portlet handle of the parent portlet.
       **/
      String getParent();
  
      /**
       * Set the portlet handle of the parent portlet. If the supplied 
       * handle is not equal to the handle in the portlet key returned by 
       * <code>getPortletKey</code> this method makes the portlet a 
       * consumer configured portlet.
       * 
       * @param portletHandle the portlet handle of the parent portlet
       **/
      void setParent(String portletHandle);
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portletdriver/PortletDriver.java
  
  Index: PortletDriver.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.portletdriver;
  
  
  import oasis.names.tc.wsrp.v1.types.BlockingInteractionResponse;
  import oasis.names.tc.wsrp.v1.types.DestroyPortletsResponse;
  import oasis.names.tc.wsrp.v1.types.MarkupResponse;
  import oasis.names.tc.wsrp.v1.types.PortletContext;
  import oasis.names.tc.wsrp.v1.types.PortletDescriptionResponse;
  import oasis.names.tc.wsrp.v1.types.PortletPropertyDescriptionResponse;
  import oasis.names.tc.wsrp.v1.types.PropertyList;
  import oasis.names.tc.wsrp.v1.types.ReturnAny;
  
  import org.apache.wsrp4j.commons.exception.WSRPException;
  import org.apache.wsrp4j.consumer.interfaces.request.InteractionRequest;
  import org.apache.wsrp4j.consumer.interfaces.request.MarkupRequest;
  import org.apache.wsrp4j.consumer.interfaces.portlet.WSRPPortlet;
  
  
  /**
   * The portlet driver is a wrapper for all action which can be performed on an
   * portlet. There is one portlet driver for all instances of an portlet.
   */
  public interface PortletDriver {
  
      /**
       * Get the portlet this driver is bound to.
       * 
       * @return The enity
       **/
      WSRPPortlet getPortlet();
  
      /**
       * This method is used to retrieve the markup generated by the portlet 
       * instance.
       * 
       * @param markupRequest The markup request 
       * @return The markup response generated by portlet
       **/
      MarkupResponse getMarkup(MarkupRequest markupRequest, String userID) 
      throws WSRPException;
  
      /**
       * This method is used to perform a blocking interaction on the portlet 
       * instance.
       * 
       * @param actionRequest The interaction request 
       **/
      BlockingInteractionResponse performBlockingInteraction(
          InteractionRequest actionRequest,
          String userID)
          throws WSRPException;
  
      /**
       * Clone the portlet
       * 
       * @return The new portlet context
       **/
      PortletContext clonePortlet(String userID) throws WSRPException;
  
      /**
       * 
       **/
      void initCookie() throws WSRPException;
  
      /**
       * Destroy the producer portlets specified in the entiyHandles array.    
       **/
      DestroyPortletsResponse destroyPortlets(String[] portletHandles, 
              String userID) throws WSRPException;
  
      /**
       * Inform the producer that the sessions specified in the sessionIDs array
       * will no longer be used by the consumer and can therefor be released.     
       **/
      ReturnAny releaseSessions(String[] sessionIDs, String userID) 
      throws WSRPException;
  
      /**
       * Fetches information about the portlet from the producer. 
       * 
       * @param userID is used to get the user context of the user from the user 
       * registry
       * @param desiredLocales Array of locales the description should be 
       * provided
       * @return The response to the getPortletDescription call.
       **/
      PortletDescriptionResponse getPortletDescription(String userID, 
              String[] desiredLocales) throws WSRPException;
  
      /**
       * Fetches all published properties of an remote portlet.
       * 
       * @param userID The ID of the user this request is done for
       * 
       * @return The portlet property description response from the producer
       **/
      PortletPropertyDescriptionResponse getPortletPropertyDescription(
              String userID) throws WSRPException;
  
      /**
       * Get the current values of the properties with the given names.
       * 
       * @param names The names of the properties
       * @param userID The ID of the user is used to get the user context
       * 
       * @return A list of properties containing the values and names of the 
       * properties.
       **/
      PropertyList getPortletProperties(String[] names, String userID) 
      throws WSRPException;
  
      /**
       * Set the portlet properties specified in the property list
       * 
       * @param properties List of properties to be set.
       * @param userID The ID of the user is used to get the user context
       **/
      PortletContext setPortletProperties(PropertyList properties, String userID) 
      throws WSRPException;
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/portletdriver/PortletDriverRegistry.java
  
  Index: PortletDriverRegistry.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.portletdriver;
  
  
  import java.util.Iterator;
  
  import org.apache.wsrp4j.commons.exception.WSRPException;
  import org.apache.wsrp4j.consumer.interfaces.portlet.WSRPPortlet;
  
  
  
  /**
   * This interface defines a registry which can be used to store
   * portlet driver objects.
   * 
   * @author Stephan Laertz
   **/
  public interface PortletDriverRegistry {
  
      /**
       * Get an portlet driver for the given portlet. If there is no portlet 
       * driver object cached a new portlet driver will be created and returned.
       * 
       * @param portlet The portlet the returned portlet driver is bind to
       * 
       * @return The portlet driver for this portlet
       **/
      PortletDriver getPortletDriver(WSRPPortlet portlet) throws WSRPException;
  
      /**
       * Get all cached portlet drivers.
       * 
       * @return Iterator with all portlet drivers in the registry
       **/
      Iterator getAllPortletDrivers();
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/producer/Producer.java
  
  Index: Producer.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.producer;
  
  
  import oasis.names.tc.wsrp.v1.intf.WSRP_v1_PortletManagement_PortType;
  import oasis.names.tc.wsrp.v1.intf.WSRP_v1_Registration_PortType;
  import oasis.names.tc.wsrp.v1.intf.WSRP_v1_ServiceDescription_PortType;
  import oasis.names.tc.wsrp.v1.types.PortletDescription;
  import oasis.names.tc.wsrp.v1.types.RegistrationContext;
  import oasis.names.tc.wsrp.v1.types.RegistrationData;
  import oasis.names.tc.wsrp.v1.types.RegistrationState;
  import oasis.names.tc.wsrp.v1.types.ReturnAny;
  import oasis.names.tc.wsrp.v1.types.ServiceDescription;
  
  import org.apache.wsrp4j.commons.exception.WSRPException;
  
  
  /**
   * A consumer representation of a WSRP-producer providing WSRP-portlets.
   * Generally a producer can expose up to four WSRP-Interfaces. These 
   * interfaces are Markup-, Service Description-,Registration- and 
   * Portlet Management Interface. Whereas the Registration- and 
   * Portlet Management Interface are optional.
   * 
   * @author Stephan Laertz
   **/
  public interface Producer {
  
      /**
       * Get the name of the producer.               
       *
       * @return The name of the producer
       **/
      String getName();
  
      /**
       * Set the name of the producer.
       *
       * @param name The name of the producer     
       **/
      void setName(String name);
  
      /**
       * Get the ID of the producer.
       * 
       * @return The ID of the producer
       **/
      String getID();
  
      /**
       * Set the ID of the producer to he given value.
       * 
       * @param id ID of the producer.
       **/
      void setID(String id);
  
      /**
       * Get a description of the producer.
       *
       * @return A description of the producer
       **/
      String getDescription();
  
      /**
       * Set a description of the producer.
       *
       * @param description Some descriptive information about the producer    
       **/
      void setDescription(String description);
  
      /**
       * Get the URL of the producers service description interface.
       *
       * @return URL of the service description interface.
       **/
      String getServiceDescriptionInterfaceEndpoint();
  
      /**
       * Set the URL of the producers service description interface.
       *
       * @param url of the service description interface.
       **/
      void setServiceDescriptionInterfaceEndpoint(String url);
  
  	/**
  	 * Get the producers service description interface.
  	 *
  	 * @return service description interface.
  	 **/
  	WSRP_v1_ServiceDescription_PortType getServiceDescriptionInterface();
  
      /**
       * Get the URL of the producers markup interface.
       *
       * @return URL of the markup interface.
       **/
      String getMarkupInterfaceEndpoint();
  
      /**
       * Set the URL of the producers markup interface.
       *
       * @param url of the markup interface.
       **/
      void setMarkupInterfaceEndpoint(String url);
  
  	/**
  	 * Get the URL of the producers portlet management interface.
  	 *
  	 * @return URL of the portlet management interface.
  	 **/
  	String getPortletManagementInterfaceEndpoint();
  
  	/**
  	 * Set the URL of the producers portlet management interface.
  	 *
  	 * @param url of the portlet management interface.
  	 **/
  	void setPortletManagementInterfaceEndpoint(String url);
  
  	/**
  	 * Get the producers portlet management interface.
  	 *
  	 * @return portlet management interface.
  	 **/
  	WSRP_v1_PortletManagement_PortType getPortletManagementInterface();
  
  	/**
  	 * Get the URL of the producers registration interface.
  	 *
  	 * @return URL of the registration interface.
  	 **/
  	String getRegistrationInterfaceEndpoint();
  
  	/**
  	 * Set the URL of the producers registration interface.
  	 *
  	 * @param url of the registration interface.
  	 **/
  	void setRegistrationInterfaceEndpoint(String url);
  
  	/**
  	 * Get the producers registration interface.
  	 *
  	 * @return registration interface.
  	 **/
  	WSRP_v1_Registration_PortType getRegistrationInterface();
  
      /**
       * Indicates wether or not the producer requires consumer registration.
       *
       * @return True if consumer registration is required.
       **/
      boolean isRegistrationRequired();
  
      /**
       * Define if the producer requires in-band registration or not.
       * 
       * @param registrationRequired True if the producer requires in-band 
       * registration
       **/
      void setIsRegistrationRequired(boolean registrationRequired);
  
      /**
       * Get the registration data the consumer uses to register at this producer.
       * 
       * @return The consumer registration data
       **/
      RegistrationData getRegistrationData();
  
      /**
       * Set the registration the consumer uses the register at this producer.
       * 
       * @param regData The registration data which is used to register at 
       * this producer
       **/
      void setRegistrationData(RegistrationData regData);
  
      /**
       * Get the service description of the producer
       * 
       * @param newRequest If set to true a new request is send to the producer 
       * otherwise a cached service description is used if available
       * 
       * @return Service description of the producer
       **/
      ServiceDescription getServiceDescription(boolean newRequest) 
      throws WSRPException;
  
      /**
       * Same as getServiceDescription(false)
       **/
      ServiceDescription getServiceDescription() throws WSRPException;
  
      /**
       * Get the portlet description of the portlet with the given handle or 
       * null if the producer doesn't know an portlet with this handle.
       * 
       * @param portletHandle The portlet handle of the portlet
       * 
       * @return The portlet description of the portlet with the given handle
       **/
      PortletDescription getPortletDescription(String portletHandle) 
      throws WSRPException;
  
      /**
       * Add an portlet description to the producer. This portlet description is
       * accessable through the portlet handle in the portlet description. If the
       * producer has already an portlet description with this portlet handle than
       * the old description will be overwritten.
       * 
       * @param portletDescription New portlet description 
       **/
      void addPortletDescription(PortletDescription portletDescription);
  
      /**
       * Get the current registration context of the consumer registered at this 
       * producer or null if no registration is required or happend so far.
       * 
       * @return The current registration context of the consumer at this
       * producer or null.
       **/
      RegistrationContext getRegistrationContext();
  
      /**
       * Set the registration context.
       * 
       * @param registrationContext The registration context of a consumer 
       * registered at the producer.
       **/
      void setRegistrationContext(RegistrationContext registrationContext);
  
      /**
       * Method establishes a relationship between consumer and producer.
       * 
       * Note: A additional call of setRegistrationContext() is not neccesary 
       *      
       * @param registrationData Data which is used to register the consumer     
       * 
       * @return The registration context received by the producer      
       **/
      RegistrationContext register(RegistrationData registrationData) 
      throws WSRPException;
  
      /**
       * Can be used to modify the relationship between consumer and producer.
       * 
       * Note: A additional call of setRegistrationContext() is not neccesary
       *     
       * @param registrationData The new registration data                 
       * 
       * @return New registration context     
       **/
      RegistrationState modifyRegistration(RegistrationData registrationData) 
      throws WSRPException;
  
      /**
       * End an existing consumer producer relationship and remove the 
       * registration context        
       * 
       * @return Can be anything
       **/
      ReturnAny deregister() throws WSRPException;
      
      /**
       * Check wether the optional registration interface is supported
       *
       * @return true if a registration interface endpoint URL is set
       */
      boolean isRegistrationInterfaceSupported();
  
  	/**
  	 * Check wether the optional portlet management interface is supported
  	 *
  	 * @return true if a portlet management interface endpoint URL is set
  	 */
  	boolean isPortletManagementInferfaceSupported();
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/producer/ProducerRegistry.java
  
  Index: ProducerRegistry.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.producer;
  
  
  import java.util.Iterator;
  
  
  /**
   * Defines a registry which can be used to administer
   * producer objects.
   * 
   * @author Stephan Laertz 
   **/
  public interface ProducerRegistry {
  
      /**
       * Add a producer to the registry
       * 
       * @param producer The producer to add
       */
      void addProducer(Producer producer);
  
      /**
       * Get the producer for the given URL
       * 
       * @param id The ID of the producer
       * 
       * @return The producer with the given ID
       **/
      Producer getProducer(String id);
  
      /**
       * Get all producer in the registry
       * 
       * @return Iterator with all producers
       **/
      Iterator getAllProducers();
  
      /**
       * Remove the producer with the given ID from the registry
       * 
       * @param id The ID of the producer
       * 
       * @return The producer which had been mapped to this id or 
       *         null if no producer was found with this id
       **/
      Producer removeProducer(String id);
  
      /**
       * Remove all producer objects from the registry
       **/
      void removeAllProducers();
  
      /**
       * Check if a producer with the given ID exists in the registry.
       * 
       * @param id The ID of the producer
       * 
       * @return True if producer exists with this ID
       **/
      boolean existsProducer(String id);
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/request/InteractionRequest.java
  
  Index: InteractionRequest.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.request;
  
  import oasis.names.tc.wsrp.v1.types.NamedString;
  
  
  /**
   * This is the abstraction for a interaction request at a integrated
   * remote portlet at the consumer side.
   * 
   **/
  public interface InteractionRequest extends WSRPBaseRequest {
  
      /**
       * Get all the interaction state
       * 
       * @return Interaction state
       **/
      String getInteractionState();
  
      /**
       * Get all name/value pairs aa result of processing an form
       * 
       * @return Array of name/value pairs
       **/
      NamedString[] getFormParameters();
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/request/MarkupRequest.java
  
  Index: MarkupRequest.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.request;
  
  import oasis.names.tc.wsrp.v1.types.MarkupContext;
  
  
  /**
   * This is the abstraction for a render request at a integrated
   * remote portlet at the consumer side.
   * 
   **/
  public interface MarkupRequest extends WSRPBaseRequest {
  
      /**
       * Get the markup context if there is cached markup for this portlet 
       * instance or null in case of an empty markup cache.
       * 
       * @return The cached markup context
       **/
      MarkupContext getCachedMarkup();
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/request/WSRPBaseRequest.java
  
  Index: WSRPBaseRequest.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.request;
  
  
  import oasis.names.tc.wsrp.v1.types.ClientData;
  
  
  /**
   * The <code>WSRPRequest</code> is the base interface for all
   * requests to a consumer side invocation of a integrated remote portlet.
   * Specialized interfaces exist for markup and action calls. 
   * 
   * @see MarkupRequest
   * @see InteractionRequest
   * 
   **/
  public interface WSRPBaseRequest {
  
      /**
       * Get the ID of the session context 
       *  
       * @return The session context
       **/
      String getSessionID();
  
      /**
       * Get an opaque string which corresponds to a unique reference to this 
       * use of the portlet.
       * 
       * @return The portlet instance key
       **/
      String getPortletInstanceKey();
  
      /**
       * Get the current navigational state of the portlet
       * 
       * @return The navigational state
       **/
      String getNavigationalState();
  
      /**
       * Get the current window state of the portlet
       * 
       * @return The window state
       **/
      String getWindowState();
  
      /**
       * Get the current mode of the portlet
       * 
       * @return The mode of the portlet
       **/
      String getMode();
  
      /**
       * Get the <code>ClientData</code> structure which carries
       * information about the end user agent.
       * 
       * @return The <code>ClientData</code> specifying the user agent.
       **/
      ClientData getClientData();
  
      /**
       * Get the locales which are supported by the portlet according to the 
       * client connecting to it.
       * The Locales returned are in the form of (ISO-639 + "-" + ISO-3166)
       * 
       * @return Array with string representations of the locales which are
       * supported by the consumer
       **/
      String[] getLocales();
  
      /**
       * Get the list of wsrp modes which are supported by the portlet.
       * This should returned the list of all actuall supported modes and
       * not necessarily the modes returned in the portlet description of the 
       * producer. 
       * 
       * @return Array with string representations of the portlet modes
       * supported by the portlet or null
       **/
      String[] getModes();
  
      /**
       * Get the list of wsrp window states which are supported by the portlet.
       * This should returned the list of all actuall supported window states and
       * not necessarily the window states returned in the portlet description of 
       * the producer. 
       * 
       * @return Array with string representations of the window states
       * supported by the portlet or null
       **/
      String[] getWindowStates();
  
      /**
       * Get an array of mime types which are supported by the end user device.
       * The order in the array defines the order of preference of the end user.    
       * 
       * @return An array of mimes types the consumer supports or null
       **/
      String[] getMimeTypes();
  
      /**
       * Get the character sets the consumer wants the remote portlet to use for 
       * encoding the markup.
       * Valid character sets are defined 
       * <a href='http://www.iana.org/assignments/character-sets'>here</a>
       *
       * @return Array of string representations of the character encoding.
       **/
      String[] getCharacterEncodingSet();
  
      /**
       * Checks wether a given wsrp mode is supported by the portlet.
       * 
       * @param wsrpMode The wsrp mode
       * @return True if the mode is supported by the portlet, false otherwise
       **/
      boolean isModeSupported(String wsrpMode);
  
      /**
       * Checks wether a given wsrp window state is supported by the portlet.
       * 
       * @param wsrpWindowState The wsrp window state
       * @return True if the window state is supported by the portlet, false 
       * otherwise
       **/
      boolean isWindowStateSupported(String wsrpWindowState);
  
      /**
       * Get the method which is used by the consumer to authenticate its users.
       *      
       * @return String indicating how end-users were authenticated by the 
       * consumer.
       **/
      String getUserAuthentication();
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/urlgenerator/URLGenerator.java
  
  Index: URLGenerator.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.urlgenerator;
  
  
  import java.util.Map;
  
  
  /**
   * This interface provides methods to query the consumer's urls. 
   * These methods could be used to implement consumer url rewriting.
   *
   * @author  <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
   **/
  public interface URLGenerator {
  
      /**
       * Creates a URL pointing to the consumer,triggering a 
       * performBlockingInteraction call.    
       * 
       * @param params A map with all parameters which should be appended
       *               to the URL.
       *
       * @return a blockingInteraction URL
       **/
      String getBlockingActionURL(Map params);
  
      /**
       * Creates a URL pointing to the consumer,triggering a getMarkup call.    
       * 
       * @param params A map with all parameters which should be appended
       *               to the URL.
       *
       * @return a getMarkup URL
       **/
      String getRenderURL(Map params);
  
      /**
       * Creates a URL pointing to the consumer,triggering the consumer
       * to fetch a certain resource
       * 
       * @param params A map with all parameters which should be appended
       *               to the URL.
       *
       * @return a resource URL
       **/
      String getResourceURL(Map params);
  
      /**
       * Creates a 'url' that the consumer can use to namespace tokens.    
       *     
       *
       * @return a prefix which ca nbe used to namespace tokens.
       **/
      String getNamespacedToken(String token);
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/urlgenerator/URLRewriter.java
  
  Index: URLRewriter.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.urlgenerator;
  
  
  /**
   * <p>This interface provides a method performing Consumer URLRewriting.</p>
   *
   * @author  <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
   *
   * @version 1.1
   */
  public interface URLRewriter {
  
      /**
       * Sets the URLGenerator to be used.
       */
      void setURLGenerator(URLGenerator urlGenerator);
  
      /**
       * Parses the entire markup and rewrites all found URLs. The URLs to be
       * rewritten are enclosed by the tokens "wsrp-rewrite" and "/wsrp-rewrite".
       *
       * @param  markup           The markup to be parsed for URLs
       *                          to be rewritten.
       *
       * @return String representing markup incl. complete URLs.
       */
      String rewriteURLs(String markup);
  
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/urlgenerator/URLTemplateComposer.java
  
  Index: URLTemplateComposer.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.urlgenerator;
  
  
  /**
   * <p>This interface provides methods to generate URL templates.</p>
   * <p>The generated templates will be transmitted to Producers (or 
   * respectively portlets) that are willing to properly write URLs for a 
   * Consumer. (With templates the Consumer indicates how it needs URLs 
   * formatted in order to process them properly.)</p> 
   *
   * @author  <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
   *
   * @version 1.1
   */
  public interface URLTemplateComposer {
  
      /**
       * Sets the URLGenerator to be used.
       */
      void setURLGenerator(URLGenerator urlGenerator);
  
      /**
       * Creates a blocking action template. Includes tokens for url-type, 
       * portletMode, navigationalState, interactionState and windowState to 
       * be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createBlockingActionTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a secure blocking action template. Includes tokens for url-type,
       * portletMode, navigationalState, interactionState, windowState and 
       * secureURL to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createSecureBlockingActionTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a render template. Includes tokens for url-type, portletMode,
       * navigationalState, interactionState and windowState to be replaced by 
       * the producer.
       *
       * @return String representing the entire template.
       */
      String createRenderTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a secure render template. Includes tokens for url-type, 
       * portletMode, navigationalState, interactionState, windowState and 
       * secureURL to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createSecureRenderTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a resource template. Includes tokens for url-type,
       * rewriteResource and url to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createResourceTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a secure resource template. Includes tokens for url-type, url,
       * rewriteResource, and secureURL to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createSecureResourceTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a default template. Includes tokens for url-type, portletMode,
       * navigationalState, interactionState, windowState, url, rewriteResource
       * and secureURL to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createDefaultTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Creates a secure default template. Includes tokens for url-type, 
       * portletMode, navigationalState, interactionState, windowState, url, 
       * rewriteResource and secureURL to be replaced by the producer.
       *
       * @return String representing the entire template.
       */
      String createSecureDefaultTemplate(
          boolean includePortletHandle,
          boolean includeUserContextKey,
          boolean includePortletInstanceKey,
          boolean includeSessionID);
  
      /**
       * Get the consumers namespace prefix which is used by the portlet
       * to namespace tokens which need to be unique on a aggregated page. 
       *
       * @return The namespace prefix of the consumer.
       **/
      String getNamespacePrefix();
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/user/User.java
  
  Index: User.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.user;
  
  
  import oasis.names.tc.wsrp.v1.types.UserContext;
  
  
  /**
   * This interface defines a user with a certain
   * user id and a user context.
   * 
   * @author Stephan Laertz
   **/
  public interface User {
  
      /**
       * Returns the userID
       * 
       * @return _userID
       */
      String getUserID();
  
      /**
       * Sets the userID
       * 
       * @param userID as String
       */
      void setUserID(String userID);
  
      /**
       * Returns the UserContext for this userid
       * 
       * @return _userContext 
       */
      UserContext getUserContext();
  
      /**
       * Sets the UserContext for this userID
       *
       * @param userContext 
       */
      void setUserContext(UserContext userContext);
  }
  
  
  
  1.1                  ws-wsrp4j/sandbox/wsrp4j/consumer/src/java/org/apache/wsrp4j/consumer/interfaces/user/UserRegistry.java
  
  Index: UserRegistry.java
  ===================================================================
  /*
   * Copyright 2003-2005 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.wsrp4j.consumer.interfaces.user;
  
  
  import java.util.Iterator;
  
  
  /**
   * Defines a registry which can be used to manage users.
   * 
   * @author Stephan Laertz
   **/
  public interface UserRegistry {
  
      /**
       * Add a user to the registry
       *
       * @param user The user to add
       *
       * @return The user added or null
       **/
      User addUser(User user);
  
      /**
       * Get the user with the given id
       * 
       * @param userID The ID of the user
       * 
       * @return The user object with the given user id
       **/
      User getUser(String userID);
  
      /**
       * Remove a user from the list of known user
       * 
       * @param userID The ID of the user 
       * @return The user which has been removed or null
       **/
      User removeUser(String userID);
  
      /**
       * Remove all users from the registry     
       **/
      void removeAllUsers();
  
      /**
       * Get an iterator with all known users
       * 
       * @return All known user objects in an iterator
       **/
      Iterator getAllUsers();
  }