Class KnativeEnvironment
- java.lang.Object
-
- org.apache.camel.component.knative.spi.KnativeEnvironment
-
@Configurer public class KnativeEnvironment extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKnativeEnvironment.KnativeServiceBuilder
-
Constructor Summary
Constructors Constructor Description KnativeEnvironment()KnativeEnvironment(Collection<KnativeResource> resources)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<KnativeResource>getResources()Stream<KnativeResource>lookup(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)static KnativeEnvironment.KnativeServiceBuilderserviceBuilder(Knative.Type type, String name)voidsetResources(List<KnativeResource> resources)Stream<KnativeResource>stream()
-
-
-
Constructor Detail
-
KnativeEnvironment
public KnativeEnvironment()
-
KnativeEnvironment
public KnativeEnvironment(Collection<KnativeResource> resources)
-
-
Method Detail
-
getResources
public List<KnativeResource> getResources()
-
setResources
public void setResources(List<KnativeResource> resources)
-
stream
public Stream<KnativeResource> stream()
-
lookup
public Stream<KnativeResource> lookup(Knative.Type type, String name)
-
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
public static KnativeEnvironment on(KnativeResource... definitions)
-
serviceBuilder
public static KnativeEnvironment.KnativeServiceBuilder serviceBuilder(Knative.Type type, String name)
-
-