gnu.hylafax
Interface Client

All Superinterfaces:
ClientProtocol
All Known Subinterfaces:
PooledClient
All Known Implementing Classes:
HylaFAXClient

public interface Client
extends ClientProtocol

Author:
Steven Jardine

Fields inherited from interface gnu.hylafax.ClientProtocol
NOTIFY_ALL, NOTIFY_DONE, NOTIFY_NONE, NOTIFY_REQUEUE, TZONE_GMT, TZONE_LOCAL
 
Method Summary
 Job createJob()
          create a new job in the server
 void delete(Job job)
          delete the given done or suspended job
 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
 void interrupt(Job job)
          interrupt the given job
 void kill(Job job)
          kill the given job
 void mode(char mode)
          set the transfer mode.
 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 setDebug(boolean value)
          Sets the ConsoleLogger's debug output.
 void setPassive(boolean passive)
          enable or disable passive transfers
 void submit(Job job)
          submit the given job to the scheduler
 void suspend(Job job)
          suspend the given job from the scheduler
 void wait(Job job)
          wait for the given job to complete
 
Methods inherited from interface gnu.hylafax.ClientProtocol
admin, filefmt, filefmt, idle, idle, jdele, jintr, jkill, jnew, job, job, jobfmt, jobfmt, jparm, jparm, jparm, jparm, jparm, jrest, jsubm, jsubm, jsusp, jwait, mdmfmt, mdmfmt, noop, open, open, pass, quit, rcvfmt, rcvfmt, size, stot, tzone, user, vrfy
 

Method Detail

createJob

public Job createJob()
              throws ServerResponseException,
                     java.io.IOException
create a new job in the server
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
delete the given done or suspended job
Parameters:
job - the (done or suspended) job to delete
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

get

public void get(java.lang.String path,
                java.io.OutputStream out)
         throws java.io.IOException,
                java.io.FileNotFoundException,
                ServerResponseException
GET the named file, FTP style.
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
get a Job instance for the given job id
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
get a long-style listing of files in the current directory. NOTE: this calls the list() method internally with the "." path.
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
get a long-style listing of files in the given directory. NOTE: this calls the list() method internally.
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
get name list of files in the current directory. Similar to getList() but returns filenames only where getList() returns other, system dependant information.
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
get name list of files in the given directory. Similar to getList() but returns filenames only where getList() returns other, system dependant information.
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()
check whether passive transfers have been enabled
Returns:
true if passive transfers are enabled, false otherwise

interrupt

public void interrupt(Job job)
               throws ServerResponseException,
                      java.io.IOException
interrupt the given job
Parameters:
job - the job to interrupt
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

kill

public void kill(Job job)
          throws ServerResponseException,
                 java.io.IOException
kill the given job
Parameters:
job - the job to kill
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

mode

public void mode(char mode)
          throws java.io.IOException,
                 ServerResponseException
set the transfer mode. valid mode values are MODE_* listed in the ClientProtocol class.
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

put

public java.lang.String put(java.io.InputStream in)
                     throws java.io.IOException,
                            ServerResponseException
put a file with a unique name. NOTE: this calls stou() internally.
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
store a file. NOTE: this calls stor() internally.
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
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.
Returns:
the filename of the temp file
Throws:
java.io.IOException - io error occurred talking to the server
ServerResponseException - server replied with error code

setDebug

public void setDebug(boolean value)
Sets the ConsoleLogger's debug output. Does nothing for the Lof4jLogger. Log4j needs to be configured using log4j.properties
Parameters:
value - new debug flag value

setPassive

public void setPassive(boolean passive)
enable or disable passive transfers
Parameters:
passive - indicates whether passive transfers should be used

submit

public void submit(Job job)
            throws ServerResponseException,
                   java.io.IOException
submit the given job to the scheduler
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
suspend the given job from the scheduler
Parameters:
job - the Job to suspend
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server

wait

public void wait(Job job)
          throws ServerResponseException,
                 java.io.IOException
wait for the given job to complete
Parameters:
job - the job to wait for
Throws:
ServerResponseException -  
java.io.IOException - an IO error occurred while communicating with the server