Examples of RMSBeanMgr


Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      String outboundSequence = nextMsgBean.getOutboundInternalSequence();
      if(outboundSequence != null) {
        RMSBean findRMS = new RMSBean();
        findRMS.setInternalSequenceID(outboundSequence);
        findRMS.setTerminated(false);
        RMSBeanMgr mgr = storageManager.getRMSBeanMgr();
        RMSBean outbound = mgr.findUnique(findRMS);
        if(outbound != null && outbound.getExpectedReplies() == 0) {
          doPoll = false;
        }
      }
      if(force || doPoll)
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

          }
        }

        if (service == null && rmdBean == null) {
          //If this is the RMD of the sequence
          RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
          RMSBean rmsfindBean = new RMSBean();
          rmsfindBean.setSequenceID(sequenceID);

          RMSBean rmsBean = rmsBeanMgr.findUnique(rmsfindBean);

          if (rmsBean != null) {
            String serviceName = rmsBean.getServiceName();
            if (serviceName != null) {
              service = configurationContext
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      log.error(message);
      throw new SandeshaException(message);
    }

    SenderBeanMgr retransmitterMgr = storageManager.getSenderBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
    if (rmsBean == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound);
      log.debug(message);
      throw new SandeshaException(message);
    }

    // Check that the create sequence response message proves possession of the correct token
    String tokenData = rmsBean.getSecurityTokenData();
    if(tokenData != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      MessageContext crtSeqResponseCtx = createSeqResponseRMMsgCtx.getMessageContext();
      OMElement body = crtSeqResponseCtx.getEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, body, crtSeqResponseCtx);
    }

    String internalSequenceId = rmsBean.getInternalSequenceID();
    if (internalSequenceId == null || "".equals(internalSequenceId)) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.tempSeqIdNotSet);
      log.debug(message);
      throw new SandeshaException(message);
    }
    createSeqResponseRMMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceId);
   
    rmsBean.setSequenceID(newOutSequenceId);

    // We should poll for any reply-to that uses the anonymous URI, when MakeConnection
    // is enabled.
    if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configCtx.getAxisConfiguration());
      if(policy.isEnableMakeConnection()) {
        String acksTo = rmsBean.getAcksToEPR();
        EndpointReference reference = new EndpointReference(acksTo);
        if(acksTo == null || reference.hasAnonymousAddress()) {
          rmsBean.setPollingMode(true);
        }
      }
    }

    SenderBean createSequenceSenderBean = retransmitterMgr.retrieve(createSeqMsgId);
    if (createSequenceSenderBean == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound));

    // deleting the create sequence entry.
    retransmitterMgr.delete(createSeqMsgId);
   
    // Remove the create sequence message
    storageManager.removeMessageContext(rmsBean.getCreateSequenceMsgStoreKey());
       
    // processing for accept (offer has been sent)
    Accept accept = createSeqResponsePart.getAccept();
    if (accept != null) {

      // TODO this should be detected in the Fault manager.
      if (rmsBean.getOfferedSequence() == null) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.accptButNoSequenceOffered);
        log.debug(message);
        throw new SandeshaException(message);
      }

      RMDBean rMDBean = new RMDBean();
     
      EndpointReference acksToEPR = accept.getAcksTo().getEPR();
      rMDBean.setAcksToEPR(acksToEPR.getAddress());
      rMDBean.setSequenceID(rmsBean.getOfferedSequence());
      rMDBean.setNextMsgNoToProcess(1);
      rMDBean.setOutboundInternalSequence(rmsBean.getInternalSequenceID());

      rMDBean.setServiceName(createSeqResponseRMMsgCtx.getMessageContext().getAxisService().getName());
     
      //Storing the referenceMessage of the sending side sequence as the reference message
      //of the receiving side as well.
      //This can be used when creating new outgoing messages.
     
      String referenceMsgStoreKey = rmsBean.getReferenceMessageStoreKey();
      MessageContext referenceMsg = storageManager.retrieveMessageContext(referenceMsgStoreKey, configCtx);
     
      String newMessageStoreKey = SandeshaUtil.getUUID();
      storageManager.storeMessageContext(newMessageStoreKey,referenceMsg);
     
      rMDBean.setReferenceMessageKey(newMessageStoreKey);

      // If this is an offered sequence that needs polling then we need to setup the
      // rmdBean for polling too, so that it still gets serviced after the outbound
      // sequence terminates.
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
        if(rmsBean.isPollingMode()) {
          rMDBean.setPollingMode(true);
        }
      }
     
      String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();
      rMDBean.setRMVersion(rmSpecVersion);
     
      EndpointReference toEPR = createSeqResponseRMMsgCtx.getTo();
      if (toEPR==null) {
        //Most probably this is a sync response message, using the replyTo of the request message
        OperationContext operationContext = createSeqResponseRMMsgCtx.getMessageContext().getOperationContext();
        if (operationContext!=null) {
          MessageContext createSequnceMessage = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
          if (createSequnceMessage!=null)
            toEPR = createSequnceMessage.getReplyTo();
        }
      }
     
      if (toEPR!=null)
        rMDBean.setToAddress(toEPR.getAddress());
     
      rMDBean.setServerCompletedMessages(new RangeString());
      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();

      // Store the security token for the offered sequence
      rMDBean.setSecurityTokenData(rmsBean.getSecurityTokenData());
     
      rMDBean.setLastActivatedTime(System.currentTimeMillis());
     
      rmdBeanMgr.insert(rMDBean);
      SandeshaUtil.startWorkersForSequence(configCtx, rMDBean);
    }
   
    rmsBean.setLastActivatedTime(System.currentTimeMillis());
    rmsBeanMgr.update(rmsBean);
    SandeshaUtil.startWorkersForSequence(configCtx, rmsBean);

    // Locate and update all of the messages for this sequence, now that we know
    // the sequence id.
    SenderBean target = new SenderBean();
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      throw new SandeshaException(message);
    }
    String createSeqMsgId = relatesTo.getValue();

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

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
    if (rmsBean == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound);
      log.debug(message);
      throw new SandeshaException(message);
    }

    // Check that the create sequence response message proves possession of the correct token
    String tokenData = rmsBean.getSecurityTokenData();
    if(tokenData != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      MessageContext crtSeqResponseCtx = createSeqResponseRMMsgCtx.getMessageContext();
      OMElement body = crtSeqResponseCtx.getEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, body, crtSeqResponseCtx);
    }

    String internalSequenceId = rmsBean.getInternalSequenceID();
    if (internalSequenceId == null || "".equals(internalSequenceId)) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.tempSeqIdNotSet);
      log.debug(message);
      throw new SandeshaException(message);
    }
    createSeqResponseRMMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceId);
   
    String sequencePropertyKey = SandeshaUtil.getSequencePropertyKey(createSeqResponseRMMsgCtx);
   
    rmsBean.setSequenceID(newOutSequenceId);
    rmsBeanMgr.update(rmsBean);

    SenderBean createSequenceSenderBean = senderBeanMgr.retrieve(createSeqMsgId);
    if (createSequenceSenderBean == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound));
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

  }
 
  private void pollRMSSide(SequenceEntry entry, boolean force) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Enter: PollingManager::pollRMSSide, force: " + force);
   
    RMSBeanMgr rmsBeanManager = storageManager.getRMSBeanMgr();
    RMSBean findRMS = new RMSBean();
    findRMS.setInternalSequenceID(entry.getSequenceId());
    findRMS.setPollingMode(true);
    findRMS.setTerminated(false);
    RMSBean beanToPoll = rmsBeanManager.findUnique(findRMS);
   
    if(beanToPoll == null) {
      // This sequence must have been terminated, or deleted
      stopThreadForSequence(entry.getSequenceId(), true);
    } else {
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

    SequenceReport sequenceReport = new SequenceReport();
    sequenceReport.setSequenceDirection(SequenceReport.SEQUENCE_DIRECTION_OUT);

    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
    RMSBeanMgr createSeqMgr = storageManager.getRMSBeanMgr();

    Transaction reportTransaction = null;

    try {
      if (createTransaction)
        reportTransaction = storageManager.getTransaction();

      sequenceReport.setInternalSequenceID(internalSequenceID);

      RMSBean createSeqFindBean = new RMSBean();
      createSeqFindBean.setInternalSequenceID(internalSequenceID);

      RMSBean rMSBean = createSeqMgr.findUnique(createSeqFindBean);

      // if data not is available sequence has to be terminated or
      // timedOut.
      if (rMSBean != null && rMSBean.isTerminated()) {
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      String outboundSequence = nextMsgBean.getOutboundInternalSequence();
      if(outboundSequence != null) {
        RMSBean findRMS = new RMSBean();
        findRMS.setInternalSequenceID(outboundSequence);
        findRMS.setTerminated(false);
        RMSBeanMgr mgr = storageManager.getRMSBeanMgr();
        RMSBean outbound = mgr.findUnique(findRMS);
        if(outbound != null && outbound.getExpectedReplies() == 0) {
          doPoll = false;
        }
      }
      if(force || doPoll)
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      log.error(message);
      throw new SandeshaException(message);
    }

    SenderBeanMgr retransmitterMgr = storageManager.getSenderBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
    if (rmsBean == null) {
      if (log.isDebugEnabled())
        log.debug("Exit: FaultManager::processCreateSequenceRefusedFault Unable to find RMSBean");
      return;
    }
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      log.error(message);
      throw new SandeshaException(message);
    }

    SenderBeanMgr retransmitterMgr = storageManager.getSenderBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
    if (rmsBean == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound);
      log.debug(message);
      throw new SandeshaException(message);
    }

    // Check that the create sequence response message proves possession of the correct token
    String tokenData = rmsBean.getSecurityTokenData();
    if(tokenData != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      MessageContext crtSeqResponseCtx = createSeqResponseRMMsgCtx.getMessageContext();
      OMElement body = crtSeqResponseCtx.getEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, body, crtSeqResponseCtx);
    }

    String internalSequenceId = rmsBean.getInternalSequenceID();
    if (internalSequenceId == null || "".equals(internalSequenceId)) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.tempSeqIdNotSet);
      log.debug(message);
      throw new SandeshaException(message);
    }
    createSeqResponseRMMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceId);
   
    // Check to see if we have already received a sequence id. If we have then this response is redundant,
    // and we can forget about it.
    // TODO: Should we terminate or close the extra sequence? We can only do that if the new sequence
    // id is different from the one we got back the first time. For now it should be enough to just
    // ignore it, and let it time out.
    if(rmsBean.getSequenceID() != null) {
      if(log.isDebugEnabled())
        log.debug("Exit: CreateSeqResponseMsgProcessor::processInMessage, sequence id is already set. " +
            "Existing id:" + rmsBean.getSequenceID() + ", new id:" + newOutSequenceId);
      return false;
    }

    // Store the new sequence id
    rmsBean.setSequenceID(newOutSequenceId);

    // We should poll for any reply-to that uses the anonymous URI, when MakeConnection
    // is enabled.
    if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configCtx.getAxisConfiguration());
      if(policy.isEnableMakeConnection()) {
        String acksTo = rmsBean.getAcksToEPR();
        EndpointReference reference = new EndpointReference(acksTo);
        if(acksTo == null || reference.hasAnonymousAddress()) {
          rmsBean.setPollingMode(true);
        }
      }
    }

    // deleting the create sequence sender bean entry.
    retransmitterMgr.delete(createSeqMsgId);
   
    // Remove the create sequence message
    storageManager.removeMessageContext(rmsBean.getCreateSequenceMsgStoreKey());
       
    // processing for accept (offer has been sent)
    Accept accept = createSeqResponsePart.getAccept();
    if (accept != null) {

      // TODO this should be detected in the Fault manager.
      if (rmsBean.getOfferedSequence() == null) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.accptButNoSequenceOffered);
        log.debug(message);
        throw new SandeshaException(message);
      }

      RMDBean rMDBean = new RMDBean();
     
      EndpointReference acksToEPR = accept.getAcksTo().getEPR();
      rMDBean.setAcksToEPR(acksToEPR.getAddress());
      rMDBean.setSequenceID(rmsBean.getOfferedSequence());
      rMDBean.setNextMsgNoToProcess(1);
      rMDBean.setOutboundInternalSequence(rmsBean.getInternalSequenceID());

      rMDBean.setServiceName(createSeqResponseRMMsgCtx.getMessageContext().getAxisService().getName());
     
      //Storing the referenceMessage of the sending side sequence as the reference message
      //of the receiving side as well.
      //This can be used when creating new outgoing messages.
     
      String referenceMsgStoreKey = rmsBean.getReferenceMessageStoreKey();
      MessageContext referenceMsg = storageManager.retrieveMessageContext(referenceMsgStoreKey, configCtx);
     
      String newMessageStoreKey = SandeshaUtil.getUUID();
      storageManager.storeMessageContext(newMessageStoreKey,referenceMsg);
     
      rMDBean.setReferenceMessageKey(newMessageStoreKey);

      // If this is an offered sequence that needs polling then we need to setup the
      // rmdBean for polling too, so that it still gets serviced after the outbound
      // sequence terminates.
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
        if(rmsBean.isPollingMode()) {
          rMDBean.setPollingMode(true);
        }
      }
     
      String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();
      rMDBean.setRMVersion(rmSpecVersion);
     
      EndpointReference toEPR = createSeqResponseRMMsgCtx.getTo();
      if (toEPR==null) {
        //Most probably this is a sync response message, using the replyTo of the request message
        OperationContext operationContext = createSeqResponseRMMsgCtx.getMessageContext().getOperationContext();
        if (operationContext!=null) {
          MessageContext createSequnceMessage = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
          if (createSequnceMessage!=null)
            toEPR = createSequnceMessage.getReplyTo();
        }
      }
     
      if (toEPR!=null)
        rMDBean.setToAddress(toEPR.getAddress());
     
      rMDBean.setServerCompletedMessages(new RangeString());
      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();

      // Store the security token for the offered sequence
      rMDBean.setSecurityTokenData(rmsBean.getSecurityTokenData());
     
      rMDBean.setLastActivatedTime(System.currentTimeMillis());
     
      rmdBeanMgr.insert(rMDBean);
      SandeshaUtil.startWorkersForSequence(configCtx, rMDBean);
    }
   
    rmsBean.setLastActivatedTime(System.currentTimeMillis());
    rmsBeanMgr.update(rmsBean);
    SandeshaUtil.startWorkersForSequence(configCtx, rmsBean);

    // Locate and update all of the messages for this sequence, now that we know
    // the sequence id.
    SenderBean target = new SenderBean();
View Full Code Here

Examples of org.apache.sandesha2.storage.beanmanagers.RMSBeanMgr

      }
     
      // Update the reply count
      if(outBean != null && outBean.getExpectedReplies() > 0 ) {
        outBean.setExpectedReplies(outBean.getExpectedReplies() - 1);
        RMSBeanMgr outMgr = storageManager.getRMSBeanMgr();
        outMgr.update(outBean);
      }
    }
   
    // Set the last activated time
    bean.setLastActivatedTime(System.currentTimeMillis());
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.