org.apache.activemq.transport.tcp
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.activemq.transport.tcp(Showing top 15 results out of 315)

origin: apache/activemq

  public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth)
    throws IOException {
    JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
    X509Certificate cert = new StubX509Certificate(principal);
    StubSSLSession sslSession = new StubSSLSession(cert);

    StubSSLSocket sslSocket = new StubSSLSocket(sslSession);
    sslSocket.setWantClientAuth(wantAuth);
    sslSocket.setNeedClientAuth(needAuth);
    return sslSocket;
  }
}
origin: apache/activemq

private void createAndBindTransportServer(boolean wantClientAuth, boolean needClientAuth, String options) throws IOException {
  sslServerSocket = new StubSSLServerSocket();
  StubSSLSocketFactory socketFactory = new StubSSLSocketFactory(sslServerSocket);
  try {
    sslTransportServer = new SslTransportServer(null, new URI("ssl://localhost:61616?" + options), socketFactory);
  } catch (Exception e) {
    fail("Unable to create SslTransportServer.");
  }
  sslTransportServer.setWantClientAuth(wantClientAuth);
  sslTransportServer.setNeedClientAuth(needClientAuth);
  sslTransportServer.bind();
}
origin: apache/activemq

  private void testInvalidTypeOfServiceValue(int val) {
    try {
      QualityOfServiceUtils.getToS(val);
      fail("No IllegalArgumentException thrown for invalid "
        + "Type of Service value " + val + ".");
    } catch (IllegalArgumentException expected) {
    }
  }
}
origin: apache/activemq

private void testValidTypeOfServiceValue(int val) {
  try {
    int typeOfService = QualityOfServiceUtils.getToS(val);
    assertEquals("Incorrect Type of Services value returned for " + val
      + ".", val, typeOfService);
  } catch (IllegalArgumentException e) {
    fail("IllegalArgumentException thrown for valid Type of Service "
       + "value " + val + ".");
  }
}
origin: apache/activemq

private void singleTest(int i, String options) throws IOException {
  final boolean wantClientAuth = getWantClientAuth(i);
  final boolean needClientAuth = getNeedClientAuth(i);
  final int expectedWantStatus = (needClientAuth? StubSSLServerSocket.UNTOUCHED: wantClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.UNTOUCHED);
  final int expectedNeedStatus = (needClientAuth ? StubSSLServerSocket.TRUE : StubSSLServerSocket.UNTOUCHED );
  createAndBindTransportServer(wantClientAuth, needClientAuth, options);
  assertEquals("Created ServerSocket did not have correct wantClientAuth status. wantClientAuth: " + wantClientAuth + ", needClientAuth: " + needClientAuth,
    expectedWantStatus, sslServerSocket.getWantClientAuthStatus());
  assertEquals("Created ServerSocket did not have correct needClientAuth status. wantClientAuth: " + wantClientAuth + ", needClientAuth: " + needClientAuth,
    expectedNeedStatus, sslServerSocket.getNeedClientAuthStatus());
}
origin: apache/activemq

public void testInvalidTypeOfServiceOptionDoesNotWork() throws Exception {
  int[] invalidOptions = {-2, -1, 256, 257};
  for (int opt : invalidOptions) {
    testInvalidOptionsDoNotWork(TOS + opt, "");
  }
}
origin: apache/activemq

@Override
protected TcpTransportServer createTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException {
  TcpTransportServer result = new TcpTransportServer(this, location, serverSocketFactory);
  result.setAllowLinkStealing(true);
  return result;
}
origin: apache/activemq

@Override
public Socket createSocket(String host, int port, InetAddress localAddress, int localPort) throws IOException {
  SocketTst sockTst;
  sockTst = new SocketTst(host, port, localAddress, localPort, this.rnd);
  sockTst.startBagot();
  return sockTst.getSocket();
}
origin: apache/activemq

public void setNeedClientAuth(boolean arg0) {
  this.needClientAuthStatus = arg0 ? TRUE : FALSE;
  if (session != null) {
    this.session.setIsVerified(arg0);
  }
}
origin: apache/activemq

/**
 * @param socket
 * @param format
 * @param detectedTransportFactory
 * @return
 */
protected TcpTransport createTransport(Socket socket, WireFormat format,
    TcpTransportFactory detectedTransportFactory, InitBuffer initBuffer) throws IOException {
  return new TcpTransport(format, socket, initBuffer);
}
origin: apache/activemq

  @Override
  public void onFrame(MQTTFrame mqttFrame) {
    transport.doConsume(mqttFrame);
  }
};
origin: apache/activemq

  /**
   * @return pretty print of this
   */
  public String toString() {
    return "" + getBindLocation();
  }
}
origin: apache/activemq

private void testValidDiffServName(String name, int expected) {
  int dscp = -1;
  try {
    dscp = QualityOfServiceUtils.getDSCP(name);
  } catch (IllegalArgumentException e) {
    fail("IllegalArgumentException thrown for valid Differentiated "
       + " Services name: " + name);
  }
  // Make sure it adjusted for any system ECN values.
  assertEquals("Incorrect Differentiated Services Code Point "  + dscp
    + " returned for name " + name + ".", ECN | (expected << 2), dscp);
}
origin: apache/activemq

private void testInvalidDiffServName(String name) {
  try {
    QualityOfServiceUtils.getDSCP(name);
    fail("No IllegalArgumentException thrown for invalid Differentiated"
       + " Services value: " + name + ".");
  } catch (IllegalArgumentException e) {
  }
}
origin: apache/activemq

@Override
public Socket createSocket(String host, int port) throws IOException {
  SocketTst sockTst;
  sockTst = new SocketTst(host, port, this.rnd);
  sockTst.startBagot();
  return sockTst.getSocket();
}
org.apache.activemq.transport.tcp

Most used classes

  • TcpTransport
    An implementation of the Transport interface using raw tcp/ip
  • SslTransport
    A Transport class that uses SSL and client-side certificate authentication. Client-side certificate
  • TcpTransportServer
    A TCP based implementation of TransportServer
  • SslTransportFactory
    An implementation of the TcpTransportFactory using SSL. The major contribution from this class is th
  • SslTransportServer
    An SSL TransportServer. Allows for client certificate authentication (refer to setNeedClientAuth for
  • TcpBufferedInputStream,
  • TcpBufferedOutputStream,
  • TcpTransportFactory,
  • ExceededMaximumConnectionsException,
  • ResponseHolder,
  • TcpTransportServer$TransportInfo,
  • TimeStampStream,
  • TcpTransport$InitBuffer,
  • InactivityMonitorTest,
  • QualityOfServiceUtilsTest,
  • ServerSocketTstFactory$ServerSocketTst,
  • ServerSocketTstFactory,
  • SocketTstFactory$SocketTst$Bagot,
  • SocketTstFactory$SocketTst

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)