com.dynalivery.saffron.client
Class SaffronEmbeddedClient

java.lang.Object
  extended bycom.dynalivery.saffron.client.SaffronClient
      extended bycom.dynalivery.saffron.client.SaffronEmbeddedClient

public class SaffronEmbeddedClient
extends SaffronClient

This is an implementation of the Saffron client using an embedded Saffron server.


Field Summary
protected  com.dynalivery.output.FormatListManager formatListManager
           
protected  com.dynalivery.output.Formatter formatter
           
 
Fields inherited from class com.dynalivery.saffron.client.SaffronClient
appServerVendor, logService, password, properties, PROPERTY_APPSERVER_VENDOR, PROPERTY_SAFFRON_COMMAND_LINE, PROPERTY_SERVER_NAME, PROPERTY_SERVER_PORT, serverName, serverPortInt, serverPortString, serverType, snoaVersionDesired, userName
 
Constructor Summary
SaffronEmbeddedClient(java.util.Properties properties)
          construct an embedded Saffron client
 
Method Summary
 void abortJob()
          Abort the active job if possible
 boolean canAbortJob()
          Returns true if we can abort an active job
 void connect(java.lang.String userName, java.lang.String password)
          Connect to the Saffron embedded server
 void disconnect()
          Disconnect from the Saffron embedded server.
 void export(FormatOptions formatOptions, SaffronInputSource[] inputSources, DestinationOptions destinationOptions)
          Export one or more documents
 com.dynalivery.common.IdentifierPair[] getDestinationList(int fid)
          getDestinationList returns the List of Destinations Supported by this Formatter.
 com.dynalivery.common.IdentifierPair[] getFormatList()
          getFormatList returns the List of OutputFormats Supported
 boolean isConnected()
          Returns true if we are connected to Saffron
 
Methods inherited from class com.dynalivery.saffron.client.SaffronClient
createSaffronClient, createSaffronCORBAClient, createSaffronEJBClient, createSaffronEmbeddedClient, getAppServerVendor, getPrintersByName, getServerName, getServerPortString, getServerType, getUserName, log, log, setClientLogService, validateServerName, validateServerPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formatter

protected com.dynalivery.output.Formatter formatter

formatListManager

protected com.dynalivery.output.FormatListManager formatListManager
Constructor Detail

SaffronEmbeddedClient

public SaffronEmbeddedClient(java.util.Properties properties)
                      throws SaffronClientException
construct an embedded Saffron client

Method Detail

connect

public void connect(java.lang.String userName,
                    java.lang.String password)
             throws AuthenticationException,
                    SaffronSecurityException,
                    UnexpectedServerException,
                    SaffronServerUnavailableException,
                    InvalidParameterException
Connect to the Saffron embedded server

Specified by:
connect in class SaffronClient
Parameters:
userName - the user name string for the current user
password - the password string for the current user in clear text
Throws:
AuthenticationException - thrown if username/password is invalid
ServerUnavailableException - thrown if server is not available
SaffronSecurityException - thrown if the specified user is not granted access to the Saffron
InvalidParameterException - thrown if any of the parameters to this method are invalid
UnexpectedServerException
SaffronServerUnavailableException

disconnect

public void disconnect()
Disconnect from the Saffron embedded server. May only be needed if GUI tools want to support re-logging in under a different username/password.

Specified by:
disconnect in class SaffronClient

isConnected

public boolean isConnected()
Returns true if we are connected to Saffron

Specified by:
isConnected in class SaffronClient
Returns:
true if we are connected to Saffron

canAbortJob

public boolean canAbortJob()
Returns true if we can abort an active job

Specified by:
canAbortJob in class SaffronClient
Returns:
true if we can abort an active job

abortJob

public void abortJob()
Abort the active job if possible

Specified by:
abortJob in class SaffronClient

export

public void export(FormatOptions formatOptions,
                   SaffronInputSource[] inputSources,
                   DestinationOptions destinationOptions)
            throws SaffronClientException
Export one or more documents

Specified by:
export in class SaffronClient
Parameters:
formatOptions - the FormatOptions for this export
inputSources - a SaffronInputSource array defining the documents to be exported
destinationOptions - the DestinationOptions for this export
Throws:
SaffronClientException

getFormatList

public com.dynalivery.common.IdentifierPair[] getFormatList()
                                                     throws SaffronClientException
getFormatList returns the List of OutputFormats Supported

Specified by:
getFormatList in class SaffronClient
Returns:
IdentifierPair[]
Throws:
SaffronClientException

getDestinationList

public com.dynalivery.common.IdentifierPair[] getDestinationList(int fid)
                                                          throws SaffronClientException
getDestinationList returns the List of Destinations Supported by this Formatter.

Specified by:
getDestinationList in class SaffronClient
Parameters:
fid - the format Id for which we need the list of destinations.
Returns:
IdentifierPair[]
Throws:
SaffronClientException