org.apache.flume.sink.solr.morphline

## Class UUIDInterceptor

- java.lang.Object
- - org.apache.flume.sink.solr.morphline.UUIDInterceptor

- All Implemented Interfaces:
    Interceptor

      public class UUIDInterceptor
      extends Object
      implements Interceptor

  Flume Interceptor that sets a universally unique identifier on all events that are intercepted. By default this event header is named "id".

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `UUIDInterceptor.Builder` Builder implementations MUST have a public no-arg constructor

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `HEADER_NAME`
    `static String` | `PREFIX_NAME`
    `static String` | `PRESERVE_EXISTING_NAME`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `UUIDInterceptor(Context context)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Perform any closing / shutdown needed by the Interceptor.
    `protected String` | `generateUUID()`
    `protected String` | `getPrefix()`
    `void` | `initialize()` Any initialization / startup needed by the Interceptor.
    `Event` | `intercept(Event event)` Interception of a single `Event`.
    `List<Event>` | `intercept(List<Event> events)` Interception of a batch of events.
    `protected boolean` | `isMatch(Event event)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HEADER_NAME

          public static final String HEADER_NAME

      See Also:
        Constant Field Values

    - #### PRESERVE_EXISTING_NAME

          public static final String PRESERVE_EXISTING_NAME

      See Also:
        Constant Field Values

    - #### PREFIX_NAME

          public static final String PREFIX_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UUIDInterceptor

          protected UUIDInterceptor(Context context)

  - ### Method Detail

    - #### initialize

          public void initialize()

      Description copied from interface: `Interceptor`
      Any initialization / startup needed by the Interceptor.
      Specified by:
        `initialize` in interface `Interceptor`

    - #### getPrefix

          protected String getPrefix()

    - #### generateUUID

          protected String generateUUID()

    - #### isMatch

          protected boolean isMatch(Event event)

    - #### intercept

          public Event intercept(Event event)

      Description copied from interface: `Interceptor`
      Interception of a single `Event`.
      Specified by:
        `intercept` in interface `Interceptor`
      Parameters:
        `event` - Event to be intercepted
      Returns:
        Original or modified event, or `null` if the Event is to be dropped (i.e. filtered out).

    - #### intercept

          public List<Event> intercept(List<Event> events)

      Description copied from interface: `Interceptor`
      Interception of a batch of events.
      Specified by:
        `intercept` in interface `Interceptor`
      Parameters:
        `events` - Input list of events
      Returns:
        Output list of events. The size of output list MUST NOT BE GREATER than the size of the input list (i.e. transformation and removal ONLY). Also, this method MUST NOT return `null`. If all events are dropped, then an empty List is returned.

    - #### close

          public void close()

      Description copied from interface: `Interceptor`
      Perform any closing / shutdown needed by the Interceptor.
      Specified by:
        `close` in interface `Interceptor`

Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.