Class KnativeEnvironment
java.lang.Object
org.apache.camel.component.knative.spi.KnativeEnvironment
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlookup(Knative.Type type, String name) static KnativeEnvironmentmandatoryLoadFromProperties(org.apache.camel.CamelContext context, Map<String, Object> properties) Construct an instance o aKnativeEnvironmentfrom a properties.static KnativeEnvironmentmandatoryLoadFromResource(org.apache.camel.CamelContext context, String path) Construct an instance o aKnativeEnvironmentfrom a json file.static KnativeEnvironmentmandatoryLoadFromSerializedString(String configuration) Construct an instance o aKnativeEnvironmentfrom a json serialized string.static KnativeEnvironmenton(KnativeResource... definitions) serviceBuilder(Knative.Type type, String name) voidsetResources(List<KnativeResource> resources) stream()
-
Constructor Details
-
KnativeEnvironment
public KnativeEnvironment() -
KnativeEnvironment
-
-
Method Details
-
getResources
-
setResources
-
stream
-
lookup
-
mandatoryLoadFromSerializedString
public static KnativeEnvironment mandatoryLoadFromSerializedString(String configuration) throws IOException Construct an instance o aKnativeEnvironmentfrom 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 aKnativeEnvironmentfrom a properties.resources[0].name = ... resources[0].type = channel|endpoint|event resources[0].endpointKind = source|sink resources[0].url = ...- Parameters:
context- theCamelContextproperties- the properties from which to construct theKnativeEnvironment- 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 aKnativeEnvironmentfrom 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- theCamelContextpath- URI of the resource- Returns:
- an instance of
KnativeEnvironment - Throws:
IOException- if an error occur while parsing the file
-
on
-
serviceBuilder
public static KnativeEnvironment.KnativeServiceBuilder serviceBuilder(Knative.Type type, String name)
-