com.ibm.dse.tools.workbench.base
Interface Repository

All Known Implementing Classes:
DefaultRepository

public interface Repository

This interface define the common operations that a source of data must provide.


Field Summary
static java.lang.String BEGIN_TABLE_TOKEN
          This token marks the beginning of the data stored in a table when exporting/importing data to a file
static java.lang.String END_TABLE_TOKEN
          This token marks the end of the data of stored in a table when exporting/importing data to a file
static java.lang.String EOL
          This tokes marks the end of line when exporting/importing data to a file
 
Method Summary
 void commit()
          This method commits the changes to the database and cleans the data maintained to allow rollback
 void connect()
          Establish the connection to database and check the application user identification
 java.lang.String[] create(java.lang.String InitialDataSetFileName)
          Creates a repository from an initial data file
 void disconnect()
          This method disconnects from the database.
 void exportToFile(java.io.Writer w)
          Export all the table data to file
 java.lang.String getCnnPassword()
          This method returns the passsword used for JDBC connection to the repository
 java.lang.String getCnnUser()
          Returns the user name used for JDBC connection
 java.sql.Connection getConnection()
          Returns the JDBC connection
 Table getTable(java.lang.String name)
          Returns the table that have the specified name.
 Table[] getTableList()
          Returns the list of tables defined in the repository.
 java.lang.String getURLpath()
          Returns the url to connect to the repository.
 TableRow getUser()
          Returns the row in the Users table representing the application user
 java.lang.String getUserCode()
          Returns the value of the application user code.
 java.lang.String getUserName()
          Returns the value of the application user name.
 void importFromFile(java.io.Reader r)
          Import all the tables data from a file
 boolean isModified()
          Indicates if modifications have been done since last commit or rollback
 void markAsModified()
          Marks the repository as modified, so commit or rollback is required
 void rollback()
          This method undoes the changes made to the rows since the last commit or rollback
 void setConnectData(java.lang.String URLpath, java.lang.String user, java.lang.String password)
          This method sets the connection data for a DefaultRepository object, with a given url, user and password.
 void setUser(java.lang.String userName, java.lang.String password)
          Sets the application user name and password, to be searched at the Users table at connection time
 

Field Detail

BEGIN_TABLE_TOKEN

public static final java.lang.String BEGIN_TABLE_TOKEN
This token marks the beginning of the data stored in a table when exporting/importing data to a file

END_TABLE_TOKEN

public static final java.lang.String END_TABLE_TOKEN
This token marks the end of the data of stored in a table when exporting/importing data to a file

EOL

public static final java.lang.String EOL
This tokes marks the end of line when exporting/importing data to a file
Method Detail

commit

public void commit()
            throws RepositoryException
This method commits the changes to the database and cleans the data maintained to allow rollback
Throws:
RepositoryException -  

connect

public void connect()
             throws RpConnectionException
Establish the connection to database and check the application user identification
Throws:
RpConnectionException - When the connection can't be established.

create

public java.lang.String[] create(java.lang.String InitialDataSetFileName)
                          throws WorkbenchException
Creates a repository from an initial data file
Parameters:
InitialDataSetFileName - java.lang.String The name of the file with the initial data (null if no initial data)
Returns:
java.lang.String[] The list of error messages
Throws:
WorkbenchException -  

disconnect

public void disconnect()
                throws RpConnectionException
This method disconnects from the database.
Throws:
RpConnectionException - When the connection can't be disconnected.

exportToFile

public void exportToFile(java.io.Writer w)
                  throws WorkbenchException,
                         java.io.IOException
Export all the table data to file
Parameters:
w - java.io.Writer
Throws:
WorkbenchException - An exception occurred accessing data
java.io.IOException - An exception occurred accessing file

getCnnPassword

public java.lang.String getCnnPassword()
This method returns the passsword used for JDBC connection to the repository
Returns:
java.lang.String

getCnnUser

public java.lang.String getCnnUser()
Returns the user name used for JDBC connection
Returns:
com.ibm.dse.tools.workbench.base.TableRow - The current value of cnnUser.

getConnection

public java.sql.Connection getConnection()
Returns the JDBC connection
Returns:
java.sql.Connection

getTable

public Table getTable(java.lang.String name)
Returns the table that have the specified name.
Returns:
com.ibm.dse.tools.workbench.base.Table.

getTableList

public Table[] getTableList()
Returns the list of tables defined in the repository.
Returns:
com.ibm.dse.tools.workbench.base.Table[].

getURLpath

public java.lang.String getURLpath()
Returns the url to connect to the repository.
Returns:
java.lang.String.

getUser

public TableRow getUser()
Returns the row in the Users table representing the application user
Returns:
java.lang.String - The current value of user.

getUserCode

public java.lang.String getUserCode()
Returns the value of the application user code.
Returns:
java.lang.String - The current value of user code.

getUserName

public java.lang.String getUserName()
Returns the value of the application user name.
Returns:
java.lang.String - The current value of user name.

importFromFile

public void importFromFile(java.io.Reader r)
                    throws WorkbenchException,
                           java.io.IOException
Import all the tables data from a file
Parameters:
r - java.io.Reader
Throws:
WorkbenchException - An exception occurred accessing tables
java.io.IOException - An exception occurred accessing file

isModified

public boolean isModified()
Indicates if modifications have been done since last commit or rollback
Returns:
boolean

markAsModified

public void markAsModified()
Marks the repository as modified, so commit or rollback is required

rollback

public void rollback()
              throws RepositoryException
This method undoes the changes made to the rows since the last commit or rollback
Throws:
RepositoryException -  

setConnectData

public void setConnectData(java.lang.String URLpath,
                           java.lang.String user,
                           java.lang.String password)
This method sets the connection data for a DefaultRepository object, with a given url, user and password.
Parameters:
URLpath - java.lang.String
user - java.lang.String
password - java.lang.String

setUser

public void setUser(java.lang.String userName,
                    java.lang.String password)
             throws WorkbenchException
Sets the application user name and password, to be searched at the Users table at connection time
Parameters:
userName - java.lang.String
password - java.lang.String
Throws:
WorkbenchException -