Author: richard.opalka(a)jboss.com
Date: 2007-09-04 07:39:20 -0400 (Tue, 04 Sep 2007)
New Revision: 4518
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java
Log:
implementing 2005/02 WS-RM protocol version except de/serialization
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,149 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested
+ */
+final class AckRequestedImpl implements AckRequested
+{
+
+ private String identifier;
+ private long lastMessageNumber;
+
+ AckRequestedImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#getMessage()
+ */
+ public long getMessageNumber()
+ {
+ return this.lastMessageNumber;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested#setMessage(long)
+ */
+ public void setMessageNumber(long lastMessageNumber)
+ {
+ if (lastMessageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.lastMessageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.lastMessageNumber = lastMessageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (int)(lastMessageNumber ^ (lastMessageNumber >>>
32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AckRequestedImpl))
+ return false;
+ final AckRequestedImpl other = (AckRequestedImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (lastMessageNumber != other.lastMessageNumber)
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.identifier == null)
+ throw new IllegalStateException();
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/AckRequestedImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,357 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence
+ */
+final class CreateSequenceImpl implements CreateSequence
+{
+
+ private String acksTo;
+ private String expires;
+ private Offer offer;
+
+ CreateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#getOffer()
+ */
+ public Offer getOffer()
+ {
+ return this.offer;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#newOffer()
+ */
+ public Offer newOffer()
+ {
+ return new OfferImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence#setOffer(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer)
+ */
+ public void setOffer(Offer offer)
+ {
+ if (offer == null)
+ throw new IllegalArgumentException("Offer cannot be null");
+ if (!(offer instanceof OfferImpl))
+ throw new IllegalArgumentException();
+ if (offer.getIdentifier() == null)
+ throw new IllegalArgumentException("Offer identifier must be
specified");
+ if (offer.getEndpoint() == null)
+ throw new IllegalArgumentException("Offer endpoint address must be
specified");
+ if (this.offer != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.offer = offer;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((offer == null) ? 0 : offer.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof CreateSequenceImpl))
+ return false;
+ final CreateSequenceImpl other = (CreateSequenceImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (offer == null)
+ {
+ if (other.offer != null)
+ return false;
+ }
+ else if (!offer.equals(other.offer))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.acksTo == null)
+ throw new IllegalStateException();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer
+ */
+ private static final class OfferImpl implements CreateSequence.Offer
+ {
+
+ private String duration;
+ private String identifier;
+
+ private OfferImpl()
+ {
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getEndpoint()
+ */
+ public String getEndpoint()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getExpires()
+ */
+ public String getExpires()
+ {
+ return this.duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#getIncompleteSequenceBehavior()
+ */
+ public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setEndpoint(java.lang.String)
+ */
+ public void setEndpoint(String address)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.duration != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.duration = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence.Offer#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((duration == null) ? 0 : duration.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof OfferImpl))
+ return false;
+ final OfferImpl other = (OfferImpl)obj;
+ if (duration == null)
+ {
+ if (other.duration != null)
+ return false;
+ }
+ else if (!duration.equals(other.duration))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.identifier == null)
+ throw new IllegalStateException();
+ }
+
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,305 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior;
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse
+ */
+final class CreateSequenceResponseImpl implements CreateSequenceResponse
+{
+
+ private String identifier;
+ private String expires;
+ private Accept accept;
+
+ CreateSequenceResponseImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getAccept()
+ */
+ public Accept getAccept()
+ {
+ return this.accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getDuration()
+ */
+ public String getExpires()
+ {
+ return this.expires;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#getIncompleteSequenceBehavior()
+ */
+ public IncompleteSequenceBehavior getIncompleteSequenceBehavior()
+ {
+ return null; // always return null for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#newAccept()
+ */
+ public Accept newAccept()
+ {
+ return new AcceptImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setAccept(org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept)
+ */
+ public void setAccept(Accept accept)
+ {
+ if (accept == null)
+ throw new IllegalArgumentException("Accept cannot be null");
+ if (!(accept instanceof AcceptImpl))
+ throw new IllegalArgumentException();
+ if (accept.getAcksTo() == null)
+ throw new IllegalArgumentException("Accept acksTo must be
specified");
+ if (this.accept != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.accept = accept;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setExpires(java.lang.String)
+ */
+ public void setExpires(String duration)
+ {
+ if ((duration == null) || (duration.trim().equals("")))
+ throw new IllegalArgumentException("Duration cannot be null nor empty
string");
+ if (this.expires != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.expires = duration;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse#setIncompleteSequenceBehavior(org.jboss.ws.extensions.wsrm.spi.protocol.IncompleteSequenceBehavior)
+ */
+ public void setIncompleteSequenceBehavior(IncompleteSequenceBehavior
incompleteSequenceBehavior)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((accept == null) ? 0 : accept.hashCode());
+ result = prime * result + ((expires == null) ? 0 : expires.hashCode());
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof CreateSequenceResponseImpl))
+ return false;
+ final CreateSequenceResponseImpl other = (CreateSequenceResponseImpl)obj;
+ if (accept == null)
+ {
+ if (other.accept != null)
+ return false;
+ }
+ else if (!accept.equals(other.accept))
+ return false;
+ if (expires == null)
+ {
+ if (other.expires != null)
+ return false;
+ }
+ else if (!expires.equals(other.expires))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.identifier == null)
+ throw new IllegalStateException();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept
+ */
+ private static final class AcceptImpl implements CreateSequenceResponse.Accept
+ {
+
+ private String acksTo;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#getAcksTo()
+ */
+ public String getAcksTo()
+ {
+ return this.acksTo;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse.Accept#setAcksTo(java.lang.String)
+ */
+ public void setAcksTo(String address)
+ {
+ if ((address == null) || (address.trim().equals("")))
+ throw new IllegalArgumentException("Address cannot be null nor empty
string");
+ if (this.acksTo != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.acksTo = address;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((acksTo == null) ? 0 : acksTo.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcceptImpl))
+ return false;
+ final AcceptImpl other = (AcceptImpl)obj;
+ if (acksTo == null)
+ {
+ if (other.acksTo != null)
+ return false;
+ }
+ else if (!acksTo.equals(other.acksTo))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.acksTo == null)
+ throw new IllegalStateException();
+ }
+
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/CreateSequenceResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,135 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.protocol.AckRequested;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CloseSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
+import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
+import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequenceResponse;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory
+ */
+final class MessageFactoryImpl implements MessageFactory
+{
+
+ private static final MessageFactory INSTANCE = new MessageFactoryImpl();
+
+ private MessageFactoryImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static MessageFactory getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newAckRequested()
+ */
+ public AckRequested newAckRequested()
+ {
+ return new AckRequestedImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequence()
+ */
+ public CloseSequence newCloseSequence()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCloseSequenceResponse()
+ */
+ public CloseSequenceResponse newCloseSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequence()
+ */
+ public CreateSequence newCreateSequence()
+ {
+ return new CreateSequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newCreateSequenceResponse()
+ */
+ public CreateSequenceResponse newCreateSequenceResponse()
+ {
+ return new CreateSequenceResponseImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequence()
+ */
+ public Sequence newSequence()
+ {
+ return new SequenceImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceAcknowledgement()
+ */
+ public SequenceAcknowledgement newSequenceAcknowledgement()
+ {
+ return new SequenceAcknowledgementImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newSequenceFault()
+ */
+ public SequenceFault newSequenceFault()
+ {
+ return new SequenceFaultImpl();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequence()
+ */
+ public TerminateSequence newTerminateSequence()
+ {
+ return new TerminateSequenceImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.MessageFactory#newTerminateSequenceResponse()
+ */
+ public TerminateSequenceResponse newTerminateSequenceResponse()
+ {
+ return null; // not supported by this version of the RM protocol
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/MessageFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,65 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.ws.extensions.wsrm.spi.MessageFactory;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider
+ */
+public final class ProviderImpl extends Provider
+{
+
+ static final String IMPLEMENTATION_VERSION =
"http://schemas.xmlsoap.org/ws/2005/02/rm";
+ private static final Provider INSTANCE = new ProviderImpl();
+
+ private ProviderImpl()
+ {
+ // forbidden inheritance
+ }
+
+ public static Provider getInstance()
+ {
+ return INSTANCE;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getMessageFactory()
+ */
+ @Override
+ public MessageFactory getMessageFactory()
+ {
+ return MessageFactoryImpl.getInstance();
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.Provider#getNamespaceURI()
+ */
+ @Override
+ public String getNamespaceURI()
+ {
+ return IMPLEMENTATION_VERSION;
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/ProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,363 @@
+/*
+ * 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.spec200502;
+
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Collections;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement;
+
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement
+ */
+final class SequenceAcknowledgementImpl implements SequenceAcknowledgement
+{
+
+ private final List<Long> nacks = new LinkedList<Long>();
+ private final List<AcknowledgementRange> acknowledgementRanges = new
LinkedList<AcknowledgementRange>();
+ private String identifier;
+
+ SequenceAcknowledgementImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addAcknowledgementRange(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange)
+ */
+ public void addAcknowledgementRange(AcknowledgementRange newAcknowledgementRange)
+ {
+ if ((newAcknowledgementRange == null) || (!(newAcknowledgementRange instanceof
AcknowledgementRangeImpl)))
+ throw new IllegalArgumentException();
+ if (this.nacks.size() != 0)
+ throw new IllegalStateException("There are already some nacks
specified");
+ if ((newAcknowledgementRange.getLower() == 0) ||
(newAcknowledgementRange.getUpper() == 0))
+ throw new IllegalArgumentException("Both, lower and upper values must be
specified");
+ for (AcknowledgementRange alreadyAccepted : acknowledgementRanges)
+ checkOverlap(alreadyAccepted, newAcknowledgementRange);
+
+ this.acknowledgementRanges.add(newAcknowledgementRange);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#addNack(long)
+ */
+ public void addNack(long messageNumber)
+ {
+ if (this.acknowledgementRanges.size() != 0)
+ throw new IllegalStateException("There are already some acknowledgement
ranges specified");
+ if (this.nacks.contains(messageNumber))
+ throw new IllegalArgumentException("There is already nack with value "
+ messageNumber + " specified");
+
+ this.nacks.add(messageNumber);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getAcknowledgementRanges()
+ */
+ public List<AcknowledgementRange> getAcknowledgementRanges()
+ {
+ return Collections.unmodifiableList(acknowledgementRanges);
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#getNacks()
+ */
+ public List<Long> getNacks()
+ {
+ return Collections.unmodifiableList(nacks);
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#isNone()
+ */
+ public boolean isNone()
+ {
+ return false; // always return false for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#newAcknowledgementRange()
+ */
+ public AcknowledgementRange newAcknowledgementRange()
+ {
+ return new AcknowledgementRangeImpl();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setFinal(boolean)
+ */
+ public void setFinal()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement#setNone(boolean)
+ */
+ public void setNone()
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + ((nacks == null) ? 0 : nacks.hashCode());
+ result = prime * result + ((acknowledgementRanges == null) ? 0 :
acknowledgementRanges.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof SequenceAcknowledgementImpl))
+ return false;
+ final SequenceAcknowledgementImpl other = (SequenceAcknowledgementImpl)obj;
+ if (acknowledgementRanges == null)
+ {
+ if (other.acknowledgementRanges != null)
+ return false;
+ }
+ else if (!acknowledgementRanges.equals(other.acknowledgementRanges))
+ return false;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (nacks == null)
+ {
+ if (other.nacks != null)
+ return false;
+ }
+ else if (!nacks.equals(other.nacks))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0))
+ throw new IllegalStateException();
+ }
+
+ private static void checkOverlap(AcknowledgementRange currentRange,
AcknowledgementRange newRange)
+ {
+ if ((currentRange.getLower() <= newRange.getLower()) &&
(newRange.getLower() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ if ((currentRange.getLower() <= newRange.getUpper()) &&
(newRange.getUpper() <= currentRange.getUpper()))
+ throw new IllegalArgumentException(
+ "Overlap detected: " + currentRange + " vs. " +
newRange);
+ }
+
+ private static final class AcknowledgementRangeImpl implements
SequenceAcknowledgement.AcknowledgementRange
+ {
+
+ private long lower;
+ private long upper;
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getLower()
+ */
+ public long getLower()
+ {
+ return this.lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#getUpper()
+ */
+ public long getUpper()
+ {
+ return this.upper;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setLower(long)
+ */
+ public void setLower(long lower)
+ {
+ if (lower <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.lower > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.upper > 0) && (lower > this.upper))
+ throw new IllegalArgumentException("Value must be lower or equal to
" + this.upper);
+
+ this.lower = lower;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceAcknowledgement.AcknowledgementRange#setUpper(long)
+ */
+ public void setUpper(long upper)
+ {
+ if (upper <= 0)
+ throw new IllegalArgumentException("Value must be greater than
0");
+ if (this.upper > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+ if ((this.lower > 0) && (this.lower > upper))
+ throw new IllegalArgumentException("Value must be greater or equal to
" + this.lower);
+
+ this.upper = upper;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int)(lower ^ (lower >>> 32));
+ result = prime * result + (int)(upper ^ (upper >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof AcknowledgementRangeImpl))
+ return false;
+ final AcknowledgementRangeImpl other = (AcknowledgementRangeImpl)obj;
+ if (lower != other.lower)
+ return false;
+ if (upper != other.upper)
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ public String toString()
+ {
+ return "<" + lower + "; " + upper + ">";
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.lower == 0)
+ throw new IllegalStateException();
+ if (this.upper == 0)
+ throw new IllegalStateException();
+ }
+
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceAcknowledgementImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,155 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault;
+import org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode;
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault
+ */
+final class SequenceFaultImpl implements SequenceFault
+{
+
+ private SequenceFaultCode faultCode;
+ private Exception detail;
+
+ SequenceFaultImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getDetail()
+ */
+ public Exception getDetail()
+ {
+ return this.detail;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#getFaultCode()
+ */
+ public SequenceFaultCode getFaultCode()
+ {
+ return this.faultCode;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setDetail(java.lang.Exception)
+ */
+ public void setDetail(Exception detail)
+ {
+ if (detail == null)
+ throw new IllegalArgumentException("Detail cannot be null");
+ if (this.detail != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.detail = detail;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFault#setFaultCode(org.jboss.ws.extensions.wsrm.spi.protocol.SequenceFaultCode)
+ */
+ public void setFaultCode(SequenceFaultCode faultCode)
+ {
+ if (faultCode == null)
+ throw new IllegalArgumentException("Fault code cannot be null");
+ if (this.faultCode != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.faultCode = faultCode;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((detail == null) ? 0 : detail.getMessage().hashCode());
+ result = prime * result + ((faultCode == null) ? 0 : faultCode.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof SequenceFaultImpl))
+ return false;
+ final SequenceFaultImpl other = (SequenceFaultImpl)obj;
+ if (detail == null)
+ {
+ if (other.detail != null)
+ return false;
+ }
+ else if (!detail.getMessage().equals(other.detail.getMessage()))
+ return false;
+ if (faultCode == null)
+ {
+ if (other.faultCode != null)
+ return false;
+ }
+ else if (!faultCode.equals(other.faultCode))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.faultCode == null)
+ throw new IllegalStateException();
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceFaultImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,171 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
+import javax.xml.soap.SOAPMessage;
+import org.jboss.util.NotImplementedException;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence
+ */
+final class SequenceImpl implements Sequence
+{
+
+ private String identifier;
+ private long messageNumber;
+ private boolean isLastMessage;
+
+ SequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#getMessageNumber()
+ */
+ public long getMessageNumber()
+ {
+ return messageNumber;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#isLastMessage()
+ */
+ public boolean isLastMessage()
+ {
+ return this.isLastMessage;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
+ */
+ public void setLastMessage()
+ {
+ this.isLastMessage = true;
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setMessageNumber(long)
+ */
+ public void setMessageNumber(long messageNumber)
+ {
+ if (messageNumber <= 0)
+ throw new IllegalArgumentException("Value must be greater than 0");
+ if (this.messageNumber > 0)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.messageNumber = messageNumber;
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ result = prime * result + (isLastMessage ? 1231 : 1237);
+ result = prime * result + (int)(messageNumber ^ (messageNumber >>> 32));
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof SequenceImpl))
+ return false;
+ final SequenceImpl other = (SequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ if (isLastMessage != other.isLastMessage)
+ return false;
+ if (messageNumber != other.messageNumber)
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.identifier == null)
+ throw new IllegalStateException();
+ if (this.messageNumber == 0)
+ throw new IllegalStateException();
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/SequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -0,0 +1,140 @@
+/*
+ * 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.spec200502;
+
+import org.jboss.util.NotImplementedException;
+import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
+import javax.xml.soap.SOAPMessage;
+
+/*
+ * @author richard.opalka(a)jboss.com
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence
+ */
+final class TerminateSequenceImpl implements TerminateSequence
+{
+
+ private String identifier;
+
+ TerminateSequenceImpl()
+ {
+ // allow inside package use only
+ }
+
+ /*
+ * @see org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getIdentifier()
+ */
+ public String getIdentifier()
+ {
+ return this.identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#getLastMsgNumber()
+ */
+ public long getLastMsgNumber()
+ {
+ return 0; // always return zero for this version of the RM protocol
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setIdentifier(java.lang.String)
+ */
+ public void setIdentifier(String identifier)
+ {
+ if ((identifier == null) || (identifier.trim().equals("")))
+ throw new IllegalArgumentException("Identifier cannot be null nor empty
string");
+ if (this.identifier != null)
+ throw new UnsupportedOperationException("Value already set, cannot be
overriden");
+
+ this.identifier = identifier;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence#setLastMsgNumber(long)
+ */
+ public void setLastMsgNumber(long lastMsgNumber)
+ {
+ // do nothing for this version of the RM protocol
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((identifier == null) ? 0 : identifier.hashCode());
+ return result;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof TerminateSequenceImpl))
+ return false;
+ final TerminateSequenceImpl other = (TerminateSequenceImpl)obj;
+ if (identifier == null)
+ {
+ if (other.identifier != null)
+ return false;
+ }
+ else if (!identifier.equals(other.identifier))
+ return false;
+ return true;
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#deserializeFrom(javax.xml.soap.SOAPMessage)
+ */
+ public void deserializeFrom(SOAPMessage soapMessage)
+ {
+ // TODO: implement deserialization using object set methods
+ if (true) throw new NotImplementedException();
+ ensureLegalState();
+ }
+
+ /*
+ * @see
org.jboss.ws.extensions.wsrm.spi.protocol.Serializable#serializeTo(javax.xml.soap.SOAPMessage)
+ */
+ public void serializeTo(SOAPMessage soapMessage)
+ {
+ ensureLegalState();
+ // TODO implement serialization using object instance fields
+ throw new NotImplementedException();
+ }
+
+ private void ensureLegalState()
+ {
+ if (this.identifier == null)
+ throw new IllegalStateException();
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200502/TerminateSequenceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-09-04
10:13:22 UTC (rev 4517)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spec200702/SequenceImpl.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -80,7 +80,7 @@
/*
* @see org.jboss.ws.extensions.wsrm.spi.protocol.Sequence#setLastMessage(boolean)
*/
- public void setLastMessage(boolean lastMessage)
+ public void setLastMessage()
{
// do nothing for this version of the RM protocol
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java 2007-09-04
10:13:22 UTC (rev 4517)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/spi/protocol/Sequence.java 2007-09-04
11:39:20 UTC (rev 4518)
@@ -76,7 +76,7 @@
* This element MAY be included by the RM Source endpoint. The
<b>LastMessage</b> element has no content.
* @param lastMessage
*/
- void setLastMessage(boolean lastMessage);
+ void setLastMessage();
/**
* Getter