gnu.hylafax.pool
Class HylaFAXPooledClient

java.lang.Object
  |
  +--gnu.inet.ftp.FtpClientProtocol
        |
        +--gnu.hylafax.HylaFAXClientProtocol
              |
              +--gnu.hylafax.HylaFAXClient
                    |
                    +--gnu.hylafax.pool.HylaFAXPooledClient
All Implemented Interfaces:
Client, ClientProtocol, ConnectionEventSource, PooledClient, java.lang.Runnable, TransferEventSource

public class HylaFAXPooledClient
extends HylaFAXClient
implements PooledClient, java.lang.Runnable

This is an extension of the gnu.hylafax.HylaFAXClient specifically designed to work with the gnu.hylafax.pool.ClientPool pooling functionality.

Author:
Steven Jardine

Fields inherited from class gnu.hylafax.HylaFAXClient
connection
 
Fields inherited from class gnu.hylafax.HylaFAXClientProtocol
DEFAULT_PORT, TZONE_GMT, TZONE_LOCAL
 
Fields inherited from class gnu.inet.ftp.FtpClientProtocol
fileType, greeting, istream, MDTM_TIME_FORMAT1, MDTM_TIME_FORMAT2, MODE_BLOCK, MODE_COMPRESSED, MODE_STREAM, MODE_ZLIB, ostream, port, sock, STRU_FILE, STRU_PAGE, STRU_RECORD, STRU_TIFF, TYPE_ASCII, TYPE_EBCDIC, TYPE_IMAGE, TYPE_LOCAL
 
Fields inherited from interface gnu.hylafax.ClientProtocol
NOTIFY_ALL, NOTIFY_DONE, NOTIFY_NONE, NOTIFY_REQUEUE, TZONE_GMT, TZONE_LOCAL
 
Constructor Summary
HylaFAXPooledClient(ClientPool clientPool)
          Default constructor.
 
Method Summary
 void admin(java.lang.String password)
          establish administrator privileges given password
 Job createJob()
          create a new job in the server
 void delete(Job job)
          delete the given done or suspended job
 void destroy()
          Destroy the client.
 java.lang.String filefmt()
          get the FILEFMT string value.
 void filefmt(java.lang.String value)
          set the FILEFMT string value.
 void get(java.lang.String path, java.io.OutputStream out)
          GET the named file, FTP style.
 Job getJob(long id)
          get a Job instance for the given job id
 java.util.Vector getList()
          get a long-style listing of files in the current directory.
 java.util.Vector getList(java.lang.String path)
          get a long-style listing of files in the given directory.
 java.util.Vector getNameList()
          get name list of files in the current directory.
 java.util.Vector getNameList(java.lang.String path)
          get name list of files in the given directory.
 boolean getPassive()
          check whether passive transfers have been enabled
 long idle()
          get the current idle timeout in seconds
 void idle(long timeout)
          set the idle timeout value to the given number of seconds
 void interrupt(Job job)
          interrupt the given job
 boolean isValid()
          Checks to see if the client is currently valid.
 boolean isWorking()
           
 void jdele(long jobid)
          delete the given job this can be called on a suspended or done job.
 void jintr(long jobid)
          interrupt the given job id
 void jkill(long jobid)
          kill the job with the given job id
 void jnew()
          create a new job.
 long job()
          get the current job id 0 indicates the current job id is "default" value
 void job(long value)
          set the current job id
 java.lang.String jobfmt()
          get the job format string.
 void jobfmt(java.lang.String value)
          set the job format string.
 java.lang.String jparm(java.lang.String parm)
          get job parameters of the current job
 void jparm(java.lang.String parm, int value)
          set job parameters on the current job
 void jparm(java.lang.String parm, long value)
          set job parameters on the current job
 void jparm(java.lang.String parm, java.lang.Object value)
          set job parameters on the current job
 void jparm(java.lang.String parm, java.lang.String value)
          set job parameters on the current job
 void jrest()
          reset the state of the current job.
 long jsubm()
          submit the current job to the scheduler
 int jsubm(long jobid)
          submit the given job to the scheduler
 void jsusp(long jobid)
          Suspend the job with the given job id.
 void jwait(long jobid)
          Wait for the job with the given job id to complete.
 void kill(Job job)
          kill the given job
 java.lang.String mdmfmt()
          get the modem format string value.
 void mdmfmt(java.lang.String value)
          set the modem format string.
 void mode(char mode)
          set the transfer mode.
 void noop()
          perform server No Operation could be used as a keep-alive
 void open()
          open a connection to the localhost on the default port
 void open(java.lang.String host)
          open a connection to a given server at default port this is an alias for connect()
 void open(java.lang.String host, int port)
          open a connection to a given server and port this is an alias for connect()
 void pass(java.lang.String password)
          send the password for this username and session
 java.lang.String put(java.io.InputStream in)
          put a file with a unique name.
 void put(java.io.InputStream in, java.lang.String pathname)
          store a file.
 java.lang.String putTemporary(java.io.InputStream data)
          put a temp file, the data is stored in a uniquely named file on the server.
 void quit()
          end session
 java.lang.String rcvfmt()
          get the received file output format string.
 void rcvfmt(java.lang.String value)
          set the receive file output format string.
 void run()
           
 void setDebug(boolean value)
          Sets the ConsoleLogger's debug output.
 void setPassive(boolean passive)
          enable or disable passive transfers
 void setValid(boolean valid)
           
 long size(java.lang.String pathname)
          Returns the size (in bytes) of the given regular file.
 void start()
          Start the maintaince thread for this client.
 void stop()
          Stops the maintaince thread for this client.
 java.lang.String stot(java.io.InputStream data)
          store temp file, the file is stored in a uniquely named file on the server.
 void submit(Job job)
          submit the given job to the scheduler
 void suspend(Job job)
          suspend the given job from the scheduler
 void tzone(java.lang.String value)
          set the timezone display format valid tzone values are TZONE_GMT and TZONE_LOCAL
 boolean user(java.lang.String username)
          send the user name for this session
 java.net.InetAddress vrfy(java.lang.String dialstring)
          verify dialstring handling and/or least-cost routing.
 void wait(Job job)
          wait for the given job to complete
 
