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

All Known Implementing Classes:
VersionableTable

public interface Versionable

This interface defines the behavior of any repository versionable object


Method Summary
 void copyOwner(TableRow row, Repository rep)
          Copies the owner of a row to a repository
 void copyParentGroupsTree(TableRow tableRow, Repository destinationRep, boolean exactGroup)
          Copies the container groups tree of a row to another repository.
 TableRow createOpenEdition(TableRow row)
          Creates an open edition for a table row.
 int getActiveColumn()
          This method returns the column identifier for the Active field of the versionable object
 int getCodeColumn()
          This method returns the column identifier for the Code of the versionable object
 TableRow getContainerGroup(TableRow versionableRow)
          This method returns the group containing the row.
 java.lang.String[] getDistinctNames(Clause where)
          This method returns the distinct names of the rows in the Versionable object.
 int getNameColumn()
          This method returns the column identifier for the Name of the versionable object
 int getOwnerColumn()
          This method returns the column identifier for the Owner of the versionable object
 int getReleasedColumn()
          This method returns the column identifier for the Released field of the versionable object
 int getTimeStampColumn()
          This method returns the column identifier for the Timestamp of the versionable object
 int getVersionColumn()
          This method returns the column identifier for the Version of the versionable object
 int getVersionedColumn()
          This method returns the column identifier for the Versioned field of the versionable object
 TableRow[] getVersions(java.lang.String name)
          Returns all the stored versions of a row in a versionable table.
 void importToWorkspace(Workspace ws, TableRow row)
          Copies a row from a repository to a workspace.
 boolean isAValidVersionNumber(TableRow versionableRow, java.lang.String versionNumber, Repository rep)
          Checks if a version number is valid for a row stored in this versionable object.
 boolean isVersioned(TableRow row)
          Tests if a row in this versionable object is versioned.
 TableRow[] rowsToBeRemoved(TableRow[] rows)
          Returns the related rows that a remove process performed on a row set will remove.
 void setContainerGroup(TableRow versionableRow, java.lang.String grpCode)
          Sets the container group of a row of this versionable table object.
 TableRow version(TableRow versionableRow, java.lang.String newVersion, Repository repository)
          Versions a row in this versionable object.
 

Method Detail

copyOwner

public void copyOwner(TableRow row,
                      Repository rep)
               throws WorkbenchException
Copies the owner of a row to a repository
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
rep - com.ibm.dse.tools.workbench.base.Repository
Throws:
WorkbenchException -  

copyParentGroupsTree

public void copyParentGroupsTree(TableRow tableRow,
                                 Repository destinationRep,
                                 boolean exactGroup)
                          throws WorkbenchException
Copies the container groups tree of a row to another repository. If it is a version an open edition would be created for it.
Parameters:
tableRow - com.ibm.dse.tools.workbench.base.TableRow The row whose parent groups tree would be copied
destinationRep - com.ibm.dse.tools.workbench.base.Repository The destination repository
exactGroup - boolean Indicates whether it must search for exact matching groups in the destination repository
Throws:
WorkbenchException - An error ocurred while copying the parent groups tree

createOpenEdition

public TableRow createOpenEdition(TableRow row)
                           throws WorkbenchException
Creates an open edition for a table row.

An open edition is an edition ready to be worked on it.

Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow
Returns:
com.ibm.dse.tools.workbench.base.TableRow The open edition of the row
Throws:
WorkbenchException - An error ocurred while creating the open edition.

getActiveColumn

public int getActiveColumn()
This method returns the column identifier for the Active field of the versionable object
Returns:
int The Active field identifier

getCodeColumn

public int getCodeColumn()
This method returns the column identifier for the Code of the versionable object
Returns:
int The Code column identifier

getContainerGroup

public TableRow getContainerGroup(TableRow versionableRow)
                           throws WorkbenchException
This method returns the group containing the row.
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow The row whose container group must be returned
Returns:
com.ibm.dse.tools.workbench.base.TableRow The group containing the row
Throws:
WorkbenchException - An error ocurred while retrieving the conatiner group

getDistinctNames

