common-util

local.tomas.util.net
Class BaseClient

java.lang.Object
  extended by local.tomas.util.net.BaseClient
Direct Known Subclasses:
FtpClient

public abstract class BaseClient
extends Object

Title: Base of Network Client Classes Description: Copyright: Copyright (c) 2001 Tomas Teubner Company: Tomas Teubner

Version:
1.0
Author:
Tomas Teubner

Nested Class Summary
static class BaseClient.NetAck
          Parsed response.
 
Field Summary
protected  Socket cmd
          Socket of command connection.
protected  BufferedReader cmdIn
          Command response stream.
protected  PrintStream cmdOut
          Command output stream.
 
Constructor Summary
BaseClient()
          Default constructor.
 
Method Summary
 void close()
          Close connection.
 BaseClient.NetAck connect(String host, int port)
          Establish new connection
 BaseClient.NetAck getAck()
          Get response.
protected  BaseClient.NetAck sendCommand(String command)
          Send command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cmd

protected Socket cmd
Socket of command connection.


cmdIn

protected BufferedReader cmdIn
Command response stream.


cmdOut

protected PrintStream cmdOut
Command output stream.

Constructor Detail

BaseClient

public BaseClient()
Default constructor.

Method Detail

connect

public BaseClient.NetAck connect(String host,
                                 int port)
                          throws NetException
Establish new connection

Parameters:
host - host name or IP address
port - port number
Returns:
parsed response of connect request
Throws:
NetException

close

public void close()
           throws NetException
Close connection.

Throws:
NetException

sendCommand

protected BaseClient.NetAck sendCommand(String command)
                                 throws NetException
Send command.

Parameters:
command - the command
Returns:
parsed response
Throws:
NetException

getAck

public BaseClient.NetAck getAck()
                         throws NetException
Get response.

Returns:
parsed response
Throws:
NetException

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.