Methods inherited from class gnu.hylafax.HylaFAXClient
addConnectionListener, addConnectionListeners, addTransferListener, addTransferListeners, main, removeConnectionListener, removeTransferListener
 
Methods inherited from class gnu.inet.ftp.FtpClientProtocol
abor, abor, cdup, connect, cwd, dele, getDebug, getGreeting, getInetAddress, getType, list, list, mdtm, nlst, nlst, pasv, port, pwd, readResponse, retr, rnfr, rnto, stat, stat, stor, stou, stru, syst, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HylaFAXPooledClient

public HylaFAXPooledClient(ClientPool clientPool)
Default constructor.
Parameters:
clientPool -  
Method Detail

admin

public void admin(java.lang.String password)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
establish administrator privileges given password
Specified by:
admin in interface ClientProtocol
Overrides:
admin in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
password - administrator password
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

createJob

public Job createJob()
              throws ServerResponseException,
                     java.io.IOException
Description copied from interface: Client
create a new job in the server
Specified by:
createJob in interface Client
Overrides:
createJob in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
a new Job instance on the server
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

delete

public void delete(Job job)
            throws ServerResponseException,
                   java.io.IOException
Description copied from interface: Client
delete the given done or suspended job
Specified by:
delete in interface Client
Overrides:
delete in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the (done or suspended) job to delete
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

destroy

public void destroy()
             throws ClientPoolException
Description copied from interface: PooledClient
Destroy the client. This makes the client unusable.
Specified by:
destroy in interface PooledClient
Following copied from interface: gnu.hylafax.pool.PooledClient
Throws:
ClientPoolException -  

filefmt

public java.lang.String filefmt()
                         throws java.io.IOException,
                                ServerResponseException
Description copied from interface: ClientProtocol
get the FILEFMT string value. The FILEFMT string specifies how file status information is formatted when returned by the LIST and STAT commands. Refer to the HylaFAX man pages, hfaxd(8c), for information on the formatting codes that can be used in this string.
Specified by:
filefmt in interface ClientProtocol
Overrides:
filefmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Returns:
the current FILEFMT value
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

filefmt

public void filefmt(java.lang.String value)
             throws java.io.IOException,
                    ServerResponseException
Description copied from interface: ClientProtocol
set the FILEFMT string value. the FILEFMT string specifies how file status information is returned when the LIST and STAT commands are used. Refer to the HylaFAX man pages, hfaxd(8c), for the formatting codes.
Specified by:
filefmt in interface ClientProtocol
Overrides:
filefmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - the new value of the FILEFMT string
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

