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/28 23:32:47 UTC

cvs commit: ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/portlet PortletKey.java PortletRegistry.java WSRPPortlet.java

dlouzan     2005/08/28 14:32:47

  Added:       sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/portlet
                        PortletKey.java PortletRegistry.java
                        WSRPPortlet.java
  Log:
  Initial commit.
  
  Revision  Changes    Path
  1.1                  ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/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.commons.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>
   *
   * @version $Id: PortletKey.java,v 1.1 2005/08/28 21:32:47 dlouzan Exp $
   **/
  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/commons-consumer/src/java/org/apache/wsrp4j/commons/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.commons.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 
   *
   * @version $Id: PortletRegistry.java,v 1.1 2005/08/28 21:32:47 dlouzan Exp $
   **/
  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/commons-consumer/src/java/org/apache/wsrp4j/commons/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.commons.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
   *
   * @version $Id: WSRPPortlet.java,v 1.1 2005/08/28 21:32:47 dlouzan Exp $
   **/
  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);
  }