Package org.apache.sandesha2.wsrm

Examples of org.apache.sandesha2.wsrm.SequenceOffer


     
      if (offeredSequenceId == null || offeredSequenceId.length() == 0) {
        offeredSequenceId = SandeshaUtil.getUUID();
      }

      SequenceOffer offerPart = new SequenceOffer(rmNamespaceValue);
      Identifier identifier = new Identifier(rmNamespaceValue);
      identifier.setIndentifer(offeredSequenceId);
      offerPart.setIdentifier(identifier);
     
      if (Sandesha2Constants.SPEC_2007_02.NS_URI.equals(rmNamespaceValue)) {
        // We are going to send an offer, so decide which endpoint to include
        EndpointReference offeredEndpoint = (EndpointReference) applicationMsgContext.getProperty(SandeshaClientConstants.OFFERED_ENDPOINT);
        //If the offeredEndpoint hasn't been set then use the acksTo of the RMSBean
        if (offeredEndpoint==null) {
          offeredEndpoint = rmsBean.getAcksToEndpointReference();
        }
       
        Endpoint endpoint = new Endpoint (offeredEndpoint, rmNamespaceValue, addressingNamespace);
        offerPart.setEndpoint(endpoint);
      }
     
      createSequencePart.setSequenceOffer(offerPart);
    }
View Full Code Here


    CreateSequenceResponse response = new CreateSequenceResponse(namespace);
    Identifier identifier = new Identifier(namespace);
    identifier.setIndentifer(rmSequenceBean.getSequenceID());
    response.setIdentifier(identifier);

    SequenceOffer offer = cs.getSequenceOffer();
    if (offer != null) {
      if(log.isDebugEnabled()) log.debug("RMMsgCreator:: " + offer);
      String outSequenceId = offer.getIdentifer().getIdentifier();

      if (outSequenceId != null && !"".equals(outSequenceId)) {

        Accept accept = new Accept(namespace);
View Full Code Here

    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(rmsBean, applicationRMMsg);

    createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
    CreateSequence createSequencePart = createSeqRMMessage.getCreateSequence();

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

      rmsBean.setOfferedSequence(offeredSequenceId);
    }

    MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
View Full Code Here

      createSeqResponse.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
     
      CreateSequenceResponse createSeqResPart = createSeqResponse.getCreateSequenceResponse();
 
      // OFFER PROCESSING
      SequenceOffer offer = createSeqPart.getSequenceOffer();
      if (offer != null) {
        Accept accept = createSeqResPart.getAccept();
        if (accept == null) {
          if (log.isDebugEnabled())
            log.debug(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart));
          FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg, SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart),
                                new Exception(),
                                null);
          // Return false if an Exception hasn't been thrown.
          if (log.isDebugEnabled())
            log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);       
          return false;
        }
 
        // offered seq id
        String offeredSequenceID = offer.getIdentifer().getIdentifier();

        //Need to see if this is a duplicate offer.
        //If it is we can't accept the offer as we can't be sure it has come from the same client.
        RMSBean finderBean = new RMSBean ();
        finderBean.setSequenceID(offeredSequenceID);
        RMSBean rMSBean = storageManager.getRMSBeanMgr().findUnique(finderBean);
        boolean offerAccepted = false;
        String outgoingSideInternalSequenceId = SandeshaUtil
          .getOutgoingSideInternalSequenceID(rmdBean.getSequenceID());

        if(rMSBean != null){
          if (log.isDebugEnabled())
            log.debug("Duplicate offer so we can't accept as we can't be sure it's from the same client: " + offeredSequenceID);
          offerAccepted = false;
        } else {
          boolean isValidseqID = isValidseqID(offeredSequenceID, context, createSeqRMMsg, storageManager);
          offerAccepted = true;
       
          //Before processing this offer any further we need to perform some extra checks
          //on the offered EP if WS-RM Spec 1.1 is being used
          if(isValidseqID && Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(rmdBean.getRMVersion())){
            Endpoint endpoint = offer.getEndpoint();
            if (endpoint!=null) {
              //Check to see if the offer endpoint has a value of WSA Anonymous
              String addressingNamespace = (String) createSeqRMMsg.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
              String endpointAddress = endpoint.getEPR().getAddress();
              if(SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespace).equals(endpointAddress)){
View Full Code Here

        .getOperationContext();
    if (operationcontext != null) {
      String offeredSequence = (String) applicationMsgContext
          .getProperty(Sandesha2ClientAPI.OFFERED_SEQUENCE_ID);
      if (offeredSequence != null && !"".equals(offeredSequence)) {
        SequenceOffer offerPart = new SequenceOffer(factory);
        Identifier identifier = new Identifier(factory);
        identifier.setIndentifer(offeredSequence);
        offerPart.setIdentifier(identifier);
        createSequencePart.setSequenceOffer(offerPart);
      }
    }

    SequencePropertyBean replyToBean = seqPropMgr.retrieve(internalSequenceId,
View Full Code Here

    Identifier identifier = new Identifier(factory);
    identifier.setIndentifer(newSequenceID);

    response.setIdentifier(identifier);

    SequenceOffer offer = cs.getSequenceOffer();
    if (offer != null) {
      String outSequenceId = offer.getIdentifer().getIdentifier();

      if (outSequenceId != null && !"".equals(outSequenceId)) {

        Accept accept = new Accept(factory);
        EndpointReference acksToEPR = createSeqMessage.getTo();
View Full Code Here

          .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);

      //If an offer is accepted do necessary procesing.
      Accept accept = createSeqResPart.getAccept();
      if (accept != null) {
        SequenceOffer offer = createSeqPart.getSequenceOffer();
        if (offer == null)
          throw new SandeshaException(
              "Internal error - no offer for the response message with Accept");

        //Setting the CreateSequence table entry.
        String incomingSeqId = createSeqResPart.getIdentifier()
            .getIdentifier();
        String outSequenceId = offer.getIdentifer().getIdentifier();
        CreateSeqBean createSeqBean = new CreateSeqBean();
        createSeqBean.setSequenceId(outSequenceId);
        createSeqBean.setInternalSequenceId(newSequenceId);
        createSeqBean.setCreateSeqMsgId(SandeshaUtil.getUUID()); //this
        // is a
View Full Code Here

      throw new SandeshaException("Storage Manager is null");

    boolean refuseSequence = false;
    String reason = "";

    SequenceOffer offer = createSequence.getSequenceOffer();
    if (offer != null) {
      String offeredSequenceId = offer.getIdentifer().getIdentifier();
      if (offeredSequenceId == null || "".equals(offeredSequenceId)) {
        refuseSequence = true;
        reason = "Offered sequenceId is invalid";
      } else {
        NextMsgBeanMgr nextMsgBeanMgr = storageManager
View Full Code Here

        .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);
      msgsBean.setName(Sandesha2Constants.SequenceProperties.RECEIVED_MESSAGES);
      msgsBean.setValue("");
View Full Code Here

    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);
View Full Code Here

TOP

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

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.