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

    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

      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);
    }
   
    //Need to see if the seqID is a dupe of one that already exists
    //If it is we can't accept the CSR, so will do nothing so that a new CreateSeq msg is sent
    RMSBean finderBean = new RMSBean ();
    finderBean.setSequenceID(newOutSequenceId);
    RMSBean rmsBeanWithDuplicateSeqID = storageManager.getRMSBeanMgr().findUnique(finderBean);
    if(rmsBeanWithDuplicateSeqID != null){
      if (log.isDebugEnabled())
        log.debug("Duplicate SeqID: " + newOutSequenceId + " so we can't accept the CSR, will terminate this seq and reallocate to a new seq");
      return false;
    }

    // Check that the create sequence response message proves possession of the correct token
    MessageContext msgCtx = createSeqResponseRMMsgCtx.getMessageContext();
    SandeshaUtil.assertProofOfPossession(rmsBean, msgCtx, msgCtx.getEnvelope().getBody());

    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()) {
        EndpointReference reference = rmsBean.getAcksToEndpointReference();
        if(reference == null || reference.hasAnonymousAddress()) {
          rmsBean.setPollingMode(true);
        }
      }
    }
     
    rmsBean.setLastActivatedTime(System.currentTimeMillis());
   
    if(!rmsBeanMgr.update(rmsBean)){     
      //Im not setting the createSeqBean sender bean to resend true as the reallocation of msgs will do this
      try{
        TerminateManager.terminateSendingSide(rmsBean, storageManager, true, transaction);
      } catch(Exception e){
        if (log.isDebugEnabled())
View Full Code Here

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

  }

  public static final RMSBean getRMSBeanFromInternalSequenceId(StorageManager storageManager, String internalSequenceID)
 
  throws SandeshaException {
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean bean = rmsBeanMgr.retrieveByInternalSequenceID(internalSequenceID);
    return bean;
  }
View Full Code Here

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

    RMSBean bean = rmsBeanMgr.retrieveByInternalSequenceID(internalSequenceID);
    return bean;
  }
 
  public static final RMSBean getRMSBeanFromSequenceId(StorageManager storageManager, String sequenceIDthrows SandeshaException {
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean bean = rmsBeanMgr.retrieveBySequenceID(sequenceID);
    return bean;
  }
View Full Code Here

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

        client.fireAndForget(msgCtx.getEnvelope().getBody().cloneOMElement().getFirstElement());
      } else if (replyTo == null || replyTo.hasAnonymousAddress()){
        //It is sync2way and therefore we should fail
        transaction = storageManager.getTransaction();

        RMSBeanMgr mgr = storageManager.getRMSBeanMgr();

        RMSBean finder = new RMSBean();
        finder.setSequenceID(oldRMSBean.getSequenceID());
        RMSBean bean = mgr.findUnique(finder);

        oldRMSBean.setReallocated(Sandesha2Constants.WSRM_COMMON.REALLOCATION_FAILED);
        storageManager.getRMSBeanMgr().update(oldRMSBean);
        throw new SandeshaException(SandeshaMessageKeys.reallocationForSyncRequestReplyNotSupported);
      } else {
View Full Code Here

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

   
    RMDBeanMgr rmdMgr = storageManager.getRMDBeanMgr();
    RMDBean rmdBean = rmdMgr.retrieve(sequenceId);
    String outBoundInternalSequence = rmdBean.getOutboundInternalSequence();
   
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    RMSBean findBean = new RMSBean ();
    findBean.setInternalSequenceID(outBoundInternalSequence);
    RMSBean rmsBean = rmsBeanMgr.findUnique (findBean);
   
    if (rmsBean!=null && rmsBean.getLastOutMessage()<=0) {
      //there is a RMS sequence without a LastMsg entry
     
      MessageContext msgContext = rmMsgCtx.getMessageContext();
View Full Code Here

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

  {
    // Create an RMS on the service.
    StorageManager storageManager =
      SandeshaUtil.getSandeshaStorageManager(serverConfigContext, serverConfigContext.getAxisConfiguration());
 
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
 
    // Mockup an RMSBean
    RMSBean rmsBean = new RMSBean();
    rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
    rmsBean.setSequenceID(sequenceID);
    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(sequenceID, null));
    rmsBean.setToEndpointReference(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
    rmsBean.setAcksToEndpointReference(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
    rmsBean.setReplyToEndpointReference(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(1);
   
    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
   
    rmsBeanMgr.insert(rmsBean);
   
    tran.commit();
    return rmsBean;
  }
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

                                        // value.
         
         
          String outgoingSideSequencePropertyKey = outgoingSideInternalSequenceId;

          RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
          rmsBeanMgr.insert(rmsBean);

          // Setting sequence properties for the outgoing sequence.
          // Only will be used by the server side response path. Will
          // be wasted properties for the client side.
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.