@Stability.Uncommitted public class EventingFunction extends Object
EventingFunction
stored or to be stored on the server.Modifier and Type | Class and Description |
---|---|
static class |
EventingFunction.Builder
This builder allows to customize the properties of the eventing function.
|
Modifier and Type | Method and Description |
---|---|
List<EventingFunctionBucketBinding> |
bucketBindings()
The bucket bindings for the function.
|
static EventingFunction.Builder |
builder(String name,
String code,
EventingFunctionKeyspace sourceKeyspace,
EventingFunctionKeyspace metadataKeyspace)
Creates a
EventingFunction.Builder that can be used to further customize the EventingFunction beyond the defaults. |
String |
code()
The actual javascript source code of the function.
|
List<EventingFunctionConstantBinding> |
constantBindings()
The constant bindings for the function.
|
static EventingFunction |
create(String name,
String code,
EventingFunctionKeyspace sourceKeyspace,
EventingFunctionKeyspace metadataKeyspace)
Creates a new
EventingFunction with the minimal required properties. |
boolean |
enforceSchema()
True if the schema should be enforced.
|
static List<EventingFunction> |
fromExportedFunctions(byte[] encoded)
Creates a list of
EventingFunction s from a raw JSON, usually exported from the server UI. |
static EventingFunction |
fromFunction(byte[] encoded)
Creates a
EventingFunction from a raw JSON. |
String |
functionInstanceId()
The function instance ID, provided by the server.
|
long |
handlerUuid()
The function UUID, provided by the server.
|
EventingFunctionKeyspace |
metadataKeyspace()
The keyspace where eventing stores the metadata for the function.
|
String |
name()
The name of the function.
|
EventingFunctionSettings |
settings()
The custom function settings applied.
|
EventingFunctionKeyspace |
sourceKeyspace()
The source keyspace where the actual data is accessed from.
|
String |
toString() |
List<EventingFunctionUrlBinding> |
urlBindings()
The URL bindings for the function.
|
String |
version()
The version of the function.
|
public static EventingFunction create(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace)
EventingFunction
with the minimal required properties.name
- the name of the function.code
- the code body of the function.sourceKeyspace
- the keyspace from where the source data is coming from.metadataKeyspace
- the keyspace where the function metadata is stored.EventingFunction
.public static EventingFunction.Builder builder(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace)
EventingFunction.Builder
that can be used to further customize the EventingFunction
beyond the defaults.name
- the name of the function.code
- the code body of the function.sourceKeyspace
- the keyspace from where the source data is coming from.metadataKeyspace
- the keyspace where the function metadata is stored.@Stability.Volatile public static EventingFunction fromFunction(byte[] encoded)
EventingFunction
from a raw JSON.
Note that the server exports it as a JSON array, so you might want to consider using
fromExportedFunctions(byte[])
for those.
encoded
- the encoded function to load.EventingFunction
.@Stability.Volatile public static List<EventingFunction> fromExportedFunctions(byte[] encoded)
EventingFunction
s from a raw JSON, usually exported from the server UI.encoded
- the encoded functions to load.EventingFunction
s.public String name()
public String code()
public EventingFunctionKeyspace sourceKeyspace()
public EventingFunctionKeyspace metadataKeyspace()
public String version()
public boolean enforceSchema()
public long handlerUuid()
public String functionInstanceId()
public EventingFunctionSettings settings()
public List<EventingFunctionBucketBinding> bucketBindings()
public List<EventingFunctionUrlBinding> urlBindings()
public List<EventingFunctionConstantBinding> constantBindings()
Copyright © 2024 Couchbase, Inc.. All rights reserved.