Package org.apache.sandesha2

Examples of org.apache.sandesha2.FaultData


      // Return an UnknownSequence error
      MessageContext messageContext = rmMessageContext.getMessageContext();

      int SOAPVersion = SandeshaUtil.getSOAPVersion(messageContext.getEnvelope());

      FaultData data = new FaultData();
      if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
        data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      else
        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.UNKNOWN_SEQUENCE ));

      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);

      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.unknownSequenceFault, sequenceID));
     
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.UNKNOWN_SEQUENCE);

      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::checkForUnknownSequence, Sequence unknown");
     
      boolean faultThrowable = !piggybackedMessage;
View Full Code Here


   * @throws AxisFault
   */
  public static void makeInvalidAcknowledgementFault(RMMsgContext rmMsgCtx,
      SequenceAcknowledgement sequenceAcknowledgement, AcknowledgementRange acknowledgementRange,
      StorageManager storageManager, boolean piggybackedMessage) throws AxisFault {
    FaultData data = new FaultData();
    int SOAPVersion = SandeshaUtil.getSOAPVersion(rmMsgCtx.getMessageContext().getEnvelope());
    if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
    else
      data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

    data.setType(Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT);
    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMsgCtx.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT ));
    data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidAckFault));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

    OMElement seqAckElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK,
        rmMsgCtx.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
 
    // Set the sequence Id
    sequenceAcknowledgement.getIdentifier().toOMElement(seqAckElement);

    // Set the Ack Range
    acknowledgementRange.toOMElement(seqAckElement);
   
    data.setDetail(seqAckElement);
             
    if (log.isDebugEnabled())
      log.debug("Exit: FaultManager::checkForInvalidAcknowledgement, invalid ACK");
   
    boolean throwable = !piggybackedMessage;
View Full Code Here

    // Return a CreateSequenceRefused error
    MessageContext messageContext = rmMessageContext.getMessageContext();

    int SOAPVersion = SandeshaUtil.getSOAPVersion(messageContext.getEnvelope());

    FaultData data = new FaultData();
    if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
    else
      data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.CREATE_SEQUENCE_REFUSED ));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
    OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
        rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
    identifierElement.setText(detail);
    data.setDetail(identifierElement);
    data.setDetailString(detail);

    data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSequenceRefused));
   
    data.setType(Sandesha2Constants.SOAPFaults.FaultType.CREATE_SEQUENCE_REFUSED);
   
    data.setExceptionString(SandeshaUtil.getStackTraceFromException(e));

    if (log.isDebugEnabled())
      log.debug("Exit: FaultManager::makeCreateSequenceRefusedFault");
    getOrSendFault(rmMessageContext, data, true);
  }
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForSequenceClosed, " + sequenceID);

    if (bean.isTerminated()) {
      MessageContext referenceMessage = referenceRMMessage.getMessageContext();
      FaultData data = new FaultData();
      int SOAPVersion = SandeshaUtil.getSOAPVersion(referenceMessage.getEnvelope());
      if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
        data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      else
        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(referenceRMMessage.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED ));
      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.sequenceTerminatedFault, sequenceID));
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED);
     
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);

      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::checkForSequenceClosed, sequence closed");
     
      boolean throwable = !piggybackedMessage;
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForSequenceClosed, " + sequenceID);

    if (rmdBean.isClosed()) {
      MessageContext referenceMessage = referenceRMMessage.getMessageContext();
      FaultData data = new FaultData();
      int SOAPVersion = SandeshaUtil.getSOAPVersion(referenceMessage.getEnvelope());
      if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
        data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      else
        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(referenceRMMessage.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_CLOSED ));
      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotAcceptMsgAsSequenceClosedFault));
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_CLOSED);
     
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);

      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::checkForSequenceClosed, sequence closed");
     
      boolean throwable = !piggybackedMessage;