get

public void get(java.lang.String path,
                java.io.OutputStream out)
         throws java.io.IOException,
                java.io.FileNotFoundException,
                ServerResponseException
Description copied from interface: Client
GET the named file, FTP style.
Specified by:
get in interface Client
Overrides:
get in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
path - the name of the file to GET. This can be a full or partial path.
out - the OutputStream to write the file data to
Throws:
java.io.IOException - an IO error occurred
ServerResponseException - the server reported an error
java.io.FileNotFoundException - the given path does not exist

getJob

public Job getJob(long id)
           throws ServerResponseException,
                  java.io.IOException
Description copied from interface: Client
get a Job instance for the given job id
Specified by:
getJob in interface Client
Overrides:
getJob in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
id - the id of the job to get
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

getList

public java.util.Vector getList()
                         throws java.io.IOException,
                                java.io.FileNotFoundException,
                                ServerResponseException
Description copied from interface: Client
get a long-style listing of files in the current directory. NOTE: this calls the list() method internally with the "." path.
Specified by:
getList in interface Client
Overrides:
getList in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
a Vector of Strings containing the list information
Throws:
java.io.IOException - an IO error occurred
java.io.FileNotFoundException - the "." path doesn't exist
ServerResponseException - the server reported an error

getList

public java.util.Vector getList(java.lang.String path)
                         throws java.io.IOException,
                                java.io.FileNotFoundException,
                                ServerResponseException
Description copied from interface: Client
get a long-style listing of files in the given directory. NOTE: this calls the list() method internally.
Specified by:
getList in interface Client
Overrides:
getList in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
path - the path that we're interested in finding the contents of
Returns:
a Vector of Strings containing the list information
Throws:
java.io.IOException - an IO error occurred
java.io.FileNotFoundException - the given path doesn't exist
ServerResponseException - the server reported an error

getNameList

public java.util.Vector getNameList()
                             throws java.io.IOException,
                                    ServerResponseException,
                                    java.io.FileNotFoundException
Description copied from interface: Client
get name list of files in the current directory. Similar to getList() but returns filenames only where getList() returns other, system dependant information.
Specified by:
getNameList in interface Client
Overrides:
getNameList in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
Vector of Strings containing filenames
Throws:
java.io.IOException - an IO error occurred
ServerResponseException - the server reported an error
java.io.FileNotFoundException - the requested path does not exist

getNameList

public java.util.Vector getNameList(java.lang.String path)
                             throws java.io.IOException,
                                    ServerResponseException,
                                    java.io.FileNotFoundException
Description copied from interface: Client
get name list of files in the given directory. Similar to getList() but returns filenames only where getList() returns other, system dependant information.
Specified by:
getNameList in interface Client
Overrides:
getNameList in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
path - the path of the directory that we want the name list of
Returns:
Vector of Strings containing filenames
Throws:
java.io.IOException - an IO error occurred
ServerResponseException - the server reported an error
java.io.FileNotFoundException - the requested path does not exist

getPassive

public boolean getPassive()
Description copied from interface: Client
check whether passive transfers have been enabled
Specified by:
getPassive in interface Client
Overrides:
getPassive in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
true if passive transfers are enabled, false otherwise

idle

public long idle()
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
get the current idle timeout in seconds
Specified by:
idle in interface ClientProtocol
Overrides:
idle in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Returns:
server's idle timeout in seconds
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

idle

public void idle(long timeout)
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
set the idle timeout value to the given number of seconds
Specified by:
idle in interface ClientProtocol
Overrides:
idle in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
timeout - new timeout value in seconds (MAX = 7200)
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

interrupt

public void interrupt(Job job)
               throws ServerResponseException,
                      java.io.IOException
Description copied from interface: Client
interrupt the given job
Specified by:
interrupt in interface Client
Overrides:
interrupt in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the job to interrupt
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

isValid

public boolean isValid()
Description copied from interface: PooledClient
Checks to see if the client is currently valid. If the client is not valid it should be reopened or destroyed.
Specified by:
isValid in interface PooledClient

isWorking

public boolean isWorking()
Returns:
true if the client is given out for work.

jdele

public void jdele(long jobid)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
delete the given job this can be called on a suspended or done job.
Specified by:
jdele in interface ClientProtocol
Overrides:
jdele in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - id of the job to delete
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - server replied with error code

jintr

