Package org.apache.sandesha2

Examples of org.apache.sandesha2.Sandesha2Constants$SOAPFaults$Subcodes


    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
        configurationContext.getAxisConfiguration());
   
    // Check that the sender of this AckRequest holds the correct token
    RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, sequenceId);

    if(rmdBean != null && rmdBean.getSecurityTokenData() != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configurationContext);
      SecurityToken token = secManager.recoverSecurityToken(rmdBean.getSecurityTokenData());
     
      secManager.checkProofOfPossession(token, soapHeader, msgContext);
    }

    // Check that the sequence requested exists
    if (FaultManager.checkForUnknownSequence(rmMsgCtx, sequenceId, storageManager, piggybackedAckRequest)) {
      if (log.isDebugEnabled())
        log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader, Unknown sequence ");
      return false;
    }

    // throwing a fault if the sequence is terminated
    if (FaultManager.checkForSequenceTerminated(rmMsgCtx, sequenceId, rmdBean, piggybackedAckRequest)) {
      if (log.isDebugEnabled())
        log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader, Sequence terminated");
      return false;
    }

    // Setting the ack depending on AcksTo.
    EndpointReference acksTo = new EndpointReference(rmdBean.getAcksToEPR());
    String acksToStr = acksTo.getAddress();

    if (acksToStr == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));

    //Getting the operation for ack messages.
    AxisOperation ackOperation = SpecSpecificConstants.getWSRMOperation(
        Sandesha2Constants.MessageTypes.ACK,
        rmdBean.getRMVersion(),
        msgContext.getAxisService());
   
    MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(rmMsgCtx, ackOperation);
   
    //setting up the RMMsgContext
View Full Code Here


      StorageManager storageManager =
        SandeshaUtil.getSandeshaStorageManager(configContext, configContext.getAxisConfiguration());
     
      Transaction tran = storageManager.getTransaction();
     
      RMSBean finderBean = new RMSBean();
      List rmsBeans = storageManager.getRMSBeanMgr().find(finderBean);
     
      tran.commit();
     
      lastError = null;
View Full Code Here

    messageContext.setEnvelope(dummyEnvelope);
   
    RMMsgContext applicationRMMsg = new RMMsgContext(messageContext);
   
    // Create an RMSBean so the create sequence message can be created
    RMSBean rmsBean = new RMSBean();
    rmsBean.setRMVersion(Sandesha2Constants.SPEC_VERSIONS.v1_1);
    rmsBean.setToEPR(to);
    rmsBean.setAcksToEPR(AddressingConstants.Final.WSA_NONE_URI);
       
    // Create a Create Sequence message
    // generating a new create sequeuce message.
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(rmsBean, applicationRMMsg);
    messageContext = createSeqRMMessage.getMessageContext();
    messageContext.setWSAAction(SpecSpecificConstants.getCreateSequenceAction(Sandesha2Constants.SPEC_VERSIONS.v1_1));

    CreateSequence createSeqResPart = (CreateSequence) createSeqRMMessage
    .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);

    createSeqResPart.setAcksTo(
        new AcksTo(new EndpointReference(AddressingConstants.Final.WSA_NONE_URI),
                   SpecSpecificConstants.getRMNamespaceValue(rmsBean.getRMVersion()),
                   AddressingConstants.Final.WSA_NAMESPACE));
   
    // Update the SOAP Envelope of the message
    createSeqRMMessage.addSOAPEnvelope();
View Full Code Here

    SenderBeanMgr senderMgr = storageManager.getSenderBeanMgr();
   
    String seqID = SandeshaUtil.getUUID();
   
    // Mockup an RMSBean
    RMSBean rmsBean = new RMSBean();
    rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
    rmsBean.setSequenceID(seqID);
    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);
    SenderBean bean3 = getSenderBean(seqID, 1, 3);   
