---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: eventadmin
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: eventadmin
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: eventadmin
        spec:
          containers:
          - image: funktion/connector-eventadmin:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: eventadmin
      syntax: eventadmin:topic
      title: OSGi EventAdmin
      description: The eventadmin component can be used in an OSGi environment to receive OSGi EventAdmin events and process them.
      label: eventbus
      deprecated: false
      async: false
      javaType: org.apache.camel.component.eventadmin.EventAdminComponent
      groupId: org.apache.camel
      artifactId: camel-eventadmin
      version: 2.18.3
    componentProperties:
      bundleContext:
        kind: property
        type: object
        javaType: org.osgi.framework.BundleContext
        deprecated: false
        secret: false
        description: The OSGi BundleContext is automatic injected by Camel
        order: 0
    properties:
      topic:
        kind: path
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Name of topic to listen or send to
        order: 0
      send:
        kind: parameter
        group: common
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Whether to use 'send' or 'synchronous' deliver. Default false (async delivery)
        order: 1
      bridgeErrorHandler:
        kind: parameter
        group: consumer
        label: consumer
        type: boolean
        javaType: boolean
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        defaultValue: false
        description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 2
      exceptionHandler:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: object
        javaType: org.apache.camel.spi.ExceptionHandler
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 3
      exchangePattern:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: string
        javaType: org.apache.camel.ExchangePattern
        enum:
        - InOnly
        - RobustInOnly
        - InOut
        - InOptionalOut
        - OutOnly
        - RobustOutOnly
        - OutIn
        - OutOptionalIn
        deprecated: false
        secret: false
        description: Sets the exchange pattern when the consumer creates an exchange.
        order: 4
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 5
  documentation.adoc: |
    [[EventAdmin-EventAdmincomponent]]
    EventAdmin component
    ~~~~~~~~~~~~~~~~~~~~

    *Available in Camel 2.6*

    The `eventadmin` component can be used in an OSGi environment to receive
    OSGi EventAdmin events and process them.

    [[EventAdmin-Dependencies]]
    Dependencies
    ^^^^^^^^^^^^

    Maven users need to add the following dependency to their `pom.xml`

    [source,xml]
    -------------------------------------------
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-eventadmin</artifactId>
      <version>${camel-version}</version>
    </dependency>
    -------------------------------------------

    where `${camel-version`} must be replaced by the actual version of Camel
    (2.6.0 or higher).

    [[EventAdmin-URIformat]]
    URI format
    ^^^^^^^^^^

    [source,xml]
    --------------------------
    eventadmin:topic[?options]
    --------------------------

    where `topic` is the name of the topic to listen too.

    [[EventAdmin-URIoptions]]
    URI options
    ^^^^^^^^^^^

    // component options: START
    The OSGi EventAdmin component supports 1 options which are listed below.



    {% raw %}
    [width="100%",cols="2,1m,7",options="header"]
    |=======================================================================
    | Name | Java Type | Description
    | bundleContext | BundleContext | The OSGi BundleContext is automatic injected by Camel
    |=======================================================================
    {% endraw %}
    // component options: END

    // endpoint options: START
    The OSGi EventAdmin component supports 6 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | topic | common |  | String | Name of topic to listen or send to
    | send | common | false | boolean | Whether to use 'send' or 'synchronous' deliver. Default false (async delivery)
    | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END

    [[EventAdmin-Messageheaders]]
    Message headers
    ^^^^^^^^^^^^^^^

    [width="100%",cols="10%,10%,80%",options="header",]
    |=======================================================================
    |Name |Type |Message |Description
    |=======================================================================

    [[EventAdmin-Messagebody]]
    Message body
    ^^^^^^^^^^^^

    The `in` message body will be set to the received Event.

    [[EventAdmin-Exampleusage]]
    Example usage
    ^^^^^^^^^^^^^

    [source,xml]
    ------------------------------
    <route>
        <from uri="eventadmin:*"/>
        <to uri="stream:out"/>
    </route>
    ------------------------------
