com.dynalivery.harmoni
Class RepositoryClient

java.lang.Object
  |
  +--com.dynalivery.harmoni.RepositoryClient

public class RepositoryClient
extends java.lang.Object

The RepositoryClient class provides several methods for the client to interact with the Repository without the need to have a PCREEngine or a PCREJob object. For example, if report output was previously produced and placed in the repository, the client can use the RepositoryClient class to easily retrieve that output to the client machine from the repository without the need to instantiate a HarmoniApplicationClient object, connect, open an engine, etc. The RepositoryClient is thread safe and may be shared by multiple client threads when interacting with the repository but this is not recommended for performance reasons. If a RepositoryClient object is shared by multiple threads, a thread should not call the logOutRepository method if other threads are still using that RepositoryClient object to interact with the repository.


Field Summary
static java.lang.String WAS_VENDOR_JBOSS_2_4
           
static java.lang.String WAS_VENDOR_JRUN_3_1
           
static java.lang.String WAS_VENDOR_ORACLE_9iAS
           
static java.lang.String WAS_VENDOR_SILVERSTREAM_3_7
           
static java.lang.String WAS_VENDOR_WEBLOGIC_6_1
           
static java.lang.String WAS_VENDOR_WEBSPHERE_4_0
           
 
Constructor Summary
RepositoryClient(java.lang.String repositoryHost, java.lang.String repositoryWASVendor, java.lang.String repositoryWASPort)
          Constructor for a RepositoryClient.
 
Method Summary
 void createFolderInRepository(java.lang.String repositoryPath, SecurityOptions folderSecOptions, SecurityOptions defaultFileSecOptions, ExpirationOptions expirationOptions)
          Creates a new folder in the repository with the given attributes.
 void deleteDorDataInRepository(java.lang.String repositoryPath)
          Delete the data file from the repository.
 void deleteFolderInRepository(java.lang.String repositoryPath)
          Deletes a folder and its recursive contents from the repository.
 void deleteOutputFromRepository(java.lang.String repositoryPath)
          Delete the single output file from the repository.
 boolean folderExists(java.lang.String folderPath)
          Used to test for the existence of the repository folder.
 void getOutputFolderContentsFromRepository(java.lang.String repositoryFolder, java.lang.String clientDirectory)
          Retrieves the output folder and all recursive contents from the repository and writes it to the client machine in the client machine folder specified.
 void getOutputFromRepository(java.lang.String repositoryPath, java.lang.String clientPath)
          Retrieves the single output file from the repository and writes it to the client machine at the path specified.
 java.io.InputStream getOutputFromRepositoryAsStream(java.lang.String repositoryPath)
          Retrieves the single output file from the repository and as an input stream.
 void logInRepository(java.lang.String username, java.lang.String password)
          Used to log the given user into the repository.
 void logOutRepository()
          Should be called in order to free resources when the user is finished using the RepositoryClient object to interact with the repository.
 void storeDorDataInRepository(java.lang.String repositoryPath, DORDataSet dataSet, SecurityOptions dataSecOptions, ExpirationOptions expirationOptions, boolean overwrite)
          Stores the data object into the repository for later use as a data source for a report.
 void storeDorDataInRepository(java.lang.String repositoryPath, java.sql.ResultSet resultSet, SecurityOptions dataSecOptions, ExpirationOptions expirationOptions, boolean overwrite)
          Stores the data object into the repository for later use as a data source for a report.
 void storeDorDataInRepository(java.lang.String repositoryPath, java.lang.String xmlFilePath, SecurityOptions dataSecOptions, ExpirationOptions expirationOptions, boolean overwrite)
          Stores the data object into the repository for later use as a data source for a report.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAS_VENDOR_WEBLOGIC_6_1

public static final java.lang.String WAS_VENDOR_WEBLOGIC_6_1

WAS_VENDOR_WEBSPHERE_4_0

public static final java.lang.String WAS_VENDOR_WEBSPHERE_4_0

WAS_VENDOR_SILVERSTREAM_3_7

public static final java.lang.String WAS_VENDOR_SILVERSTREAM_3_7

WAS_VENDOR_JRUN_3_1

public static final java.lang.String WAS_VENDOR_JRUN_3_1

WAS_VENDOR_JBOSS_2_4

public static final java.lang.String WAS_VENDOR_JBOSS_2_4

WAS_VENDOR_ORACLE_9iAS

public static final java.lang.String WAS_VENDOR_ORACLE_9iAS
Constructor Detail

RepositoryClient

public RepositoryClient(java.lang.String repositoryHost,
                        java.lang.String repositoryWASVendor,
                        java.lang.String repositoryWASPort)
                 throws HarmoniClientError
