Package org.apache.sandesha2.storage.beanmanagers

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


    }

    public void testRetrieve() throws SandeshaStorageException {
        assertNull(mgr.retrieve("MsgId5"));
        try {
            mgr.insert(new SenderBean("MsgId5", "Key5", false , 1001 , "TmpSeqId5", 1005));
        } catch (SandeshaException e) {
            fail("this should not throw an exception");
        }
        assertNotNull(mgr.retrieve("MsgId5"));
    }
View Full Code Here


        }
        assertNotNull(mgr.retrieve("MsgId5"));
    }

    public void testUpdate() throws SandeshaStorageException {
        SenderBean bean = new SenderBean("MsgId6", "Key6", false , 1001 , "TmpSeqId6", 1006);
        try {
            mgr.insert(bean);
        } catch (SandeshaException e) {
            fail("should not throw an exception");
        }
        bean.setSend(true);
        mgr.update(bean);

        SenderBean tmp = mgr.retrieve("MsgId6");
        assertTrue(tmp.isSend());
    }
View Full Code Here

    // Ensure the outbound message us secured using the correct token
    RMMsgCreator.secureOutboundMessage(getRMSBean(), msgContext);
   
    String key = SandeshaUtil.getUUID();

    SenderBean senderBean = new SenderBean();
    senderBean.setMessageType(msgType);
    senderBean.setMessageContextRefKey(key);
    senderBean.setTimeToSend(System.currentTimeMillis() + delay);
    senderBean.setMessageID(msgContext.getMessageID());
   
    // Set the internal sequence id and outgoing sequence id for the terminate message
    senderBean.setInternalSequenceID(internalSequenceID);
    if (sequenceExists)
    {
      senderBean.setSend(true);
      senderBean.setSequenceID(outSequenceID);
    }
    else
      senderBean.setSend(false);     
   
    EndpointReference to = msgContext.getTo();
    if (to!=null)
      senderBean.setToAddress(to.getAddress());

    // If this message is targetted at an anonymous address then we must not have a transport
    // ready for it, as the current message is not a reply.
    if(to == null || to.hasAnonymousAddress())
      senderBean.setTransportAvailable(false);
   
    msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);

    senderBean.setReSend(false);

    SenderBeanMgr retramsmitterMgr = storageManager.getSenderBeanMgr();
   
    SandeshaUtil.executeAndStore(rmMsgCtx, key);
 
View Full Code Here

     
      //setting a dummy property been to stop Sandesha2 from throwing exceptions.
      SandeshaPolicyBean policyBean = new SandeshaPolicyBean ();
      axisConfiguration.addParameter(new Parameter (Sandesha2Constants.SANDESHA_PROPERTY_BEAN,policyBean));
     
      InMemoryStorageManager storageManager = new InMemoryStorageManager (configurationContext);
     
      Transaction transaction = storageManager.getTransaction();
     
      RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
     
      RMSBean rmsBean = new RMSBean ();
      RMSBean duplicateRMSBean = new RMSBean ();
     
      rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
View Full Code Here

    rmdBean.setSequenceID(seqID);
    rmdBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmdBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmdBean.setServerCompletedMessages(new RangeString());
    // Flag that the sequence is closed.
    rmdBean.setClosed(true);
   
    // Create a transaction and insert the RMSBean
    Transaction tran = storageManager.getTransaction();
View Full Code Here

    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null));
    rmsBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setReplyToEPR(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();
   
View Full Code Here

    rmsBean.setInternalSequenceID(SandeshaUtil.getInternalSequenceID(seqID, null));
    rmsBean.setToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setReplyToEPR(AddressingConstants.Final.WSA_ANONYMOUS_URL);
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setClientCompletedMessages(new RangeString());
    rmsBean.setNextMessageNumber(4);
    rmsBean.setHighestOutMessageNumber(3);
   
    SenderBean bean1 = getSenderBean(seqID, 1, 1);
    SenderBean bean2 = getSenderBean(seqID, 0, 2);
View Full Code Here

    }

    //In case of ack request messages RM Namespace is decided based on the sequenceId of the last
    //ack request.
    for (Iterator iter = elements.getAckRequests();iter.hasNext();) {
      AckRequested ackRequest = (AckRequested) iter.next();
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST, ackRequest);
      rmNamespace = ackRequest.getNamespaceValue();
    }

    if (elements.getCloseSequence() != null) {
      rmMsgContext.setMessagePart(Sandesha2Constants.MessageParts.CLOSE_SEQUENCE, elements.getCloseSequence());
      rmNamespace = elements.getCloseSequence().getNamespaceValue();
View Full Code Here

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!ackRequestedIter.hasNext())
        sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
View Full Code Here

    Identifier id = new Identifier(rmNamespaceValue);
    id.setIndentifer(sequenceId);
    sequenceAck.setIdentifier(id);
   
    // Set the Invalid range!
    AcknowledgementRange ackRange = new AcknowledgementRange(rmNamespaceValue);
    ackRange.setLowerValue(1);
    ackRange.setUpperValue(3);
    sequenceAck.addAcknowledgementRanges(ackRange);

    // Set the SequenceAcknowledgement part in the message
    applicationRMMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
    applicationRMMsg.addSOAPEnvelope();
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr

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.