gnu.hylafax.job
Class Job

java.lang.Object
  |
  +--gnu.hylafax.job.Job
All Implemented Interfaces:
Job
Direct Known Subclasses:
ThreadSafeJob

public class Job
extends java.lang.Object
implements Job

This class is a light, unsynchronized implementation of gnu.hylafax.Job.

Version:
$Id: Job.java,v 1.2 2005/06/02 03:37:23 sjardine Exp $
Author:
$Author: sjardine $
See Also:
ClientProtocol, Client, Job

Field Summary
static java.lang.String CHOP_DEFAULT
           
protected  Client client
           
static java.lang.String NOTIFY_ALL
           
static java.lang.String NOTIFY_DONE
           
static java.lang.String NOTIFY_NONE
           
static java.lang.String NOTIFY_REQUEUE
           
static int PRIORITY_BULK
           
static int PRIORITY_HIGH
           
static int PRIORITY_NORMAL
           
static int RESOLUTION_LOW
           
static int RESOLUTION_MEDIUM
           
 
Constructor Summary
Job(Client c)
           
Job(Client c, long id)
           
 
Method Summary
 void addDocument(java.lang.String value)
           
 int getChopThreshold()
           
 java.lang.String getDialstring()
           
 java.lang.String getDocumentName()
           
 java.lang.String getFromUser()
           
 long getId()
          get the job-id of this Job instance.
 java.lang.String getJobInfo()
          Get JobInfo attribute.
 java.lang.String getKilltime()
           
 int getMaximumDials()
           
 int getMaximumTries()
           
 java.lang.String getNotifyAddress()
           
 java.lang.String getNotifyType()
           
 java.lang.String getPageChop()
           
 java.awt.Dimension getPageDimension()
           
 int getPageLength()
           
 int getPageWidth()
           
 int getPriority()
           
 java.lang.String getProperty(java.lang.String key)
          Get the value for an arbitrary property for this job.
 java.lang.String getRetrytime()
           
 java.lang.String getTagline()
          Get TagLine format attribute.
 boolean getUseTagline()
          Get the UseTagLine attribute.
 int getVerticalResolution()
           
 void setChopThreshold(int value)
           
 void setDialstring(java.lang.String value)
           
 void setFromUser(java.lang.String value)
           
 void setJobInfo(java.lang.String value)
          Set the JobInfo attribute.
 void setKilltime(java.lang.String value)
           
 void setMaximumDials(int value)
           
 void setMaximumTries(int value)
           
 void setNotifyAddress(java.lang.String value)
           
 void setNotifyType(java.lang.String value)
          set the notification type.
 void setPageChop(java.lang.String value)
           
 void setPageDimension(java.awt.Dimension value)
          Set the job's pagesize.
 void setPageLength(int length)
           
 void setPageWidth(int width)
           
 void setPriority(int value)
           
 void setProperty(java.lang.String property, int value)
          Set any arbitrary property on this job to an integer value.
 void setProperty(java.lang.String parameter, java.lang.String value)
          Set any arbitrary property on this job.
 void setRetrytime(java.lang.String value)
           
 void setSendTime(java.util.Date sendTime)
          Set the SENDTIME attribute.
 void setSendTime(java.lang.String sendTime)
          Set the SENDTIME attribute.
 void setTagline(java.lang.String value)
          Set the TagLine format attribute.
 void setUseTagline(boolean value)
          Set the UseTagLine format attribute.
 void setVerticalResolution(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

protected Client client

PRIORITY_NORMAL

public static int PRIORITY_NORMAL

PRIORITY_BULK

public static int PRIORITY_BULK

PRIORITY_HIGH

public static int PRIORITY_HIGH

RESOLUTION_LOW

public static int RESOLUTION_LOW

RESOLUTION_MEDIUM

public static int RESOLUTION_MEDIUM

NOTIFY_NONE

public static java.lang.String NOTIFY_NONE

NOTIFY_DONE

public static java.lang.String NOTIFY_DONE

NOTIFY_REQUEUE

public static java.lang.String NOTIFY_REQUEUE

NOTIFY_ALL

public static java.lang.String NOTIFY_ALL

CHOP_DEFAULT

public static java.lang.String CHOP_DEFAULT
Constructor Detail

Job

public Job(Client c)
    throws ServerResponseException,
           java.io.IOException

Job

public Job(Client c,
           long id)
    throws ServerResponseException,
           java.io.IOException
Method Detail

getFromUser

public java.lang.String getFromUser()
                             throws ServerResponseException,
                                    java.io.IOException
Specified by:
getFromUser in interface Job

getKilltime

public java.lang.String getKilltime()
                             throws ServerResponseException,
                                    java.io.IOException
Specified by:
getKilltime in interface Job

getMaximumDials

public int getMaximumDials()
                    throws ServerResponseException,
                           java.io.IOException
Specified by:
getMaximumDials in interface Job

getMaximumTries

public int getMaximumTries()
                    throws ServerResponseException,
                           java.io.IOException
Specified by:
getMaximumTries in interface Job

getPriority

public int getPriority()
                throws ServerResponseException,
                       java.io.IOException
Specified by:
getPriority in interface Job

getDialstring

public java.lang.String getDialstring()
                               throws ServerResponseException,
                                      java.io.IOException
Specified by:
getDialstring in interface Job

getNotifyAddress

public java.lang.String getNotifyAddress()
                                  throws ServerResponseException,
                                         java.io.IOException
Specified by:
getNotifyAddress in interface Job

getVerticalResolution

public int getVerticalResolution()
                          throws ServerResponseException,
                                 java.io.IOException
Specified by:
getVerticalResolution in interface Job

getPageDimension

public java.awt.Dimension getPageDimension()
                                    throws ServerResponseException,
                                           java.io.IOException
Specified by:
getPageDimension in interface Job

getPageWidth

public int getPageWidth()
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
getPageWidth in interface Job

getPageLength

public int getPageLength()
                  throws ServerResponseException,
                         java.io.IOException
Specified by:
getPageLength in interface Job

getNotifyType

public java.lang.String getNotifyType()
                               throws ServerResponseException,
                                      java.io.IOException
Specified by:
getNotifyType in interface Job

getPageChop

public java.lang.String getPageChop()
                             throws ServerResponseException,
                                    java.io.IOException
Specified by:
getPageChop in interface Job

getChopThreshold

public int getChopThreshold()
                     throws ServerResponseException,
                            java.io.IOException
Specified by:
getChopThreshold in interface Job

getDocumentName

public java.lang.String getDocumentName()
                                 throws ServerResponseException,
                                        java.io.IOException
Specified by:
getDocumentName in interface Job

getRetrytime

public java.lang.String getRetrytime()
                              throws ServerResponseException,
                                     java.io.IOException
Specified by:
getRetrytime in interface Job

getProperty

public java.lang.String getProperty(java.lang.String key)
                             throws ServerResponseException,
                                    java.io.IOException
Get the value for an arbitrary property for this job. Developers using this method should be familiar with the HylaFAX client protocol in order to provide the correct key values and how to interpret the values returned.
Specified by:
getProperty in interface Job
Returns:
a String value for the given property key
Throws:
ServerResponseException - the server responded with an error. This is likely due to a protocol error.
java.io.IOException - an i/o error occured

getId

public long getId()
get the job-id of this Job instance.
Specified by:
getId in interface Job
Returns:
job id

setFromUser

public void setFromUser(java.lang.String value)
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
setFromUser in interface Job

setKilltime

public void setKilltime(java.lang.String value)
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
setKilltime in interface Job

setMaximumDials

public void setMaximumDials(int value)
                     throws ServerResponseException,
                            java.io.IOException
Specified by:
setMaximumDials in interface Job

setMaximumTries

public void setMaximumTries(int value)
                     throws ServerResponseException,
                            java.io.IOException
Specified by:
setMaximumTries in interface Job

setPriority

public void setPriority(int value)
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
setPriority in interface Job

setDialstring

public void setDialstring(java.lang.String value)
                   throws ServerResponseException,
                          java.io.IOException
Specified by:
setDialstring in interface Job

setNotifyAddress

public void setNotifyAddress(java.lang.String value)
                      throws ServerResponseException,
                             java.io.IOException
Specified by:
setNotifyAddress in interface Job

setVerticalResolution

public void setVerticalResolution(int value)
                           throws ServerResponseException,
                                  java.io.IOException
Specified by:
setVerticalResolution in interface Job

setPageDimension

public void setPageDimension(java.awt.Dimension value)
                      throws ServerResponseException,
                             java.io.IOException
Description copied from interface: Job
Set the job's pagesize.
Specified by:
setPageDimension in interface Job
Following copied from interface: gnu.hylafax.Job
See Also:
for common pagesizes

setPageWidth

public void setPageWidth(int width)
                  throws ServerResponseException,
                         java.io.IOException
Specified by:
setPageWidth in interface Job

setPageLength

public void setPageLength(int length)
                   throws ServerResponseException,
                          java.io.IOException
Specified by:
setPageLength in interface Job

getJobInfo

public java.lang.String getJobInfo()
                            throws ServerResponseException,
                                   java.io.IOException
Get JobInfo attribute. JobInfo is an identifying string associated with the job.
Specified by:
getJobInfo in interface Job

getTagline

public java.lang.String getTagline()
                            throws ServerResponseException,
                                   java.io.IOException
Get TagLine format attribute. The TagLine
Specified by:
getTagline in interface Job

getUseTagline

public boolean getUseTagline()
                      throws ServerResponseException,
                             java.io.IOException
Get the UseTagLine attribute. The TagLine
Specified by:
getUseTagline in interface Job

setNotifyType

public void setNotifyType(java.lang.String value)
                   throws ServerResponseException,
                          java.io.IOException
set the notification type. For possible values, see the NOTIFY_* members of this class.
Specified by:
setNotifyType in interface Job
Parameters:
value - the new notification type
Throws:
ServerResponseException - the server responded with an error. This is likely a protocol violation.
java.io.IOException - an IO error occurred while communicating with the server

setPageChop

public void setPageChop(java.lang.String value)
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
setPageChop in interface Job

setChopThreshold

public void setChopThreshold(int value)
                      throws ServerResponseException,
                             java.io.IOException
Specified by:
setChopThreshold in interface Job

addDocument

public void addDocument(java.lang.String value)
                 throws ServerResponseException,
                        java.io.IOException
Specified by:
addDocument in interface Job

setUseTagline

public void setUseTagline(boolean value)
                   throws ServerResponseException,
                          java.io.IOException
Description copied from interface: Job
Set the UseTagLine format attribute. This is an
Specified by:
setUseTagline in interface Job

setRetrytime

public void setRetrytime(java.lang.String value)
                  throws ServerResponseException,
                         java.io.IOException
Specified by:
setRetrytime in interface Job

setJobInfo

public void setJobInfo(java.lang.String value)
                throws ServerResponseException,
                       java.io.IOException
Set the JobInfo attribute. This is an identifying string associated with each job.
Specified by:
setJobInfo in interface Job

setTagline

public void setTagline(java.lang.String value)
                throws ServerResponseException,
                       java.io.IOException
Set the TagLine format attribute. This property specifies the format of the tagline rendered at the top of each page of the transmitted FAX. Tagline format strings are documented in config(5F). If you use this, you will probably want to use setUseTagline()
Specified by:
setTagline in interface Job

setProperty

public void setProperty(java.lang.String parameter,
                        java.lang.String value)
                 throws ServerResponseException,
                        java.io.IOException
Set any arbitrary property on this job. In order to use this method, developers should be familiar with the HylaFAX client protocol.
Specified by:
setProperty in interface Job
Throws:
ServerResponseException - the server responded with an error code. This is likely a protocol violation.
java.io.IOException - an i/o error occured

setProperty

public void setProperty(java.lang.String property,
                        int value)
                 throws ServerResponseException,
                        java.io.IOException
Set any arbitrary property on this job to an integer value. In order to use this method, developers should be familiar with the HylaFAX client protocol.
Specified by:
setProperty in interface Job
Throws:
ServerResponseException - the server responded with an error code. This is likely a protocol violation.
java.io.IOException - an i/o error occured

setSendTime

public void setSendTime(java.util.Date sendTime)
                 throws ServerResponseException,
                        java.io.IOException
Description copied from interface: Job
Set the SENDTIME attribute. This allows for queuing up faxes and sending them at a specific time.
Specified by:
setSendTime in interface Job
Following copied from interface: gnu.hylafax.Job
Parameters:
sendTime -  
Throws:
ServerResponseException - the server responded with an error code. This is likely a protocol violation.
java.io.IOException - an i/o error occured

setSendTime

public void setSendTime(java.lang.String sendTime)
                 throws ServerResponseException,
                        java.io.IOException
Description copied from interface: Job
Set the SENDTIME attribute. Must be in the format yyyyMMddHHmm and in GMT time. This allows for queuing up faxes and sending them at a specific time.
Specified by:
setSendTime in interface Job
Following copied from interface: gnu.hylafax.Job
Parameters:
sendTime -  
Throws:
ServerResponseException - the server responded with an error code. This is likely a protocol violation.
java.io.IOException - an i/o error occured