View Full Code Here

      // Return a CreateSequenceRefused error
      MessageContext messageContext = rmMessageContext.getMessageContext();

      int SOAPVersion = SandeshaUtil.getSOAPVersion(messageContext.getEnvelope());

      FaultData data = new FaultData();
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.MESSAGE_NUMBER_ROLLOVER ));

      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceId);
     
      OMElement maxMsgNumber = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.MAX_MSG_NUMBER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      maxMsgNumber.setText(Long.toString(msgNo));
     
      data.setDetail(identifierElement);
      data.setDetail2(maxMsgNumber);

      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.messageNumberRollover));
     
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.MESSAGE_NUMBER_ROLLOVER);

      getOrSendFault(rmMessageContext, data, true);
     
      return true;
    }
View Full Code Here

      // Return an UnknownSequence error
      MessageContext messageContext = rmMessageContext.getMessageContext();

      int SOAPVersion = SandeshaUtil.getSOAPVersion(messageContext.getEnvelope());

      FaultData data = new FaultData();
      if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
        data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      else
        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.UNKNOWN_SEQUENCE ));

      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);

      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.unknownSequenceFault, sequenceID));
     
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.UNKNOWN_SEQUENCE);

      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::checkForUnknownSequence, Sequence unknown");
     
      boolean faultThrowable = !piggybackedMessage;
View Full Code Here

   * @throws AxisFault
   */
  public static void makeInvalidAcknowledgementFault(RMMsgContext rmMsgCtx,
      SequenceAcknowledgement sequenceAcknowledgement, AcknowledgementRange acknowledgementRange,
      StorageManager storageManager, boolean piggybackedMessage) throws AxisFault {
    FaultData data = new FaultData();
    int SOAPVersion = SandeshaUtil.getSOAPVersion(rmMsgCtx.getMessageContext().getEnvelope());
    if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
    else
      data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

    data.setType(Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT);
    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMsgCtx.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT ));
    data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidAckFault));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

    OMElement seqAckElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK,
        rmMsgCtx.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
 
    // Set the sequence Id
    sequenceAcknowledgement.getIdentifier().toOMElement(seqAckElement);

    // Set the Ack Range
    acknowledgementRange.toOMElement(seqAckElement);
   
    data.setDetail(seqAckElement);
             
    if (log.isDebugEnabled())
      log.debug("Exit: FaultManager::checkForInvalidAcknowledgement, invalid ACK");
   
    boolean throwable = !piggybackedMessage;
View Full Code Here

    // Return a CreateSequenceRefused error
    MessageContext messageContext = rmMessageContext.getMessageContext();

    int SOAPVersion = SandeshaUtil.getSOAPVersion(messageContext.getEnvelope());

    FaultData data = new FaultData();
    if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
    else
      data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.CREATE_SEQUENCE_REFUSED ));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
    OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
        rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
    identifierElement.setText(detail);
    data.setDetail(identifierElement);
    data.setDetailString(detail);

    data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSequenceRefused));
   
    data.setType(Sandesha2Constants.SOAPFaults.FaultType.CREATE_SEQUENCE_REFUSED);
   
    data.setExceptionString(SandeshaUtil.getStackTraceFromException(e));

    if (log.isDebugEnabled())
      log.debug("Exit: FaultManager::makeCreateSequenceRefusedFault");
    getOrSendFault(rmMessageContext, data, true);
  }
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForSequenceTerminated, " + sequenceID);

    if (bean.isTerminated()) {
      MessageContext referenceMessage = referenceRMMessage.getMessageContext();
      FaultData data = new FaultData();
      int SOAPVersion = SandeshaUtil.getSOAPVersion(referenceMessage.getEnvelope());
      if (SOAPVersion == Sandesha2Constants.SOAPVersion.v1_1)
        data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      else
        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(referenceRMMessage.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED ));
      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.sequenceTerminatedFault, sequenceID));
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED);
     
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);

      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::checkForSequenceTerminated, sequence terminated");
     
      boolean throwable = !piggybackedMessage;
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.FaultData

Copyright © 2018 www.massapicom. 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.