org.abstracthorizon.mercury.finger
Class SimpleFinger

java.lang.Object
  extended by org.abstracthorizon.mercury.finger.SimpleFinger

public class SimpleFinger
extends Object

Simple finger

Author:
Daniel Sendula

Field Summary
protected  InetAddress hostAddress
          Host address
protected  String hostName
          Hostname
protected  String lastResult
          Last invocation's result
protected  org.slf4j.Logger logger
          Logger
protected  int timeout
          Timeout.
protected  String userName
          Username
 
Constructor Summary
SimpleFinger()
          Constructor
 
Method Summary
 void finger()
          Note: Address or host must be populated.
static String finger(String user)
          Invokes finger function
static String finger(String user, String host)
          Invokes finger
 InetAddress getHostAddress()
          Returns host address
 String getHostName()
          Returns host name
 String getLastResult()
          Returns last result
 int getTimeout()
          Returns timeout
 String getUser()
          Returns user
static void main(String[] args)
           
 void setHostAddress(InetAddress address)
          Sets host address
 void setHostName(String host)
          Sets host name
 void setTimeout(int timeout)
          Sets timeout
 void setUser(String user)
          Sets user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger


userName

protected String userName
Username


hostName

protected String hostName
Hostname


hostAddress

protected InetAddress hostAddress
Host address


timeout

protected int timeout
Timeout. Default is 60 seconds


lastResult

protected String lastResult
Last invocation's result

Constructor Detail

SimpleFinger

public SimpleFinger()
Constructor

Method Detail

getHostName

public String getHostName()
Returns host name

Returns:
host name

setHostName

public void setHostName(String host)
Sets host name

Parameters:
host - host name

getHostAddress

public InetAddress getHostAddress()
Returns host address

Returns:
host address

setHostAddress

public void setHostAddress(InetAddress address)
Sets host address

Parameters:
address - host address

getUser

public String getUser()
Returns user

Returns:
user

setUser

public void setUser(String user)
Sets user

Parameters:
user - user

getTimeout

public int getTimeout()
Returns timeout

Returns:
timeout

setTimeout

public void setTimeout(int timeout)
Sets timeout

Parameters:
timeout - timeout

getLastResult

public String getLastResult()
Returns last result

Returns:
last result

finger

public void finger()
            throws UnknownHostException,
                   IOException
Note: Address or host must be populated.

Throws:
UnknownHostException
IOException

finger

public static String finger(String user)
                     throws UnknownHostException,
                            IOException
Invokes finger function

Parameters:
user - username in format user@host
Returns:
result
Throws:
UnknownHostException
IOException

finger

public static String finger(String user,
                            String host)
                     throws UnknownHostException,
                            IOException
Invokes finger

Parameters:
user - username
host - hostname
Returns:
result
Throws:
UnknownHostException
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.