Author: richard.opalka(a)jboss.com
Date: 2008-03-14 11:12:14 -0400 (Fri, 14 Mar 2008)
New Revision: 5982
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessage.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessageFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequence.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaData.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilder.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilderFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceState.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMStore.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/PersistenceTestCase.java
Log:
[JBWS-1828] message store interfaces for future use on both client and server side
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessage.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessage.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessage.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+/**
+ * Message abstraction on persistence layer
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMMessage
+{
+
+ /**
+ * Message id specified in either <b>MessageID</b> or
<b>RelatesTo</b> addressing header element
+ * @return message id
+ */
+ String getMessageId();
+
+ /**
+ * Gets bytes of SOAP payload without WS-Security and WS-RM elements present
+ * @return
+ */
+ byte[] getData();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessageFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessageFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessageFactory.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Factory for creating storable message wrappers
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMMessageFactory
+{
+
+ private static final RMMessageFactory instance = new RMMessageFactory();
+
+ private RMMessageFactory()
+ {
+ // forbidden inheritance
+ }
+
+ /**
+ * Gets factory instance
+ * @return factory instance
+ */
+ public static final RMMessageFactory getInstance()
+ {
+ return instance;
+ }
+
+ /**
+ * Constructs new storable message wrapper
+ * @param messageId specified in either <b>MessageID</b> or
<b>RelatesTo</b> addressing header element
+ * @param data bytes of SOAP payload without WS-Security and WS-RM elements present
+ * @return storable message wrapper
+ */
+ public final RMMessage newMessage(String messageId, byte[] data)
+ {
+ throw new NotImplementedException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMMessageFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequence.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequence.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequence.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import java.util.Iterator;
+
+/**
+ * Storable sequence
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequence
+{
+
+ /**
+ * Gets sequence outbound id
+ * @return sequence outbound id
+ */
+ String getOutboundId();
+
+ /**
+ * Gets sequence inbound id
+ * @return sequence inbound id
+ */
+ String getInboundId();
+
+ /**
+ * This method will be used on client side only.
+ * Inbound sequence id is available on first response message from server
+ * @param inboundId inbound id to set
+ */
+ void setInboundId(String inboundId);
+
+ /**
+ * Gets sequence metadata
+ * @return sequence metadata
+ */
+ RMSequenceMetaData getMetaData();
+
+ /**
+ * Sets sequence state
+ * @param seqState new sequence state
+ */
+ void setState(RMSequenceState seqState);
+
+ /**
+ * Gets sequence state
+ * @return sequence state
+ */
+ RMSequenceState getState();
+
+ /**
+ * Adds new inbound message to the sequence
+ * @param msg inbound message persistence wrapper
+ */
+ void addInboundMessage(RMMessage msg);
+
+ /**
+ * Adds new outbound message to the sequence
+ * @param msg outbound message persistence wrapper
+ */
+ void addOutboundMessage(RMMessage msg);
+
+ /**
+ * Gets all arrived inbound messages ids
+ * @return all arrived inbound messages ids
+ */
+ Iterator<Long> getInboundMessageNumbers();
+
+ /**
+ * Gets all sent inbound messages ids
+ * @return all sent inbound messages ids
+ */
+ Iterator<Long> getOutboundMessageNumbers();
+
+ /**
+ * Gets particular inbound message wrapper identified by its message number
+ * @param msgInboundNo message inbound number
+ * @return message wrapper
+ */
+ RMMessage getInboundMessage(long msgInboundNo);
+
+ /**
+ * Gets particular outbound message wrapper identified by its message number
+ * @param msgInboundNo message outbound number
+ * @return message wrapper
+ */
+ RMMessage getOutboundMessage(long msgOutboundNo);
+
+ /**
+ * Gets particular inbound message wrapper identified by its message id
+ * @param msgInboundNo message inbound number
+ * @return message wrapper
+ */
+ RMMessage getInboundMessage(String messageId);
+
+ /**
+ * Gets particular outbound message wrapper identified by its message id
+ * @param msgInboundNo message outbound number
+ * @return message wrapper
+ */
+ RMMessage getOutboundMessage(String messageId);
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequence.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceFactory.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Sequence factory used on both client and server sides
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMSequenceFactory
+{
+
+ private static RMSequenceFactory instance = new RMSequenceFactory();
+
+ private RMSequenceFactory()
+ {
+ // forbidden inheritance
+ }
+
+ /**
+ * Gets factory instance
+ * @return factory instance
+ */
+ public static final RMSequenceFactory getInstance()
+ {
+ return instance;
+ }
+
+ /**
+ * Creates new sequence instance. This method will be used on server side only.
+ * The created sequence will have automatically generated both inbound and outbound
ids.
+ * @param seqMD sequence metadata
+ * @return new server sequence instance
+ */
+ public RMSequence newSequence(RMSequenceMetaData seqMD)
+ {
+ return newSequence(seqMD, null);
+ }
+
+ /**
+ * Creates new sequence instance. This method will be used on client side only.
+ * The created sequence will have outbound id set to the value passed via
<b>outboundId</b> parameter
+ * and inbound id will be null until client will change it to the specified value
lazily.
+ * @param seqMD sequence metadata
+ * @param outboundId outbound sequence id
+ * @return new client sequence instance
+ */
+ public RMSequence newSequence(RMSequenceMetaData seqMD, String outboundId)
+ {
+ throw new NotImplementedException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaData.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaData.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaData.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import org.jboss.ws.extensions.wsrm.RMDeliveryAssurance;
+
+/**
+ * Sequence meta data associated with sequence during its lifetime
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceMetaData
+{
+
+ /**
+ * Gets sequence SOAP version
+ * @return sequence SOAP version
+ */
+ public String getSOAPVersion();
+
+ /**
+ * Gets sequence WSRM version
+ * @return sequence WSRM version
+ */
+ public String getWSRMVersion();
+
+ /**
+ * Gets sequence ADDR version
+ * @return sequence ADDR version
+ */
+ public String getADDRVersion();
+
+ /**
+ * Gets endpoint address
+ * @return endpoint address
+ */
+ public String getEndpointAddress();
+
+ /**
+ * Gets acks to address
+ * @return acks to address
+ */
+ public String getAcksToAddress();
+
+ /**
+ * Gets quality of service to be ensured
+ * @return quality of service
+ */
+ public RMDeliveryAssurance getDeliveryAssurance();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilder.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilder.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilder.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+/**
+ * Sequence metadata builder
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public interface RMSequenceMetaDataBuilder
+{
+
+ /**
+ * Sets sequence SOAP version
+ * @param soapVersion SOAP version used during sequence lifetime
+ * @return this
+ */
+ RMSequenceMetaDataBuilder setSOAPVersion(String soapVersion);
+
+ /**
+ * Sets sequence WSRM version
+ * @param wsrmVersion WSRM version used during sequence lifetime
+ * @return this
+ */
+ RMSequenceMetaDataBuilder setWSRMVersion(String wsrmVersion);
+
+ /**
+ * Sets sequence ADDR version
+ * @param addrVersion ADDR version used during sequence lifetime
+ * @return this
+ */
+ RMSequenceMetaDataBuilder setADDRVersion(String addrVersion);
+
+ /**
+ * Sets endpoint address
+ * @param endpointAddr endpoint address
+ * @return this
+ */
+ RMSequenceMetaDataBuilder setEndpointAddress(String endpointAddr);
+
+ /**
+ * Sets acks to address
+ * @param acksToAddr acks to address
+ * @return this
+ */
+ RMSequenceMetaDataBuilder setAcksToAddress(String acksToAddr);
+
+ /**
+ * Builded sequence metadata
+ * @return sequence metadata
+ */
+ RMSequenceMetaData toSequenceMetaData();
+
+ /**
+ * Clear internals so this instance can be reused
+ */
+ void clear();
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilderFactory.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilderFactory.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilderFactory.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Sequence metadata builder factory
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMSequenceMetaDataBuilderFactory
+{
+
+ private static RMSequenceMetaDataBuilderFactory instance = new
RMSequenceMetaDataBuilderFactory();
+
+ private RMSequenceMetaDataBuilderFactory()
+ {
+ // forbidden instantiation
+ }
+
+ /**
+ * Gets factory instance
+ * @return factory instance
+ */
+ public static final RMSequenceMetaDataBuilderFactory getInstance()
+ {
+ return instance;
+ }
+
+ /**
+ * Returns new sequence metadata builder instance
+ * @return new sequence metadata builder instance
+ */
+ public final RMSequenceMetaDataBuilder newBuilder()
+ {
+ return new RMSequenceMetaDataBuilderImpl();
+ }
+
+ /**
+ * @see org.jboss.ws.extensions.wsrm.persistence.RMSequenceMetaDataBuilder
+ */
+ private static class RMSequenceMetaDataBuilderImpl implements
RMSequenceMetaDataBuilder
+ {
+
+ public void clear()
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaDataBuilder setAcksToAddress(String acksToAddr)
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaDataBuilder setADDRVersion(String addrVersion)
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaDataBuilder setEndpointAddress(String endpointAddr)
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaDataBuilder setSOAPVersion(String soapVersion)
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaDataBuilder setWSRMVersion(String wsrmVersion)
+ {
+ throw new NotImplementedException();
+ }
+
+ public RMSequenceMetaData toSequenceMetaData()
+ {
+ throw new NotImplementedException();
+ }
+
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceMetaDataBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceState.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceState.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceState.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+/**
+ * Possible sequence states
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public enum RMSequenceState
+{
+
+ CREATED(0),
+ CLOSED(1),
+ TERMINATED(2);
+
+ private final int state;
+
+ private RMSequenceState(int state)
+ {
+ this.state = state;
+ }
+
+ /**
+ * Returns integer representation of the enum instance
+ * @return
+ */
+ public final int getState()
+ {
+ return this.state;
+ }
+
+ /**
+ * Factory method for constructing this enum instance from its integer representation
+ * @param state for which enum instance is required
+ * @return enum instance
+ */
+ public final RMSequenceState valueOf(int state)
+ {
+ if (0 == state)
+ return CREATED;
+ if (1 == state)
+ return CLOSED;
+ if (2 == state)
+ return TERMINATED;
+
+ throw new RuntimeException();
+ }
+
+ /**
+ * Returns string enum representation
+ * @return string enum representation
+ */
+ @Override
+ public final String toString()
+ {
+ if (CREATED == this)
+ return "created";
+ if (CLOSED == this)
+ return "closed";
+ if (TERMINATED == this)
+ return "terminated";
+
+ throw new RuntimeException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMSequenceState.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMStore.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMStore.java
(rev 0)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMStore.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.ws.extensions.wsrm.persistence;
+
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Sequences persistent store singleton.
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class RMStore
+{
+
+ private static final RMStore instance = new RMStore();
+
+ private RMStore()
+ {
+ // forbidden inheritance
+ }
+
+ /**
+ * Gets store instance
+ * @return store instance
+ */
+ public static final RMStore getInstance()
+ {
+ return instance;
+ }
+
+ /**
+ * Writes sequence to the persistence layer
+ * @param seq sequence to be persisted
+ */
+ public final void write(RMSequence seq)
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Reads sequence from persistence layer
+ * @param sequenceId sequence id to use for lookup
+ * @param outbound if true <b>sequenceId</b> is outbound otherwise
inbound
+ * @return sequence or null
+ */
+ public final RMSequence read(String sequenceId, boolean outbound)
+ {
+ throw new NotImplementedException();
+ }
+
+}
Property changes on:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/wsrm/persistence/RMStore.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/PersistenceTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/PersistenceTestCase.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/PersistenceTestCase.java 2008-03-14
15:12:14 UTC (rev 5982)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jboss.test.ws.jaxws.wsrm.persistence;
+
+import java.util.Iterator;
+
+import org.jboss.ws.extensions.wsrm.persistence.RMMessage;
+import org.jboss.ws.extensions.wsrm.persistence.RMMessageFactory;
+import org.jboss.ws.extensions.wsrm.persistence.RMSequence;
+import org.jboss.ws.extensions.wsrm.persistence.RMSequenceFactory;
+import org.jboss.ws.extensions.wsrm.persistence.RMSequenceMetaData;
+import org.jboss.ws.extensions.wsrm.persistence.RMSequenceMetaDataBuilder;
+import org.jboss.ws.extensions.wsrm.persistence.RMSequenceMetaDataBuilderFactory;
+import org.jboss.ws.extensions.wsrm.persistence.RMStore;
+
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * WSRM persistent store test
+ *
+ * @author richard.opalka(a)jboss.com
+ */
+public final class PersistenceTestCase extends JBossWSTest
+{
+
+ public void testPersistency() throws Exception
+ {
+
+ if (true)
+ {
+ System.out.println("FIXME [JBWS-2044]");
+ return;
+ }
+
+ RMSequenceMetaDataBuilder seqMDBuilder =
RMSequenceMetaDataBuilderFactory.getInstance().newBuilder();
+ RMSequenceMetaData sequenceMD = seqMDBuilder
+ .setSOAPVersion("http://schemas.xmlsoap.org/soap/envelope/")
+ .setWSRMVersion("http://docs.oasis-open.org/ws-rx/wsrm/200702")
+ .setADDRVersion("http://www.w3.org/2005/08/addressing")
+ .setEndpointAddress("http://somehost:666/endpoint")
+
.setAcksToAddress("http://www.w3.org/2005/08/addressing/anonymous")
+ .toSequenceMetaData();
+
+ RMSequence sequence = RMSequenceFactory.getInstance().newSequence(sequenceMD);
+ RMMessage inboundMessage =
RMMessageFactory.getInstance().newMessage("messageId",
"data".getBytes());
+ RMMessage outboundMessage =
RMMessageFactory.getInstance().newMessage("messageId",
"data".getBytes());
+ sequence.addInboundMessage(inboundMessage);
+ sequence.addOutboundMessage(outboundMessage);
+ Iterator<Long> inboundIds = sequence.getInboundMessageNumbers();
+ Iterator<Long> outboundIds = sequence.getOutboundMessageNumbers();
+ inboundMessage = sequence.getInboundMessage(1);
+ outboundMessage = sequence.getOutboundMessage(2);
+ inboundMessage = sequence.getInboundMessage("messageId");
+ outboundMessage = sequence.getOutboundMessage("messageId");
+ RMStore store = RMStore.getInstance();
+ sequence = store.read("sequenceOutboundId", true);
+ sequence = store.read("sequenceInboundId", false);
+ sequence.addInboundMessage(inboundMessage);
+ store.write(sequence);
+ }
+
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/persistence/PersistenceTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF