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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(TdbControlObject ob)
      Add the database or thesaurus referenced by the provided Control object as a member of this cluster.
      void add​(java.lang.String db)
      Add a new member to the cluster, by name
      void changeMgr​(java.lang.String newmgr)
      Transfer all objects from the current user to a new manager.
      void changeMgr​(java.lang.String newmgr, java.lang.String oldmgr)
      Transfer all objects from one manager to another.
      void changeMgr​(java.lang.String newmgr, java.lang.String oldmgr, java.lang.String name)
      Transfer ownership of one or more cluster designs from one user to another.
      void copy​(java.lang.String newname, TdbControlObject newobj)
      Copy the current cluster definition to a new name.
      void deepCopy​(java.lang.String newname, TdbControlObject newobj)
      Create a deep copy of the current cluster under a new name.
      void delete()
      Delete the current cluster design from the server.
      void delete​(java.lang.String name)
      Delete the named cluster design from the server.
      void export​(java.lang.String filename)
      Export the current cluster definition to the named file.
      void export​(java.lang.String filename, java.lang.String name)
      Export the named database cluster design to the named file.
      void get()
      Retrieve the current cluster's design from the server.
      void get​(boolean resolve)
      Retrieve the current cluster's design from the server.
      void get​(java.lang.String name)
      Retrieve the named cluster design from the server.
      void get​(java.lang.String name, boolean resolve)
      Retrieve the named cluster design from the server.
      java.util.List<TdbFieldDesign> getCommonFields()
      Return a list of fields common to all databases in the cluster.
      java.util.List<TdbFieldDesign> getCommonFields​(java.lang.String name)
      Return a list of fields common to all databases in the cluster.
      java.lang.String getDescription()
      Retrieve any description or comment associated with the database cluster.
      java.util.List<TdbDatabaseDesign> getMemberDesigns()
      Return a list of database design objects for all databases in the cluster, with nested clusters resolved.
      java.util.List<TdbDatabaseDesign> getMemberDesigns​(java.lang.String name)
      Return a list of database design objects for all databases in the cluster, with nested clusters resolved.
      void importCluster​(java.lang.String filename, java.lang.String name)
      Import a new cluster design from the named file.
      void importUpdate​(java.lang.String filename)
      Import an update to the current cluster design from the named file.
      void importUpdate​(java.lang.String filename, java.lang.String name)
      Import an update to the named cluster design from the named file.
      boolean isOwner()
      Check if the calling user is the owner of the database cluster.
      TdbControlObjectList members()
      Retrieve the current set of members in the cluster.
      void put()
      Store the current cluster design to the server.
      void put​(java.lang.String name)
      Store a new or modified cluster design to the server.
      void remove​(TdbControlObject ob)
      Remove the referenced Control object member from this cluster.
      void remove​(java.lang.String db)
      Remove a named member from the cluster.
      void rename​(java.lang.String newname)
      Rename the current cluster design to a new name.
      void setDescription​(java.lang.String comment)
      Establish a description or comment to associate with the database cluster.
      void setMembers​(TdbControlObjectList members)
      Establish a new set of members in the cluster.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • 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 java.lang.String getDescription()
        Retrieve any description or comment associated with the database cluster.
        Returns:
        Cluster comment, if any
      • setDescription

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

        public void add​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String filename,
                           java.lang.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​(java.lang.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​(java.lang.String filename,
                                  java.lang.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​(java.lang.String filename,
                                 java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String newmgr,
                              java.lang.String oldmgr,
                              java.lang.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​(java.lang.String newmgr,
                              java.lang.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​(java.lang.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 java.util.List<TdbDatabaseDesign> getMemberDesigns​(java.lang.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 java.util.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 java.util.List<TdbFieldDesign> getCommonFields​(java.lang.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 java.util.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