Examples of RMFault


Examples of org.jboss.ws.extensions.wsrm.RMFault

      Map<QName, RMSerializable> data = new HashMap<QName, RMSerializable>();
      String optionalMessageId = (addrProps.getMessageID() != null) ? addrProps.getMessageID().getURI().toString() : null;
      rmOutboundContext.put(RMConstant.WSA_MESSAGE_ID, optionalMessageId);
      rmOutboundContext.put(RMConstant.PROTOCOL_MESSAGES_MAPPING, data);
      SOAPMessage soapMessage = ((SOAPMessageContext)commonMsgContext).getMessage();
      RMFault sequenceFault = (RMFault)rmOutboundContext.get(RMConstant.FAULT_REFERENCE);

      // try to serialize SequenceFault to message
      serialize(rmConstants.getSequenceFaultQName(), outMsgs, data, soapMessage, sequenceFault);
     
      if ((outMsgs.size() != 0) && (data.size() == 0))
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

         // write required wsrm:SequenceFault element
         QName sequenceFaultQName = wsrmConstants.getSequenceFaultQName();
         SOAPElement sequenceFaultElement = soapEnvelope.getHeader().addChildElement(sequenceFaultQName);

         // write required wsrm:FaultCode element
         RMFault rmFault = (RMFault)o.getDetail();
         QName faultCodeQName = wsrmConstants.getFaultCodeQName();
         String subcode = wsrmConstants.getPrefix() + ":" + rmFault.getFaultCode().getSubcode().getValue();
         sequenceFaultElement.addChildElement(faultCodeQName).setValue(subcode);

         Map<String, Object> details = rmFault.getDetails()
         if (details.size() > 0)
         {
            for (Iterator<String> i = details.keySet().iterator(); i.hasNext(); )
            {
               // write optional wsrm:Detail elements
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

     
      Map<String, Object> rmReqProps = (Map<String, Object>)msgContext.get(RMConstant.REQUEST_CONTEXT);
      msgContext.remove(RMConstant.REQUEST_CONTEXT);
      if (rmReqProps == null)
      {
         throw new RMFault(RMFaultCode.WSRM_REQUIRED);
      }
     
      AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      if (addrProps == null)
      {
         throw new IllegalStateException("WS-Addressing properties not found in server request");
      }
     
      List<QName> protocolMessages = new LinkedList<QName>();
      Map<String, Object> rmResponseContext = new HashMap<String, Object>();
      rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, protocolMessages);
      msgContext.remove(RMConstant.RESPONSE_CONTEXT);
      RMServerSequence sequence = null;
      boolean isOneWayOperation = true;
     
      if (RMHelper.isCreateSequence(rmReqProps))
      {
         sequence = new RMServerSequence();
         RMStore.serialize(dataDir, sequence);
         protocolMessages.add(rmConstants.getCreateSequenceResponseQName());
         rmResponseContext.put(RMConstant.SEQUENCE_REFERENCE, sequence);
         isOneWayOperation = false;
      }
     
      if (RMHelper.isCloseSequence(rmReqProps))
      {
         Map<QName, RMSerializable> data = (Map<QName, RMSerializable>)rmReqProps.get(RMConstant.PROTOCOL_MESSAGES_MAPPING);
         RMCloseSequence payload = (RMCloseSequence)data.get(rmConstants.getCloseSequenceQName());
         String seqIdentifier = payload.getIdentifier();
         sequence = RMStore.deserialize(dataDir, seqIdentifier, true);
         if (sequence == null)
         {
            throw getUnknownSequenceFault(seqIdentifier);
         }

         sequence.close();
         RMStore.serialize(dataDir, sequence);
         protocolMessages.add(rmConstants.getCloseSequenceResponseQName());
         protocolMessages.add(rmConstants.getSequenceAcknowledgementQName());
         rmResponseContext.put(RMConstant.SEQUENCE_REFERENCE, sequence);
         isOneWayOperation = false;
      }
        
      if (RMHelper.isSequenceAcknowledgement(rmReqProps))
      {
         Map<QName, RMSerializable> data = (Map<QName, RMSerializable>)rmReqProps.get(RMConstant.PROTOCOL_MESSAGES_MAPPING);
         RMSequenceAcknowledgement payload = (RMSequenceAcknowledgement)data.get(rmConstants.getSequenceAcknowledgementQName());
         String seqIdentifier = payload.getIdentifier();
         sequence = RMStore.deserialize(dataDir, seqIdentifier, false);
         if (sequence == null)
         {
            throw getUnknownSequenceFault(seqIdentifier);
         }

         for (RMSequenceAcknowledgement.RMAcknowledgementRange range : payload.getAcknowledgementRanges())
         {
            for (long i = range.getLower(); i <= range.getUpper(); i++)
            {
               if (i > sequence.getLastMessageNumber())
               {
                  // invalid acknowledgement - generating fault
                  RMStore.serialize(dataDir, sequence);
                  Map<String, Object> detailsMap = new HashMap<String, Object>(2);
                  detailsMap.put(RMFaultConstant.ACKNOWLEDGEMENT, range);
                  throw new RMFault(RMFaultCode.INVALID_ACKNOWLEDGEMENT, new HashMap<String, Object>(2));
               }

               sequence.addReceivedOutboundMessage(i);
            }
         }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

  
   private static RMFault getUnknownSequenceFault(String sequenceId)
   {
      Map<String, Object> detailsMap = new HashMap<String, Object>(2);
      detailsMap.put(RMFaultConstant.IDENTIFIER, sequenceId);
      return new RMFault(RMFaultCode.UNKNOWN_SEQUENCE, detailsMap);
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

   {
      if (this.closed)
      {
         Map<String, Object> detailsMap = new HashMap<String, Object>(2);
         detailsMap.put(RMFaultConstant.IDENTIFIER, this.inboundId);
         throw new RMFault(RMFaultCode.SEQUENCE_CLOSED, detailsMap);
      }
      else
      {
         if (messageId == Long.MAX_VALUE)
         {
            // maximum number achieved - generating fault
            Map<String, Object> detailsMap = new HashMap<String, Object>(3);
            detailsMap.put(RMFaultConstant.IDENTIFIER, this.inboundId);
            detailsMap.put(RMFaultConstant.MAX_MESSAGE_NUMBER, this.messageNumber);
            this.terminate();
            throw new RMFault(RMFaultCode.MESSAGE_NUMBER_ROLLOVER, detailsMap);
         }
        
         this.receivedInboundMessages.add(messageId);
         logger.debug("Inbound Sequence: " + this.inboundId + ", received message no. " + messageId);
      }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

      {
         this.terminate();
         Map<String, Object> detailsMap = new HashMap<String, Object>(3);
         detailsMap.put(RMFaultConstant.IDENTIFIER, this.outboundId);
         detailsMap.put(RMFaultConstant.MAX_MESSAGE_NUMBER, this.messageNumber);
         throw new RMFault(RMFaultCode.MESSAGE_NUMBER_ROLLOVER, detailsMap);
      }

      return ++this.messageNumber;
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

     
      Map<String, Object> rmReqProps = (Map<String, Object>)msgContext.get(RMConstant.REQUEST_CONTEXT);
      msgContext.remove(RMConstant.REQUEST_CONTEXT);
      if (rmReqProps == null)
      {
         throw new RMFault(RMFaultCode.WSRM_REQUIRED);
      }
     
      AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      if (addrProps == null)
      {
         throw new IllegalStateException("WS-Addressing properties not found in server request");
      }
     
      List<QName> protocolMessages = new LinkedList<QName>();
      Map<String, Object> rmResponseContext = new HashMap<String, Object>();
      rmResponseContext.put(RMConstant.PROTOCOL_MESSAGES, protocolMessages);
      msgContext.remove(RMConstant.RESPONSE_CONTEXT);
      RMServerSequence sequence = null;
      boolean isOneWayOperation = true;
     
      if (RMHelper.isCreateSequence(rmReqProps))
      {
         sequence = new RMServerSequence();
         RMStore.serialize(dataDir, sequence);
         protocolMessages.add(rmConstants.getCreateSequenceResponseQName());
         rmResponseContext.put(RMConstant.SEQUENCE_REFERENCE, sequence);
         isOneWayOperation = false;
      }
     
      if (RMHelper.isCloseSequence(rmReqProps))
      {
         Map<QName, RMSerializable> data = (Map<QName, RMSerializable>)rmReqProps.get(RMConstant.PROTOCOL_MESSAGES_MAPPING);
         RMCloseSequence payload = (RMCloseSequence)data.get(rmConstants.getCloseSequenceQName());
         String seqIdentifier = payload.getIdentifier();
         sequence = RMStore.deserialize(dataDir, seqIdentifier, true);
         if (sequence == null)
         {
            throw getUnknownSequenceFault(seqIdentifier);
         }

         sequence.close();
         RMStore.serialize(dataDir, sequence);
         protocolMessages.add(rmConstants.getCloseSequenceResponseQName());
         protocolMessages.add(rmConstants.getSequenceAcknowledgementQName());
         rmResponseContext.put(RMConstant.SEQUENCE_REFERENCE, sequence);
         isOneWayOperation = false;
      }
        
      if (RMHelper.isSequenceAcknowledgement(rmReqProps))
      {
         Map<QName, RMSerializable> data = (Map<QName, RMSerializable>)rmReqProps.get(RMConstant.PROTOCOL_MESSAGES_MAPPING);
         RMSequenceAcknowledgement payload = (RMSequenceAcknowledgement)data.get(rmConstants.getSequenceAcknowledgementQName());
         String seqIdentifier = payload.getIdentifier();
         sequence = RMStore.deserialize(dataDir, seqIdentifier, false);
         if (sequence == null)
         {
            throw getUnknownSequenceFault(seqIdentifier);
         }

         for (RMSequenceAcknowledgement.RMAcknowledgementRange range : payload.getAcknowledgementRanges())
         {
            for (long i = range.getLower(); i <= range.getUpper(); i++)
            {
               if (i > sequence.getLastMessageNumber())
               {
                  // invalid acknowledgement - generating fault
                  RMStore.serialize(dataDir, sequence);
                  Map<String, Object> detailsMap = new HashMap<String, Object>(2);
                  detailsMap.put(RMFaultConstant.ACKNOWLEDGEMENT, range);
                  throw new RMFault(RMFaultCode.INVALID_ACKNOWLEDGEMENT, new HashMap<String, Object>(2));
               }

               sequence.addReceivedOutboundMessage(i);
            }
         }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

  
   private static RMFault getUnknownSequenceFault(String sequenceId)
   {
      Map<String, Object> detailsMap = new HashMap<String, Object>(2);
      detailsMap.put(RMFaultConstant.IDENTIFIER, sequenceId);
      return new RMFault(RMFaultCode.UNKNOWN_SEQUENCE, detailsMap);
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

         // write required wsrm:SequenceFault element
         QName sequenceFaultQName = wsrmConstants.getSequenceFaultQName();
         SOAPElement sequenceFaultElement = soapEnvelope.getHeader().addChildElement(sequenceFaultQName);

         // write required wsrm:FaultCode element
         RMFault rmFault = (RMFault)o.getDetail();
         QName faultCodeQName = wsrmConstants.getFaultCodeQName();
         String subcode = wsrmConstants.getPrefix() + ":" + rmFault.getFaultCode().getSubcode().getValue();
         sequenceFaultElement.addChildElement(faultCodeQName).setValue(subcode);

         Map<String, Object> details = rmFault.getDetails()
         if (details.size() > 0)
         {
            for (Iterator<String> i = details.keySet().iterator(); i.hasNext(); )
            {
               // write optional wsrm:Detail elements
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.RMFault

   {
      if (this.closed)
      {
         Map<String, Object> detailsMap = new HashMap<String, Object>(2);
         detailsMap.put(RMFaultConstant.IDENTIFIER, this.inboundId);
         throw new RMFault(RMFaultCode.SEQUENCE_CLOSED, detailsMap);
      }
      else
      {
         if (messageId == Long.MAX_VALUE)
         {
            // maximum number achieved - generating fault
            Map<String, Object> detailsMap = new HashMap<String, Object>(3);
            detailsMap.put(RMFaultConstant.IDENTIFIER, this.inboundId);
            detailsMap.put(RMFaultConstant.MAX_MESSAGE_NUMBER, this.messageNumber);
            this.terminate();
            throw new RMFault(RMFaultCode.MESSAGE_NUMBER_ROLLOVER, detailsMap);
         }
        
         this.receivedInboundMessages.add(messageId);
         logger.debug("Inbound Sequence: " + this.inboundId + ", received message no. " + messageId);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.