org.apache.mina.proxy.handlers.socks

## Class SocksProxyRequest

- java.lang.Object
- - org.apache.mina.proxy.handlers.ProxyRequest
  - - org.apache.mina.proxy.handlers.socks.SocksProxyRequest

-     public class SocksProxyRequest
      extends ProxyRequest

  SocksProxyRequest.java - Wrapper class for SOCKS requests.
  Since:
    MINA 2.0.0-M3
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocksProxyRequest(byte protocolVersion, byte commandCode, InetSocketAddress endpointAddress, String userName)` Constructor used when building a SOCKS4 request.
    `SocksProxyRequest(byte commandCode, String host, int port, String userName)` Constructor used when building a SOCKS4a request.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `getCommandCode()` Return the command code.
    `String` | `getHost()` Return the server host name.
    `byte[]` | `getIpAddress()` Returns the endpoint address resulting from the `ProxyRequest.getEndpointAddress()`.
    `String` | `getPassword()` Return the user password.
    `byte[]` | `getPort()` Return the server port as a byte array.
    `byte` | `getProtocolVersion()` Return the protocol version.
    `String` | `getServiceKerberosName()` Return the Kerberos service name.
    `String` | `getUserName()` Return the user name.
    `void` | `setPassword(String password)` Set the user password
    `void` | `setServiceKerberosName(String serviceKerberosName)` Set the Kerberos service name.

    - ### Methods inherited from class org.apache.mina.proxy.handlers.ProxyRequest

      `getEndpointAddress`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SocksProxyRequest

          public SocksProxyRequest(byte protocolVersion,
                           byte commandCode,
                           InetSocketAddress endpointAddress,
                           String userName)

      Constructor used when building a SOCKS4 request.
      Parameters:
        `protocolVersion` - the protocol version
        `commandCode` - the command code
        `endpointAddress` - the endpoint address
        `userName` - the user name

    - #### SocksProxyRequest

          public SocksProxyRequest(byte commandCode,
                           String host,
                           int port,
                           String userName)

      Constructor used when building a SOCKS4a request.
      Parameters:
        `commandCode` - the command code
        `host` - the server host name
        `port` - the server port
        `userName` - the user name

  - ### Method Detail

    - #### getIpAddress

          public byte[] getIpAddress()

      Returns the endpoint address resulting from the `ProxyRequest.getEndpointAddress()`. If not set, it will return the `SocksProxyConstants.FAKE_IP` constant value which will be ignored in a SOCKS v4 request.
      Returns:
        the endpoint address

    - #### getPort

          public byte[] getPort()

      Return the server port as a byte array.
      Returns:
        the server port

    - #### getCommandCode

          public byte getCommandCode()

      Return the command code.
      Returns:
        the command code

    - #### getProtocolVersion

          public byte getProtocolVersion()

      Return the protocol version.
      Returns:
        the protocol version

    - #### getUserName

          public String getUserName()

      Return the user name.
      Returns:
        the user name

    - #### getHost

          public final String getHost()

      Return the server host name.
      Returns:
        the server host name

    - #### getPassword

          public String getPassword()

      Return the user password.
      Returns:
        the user password

    - #### setPassword

          public void setPassword(String password)

      Set the user password
      Parameters:
        `password` - the user password value

    - #### getServiceKerberosName

          public String getServiceKerberosName()

      Return the Kerberos service name.
      Returns:
        the Kerberos service name

    - #### setServiceKerberosName

          public void setServiceKerberosName(String serviceKerberosName)

      Set the Kerberos service name.
      Parameters:
        `serviceKerberosName` - the Kerberos service name

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.