Examples of RMSBeanMgr


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

      if (log.isDebugEnabled())
        log.debug("Exit: CreateSeqMsgProcessor::offerAccepted, " + false);
      return false;
    }

    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsFindBean = new RMSBean();
    rmsFindBean.setSequenceID(sequenceId);
    Collection arr = rmsBeanMgr.find(rmsFindBean);

    if (arr.size() > 0) {
      if (log.isDebugEnabled())
        log.debug("Exit: CreateSeqMsgProcessor::offerAccepted, " + false);
      return false;
View Full Code Here

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

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForUnknownSequence, " + sequenceID);

    MessageContext messageContext = rmMessageContext.getMessageContext();

    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    boolean validSequence = false;

    // Look for an outbound sequence
    RMSBean rmsFindBean = new RMSBean();
    rmsFindBean.setSequenceID(sequenceID);

    Collection coll = rmsBeanMgr.find(rmsFindBean);
    if (!coll.isEmpty()) {
      validSequence = true;

    } else {
      // Look for an inbound sequence
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());
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    String withinTransactionStr = (String) configurationContext.getProperty(Sandesha2Constants.WITHIN_TRANSACTION);
    boolean withinTransaction = false;
    if (withinTransactionStr != null && Sandesha2Constants.VALUE_TRUE.equals(withinTransactionStr))
      withinTransaction = true;

    Transaction reportTransaction = null;
    if (!withinTransaction)
      reportTransaction = storageManager.getTransaction();

    boolean rolebacked = false;

    try {

      sequenceReport.setInternalSequenceID(internalSequenceID);

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

      RMSBean createSeqBean = rmsBeanMgr.findUnique(rmsFindBean);

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

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

    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());
      }
    }
   
    rmsBeanMgr.insert(rmsBean);

    String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE, storageManager);
    String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);
View Full Code Here

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

  private static void cleanSendingSideData(ConfigurationContext configContext, String sequencePropertyKey,String internalSequenceId,
      boolean serverSide, StorageManager storageManager) throws SandeshaException {

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

    String outSequenceID = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID, storageManager);

    if (!serverSide) {
      boolean stopListnerForAsyncAcks = false;
      SequencePropertyBean acksToBean = sequencePropertyBeanMgr.retrieve(sequencePropertyKey,
          Sandesha2Constants.SequenceProperties.ACKS_TO_EPR);

      String addressingNamespace = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
          Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE, storageManager);
      String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespace);

      if (acksToBean != null) {
        String acksTo = acksToBean.getValue();
        if (acksTo != null && !anonymousURI.equals(acksTo)) {
          stopListnerForAsyncAcks = true;
        }
      }
    }

    // removing retransmitterMgr entries and corresponding message contexts.
    Collection collection = senderBeanMgr.find(internalSequenceId);
    Iterator iterator = collection.iterator();
    while (iterator.hasNext()) {
      SenderBean senderBean = (SenderBean) iterator.next();
      senderBeanMgr.delete(senderBean.getMessageID());

      String messageStoreKey = senderBean.getMessageContextRefKey();
      storageManager.removeMessageContext(messageStoreKey);
    }

    // removing the createSeqMgrEntry
    RMSBean findRMSBean = new RMSBean();
    findRMSBean.setInternalSequenceID(internalSequenceId);
    collection = rmsBeanMgr.find(findRMSBean);
    iterator = collection.iterator();
    while (iterator.hasNext()) {
      RMSBean rmsBean = (RMSBean) iterator.next();
      rmsBeanMgr.delete(rmsBean.getCreateSeqMsgID());
    }

    // removing sequence properties
    SequencePropertyBean findSequencePropertyBean1 = new SequencePropertyBean();
    findSequencePropertyBean1.setSequencePropertyKey(sequencePropertyKey);
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.