Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.CreateSequence


      faultMsgContext.setAxisOperation(operation);
      faultMsgContext.setOperationContext(operationContext);

      String acksToStr = null;
      if (referenceRMMsgContext.getMessageType() == Sandesha2Constants.MessageTypes.CREATE_SEQ) {
        CreateSequence createSequence = (CreateSequence) referenceRMMsgContext
            .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
        acksToStr = createSequence.getAcksTo().getAddress().getEpr()
            .getAddress();
      } else {
        SequencePropertyBeanMgr seqPropMgr = storageManager
            .getSequencePropretyBeanMgr();
        String sequenceId = data.getSequenceId();
View Full Code Here


    EndpointReference replyTo = createSequenceMsg.getReplyTo();
    if (replyTo == null)
      throw new AxisFault("ReplyTo is null");

    CreateSequence createSequence = (CreateSequence) createSequenceMsg
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequence == null)
      throw new AxisFault("Create Sequence Part is null");

    EndpointReference acksTo = createSequence.getAcksTo().getAddress()
        .getEpr();

    if (acksTo == null)
      throw new AxisFault("AcksTo is null");
View Full Code Here

    MessageContext applicationMsg = applicationRMMsg.getMessageContext();
    if (applicationMsg == null)
      throw new SandeshaException("Message context is null");
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(
        applicationRMMsg, internalSequenceId, acksTo);
    CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequencePart == null)
      throw new SandeshaException(
          "Create Sequence part is null for a CreateSequence message");

    SequenceOffer offer = createSequencePart.getSequenceOffer();
    if (offer != null) {
      //Offer processing
      String offeredSequenceId = offer.getIdentifer().getIdentifier();
      SequencePropertyBean msgsBean = new SequencePropertyBean();
      msgsBean.setSequenceId(offeredSequenceId);
View Full Code Here

    // generating a new create sequeuce message.
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(referenceRMMsg, sequencePropertyKey, acksTo,
        storageManager);

    createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
    CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);

    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();

    SequenceOffer offer = createSequencePart.getSequenceOffer();
    if (offer != null) {
      String offeredSequenceId = offer.getIdentifer().getIdentifier();

      SequencePropertyBean offeredSequenceBean = new SequencePropertyBean();
      offeredSequenceBean.setName(Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);
      offeredSequenceBean.setSequencePropertyKey(sequencePropertyKey);
      offeredSequenceBean.setValue(offeredSequenceId);

      seqPropMgr.insert(offeredSequenceBean);
    }

    MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
    createSeqMsg.setRelationships(null); // create seq msg does not
                        // relateTo anything

    String createSequenceMessageStoreKey = SandeshaUtil.getUUID(); // the key taht will be used to store
                                     //the create sequence message.
   
    RMSBean rmsBean = new RMSBean();
    rmsBean.setInternalSequenceID(internalSequenceId);
    rmsBean.setCreateSeqMsgID(createSeqMsg.getMessageID());
    rmsBean.setCreateSequenceMsgStoreKey(createSequenceMessageStoreKey);
   
    //cloning the message and storing it as a reference.
    MessageContext clonedMessage = SandeshaUtil.cloneMessageContext(createSeqMsg);
    String clonedMsgStoreKey = SandeshaUtil.getUUID();
    storageManager.storeMessageContext(clonedMsgStoreKey, clonedMessage);
    rmsBean.setReferenceMessageStoreKey(clonedMsgStoreKey);
   
   
    //TODO set the replyTo of CreateSeq (and others) to Anymomous if Application Msgs hv it as Anonymous.
   
//    //checking weather the sequence is in polling mode.
//    boolean pollingMode = false;
//    EndpointReference replyTo = applicationRMMsg.getReplyTo();
//    if (replyTo!=null && SandeshaUtil.isWSRMAnonymousReplyTo(replyTo.getAddress()))
//      pollingMode = true;
//    else if (replyTo!=null && offer!=null &&
//        (AddressingConstants.Final.WSA_ANONYMOUS_URL.equals(replyTo.getAddress()) ||
//            AddressingConstants.Submission.WSA_ANONYMOUS_URL.equals(replyTo.getAddress())))
//      pollingMode = true;
//   
//    createSeqBean.setPollingMode(pollingMode);
   
//    //if PollingMode is true, starting the pollingmanager.
//    if (pollingMode)
//      SandeshaUtil.startPollingManager(configCtx);
   
    SecurityToken token = (SecurityToken) createSeqRMMessage.getProperty(Sandesha2Constants.SequenceProperties.SECURITY_TOKEN);
    if(token != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      rmsBean.setSecurityTokenData(secManager.getTokenRecoveryData(token));
     
      // If we are using token based security, and the 1.1 spec level, then we
      // should introduce a UsesSequenceSTR header into the message.
      if(createSequencePart.getNamespaceValue().equals(Sandesha2Constants.SPEC_2006_08.NS_URI)) {
        UsesSequenceSTR header = new UsesSequenceSTR(null, Sandesha2Constants.SPEC_2006_08.NS_URI);
        header.toSOAPEnvelope(createSeqMsg.getEnvelope());
      }
    }
   
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForCreateSequenceRefused");

    RMMsgContext createSequenceRMMsg = MsgInitializer.initializeMessage(createSequenceMessage);

    CreateSequence createSequence = (CreateSequence) createSequenceRMMsg
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequence == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noCreateSeqParts));

    ConfigurationContext context = createSequenceMessage.getConfigurationContext();
View Full Code Here

    Sequence sequence = new Sequence(rmNamespaceValue);
    MessageNumber msgNumber = new MessageNumber(rmNamespaceValue);
    msgNumber.setMessageNumber(1);
    sequence.setMessageNumber(msgNumber);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE, sequence);
    applicationRMMsg.addSOAPEnvelope();

    // --------------------------------------------
View Full Code Here

    // -------------------------------
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(Sandesha2Constants.SPEC_VERSIONS.v1_1);

    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue);
    // Set the sequenceId
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    AcknowledgementRange ackRange = new AcknowledgementRange(rmNamespaceValue);
    ackRange.setLowerValue(1);
View Full Code Here

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

    Sequence sequence = new Sequence(rmNamespaceValue);
    MessageNumber msgNumber = new MessageNumber(rmNamespaceValue);
    msgNumber.setMessageNumber(1);
    sequence.setMessageNumber(msgNumber);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE, sequence);
View Full Code Here

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

    Sequence sequence = new Sequence(rmNamespaceValue);
    MessageNumber msgNumber = new MessageNumber(rmNamespaceValue);
    msgNumber.setMessageNumber(1);
    sequence.setMessageNumber(msgNumber);
    Identifier id1 = new Identifier(rmNamespaceValue);
    id1.setIndentifer(uuid);
    sequence.setIdentifier(id1);
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQUENCE, sequence);
    applicationRMMsg.addSOAPEnvelope();

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

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

    SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue);
    // Set the sequenceId
    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    AcknowledgementRange ackRange = new AcknowledgementRange(rmNamespaceValue);
    ackRange.setLowerValue(1);
    ackRange.setUpperValue(3);
    sequenceAck.addAcknowledgementRanges(ackRange);

    // Set the SequenceAcknowledgement part in the message
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
    applicationRMMsg.addSOAPEnvelope();
View Full Code Here

TOP

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

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.