Class RLinkServerInterface


  • public final class RLinkServerInterface
    extends java.lang.Object
    Provides more convenient communication with the Patterns server in situations that are frequently used in record pair scoring for Learn.
    • Constructor Summary

      Constructors 
      Constructor Description
      RLinkServerInterface​(com.netrics.likeit.NetricsServerInterface netricsSI)
      Constructs RLinkServerInterface object that wraps the given object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getFieldValues​(java.lang.String table, java.lang.String key)  
      com.netrics.likeit.NetricsServerInterface nsi()
      Returns the server interface object to be used for all standard server methods.
      java.util.List<com.netrics.likeit.NetricsSearchResult> searchForRecord​(com.netrics.likeit.NetricsSearchCfg tblCfg, com.netrics.likeit.NetricsSearchOpts opts)
      Searches for a given record in a single table.
      boolean tblExists​(java.lang.String table)
      Checks if a table exists on the server.
      void tblSafeDelete​(java.lang.String table)
      Deletes a table if it exists on the server, otherwise does nothing.
      • Methods inherited from class java.lang.Object

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

      • RLinkServerInterface

        public RLinkServerInterface​(com.netrics.likeit.NetricsServerInterface netricsSI)
        Constructs RLinkServerInterface object that wraps the given object.
        Parameters:
        netricsSI - - object to communicate with the server. Not null.
    • Method Detail

      • nsi

        public com.netrics.likeit.NetricsServerInterface nsi()
        Returns the server interface object to be used for all standard server methods.
        Returns:
        the internal NetricsServerInterface object.
      • tblExists

        public boolean tblExists​(java.lang.String table)
                          throws com.netrics.likeit.NetricsException,
                                 java.io.IOException
        Checks if a table exists on the server.
        Parameters:
        table - - the name of a table on the server.
        Returns:
        true if the specified table exists on the server.
        Throws:
        com.netrics.likeit.NetricsException - - errors on the server
        java.io.IOException - if I/O error occurs while communicating with server
      • tblSafeDelete

        public void tblSafeDelete​(java.lang.String table)
                           throws com.netrics.likeit.NetricsException,
                                  java.io.IOException
        Deletes a table if it exists on the server, otherwise does nothing.
        Parameters:
        table - - the name of a table on the server.
        Throws:
        com.netrics.likeit.NetricsException - if the server indicates that an error has occured (Possible errors - EXPECTTBLDESC, NOTBLDESC, NOSYSINIT)
        java.io.IOException - if an I/O error occurs while communicating with server
      • getFieldValues

        public java.util.List<java.lang.String> getFieldValues​(java.lang.String table,
                                                               java.lang.String key)
                                                        throws java.io.IOException,
                                                               com.netrics.likeit.NetricsException
        Parameters:
        table - - the name of the table on the server.
        key - - the key of a record in the table.
        Returns:
        field values for the record specified by the key.
        Throws:
        com.netrics.likeit.NetricsException - if the server indicates that an error has occured
        java.io.IOException - if an I/O error occurs while communicating with server
      • searchForRecord

        public java.util.List<com.netrics.likeit.NetricsSearchResult> searchForRecord​(com.netrics.likeit.NetricsSearchCfg tblCfg,
                                                                                      com.netrics.likeit.NetricsSearchOpts opts)
                                                                               throws com.netrics.likeit.NetricsException,
                                                                                      java.io.IOException
        Searches for a given record in a single table.
        Parameters:
        tblCfg - - search configuration for the table which will be searched
        opts - - configuration object for the overall search
        Returns:
        the search results (a fixed size list). If the input record has all blank field values that are queried by Simple/Cognate querylets, returns an empty list instead of throwing an exception.
        Throws:
        com.netrics.likeit.NetricsException - If the server indicates that an error has occured
        java.io.IOException - If an I/O error occurs
        See Also:
        NetricsServerInterface.search(NetricsSearchCfg[],NetricsSearchOpts)