Package java.net

Examples of java.net.SocketAddress


    responseHandler.setRequestListener(requestListener);
    responseHandler.setConnectionListener(connectListener);
    responseHandler.setCloseListener(closeListener);

    Channel channel = createClientBootstrap(responseHandler);
    SocketAddress clientAddr = channel.getLocalAddress();
    try
    {

      HttpResponse resp = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR);
      resp.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
View Full Code Here


    TestConnectListener connectListener = new TestConnectListener(log);
    responseHandler.setConnectionListener(connectListener);

    Channel channel = createClientBootstrap(responseHandler);
    SocketAddress clientAddr = channel.getLocalAddress();
    try
    {
      for (int i=0; i < 2;++i)
      {
        TestHttpResponseProcessor respProcessor = new TestHttpResponseProcessor(log);
View Full Code Here

                _management.isHttpBasicAuthenticationEnabled());
    }

    public void testGetAuthenticationProvider()
    {
        SocketAddress localAddress = InetSocketAddress.createUnresolved("localhost", 8080);
        AuthenticationProvider brokerAuthenticationProvider = mock(AuthenticationProvider.class);
        when(_broker.getAuthenticationProvider(localAddress)).thenReturn(brokerAuthenticationProvider);
        AuthenticationProvider authenticationProvider = _management.getAuthenticationProvider(localAddress);
        assertEquals("Unexpected subject creator", brokerAuthenticationProvider, authenticationProvider);
    }
View Full Code Here

    }

    private static Subject tryToAuthenticate(HttpServletRequest request, HttpManagementConfiguration managementConfig)
    {
        Subject subject = null;
        SocketAddress localAddress = getSocketAddress(request);
        SubjectCreator subjectCreator = managementConfig.getAuthenticationProvider(localAddress).getSubjectCreator();
        String remoteUser = request.getRemoteUser();

        if (remoteUser != null || subjectCreator.isAnonymousAuthenticationAllowed())
        {
View Full Code Here

    }

    public void setNetworkConnection(NetworkConnection network, Sender<ByteBuffer> sender)
    {
        _network = network;
        SocketAddress address = _network.getLocalAddress();
        if (address instanceof InetSocketAddress)
        {
            _fqdn = ((InetSocketAddress) address).getHostName();
        }
        else
View Full Code Here

        return principal.getName();
    }

    private PreferencesProvider getPreferencesProvider(HttpServletRequest request)
    {
        SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
        AuthenticationProvider authenticationProvider = getManagementConfiguration().getAuthenticationProvider(localAddress);
        if (authenticationProvider == null)
        {
            throw new IllegalStateException("Authentication provider is not found");
        }
View Full Code Here

        }
    }

    private SubjectCreator getSubjectCreator(HttpServletRequest request)
    {
        SocketAddress localAddress = HttpManagementUtil.getSocketAddress(request);
        return HttpManagementUtil.getManagementConfiguration(getServletContext()).getAuthenticationProvider(localAddress).getSubjectCreator();
    }
View Full Code Here

                                                  Port port,
                                                  Transport transport,
                                                  long id)
    {
        String fqdn = null;
        SocketAddress address = network.getLocalAddress();
        if (address instanceof InetSocketAddress)
        {
            fqdn = ((InetSocketAddress) address).getHostName();
        }
        final ConnectionDelegate connDelegate = new ServerConnectionDelegate(broker,
View Full Code Here

  @Override
  public void channelClosed(ChannelHandlerContext ctx,
                                         ChannelStateEvent e) throws Exception {
    Channel channel = e.getChannel();
    SocketAddress a = (null != channel) ? channel.getRemoteAddress() : null;
    _log.info("channel to peer closed: " + a);

    synchronized (this){
      _channelState = ChannelState.CHANNEL_CLOSED;
View Full Code Here

    waitForServerConnection(conn, log);

    //introspect connection to server
    Channel channel = conn._channel;
    SocketAddress clientAddr = channel.getLocalAddress();

    Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
    ChannelPipeline serverPipeline = serverChannel.getPipeline();
    SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");
View Full Code Here

TOP

Related Classes of java.net.SocketAddress

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.