Package org.teiid.client.security

Examples of org.teiid.client.security.ILogon.ping()


      }, "foo"); //$NON-NLS-1$
    csr.registerClientService(FakeService.class, new FakeServiceImpl(), "foo"); //$NON-NLS-1$
    final FakeClientServerInstance serverInstance = new FakeClientServerInstance(csr);
    SocketServerConnection connection = createFakeConnection(serverInstance);
    ILogon logon = connection.getService(ILogon.class);
    Future<?> result = logon.ping();
    assertNull(result.get(0, TimeUnit.MILLISECONDS));
    result = logon.logoff();
    try {
      result.get(0, TimeUnit.MICROSECONDS);
      fail("exception expected"); //$NON-NLS-1$
View Full Code Here


            ILogon logon = instance.getService(ILogon.class);
            if ("7.1.1".compareTo(instance.getServerVersion()) > 0) { //$NON-NLS-1$
              for (SessionToken session : entries) {
                try {
                  logon.assertIdentity(session);
                  logon.ping();
                  log.log(Level.FINER, "issueing ping for session:", session); //$NON-NLS-1$
                } catch (InvalidSessionException e) {
                }
              }
            } else {
View Full Code Here

            } else {
              ArrayList<String> sessionStrings = new ArrayList<String>(entry.getValue().size());
              for (SessionToken session : entries) {
                sessionStrings.add(session.getSessionID());
              }
              logon.ping(sessionStrings);
              log.log(Level.FINER, "issueing ping for sessions:", sessionStrings); //$NON-NLS-1$
            }
          } catch (Exception e) {
            log.log(Level.WARNING, "Error performing keep-alive ping", e); //$NON-NLS-1$
          } finally {
View Full Code Here

      }
      if (instance != null) {
        ILogon logon = instance.actual.getService(ILogon.class);
        boolean valid = false;
        try {
          Future<?> success = logon.ping();
          success.get(this.channelFactory.getSoTimeout(), TimeUnit.MILLISECONDS);
          valid = true;
        } catch (Exception e) {
          log.log(Level.FINE, "Error performing ping, will select another instance", e); //$NON-NLS-1$
        }
View Full Code Here

    SocketServerConnection connection = createConnection(new SingleInstanceCommunicationException());
    connection.setFailOver(true);
    connection.setFailOverPingInterval(50);
    ILogon logon = connection.getService(ILogon.class);
    Thread.sleep(70);
    logon.ping();
  }
 
  @Test(expected=CommunicationException.class) public void testImmediateFail() throws Exception {
    SocketServerConnection connection = createConnection(new CommunicationException());
    ILogon logon = connection.getService(ILogon.class);
View Full Code Here

  }
 
  @Test(expected=CommunicationException.class) public void testImmediateFail() throws Exception {
    SocketServerConnection connection = createConnection(new CommunicationException());
    ILogon logon = connection.getService(ILogon.class);
    logon.ping();
  }
 
  @Test(expected=CommunicationException.class) public void testImmediateFail1() throws Exception {
    SocketServerConnection connection = createConnection(new CommunicationException());
    connection.setFailOver(true);
View Full Code Here

 
  @Test(expected=CommunicationException.class) public void testImmediateFail1() throws Exception {
    SocketServerConnection connection = createConnection(new CommunicationException());
    connection.setFailOver(true);
    ILogon logon = connection.getService(ILogon.class);
    logon.ping();
  }

  private SocketServerConnection createConnection(final Throwable throwException) throws CommunicationException, ConnectionException {
    return createConnection(throwException, new Properties());
  }
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.