Interface NetricsRecOpSrc

  • All Known Implementing Classes:
    NetricsArrayRecOpSrc

    public interface NetricsRecOpSrc
    Generic interface for reading record operations.

    This interface defines how record operations are passed into the API. By creating a class that implements this interface record operations can be streamed from any source through the ibi™ Patterns - Search Java API to the ibi™ Patterns - Search server. For example a DBMS table could be mirrored to a ibi™ Patterns - Search server by creating an implementation of this interface that scanned a DBMS transaction log to convert record operations recorded there into NetricsRecOp objects returned by this interface.

    The Java API comes with one predefined implementations of the NetricsRecOpSrc interface: NetricsArrayRecOpSrc is a simple array of record operations.

    See Also:
    NetricsRecOp, NetricsArrayRecOpSrc, NetricsServerInterface.doRecOps(String,boolean,NetricsRecOpSrc)
    • Method Detail

      • hasNext

        boolean hasNext()
                 throws NetricsRecSrcException
        True if getNext will return a record operation.
        Returns:
        True if there is another record operation, false otherwise.
        Throws:
        NetricsRecSrcException - if an error occurs.
      • getCur

        NetricsRecOp getCur()
        Returns the current record operation. This returns the last record operation fetched. If no record operation has been fetched, or getNext() was called at the end of file, this returns null.
        Returns:
        the current record operation, null if no current record operation set.
      • canReset

        boolean canReset()
        Returns true if this instance supports the reset method.
        Returns:
        true if this instance support the reset method, false otherwise.
      • reset

        void reset()
            throws NetricsRecSrcException,
                   java.lang.UnsupportedOperationException
        Reset the scan of records back to the beginning. This resets the scan of records back to the initial state. After this call there is no current record and getNext will retrieve the first record. Support for this method is optional. If it is not supported the canReset method should return false and a call to this method should throw an UnsupportedOperationException.
        Throws:
        NetricsRecSrcException - if there was an error in the reset.
        java.lang.UnsupportedOperationException - if this implementation doesn't support the reset operation.