Constructor for a RepositoryClient.
Parameters:
repositoryHost - The host name or ip address of the web application server machine where the repository is running.
repositoryWASVendor - Use one of the WAS_VENDOR_* constants to specify which Web Application Server product the repository is running inside.
repositoryWASPort - Specify the port number which the Web Application Server is listening on. For example, WebLogic listens on port 7001 by default.
Throws:
HarmoniClientError - thrown if any of the parameters to this constructor are null.
Method Detail

folderExists

public boolean folderExists(java.lang.String folderPath)
                     throws RepositorySecurityException
Used to test for the existence of the repository folder.
Parameters:
folderPath - The full path to the folder in question.
Throws:
RepositorySecurityException - thrown if the user doesn't have read permission for the folder in question.

logInRepository

public void logInRepository(java.lang.String username,
                            java.lang.String password)
                     throws AuthenticationException,
                            ServerUnavailableException,
                            RepositorySecurityException
Used to log the given user into the repository. Only one user may be logged in to a given RepositoryClient object at any time. If this method is called after a user has already logged in, then the current user will be logged out before the new user is logged in.
Parameters:
username - The username which exists in the security realm of the Web Application Server in which the repository is running.
password - The corresponding password for this user.
Throws:
AuthenticationException - thrown if the username/password failed.
ServerUnavailableException - thrown if the repository is not available.
RepositorySecurityException - thrown if the user does not have permission to use the repository.

logOutRepository

public void logOutRepository()
Should be called in order to free resources when the user is finished using the RepositoryClient object to interact with the repository.

createFolderInRepository

public void createFolderInRepository(java.lang.String repositoryPath,
                                     SecurityOptions folderSecOptions,
                                     SecurityOptions defaultFileSecOptions,
                                     ExpirationOptions expirationOptions)
                              throws RepositorySecurityException,
                                     DuplicateObjectException,
                                     InvalidPathnameException,
                                     InvalidParameterException
Creates a new folder in the repository with the given attributes.
Parameters:
repositoryPath - full pathname for the folder to be created.
folderSecOptions - the security attributes of the new folder.
defaultFileSecOptions - the security attributes which a contained file or folder will have if not specified during creation of the contained file or folder.
expirationInfo - the expiration attributes of the new folder.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the parent folder.
DuplicateObjectException - thrown if the folder already exists.
InvalidPathnameException - thrown if the path to the parent folder doesn't exist.
InvalidParameterException - thrown if the values of the expirationInfo object are not valid. For example, this folder expires in negative 10 minutes.

deleteFolderInRepository

public void deleteFolderInRepository(java.lang.String repositoryPath)
                              throws RepositorySecurityException,
                                     InvalidPathnameException,
                                     PinnedFileException
Deletes a folder and its recursive contents from the repository. This operation has atomic behavior which means that it will either totally succeed with the folder and all recursive contents deleted, or will fail with the folder and all recursive contents remaining.
Parameters:
repositoryPath - full pathname for the folder to be deleted.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the folder and all recursive contents. The user must also have read permission for this folder and all recursive subfolders so that the folder contents can be "listed" during the deletion process.
InvalidPathnameException - thrown if the path to the folder doesn't exist in the repository.
PinnedFileException - thrown if the folder or some of its contents have been marked as pinned which prevents their deletion.

getOutputFromRepository

public void getOutputFromRepository(java.lang.String repositoryPath,
                                    java.lang.String clientPath)
                             throws RepositorySecurityException,
                                    InvalidClientPathnameException,
                                    InvalidPathnameException,
                                    FileExpiredException,
                                    IncompleteBLOBException,
                                    java.io.IOException
Retrieves the single output file from the repository and writes it to the client machine at the path specified.
Parameters:
repositoryPath - full pathname to the output to be retrieved.
clientPath - full pathname to the location on the client machine to write the output.
Throws:
RepositorySecurityException - thrown if the user doesn't have read permission for the output file.
InvalidPathnameException - thrown if the path to the output doesn't exist.
InvalidClientPathnameException - thrown if the client path is invalid.
java.io.IOException - thrown if an I/O error occurs while writing the output on the client machine.

getOutputFromRepositoryAsStream

public java.io.InputStream getOutputFromRepositoryAsStream(java.lang.String repositoryPath)
                                                    throws RepositorySecurityException,
                                                           InvalidPathnameException,
                                                           FileExpiredException,
                                                           IncompleteBLOBException
Retrieves the single output file from the repository and as an input stream.
Parameters:
repositoryPath - full pathname to the output to be retrieved.
Throws:
RepositorySecurityException - thrown if the user doesn't have read permission for the output file.
InvalidPathnameException - thrown if the path to the output doesn't exist.

deleteOutputFromRepository

public void deleteOutputFromRepository(java.lang.String repositoryPath)
                                throws RepositorySecurityException,
                                       InvalidPathnameException
Delete the single output file from the repository.
Parameters:
repositoryPath - full pathname to the output to be deleted.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the output file.
InvalidPathnameException - thrown if the path to the output doesn't exist in the repository.

storeDorDataInRepository

