gnu.hylafax
Interface ClientProtocol

All Known Subinterfaces:
Client, PooledClient
All Known Implementing Classes:
HylaFAXClientProtocol

public interface ClientProtocol

Author:
Steven Jardine

Field Summary
static java.lang.String NOTIFY_ALL
          Notify on all job state changes.
static java.lang.String NOTIFY_DONE
          Notify when the job is done.
static java.lang.String NOTIFY_NONE
          Do not notify when the job is done or requeued.
static java.lang.String NOTIFY_REQUEUE
          Notify when the job is requeued.
static java.lang.String TZONE_GMT
          use the GMT timezone for date fields.
static java.lang.String TZONE_LOCAL
          use the local timezone for date fields.
 
Method Summary
 void admin(java.lang.String password)
          establish administrator privileges given password
 java.lang.String filefmt()
          get the FILEFMT string value.
 void filefmt(java.lang.String value)
          set the FILEFMT string value.
 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 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.
 java.lang.String mdmfmt()
          get the modem format string value.
 void mdmfmt(java.lang.String value)
          set the modem format string.
 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 pass(java.lang.String password)
          send the password for this username and session
 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.
 long size(java.lang.String pathname)
          Returns the size (in bytes) of the given regular file.
 java.lang.String stot(java.io.InputStream data)
          store temp file, the file is stored in a uniquely named file on the server.
 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.
 

Field Detail

NOTIFY_ALL

public static final java.lang.String NOTIFY_ALL
Notify on all job state changes. Used with the JPARM NOTIFY command.

NOTIFY_DONE

public static final java.lang.String NOTIFY_DONE
Notify when the job is done. Used with the JPARM NOTIFY command.

NOTIFY_NONE

public static final java.lang.String NOTIFY_NONE
Do not notify when the job is done or requeued. Used with the JPARM NOTIFY command.

NOTIFY_REQUEUE

public static final java.lang.String NOTIFY_REQUEUE
Notify when the job is requeued. Used with the JPARM NOTIFY command.

TZONE_GMT

public static final java.lang.String TZONE_GMT
use the GMT timezone for date fields.

TZONE_LOCAL

public static final java.lang.String TZONE_LOCAL
use the local timezone for date fields.
Method Detail

admin

public void admin(java.lang.String password)
           throws java.io.IOException,
                  ServerResponseException
establish administrator privileges given password
Parameters:
password - administrator password
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

filefmt

public java.lang.String filefmt()
                         throws java.io.IOException,
                                ServerResponseException
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.
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
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.
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

idle

public long idle()
          throws java.io.IOException,
                 ServerResponseException
get the current idle timeout in seconds
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
set the idle timeout value to the given number of seconds
Parameters:
timeout - new timeout value in seconds (MAX = 7200)
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

jdele

public void jdele(long jobid)
           throws java.io.IOException,
                  ServerResponseException
delete the given job this can be called on a suspended or done job.
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
interrupt the given job id
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
kill the job with the given job id
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
create a new job. get the new job id using the job() method. The new job is the current job.
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
get the current job id 0 indicates the current job id is "default" value
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
set the current job id
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
get the job format string. read the HylaFAX man pages, hfaxd(8c), for format codes.
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
set the job format string. read the HylaFAX man pages, hfaxd(8c), for format codes.
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
get job parameters of the current job
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
set job parameters on the current job
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
set job parameters on the current job
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
set job parameters on the current job
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
set job parameters on the current job
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
reset the state of the current job. get/set the current job id via the 'job' method
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
submit the current job to the scheduler
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
submit the given job to the scheduler
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
Suspend the job with the given job id.
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
Wait for the job with the given job id to complete.
Parameters:
jobid - id of the job to wait for
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

mdmfmt

public java.lang.String mdmfmt()
                        throws java.io.IOException,
                               ServerResponseException
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.
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
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.
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

noop

public void noop()
          throws java.io.IOException,
                 ServerResponseException
perform server No Operation could be used as a keep-alive
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
open a connection to the localhost on the default port
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
open a connection to a given server at default port this is an alias for connect()
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

pass

public void pass(java.lang.String password)
          throws java.io.IOException,
                 ServerResponseException
send the password for this username and session
Parameters:
password - the password to login with
Throws:
java.io.IOException - io error occurred
ServerResponseException - server replied with an error code

quit

public void quit()
          throws java.io.IOException,
                 ServerResponseException
end session
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
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.
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
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.
Parameters:
value - the new format string
Throws:
java.io.IOException - a socket IO error occurred
ServerResponseException - the server responded with an error code

size

public long size(java.lang.String pathname)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 ServerResponseException
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)
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

stot

public java.lang.String stot(java.io.InputStream data)
                      throws java.io.IOException,
                             ServerResponseException
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.
Returns:
the filename of the temp file
Throws:
java.io.IOException - io error occurred talking to the server
ServerResponseException - server replied with error code

tzone

public void tzone(java.lang.String value)
           throws java.io.IOException,
                  ServerResponseException
set the timezone display format valid tzone values are TZONE_GMT and TZONE_LOCAL
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
send the user name for this session
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
verify dialstring handling and/or least-cost routing.
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