Class NetricsServerInterface

  • Direct Known Subclasses:
    NetricsTransaction

    public class NetricsServerInterface
    extends java.lang.Object
    Base class for all interactions with the ibi™ Patterns - Search Engine.

    All interactions with the ibi™ Patterns - Search Engine are performed using objects of this class or the NetricsTransactions class, which is an extension of this class. All operations on the ibi™ Patterns - Search Engine are exposed as methods of objects of this class.

    The method calls used to perform operations on the ibi™ Patterns - Search Engine do not retain any state, all information is maintained on the ibi™ Patterns - Search Engine itself. Because these methods are stateless they are thread safe. However these objects do maintain certain connection information. Methods which update this information are NOT thread safe. These methods include: DebuggingOn, DebuggingOff, setServerLocale, setCharset, and setConnectionPoolingPolicy. None of these methods should ever be called on an object being shared by multiple threads.

    See the Overview for an example of how to use this interface.

    • Field Detail

      • transactionClosed

        public static final java.lang.String transactionClosed
        See Also:
        Constant Field Values
      • unsupportedEmbeddedServerOperation

        public static final java.lang.String unsupportedEmbeddedServerOperation
        See Also:
        Constant Field Values
      • ConnectionPoolingNone

        public static final int ConnectionPoolingNone
        Do not use connection pooling.
        See Also:
        Constant Field Values
      • ConnectionPoolingLocal

        public static final int ConnectionPoolingLocal
        Use a separate pool for this NetricsServerInterface object.
        See Also:
        Constant Field Values
      • ConnectionPoolingCommon

        public static final int ConnectionPoolingCommon
        Use a pool shared with other NetricsServerInterface objects.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NetricsServerInterface

        public NetricsServerInterface​(java.lang.String host,
                                      int port)
        Create an object for interacting with a ibi™ Patterns - Search Server.
        Parameters:
        host - The hostname or IP address of the machine on which the ibi™ Patterns - Search Server is running.
        port - The port number which the ibi™ Patterns - Search Server is listening on
      • NetricsServerInterface

        public NetricsServerInterface​(java.lang.String host,
                                      int port,
                                      boolean protocol_debug)
        Create an object for interacting with a ibi™ Patterns - Search Server.
        Parameters:
        host - The hostname or IP address of the machine on which the ibi™ Patterns - Search Server is running.
        port - The port number which the ibi™ Patterns - Search Server is listening on
        protocol_debug - If true output to System.out detailed information on all interactions with the server.
      • NetricsServerInterface

        public NetricsServerInterface​(java.lang.String host,
                                      int port,
                                      boolean protocol_debug,
                                      boolean log4j)
        Create an object for interacting with a ibi™ Patterns - Search Server.
        Parameters:
        host - The hostname or IP address of the machine on which the ibi™ Patterns - Search Server is running.
        port - The port number which the ibi™ Patterns - Search Server is listening on
        protocol_debug - If true output detailed information on all interactions with the server.
        log4j - Dump output to log4j logger.
      • NetricsServerInterface

        public NetricsServerInterface​(boolean protocol_debug)
        Create an object for interacting with the Embedded ibi™ Patterns - Search Server.
        Parameters:
        protocol_debug - If true output detailed information on all interactions with the embedded server.
    • Method Detail

      • DebuggingOn

        public boolean DebuggingOn()
        Turn on debugging output.

        Turn on very verbose debugging output. This should only be used on the advice of ibi support.

        Returns:
        the previous debugging state.
      • DebuggingOff

        public boolean DebuggingOff()
        Turn off debugging output.

        Turn off debugging output. This should only be used on the advice of ibi support.

        Returns:
        the previous debugging state.
      • selectLayout

        @Deprecated
        public void selectLayout​(java.lang.String ignored)
        Deprecated.
        Deprecated since 5.6. This function no longer does anything.
        Parameters:
        ignored - ignored.
      • getLayout

        @Deprecated
        public java.lang.String getLayout()
        Deprecated.
        Deprecated since 5.6. This function always returns null.
        Returns:
        null
      • getConnectionPoolingPolicy

        public int getConnectionPoolingPolicy()
        Retrieve the connection pooling policy currently in use.
        Returns:
        the connection pooling policy currently in use.
      • setConnectionPoolingPolicy

        public void setConnectionPoolingPolicy​(int policy)
                                        throws NetricsException
        Set the connection pooling policy for this object. The default policy is: ConnectionPoolingCommon. This should be changed only on the advice of your ibi representative.
        Parameters:
        policy - one of ConnectionPoolingNone, ConnectionPoolingLocal, ConnectionPoolingCommon.
        Throws:
        NetricsException - if the pooling mode is invalid.
      • setCharset

        public void setCharset​(java.lang.String charset)
        Do not change this unless instructed to do so by your ibi representative.
        Parameters:
        charset - the name of a supported character set
      • tblload

        public NetricsTableStats tblload​(NetricsTable tbl)
                                  throws java.io.IOException,
                                         NetricsException
        Used to load a NetricsTable into the server.
        Parameters:
        tbl - The table to be loaded
        Returns:
        The statistics for the table just loaded
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTable
      • tblload

        public NetricsTableStats tblload​(NetricsTable tbl,
                                         boolean doMaxWork)
                                  throws java.io.IOException,
                                         NetricsException
        Used to load a NetricsTable into the server.
        Parameters:
        tbl - The table to be loaded
        doMaxWork - process as many records as possible, ignoring those with errors.
        Returns:
        The statistics for the table just loaded
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTable
      • tblload

        public NetricsTableStats tblload​(NetricsTable tbl,
                                         NetricsRecFile fileDef)
                                  throws NetricsException,
                                         java.io.IOException
        Create and load a table from a server side CSV file.
        Parameters:
        tbl - Defines table to be loaded. Record source is ignored.
        fileDef - Defines the name and format of the file containing the records. The file location is relative to the server's loadable-data directory.
        Returns:
        The statistics for the table just created
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTable, NetricsRecFile
      • getTable

        public NetricsTable getTable​(java.lang.String name)
                              throws java.io.IOException,
                                     NetricsException
        Get all information on a loaded table.
        Parameters:
        name - Name of the table to retrieve.
        Returns:
        The complete information on a table, suitable for loading to another server via tblload(NetricsTable)
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates an error has occurred.
        java.lang.IllegalArgumentException - if the table name is null.
      • addRecsFromFile

        public NetricsTableStats addRecsFromFile​(java.lang.String tblname,
                                                 boolean replaceNotAdd,
                                                 NetricsRecFile fileDef)
                                          throws NetricsException,
                                                 java.io.IOException
        Add or replace records from a file.
        Parameters:
        tblname - Defines table to be loaded.
        replaceNotAdd - if true this replaces existing records, if false it adds new records.
        fileDef - Defines the name and format of the file containing the records.
        Returns:
        The statistics for the table just created
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM,s RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsRecFile
      • updRecsFromFile

        public NetricsTableStats updRecsFromFile​(java.lang.String tblname,
                                                 NetricsRecFile fileDef)
                                          throws NetricsException,
                                                 java.io.IOException
        Update records from a file.

        This will add the given records if the do not already exist, or replace them if they do exist.

        Parameters:
        tblname - Defines table to be loaded.
        fileDef - Defines the name and format of the file containing the records.
        Returns:
        The statistics for the table as it exists at the completion of the update.
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsRecFile
      • thcreate

        public void thcreate​(NetricsThesaurus thes)
                      throws java.io.IOException,
                             NetricsException
        Create a thesaurus in the Patterns server.

        Parameters:
        thes - The NetricsThesaurus object to create on the Patterns server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)
      • cthcreate

        public void cthcreate​(NetricsCombinedThesaurus cthes)
                       throws java.io.IOException,
                              NetricsException
        Create a combined thesaurus in the Patterns server.

        Parameters:
        cthes - The NetricsCombinedThesaurus object to create on the Patterns server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)
      • cmapcreate

        public void cmapcreate​(NetricsCharmap cmap)
                        throws java.io.IOException,
                               NetricsException
        Create a character map in the Patterns server.
        Parameters:
        cmap - The character map to add.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - if the transaction assocated with this ServerInterface is closed.
      • wdcreate

        public void wdcreate​(NetricsWeightedDictionary wdict)
                      throws java.io.IOException,
                             NetricsException
        Create a weighted dictionary in the Patterns server.
        Parameters:
        wdict - The NetricsWeightedDictionary object to create on the Patterns server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)
      • rlcreate

        public void rlcreate​(java.lang.String rlModelName,
                             java.lang.String rlModelFile)
                      throws java.io.IOException,
                             NetricsException
        Use this function to load a ibi™ Patterns - Search Learn Model under the given name. When using a model, you must configure the search query appropriately.

        Parameters:
        rlModelName - The name the model will be loaded under.
        rlModelFile - The location of the model file on the ibi™ Patterns - Search server's file system. It must be located inside the server's loadable-data directory.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - if the transaction associated with this ServerInterface is closed.
        See Also:
        NetricsSearchOpts.setRlModelName(java.lang.String)
      • rlcreate_l

        public void rlcreate_l​(java.lang.String rlModelName,
                               java.lang.String rlModelFile,
                               boolean allowLargeGatewayMem)
                        throws java.io.IOException,
                               NetricsException
        Use this function to load a ibi™ Patterns - Search Learn Model under the given name. When using a model, you must configure the search query appropriately.

        Parameters:
        rlModelName - The name the model will be loaded under.
        rlModelFile - The location of the model file.
        allowLargeGatewayMem - If loading into a cluster, enabling this flag allows the gateway to temporarily store the model in memory. If the flag is not enabled, the gateway will temporarily store the model in a file. In this case, if the gateway is not configured with a temporary storage directory, a FEATURESET error is returned. Enabling this flag when loading extremely large models (> 50 MB) will return a PARAMVAL error. This flag is ignored when not loading to a cluster.
        Throws:
        NetricsException - if the transaction associated with this ServerInterface is closed.
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsSearchOpts.setRlModelName(java.lang.String)
      • rlcreate_l

        public void rlcreate_l​(java.lang.String rlModelName,
                               java.lang.String rlModelFile)
                        throws java.io.IOException,
                               NetricsException
        Throws:
        java.io.IOException
        NetricsException
      • rllist

        public NetricsModelStats[] rllist​(java.lang.String[] modellist)
                                   throws java.io.IOException,
                                          NetricsException
        List information on ibi™ Patterns - Search Learn models.

        This lists basic information on one or more ibi™ Patterns - Search Learn Models currently loaded on the ibi™ Patterns - Search Server.

        If any of the model names given are not on the engine a NetricsException error is thrown with a code of RLINKMODELNOTFOUND.

        Parameters:
        modellist - The names of the models to be listed. Pass null or an empty list to list all models on the server.

        Returns:
        An array of NetricsModelStats objects.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - NODBDESC, RLINKMODELNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        NetricsException - if there is an error retrieving the list.
        See Also:
        NetricsModelStats
      • rldelete

        public void rldelete​(java.lang.String[] modellist)
                      throws java.io.IOException,
                             NetricsException
        Delete one or more ibi™ Patterns - Search Learn Models.

        This deletes one or more ibi™ Patterns - Search Learn Models currently loaded on the ibi™ Patterns - Search Server.

        If any of the model names given are not on the engine a NetricsException error is thrown with a code of RLINKMODELNOTFOUND, however all other models will still be deleted.

        Parameters:
        modellist - The names of the models to be deleted. Pass null or an empty list to delete all models on the server.

        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - NODBDESC, RLINKMODELNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • rleval

        public double rleval​(java.lang.String rlModelName,
                             double[] featurevec)
                      throws java.io.IOException,
                             NetricsException
        Evaluate a ibi™ Patterns - Search Learn Model with the given vector of feature values.
        Parameters:
        rlModelName - The name of the model to use in the evaluation.
        featurevec - An array of double feature values (from 0.0 to 1.0) which will be evaluated by the model. The number of features in this array must be the same as the model was created and trained with.
        Returns:
        a Learn Model evaluation score.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates that an error has occurred (Possible errors - NORLINKMODEL, RLINKMODELNOTFOUND, NOFEATUREVEC, NUMFEATURESMISMATCH, FEATURESET, IOERROR, PARAMVAL)
      • getModel

        public NetricsRLinkModel getModel​(java.lang.String name)
                                   throws java.io.IOException,
                                          NetricsException
        Retrieve an RLink model and all it's content from a Patterns Server.

        This may consume substantial memory in the JVM, as the entire model is loaded into memory.

        Parameters:
        name - Name of the model to retrieve.
        Returns:
        The complete information on a model, suitable for loading to another server via rlcreate(NetricsRLinkModel, String).
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates an error has occurred.
        java.lang.IllegalArgumentException - if the model name is null.
      • rlcreate

        public void rlcreate​(NetricsRLinkModel model,
                             java.lang.String name_override)
                      throws NetricsException,
                             java.io.IOException
        Loads a ibi™ Patterns - Search Learn Model under the given name. When using a model, you must configure the search query appropriately.
        Not supported by embedded server.
        Parameters:
        model - The model to load.
        name_override - The name of the model to create. If null, the name is taken from the statistics of the model parameter.
        Throws:
        NetricsException - If the server indicates an error has occurred.
        java.io.IOException - If an I/O error occurs.
      • search

        public NetricsSearchResponse search​(NetricsSearchCfg[] tblCfgs,
                                            NetricsSearchOpts opts)
                                     throws java.io.IOException,
                                            NetricsException
        Perform a search on one or more tables.

        Queries are set in the NetricsSearchCfg objects and overall search options are set in the NetricsSearchOpts object.

        Parameters:
        tblCfgs - One NetricsSearchCfg per table which will be searched (can be specified in any order)
        opts - The configuration object for the overall search - allows a number of options for searching
        Returns:
        A NetricsSearchResponse object containing the results of the search
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, TBLNOTFOUND, EXPECTTBLDESC, EXPECTRTBLDESC, EXPECTLIST, EXPECTQUERY, FEATUREOFF, FEATURESET, LISTLEN, LOOKUP, NOTBLDESC, NOQUERY, NSFIELD, NUMFIELDS, PARAMCONFLICT, PARAMMISSING, PARAMVAL, PARTIAL, PREDTYPE, SRCHPARAM, THESNOTFOUND, UNKFIELD)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsSearchCfg, NetricsSearchOpts
      • scoreRecords

        public NetricsSearchResponse scoreRecords​(NetricsQuery query,
                                                  NetricsSearchOpts query_opts,
                                                  NetricsTable rec_format,
                                                  NetricsRecord... records)
                                           throws java.io.IOException,
                                                  NetricsException
        Score one or more records against a query.

        This scores a single record, or a list of records, against a query returning a scored search result for each record given.

        All records are scored and returned, even if they receive a reject score because of errors or invalid or empty data.

        Parameters:
        query - The query to run against the records. The query is the same as for a standard search except no table settings are required (they may be given, but are ignored).
        query_opts - These are the search options for the query. They are the same as for the standard search except those options relating to the prefilter are ignored.
        rec_format - This is a table definition. It provides the field names, field types and character maps for the fields in the records. A full table definition may be given, but all parts except field names, field types and character maps are ignored.
        records - One or more records or an array of records. The fields of the records must match the format defined in the rec_format argument.
        Returns:
        A NetricsSearchResponse object containing the results of the search.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, TBLNOTFOUND, EXPECTTBLDESC, EXPECTRTBLDESC, EXPECTLIST, EXPECTQUERY, FEATUREOFF, FEATURESET, LISTLEN, LOOKUP, NOTBLDESC, NOQUERY, NSFIELD, NUMFIELDS, PARAMCONFLICT, PARAMMISSING, PARAMVAL, PREDTYPE, SRCHPARAM, THESNOTFOUND, UNKFIELD)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsQuery, NetricsSearchOpts, NetricsTable
      • scoreRecords

        public NetricsSearchResponse scoreRecords​(NetricsQuery query,
                                                  NetricsSearchOpts query_opts,
                                                  NetricsTable rec_format,
                                                  NetricsRecSrc rec_src)
                                           throws java.io.IOException,
                                                  NetricsException
        Score all records from a record source against a query.

        This scores all records from a record source against a query returning a scored search result for each record given.

        All records are scored and returned, even if they receive a reject score because of errors or invalid or empty data.

        Parameters:
        query - The query to run against the records. The query is the same as for a standard search except no table settings are required (they may be given, but are ignored).
        query_opts - These are the search options for the query. They are the same as for the standard search except those options relating to the prefilter are ignored.
        rec_format - This is a table definition. It provides the field names, field types and character maps for the fields in the records. A full table definition may be given, but all parts except field names, field types and character maps are ignored.
        rec_src - A record source object. All records from this object are retrieved and sent for scoring. All records must have the format defined in the rec_format argument.
        Returns:
        A NetricsSearchResponse object containing the results of the search
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - ARRAYLEN, TBLNOTFOUND, EXPECTTBLDESC, EXPECTRTBLDESC, EXPECTLIST, EXPECTQUERY, FEATUREOFF, FEATURESET, LISTLEN, LOOKUP, NOTBLDESC, NOQUERY, NSFIELD, NUMFIELDS, PARAMCONFLICT, PARAMMISSING, PARAMVAL, PREDTYPE, SRCHPARAM, THESNOTFOUND, UNKFIELD, FILEFORMAT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsQuery, NetricsSearchOpts, NetricsTable, NetricsRecSrc
      • list

        public NetricsTableStats[] list​(java.lang.String[] tblnames,
                                        boolean includeVarAttrNames)
                                 throws java.io.IOException,
                                        NetricsException
        Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
        Parameters:
        tblnames - The names of the tables for which to receive statistics. Pass null to receive a NetricsTableStats object for every table currently loaded.
        includeVarAttrNames - If true, the returned statistics will include the names of all variable-attributes present in each table. There may be thousands of these.
        Returns:
        An array of NetricsTableStats objects, one per requested table
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • list

        public NetricsTableStats[] list​(java.lang.String[] tblnames)
                                 throws java.io.IOException,
                                        NetricsException
        Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
        Parameters:
        tblnames - The names of the tables for which to receive statistics. Pass null to receive a NetricsTableStats object for every table currently loaded.
        Returns:
        An array of NetricsTableStats objects, one per requested table
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • checkpoint

        @Deprecated
        public java.lang.String[] checkpoint​(java.lang.String[] tblnames)
                                      throws java.io.IOException,
                                             NetricsException
        Deprecated.
        Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi Patterns Installation Guide. If the checkpoint/restore feature must be used, checkpointObjects(NetricsObjectNameCollection) is preferred.
        Checkpoint tables currently loaded in the ibi™ Patterns - Search Server.

        Checkpointing a table allows the table to be restored to the state it was in at the time of the checkpoint. A checkpoint is made to a permanent file store, so checkpoints can be restored across different server invocations. A checkpoint restore is the fastest way to load a table.

        In order to checkpoint a file the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

        If the server has the durable-data feature enabled, this function has no effect.

        If one or more of the named tables do not exists a NetricsException is thrown with an error code of DBNOTFOUND. All tables that were found are checkpointed.

        If some, but not all, of the tables fail to checkpoint for any other reason a NetricsException is thrown with error code PARTIALCHPT. Again some tables may have checkpointed successfully in this case.

        If all tables fail to checkpoint correctly and not all of them failed because the named table didn't exist a NetricsException is thrown with error code CHPTFAILED.

        The extended error item will be a generic list containing the DBDESCRIPTOR for each table that failed to checkpoint correctly for any reason.

        Parameters:
        tblnames - The names of the tables to be checkpointed. Pass null to checkpoint all tables currently in the server.

        Returns:
        An array of the names of the tables that were successfully checkpointed.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, DBNOTFOUND, PARTIALCHPT, CHPTFAILED, INTERNAL, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • checkpointObjects

        public NetricsObjectNameCollection checkpointObjects​(NetricsObjectNameCollection objects)
                                                      throws java.io.IOException,
                                                             NetricsException
        Deprecated.
        Checkpoint/Restore is deprecated in favor of Durable Data.
        Checkpoint objects (tables, thesauri, character maps, rlink models) currently loaded in the ibi™ Patterns - Search Server.

        Checkpointing an object allows it to be restored to the state it was in at the time of the checkpoint. A checkpoint is made to a permanent file store, so checkpoints can be restored across different server invocations. A checkpoint restore is the fastest way to load an object.

        In order to checkpoint an object the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

        If the server has the durable-data feature enabled, this function has no effect.

        If one or more of the named objects does not exist a NetricsException is thrown with an error code of DBNOTFOUND. All objects that were found are checkpointed.

        If some, but not all, of the objects fail to checkpoint for any other reason a NetricsException is thrown with error code PARTIALCHPT. Again some objects may have checkpointed successfully in this case.

        If all objects fail to checkpoint correctly and not all of them failed because the named table didn't exist a NetricsException is thrown with error code CHPTFAILED.

        The extended error item will be a generic list containing the descriptor for each object that failed to checkpoint correctly for any reason.

        If tables and/or thesauri with user-defined character maps are specified, those user-defined character maps are automatically added to the set of objects to checkpoint.

        Parameters:
        objects - The names of the objects to be checkpointed. Pass null to checkpoint all objects currently in the server.

        Returns:
        An NetricsObjectNameCollection containing the names of the objects that were successfully checkpointed.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, DBNOTFOUND, PARTIALCHPT, CHPTFAILED, INTERNAL, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • restore

        @Deprecated
        public java.lang.String[] restore​(java.lang.String[] tblnames)
                                   throws java.io.IOException,
                                          NetricsException
        Deprecated.
        Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi Patterns Installation Guide. If the checkpoint/restore feature must be used, restoreObjects(NetricsObjectNameCollection) is preferred.
        Restore tables previously checkpointed.

        This restores a table to the state of the latest checkpoint for that table. The checkpoint could have been made from this invocation of the server, in which case this backs up the state of the table to that at the time of the last checkpoint, or in a previous invocation of the server, in which case this is a way to quickly reload a table.

        In order to restore a file the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

        If the server has the durable-data feature enabled, this function has no effect.

        If some, but not all, of the tables fail to restore a NetricsException is thrown with error code PARTIALRESTORE.

        If all tables fail to restore correctly a NetricsException is thrown with error code RESTOREFAILED.

        Parameters:
        tblnames - The names of the tables to be restored. Pass null to restore all tables that were previously checkpointed.

        Returns:
        An array of the names of the tables that were successfully restored.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, PARTIALRESTORE, RESTOREFAILED, INTERNAL, NOSYSINIT, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
      • restoreObjects

        public NetricsObjectNameCollection restoreObjects​(NetricsObjectNameCollection objects)
                                                   throws java.io.IOException,
                                                          NetricsException
        Deprecated.
        Checkpoint/Restore is deprecated in favor of Durable Data.
        Restore objects previously checkpointed.

        This restores objects to the state of the latest checkpoint for those objects. The checkpoint could have been made from this invocation of the server, in which case this backs up the state of the objects to that at the time of the last checkpoint, or in a previous invocation of the server, in which case this is a way to quickly reload objects.

        When user-defined character-maps are in use, it is strongly recommended that objects include all character maps.

        In order to restore objects the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

        If the server has the durable-data feature enabled, this function has no effect.

        If some, but not all, of the objects fail to restore a NetricsException is thrown with error code PARTIALRESTORE.

        If all objects fail to restore correctly a NetricsException is thrown with error code RESTOREFAILED.

        Parameters:
        objects - The names of the objects to be restored. Pass null to restore all objects that were previously checkpointed.

        Returns:
        An NetricsObjectNameCollection containing the names of the objects that were successfully restored.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, PARTIALRESTORE, RESTOREFAILED, INTERNAL, NOSYSINIT, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
      • idxlist

        public NetricsIdxStats[] idxlist​(java.lang.String[] tblnames)
                                  throws java.io.IOException,
                                         NetricsException
        Lists statistics for partitioned indexes. This command can be used to retrieve information on all of the partition indexes associated with one or more tables loaded into the ibi™ Patterns - Search server. Information can be retrieved for all tables or a list of specific tables. Information for all indexes associated with the indicated tables is returned as a list of NetricsIdxStats objects. It is an error if a named table doesn't exist. If a table has no indexes an empty statistics object is returned for that table.

        Parameters:
        tblnames - The names of the tables for which to recieve statistics. Pass null to recieve information for indexes of all tables.

        Returns:
        An array of NetricsIdxStats objects.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsIdxStats
      • thdelete

        public void thdelete​(java.lang.String[] theslist)
                      throws java.io.IOException,
                             NetricsException
        Delete one or more thesauri currently loaded on the server.

        This deletes all of the thesauri given (all thesauri on the server if null passed).

        Parameters:
        theslist - The names of the thesauri to be deleted. Pass null to delete all thesauri on the server.

        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - NODBDESC, THESNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • thlist

        public java.lang.String[] thlist()
                                  throws java.io.IOException,
                                         NetricsException
        Lists the thesauri currently loaded in the ibi™ Patterns - Search Server.
        Returns:
        An array of Strings, one per thesaurus loaded in the ibi Patterns Server.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - THESNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • thes_stats

        public NetricsThesStats[] thes_stats​(java.lang.String[] thes_names)
                                      throws java.io.IOException,
                                             NetricsException
        Lists statistics on thesauri currently loaded on the server.

        Parameters:
        thes_names - A list of the thesaurus names who's statistics should be returned. If null statistics on all thesauri is returned.
        Returns:
        An array of NetricsThesStats, one per thesaurus loaded in the ibi™ Patterns - Search Server.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - THESNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsThesStats
      • cmaplist

        public java.lang.String[] cmaplist()
                                    throws java.io.IOException,
                                           NetricsException
        List character maps currently loaded in the ibi™ Patterns - Search Server.
        Returns:
        An array of Strings, one per character map loaded in the ibi Patterns Server.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - CMAPNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • getCharmap

        public NetricsCharmap getCharmap​(java.lang.String name)
                                  throws java.io.IOException,
                                         NetricsException
        Retrieve a character-map and all it's content from a Patterns Server.
        Parameters:
        name - Name of the character-map to retrieve.
        Returns:
        The complete information on a character-map, suitable for loading to another server via cmapcreate(NetricsCharmap).
        Throws:
        NetricsException - If the server indicates an error has occurred.
        java.io.IOException - If an I/O error occurs
        java.lang.IllegalArgumentException - if the character-map name is null.
      • cmap_stats

        public NetricsCharmapStats[] cmap_stats​(java.lang.String[] cmap_names)
                                         throws java.io.IOException,
                                                NetricsException
        Lists statistics on character maps currently loaded on the server.

        Parameters:
        cmap_names - A list of the character map names who's statistics should be returned. If null statistics on all character maps is returned.
        Returns:
        An array of NetricsCharmapStats, one per character map loaded in the ibi™ Patterns - Search Server.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - CMAPNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsCharmapStats
      • tblmove

        public void tblmove​(java.lang.String oldName,
                            java.lang.String newName)
                     throws java.io.IOException,
                            NetricsException
        Rename a table. Call this method to rename an existing table. Note that if the table with the name newName already exists, it will be deleted, and replaced by the table that you are renaming.

        Parameters:
        oldName - The name of the table that will be renamed
        newName - The new name of the table
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLMOVESAME, TBLNOTFOUND, EXPECTTBLDESC, FEATURESET, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • tbldelete

        public void tbldelete​(java.lang.String tblName)
                       throws java.io.IOException,
                              NetricsException
        Delete a table. Call this method to delete an existing table.

        Parameters:
        tblName - The name of the table to be deleted
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, NOTBLDESC, NOSYSINIT)
        java.io.IOException - If an I/O error occurs
      • recget

        public NetricsRecord recget​(java.lang.String tblName,
                                    java.lang.String recKey)
                             throws java.io.IOException,
                                    NetricsException
        Get a single record from a table.
        Parameters:
        tblName - a table name.
        recKey - The record key of the record
        Returns:
        a record from the specified table.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        java.lang.IllegalArgumentException - if the table name or record key is null
        See Also:
        NetricsTableStats
      • getChildRecord

        public NetricsRecord getChildRecord​(java.lang.String table_name,
                                            java.lang.String parent_key,
                                            java.lang.String child_key)
                                     throws java.io.IOException,
                                            NetricsException
        Throws:
        java.io.IOException
        NetricsException
      • getChildRecords

        public NetricsRecord[] getChildRecords​(java.lang.String table_name,
                                               java.lang.String[] parent_keys,
                                               java.lang.String[] child_keys)
                                        throws java.io.IOException,
                                               NetricsException
        Get multiple records from a child table.

        This method should typically be used instead of performing multiple single record "gets" for performance reasons.

        Parameters:
        table_name - The name of the child table to get the records from.
        parent_keys - The parent record keys of the records to get.
        child_keys - The child record keys of the records to get. If null is passed in then all child records with the given parent record keys are returned.
        Returns:
        An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 1 or more records for each parent key is returned. There is a limit of parent_keys.length+10000 on the number of records that are returned. If this limit is exceeded a NetricsException with code ARRAYLEN is returned.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsRecord
      • getChildRecords

        public NetricsRecord[] getChildRecords​(java.lang.String table_name,
                                               NetricsRecord.ChildType child_type,
                                               java.lang.String[] parent_keys,
                                               java.lang.String[] child_keys)
                                        throws java.io.IOException,
                                               NetricsException
        Get multiple records from a child table.

        This method should typically be used instead of performing multiple single record "gets" for performance reasons.

        This method adds the ability to specify the type of child records to be returned: ORPHANS, NONORPHANS or all types.

        Parameters:
        table_name - The name of the child table to get the records from
        child_type - The type of child records to return. One of ORPHANS, NONORPHANS or ALL.
        parent_keys - The parent record keys of the records to get
        child_keys - The child record keys of the records to get. If null is passed in then all child records with the given parent record keys are returned.
        Returns:
        An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 1 or more records for each parent key is returned. There is a limit of parent_keys.length+10000 on the number of records that are returned. If this limit is exceeded a NetricsException with code ARRAYLEN is returned.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsRecord
      • getChildRecords

        public NetricsRecord[] getChildRecords​(java.lang.String table_name,
                                               NetricsRecord.ChildType child_type,
                                               java.lang.String[] parent_keys,
                                               java.lang.String[] child_keys,
                                               boolean do_max_work)
                                        throws java.io.IOException,
                                               NetricsException
        Get multiple records from a child table.

        This method should typically be used instead of performing multiple single record "gets" for performance reasons.

        This method adds the ability to specify the type of child records to be returned: ORPHANS, NONORPHANS or all types.

        Parameters:
        table_name - The name of the child table to get the records from
        child_type - The type of child records to return. One of ORPHANS, NONORPHANS or ALL.
        parent_keys - The parent record keys of the records to get
        child_keys - The child record keys of the records to get. If null is passed in then all child records with the given parent record keys are returned.
        do_max_work - If true record not found errors are ignored.
        Returns:
        An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 0 or more records for each parent key is returned. There is a limit of parent_keys.length+10000 on the number of records that are returned. If this limit is exceeded a NetricsException with code ARRAYLEN is returned.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsRecord
      • delChildRecord

        public NetricsTableStats delChildRecord​(java.lang.String table_name,
                                                java.lang.String parent_key,
                                                java.lang.String child_key,
                                                boolean doMaxWork)
                                         throws java.io.IOException,
                                                NetricsException
        Throws:
        java.io.IOException
        NetricsException
      • delChildRecords

        public NetricsTableStats delChildRecords​(java.lang.String table_name,
                                                 java.lang.String[] parent_keys,
                                                 java.lang.String[] child_keys,
                                                 boolean doMaxWork)
                                          throws java.io.IOException,
                                                 NetricsException
        Delete multiple records from a child table.
        Parameters:
        table_name - The name of the child table from which the records will be deleted
        parent_keys - The parent record keys of the records to delete
        child_keys - The child record keys of the records to delete. If null is passed in then all child records with the given parent record keys are deleted.
        doMaxWork - Continue on error - deletes those records which do exist
        Returns:
        The statistics for the table after the records have been deleted
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • delChildRecords

        public NetricsTableStats delChildRecords​(java.lang.String table_name,
                                                 NetricsRecord.ChildType child_type,
                                                 java.lang.String[] parent_keys,
                                                 java.lang.String[] child_keys,
                                                 boolean doMaxWork)
                                          throws java.io.IOException,
                                                 NetricsException
        Delete multiple records from a child table. This method adds the ability to select child records for deletion by orphan status. Only records with the given orphan status are deleted.
        Parameters:
        table_name - The name of the child table from which the records will be deleted
        child_type - The type of child records to delete. One of ORPHANS, NONORPHANS or ALL.
        parent_keys - The parent record keys of the records to delete
        child_keys - The child record keys of the records to delete. If null is passed in then all child records with the given parent record keys are deleted.
        doMaxWork - Continue on error - deletes those records which do exist
        Returns:
        The statistics for the table after the records have been deleted
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • getCompoundRecords

        public NetricsCompoundRecord[] getCompoundRecords​(java.lang.String parent_table,
                                                          java.lang.String[] child_tables,
                                                          java.lang.String... parent_keys)
                                                   throws java.io.IOException,
                                                          NetricsException,
                                                          java.lang.IllegalArgumentException
        Get multiple compound records.

        This method is used to retrieve compound records. A compound record consists of a parent record and all child records linked to that parent record. The records are fetched based on a list of the keys of the parent records. A list of the child tables to be included can be specified, by default all child tables of the parent table are included.

        Parameters:
        parent_table - The name of the parent table. The table listed must exist in the Patterns server and have a table type of parent.
        child_tables - A list of the names of the child tables to be included in the compound record. All tables listed must be a child table of the given parent table. Duplicate names are not allowed. The order of listing is irrelevant. If this is null all child tables of the given parent table are included.
        parent_keys - The parent record keys of the records to get
        Returns:
        An array of NetricsCompoundRecords.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
        java.io.IOException - If an I/O error occurs
        java.lang.IllegalArgumentException - if parent_table is not a parent table, or if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list.
        See Also:
        NetricsCompoundRecord
      • recadd

        public NetricsTableStats recadd​(java.lang.String tblName,
                                        NetricsRecSrc src,
                                        boolean doMaxWork,
                                        int estNumRecs)
                                 throws java.io.IOException,
                                        NetricsException
        Add multiple records to a table.
        Parameters:
        tblName - The name of the table to which the records will be added.
        src - The record source for those records which will be added.
        doMaxWork - Continue on error - adds those records which do not already exist.
        estNumRecs - The estimated number of records in the record source. This is used by the server to determine the most efficient loading method. It need not be exact or even close.
        Returns:
        The statistics for the table after the records have been added
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECEXISTS, UPDPARAM, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • recadd

        public NetricsTableStats recadd​(java.lang.String tblName,
                                        NetricsRecord rec)
                                 throws java.io.IOException,
                                        NetricsException
        Add a single record to a table.

        Parameters:
        tblName - The name of the table that the record will be added to
        rec - The record which will be added
        Returns:
        The statistics for the table after the record has been added
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • recdelete

        public NetricsTableStats recdelete​(java.lang.String tblName,
                                           java.lang.String[] recKeys,
                                           boolean doMaxWork)
                                    throws java.io.IOException,
                                           NetricsException
        Delete multiple records from a table.

        Parameters:
        tblName - The name of the table from which the records will be deleted
        recKeys - The record keys of the records to be deleted
        doMaxWork - Continue on error - deletes those records which do exist
        Returns:
        The statistics for the table after the records have been deleted.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • recdelete

        public NetricsTableStats recdelete​(java.lang.String tblName,
                                           java.lang.String recKey)
                                    throws java.io.IOException,
                                           NetricsException
        Delete a single record from a table.

        Parameters:
        tblName - The name of the table from which the record will be deleted
        recKey - The record key of the record to be deleted
        Returns:
        The statistics for the table after the record has been deleted
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • delCompoundRecords

        public NetricsTableStats[] delCompoundRecords​(java.lang.String parent_table,
                                                      java.lang.String[] child_tables,
                                                      java.lang.String[] parent_keys,
                                                      boolean delete_orphans,
                                                      boolean doMaxWork)
                                               throws java.io.IOException,
                                                      NetricsException,
                                                      java.lang.IllegalArgumentException
        Deletes a set of records from a parent table, and deletes associated child records from child tables.
        Parameters:
        parent_table - The name of the parent table. The table must exist in the Patterns server and have a table type of parent.
        child_tables - A list of names of child tables. Only child records from these tables are deleted. All tables listed must be children of parent_table. Duplicate names are not allowed. If this is null all child tables of the given parent table are included.
        parent_keys - Keys of parent records to be deleted.
        delete_orphans - If true, all child records whose parent-reference matches one of the keys in parent_keys will be deleted, regardless of orphan status.
        If false, only non-orphan child records whose parent-reference matches one of the keys in parent_keys will be deleted.
        doMaxWork - Ignore record-not-found errors when deleting from the parent table.
        Returns:
        A list of table statistics. The first item on the list is the statistics for the parent table after the delete is performed. The remaining items on the list are the statistics for the child tables after the deletes are performed, in the same order as given in child_tables. If child_tables was null the order is arbitrary.
        Throws:
        NetricsException - If the server indicates an error occurred.
        Possible errors: TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN
        java.io.IOException - If an I/O error occurs
        java.lang.IllegalArgumentException - if parent_table is not a parent table, or if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list, or if parent_keys is null, or if parent_table is null, or if a child table name is null.
        See Also:
        NetricsCompoundRecord
      • recreplace

        public NetricsTableStats recreplace​(java.lang.String tblName,
                                            NetricsRecSrc src,
                                            boolean doMaxWork)
                                     throws java.io.IOException,
                                            NetricsException
        Replace a set of records in a table.

        Parameters:
        tblName - The name of the table containing the records being replaced
        src - The record source for those records which will be replaced
        doMaxWork - Continue on error - replaces those records which do exist
        Returns:
        The statistics for the table after the records have been replaced
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECNOTFOUND, UPDPARAM, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • recreplace

        public NetricsTableStats recreplace​(java.lang.String tblName,
                                            NetricsRecord rec)
                                     throws java.io.IOException,
                                            NetricsException
        Replace a single existing record in a table.
        Parameters:
        tblName - The name of the table containing the record being replaced
        rec - The new record. The value of its record key should be the record key of the record being replaced.
        Returns:
        The statistics for the table after the record has been replaced
        Throws:
        NetricsException - If the server indicates that an error has occurred.
        java.io.IOException - If an I/O error occurs.
        See Also:
        NetricsTableStats
      • recupdate

        public NetricsTableStats recupdate​(java.lang.String tblName,
                                           NetricsRecSrc src,
                                           boolean doMaxWork)
                                    throws java.io.IOException,
                                           NetricsException
        Update a set of records in a table.

        Update operations add the record if it does not exist and replace the record if it does.

        Parameters:
        tblName - The name of the table containing the records being updated
        src - The record source for those records which will be updated
        doMaxWork - Continue on error - update as man records as possible, ignoring records with errors.
        Returns:
        The statistics for the table after the records have been updated
        Throws:
        NetricsException - If the server indicates that an error has occurred (possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECNOTFOUND, UPDPARAM, SHUTDOWN)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • recupdate

        public NetricsTableStats recupdate​(java.lang.String tblName,
                                           NetricsRecord rec)
                                    throws java.io.IOException,
                                           NetricsException
        Update a single existing record in a table.

        Parameters:
        tblName - The name of the table containing the record being updated.
        rec - The new version of the record.
        Returns:
        The statistics for the table after the record has been updated
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsTableStats
      • doRecOps

        public NetricsTableStats doRecOps​(java.lang.String table_name,
                                          boolean do_max_work,
                                          NetricsRecOpSrc rec_ops)
                                   throws java.io.IOException,
                                          NetricsException,
                                          NetricsRecSrcException,
                                          java.lang.IllegalArgumentException
        Perform a mixed set of record updates. This method performs a set of record update operations. The operations to perform are defined by a stream of NetricsRecOp objects. The operations are performed in the order they are returned from the NetricsRecOpSrc. Record operations performed earlier in the stream are seen by later operations in the stream. For example if a new record is added, a delete that follows it will delete the added record instead of failing. All operations are committed or rolled back as a unit.
        Parameters:
        table_name - the name of the ibi™ Patterns - Search table holding the records.
        do_max_work - If true record key and record format errors are quietly ignored.
        rec_ops - The source that provides the stream of record operations.
        Returns:
        The statistics for the table after the operations have been performed.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - on errors returned by the ibi™ Patterns - Search server.
        NetricsRecSrcException - on errors retrieving the record operations.
        java.lang.IllegalArgumentException - if rec_ops is null.
      • doRecOps

        public NetricsTableStats doRecOps​(java.lang.String table_name,
                                          boolean do_max_work,
                                          NetricsRecOp... rec_ops)
                                   throws java.io.IOException,
                                          NetricsException,
                                          NetricsRecSrcException,
                                          java.lang.IllegalArgumentException
        Perform a mixed set of record updates. This method performs a set of record update operations. The operations to perform are defined by an array of NetricsRecOp objects. The operations are performed in the order they are given. Record operations performed earlier in the array are seen by later operations in the array. For example if a new record is added, a delete that follows it will delete the added record instead of failing. All operations are committed or rolled back as a unit.
        Parameters:
        table_name - the name of the ibi™ Patterns - Search table holding the records.
        do_max_work - If true record key and record format errors are quietly ignored.
        rec_ops - An array or list of record operations.
        Returns:
        The statistics for the table after the operations have been performed.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - on errors returned by the ibi™ Patterns - Search server.
        NetricsRecSrcException - on errors retrieving the record operations.
        java.lang.IllegalArgumentException - if rec_ops is null.
      • cmdstats

        public NetricsCmdStats[] cmdstats​(java.lang.String[] cmd_names)
                                   throws java.io.IOException,
                                          NetricsException
        Retrieve processing statistics for commands.

        This reports statistics for the named commands. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands. This command will generate a report that includes all commands completed from the time the server was started until the time the request was received.

        Parameters:
        cmd_names - The names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
        Returns:
        An array of NetricsCmdStats objects, one per requested command.
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - PARAMVAL, EXPECTLIST, INTERNAL)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsCmdStats
      • cmdstats

        public NetricsCmdStats[] cmdstats​(java.lang.String[] cmd_names,
                                          double duration)
                                   throws java.io.IOException,
                                          NetricsException
        Retrieve processing statistics for specified duration for commands.

        This reports statistics for the named commands starting from the present moment going duration seconds into the past. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

        The duration value is approximate. Each time a report request is made that does not request a specific end_time a reporting tic-mark is made at that time. The start and end time for a report will be reset to the closest time tic-mark set by a previous report. (This implies the first report always includes the entire time span since the start of the server.) The normal procedure is to request reports at a fixed interval requesting durations in units of the request interval. E.g. request a report every 5 minutes covering a 15 minute period.

        Parameters:
        cmd_names - The names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
        duration - The time period in seconds to be covered by this report.
        Returns:
        An array of NetricsCmdStats objects, one per requested command.
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - PARAMVAL, PARAMCONFLICT, EXPECTLIST, INTERNAL)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsCmdStats
      • cmdstats

        public NetricsCmdStats[] cmdstats​(java.lang.String[] cmd_names,
                                          double duration,
                                          double end_time)
                                   throws java.io.IOException,
                                          NetricsException
        Retrieve processing statistics for specified time period.

        This reports statistics for the named commands ending at the given time going duration seconds into the past from that time. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

        The end time and duration are approximate. Each time a report request is made that does not request a specific end time a reporting tic-mark is made at that time. The start and end time for a report will be reset to the closest time tic-mark set by a previous report. (This implies the first report always includes the entire time span since the start of the server.) The normal procedure is to request reports at a fixed interval requesting durations in units of the request interval. E.g. request a report every 5 minutes covering a 15 minute period.

        The end_time value is given in milliseconds from an arbitrary epic point, thus the only valid way to get an end_time value is to use a value returned by a previous report. So if you are requesting reports every 5 minutes and you want reports that cover the previous 5, 10, 15 minutes and the entire server time span the normal procedure would be something like:
        String[] cmd_list = new { NetricsCmdStats.CMD_ALL };
        NetricsCmdStats[] report_5 ;
        NetricsCmdStats[] report_10 ;
        NetricsCmdStats[] report_15 ;
        NetricsCmdStats[] report_forever ;
        report_5 = si.cmdstats(cmd_list,60.0*5.0);
        double end_time = report_5[0].end_time();
        report_10 = si.cmdstats(cmd_list,60.0*10.0,end_time);
        report_15 = si.cmdstats(cmd_list,60.0*15.0,end_time);
        report_forever = si.cmdstats(cmd_list,-1.0,end_time);

        Parameters:
        cmd_names - The names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
        duration - The time period in seconds to be covered by this report. -1.0 can be used to indicate "forever".
        end_time - The ending time for a report.
        Returns:
        An array of NetricsCmdStats objects, one per requested command.
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - PARAMVAL, PARAMCONFLICT, EXPECTLIST, INTERNAL)
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsCmdStats
      • cmdstats_reset

        public void cmdstats_reset​(java.lang.String[] cmd_names,
                                   double start_time)
                            throws java.io.IOException,
                                   NetricsException
        Reset processing statistics for the specified commands.

        This resets the processing statistics, removing any collected statistics for commands completed before start_time (the present moment if < 0.0). A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

        The start_time value is given in milliseconds from an arbitrary epic point, thus the only valid way to get a start_time value is to use a value returned by a previous report. As with end_time the start time is approximate and matches the start time of previously tic-marked reports.

        Parameters:
        cmd_names - The names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
        start_time - Data for commands before this point is deleted.
        Throws:
        NetricsException - If the server indicates an error has occurred (Possible errors - PARAMVAL, PARAMCONFLICT, EXPECTLIST, INTERNAL)
        java.io.IOException - If an I/O error occurs
      • svrlogon

        public void svrlogon()
                      throws java.io.IOException,
                             NetricsException
        Turn on search logging. The server must have been started with search logging enabled.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - LOGFILE, IPCERR, IPCTIMEOUT, IPCEOF, HANDSHAKE)
        java.io.IOException - If an I/O error occurs
      • svrlogoff

        public void svrlogoff()
                       throws java.io.IOException,
                              NetricsException
        Turn off search logging (must be enabled when the server starts up).

        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - EXPECTRTBLDESC, IPCERR, IPCTIMEOUT, IPCEOF, HANDSHAKE)
        java.io.IOException - If an I/O error occurs
      • server_info

        public NetricsServerStats server_info()
                                       throws java.io.IOException,
                                              NetricsException
        Retrieve the server version information. This returns the complete server version and status information.
        Returns:
        a NetricsServerStats object.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsServerStats
      • svrversion

        public java.lang.String svrversion()
                                    throws java.io.IOException,
                                           NetricsException
        Retrieve the version information of this interface. This returns the raw server_info string from the NetricsServerStats.
        Returns:
        The ibi™ Patterns - Search Server's version string
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
        See Also:
        server_info(), NetricsServerStats
      • isDecisionEngine

        @Deprecated
        public boolean isDecisionEngine()
                                 throws java.io.IOException,
                                        NetricsException
        Deprecated.
        Return true if the server indicates it supports Learn Models.

        This returns true if the server indicates it supports Learn Models. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support Learn Models.

        Returns:
        True if the server supports Learn Models, False otherwise.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • isGIPEnabled

        public boolean isGIPEnabled()
                             throws java.io.IOException,
                                    NetricsException
        Return true if the server indicates GIP is the default prefilter.

        This returns true if the server indicates tables creation uses the GIP prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support the GIP prefilter.

        Returns:
        as described above
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • isSortEnabled

        public boolean isSortEnabled()
                              throws java.io.IOException,
                                     NetricsException
        Return true if the server indicates SORT is the default prefilter.

        This returns true if the server indicates tables creation uses the SORT prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support the Sort prefilter.

        Returns:
        as described above
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • isPsiEnabled

        public boolean isPsiEnabled()
                             throws java.io.IOException,
                                    NetricsException
        Return true if the server indicates PSI is the default prefilter.

        This returns true if the server indicates tables creation uses the PSI prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before PSI was released.

        Returns:
        as described above
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • isDurableDataEnabled

        public boolean isDurableDataEnabled()
                                     throws java.io.IOException,
                                            NetricsException
        Return true if the server is using the durable-data feature.
        Returns:
        true if the server is using the durable-data feature.
        Throws:
        java.io.IOException - If an I/O error occurs
        NetricsException - If the server indicates an error has occurred.
        See Also:
        NetricsServerStats.durable_data()
      • version

        public java.lang.String version()
        Retrieve the ibi™ Patterns - Search Server Interface version information.
        Returns:
        the ibi™ Patterns - Search Server Interface version information.
      • loadClusterConfiguration

        public void loadClusterConfiguration​(java.lang.String file_name)
                                      throws java.io.IOException,
                                             NetricsException
        Load a new cluster configuration file on the gateway server.
        Parameters:
        file_name - The name of the new file. This file and path must be recognizable within the context of the cluster gateway.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • svrnoop

        public void svrnoop()
                     throws java.io.IOException,
                            NetricsException
        Perform a noop on the ibi™ Patterns - Search Server.

        This method is the quickest way to determine if the ibi™ Patterns - Search Server is responding or not.

        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • listTransactions

        public NetricsTranStats[] listTransactions​(int idle_cutoff)
                                            throws NetricsException,
                                                   java.io.IOException
        Returns an array of NetricsTranStats objects, one object for each open transaction with an idle time greater than idle_cutoff. If idle_cutoff is less than 0 all open transactions are returned.
        Parameters:
        idle_cutoff - an idle time cutoff, in seconds
        Returns:
        an array of transactions statistics.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • tranAbort

        public void tranAbort​(long tran_id)
                       throws java.io.IOException,
                              NetricsException
        This method aborts the transaction with full transaction id tran_id. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server. Should communications with the server fail an IOException is thrown.
        Parameters:
        tran_id - id of the transaction to abort
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • tranCommit

        public void tranCommit​(long tran_id)
                        throws java.io.IOException,
                               NetricsException
        This method commits the transaction with full transaction id tran_id. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server. Should communications with the server fail an IOException is thrown.
        Parameters:
        tran_id - id of the transaction to commit
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • tranForceCommit

        public void tranForceCommit​(long tran_id)
                             throws java.io.IOException,
                                    NetricsException
        This method commits the transaction with full transaction id tran_id, forcing the commit even if there were errors. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server. Should communications with the server fail an IOException is thrown.
        Parameters:
        tran_id - id of the transaction to forcefully commit.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • tranSetIdleOpts

        public void tranSetIdleOpts​(int idle_time,
                                    java.lang.String action)
                             throws java.io.IOException,
                                    NetricsException
        Set the idle transaction processing parameters on the server. This method is used to set the parameters that control how idle transactions are treated on the server. Transactions that sit idle for long periods of time can be cleaned up automatically by the server. These parameters define how that clean up processing is performed.

        A transaction is idle when no commands are being run under that transaction. The idle time is the time from the completion of the last command associated with the transaction to the present time.

        The purpose of idle transaction clean up is to take care of transactions that were abandoned, e.g. an application crashed in the middle of the transaction and thus will never close it. These parameters can be set from command line arguments when the server is started, so generally it is not necessary to do so from the API.

        The server doesn't guarantee that a transaction will be cleaned up as soon as it exceeds the idle time. Checks are made on a periodic basis, so transactions may be idle for some seconds past the maximum before they are detected.

        Parameters:
        idle_time - This defines how many seconds a transaction must sit idle before the clean up action is performed. If this value is zero the max idle time is considered to be infinite (i.e. no clean up is performed). If this value is less than zero the max idle time parameter is left unchanged.
        action - This defines the action to be performed on all transactions that exceed the maximum idle time. It is a one character flag with values: a abort the transaction, c commit the transaction, e abort the transaction if it has errors, otherwise commit the transaction, n do nothing. If this argument is null, an empty string or a single blank character the parameter is left unchanged.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • recnext

        public NetricsRecord[] recnext​(NetricsTableCursor cursor)
                                throws java.io.IOException,
                                       NetricsException
        Retrieve records from a table cursor. This fetches the next batch of records from a table cursor, updating the cursor position.

        Returns an array of records representing the next batch of records from the cursor. If the cursor is at EOT null is returned. The number of records returned could be less than the batch size if this is the last batch.

        Parameters:
        cursor - The cursor to fetch from.
        Returns:
        an array of records, or null if the cursor is at EOT.
        Throws:
        NetricsException - If the server indicates that an error has occurred
        java.io.IOException - If an I/O error occurs
      • compoundNext

        public NetricsCompoundRecord[] compoundNext​(NetricsTableCursor cursor)
                                             throws java.io.IOException,
                                                    NetricsException,
                                                    java.lang.IllegalArgumentException
        Retrieve compound records from a cursor.

        This method is used to retrieve compound records from a table cursor. A compound record consists of a parent record and all child records linked to that parent record. The cursor scans the parent table, and fetches all child records of the parent records returned to produce the compound records returned.

        Parameters:
        cursor - The cursor being used to scan the table.
        Returns:
        An array of NetricsCompoundRecords representing the next batch from the cursor, or null if the cursor is at EOT. The cursor position is updated.
        Throws:
        NetricsException - If the server indicates that an error has occurred (Possible errors - TBLNOTFOUND)
        java.io.IOException - If an I/O error occurs
        java.lang.IllegalArgumentException - if parent_table is not a parent table, of if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list.
        See Also:
        NetricsCompoundRecord, NetricsTableCursor
      • setServerLocale

        public java.util.Locale setServerLocale​(java.util.Locale locale)
        Sets the locale used by the interface when formatting exchanges with the server. Use this only if the server has been set to use a non-English locale. This should only be used on the advice of ibi support.
        Parameters:
        locale - the local to use, null resets to the default locale.
        Returns:
        the previous locale.
      • getFormatTransmitDuration

        public java.lang.Long getFormatTransmitDuration()
        Gets the time spent formatting and transmitting the last command the current thread executed on this interface object.
        Returns:
        nanoseconds, or null if there was no such command.
      • getServerDuration

        public java.lang.Long getServerDuration()
        Gets the time spent waiting for the server to begin responding to the last command the current thread executed on this interface object.
        Returns:
        nanoseconds, or null if there was no such command.
      • getReceiveParseDuration

        public java.lang.Long getReceiveParseDuration()
        Gets the time spent receiving and parsing the response to the last command the current thread executed on this interface object.
        Returns:
        nanoseconds, or null if there was no such command.
      • getCommandDuration

        public java.lang.Long getCommandDuration()
        Gets the total time spent on the last command the current thread executed on this interface object.
        Returns:
        nanoseconds, or null if there was no such command.
      • isSSLEnabled

        public boolean isSSLEnabled()
        Returns the SSL enable flag.
        SSL is enabled by default for non-embedded servers.
        See NetricsConMgr.isSSLEnabled().
        Returns:
        the SSL enable flag
      • setSSLEnabled

        public void setSSLEnabled​(boolean enable)
        Sets the SSL enable flag.
        SSL is enabled by default for non-embedded servers.
        See NetricsConMgr.setSSLEnabled(boolean).
        Parameters:
        enable - true to enable SSL, false to disable.
      • getSSLSocketFactory

        public javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
        Returns the current SSL socket factory.
        The factory is ignored if SSL is disabled.
        See NetricsConMgr.getSSLSocketFactory().
        Returns:
        the current SSL socket factory, or null if the default factory will be used.
      • setSSLSocketFactory

        public void setSSLSocketFactory​(javax.net.ssl.SSLSocketFactory factory)
        Sets the current SSL socket factory.

        There are two ways to control the SSL socket factory:
        1. Create one in application code and set it using setSSLSocketFactory(SSLSocketFactory)
        2. Modify the default factory by changing the javax.net.ssl.trustStore property

        The factory is ignored if SSL is disabled.
        See NetricsConMgr.setSSLSocketFactory(SSLSocketFactory).
        Parameters:
        factory - A socket factory, or null to use the default factory.