Package org.apache.sandesha2.client

Examples of org.apache.sandesha2.client.SequenceReport


    }
   
   
    SandeshaReport rmReport = SandeshaClient.getSandeshaReport(configContext);
   
     SequenceReport sequence1Report = null;
     SequenceReport sequence2Report = null;
    
     Iterator iterator = rmReport.getOutgoingSequenceList().iterator();
     while (iterator.hasNext()) {
       String sequenceID = (String) iterator.next();
      
        String internalSequenceID = rmReport.getInternalSequenceIdOfOutSequence(sequenceID);
       
        if (internalSequenceID.indexOf(sequenceKey1)>=0) {
          sequence1Report = SandeshaClient.getOutgoingSequenceReport(to,sequenceKey1,configContext);
        } else if (internalSequenceID.indexOf(sequenceKey2)>=0){
          sequence2Report = SandeshaClient.getOutgoingSequenceReport(to,sequenceKey2,configContext);
        }
     }
    
     assertNotNull(sequence1Report);
     assertNotNull(sequence2Report);
    
     assertEquals(sequence1Report.getCompletedMessages().size(),2);
     assertEquals(sequence2Report.getCompletedMessages().size(),1);
    
     assertEquals(sequence1Report.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
     assertEquals(sequence2Report.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_ESTABLISHED)
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here


   
       
        Thread.sleep(40000);
   
        //assertions for the out sequence.
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
   
    assertEquals(callback1.getResult(),"echo1");
   
    serviceClient.finalizeInvoke();
  }
View Full Code Here

   
        while (!callback3.isComplete()) {
            Thread.sleep(1000);
        }
       
      SequenceReport sequenceReport = null;   
    boolean complete = false;
    while (!complete) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getCompletedMessages().size()==3)
        complete = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

    serviceClient.fireAndForget(getPingOMBlock("ping2"));
   
   
    Thread.sleep(10000);
 
    SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(1)));
    assertTrue(sequenceReport.getCompletedMessages().contains(new Long(2)));
    assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TERMINATED);
    assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
 
    serviceClient.finalizeInvoke();
  }
View Full Code Here

    clientOptions.setProperty(SandeshaClientConstants.LAST_MESSAGE, "true");
    serviceClient.fireAndForget(getPingOMBlock("ping31"));
   
    clientOptions.setProperty(SandeshaClientConstants.DUMMY_MESSAGE,Sandesha2Constants.VALUE_FALSE);

    SequenceReport sequenceReport = null;
   
    boolean established = false;
    while (!established) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()>=SequenceReport.SEQUENCE_STATUS_ESTABLISHED)
        established = true;
      else {
        try {
          Thread.sleep(100);
        } catch (InterruptedException e1) {
          e1.printStackTrace();
        }
      }
    }
   
    SandeshaClient.sendAckRequest(serviceClient);
   
    SandeshaClient.terminateSequence(serviceClient);
   
    boolean terminated = false;
    while (!terminated) {
      sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
      if (sequenceReport!=null && sequenceReport.getSequenceStatus()==SequenceReport.SEQUENCE_STATUS_TERMINATED)
        terminated = true;
      else {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e1) {
View Full Code Here

    return interval;
  }
 
  private void finalizeTimedOutSequence (String internalSequenceID, String sequenceID ,MessageContext messageContext) throws SandeshaException {
    ConfigurationContext configurationContext = messageContext.getConfigurationContext();
    SequenceReport report = SandeshaClient.getOutgoingSequenceReport(internalSequenceID ,configurationContext);
    TerminateManager.timeOutSendingSideSequence(configurationContext,internalSequenceID, false);
   
    SandeshaListener listener = (SandeshaListener) messageContext.getProperty(SandeshaClientConstants.SANDESHA_LISTENER);
    if (listener!=null) {
      listener.onTimeOut(report);
View Full Code Here

    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
            //assertions for the out sequence.
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TIMED_OUT);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        assertTrue(callback1.isErrorReported());
        assertEquals(callback1.getResult(),null);
       
        lastError = null;
View Full Code Here

    while(System.currentTimeMillis() < limit) {
      Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
     
      try {
            //assertions for the out sequence.
        SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
        assertEquals(sequenceReport.getSequenceStatus(),SequenceReport.SEQUENCE_STATUS_TIMED_OUT);
        assertEquals(sequenceReport.getSequenceDirection(),SequenceReport.SEQUENCE_DIRECTION_OUT);
       
        assertTrue(callback1.isErrorReported());
        assertEquals(callback1.getResult(),null);
       
        lastError = null;
View Full Code Here

      Error lastError = null;
      while(System.currentTimeMillis() < limit) {
        Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
       
        try {
          SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
         
          assertNotNull(sequenceReport.getSequenceID());
          assertFalse(sequenceReport.isSecureSequence());

          lastError = null;
          break;
        } catch(Error e) {
          lastError = e;
View Full Code Here

        Error lastError = null;
        while(System.currentTimeMillis() < limit) {
          Thread.sleep(tickTime); // Try the assertions each tick interval, until they pass or we time out
         
          try {
            SequenceReport sequenceReport = SandeshaClient.getOutgoingSequenceReport(serviceClient);
            assertNotNull(sequenceReport.getSequenceID());
           
            //now close the sequence
            SandeshaClient.closeSequence(serviceClient);
           
            //try and send another msg - this should fail
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.client.SequenceReport

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.