Package org.apache.sandesha2.storage.beans

Examples of org.apache.sandesha2.storage.beans.RMDBean


        }

    }

    public void testInsert() throws SandeshaStorageException {
        RMDBean bean = new RMDBean("SeqId4", 1004);
        mgr.insert(bean);
        RMDBean tmp = mgr.retrieve("SeqId4");
        assertTrue(tmp.getNextMsgNoToProcess() == 1004);
    }
View Full Code Here


        assertTrue(tmp.getNextMsgNoToProcess() == 1004);
    }

    public void testRetrieve() throws SandeshaStorageException {
        assertNull(mgr.retrieve("SeqId5"));
        mgr.insert(new RMDBean("SeqId5", 1005));

        RMDBean tmp = mgr.retrieve("SeqId5");
        assertTrue(tmp.getNextMsgNoToProcess() == 1005);
    }
View Full Code Here

        RMDBean tmp = mgr.retrieve("SeqId5");
        assertTrue(tmp.getNextMsgNoToProcess() == 1005);
    }

    public void testUpdate() throws SandeshaStorageException {
        RMDBean bean = new RMDBean("SeqId6", 1006);
        mgr.insert(bean);
        bean.setNextMsgNoToProcess(1007);
        mgr.update(bean);
        RMDBean tmp = mgr.retrieve("SeqId6");
        assertTrue(tmp.getNextMsgNoToProcess() ==1007);
    }
View Full Code Here

    Iterator iterator = table.values().iterator();

    if (bean == null)
      return beans;

    RMDBean temp;
    while (iterator.hasNext()) {
      temp = (RMDBean) iterator.next();

      boolean equal = true;

      if (bean.getNextMsgNoToProcess() > 0
          && bean.getNextMsgNoToProcess() != temp
              .getNextMsgNoToProcess())
        equal = false;

      if (bean.getSequenceID() != null
          && !bean.getSequenceID().equals(temp.getSequenceID()))
        equal = false;

      if (equal)
        beans.add(temp);
View Full Code Here

    if (toBean != null)
      seqPropMgr.insert(toBean);

    RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
    rmdBeanMgr.insert(new RMDBean(sequenceId, 1)); // 1 will be the
                              // next

    // message to invoke. This will apply for only in-order invocations.

    SandeshaUtil.startSenderForTheSequence(configurationContext, sequenceId);
View Full Code Here

    String offeredSequenceId = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
        Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE, storageManager);
    if (offeredSequenceId!=null) {

      RMDBeanMgr rmdBeanMgr = storageManager.getRMDBeanMgr();
      RMDBean rmdBean = rmdBeanMgr.retrieve(outSequenceId);
     
      if (rmdBean!=null && rmdBean.isPollingMode())
        SandeshaUtil.shedulePollingRequest(offeredSequenceId, configCtx);
     
    }
   
    // setting acked message date.
View Full Code Here

      acksToBean.setSequencePropertyKey(offeredSequenceId);
      acksToBean.setValue(acksToEPR.getAddress());

      sequencePropMgr.insert(acksToBean);

      RMDBean rmdBean = new RMDBean();
      rmdBean.setSequenceID(offeredSequenceId);
      rmdBean.setNextMsgNoToProcess(1);
     

      boolean pollingMode = false;
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
        String replyToAddress = SandeshaUtil.getSequenceProperty(sequencePropertyKey,
                Sandesha2Constants.SequenceProperties.REPLY_TO_EPR, storageManager);
        if (replyToAddress!=null) {
          if (AddressingConstants.Submission.WSA_ANONYMOUS_URL.equals(replyToAddress))
            pollingMode = true;
          else if (AddressingConstants.Final.WSA_ANONYMOUS_URL.equals(replyToAddress))
            pollingMode = true;
          else if (replyToAddress.startsWith(Sandesha2Constants.WSRM_ANONYMOUS_URI_PREFIX))
            pollingMode = true;
        }
      }
     
      //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);
     
      rmdBean.setPollingMode(pollingMode);
     
      //if PollingMode is true, starting the pollingmanager.
      if (pollingMode)
        SandeshaUtil.startPollingManager(configCtx);
     
View Full Code Here

    public void tearDown() throws Exception {
      transaction.commit();
    }

    public void testDelete() throws SandeshaStorageException{
        mgr.insert(new RMDBean("SeqId1", 1001));
        mgr.delete("SeqId1");
        assertNull(mgr.retrieve("SeqId1"));
    }
View Full Code Here

        mgr.delete("SeqId1");
        assertNull(mgr.retrieve("SeqId1"));
    }

    public void testFind() throws SandeshaStorageException {
        mgr.insert(new RMDBean("SeqId2", 1002));
        mgr.insert(new RMDBean("SeqId3", 1002));

        RMDBean target = new RMDBean();
        target.setNextMsgNoToProcess(1002);

        Iterator iterator = mgr.find(target).iterator();
        RMDBean tmp = (RMDBean) iterator.next();

        if (tmp.getSequenceID().equals("SeqId2")) {
            tmp = (RMDBean) iterator.next();
            tmp.getSequenceID().equals("SeqId3");
        } else {
            tmp = (RMDBean) iterator.next();
            tmp.getSequenceID().equals("SeqId2");
        }

    }
View Full Code Here

        }

    }

    public void testInsert() throws SandeshaStorageException {
        RMDBean bean = new RMDBean("SeqId4", 1004);
        mgr.insert(bean);
        RMDBean tmp = mgr.retrieve("SeqId4");
        assertTrue(tmp.getNextMsgNoToProcess() == 1004);
    }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.beans.RMDBean

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.