Class TdbDatabaseClusterDesign

All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider

public class TdbDatabaseClusterDesign extends TdbSerializableObject implements com.tietoenator.trip.jxp.internal.utils.DOMSink
Provides a container and manipulation logic for a database cluster
  • Constructor Details

    • TdbDatabaseClusterDesign

      public TdbDatabaseClusterDesign(TdbSession session) throws TdbException
      Constructor, creates a new blank container
      Parameters:
      session - Active session
      Throws:
      TdbException
    • TdbDatabaseClusterDesign

      public TdbDatabaseClusterDesign(TdbSession session, TdbControlObject ob) throws TdbException
      Constructor, creates a container for the cluster referenced by the provided Control object
      Parameters:
      session - Active session
      ob - Control object referencing the cluster desired
      Throws:
      TdbException
  • Method Details

    • members

      public TdbControlObjectList members() throws TdbException
      Retrieve the current set of members in the cluster. This method returns a copy of the member collection. For repeated use, please retain the object returned.
      Returns:
      A collection of member references
      Throws:
      TdbException
    • setMembers

      public void setMembers(TdbControlObjectList members) throws TdbException
      Establish a new set of members in the cluster. This removes any existing members, does not append to the existing set.
      Parameters:
      members - The new membership set for the cluster.
      Throws:
      TdbException
    • isOwner

      public boolean isOwner()
      Check if the calling user is the owner of the database cluster.
      Returns:
      true / false
    • getDescription

      public String getDescription()
      Retrieve any description or comment associated with the database cluster.
      Returns:
      Cluster comment, if any
    • setDescription

      public void setDescription(String comment)
      Establish a description or comment to associate with the database cluster.
      Parameters:
      comment - Cluster comment
    • add

      public void add(String db)
      Add a new member to the cluster, by name
      Parameters:
      db - The name of the member to add (either a database or a thesaurus)
    • add

      public void add(TdbControlObject ob)
      Add the database or thesaurus referenced by the provided Control object as a member of this cluster.
      Parameters:
      ob - The Control object reference to add as a member
    • remove

      public void remove(String db) throws TdbException
      Remove a named member from the cluster.
      Parameters:
      db - The name of the member to remove.
      Throws:
      TdbException
    • remove

      public void remove(TdbControlObject ob) throws TdbException
      Remove the referenced Control object member from this cluster.
      Parameters:
      ob - The Control object member to remove.
      Throws:
      TdbException
    • get

      public void get(String name) throws TdbException
      Retrieve the named cluster design from the server.

      This method causes network I/O.

      Parameters:
      name - The name of the cluster to retrieve
      Throws:
      TdbException
    • get

      public void get(String name, boolean resolve) throws TdbException
      Retrieve the named cluster design from the server.

      This method causes network I/O.

      Parameters:
      name - The name of the cluster to retrieve
      resolve - Set to true to resolve nested clusters into their constituent databases. The resulting TdbDatabaseClusterDesign instance will not be possible to update.
      Throws:
      TdbException
    • get

      public void get() throws TdbException
      Retrieve the current cluster's design from the server. This object must have been constructed using a valid Control object reference for this to succeed.
      Throws:
      TdbException
    • get

      public void get(boolean resolve) throws TdbException
      Retrieve the current cluster's design from the server. This object must have been constructed using a valid Control object reference for this to succeed.
      Parameters:
      resolve - Set to true to resolve nested clusters into their constituent databases. The resulting TdbDatabaseClusterDesign instance will not be possible to update.
      Throws:
      TdbException
    • put

      public void put(String name) throws TdbException
      Store a new or modified cluster design to the server.

      This method causes network I/O.

      Parameters:
      name - Name of the cluster design to store
      Throws:
      TdbException
    • put

      public void put() throws TdbException
      Store the current cluster design to the server. The design must have been retrieved using the get method in order for this to succeed.

      This method causes network I/O.

      Throws:
      TdbException
    • export

      public void export(String filename, String name) throws TdbException
      Export the named database cluster design to the named file.

      This method causes network I/O.

      Parameters:
      filename - File to which to export the design
      name - Design to export
      Throws:
      TdbException
    • export

      public void export(String filename) throws TdbException
      Export the current cluster definition to the named file.

      This method causes network I/O.

      Parameters:
      filename - File to which to export the design
      Throws:
      TdbException
    • importCluster

      public void importCluster(String filename, String name) throws TdbException
      Import a new cluster design from the named file.

      This method causes network I/O.

      Parameters:
      filename - Name of file from which to import
      name - Name of cluster design to create
      Throws:
      TdbException
    • importUpdate

      public void importUpdate(String filename, String name) throws TdbException
      Import an update to the named cluster design from the named file.

      This method causes network I/O.

      Parameters:
      filename - Name of file from which to import
      name - Name of cluster design to update
      Throws:
      TdbException
    • importUpdate

      public void importUpdate(String filename) throws TdbException
      Import an update to the current cluster design from the named file.

      This method causes network I/O.

      Parameters:
      filename - Name of file from which to import
      Throws:
      TdbException
    • delete

      public void delete(String name) throws TdbException
      Delete the named cluster design from the server.

      This method causes network I/O.

      Parameters:
      name - Name of cluster design to delete
      Throws:
      TdbException
    • delete

      public void delete() throws TdbException
      Delete the current cluster design from the server.

      This method causes network I/O.

      Throws:
      TdbException
    • rename

      public void rename(String newname) throws TdbException
      Rename the current cluster design to a new name.

      This method causes network I/O.

      Parameters:
      newname - The new name for the cluster design
      Throws:
      TdbException
    • copy

      public void copy(String newname, TdbControlObject newobj) throws TdbException
      Copy the current cluster definition to a new name.

      This method causes network I/O.

      Parameters:
      newname - Name of new copy
      newobj - If not null on input, this object will contain the Control reference for the new cluster on successful completion
      Throws:
      TdbException
    • deepCopy

      public void deepCopy(String newname, TdbControlObject newobj) throws TdbException
      Create a deep copy of the current cluster under a new name. Deep copying maintains access rights along with the design.

      This method causes network I/O.

      Parameters:
      newname - Name of new object to create
      newobj - If not null on input, this object will contain the Control reference for the new cluster on successful completion
      Throws:
      TdbException
    • changeMgr

      public void changeMgr(String newmgr, String oldmgr, String name) throws TdbException
      Transfer ownership of one or more cluster designs from one user to another.

      This method causes network I/O.

      Parameters:
      newmgr - The name of the new owner
      oldmgr - The name of the existing owner; if this is null, the name of the calling user is assumed; if this is not null, and is not the name of the calling user, the calling user must be the SYSTEM user
      name - The name of the object to transfer, or "*" for all
      Throws:
      TdbException
    • changeMgr

      public void changeMgr(String newmgr, String oldmgr) throws TdbException
      Transfer all objects from one manager to another.

      This method causes network I/O.

      Parameters:
      newmgr - Name of the new manager
      oldmgr - Name of the current manager; if this is not the name of the calling user, the calling must be the SYSTEM user for this to succeed
      Throws:
      TdbException
    • changeMgr

      public void changeMgr(String newmgr) throws TdbException
      Transfer all objects from the current user to a new manager.

      This method causes network I/O.

      Parameters:
      newmgr - Name of the new manager
      Throws:
      TdbException
    • getMemberDesigns

      public List<TdbDatabaseDesign> getMemberDesigns(String name) throws TdbException
      Return a list of database design objects for all databases in the cluster, with nested clusters resolved. Repeated calls with the same instance of TdbDatabaseClusterDesign will not cause any additional network I/O. If the information on database designs in a cluster is required repeatedly within the same session, the TdbDatabaseClusterDesign instance should be cached in order to reduce potentially expensive network I/O.
      Throws:
      TdbException
    • getMemberDesigns

      public List<TdbDatabaseDesign> getMemberDesigns() throws TdbException
      Return a list of database design objects for all databases in the cluster, with nested clusters resolved. The cluster design must have been loaded prior to calling this method (alternatively use the getMemberDesigns(string) overload). Repeated calls with the same instance of TdbDatabaseClusterDesign will not cause any additional network I/O. If the information on database designs in a cluster is required repeatedly within the same session, the TdbDatabaseClusterDesign instance should be cached in order to reduce potentially expensive network I/O.
      Throws:
      TdbException
    • getCommonFields

      public List<TdbFieldDesign> getCommonFields(String name) throws TdbException
      Return a list of fields common to all databases in the cluster.

      Fields are considered common if they have the same name, same type and are in part or head record respectively.

      Repeated calls with the same instance of TdbDatabaseClusterDesign will not cause any additional network I/O. If the information on common fields in a cluster is required repeatedly within the same session, the TdbDatabaseClusterDesign instance should be cached in order to reduce potentially expensive network I/O.

      Throws:
      TdbException
    • getCommonFields

      public List<TdbFieldDesign> getCommonFields() throws TdbException
      Return a list of fields common to all databases in the cluster.

      The cluster design must have been loaded prior to calling this method (alternatively use the getCommonFields(string) overload).

      Fields are considered common if they have the same name, same type and are in part or head record respectively.

      Repeated calls with the same instance of TdbDatabaseClusterDesign will not cause any additional network I/O. If the information on common fields in a cluster is required repeatedly within the same session, the TdbDatabaseClusterDesign instance should be cached in order to reduce potentially expensive network I/O.

      Throws:
      TdbException