Secure iNet Factory

com.jscape.inet.finger
Class Finger

java.lang.Object
  extended by com.jscape.inet.finger.Finger
All Implemented Interfaces:
java.io.Serializable

public class Finger
extends java.lang.Object
implements java.io.Serializable

Implements the basic functionality of a FINGER client.

Example Usage:

 Finger finger = new Finger();
 finger.setHostname("myserver.com");

 try
 {
   // attempts to lookup information about user jsmith on machine myserver.com
   String results = finger.query("jsmith");
   System.out.println(results);
 }
 catch(FingerException e)
 {
   System.out.println(e);
 }
 

See Also:
Serialized Form

Constructor Summary
Finger()
          Constructs new Finger instance.
Finger(java.lang.String hostname)
          Constructs new Finger instance.
 
Method Summary
 java.lang.String getHostname()
          Gets hostname of FINGER server.
 int getPort()
          Gets port of finger server.
 int getTimeout()
          Gets the timeout for opening a FINGER connection.
 java.lang.String query(java.lang.String user)
          Connects to finger server and performs finger query.
 void setHostname(java.lang.String hostname)
          Sets hostname of FINGER server.
 void setPort(int port)
          Sets port of FINGER server.
 void setProxyAuthentication(java.lang.String proxyUsername, java.lang.String proxyPassword)
          Sets the username and password to use when for authentication with proxy server.
 void setProxyHost(java.lang.String proxyHostname, int proxyPort)
          Sets the proxy hostname and port for this connection.
 void setProxyType(java.lang.String proxyType)
          Sets the proxy type will be used for this connection.
 void setTimeout(int timeout)
          Sets the timeout for opening a FINGER connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Finger

public Finger()
Constructs new Finger instance.


Finger

public Finger(java.lang.String hostname)
Constructs new Finger instance.

Parameters:
hostname - the hostname of FINGER server
Method Detail

setPort

public void setPort(int port)
Sets port of FINGER server. Default value is 79.

Parameters:
port - the port of FINGER server

getPort

public int getPort()
Gets port of finger server. Default value is 79.

Returns:
port

setHostname

public void setHostname(java.lang.String hostname)
Sets hostname of FINGER server.

Parameters:
hostname - the hostname of FINGER server

getHostname

public java.lang.String getHostname()
Gets hostname of FINGER server.

Returns:
the hostname of FINGER server

setTimeout

public void setTimeout(int timeout)
Sets the timeout for opening a FINGER connection. Default of 0ms uses natural timeout of socket.

Parameters:
timeout - in milliseconds

getTimeout

public int getTimeout()
Gets the timeout for opening a FINGER connection. Default of 0ms uses natural timeout of socket.

Returns:
timeout in milliseconds

setProxyAuthentication

public void setProxyAuthentication(java.lang.String proxyUsername,
                                   java.lang.String proxyPassword)
Sets the username and password to use when for authentication with proxy server. To clear these settings invoke the #clearProxySettings method.

Parameters:
proxyUsername - the proxy username
proxyPassword - the proxy password

setProxyHost

public void setProxyHost(java.lang.String proxyHostname,
                         int proxyPort)
Sets the proxy hostname and port for this connection. To clear these settings invoke the #clearProxySettings method.

Parameters:
proxyHostname - the hostname or ip address of the proxy server
proxyPort - the port of the proxy server

setProxyType

public void setProxyType(java.lang.String proxyType)
Sets the proxy type will be used for this connection.

Parameters:
proxyType - The proxy type. Valid values: HTTP, SOCKS5

query

public java.lang.String query(java.lang.String user)
                       throws FingerException
Connects to finger server and performs finger query.

Parameters:
user - the user to query
Returns:
results of finger query
Throws:
FingerException - if a FINGER or I/O error occurs

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved