Author: chris.laprun(a)jboss.com
Date: 2009-11-13 17:36:33 -0500 (Fri, 13 Nov 2009)
New Revision: 597
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
Modified:
portal/trunk/component/wsrp/pom.xml
Log:
- Started adding support for consumers configuration. This code is currently inert (i.e.
it is not called from main integration point).
Committing for review purpose. Will probably move back to a branch soon.
Modified: portal/trunk/component/wsrp/pom.xml
===================================================================
--- portal/trunk/component/wsrp/pom.xml 2009-11-13 21:33:30 UTC (rev 596)
+++ portal/trunk/component/wsrp/pom.xml 2009-11-13 22:36:33 UTC (rev 597)
@@ -1,24 +1,26 @@
<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-
--->
-
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
@@ -89,6 +91,11 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.api</artifactId>
+ <version>${version.chromattic}</version>
+ </dependency>
</dependencies>
<build>
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,221 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping;
+import
org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
+
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class ConsumerRegistry extends AbstractConsumerRegistry
+{
+ private Chromattic chrome;
+ private static final String WSRP_SERVICES_PATH = RegistryService.EXO_SERVICES +
"/wsrp/";
+ private static final String PRODUCER_INFOS_PATH = WSRP_SERVICES_PATH +
"producerinfos";
+
+ public ConsumerRegistry(InitParams params, RegistryService jcrRegistry) throws
Exception
+ {
+
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
+
+ builder.add(ProducerInfosMapping.class);
+ builder.add(ProducerInfoMapping.class);
+ builder.add(EndpointInfoMapping.class);
+ builder.add(RegistrationInfoMapping.class);
+ builder.add(RegistrationPropertyMapping.class);
+ builder.add(RegistrationPropertyDescriptionMapping.class);
+
+ chrome = builder.build();
+ }
+
+ @Override
+ protected void save(ProducerInfo info, String messageOnError)
+ {
+ String path = getPathFor(info);
+ ChromatticSession session = chrome.openSession();
+
+ session.persist(toProducerInfoMapping(info), path);
+
+ // todo: find a way to inject JCR Id into ProducerInfo
+
+ session.close();
+ }
+
+ @Override
+ protected void delete(ProducerInfo info)
+ {
+ ChromatticSession session = chrome.openSession();
+ delete(session, getPathFor(info));
+
+ session.close();
+ }
+
+ @Override
+ protected String update(ProducerInfo producerInfo)
+ {
+ // todo: need JCR id to be able to find the previous ProducerInfo in case the id
has been modified
+ return null;
+ }
+
+ @Override
+ protected Iterator getAllProducerInfos()
+ {
+ ChromatticSession session = chrome.openSession();
+ ProducerInfosMapping producerInfosMapping =
session.findByPath(ProducerInfosMapping.class, PRODUCER_INFOS_PATH);
+
+ Iterator<ProducerInfo> producerInfos;
+
+ // if we don't have info from JCR, load from XML and populate JCR
+ if (producerInfosMapping == null)
+ {
+ producerInfosMapping = session.insert(ProducerInfosMapping.class,
PRODUCER_INFOS_PATH);
+
+ List<ProducerInfoMapping> infos =
producerInfosMapping.getProducerInfos();
+
+ // Load from XML
+ XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
+ fromXML.reloadConsumers();
+
+ // Save to JCR
+ List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
+ for (WSRPConsumer consumer : consumers)
+ {
+ infos.add(toProducerInfoMapping(consumer.getProducerInfo()));
+ }
+ session.persist(infos); // todo: is that sufficient?
+
+ producerInfos = new ConsumerToProducerInfoIterator(consumers.iterator());
+ }
+ else
+ {
+ List<ProducerInfoMapping> mappings =
producerInfosMapping.getProducerInfos();
+ producerInfos = new MappingToProducerInfoIterator(mappings.iterator());
+ }
+
+ session.save();
+ session.close();
+ return producerInfos;
+ }
+
+ private void delete(ChromatticSession session, String path)
+ {
+ ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
+
+ if (old != null)
+ {
+ session.remove(old);
+ }
+ }
+
+ private String getPathFor(ProducerInfo info)
+ {
+ return PRODUCER_INFOS_PATH + "/" + info.getId();
+ }
+
+ private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo)
+ {
+ return null; // todo: implement
+ }
+
+ private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
+ {
+ return null; // todo: implement
+ }
+
+ private static class ConsumerToProducerInfoIterator implements
Iterator<ProducerInfo>
+ {
+
+ private final Iterator<WSRPConsumer> consumers;
+
+ public ConsumerToProducerInfoIterator(Iterator<WSRPConsumer> consumers)
+ {
+ this.consumers = consumers;
+ }
+
+ @Override
+ public boolean hasNext()
+ {
+ return consumers.hasNext();
+ }
+
+ @Override
+ public ProducerInfo next()
+ {
+ return consumers.next().getProducerInfo();
+ }
+
+ @Override
+ public void remove()
+ {
+ throw new UnsupportedOperationException("Remove not supported!");
+ }
+ }
+
+ private static class MappingToProducerInfoIterator implements
Iterator<ProducerInfo>
+ {
+ private Iterator<ProducerInfoMapping> mappings;
+
+ public MappingToProducerInfoIterator(Iterator<ProducerInfoMapping>
infoMappingIterator)
+ {
+ this.mappings = infoMappingIterator;
+ }
+
+ @Override
+ public boolean hasNext()
+ {
+ return mappings.hasNext();
+ }
+
+ @Override
+ public ProducerInfo next()
+ {
+ return toProducerInfo(mappings.next());
+ }
+
+ @Override
+ public void remove()
+ {
+ throw new UnsupportedOperationException("Remove not supported!");
+ }
+ }
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = EndpointInfoMapping.NODE_NAME)
+public abstract class EndpointInfoMapping
+{
+ public static final String NODE_NAME = "wsrp:endpointinfo";
+
+ @Property(name = "wsdlurl")
+ public abstract String getWSDLURL();
+
+ public abstract void setWSDLURL(String wsdlURL);
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.RelatedMappedBy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ProducerInfoMapping.NODE_NAME)
+public abstract class ProducerInfoMapping
+{
+ public static final String NODE_NAME = "wsrp:producerinfo";
+
+ @OneToOne
+ @RelatedMappedBy("endpoint")
+ public abstract EndpointInfoMapping getEndpointInfo();
+
+ @OneToOne
+ @RelatedMappedBy("registration")
+ public abstract RegistrationInfoMapping getRegistrationInfo();
+
+ @Property(name = "producerid")
+ public abstract String getProducerId();
+
+ public abstract void setProducerId(String id);
+
+ @Property(name = "cache")
+ public abstract Integer getExpirationCacheSeconds();
+
+ public abstract void setExpirationCacheSeconds(Integer expiration);
+
+ @Property(name = "active")
+ public abstract boolean getActive();
+
+ public abstract void setActive(boolean active);
+
+ @Property(name = "available")
+ public abstract boolean getAvailable();
+
+ public abstract void setAvailable(boolean available);
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ProducerInfosMapping.NODE_NAME)
+public abstract class ProducerInfosMapping
+{
+ public static final String NODE_NAME = "wsrp:producerinfos";
+
+ @OneToMany
+ public abstract List<ProducerInfoMapping> getProducerInfos();
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.Property;
+
+import java.io.InputStream;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationInfoMapping.NODE_NAME)
+public abstract class RegistrationInfoMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationinfo";
+
+ @Property(name = "consumername")
+ public abstract String getConsumerName();
+
+ public abstract void setConsumerName(String name);
+
+ @Property(name = "handle")
+ public abstract String getRegistrationHandle();
+
+ public abstract void setRegistrationHandle(String handle);
+
+ @Property(name = "state")
+ public abstract InputStream getRegistrationState();
+
+ public abstract void setRegistrationState(InputStream state);
+
+ @OneToMany
+ public abstract List<RegistrationPropertyMapping> getRegistrationProperties();
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
+public abstract class RegistrationPropertyDescriptionMapping
+{
+ public static final String NODE_NAME =
"wsrp:registrationpropertydescription";
+
+ // todo: this should really be a QName
+ @Property(name = "name")
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ // todo: this should really be a QName
+ @Property(name = "type")
+ public abstract String getType();
+
+ public abstract void setType(String type);
+
+
+ // todo: this should really be a LocalizedString
+ @Property(name = "description")
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ // todo: this should really be a LocalizedString
+ @Property(name = "hint")
+ public abstract String getHint();
+
+ public abstract void setHint(String hint);
+
+ // todo: this should really be a LocalizedString
+ @Property(name = "label")
+ public abstract String getLabel();
+
+ public abstract void setLabel(String label);
+}
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-11-13
22:36:33 UTC (rev 597)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.RelatedMappedBy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationPropertyMapping.NODE_NAME)
+public abstract class RegistrationPropertyMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationproperty";
+
+ @Property(name = "value")
+ public abstract String getValue();
+
+ public abstract void setValue(String value);
+
+ @OneToOne
+ @RelatedMappedBy("description")
+ public abstract RegistrationPropertyDescriptionMapping getDescription();
+
+ // todo: this should really be an enum�
+ @Property(name = "status")
+ public abstract String getStatus();
+
+ public abstract void setStatus(String status);
+}