| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elixirtech.ers2.client.ERSClient
public class ERSClient
Elixir Repertoire Server Client provides a light weight connection to the Repertoire Server. It provides basic functionalities as listing file system, querying for report deployed on the server repository , querying dynamic parameters in the report, datasource file and generate reports. You also invoke return of data from data source or trigger data store to push data to a location. The triggering of data store requires an ensemble data store license for repertoire server.
| Field Summary | |
|---|---|
static java.lang.String | 
DEFAULT_CONTENT_TYPE
Content Type for Posting to ensure non-ASCII characters are handled properly  | 
static org.apache.log4j.Logger | 
m_Log
 | 
static short | 
MODE_NEW_CONNECTION
Every request is a new connection to the server.  | 
static short | 
MODE_REUSE_CONNECTION
Keep the current connection alive and submit request through the same connection.  | 
static int | 
PREFERRED_PORT
Preferred server port.  | 
static java.lang.String | 
PREFERRED_TARGET
Preferred target name.  | 
static int | 
PREFERRED_TIMEOUT
Preferred timeout  | 
| Constructor Summary | |
|---|---|
ERSClient()
Default Constructor.  | 
|
ERSClient(java.lang.String host,
          int port,
          java.lang.String user,
          java.lang.String password)
Constructor.Creates a new ERSClient with server host name/ IP address, user name and password.  | 
|
ERSClient(java.lang.String host,
          int port,
          java.lang.String user,
          java.lang.String password,
          short mode,
          int timeout)
Deprecated. Use the version without mode and timeout as they are now ignored  | 
|
| Method Summary | |
|---|---|
 void | 
close()
 | 
 org.apache.commons.httpclient.HttpClient | 
connect()
 | 
 IJobInfo | 
generateData(java.lang.String dataName,
             java.io.OutputStream os,
             java.util.Properties props)
Invoke a datasource to generate data.  | 
 short | 
getConnectionMode()
Get ConnectionMode  | 
 java.lang.String[] | 
getFiles(java.lang.String fs)
Get the files available in a filesystem.  | 
 IFileSystem | 
getFileSystem(java.lang.String fs)
Get a Filesystem from the server  | 
 java.lang.String[] | 
getFileSystems()
Get the filesystems available on the server.  | 
 java.lang.String | 
getHost()
Get server host name.  | 
 java.io.InputStream | 
getInputStream(java.lang.String filename)
Get the contents of a file from the server.  | 
 java.lang.String[] | 
getMIMETypes()
Get the mime-types available on the server.  | 
 Parameter[] | 
getParameters(java.lang.String file)
Query the parameters needed by a particular server object (report, datasource or trigger)  | 
 java.lang.String | 
getPassword()
Get password.  | 
 int | 
getPort()
Get port set.  | 
 java.lang.String[] | 
getReports(java.lang.String fs)
Get the reports available in a filesystem.  | 
 java.lang.String | 
getServerURL()
 | 
 int | 
getTimeout()
Get timeout.  | 
 java.lang.String | 
getUserName()
Get user name.  | 
 boolean | 
isAutoEscape()
Deprecated. - the protocol now ensures correct transmission of all characters  | 
 boolean | 
isConnected()
Deprecated. - connection status is now controlled internally  | 
 boolean | 
isSecure()
Get the current value of the Secure mode.  | 
 IJobInfo | 
renderDocX(java.lang.String report,
           java.lang.String format,
           java.io.OutputStream osm,
           java.util.Properties properties)
Send a request to render a docx report as a different back to the client.  | 
 IJobInfo | 
renderReport(java.lang.String report,
             java.lang.String mimeType,
             java.io.OutputStream osm,
             java.util.Properties properties)
Send a request to render a report back to the client.  | 
 IJobInfo | 
renderReport(java.lang.String report,
             java.lang.String mimeType,
             java.io.OutputStream os,
             java.util.Properties properties,
             java.lang.String target)
Deprecated. If requesting a report to be returned, use the renderReport with no target. Else if sending a report to a target, use the renderReport with no output stream. This overloaded version handles both cases, but is more confusing, hence deprecated.  | 
 IJobInfo | 
renderReport(java.lang.String report,
             java.lang.String mimeType,
             java.util.Properties properties,
             java.lang.String target)
Send a request to render a report.  | 
 IJobInfo | 
renderReport(java.lang.String report,
             java.lang.String mimeType,
             java.util.Properties properties,
             java.lang.String target,
             java.util.Properties targetProperties)
Send a request to render a report.  | 
 void | 
setAutoEscape(boolean b)
Deprecated. - the protocol now ensures correct transmission of all characters  | 
 void | 
setConnectionMode(short mode)
Set Connection Mode.  | 
 void | 
setHost(java.lang.String host)
Set server host name.  | 
 void | 
setPassword(java.lang.String password)
Set password.  | 
 void | 
setPort(int port)
Set port.  | 
 void | 
setSecure(boolean secure)
Set Secure mode.  | 
 void | 
setSecure(java.io.File keystore,
          java.lang.String keystorePassword,
          java.io.File truststore,
          java.lang.String truststorePassword)
Set Secure mode.  | 
 void | 
setTimeout(int timeout)
With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time (in milliseconds).  | 
 void | 
setUserName(java.lang.String userName)
Set user name.  | 
 boolean | 
shutdown()
Shutdown the server - only available with admin rights  | 
 IJobInfo | 
triggerJob(java.lang.String jobName,
           java.util.Properties props)