public void jintr(long jobid)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
interrupt the given job id
Specified by:
jintr in interface ClientProtocol
Overrides:
jintr in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - id of the job to interrupt
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

jkill

public void jkill(long jobid)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
kill the job with the given job id
Specified by:
jkill in interface ClientProtocol
Overrides:
jkill in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - the id of the job to kill
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

jnew

public void jnew()
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
create a new job. get the new job id using the job() method. The new job is the current job.
Specified by:
jnew in interface ClientProtocol
Overrides:
jnew in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

job

public long job()
         throws java.io.IOException,
                ServerResponseException
Description copied from interface: ClientProtocol
get the current job id 0 indicates the current job id is "default" value
Specified by:
job in interface ClientProtocol
Overrides:
job in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

job

public void job(long value)
         throws java.io.IOException,
                ServerResponseException
Description copied from interface: ClientProtocol
set the current job id
Specified by:
job in interface ClientProtocol
Overrides:
job in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - new current job id
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jobfmt

public java.lang.String jobfmt()
                        throws java.io.IOException,
                               ServerResponseException
Description copied from interface: ClientProtocol
get the job format string. read the HylaFAX man pages, hfaxd(8c), for format codes.
Specified by:
jobfmt in interface ClientProtocol
Overrides:
jobfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - a socket IO error occurred.
ServerResponseException - the server responded with an error code

jobfmt

public void jobfmt(java.lang.String value)
            throws java.io.IOException,
                   ServerResponseException
Description copied from interface: ClientProtocol
set the job format string. read the HylaFAX man pages, hfaxd(8c), for format codes.
Specified by:
jobfmt in interface ClientProtocol
Overrides:
jobfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - new job format string
Throws:
java.io.IOException - a socket IO error occurred.
ServerResponseException - the server responded with an error

jparm

public java.lang.String jparm(java.lang.String parm)
                       throws java.io.IOException,
                              ServerResponseException
Description copied from interface: ClientProtocol
get job parameters of the current job
Specified by:
jparm in interface ClientProtocol
Overrides:
jparm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
parm - the name of the job parameter to change
Returns:
value of the named job parameter
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jparm

public void jparm(java.lang.String parm,
                  int value)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
set job parameters on the current job
Specified by:
jparm in interface ClientProtocol
Overrides:
jparm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
parm - the name of the job parameter to change
value - the value of the given parameter
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jparm

public void jparm(java.lang.String parm,
                  long value)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
set job parameters on the current job
Specified by:
jparm in interface ClientProtocol
Overrides:
jparm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
parm - the name of the job parameter to change
value - the value of the given parameter
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jparm

public void jparm(java.lang.String parm,
                  java.lang.Object value)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
set job parameters on the current job
Specified by:
jparm in interface ClientProtocol
Overrides:
jparm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
parm - the name of the job parameter to change
value - the value of the given parameter as an Object
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jparm

public void jparm(java.lang.String parm,
                  java.lang.String value)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
set job parameters on the current job
Specified by:
jparm in interface ClientProtocol
Overrides:
jparm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
parm - the name of the job parameter to change
value - the value of the given parameter
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jrest

public void jrest()
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
reset the state of the current job. get/set the current job id via the 'job' method
Specified by:
jrest in interface ClientProtocol
Overrides:
jrest in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - an IO error occurred
ServerResponseException - the server replied with an error code

jsubm

public long jsubm()
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
submit the current job to the scheduler
Specified by:
jsubm in interface ClientProtocol
Overrides:
jsubm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Returns:
the job id
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jsubm

public int jsubm(long jobid)
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
submit the given job to the scheduler
Specified by:
jsubm in interface ClientProtocol
Overrides:
jsubm in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - the id of the job to submit
Returns:
the submitted job id, should match jobid passed in
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jsusp

public void jsusp(long jobid)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
Suspend the job with the given job id.
Specified by:
jsusp in interface ClientProtocol
Overrides:
jsusp in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - id of the job to suspend
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jwait

public void jwait(long jobid)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
Wait for the job with the given job id to complete.
Specified by:
jwait in interface ClientProtocol
Overrides:
jwait in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
jobid - id of the job to wait for
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

kill

public void kill(Job job)
          throws ServerResponseException,
                 java.io.IOException
Description copied from interface: Client
kill the given job
Specified by:
kill in interface Client
Overrides:
kill in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the job to kill
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

mdmfmt

