Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.Sequence


  public static String getSequenceIDFromRMMessage(RMMsgContext rmMessageContext) {
    int messageType = rmMessageContext.getMessageType();

    String sequenceID = null;
    if (messageType == Sandesha2Constants.MessageTypes.APPLICATION) {
      Sequence sequence = rmMessageContext.getSequence();
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (messageType == Sandesha2Constants.MessageTypes.ACK) {
      Iterator<SequenceAcknowledgement> sequenceAckIter = rmMessageContext
          .getSequenceAcknowledgements();
     
      //In case of ack messages sequenceId is decided based on the sequenceId of the first
View Full Code Here


  public static void processLastMessage(RMMsgContext rmMsgCtx) throws AxisFault {
   
    if (!Sandesha2Constants.SPEC_VERSIONS.v1_0.equals(rmMsgCtx.getRMSpecVersion()))
      return;
   
    Sequence sequence = rmMsgCtx.getSequence();
    String sequenceId = sequence.getIdentifier().getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(
              configurationContext, configurationContext.getAxisConfiguration());
   
View Full Code Here

    RMMsgContext applicationRMMsg = new RMMsgContext(messageContext);
   
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(Sandesha2Constants.SPEC_VERSIONS.v1_1);
   
    //now add a sequence part to simulate a piggy backed application msg
    Sequence sequence = new Sequence(rmNamespaceValue);
    Identifier sequenceID = new Identifier(rmNamespaceValue);
    sequenceID.setIndentifer(sequenceIDApplicationMessage); //some new uuid ID
    sequence.setIdentifier(sequenceID);
    sequence.setMessageNumber(1);
    applicationRMMsg.setSequence(sequence);
   
    //setup the sequenceAck portion of the msg
    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue, true);
    // Set the sequenceId
View Full Code Here

   
    // Generate the Sequence field.
    // -------------------------------
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(Sandesha2Constants.SPEC_VERSIONS.v1_1);

    Sequence sequence = new Sequence(rmNamespaceValue);
    sequence.setMessageNumber(1);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setSequence(sequence);
    applicationRMMsg.addSOAPEnvelope();

    // --------------------------------------------
    // Finished generating Sequence part
View Full Code Here

          }
        }

        if(!isProcessed){
          if(WSRM_COMMON.SEQUENCE.equals(localName)){
            sequence = new Sequence(namespace);
            sequence.fromHeaderBlock(element);
          }else if(WSRM_COMMON.SEQUENCE_ACK.equals(localName)){
            SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(namespace, false);
            sequenceAcknowledgement.fromHeaderBlock(element);
            sequenceAcknowledgements.add(sequenceAcknowledgement);
View Full Code Here

        boolean lastMessageHeader = false;
        try {
          SOAPHeader header = env.getHeader();
          if(header != null) {
            SOAPHeaderBlock shb = (SOAPHeaderBlock) header.getFirstChildWithName(Sandesha2Constants.SPEC_2005_02.QNames.Sequence);
            Sequence sequence = new Sequence(Sandesha2Constants.SPEC_2005_02.NS_URI);
            sequence.fromHeaderBlock(shb);
            lastMessageHeader = sequence.getLastMessage();
          }
        } catch(Exception e) {
          // Do nothing, we failed to find a Sequence header
          if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
            log.debug("Exception encountered accessing Sequence Header ", e);
View Full Code Here

 
  private static void processApplicationMessage(RMMsgContext rmMsgCtx) throws AxisFault {
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
      log.debug("Enter: SandeshaGlobalInHandler::processApplicationMessage");
    // Check if this is a duplicate message
    Sequence sequence = rmMsgCtx.getSequence();
    String sequenceId = sequence.getIdentifier().getIdentifier();
    long msgNo = sequence.getMessageNumber();

    StorageManager storageManager =
      SandeshaUtil.getSandeshaStorageManager(rmMsgCtx.getConfigurationContext(),
          rmMsgCtx.getConfigurationContext().getAxisConfiguration());
   
View Full Code Here

          }
        }

        if(!isProcessed){
          if(WSRM_COMMON.SEQUENCE.equals(localName)){
            sequence = new Sequence(namespace);
            sequence.fromHeaderBlock(element);
          }else if(WSRM_COMMON.SEQUENCE_ACK.equals(localName)){
            SequenceAcknowledgement sequenceAcknowledgement = new SequenceAcknowledgement(namespace, false);
            sequenceAcknowledgement.fromHeaderBlock(element);
            sequenceAcknowledgements.add(sequenceAcknowledgement);
View Full Code Here

      RMMsgContext ackRMMsgCtx = MsgInitializer
          .initializeMessage(ackMsgCtx);

      setUpMessage(ackMsgCtx);

      Sequence reqSequence = (Sequence) applicationRMMsgCtx
          .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      if (reqSequence == null)
        throw new SandeshaException(
            "Sequence part of application message is null");

      String sequenceId = reqSequence.getIdentifier().getIdentifier();

      addAckMessage(ackRMMsgCtx, sequenceId);
      return ackRMMsgCtx;
    } catch (AxisFault e) {
      throw new SandeshaException(e.getMessage());
View Full Code Here

    SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager
        .getSequencePropretyBeanMgr();

    SenderBean findBean = new SenderBean();

    Sequence sequence = (Sequence) applicationRMMsgContext
        .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
    if (sequence == null)
      throw new SandeshaException(
          "Application message does not contain a sequence part");

    String sequenceId = sequence.getIdentifier().getIdentifier();

    SequencePropertyBean internalSequenceBean = sequencePropertyBeanMgr
        .retrieve(sequenceId,
            Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
    if (internalSequenceBean == null)
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.wsrm.Sequence

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.