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/29 01:38:16 UTC
cvs commit: ws-wsrp4j/sandbox/wsrp4j/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver ConsumerConfiguredPortletImpl.java ConsumerPortletRegistrationImpl.java PortletImpl.java
dlouzan 2005/08/28 16:38:16
Added: sandbox/wsrp4j/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver
ConsumerConfiguredPortletImpl.java
ConsumerPortletRegistrationImpl.java
PortletImpl.java
Log:
Initial commit.
Revision Changes Path
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/ConsumerConfiguredPortletImpl.java
Index: ConsumerConfiguredPortletImpl.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.producer.provider.driver;
import org.apache.wsrp4j.commons.producer.provider.ConsumerConfiguredPortlet;
/**
* This class implements the ConsumerConfiguredPortlet interface. It also
* extends the PortletImpl class.
*
* @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
*
* @see ConsumerConfiguredPortlet PortletImpl
* @version $Id: ConsumerConfiguredPortletImpl.java,v 1.1 2005/08/28 23:38:16 dlouzan Exp $
*/
public class ConsumerConfiguredPortletImpl extends PortletImpl
implements ConsumerConfiguredPortlet {
/**
* Portlet handle of the parent ProducerOfferedPortlet object
*/
private String parentHandle = "";
/**
* Sets the portlet handle of the parent ProducerOfferedPortlet.
*
* @param handle String representing the portlet handle of the corresponding
* parent ProducerOfferedPortlet.
*/
public void setParentHandle(String handle) {
parentHandle = handle;
}
/**
* Returns the portlet handle of the corresponding parent
* ProducerOfferedPortlet.
*
* @return String representing the portlet handle of the corresponding
* parent ProducerOfferedPortlet.
*/
public String getParentHandle() {
return parentHandle;
}
/**
* Redefines the clone-method of the Cloneable-interface. This is necessary
* as the clone-method is declared protected in the Object class.
*
* @return Object representing the cloned object.
*/
public Object clone() {
ConsumerConfiguredPortlet clone = new ConsumerConfiguredPortletImpl();
clone.setParentHandle(parentHandle);
return clone;
}
}
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/ConsumerPortletRegistrationImpl.java
Index: ConsumerPortletRegistrationImpl.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.producer.provider.driver;
import java.util.HashSet;
import java.util.Collection;
/**
* This class collects the porlet handles for a registered consumer and
* is used for persistence purpose.
*
* @author <a href="mailto:Ralf.Altrichter@de.ibm.com">Ralf Altrichter</a>
*
* @version $Id: ConsumerPortletRegistrationImpl.java,v 1.1 2005/08/28 23:38:16 dlouzan Exp $
*/
public class ConsumerPortletRegistrationImpl
{
// the registrationHandle of the consumer
private String _registrationHandle;
// collects all portletHandles for this registrationHandle
private HashSet _portletHandles = new HashSet();
/**
* Sets the registration handle for a specific consumer
*
* @param regHandle consumer registration handle
*/
public void setRegistrationHandle(String regHandle)
{
_registrationHandle = regHandle;
}
/**
* Returns the registration handle for a specific consumer
*
* @return registrationHandle
*/
public String getRegistrationHandle()
{
return _registrationHandle;
}
/**
* Add a portlet handle to the current registration
*
* @param portletHandle
*/
public void addPortletHandle(String portletHandle)
{
_portletHandles.add(portletHandle);
}
/**
* Returns true, if the portletHandle is associated to the
* current registration.
*
* @return true on success, otherwise false
*/
public boolean containsPortletHandle(String portletHandle)
{
return _portletHandles.contains(portletHandle);
}
/**
* Removes a portlet handle from the current registration
*
* @param portletHandle
*/
public void deletePortletHandle(String portletHandle)
{
_portletHandles.remove(portletHandle);
}
/**
* Sets a collection of portlet handles for this registration
*
* @param collection
*/
public void setPortletHandles(Collection collection)
{
_portletHandles = (HashSet) collection;
}
/**
* Returns a collection of portlet handles for this registration
*
* @return collection
*/
public Collection getPortletHandles()
{
return _portletHandles;
}
/**
* @return true, if no portlet handles are assigned to this registration
* false, if at least one portlet handle is assigned to his registration
*/
public boolean isEmpty()
{
boolean retVal = false;
if(_portletHandles.size() == 0)
{
retVal = true;
}
return retVal;
}
}
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-producer/src/java/org/apache/wsrp4j/commons/producer/provider/driver/PortletImpl.java
Index: PortletImpl.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.producer.provider.driver;
import java.io.Serializable;
import org.apache.wsrp4j.commons.producer.provider.Portlet;
/**
* <p>This abstract class implements the Portlet interface encapsulating
* Portlet-objects. Provides setters and getters.</p>
* <p>Implements the Cloneable interface to enable cloning of portlets.</p>
* <p>Implements the Serializable interface to enable serialization, e.g. to
* an XML-file.</p>
*
* @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
*
* @see org.apache.wsrp4j.producer.provider.ProducerOfferedPortlet
* @version $Id: PortletImpl.java,v 1.1 2005/08/28 23:38:16 dlouzan Exp $
*/
public abstract class PortletImpl implements Portlet, Serializable {
private String handle = "";
/**
* Returns the portletHandle.
*
* @return A String representing the portletHandle.
*/
public String getPortletHandle() {
return this.handle;
}
/**
* Sets the portletHandle to enable identification of the portlet.
*
* @param portletHandle String to be assigned to handle.
*/
public void setPortletHandle(String portletHandle) {
this.handle = portletHandle;
}
/**
* Redefines the clone-method of the Cloneable-interface. This is necessary
* as the clone-method is declared protected in the Object class.
*
* @return Object representing the cloned object.
*/
public abstract Object clone();
}