Class KnativeEnvironment


  • @Configurer
    public class KnativeEnvironment
    extends Object
    • Constructor Detail

      • KnativeEnvironment

        public KnativeEnvironment()
    • Method Detail

      • mandatoryLoadFromSerializedString

        public static KnativeEnvironment mandatoryLoadFromSerializedString​(String configuration)
                                                                    throws IOException
        Construct an instance o a KnativeEnvironment from a json serialized string.
        
         {
             "resources": [
                 {
                      "type": "channel|endpoint|event",
                      "name": "",
                      "url": "",
                      "path": "",
                      "eventType": "",
                      "objectKind": "",
                      "objectApiVersion": "",
                      "endpointKind": "source|sink",
                      "filters": {
                          "header": "value"
                      },
                      "ceOverrides": {
                          "ce-type": "something"
                      }
                 },
             ]
         }
         
        Parameters:
        configuration - the serialized representation of the Knative environment
        Returns:
        an instance of KnativeEnvironment
        Throws:
        IOException - if an error occur while parsing the file
      • mandatoryLoadFromProperties

        public static KnativeEnvironment mandatoryLoadFromProperties​(org.apache.camel.CamelContext context,
                                                                     Map<String,​Object> properties)
        Construct an instance o a KnativeEnvironment from a properties.
        
         resources[0].name = ...
         resources[0].type = channel|endpoint|event
         resources[0].endpointKind = source|sink
         resources[0].url = ...
         
        Parameters:
        context - the CamelContext
        properties - the properties from which to construct the KnativeEnvironment
        Returns:
        an instance of KnativeEnvironment
        Throws:
        IOException - if an error occur while parsing the file
      • mandatoryLoadFromResource

        public static KnativeEnvironment mandatoryLoadFromResource​(org.apache.camel.CamelContext context,
                                                                   String path)
                                                            throws IOException
        Construct an instance o a KnativeEnvironment from a json file.
        
         {
             "resources": [
                 {
                      "type": "channel|endpoint|event",
                      "name": "",
                      "url": "",
                      "path": "",
                      "eventType": "",
                      "objectKind": "",
                      "objectApiVersion": "",
                      "endpointKind": "source|sink",
                      "filters": {
                          "header": "value"
                      },
                      "ceOverrides": {
                          "ce-type": "something"
                      }
                 },
             ]
         }
         
        Parameters:
        context - the CamelContext
        path - URI of the resource
        Returns:
        an instance of KnativeEnvironment
        Throws:
        IOException - if an error occur while parsing the file