public java.lang.String mdmfmt()
                        throws java.io.IOException,
                               ServerResponseException
Description copied from interface: ClientProtocol
get the modem format string value. the modem format string specifies how modem status information should be displayed. refer to the HylaFAX man pages, hfaxd(8c), for the format string codes.
Specified by:
mdmfmt in interface ClientProtocol
Overrides:
mdmfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

mdmfmt

public void mdmfmt(java.lang.String value)
            throws java.io.IOException,
                   ServerResponseException
Description copied from interface: ClientProtocol
set the modem format string. the modem format string is used to format the modem status information. Refer to the HylaFAX man pages, hfaxd(8c), for formatting codes.
Specified by:
mdmfmt in interface ClientProtocol
Overrides:
mdmfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - the new modem format string to use
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

mode

public void mode(char mode)
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: Client
set the transfer mode. valid mode values are MODE_* listed in the ClientProtocol class.
Specified by:
mode in interface Client
Overrides:
mode in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
mode - the new mode setting
Throws:
java.io.IOException - an io error occurred talking to the server
ServerResponseException - the server replied with an error code

noop

public void noop()
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
perform server No Operation could be used as a keep-alive
Specified by:
noop in interface ClientProtocol
Overrides:
noop in class FtpClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

open

public void open()
          throws java.net.UnknownHostException,
                 java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
open a connection to the localhost on the default port
Specified by:
open in interface ClientProtocol
Overrides:
open in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.net.UnknownHostException - cannot resolve the given hostname
java.io.IOException - IO error occurred
ServerResponseException - the server replied with an error code

open

public void open(java.lang.String host)
          throws java.net.UnknownHostException,
                 java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
open a connection to a given server at default port this is an alias for connect()
Specified by:
open in interface ClientProtocol
Overrides:
open in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
host - the hostname of the HylaFAX server
Throws:
java.net.UnknownHostException - cannot resolve the given hostname
java.io.IOException - IO error occurred
ServerResponseException - the server replied with an error code

open

public void open(java.lang.String host,
                 int port)
          throws java.net.UnknownHostException,
                 java.io.IOException,
                 ServerResponseException
Description copied from class: FtpClientProtocol
open a connection to a given server and port this is an alias for connect()
Overrides:
open in class FtpClientProtocol
Following copied from class: gnu.inet.ftp.FtpClientProtocol
Parameters:
host - the hostname of the HylaFAX server
portnumber - the port the server is listening on
Throws:
java.net.UnknownHostException - cannot resolve the given hostname
java.io.IOException - IO error occurred
ServerResponseException - the server replied with an error code

pass

public void pass(java.lang.String password)
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
send the password for this username and session
Specified by:
pass in interface ClientProtocol
Overrides:
pass in class FtpClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
password - the password to login with
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

put

public java.lang.String put(java.io.InputStream in)
                     throws java.io.IOException,
                            ServerResponseException
Description copied from interface: Client
put a file with a unique name. NOTE: this calls stou() internally.
Specified by:
put in interface Client
Overrides:
put in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
the name of the file created
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

put

public void put(java.io.InputStream in,
                java.lang.String pathname)
         throws java.io.IOException,
                ServerResponseException
Description copied from interface: Client
store a file. NOTE: this calls stor() internally.
Specified by:
put in interface Client
Overrides:
put in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
pathname - name of file to store on server (where to put the file on the server)
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error

putTemporary

public java.lang.String putTemporary(java.io.InputStream data)
                              throws java.io.IOException,
                                     ServerResponseException
Description copied from interface: Client
put a temp file, the data is stored in a uniquely named file on the server. The remote temp file is deleted when the connection is closed. NOTE: this calls stot() internally.
Specified by:
putTemporary in interface Client
Overrides:
putTemporary in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Returns:
the filename of the temp file
Throws:
java.io.IOException - io error occurred talking to the server
ServerResponseException - server replied with error code

quit

public void quit()
          throws java.io.IOException,
                 ServerResponseException
Description copied from interface: ClientProtocol
end session
Specified by:
quit in interface ClientProtocol
Overrides:
quit in class FtpClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

rcvfmt

public java.lang.String rcvfmt()
                        throws java.io.IOException,
                               ServerResponseException
Description copied from interface: ClientProtocol
get the received file output format string. The rcvfmt string specifies how received faxes (files in the rcvq directory) are displayed. Refer to the HylaFAX man pages, hfaxd(8c), for the format string codes.
Specified by:
rcvfmt in interface ClientProtocol
Overrides:
rcvfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

