Interface SendOperationsInterface

  • All Known Subinterfaces:
    EngineClientInterface
    All Known Implementing Classes:
    EngineClientBean

    public interface SendOperationsInterface
    SendOperationsInterface is an interface that specifies the standard operations to enable an engine client to send events to a remote correlator.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void flushEvents()
      Wait for any outstanding events from previous calls sendEvents(Event...) or sendEvents(boolean, Event...) (where the boolean is true) into the Engine, and then return.
      void sendEvents​(boolean autoBatch, Event... events)
      Send events into the Engine, optionally not performing rebatching the actual event sending.
      void sendEvents​(Event... events)
      Send an array of Event objects to the engine (automatically rebatching the actual event sending for efficiency).
      void sendEventsFromFile​(java.util.List<java.lang.String> filenames, int loop)
      Send a number of events from a file or stdin.
      void sendEventsFromFile​(java.util.List<java.lang.String> filenames, int loop, boolean utf8)
      Send a number of events from a file or stdin.
      void sendEventsFromFile​(java.util.List<java.lang.String> filenames, int loop, boolean utf8, boolean autoBatch)
      Send a number of events from a file or stdin, specifying the file encoding detection mode and whether to auto-batch events or not.
      void sendEventsFromFile​(java.util.List<java.lang.String> filenames, int loop, boolean utf8, boolean autoBatch, java.lang.String defaultChannel)
      Send a number of events from a file or stdin, specifying the file encoding detection mode and whether to auto-batch events or not.
      void setCancelSendFileRead​(boolean newCancelFileReadValue)
      Setter for the cancelFileRead property for the Send operations.
    • Method Detail

      • sendEventsFromFile

        void sendEventsFromFile​(java.util.List<java.lang.String> filenames,
                                int loop)
                         throws EngineException
        Send a number of events from a file or stdin.

        If a connection is not yet established, this method will request a connection.

        The current implementation of this method does not perform automatic batching of the events, but a future release may change this behaviour, so please use the overloaded sendEventsFromFile(List, int, boolean, boolean) method if you require control over this. Auto-batching will usually provide better throughput.

        NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.

        Parameters:
        filenames - Names of files to read event descriptions from. A file name "-" is taken to be stdin.
        loop - Loop count for repeated reading of input data.
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
      • sendEventsFromFile

        void sendEventsFromFile​(java.util.List<java.lang.String> filenames,
                                int loop,
                                boolean utf8)
                         throws EngineException
        Send a number of events from a file or stdin.

        If a connection is not yet established, this method will request a connection.

        The current implementation of this method does not perform automatic batching of the events, but a future release may change this behaviour, so please use the overloaded sendEventsFromFile(List, int, boolean, boolean) method if you require control over this. Auto-batching will usually provide better throughput.

        NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.

        Parameters:
        filenames - Names of files to read event descriptions from. A file name "-" is taken to be stdin.
        loop - Loop count for repeated reading of input data.
        utf8 - If true, the specified files will be read as UTF-8; otherwise they will be read using the system default encoding unless they begin with a unicode Byte Order Mark (BOM) character.
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
      • sendEventsFromFile

        void sendEventsFromFile​(java.util.List<java.lang.String> filenames,
                                int loop,
                                boolean utf8,
                                boolean autoBatch)
                         throws EngineException
        Send a number of events from a file or stdin, specifying the file encoding detection mode and whether to auto-batch events or not.

        If a connection is not yet established, this method will request a connection.

        NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.

        Parameters:
        filenames - Names of files to read event descriptions from. A file name "-" is taken to be stdin.
        loop - Loop count for repeated reading of input data.
        utf8 - If true, the specified files will be read as UTF-8; otherwise they will be read using the system default encoding unless they begin with a unicode Byte Order Mark (BOM) character.
        autoBatch - If true, events will be automatically rebatched to improve throughput
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
      • sendEventsFromFile

        void sendEventsFromFile​(java.util.List<java.lang.String> filenames,
                                int loop,
                                boolean utf8,
                                boolean autoBatch,
                                java.lang.String defaultChannel)
                         throws EngineException
        Send a number of events from a file or stdin, specifying the file encoding detection mode and whether to auto-batch events or not.

        If a connection is not yet established, this method will request a connection.

        NOTE: Change in behaviour at Apama 3.0 - previously we ignored any missing files, now an exception is thrown.

        Parameters:
        filenames - Names of files to read event descriptions from. A file name "-" is taken to be stdin.
        loop - Loop count for repeated reading of input data.
        utf8 - If true, the specified files will be read as UTF-8; otherwise they will be read using the system default encoding unless they begin with a unicode Byte Order Mark (BOM) character.
        autoBatch - If true, events will be automatically rebatched to improve throughput
        defaultChannel - Channel to use for events which aren't specified in the input file
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
      • sendEvents

        void sendEvents​(Event... events)
                 throws EngineException
        Send an array of Event objects to the engine (automatically rebatching the actual event sending for efficiency). Please use the overloaded sendEvents(boolean, Event...) method if you require control over the rebatching. If a connection is not yet established, this method will request a connection.
        Parameters:
        events - An array with one or more Events to be sent.
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
        See Also:
        flushEvents()
      • sendEvents

        void sendEvents​(boolean autoBatch,
                        Event... events)
                 throws EngineException
        Send events into the Engine, optionally not performing rebatching the actual event sending. If a connection is not yet established, this method will request a connection.
        Parameters:
        autoBatch - If true, events will be automatically rebatched to improve throughput (even across separate sendEvents calls)
        events - The array of Events to be sent.
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
        See Also:
        flushEvents()
      • flushEvents

        void flushEvents()
                  throws EngineException,
                         java.lang.InterruptedException
        Wait for any outstanding events from previous calls sendEvents(Event...) or sendEvents(boolean, Event...) (where the boolean is true) into the Engine, and then return.
        Throws:
        EngineException - Thrown if any exceptions occur in the Client SDK.
        java.lang.InterruptedException - Thrown if this thread is interrupted while waiting for outstanding events to be sent and acknowledged (see Thread.interrupt().
      • setCancelSendFileRead

        void setCancelSendFileRead​(boolean newCancelFileReadValue)
        Setter for the cancelFileRead property for the Send operations. The purpose of the cancelFileRead property is to provide a mechanism to cleanly terminate the processing of events from file, when the sendEventsFromFile() method is in progress. When cancelFileRead is set to true, the event sending loop will terminate at the next iteration.
        Parameters:
        newCancelFileReadValue - New value for the cancelFileRead property.