Triggers a job on the server.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String DEFAULT_CONTENT_TYPE
public static final short MODE_NEW_CONNECTION
public static final short MODE_REUSE_CONNECTION
public static final int PREFERRED_PORT
public static final int PREFERRED_TIMEOUT
public static final java.lang.String PREFERRED_TARGET
public static final org.apache.log4j.Logger m_Log
| Constructor Detail | 
|---|
public ERSClient()
public ERSClient(java.lang.String host,
                 int port,
                 java.lang.String user,
                 java.lang.String password)
host - The server nameport - The server portuser - The User namepassword - The User password
public ERSClient(java.lang.String host,
                 int port,
                 java.lang.String user,
                 java.lang.String password,
                 short mode,
                 int timeout)
host - The server nameport - The server portuser - The User namepassword - The User passwordmode - Not used now the underlying transport is HTTPtimeout - Not used now the underlying transport is HTTP| Method Detail | 
|---|
public void setAutoEscape(boolean b)
b - The auto-escape flagpublic boolean isAutoEscape()
public boolean shutdown()
                 throws com.elixirtech.net.NetException
com.elixirtech.net.NetException
public Parameter[] getParameters(java.lang.String file)
                          throws com.elixirtech.net.NetException
com.elixirtech.net.NetException
public IFileSystem getFileSystem(java.lang.String fs)
                          throws com.elixirtech.net.NetException
com.elixirtech.net.NetException
public java.lang.String[] getFileSystems()
                                  throws com.elixirtech.net.NetException
com.elixirtech.net.NetException
public java.lang.String[] getFiles(java.lang.String fs)
                            throws com.elixirtech.net.NetException
fs - The filesystem.
com.elixirtech.net.NetException
public java.io.InputStream getInputStream(java.lang.String filename)
                                   throws com.elixirtech.net.NetException
filename - The filename to read from
com.elixirtech.net.NetException
public java.lang.String[] getReports(java.lang.String fs)
                              throws com.elixirtech.net.NetException
fs - The filesystem
com.elixirtech.net.NetException
public java.lang.String[] getMIMETypes()
                                throws com.elixirtech.net.NetException
com.elixirtech.net.NetException
public IJobInfo renderDocX(java.lang.String report,
                           java.lang.String format,
                           java.io.OutputStream osm,
                           java.util.Properties properties)
                    throws com.elixirtech.net.NetException
report - The docx report nameformat - The format as docx, pdf, xps or docx_pdf_zip.osm - Output streamproperties - properties to pass to report - may be null
com.elixirtech.net.NetException
public IJobInfo renderReport(java.lang.String report,
                             java.lang.String mimeType,
                             java.io.OutputStream osm,
                             java.util.Properties properties)
                      throws com.elixirtech.net.NetException
report - The report namemimeType - The mime type.osm - Output streamproperties - properties to pass to report - may be null
com.elixirtech.net.NetException
public IJobInfo renderReport(java.lang.String report,
                             java.lang.String mimeType,
                             java.util.Properties properties,
                             java.lang.String target)
                      throws com.elixirtech.net.NetException
report - The report namemimeType - The mime type.properties - properties to pass to report - may be nulltarget - the name of the report destination
com.elixirtech.net.NetException
public IJobInfo renderReport(java.lang.String report,
                             java.lang.String mimeType,
                             java.util.Properties properties,
                             java.lang.String target,
                             java.util.Properties targetProperties)
                      throws com.elixirtech.net.NetException
report - The report namemimeType - The mime type.properties - properties to pass to report - may be null.target - the name of the report destinationtargetProperties - Target properties - may be null.
com.elixirtech.net.NetException
public IJobInfo renderReport(java.lang.String report,
                             java.lang.String mimeType,
                             java.io.OutputStream os,
                             java.util.Properties properties,
                             java.lang.String target)
                      throws com.elixirtech.net.NetException
report - The report namemimeType - The mime type.properties - properties to pass to report - may be null.os - The output stream used if target is a ReplyTarget (eg. "me")target - the name of the report destination
com.elixirtech.net.NetException
public IJobInfo triggerJob(java.lang.String jobName,
                           java.util.Properties props)
                    throws com.elixirtech.net.NetException
jobName - The job nameprops - Any parameters required by the job - may be null
com.elixirtech.net.NetException
public IJobInfo generateData(java.lang.String dataName,
                             java.io.OutputStream os,
                             java.util.Properties props)
                      throws com.elixirtech.net.NetException
dataName - file The data source nameos - Output stream return data. May be null only if writing to a DataStoreprops - properties of the data file. May be null. To trigger a DataStore to generate 
 on the server. Add a property "datastore" with the value being the name of the DataStore.
com.elixirtech.net.NetExceptionpublic void close()
public void setHost(java.lang.String host)
host - The server namepublic java.lang.String getHost()
public void setPort(int port)
port - The server portpublic int getPort()
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName - The userpublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - The passwordpublic void setSecure(boolean secure)
secure - The secure mode
public void setSecure(java.io.File keystore,
                      java.lang.String keystorePassword,
                      java.io.File truststore,
                      java.lang.String truststorePassword)
               throws java.io.IOException
keystore - The client keystorekeystorePassword - The client keystore passwordtruststore - The client truststoretruststorePassword - The client truststore password
java.io.IOExceptionpublic boolean isSecure()
public int getTimeout()
public short getConnectionMode()
public void setConnectionMode(short mode)
mode - Connection mode.public boolean isConnected()
public void setTimeout(int timeout)
timeout - in milliseonds
public org.apache.commons.httpclient.HttpClient connect()
                                                 throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getServerURL()
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||