rcvfmt

public void rcvfmt(java.lang.String value)
            throws java.io.IOException,
                   ServerResponseException
Description copied from interface: ClientProtocol
set the receive file output format string. The rcvfmt string specifies how received faxes (files in the rcvq directory) are displayed. refer to the HylaFAX man pages, hfaxd(8c), for the format string codes.
Specified by:
rcvfmt in interface ClientProtocol
Overrides:
rcvfmt in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - the new format string
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

run

public void run()
Specified by:
run in interface java.lang.Runnable

setDebug

public void setDebug(boolean value)
Description copied from interface: Client
Sets the ConsoleLogger's debug output. Does nothing for the Lof4jLogger. Log4j needs to be configured using log4j.properties
Specified by:
setDebug in interface Client
Overrides:
setDebug in class FtpClientProtocol
Following copied from interface: gnu.hylafax.Client
Parameters:
value - new debug flag value

setPassive

public void setPassive(boolean passive)
Description copied from interface: Client
enable or disable passive transfers
Specified by:
setPassive in interface Client
Overrides:
setPassive in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
passive - indicates whether passive transfers should be used

setValid

public void setValid(boolean valid)

size

public long size(java.lang.String pathname)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 ServerResponseException
Description copied from interface: ClientProtocol
Returns the size (in bytes) of the given regular file. This is the size on the server and may not accurately represent the file size once the file has been transferred (particularly via ASCII mode)
Specified by:
size in interface ClientProtocol
Overrides:
size in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
pathname - the name of the file to get the size for
Throws:
java.io.IOException - caused by a socket IO error
ServerResponseException - caused by a server response indicating an error
java.io.FileNotFoundException - the given path does not exist

start

public void start()
Start the maintaince thread for this client.

stop

public void stop()
Stops the maintaince thread for this client.

stot

public java.lang.String stot(java.io.InputStream data)
                      throws java.io.IOException,
                             ServerResponseException
Description copied from interface: ClientProtocol
store temp file, the file is stored in a uniquely named file on the server. The remote temp file is deleted when the connection is closed.
Specified by:
stot in interface ClientProtocol
Overrides:
stot in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Returns:
the filename of the temp file
Throws:
java.io.IOException - io error occurred talking to the server
ServerResponseException - server replied with error code

submit

public void submit(Job job)
            throws ServerResponseException,
                   java.io.IOException
Description copied from interface: Client
submit the given job to the scheduler
Specified by:
submit in interface Client
Overrides:
submit in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the Job to submit
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

suspend

public void suspend(Job job)
             throws ServerResponseException,
                    java.io.IOException
Description copied from interface: Client
suspend the given job from the scheduler
Specified by:
suspend in interface Client
Overrides:
suspend in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the Job to suspend
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

tzone

public void tzone(java.lang.String value)
           throws java.io.IOException,
                  ServerResponseException
Description copied from interface: ClientProtocol
set the timezone display format valid tzone values are TZONE_GMT and TZONE_LOCAL
Specified by:
tzone in interface ClientProtocol
Overrides:
tzone in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
value - new timezone display setting
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

user

public boolean user(java.lang.String username)
             throws java.io.IOException,
                    ServerResponseException
Description copied from interface: ClientProtocol
send the user name for this session
Specified by:
user in interface ClientProtocol
Overrides:
user in class FtpClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
username - name of the user to login as
Returns:
true if a password is required, false if no password is required
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

vrfy

public java.net.InetAddress vrfy(java.lang.String dialstring)
                          throws java.io.IOException,
                                 ServerResponseException
Description copied from interface: ClientProtocol
verify dialstring handling and/or least-cost routing.
Specified by:
vrfy in interface ClientProtocol
Overrides:
vrfy in class HylaFAXClientProtocol
Following copied from interface: gnu.hylafax.ClientProtocol
Parameters:
dialstring - the dialstring to verify
Returns:
the InetAddress of the server that will handle the given dialstring
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server replied with an error code

wait

public void wait(Job job)
          throws ServerResponseException,
                 java.io.IOException
Description copied from interface: Client
wait for the given job to complete
Specified by:
wait in interface Client
Overrides:
wait in class HylaFAXClient
Following copied from interface: gnu.hylafax.Client
Parameters:
job - the job to wait for
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server