public java.lang.String[] getDistinctNames(Clause where)
                                    throws WorkbenchException
This method returns the distinct names of the rows in the Versionable object.
Parameters:
where - com.ibm.dse.tools.workbench.base.Clause A clause to filter the names retrieved.
Returns:
java.lang.String[] The distinct names of the rows.
Throws:
WorkbenchException - An error ocurred while retrieving the distinct names.

getNameColumn

public int getNameColumn()
This method returns the column identifier for the Name of the versionable object
Returns:
int The Name column identifier

getOwnerColumn

public int getOwnerColumn()
This method returns the column identifier for the Owner of the versionable object
Returns:
int The Owner column identifier

getReleasedColumn

public int getReleasedColumn()
This method returns the column identifier for the Released field of the versionable object
Returns:
int The Released column identifier

getTimeStampColumn

public int getTimeStampColumn()
This method returns the column identifier for the Timestamp of the versionable object
Returns:
int The Timestamp column identifier

getVersionColumn

public int getVersionColumn()
This method returns the column identifier for the Version of the versionable object
Returns:
int The Version column identifier

getVersionedColumn

public int getVersionedColumn()
This method returns the column identifier for the Versioned field of the versionable object
Returns:
int The Versioned column identifier

getVersions

public TableRow[] getVersions(java.lang.String name)
                       throws WorkbenchException
Returns all the stored versions of a row in a versionable table.

The search is performed by name.

Parameters:
name - java.lang.String The name of the row
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] The stored versions
Throws:
WorkbenchException - An error ocurred while retrieving the versions.

importToWorkspace

public void importToWorkspace(Workspace ws,
                              TableRow row)
                       throws WorkbenchException
Copies a row from a repository to a workspace.
Parameters:
ws - com.ibm.dse.tools.workbench.base.Workspace The destination repository.
row - com.ibm.dse.tools.workbench.base.TableRow The row to be copied.
Throws:
WorkbenchException - An error ocurred while importing to workspace.

isAValidVersionNumber

public boolean isAValidVersionNumber(TableRow versionableRow,
                                     java.lang.String versionNumber,
                                     Repository rep)
                              throws WorkbenchException
Checks if a version number is valid for a row stored in this versionable object.

This method would be tipically used to ensure that only a version number exists in a repository for a named row.

Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow the row.
versionNumber - java.lang.String the version number.
rep - com.ibm.dse.tools.workbench.base.Repository the repository.
Returns:
boolean true if the version number is valid for the row in the repository passed as parameters, false otherwise.
Throws:
WorkbenchException - an error ocurred while checking the version number.

isVersioned

public boolean isVersioned(TableRow row)
Tests if a row in this versionable object is versioned.
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow the row.
Returns:
boolean true if the row is versioned; false otherwhise.

rowsToBeRemoved

public TableRow[] rowsToBeRemoved(TableRow[] rows)
                           throws WorkbenchException
Returns the related rows that a remove process performed on a row set will remove.
Parameters:
row - com.ibm.dse.tools.workbench.base.TableRow the row set
Returns:
com.ibm.dse.tools.workbench.base.TableRow[] the rows that would de removed
Throws:
WorkbenchException - An error ocurred while retrieving the rows to be removed.

setContainerGroup

public void setContainerGroup(TableRow versionableRow,
                              java.lang.String grpCode)
                       throws WorkbenchException
Sets the container group of a row of this versionable table object.
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow the row
grpCode - java.lang.String the group code
Throws:
WorkbenchException - An error ocurred while setting the container group.

version

public TableRow version(TableRow versionableRow,
                        java.lang.String newVersion,
                        Repository repository)
                 throws WorkbenchException
Versions a row in this versionable object.
Parameters:
versionableRow - com.ibm.dse.tools.workbench.base.TableRow the row to be versioned.
newVersion - java.lang.String the version code
repository - com.ibm.dse.tools.workbench.base.Repository the repository where the versioned row should be copied.
Returns:
com.ibm.dse.tools.workbench.base.TableRow the versioned row.
Throws:
WorkbenchException - An error ocurred while versioning the row.