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 class
KnativeEnvironment.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 KnativeEnvironment
mandatoryLoadFromProperties(org.apache.camel.CamelContext context, Map<String,Object> properties)
Construct an instance o aKnativeEnvironment
from a properties.static KnativeEnvironment
mandatoryLoadFromResource(org.apache.camel.CamelContext context, String path)
Construct an instance o aKnativeEnvironment
from a json file.static KnativeEnvironment
mandatoryLoadFromSerializedString(String configuration)
Construct an instance o aKnativeEnvironment
from a json serialized string.static KnativeEnvironment
on(KnativeResource... definitions)
static KnativeEnvironment.KnativeServiceBuilder
serviceBuilder(Knative.Type type, String name)
void
setResources(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 aKnativeEnvironment
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 aKnativeEnvironment
from a properties.resources[0].name = ... resources[0].type = channel|endpoint|event resources[0].endpointKind = source|sink resources[0].url = ...
- Parameters:
context
- theCamelContext
properties
- 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 aKnativeEnvironment
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
- theCamelContext
path
- 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)
-
-