public void storeDorDataInRepository(java.lang.String repositoryPath,
                                     DORDataSet dataSet,
                                     SecurityOptions dataSecOptions,
                                     ExpirationOptions expirationOptions,
                                     boolean overwrite)
                              throws RepositorySecurityException,
                                     DuplicateObjectException,
                                     InvalidPathnameException,
                                     DORException,
                                     InvalidParameterException
Stores the data object into the repository for later use as a data source for a report.
Parameters:
repositoryPath - full pathname for the data object in the repository.
dataSet - the data object to store.
dataSecOptions - the security attributes for the data.
expirationOptions - the expiration attributes for the data.
overwrite - true if desire to overwrite data with the same path in the repository.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the parent folder.
DuplicateObjectException - thrown if the overwrite parameter is false, and an object already exists in the repository at that path.
InvalidPathnameException - thrown if the path in the repository is invalid.
DORException - thrown if an error occurs while converting the data object into an XML representation for storage into the repository.
InvalidParameterException - throw if an invalid expiration object is passed. For example, this data expires in negative 20 minutes.

storeDorDataInRepository

public void storeDorDataInRepository(java.lang.String repositoryPath,
                                     java.sql.ResultSet resultSet,
                                     SecurityOptions dataSecOptions,
                                     ExpirationOptions expirationOptions,
                                     boolean overwrite)
                              throws RepositorySecurityException,
                                     DuplicateObjectException,
                                     InvalidPathnameException,
                                     DORException,
                                     InvalidParameterException
Stores the data object into the repository for later use as a data source for a report.
Parameters:
repositoryPath - full pathname for the data object in the repository.
resultSet - the data object to store.
dataSecOptions - the security attributes for the data.
expirationOptions - the expiration attributes for the data.
overwrite - true if desire to overwrite data with the same path in the repository.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the parent folder.
DuplicateObjectException - thrown if the overwrite parameter is false, and an object already exists in the repository at that path.
InvalidPathnameException - thrown if the path in the repository is invalid.
DORException - thrown if an error occurs while converting the data object into an XML representation for storage into the repository.
InvalidParameterException - throw if an invalid expiration object is passed. For example, this data expires in negative 20 minutes.

storeDorDataInRepository

public void storeDorDataInRepository(java.lang.String repositoryPath,
                                     java.lang.String xmlFilePath,
                                     SecurityOptions dataSecOptions,
                                     ExpirationOptions expirationOptions,
                                     boolean overwrite)
                              throws RepositorySecurityException,
                                     DuplicateObjectException,
                                     InvalidPathnameException,
                                     InvalidClientPathnameException,
                                     java.io.IOException,
                                     InvalidParameterException
Stores the data object into the repository for later use as a data source for a report.
Parameters:
repositoryPath - full pathname for the data object in the repository.
xmlFilePath - the client machine path to an XML file. Used by Dynalivery customers who are using the COM client.
dataSecOptions - the security attributes for the data.
expirationOptions - the expiration attributes for the data.
overwrite - true if desire to overwrite data with the same path in the repository.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the parent folder.
DuplicateObjectException - thrown if the overwrite parameter is false, and an object already exists in the repository at that path.
InvalidPathnameException - thrown if the path in the repository is invalid.
java.io.IOException - thrown if an I/O error occurs while reading the XML file from the client machine.
InvalidParameterException - throw if an invalid expiration object is passed. For example, this data expires in negative 20 minutes.

deleteDorDataInRepository

public void deleteDorDataInRepository(java.lang.String repositoryPath)
                               throws RepositorySecurityException,
                                      InvalidPathnameException
Delete the data file from the repository.
Parameters:
repositoryPath - full pathname to the data to be deleted.
Throws:
RepositorySecurityException - thrown if the user doesn't have write permission for the data file.
InvalidPathnameException - thrown if the path to the data doesn't exist in the repository.

getOutputFolderContentsFromRepository

public void getOutputFolderContentsFromRepository(java.lang.String repositoryFolder,
                                                  java.lang.String clientDirectory)
                                           throws RepositorySecurityException,
                                                  InvalidPathnameException,
                                                  InvalidClientPathnameException,
                                                  java.io.IOException,
                                                  FileExpiredException,
                                                  IncompleteBLOBException
Retrieves the output folder and all recursive contents from the repository and writes it to the client machine in the client machine folder specified. The name of all contents and the folder structure is maintained. This method does not have atomic behavior and may result in a partial retrieval of contents before an exception is thrown.
Parameters:
repositoryFolder - full pathname to the output folder to be retrieved.
clientDirectory - full pathname to the directory on the client machine to write the output.
Throws:
RepositorySecurityException - thrown if the user doesn't have read permission for the output folder or any of the recursive contents.
InvalidPathnameException - thrown if the path to the output folder doesn't exist in the repository.
InvalidClientPathnameException - thrown if the client machine path is invalid.
java.io.IOException - thrown if an I/O error occurs while writing the output on the client machine.