Class EventingFunction
java.lang.Object
com.couchbase.client.java.manager.eventing.EventingFunction
An immutable representation of the 
EventingFunction stored or to be stored on the server.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThis builder allows to customize the properties of the eventing function.
- 
Method SummaryModifier and TypeMethodDescriptionThe bucket bindings for the function.static EventingFunction.Builderbuilder(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace) Creates aEventingFunction.Builderthat can be used to further customize theEventingFunctionbeyond the defaults.code()The actual javascript source code of the function.The constant bindings for the function.static EventingFunctioncreate(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace) Creates a newEventingFunctionwith the minimal required properties.booleanTrue if the schema should be enforced.static List<EventingFunction> fromExportedFunctions(byte[] encoded) Creates a list ofEventingFunctions from a raw JSON, usually exported from the server UI.static EventingFunctionfromFunction(byte[] encoded) Creates aEventingFunctionfrom a raw JSON.The function instance ID, provided by the server.longThe function UUID, provided by the server.The keyspace where eventing stores the metadata for the function.name()The name of the function.settings()The custom function settings applied.The source keyspace where the actual data is accessed from.toString()The URL bindings for the function.version()The version of the function.
- 
Method Details- 
createpublic static EventingFunction create(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace) Creates a newEventingFunctionwith the minimal required properties.- Parameters:
- 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.
- Returns:
- the created EventingFunction.
 
- 
builderpublic static EventingFunction.Builder builder(String name, String code, EventingFunctionKeyspace sourceKeyspace, EventingFunctionKeyspace metadataKeyspace) Creates aEventingFunction.Builderthat can be used to further customize theEventingFunctionbeyond the defaults.- Parameters:
- 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.
- Returns:
- the builder to customize.
 
- 
fromFunctionCreates aEventingFunctionfrom a raw JSON.Note that the server exports it as a JSON array, so you might want to consider using fromExportedFunctions(byte[])for those.- Parameters:
- encoded- the encoded function to load.
- Returns:
- the created EventingFunction.
 
- 
fromExportedFunctionsCreates a list ofEventingFunctions from a raw JSON, usually exported from the server UI.- Parameters:
- encoded- the encoded functions to load.
- Returns:
- the created list of EventingFunctions.
 
- 
nameThe name of the function.
- 
codeThe actual javascript source code of the function.
- 
sourceKeyspaceThe source keyspace where the actual data is accessed from.
- 
metadataKeyspaceThe keyspace where eventing stores the metadata for the function.
- 
versionThe version of the function.
- 
enforceSchemapublic boolean enforceSchema()True if the schema should be enforced.
- 
handlerUuidpublic long handlerUuid()The function UUID, provided by the server.
- 
functionInstanceIdThe function instance ID, provided by the server.
- 
settingsThe custom function settings applied.
- 
bucketBindingsThe bucket bindings for the function.
- 
urlBindingsThe URL bindings for the function.
- 
constantBindingsThe constant bindings for the function.
- 
toString
 
-