Class TdbDatabaseDesign

  • All Implemented Interfaces:
    com.tietoenator.trip.jxp.internal.utils.DOMSink, TdbControlObjectProvider
    Direct Known Subclasses:
    TdbThesaurusDesign

    public class TdbDatabaseDesign
    extends TdbSerializableObject
    implements com.tietoenator.trip.jxp.internal.utils.DOMSink
    Container and manipulation logic for a database design.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addField​(TdbFieldDesign field)
      Append a new field definition to the current design.
      void addForeignKey​(java.lang.String key, java.lang.String linkdb, java.lang.String linkfld, TdbIntegrityType on_update, TdbIntegrityType on_delete)
      Create a foreign key relationship between this database (as the slave) and another database (as the master).
      boolean bafNeedsDefrag()
      Check if database's data file (BAF) needs to be defragmented.
      boolean bifNeedsDefrag()
      Check if database's primary index file (BIF) needs to be defragmented.
      void changeMgr​(java.lang.String newmgr)
      Transfer ownership of all databases from the calling user to another.
      void changeMgr​(java.lang.String newmgr, java.lang.String oldmgr)
      Transfer ownership of all databases from one user to another.
      void changeMgr​(java.lang.String newmgr, java.lang.String oldmgr, java.lang.String name)
      Transfer ownership of one or more database objects from one user to another.
      void compress​(TdbCompressionContext ctx, boolean all)
      Requests a database compression operation, akin to the command line utility PACKIT.
      void copy​(java.lang.String newname, TdbControlObject newobj)
      Create a shallow copy of the current database / thesaurus, preserving base design but ignoring associated reports / forms, locations and access rights.
      boolean databaseNeedsDefrag()
      Check if any of the database's files (BAF, BIF or VIF) need to be defragmented.
      void deepCopy​(java.lang.String newname, TdbControlObject newobj)
      Create a deep copy of the current database / thesaurus, creating a new one that is exactly the same, but with a different name (and correspondibly different filenames on the server).
      void delete()
      Delete the current database from the server.
      void delete​(java.lang.String name)
      Delete a named database from the server.
      void deleteForeignKey​(java.lang.String key)
      Remove any existing foreign key relationship from the named field.
      void deleteForeignKeys()
      Removes all existing referential integrity rules from the database design.
      void diagnose​(TdbErrorCheckSink sink)
      Check the database's primary data file (the BAF) for errors or conditions that might cause errors in the future.
      void diagnose​(TdbErrorCheckSink sink, int phase)
      Check the database's primary data file (the BAF) for errors or conditions that might cause errors in the future.
      void export​(java.lang.String filename)
      Exports the current database's design to the named file, including all associated form definitions and file specifications.
      void export​(java.lang.String filename, boolean full, boolean incfiles)
      Export the current database's design to the named file, optionally including all associated form definitions.
      void export​(java.lang.String db, java.lang.String filename, boolean full, boolean incfiles)
      Export the named database's design to the named file, optionally including all associated form definitions.
      java.util.List<TdbFieldDesign> fields()
      Retrieve the field collection, i.e. the set of field designs that comprise the database design.
      void get()
      Retrieve the database design of the database referenced by the Control object used to construct this object.
      void get​(java.lang.String name)
      Retrieve the named database design and all associated properties.
      void get​(java.lang.String name, boolean update)
      Retrieve the named database design and all associated properties, optionally with the default database design parameters in preparation for the creation of a new database.
      java.lang.String getApplicationId()
      Retrieve an opaque identifier that applications can use to store whatever they desire.
      java.lang.String getAsePostCommit()
      Retrieve the name of the ASE function that is called whenever a record is being committed to the database, after the record has actually been written to physical storage.
      java.lang.String getAsePostSubmit()
      Retrieve the name of the ASE function that will be invoked after submitting a background task to an execution queue.
      java.lang.String getAsePreCommit()
      Retrieve the name of the ASE function that is called whenever a record is being committed to the database, before the record has actually been written to physical storage.
      java.lang.String getAsePreSubmit()
      Retrieve the name of the ASE function that will be invoked prior to submitting a background task to an execution queue.
      java.lang.String getBafFile()
      Retrieve the filename of the database's data file (the BAF)
      java.lang.String getBifFile()
      Retrieve the filename of the database's primary index file (the BIF)
      java.lang.String getCharacterSet()
      Retrieve the "native" character set that will be used within the database.
      TdbSegmentationType getChineseSegmentation()
      Retrieve the type of word segmentation algorithm that is being used to process Chinese text in this database.
      java.lang.String getClassificationScheme()
      Retrieve the name of the classification scheme (database) that will be used to classify records within this database.
      java.lang.String getDefaultEntryForm()
      Retrieve the name of the default TRIPclassic entry form for the database.
      java.lang.String getDefaultOutputFormat()
      Retrieve the name of the default output format for the database.
      java.lang.String getDescription()
      Retrieve any comment or description associated with the database design
      TdbControlObjectList getEntryForms()
      Retrieve the list of TRIPclassic entry forms defined for the database
      TdbFieldDesign getFieldById​(int id)
      Retrieve a reference to the design for a field with the specified field number.
      TdbFieldDesign getFieldByIndex​(int index)
      Retrieve the n'th field within the database design.
      TdbFieldDesign getFieldByName​(java.lang.String name)
      Retrieve the named field within the database design.
      int getFieldCount()
      Retrieve a count of the number of fields in this database design.
      TdbFieldGroupDesign getFieldGroupById​(int id)
      Retrieve a reference to the design for a field group with the specified field number.
      TdbFieldGroupDesign getFieldGroupByIndex​(int index)
      Retrieve the n'th field group within the database design.
      TdbFieldGroupDesign getFieldGroupByName​(java.lang.String name)
      Retrieve the named field group within the database design.
      int getFieldGroupCount()
      Retrieve a count of the number of fields groups in this database design.
      java.util.List<TdbFieldGroupDesign> getFieldGroups()
      Get the field groups collection for the database.
      java.lang.String getFoldingClass()
      Retrieve the character folding class to be applied to data within the database.
      TdbTextSeparators getIndexingRules()
      Retrieve the indexing rules (parsing rules) that are to be applied to data stored in this database.
      java.lang.String getLanguage()
      Retrieve the natural language used for the text in the database.
      java.lang.String getLastIndex()
      Retrieve the last index date/time for the database
      java.lang.String getLastUpdate()
      Retrieve the last update date/time for the database
      java.lang.String getLogFile()
      Retrieve the filename of the database's transaction log file
      java.lang.String getName()
      Retrieve the database's name
      TdbControlObjectList getOutputFormats()
      Retrieve the list of avaiable output formats defined for the database
      java.lang.String getOwnerName()
      Retrieve the name of the database's owner.
      java.lang.String getPartNameField()
      Retrieve the name of the record part name field, i.e. the field that holds the primary key of part records within a particular record.
      int getRecordCount()
      Retrieve the number of records in the database; this count does not only include records that have been indexed, but rather is the physical count of records in the BAF.
      java.lang.String getRecordNameField()
      Retrieve the name of the record name field, i.e. the database's primary key field.
      java.lang.String getRecordNumberField()
      Retrieve the name of the record number field, i.e. the field that will hold the ordinal identifier assigned to each record by the server during storage.
      boolean getSubmitKeepLogfile()
      Check if the logfiles generated by background tasks are being kept or discarded.
      boolean getSubmitNotifyOnCompletion()
      Check if background tasks should attempt to notify foreground tasks when they complete.
      int getSubmitOptions()
      Retrieve the server-specific submit options for background tasks.
      boolean getSubmitPrintLogfile()
      Check if the logfiles generated by background tasks will be queued for printing upon completion of the task.
      java.lang.String getSubmitQueue()
      Retrieve the name of the submission queue to which background tasks will be sent by the server.
      boolean getUsesAudit()
      Check if a query audit trail is established for this database.
      boolean getUsesAutoReorg()
      Check if the database's index files automatically reorganize, or whether the DBA gets alerted to the fact that the files are in need of reorganization.
      boolean getUsesLogDeletes()
      Check if the database's transaction log file contains the full content of records that are deleted, or simply a delete marker.
      java.lang.String getVifFile()
      Retrieve the filename of the database's secondary index file (the VIF)
      java.lang.String getWordChars()
      Retrieve the set of normally unindexed characters that are to be considered searchable within this database.
      boolean hasPartNameField()
      Check if this database has a record part name field defined
      boolean hasRecordNameField()
      Check if this database has a record name field defined, i.e. a primary key.
      boolean hasRecordNumberField()
      Check if this database has a record number field defined
      void importDesign​(java.lang.String filename, java.lang.String name)
      Import a new database or thesaurus design from a named file.
      void importUpdate​(java.lang.String filename)
      Import an update to the current database's / thesaurus' design from a named file.
      void importUpdate​(java.lang.String filename, java.lang.String name)
      Import an update to an existing database / thesaurus from a named file.
      void index()
      Request a background task be submitted to index the current database.
      void index​(boolean reindex, boolean batchjob)
      Request the current database to be indexed.
      java.util.List<TdbIntegrityRule> integrityRules()
      Retrieve a collection of integrity rules established for the database.
      boolean isConnectorDatabase()
      Check if the database is an import connector database.
      boolean isGraph()
      Check if the database is a graph database.
      boolean isOwner()
      Check if the calling user has ownership rights to this database.
      boolean isXmlEnabled()
      Check if the database is enabled for XML storage and XPath searching.
      void load​(java.lang.String tform)
      Request a background task to be submitted to load the named TFORM file into the current database.
      void loadAndIndex​(java.lang.String tform)
      Request a background task to be submitted to load and subsequently index the named TFORM file into the current database.
      void loadAndReindex​(java.lang.String tform)
      Request a background task to be submitted to load and subsequently reindex the named TFORM file into the current database.
      void put()
      Store the current design to the server, including all associated properties.
      void put​(java.lang.String name)
      Commit a new/updated database design to the server, including all associated properties.
      void putField​(TdbFieldDesign field)
      Store a single modified field's properties to the server.
      void putFieldGroup​(TdbFieldGroupDesign fgroup)
      Store a single modified field group's properties to the server.
      void putFieldGroups()
      Store the current database's field group collection to the server.
      void putFields()
      Store the current database's fields collection to the server.
      void putProperties()
      Store the general and indexing properties of the current design to the server.
      void putProperties​(java.lang.String db)
      Store the general and indexing properties of the named design to the server.
      void reindex()
      Deprecated.
      Use index(boolean,boolean) instead.
      void removeField​(TdbFieldDesign field)
      Remove a particular field from the current database design.
      void removeFieldGroup​(TdbFieldGroupDesign fgroup)
      Remove a particular field group from the current database design.
      void rename​(java.lang.String newname)
      Rename the current database.
      void setApplicationId​(java.lang.String id)
      Establish an opaque identifier that applications can use to store whatever they desire.
      void setAsePostCommit​(java.lang.String ase)
      Establish the name of an ASE function that will be called whenever a record is being committed to the database, after the record has actually been written to physical storage.
      void setAsePostSubmit​(java.lang.String ase)
      Establish the name of the ASE function that will be invoked after submitting a background task to an execution queue.
      void setAsePreCommit​(java.lang.String ase)
      Establish the name of an ASE function that will be called whenever a record is being committed to the database, before the record has actually been written to physical storage.
      void setAsePreSubmit​(java.lang.String ase)
      Establish the name of the ASE function that will be invoked prior to submitting a background task to an execution queue.
      void setBafFile​(java.lang.String filename)
      Establish the filename of the database's data file (the BAF)
      void setBifFile​(java.lang.String filename)
      Establish the filename of the database's primary index file (the BIF)
      void setCharacterSet​(java.lang.String charset)
      Establish the "native" character set that will be used within the database.
      void setChineseSegmentation​(TdbSegmentationType type)
      Establish the type of word segmentation algorithm that should be used to process Chinese text in this database.
      void setClassificationScheme​(java.lang.String scheme)
      Establish the name of the classification scheme (database) that will be used to classify records within this database.
      void setConnectorDatabase​(boolean mode)
      Establish whether the database should be an import connector database.
      void setDefaultEntryForm​(java.lang.String name)
      Establish the name of the default TRIPclassic entry form for the database.
      void setDefaultOutputFormat​(java.lang.String name)
      Establish the name of the default output format for the database.
      void setDescription​(java.lang.String comment)
      Establish a comment or description to associate with the database design
      void setFieldGroups​(java.util.Collection<TdbFieldGroupDesign> groups)
      Set the field groups collection for the database.
      void setFields​(java.util.Collection<TdbFieldDesign> fields)
      Replace or establish the field collection, i.e. the set of field designs that comprise the database design.
      void setFoldingClass​(java.lang.String folding)
      Establish the character folding class to be applied to data within the database.
      void setGraph​(boolean mode)
      Establish whether the database should be a graph database.
      void setIndexingRules​(TdbTextSeparators spec)
      Establish the indexing rules (parsing rules) that are to be applied to data stored in this database.
      void setIntegrityRules​(java.util.Collection<TdbIntegrityRule> rules)
      Establish a new set of integrity rules for the database.
      void setLanguage​(java.lang.String lang)
      Establish the natural language used for the text in the database.
      void setLogFile​(java.lang.String filename)
      Establish the filename of the database's transaction log file
      void setName​(java.lang.String name)
      Establish the database's name
      void setPartNameField​(java.lang.String name)
      Establish the name of the record part name field, i.e. the field that will hold the primary key of part records within a particular record.
      void setRecordNameField​(java.lang.String name)
      Establish the name of the record name field, i.e. the database's primary key field.
      void setRecordNumberField​(java.lang.String name)
      Establish the name of the record number field, i.e. the field that will hold the ordinal identifier assigned to each record by the server during storage.
      void setSubmitKeepLogfile​(boolean mode)
      Establish whether the logfiles generated by background tasks should be kept or discarded.
      void setSubmitNotifyOnCompletion​(boolean mode)
      Establish whether background tasks should attempt to notify foreground tasks when they complete.
      void setSubmitOptions​(int options)
      Establish the server-specific submit options for background tasks.
      void setSubmitPrintLogfile​(boolean mode)
      Establish whether the logfiles generated by background tasks should be queued for printing upon completion of the task.
      void setSubmitQueue​(java.lang.String queue)
      Establish the name of the submission queue to which background tasks will be sent by the server.
      void setUsesAudit​(boolean mode)
      Establish a query audit trail for this database.
      void setUsesAutoReorg​(boolean mode)
      Establish whether the database's index files should automatically reorganize, or whether the DBA should be alerted to the fact that the files are in need of reorganization.
      void setUsesLogDeletes​(boolean mode)
      Establish whether the database's transaction log file should contain the full content of records that are deleted, or simply a delete marker.
      void setVifFile​(java.lang.String filename)
      Establish the filename of the database's secondary index file (the VIF)
      void setWordChars​(java.lang.String chars)
      Retrieve the set of normally unindexed characters that are to be considered searchable within this database.
      void setXmlEnabled​(boolean mode)
      Establish whether the database should be enabled for XML storage and XPath searching.
      void status()
      Refresh the status information of the current database.
      void status​(java.lang.String name)
      Refresh the status information of the named database.
      void validateField​(TdbFieldDesign field)
      Validate a particular field's design against the database design.
      void validateRestriction​(int type, java.lang.String rest, boolean pattern, boolean fileref)
      Attempt to validate that a restriction value is valid for a particular type of field; this checks both the availability of the restriction type for that field type, and the data type of the restriction.
      boolean vifNeedsDefrag()
      Check if database's secondary index file (VIF) needs to be defragmented.
      • Methods inherited from class java.lang.Object

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

      • TdbDatabaseDesign

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

        public TdbDatabaseDesign​(TdbSession session,
                                 TdbControlObject ob)
                          throws TdbException
        Constructor, creates a container for the database referenced by the provided Control object
        Parameters:
        session - Active session
        ob - Control object referencing the database required
        Throws:
        TdbException
    • Method Detail

      • isOwner

        public boolean isOwner()
        Check if the calling user has ownership rights to this database. This method may return true even if the calling user is not the actual owner. This happens if the calling user is SYSTEM and the TDBS_SUPERMAN configuration property has been set on the server.
        Returns:
        true if the calling user has ownership rights to this database
      • getName

        public java.lang.String getName()
        Retrieve the database's name
        Returns:
        Database name
      • setName

        public void setName​(java.lang.String name)
        Establish the database's name
        Parameters:
        name - Database name
      • getOwnerName

        public java.lang.String getOwnerName()
        Retrieve the name of the database's owner.
        Returns:
        Name of user who owns the database
      • getRecordCount

        public int getRecordCount()
        Retrieve the number of records in the database; this count does not only include records that have been indexed, but rather is the physical count of records in the BAF.
        Returns:
        Record count
      • getFieldCount

        public int getFieldCount()
        Retrieve a count of the number of fields in this database design. NOTE: This is not the same as the max field number in the database design.
        Returns:
        The number of fields in the database design.
      • fields

        public java.util.List<TdbFieldDesign> fields()
        Retrieve the field collection, i.e. the set of field designs that comprise the database design. This method returns a snapshot copy of the field collection. For repeated use, please retain the object returned.
        Returns:
        Field collection
      • setFields

        public void setFields​(java.util.Collection<TdbFieldDesign> fields)
        Replace or establish the field collection, i.e. the set of field designs that comprise the database design.
        Parameters:
        fields - Field collection
      • getFieldGroupCount

        public int getFieldGroupCount()
        Retrieve a count of the number of fields groups in this database design.
        Returns:
        The number of field groups in the database design.
        Since:
        TRIPjxp 8.0-0
      • getFieldGroups

        public java.util.List<TdbFieldGroupDesign> getFieldGroups()
        Get the field groups collection for the database.
        Since:
        TRIPjxp 8.0-0
      • setFieldGroups

        public void setFieldGroups​(java.util.Collection<TdbFieldGroupDesign> groups)
        Set the field groups collection for the database.
        Since:
        TRIPjxp 8.0-0
      • integrityRules

        public java.util.List<TdbIntegrityRule> integrityRules()
        Retrieve a collection of integrity rules established for the database. The resulting collection is a snapshot copy (is not live), and cannot be used to propagate changes down to the underlying rule set.
        Returns:
        Integrity rules collection
      • setIntegrityRules

        public void setIntegrityRules​(java.util.Collection<TdbIntegrityRule> rules)
        Establish a new set of integrity rules for the database. This provided rule set completely replaces any existing rules defined for the database.
        Parameters:
        rules - New integrity rules collection
      • getIndexingRules

        public TdbTextSeparators getIndexingRules()
        Retrieve the indexing rules (parsing rules) that are to be applied to data stored in this database. The result of this function is a copy of the current indexing rules and cannot be used to update the underlying design. Use setIndexingRules()) to store any modifications to the rule set.
        Returns:
        Indexing rules
      • setIndexingRules

        public void setIndexingRules​(TdbTextSeparators spec)
        Establish the indexing rules (parsing rules) that are to be applied to data stored in this database.
        Parameters:
        spec - Indexing rules
      • getBafFile

        public java.lang.String getBafFile()
        Retrieve the filename of the database's data file (the BAF)
        Returns:
        BAF specification
      • setBafFile

        public void setBafFile​(java.lang.String filename)
        Establish the filename of the database's data file (the BAF)
        Parameters:
        filename - New BAF specification
      • getBifFile

        public java.lang.String getBifFile()
        Retrieve the filename of the database's primary index file (the BIF)
        Returns:
        BIF specification
      • setBifFile

        public void setBifFile​(java.lang.String filename)
        Establish the filename of the database's primary index file (the BIF)
        Parameters:
        filename - New BIF specification
      • getVifFile

        public java.lang.String getVifFile()
        Retrieve the filename of the database's secondary index file (the VIF)
        Returns:
        VIF specification
      • setVifFile

        public void setVifFile​(java.lang.String filename)
        Establish the filename of the database's secondary index file (the VIF)
        Parameters:
        filename - New VIF specification
      • getLogFile

        public java.lang.String getLogFile()
        Retrieve the filename of the database's transaction log file
        Returns:
        Logfile specification
      • setLogFile

        public void setLogFile​(java.lang.String filename)
        Establish the filename of the database's transaction log file
        Parameters:
        filename - New logfile specification
      • getWordChars

        public java.lang.String getWordChars()
        Retrieve the set of normally unindexed characters that are to be considered searchable within this database.
        By default, there is a reasonably small number of characters within each character set that are indexed, e.g. alphanumerics. Specifically, punctuation characters are normally excluded, so if the application requires characters such as ^ or / to be indexed, they need to be set in the "word characters" set.
        Returns:
        Special indexable characters
      • setWordChars

        public void setWordChars​(java.lang.String chars)
        Retrieve the set of normally unindexed characters that are to be considered searchable within this database.
        By default, there is a reasonably small number of characters within each character set that are indexed, e.g. alphanumerics. Specifically, punctuation characters are normally excluded, so if the application requires characters such as ^ or / to be indexed, they need to be set in the "word characters" set.
        Parameters:
        chars - Special indexable characters
      • getAsePreCommit

        public java.lang.String getAsePreCommit()
        Retrieve the name of the ASE function that is called whenever a record is being committed to the database, before the record has actually been written to physical storage.
        Returns:
        ASE name, if any
      • setAsePreCommit

        public void setAsePreCommit​(java.lang.String ase)
        Establish the name of an ASE function that will be called whenever a record is being committed to the database, before the record has actually been written to physical storage.
        Parameters:
        ase - ASE name
      • getAsePostCommit

        public java.lang.String getAsePostCommit()
        Retrieve the name of the ASE function that is called whenever a record is being committed to the database, after the record has actually been written to physical storage.
        Returns:
        ASE name, if any
      • setAsePostCommit

        public void setAsePostCommit​(java.lang.String ase)
        Establish the name of an ASE function that will be called whenever a record is being committed to the database, after the record has actually been written to physical storage.
        Parameters:
        ase - ASE name
      • getCharacterSet

        public java.lang.String getCharacterSet()
        Retrieve the "native" character set that will be used within the database. This property is reserved for use with Unicode databases. Retrieving this property with a non-Unicode database has no meaning.
        Returns:
        Native character set, if any
      • setCharacterSet

        public void setCharacterSet​(java.lang.String charset)
        Establish the "native" character set that will be used within the database. This property is reserved for use with Unicode databases. Setting this property with a non-Unicode database has no meaning.
        Parameters:
        charset - Native character set name
      • getFoldingClass

        public java.lang.String getFoldingClass()
        Retrieve the character folding class to be applied to data within the database.

        Character folding is used to indicate that language-specific character replacement should be performed. This is meaningful only for non-English text and is used to exchange certain characters with others based on phonetic similarity or difference, for example the sound of the Swedish national characters �, and � exist in the Norwegian language as well but they have different character representations, namely �, and �. So, if you use SWE as the folding class, these Norwegian characters will be converted to their Swedish equivalent when indexing and/or searching.

        This means that you can search for Norwegian words, names, etc. within a Swedish database, which can be very useful as national keyboards only have one variety of these phonetically similar characters and using tools such as the Windows character map is an annoyingly cumbersome option for end users.

        Note that you can also fold a Swedish/German/Norwegian/etc. database to ENG, which means that all diacritics are removed and just the base forms of characters are used.

        Folding as MUL (the default) means that no character conversion is performed.

        Returns:
        Folding class
      • setFoldingClass

        public void setFoldingClass​(java.lang.String folding)
        Establish the character folding class to be applied to data within the database.

        Character folding is used to indicate that language-specific character replacement should be performed. This is meaningful only for non-English text and is used to exchange certain characters with others based on phonetic similarity or difference, for example the sound of the Swedish national characters �, and � exist in the Norwegian language as well but they have different character representations, namely �, and �. So, if you use SWE as the folding class, these Norwegian characters will be converted to their Swedish equivalent when indexing and/or searching.

        This means that you can search for Norwegian words, names, etc. within a Swedish database, which can be very useful as national keyboards only have one variety of these phonetically similar characters and using tools such as the Windows character map is an annoyingly cumbersome option for end users.

        Note that you can also fold a Swedish/German/Norwegian/etc. database to ENG, which means that all diacritics are removed and just the base forms of characters are used.

        Folding as MUL (the default) means that no character conversion is performed.

        Parameters:
        folding - Folding class
      • getLanguage

        public java.lang.String getLanguage()
        Retrieve the natural language used for the text in the database.

        This property affects stemming and other language-specific characteristics of the index.

        Setting the language to CHI (Chinese) is required in order to for the word segmentation property to be valid.

        Returns:
        Natural language type string (ENG, GER, SWE, NOR, FIN, or CHI)
      • setLanguage

        public void setLanguage​(java.lang.String lang)
        Establish the natural language used for the text in the database.

        This property affects stemming and other language-specific characteristics of the index.

        Setting the language to CHI (Chinese) is required in order to for the word segmentation property to be valid.

        Parameters:
        lang - Natural language type string (ENG, GER, SWE, NOR, FIN, or CHI)
      • getRecordNameField

        public java.lang.String getRecordNameField()
        Retrieve the name of the record name field, i.e. the database's primary key field. See TdbFieldDesign for other means of determining that a particular field is the record name field.
        Returns:
        The name of the record name field, if any
      • setRecordNameField

        public void setRecordNameField​(java.lang.String name)
        Establish the name of the record name field, i.e. the database's primary key field. See TdbFieldDesign for other means of establishing that a particular field is the record name field.
        Parameters:
        name - The name of the record name field
      • hasRecordNameField

        public boolean hasRecordNameField()
        Check if this database has a record name field defined, i.e. a primary key.
        Returns:
        true if the database has a record name field
      • getRecordNumberField

        public java.lang.String getRecordNumberField()
        Retrieve the name of the record number field, i.e. the field that will hold the ordinal identifier assigned to each record by the server during storage. See TdbFieldDesign for other means of determining that a particular field is the record number field.
        Returns:
        The name of the record number field, if any
      • setRecordNumberField

        public void setRecordNumberField​(java.lang.String name)
        Establish the name of the record number field, i.e. the field that will hold the ordinal identifier assigned to each record by the server during storage. See TdbFieldDesign for other means of establishing that a particular field is the record number field.
        Parameters:
        name - The name of the record number field
      • hasRecordNumberField

        public boolean hasRecordNumberField()
        Check if this database has a record number field defined
        Returns:
        true if the database has a record number field
      • getPartNameField

        public java.lang.String getPartNameField()
        Retrieve the name of the record part name field, i.e. the field that holds the primary key of part records within a particular record. See TdbFieldDesign for other means of determining that a particular field is the record part name field.
        Returns:
        The name of the record number field, if any
      • setPartNameField

        public void setPartNameField​(java.lang.String name)
        Establish the name of the record part name field, i.e. the field that will hold the primary key of part records within a particular record. See TdbFieldDesign for other means of establishing that a particular field is the record part name field.
        Parameters:
        name - The name of the record number field
      • hasPartNameField

        public boolean hasPartNameField()
        Check if this database has a record part name field defined
        Returns:
        true if the database has a record part name field
      • getApplicationId

        public java.lang.String getApplicationId()
        Retrieve an opaque identifier that applications can use to store whatever they desire. This value passes unmodified and uninterpreted through the server.
        Returns:
        Application data, if any
      • setApplicationId

        public void setApplicationId​(java.lang.String id)
        Establish an opaque identifier that applications can use to store whatever they desire. This value passes unmodified and uninterpreted through the server.
        Parameters:
        id - Application data
      • getDescription

        public java.lang.String getDescription()
        Retrieve any comment or description associated with the database design
        Returns:
        Database comment, if any
      • setDescription

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

        public java.lang.String getSubmitQueue()
        Retrieve the name of the submission queue to which background tasks will be sent by the server. All tasks queued to the same queue (i.e. with the same queue name) will operate sequentially.
        Returns:
        Submission queue
      • setSubmitQueue

        public void setSubmitQueue​(java.lang.String queue)
        Establish the name of the submission queue to which background tasks will be sent by the server. All tasks queued to the same queue (i.e. with the same queue name) will operate sequentially.
        Parameters:
        queue - Submission queue
      • getAsePreSubmit

        public java.lang.String getAsePreSubmit()
        Retrieve the name of the ASE function that will be invoked prior to submitting a background task to an execution queue.
        Returns:
        Ase name, if any
      • setAsePreSubmit

        public void setAsePreSubmit​(java.lang.String ase)
        Establish the name of the ASE function that will be invoked prior to submitting a background task to an execution queue.
        Parameters:
        ase - Ase name
      • getAsePostSubmit

        public java.lang.String getAsePostSubmit()
        Retrieve the name of the ASE function that will be invoked after submitting a background task to an execution queue.
        Returns:
        Ase name, if any
      • setAsePostSubmit

        public void setAsePostSubmit​(java.lang.String ase)
        Establish the name of the ASE function that will be invoked after submitting a background task to an execution queue.
        Parameters:
        ase - Ase name
      • getLastUpdate

        public java.lang.String getLastUpdate()
        Retrieve the last update date/time for the database
        Returns:
        Last update
      • getLastIndex

        public java.lang.String getLastIndex()
        Retrieve the last index date/time for the database
        Returns:
        Last index
      • getClassificationScheme

        public java.lang.String getClassificationScheme()
        Retrieve the name of the classification scheme (database) that will be used to classify records within this database.
        Returns:
        Classification scheme name, if any
      • setClassificationScheme

        public void setClassificationScheme​(java.lang.String scheme)
        Establish the name of the classification scheme (database) that will be used to classify records within this database.
        Parameters:
        scheme - Classification scheme name
      • isXmlEnabled

        public boolean isXmlEnabled()
        Check if the database is enabled for XML storage and XPath searching.
        Returns:
        XML enablement status
      • setXmlEnabled

        public void setXmlEnabled​(boolean mode)
        Establish whether the database should be enabled for XML storage and XPath searching. Note that this flag can only successfully be set when the database is being created. Any attempt to modify the database's XML enablement status after the initial creation of the database design will fail.
        Parameters:
        mode - true if the database should be enabled for XML
      • isGraph

        public boolean isGraph()
        Check if the database is a graph database.
        Returns:
        True if this is a graph database
      • setGraph

        public void setGraph​(boolean mode)
        Establish whether the database should be a graph database. Note that this flag can only successfully be set when the database is being created. Any attempt to modify the database's graph status after the initial creation of the database design will fail.
        Parameters:
        mode - true if the database should be a graph
      • isConnectorDatabase

        public boolean isConnectorDatabase()
        Check if the database is an import connector database.
        Returns:
        True if this is an import connector database
      • setConnectorDatabase

        public void setConnectorDatabase​(boolean mode)
                                  throws TdbException
        Establish whether the database should be an import connector database. Note that this flag can only successfully be set when the database is being created. Any attempt to modify the database's status after the initial creation of the database design will fail.
        Parameters:
        mode - true if the database should be a connector database
        Throws:
        TdbException - If connector databases are not supported
      • getChineseSegmentation

        public TdbSegmentationType getChineseSegmentation()
        Retrieve the type of word segmentation algorithm that is being used to process Chinese text in this database. Obviously only relevant if the server is setup to use Chinese.
        Returns:
        Segmentation type
      • setChineseSegmentation

        public void setChineseSegmentation​(TdbSegmentationType type)
        Establish the type of word segmentation algorithm that should be used to process Chinese text in this database. Obviously only relevant if the server is setup to use Chinese.
        Parameters:
        type - Segmentation type
      • getUsesAutoReorg

        public boolean getUsesAutoReorg()
        Check if the database's index files automatically reorganize, or whether the DBA gets alerted to the fact that the files are in need of reorganization. See setUsesAutoReorg() for more detail.
        Returns:
        true if index files are allowed to automatically reorganize when indexing
      • setUsesAutoReorg

        public void setUsesAutoReorg​(boolean mode)
        Establish whether the database's index files should automatically reorganize, or whether the DBA should be alerted to the fact that the files are in need of reorganization.

        It is sometimes not possible to allow TRIP to automatically reorganize index files when indexing due to the length of time that this operation might take. When databases are very large, reorganzing the index can take considerable time, during which any attempt to search the database could result in an error being reported to the user. To avoid this ever happening, set this flag false and TRIP will simply report in the index logfile when the index files are in need of reorganization. The DBA can then schedule downtime for the database to perform such maintenance as is required.

        Parameters:
        mode - true if index files are to be allowed to automatically reorganize when indexing
      • getUsesAudit

        public boolean getUsesAudit()
        Check if a query audit trail is established for this database. See setUsesAudit for more detail.
        Returns:
        true if a query audit has been established
      • setUsesAudit

        public void setUsesAudit​(boolean mode)
        Establish a query audit trail for this database. Doing this requires significant system privileges, and due to the extreme performance impact that it can impose, its use is not encouraged in any but the most severe of circumstance under the direction of TRIP customer support.
        Parameters:
        mode - Set this true to establish a query audit log
      • getUsesLogDeletes

        public boolean getUsesLogDeletes()
        Check if the database's transaction log file contains the full content of records that are deleted, or simply a delete marker. In application contexts where it is possible that incorrect delete operations may take place, it is useful to have the content of deleted records available in the transaction log for rollback purposes.
        Returns:
        true if the database is setup to log deleted record content
      • setUsesLogDeletes

        public void setUsesLogDeletes​(boolean mode)
        Establish whether the database's transaction log file should contain the full content of records that are deleted, or simply a delete marker. In application contexts where it is possible that incorrect delete operations may take place, it is useful to have the content of deleted records available in the transaction log for rollback purposes.
        Parameters:
        mode - Set this true if the database is to log deleted record content
      • setSubmitOptions

        public void setSubmitOptions​(int options)
        Establish the server-specific submit options for background tasks. For better ways to set these options, see the more granular methods setSubmitNotifyOnCompletion, setSubmitPrintLogfile and setSubmitKeepLogfile
        Parameters:
        options - Background task submission options bitmask
      • getSubmitNotifyOnCompletion

        public boolean getSubmitNotifyOnCompletion()
        Check if background tasks should attempt to notify foreground tasks when they complete. Note that this is dependent both on server platform capabilities, and on server applications integrating correctly with the TRIPdaemon.
        Returns:
        true if background tasks are to notify of their completion
      • setSubmitNotifyOnCompletion

        public void setSubmitNotifyOnCompletion​(boolean mode)
        Establish whether background tasks should attempt to notify foreground tasks when they complete. Note that this is dependent both on server platform capabilities, and on server applications integrating correctly with the TRIPdaemon.
        Parameters:
        mode - true if background tasks are to notify of their completion
      • getSubmitPrintLogfile

        public boolean getSubmitPrintLogfile()
        Check if the logfiles generated by background tasks will be queued for printing upon completion of the task.
        Returns:
        true if logfile printing is turned on
      • setSubmitPrintLogfile

        public void setSubmitPrintLogfile​(boolean mode)
        Establish whether the logfiles generated by background tasks should be queued for printing upon completion of the task.
        Parameters:
        mode - true if logfile printing is to be turned on
      • getSubmitKeepLogfile

        public boolean getSubmitKeepLogfile()
        Check if the logfiles generated by background tasks are being kept or discarded.
        Returns:
        true if logfiles from background tasks are being kept
      • setSubmitKeepLogfile

        public void setSubmitKeepLogfile​(boolean mode)
        Establish whether the logfiles generated by background tasks should be kept or discarded.
        Parameters:
        mode - true if logfiles from background tasks are to be kept
      • bafNeedsDefrag

        public boolean bafNeedsDefrag()
        Check if database's data file (BAF) needs to be defragmented. Not all server platforms support this property.
        Returns:
        true if defragmentation is recommended for the BAF
      • bifNeedsDefrag

        public boolean bifNeedsDefrag()
        Check if database's primary index file (BIF) needs to be defragmented. Not all server platforms support this property.
        Returns:
        true if defragmentation is recommended for the BIF
      • vifNeedsDefrag

        public boolean vifNeedsDefrag()
        Check if database's secondary index file (VIF) needs to be defragmented. Not all server platforms support this property.
        Returns:
        true if defragmentation is recommended for the VIF
      • databaseNeedsDefrag

        public boolean databaseNeedsDefrag()
        Check if any of the database's files (BAF, BIF or VIF) need to be defragmented. Not all server platforms support this property.
        Returns:
        true if defragmentation is recommended for one or more of the database's files
      • getDefaultOutputFormat

        public java.lang.String getDefaultOutputFormat()
        Retrieve the name of the default output format for the database. This format will be used when processing CCL Show orders that do not specify a particular format.
        Returns:
        Name of the default output format
      • setDefaultOutputFormat

        public void setDefaultOutputFormat​(java.lang.String name)
        Establish the name of the default output format for the database. This format will be used when processing CCL Show orders that do not specify a particular format.
        Parameters:
        name - Name of the default output format
      • getOutputFormats

        public TdbControlObjectList getOutputFormats()
                                              throws TdbException
        Retrieve the list of avaiable output formats defined for the database
        Returns:
        List of available output formats
        Throws:
        TdbException
      • getDefaultEntryForm

        public java.lang.String getDefaultEntryForm()
        Retrieve the name of the default TRIPclassic entry form for the database. This property only has meaning if the application being used for data update is TRIPclassic.
        Returns:
        Name of the default entry form
      • setDefaultEntryForm

        public void setDefaultEntryForm​(java.lang.String name)
        Establish the name of the default TRIPclassic entry form for the database. This property only has meaning if the application being used for data update is TRIPclassic.
        Parameters:
        name - Name of the default entry form
      • get

        public void get​(java.lang.String name)
                 throws TdbException
        Retrieve the named database design and all associated properties. The calling user must have some level of read access to the database in order for this to succeed.

        This method causes network I/O.

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

        public void get​(java.lang.String name,
                        boolean update)
                 throws TdbException
        Retrieve the named database design and all associated properties, optionally with the default database design parameters in preparation for the creation of a new database.

        If the update parameter is set to false, the calling user must have some level of read access to the database in order for this to succeed.

        If the update parameter is set to true, the calling user must either be the owner of the specified database, or have file manager privileges.

        This method requires TRIPsystem 8.1 or later.

        This method causes network I/O.

        Parameters:
        name - The name of the database to retrieve
        update - True if the database design is to be create or altrered
        Throws:
        TdbException
        Since:
        TRIPjxp 8.1-0
      • get

        public void get()
                 throws TdbException
        Retrieve the database design of the database referenced by the Control object used to construct this object. The calling user must have some level of read access to the database in order for this to succeed.

        This method causes network I/O.

        Throws:
        TdbException
      • addField

        public void addField​(TdbFieldDesign field)
        Append a new field definition to the current design.
        Parameters:
        field - The new field to add to the design
      • getFieldById

        public TdbFieldDesign getFieldById​(int id)
                                    throws TdbException
        Retrieve a reference to the design for a field with the specified field number. This reference is live, and can be used to propagate changes into the underlying design.
        Parameters:
        id - The number of the field to retrieve
        Returns:
        The field design for the appropriate field, or null if not found
        Throws:
        TdbException
      • getFieldByIndex

        public TdbFieldDesign getFieldByIndex​(int index)
                                       throws TdbException
        Retrieve the n'th field within the database design. This does not take field number into account. This reference is live and can be used to propagate changes into the underlying design.
        Parameters:
        index - The offset of the field within the design
        Returns:
        The appropriate field
        Throws:
        TdbException
      • getFieldByName

        public TdbFieldDesign getFieldByName​(java.lang.String name)
        Retrieve the named field within the database design. This reference is live and can be used to propagate changes into the underlying design.
        Parameters:
        name - The name of the field to retrieve
        Returns:
        The appropriate field
      • getFieldGroupById

        public TdbFieldGroupDesign getFieldGroupById​(int id)
                                              throws TdbException
        Retrieve a reference to the design for a field group with the specified field number.
        Parameters:
        id - The number of the field group to retrieve
        Returns:
        Field group design object, or null if not found.
        Throws:
        TdbException - If the id is not a positive integer
        Since:
        TRIPjxp 8.0-0 The returned reference is live and can be used to propagate changes into the underlying design.
      • getFieldGroupByIndex

        public TdbFieldGroupDesign getFieldGroupByIndex​(int index)
                                                 throws TdbException
        Retrieve the n'th field group within the database design.
        Parameters:
        index - The zero-based offset of the field group within the design.
        Returns:
        Field group design object.
        Throws:
        TdbException - If the index is outside the valid range.
        Since:
        TRIPjxp 8.0-0 The returned reference is live and can be used to propagate changes into the underlying design.
      • getFieldGroupByName

        public TdbFieldGroupDesign getFieldGroupByName​(java.lang.String name)
        Retrieve the named field group within the database design.
        Parameters:
        name - Name of field group to retrieve.
        Returns:
        Field group design object, or null if not found
        Since:
        TRIPjxp 8.0-0 The returned reference is live and can be used to propagate changes into the underlying design.
      • validateRestriction

        public void validateRestriction​(int type,
                                        java.lang.String rest,
                                        boolean pattern,
                                        boolean fileref)
                                 throws TdbException
        Attempt to validate that a restriction value is valid for a particular type of field; this checks both the availability of the restriction type for that field type, and the data type of the restriction.

        This method causes network I/O.

        Parameters:
        type - The type of field for which the restriction is to be validated
        rest - The value of the restriction
        pattern - If true, the restriction is interpreted as a regular expression
        fileref - If true, the restriction is interpreted as a database.field reference
        Throws:
        TdbException
      • validateField

        public void validateField​(TdbFieldDesign field)
                           throws TdbException
        Validate a particular field's design against the database design.

        The purpose of this function is to make sure that the field design specified will be accepted as part of a larger bulk update when committing the entire database design. This is intended for use in an interactive context where fields are being accumulated on the client prior to a single commit operation.

        This method causes network I/O.

        Parameters:
        field - The field design to validate
        Throws:
        TdbException
      • status

        public void status​(java.lang.String name)
                    throws TdbException
        Refresh the status information of the named database. After calling this method, the properties RecordCount, LastUpdate and LastIndex will hold up-to-date values.

        This method causes network I/O.

        Parameters:
        name - The name of the database for which information is to be retrieved
        Throws:
        TdbException
      • export

        public void export​(java.lang.String db,
                           java.lang.String filename,
                           boolean full,
                           boolean incfiles)
                    throws TdbException
        Export the named database's design to the named file, optionally including all associated form definitions. The file is written in UTF-8.

        This method causes network I/O.

        Parameters:
        db - Name of database to export
        filename - The name of the file to write the exported definition to
        full - If set true, all associated forms are also exported, otherwise not
        incfiles - If set true, the file definitions for the database are written, otherwise not
        Throws:
        TdbException
      • export

        public void export​(java.lang.String filename,
                           boolean full,
                           boolean incfiles)
                    throws TdbException
        Export the current database's design to the named file, optionally including all associated form definitions. The file is written in UTF-8.

        This method causes network I/O.

        Parameters:
        filename - The name of the file to write the exported definition to
        full - If set true, all associated forms are also exported, otherwise not
        incfiles - If set true, the file definitions for the database are written, otherwise not
        Throws:
        TdbException
      • export

        public void export​(java.lang.String filename)
                    throws TdbException
        Exports the current database's design to the named file, including all associated form definitions and file specifications. The file is written in UTF8.

        This method causes network I/O.

        Parameters:
        filename - The name of the file to write the exported definition to
        Throws:
        TdbException
      • importDesign

        public void importDesign​(java.lang.String filename,
                                 java.lang.String name)
                          throws TdbException
        Import a new database or thesaurus design from a named file.

        This method causes network I/O.

        Parameters:
        filename - Filename from which to read the design
        name - The name of the new database / thesaurus to create
        Throws:
        TdbException
      • importUpdate

        public void importUpdate​(java.lang.String filename,
                                 java.lang.String name)
                          throws TdbException
        Import an update to an existing database / thesaurus from a named file.

        This method causes network I/O.

        Parameters:
        filename - Filename from which to read the updated design
        name - The name of the database/thesaurus to update
        Throws:
        TdbException
      • importUpdate

        public void importUpdate​(java.lang.String filename)
                          throws TdbException
        Import an update to the current database's / thesaurus' design from a named file.

        This method causes network I/O.

        Parameters:
        filename - Filename from which to read the updated design
        Throws:
        TdbException
      • put

        public void put​(java.lang.String name)
                 throws TdbException
        Commit a new/updated database design to the server, including all associated properties.

        This method causes network I/O.

        Parameters:
        name - The name of the database design to commit
        Throws:
        TdbException
      • put

        public void put()
                 throws TdbException
        Store the current design to the server, including all associated properties.

        This method causes network I/O.

        Throws:
        TdbException
      • putProperties

        public void putProperties​(java.lang.String db)
                           throws TdbException
        Store the general and indexing properties of the named design to the server. This method does not store any field design information.

        This method causes network I/O.

        Parameters:
        db - The name of the database / thesaurus to store
        Throws:
        TdbException
      • putProperties

        public void putProperties()
                           throws TdbException
        Store the general and indexing properties of the current design to the server. This method does not store any field design information.

        This method causes network I/O.

        Throws:
        TdbException
      • putFields

        public void putFields()
                       throws TdbException
        Store the current database's fields collection to the server. This method does not update any general or indexing properties of the database/thesaurus.

        This method causes network I/O.

        Throws:
        TdbException
      • putField

        public void putField​(TdbFieldDesign field)
                      throws TdbException
        Store a single modified field's properties to the server. This also serves to update that field's representation in the internal structure of the database design that is cached on the client.

        This method causes network I/O.

        Parameters:
        field - The modified field design
        Throws:
        TdbException
      • putFieldGroups

        public void putFieldGroups()
                            throws TdbException
        Store the current database's field group collection to the server. This method does not update any general or indexing properties of the database/thesaurus.
        Throws:
        TdbException
        Since:
        TRIPjxp 8.0-0
      • putFieldGroup

        public void putFieldGroup​(TdbFieldGroupDesign fgroup)
                           throws TdbException
        Store a single modified field group's properties to the server.
        Parameters:
        fgroup - The modified field group design
        Throws:
        TdbException
        Since:
        TRIPjxp 8.0-0 This also serves to update that field group's representation in the internal structure of the database design that is cached on the client.
      • delete

        public void delete​(java.lang.String name)
                    throws TdbException
        Delete a named database from the server.

        The calling user must be the file manager (FM) of the database for this to succeed. In addition, the database must not contain any records (whether indexed or not).

        This method causes network I/O.

        Parameters:
        name - The name of the database to delete
        Throws:
        TdbException
      • delete

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

        The calling user must be the file manager (FM) of the database for this to succeed. In addition, the database must not contain any records (whether indexed or not).

        This method causes network I/O.

        Throws:
        TdbException
      • removeField

        public void removeField​(TdbFieldDesign field)
                         throws TdbException
        Remove a particular field from the current database design.

        Note that after the completion of this call, the field specified is no longer part of the design, although the object used will still be valid, and can (for example) be added back to the design (or to another design, etc).

        This method causes network I/O.

        Parameters:
        field - The field design to remove from the database
        Throws:
        TdbException
      • removeFieldGroup

        public void removeFieldGroup​(TdbFieldGroupDesign fgroup)
                              throws TdbException
        Remove a particular field group from the current database design.

        Note that after the completion of this call, the field group specified is no longer part of the design, although the object used will still be valid, and can (for example) be added back to the design (or to another design, etc).

        Parameters:
        fgroup - The field group design to remove from the database.
        Throws:
        TdbException
        Since:
        TRIPjxp 8.0-0
      • rename

        public void rename​(java.lang.String newname)
                    throws TdbException
        Rename the current database.

        This method causes network I/O.

        Parameters:
        newname - The new name for the database/thesaurus
        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 database objects from one user to another. The calling user must either be the existing manager of the object(s) being transfered, or must be the SYSTEM user.

        This method causes network I/O.

        Parameters:
        newmgr - The name of the user to which to transfer ownership
        oldmgr - The name of the user from which to transfer ownership
        name - The name of the object to transfer; set this to "*" to transfer everything
        Throws:
        TdbException
      • changeMgr

        public void changeMgr​(java.lang.String newmgr,
                              java.lang.String oldmgr)
                       throws TdbException
        Transfer ownership of all databases from one user to another. The calling user must be the SYSTEM user.

        This method causes network I/O.

        Parameters:
        newmgr - The name of the user to which to transfer ownership
        oldmgr - The name of the user from which to transfer ownership
        Throws:
        TdbException
      • changeMgr

        public void changeMgr​(java.lang.String newmgr)
                       throws TdbException
        Transfer ownership of all databases from the calling user to another.

        This method causes network I/O.

        Parameters:
        newmgr - The name of the user to which to transfer ownership
        Throws:
        TdbException
      • index

        public void index​(boolean reindex,
                          boolean batchjob)
                   throws TdbException
        Request the current database to be indexed.

        Synchronous indexing is supported with TRIPsystem 7.0 and later. Note that indexing a database with a very large number of new or changed records may take a long time.

        If you index synchronously, best practise is to regularly schedule a regular index batch job. Not doing this may degrade performance over time.

        This method causes network I/O.

        Parameters:
        reindex - pass true to reindex the database and false to index incrementally
        batchjob - pass true to index in a background task and false to index synchronously.
        Throws:
        TdbException
      • index

        public void index()
                   throws TdbException
        Request a background task be submitted to index the current database. Calling this method is the same as calling index(false,true).

        This method causes network I/O.

        Throws:
        TdbException
      • reindex

        @Deprecated
        public void reindex()
                     throws TdbException
        Deprecated.
        Use index(boolean,boolean) instead.
        Request a background task to be submitted to reindex the current database.

        This method causes network I/O.

        Throws:
        TdbException
      • load

        public void load​(java.lang.String tform)
                  throws TdbException
        Request a background task to be submitted to load the named TFORM file into the current database.

        This method causes network I/O.

        Parameters:
        tform - Name of TFORM file to be loaded -- this is a server-specific file specification
        Throws:
        TdbException
      • loadAndIndex

        public void loadAndIndex​(java.lang.String tform)
                          throws TdbException
        Request a background task to be submitted to load and subsequently index the named TFORM file into the current database.

        This method causes network I/O.

        Parameters:
        tform - Name of TFORM file to be loaded -- this is a server-specific file specification
        Throws:
        TdbException
      • loadAndReindex

        public void loadAndReindex​(java.lang.String tform)
                            throws TdbException
        Request a background task to be submitted to load and subsequently reindex the named TFORM file into the current database.

        This method causes network I/O.

        Parameters:
        tform - Name of TFORM file to be loaded -- this is a server-specific file specification
        Throws:
        TdbException
      • copy

        public void copy​(java.lang.String newname,
                         TdbControlObject newobj)
                  throws TdbException
        Create a shallow copy of the current database / thesaurus, preserving base design but ignoring associated reports / forms, locations and access rights.

        This method causes network I/O.

        Parameters:
        newname - The name to be assigned to the copied database / thesaurus
        newobj - If not null on input, this object will contain the Control reference for the newly created object upon return
        Throws:
        TdbException
      • deepCopy

        public void deepCopy​(java.lang.String newname,
                             TdbControlObject newobj)
                      throws TdbException
        Create a deep copy of the current database / thesaurus, creating a new one that is exactly the same, but with a different name (and correspondibly different filenames on the server). All access rights, forms / reports and general file specifications are maintained between the copies.

        This method causes network I/O.

        Parameters:
        newname - The name to be assigned to the new copy
        newobj - If not null on input, this object will contain the Control reference for the newly created object upon return
        Throws:
        TdbException
      • addForeignKey

        public void addForeignKey​(java.lang.String key,
                                  java.lang.String linkdb,
                                  java.lang.String linkfld,
                                  TdbIntegrityType on_update,
                                  TdbIntegrityType on_delete)
                           throws TdbException
        Create a foreign key relationship between this database (as the slave) and another database (as the master). This relationship will be validated at the time of placing this call, before it is added to the client-side cache of integrity rules.

        This method causes network I/O.

        Parameters:
        key - Foreign key field name
        linkdb - Master database name
        linkfld - Master key field name
        on_update - Action to take on update of master field in master database
        on_delete - Action to take on deletion of records from the master database
        Throws:
        TdbException
      • deleteForeignKey

        public void deleteForeignKey​(java.lang.String key)
                              throws TdbException
        Remove any existing foreign key relationship from the named field.

        This method causes network I/O.

        Parameters:
        key - The field from which to remove any foreign keys
        Throws:
        TdbException
      • deleteForeignKeys

        public void deleteForeignKeys()
                               throws TdbException
        Removes all existing referential integrity rules from the database design.

        This method causes network I/O.

        Throws:
        TdbException
      • diagnose

        public void diagnose​(TdbErrorCheckSink sink,
                             int phase)
                      throws TdbException
        Check the database's primary data file (the BAF) for errors or conditions that might cause errors in the future. The phases involved in the diagnosis reflect the phases run by the command-line utility BAF DOCTOR.

        This method causes network I/O.

        Parameters:
        sink - A sink object that will collect results from the operation -- this must be provided by the caller and must not be null.
        phase - A value determining the phase or phases of diagnosis to execute: 0 - all phases; 1 - gross file integrity; 2 - simple internal file structure; 3 - (obsolete) cache-defeat file structure check; 4 - directory track validation; 5 - free list validation; 6 - rigorous data structure validation.
        Throws:
        TdbException
      • diagnose

        public void diagnose​(TdbErrorCheckSink sink)
                      throws TdbException
        Check the database's primary data file (the BAF) for errors or conditions that might cause errors in the future. This version of the method invokes all phases of diagnosis in one shot.

        This method causes network I/O.

        Parameters:
        sink - A sink object that will collect results from the operation -- this must be provided by the caller and must not be null.
        Throws:
        TdbException
      • compress

        public void compress​(TdbCompressionContext ctx,
                             boolean all)
                      throws TdbException
        Requests a database compression operation, akin to the command line utility PACKIT. The operation can either be performed all at once, or using a call loop so as to allow the calling application to give the end user feedback on progress.

        This method causes network I/O.

        Parameters:
        ctx - Compression context. This context is used to tie together the compression operation and must be provided by the caller. If the application is using a call loop, i.e. calling this function iteratively until completed, the same context object must be provided for each iteration. Applications can test for the completion of the operation by testing the isComplete property of the context. Note that the new location of the database BAF must be provided using the NewName property of the context prior to the first call to this method. Calling applications can check the progress of the compression operation using the Progress and MaxRecs properties of the context following a successful invocation of the Compress method.
        all - If set true, the compression operation will take place in a single call. This might take considerable time, however, so the caller is encouraged to set this flag false and instead to place calls to this method within a loop that gives feedback to the user.
        Throws:
        TdbException