View Full Code Here

     
      Transaction transaction = storageManager.getTransaction();
     
      RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
     
      RMSBean rmsBean = new RMSBean ();
      RMSBean duplicateRMSBean = new RMSBean ();
     
      rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
      duplicateRMSBean.setCreateSeqMsgID(SandeshaUtil.getUUID());
     
      String sequenceId = SandeshaUtil.getUUID();
     
      //we duplicate this sequenceID in both RMSBeans.
      rmsBean.setSequenceID(sequenceId);
      duplicateRMSBean.setSequenceID(sequenceId);
     
      rmsBeanMgr.insert(rmsBean);
     
      boolean exceptionThrown = false;
      try {
View Full Code Here

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

    public void testDelete() throws SandeshaStorageException {
      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId1");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId1");
      rMSBean.setSequenceID("SeqId1");
        mgr.insert(rMSBean);
        mgr.delete("CreateSeqMsgId1");
        assertNull(mgr.retrieve("CreateSeqMsgId1"));
    }
View Full Code Here

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

    public void testFind() throws SandeshaStorageException {
      RMSBean createSeqBean1 = new RMSBean ();
      createSeqBean1.setInternalSequenceID("TmpSeqId1");
      createSeqBean1.setCreateSeqMsgID("CreateSeqMsgId1");
      createSeqBean1.setSequenceID("SeqId1");
     
      RMSBean createSeqBean2 = new RMSBean ();
      createSeqBean2.setInternalSequenceID("TmpSeqId1");
      createSeqBean2.setCreateSeqMsgID("CreateSeqMsgId2");
      createSeqBean2.setSequenceID("SeqId2");
     
        mgr.insert(createSeqBean1);
        mgr.insert(createSeqBean2);

        RMSBean target = new RMSBean();
        target.setInternalSequenceID("TmpSeqId1");

        Iterator iter = mgr.find(target).iterator();
        RMSBean tmp = (RMSBean) iter.next();
        if (tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1")) {
            tmp = (RMSBean) iter.next();
            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId2"));

        }   else {
            tmp = (RMSBean) iter.next();
            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1"));
        }
    }
View Full Code Here

            assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId1"));
        }
    }

    public void testInsert() throws SandeshaStorageException{
      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId4");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId4");
      rMSBean.setSequenceID("SeqId4");
        mgr.insert(rMSBean);
        RMSBean tmpbean = mgr.retrieve("CreateSeqMsgId4");
        assertTrue(tmpbean.getCreateSeqMsgID().equals("CreateSeqMsgId4"));
        assertTrue(tmpbean.getSequenceID().equals("SeqId4"));
        assertTrue(tmpbean.getInternalSequenceID().equals("TmpSeqId4"));
    }
View Full Code Here


    public void testRetrieve() throws SandeshaStorageException{
        assertNull(mgr.retrieve("CreateSeqMsgId5"));

      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId5");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId5");
      rMSBean.setSequenceID("SeqId5");
        mgr.insert(rMSBean);
        RMSBean tmp = mgr.retrieve("CreateSeqMsgId5");
        assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId5"));
    }
View Full Code Here

        RMSBean tmp = mgr.retrieve("CreateSeqMsgId5");
        assertTrue(tmp.getCreateSeqMsgID().equals("CreateSeqMsgId5"));
    }

    public void testUpdate() throws SandeshaStorageException {
      RMSBean rMSBean = new RMSBean ();
      rMSBean.setInternalSequenceID("TmpSeqId6");
      rMSBean.setCreateSeqMsgID("CreateSeqMsgId6");
      rMSBean.setSequenceID("SeqId6");
       
        mgr.insert(rMSBean);
        rMSBean.setInternalSequenceID("TmpSeqId7");
        mgr.update(rMSBean);
        RMSBean tmp = mgr.retrieve("CreateSeqMsgId6");
        assertTrue(tmp.getInternalSequenceID().equals("TmpSeqId7"));
    }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.Sandesha2Constants$SOAPFaults$Subcodes

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.