Class ReactiveScopeEventingFunctionManager
EventingFunctions.-
Constructor Summary
ConstructorsConstructorDescriptionReactiveScopeEventingFunctionManager(ReactorOps reactor, AsyncScopeEventingFunctionManager asyncManager) Creates a newReactiveScopeEventingFunctionManager. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void> deployFunction(String name) Deploys anEventingFunctionidentified by its name.reactor.core.publisher.Mono<Void> deployFunction(String name, DeployFunctionOptions options) Deploys anEventingFunctionidentified by its name with custom options.reactor.core.publisher.Mono<Void> dropFunction(String name) Removes aEventingFunctionby its name if it exists.reactor.core.publisher.Mono<Void> dropFunction(String name, DropFunctionOptions options) Removes aEventingFunctionby its name if it exists with custom options.reactor.core.publisher.Mono<EventingStatus> Retrieves helpful status information about all functions currently created on the cluster.reactor.core.publisher.Mono<EventingStatus> functionsStatus(FunctionsStatusOptions options) Retrieves helpful status information about all functions currently created on the cluster with custom options.reactor.core.publisher.Flux<EventingFunction> Retrieves allEventingFunctionscurrently stored on the server.reactor.core.publisher.Flux<EventingFunction> getAllFunctions(GetAllFunctionsOptions options) Retrieves allEventingFunctionscurrently stored on the server with custom options.reactor.core.publisher.Mono<EventingFunction> getFunction(String name) Retrieves aEventingFunctionby its name.reactor.core.publisher.Mono<EventingFunction> getFunction(String name, GetFunctionOptions options) Retrieves aEventingFunctionby its name with custom options.reactor.core.publisher.Mono<Void> pauseFunction(String name) Pauses anEventingFunctionidentified by its name.reactor.core.publisher.Mono<Void> pauseFunction(String name, PauseFunctionOptions options) Pauses anEventingFunctionidentified by its name with custom options.reactor.core.publisher.Mono<Void> resumeFunction(String name) Resumes anEventingFunctionidentified by its name.reactor.core.publisher.Mono<Void> resumeFunction(String name, ResumeFunctionOptions options) Resumes anEventingFunctionidentified by its name with custom options.reactor.core.publisher.Mono<Void> undeployFunction(String name) Undeploys anEventingFunctionidentified by its name.reactor.core.publisher.Mono<Void> undeployFunction(String name, UndeployFunctionOptions options) Undeploys anEventingFunctionidentified by its name with custom options.reactor.core.publisher.Mono<Void> upsertFunction(EventingFunction function) Inserts or replaces aEventingFunction.reactor.core.publisher.Mono<Void> upsertFunction(EventingFunction function, UpsertFunctionOptions options) Inserts or replaces aEventingFunctionwith custom options.
-
Constructor Details
-
ReactiveScopeEventingFunctionManager
@Internal public ReactiveScopeEventingFunctionManager(ReactorOps reactor, AsyncScopeEventingFunctionManager asyncManager) Creates a newReactiveScopeEventingFunctionManager.This API is not intended to be called by the user directly, use
ReactiveCluster.eventingFunctions()instead.- Parameters:
asyncManager- the underlying async manager that performs the ops.
-
-
Method Details
-
upsertFunction
Inserts or replaces aEventingFunction.The eventing management API defines that if a function is stored which name does not exist yet, it will be inserted. If the name already exists, the function will be replaced with its new equivalent and the properties changed.
Operations which change the runtime-state of a function (i.e. deploy / undeploy / pause / resume) should not be modified through this method, but rather by using those methods directly (i.e.
deployFunction(String)).- Parameters:
function- the function to be inserted or replaced.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionCompilationFailureException- (async) if the function body cannot be compiled.CollectionNotFoundException- (async) if the specified collection or scope does not exist.BucketNotFoundException- (async) if the specified bucket does not exist.EventingFunctionIdenticalKeyspaceException- (async) if the source and metadata keyspace are the same.CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
upsertFunction
public reactor.core.publisher.Mono<Void> upsertFunction(EventingFunction function, UpsertFunctionOptions options) Inserts or replaces aEventingFunctionwith custom options.The eventing management API defines that if a function is stored which name does not exist yet, it will be inserted. If the name already exists, the function will be replaced with its new equivalent and the properties changed.
Operations which change the runtime-state of a function (i.e. deploy / undeploy / pause / resume) should not be modified through this method, but rather by using those methods directly (i.e.
deployFunction(String)).- Parameters:
function- the function to be inserted or replaced.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionCompilationFailureException- (async) if the function body cannot be compiled.CollectionNotFoundException- (async) if the specified collection or scope does not exist.BucketNotFoundException- (async) if the specified bucket does not exist.EventingFunctionIdenticalKeyspaceException- (async) if the source and metadata keyspace are the same.CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
getFunction
Retrieves aEventingFunctionby its name.- Parameters:
name- the name of the function to retrieve.- Returns:
- a
Monocompleting with the eventing function found or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
getFunction
public reactor.core.publisher.Mono<EventingFunction> getFunction(String name, GetFunctionOptions options) Retrieves aEventingFunctionby its name with custom options.- Parameters:
name- the name of the function to retrieve.options- the custom options to apply.- Returns:
- a
Monocompleting with the eventing function found or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
getAllFunctions
Retrieves allEventingFunctionscurrently stored on the server.If no functions are found, an empty flux is returned.
- Returns:
- a
Fluxcompleting with all eventing functions found or failed with an error. - Throws:
CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
getAllFunctions
public reactor.core.publisher.Flux<EventingFunction> getAllFunctions(GetAllFunctionsOptions options) Retrieves allEventingFunctionscurrently stored on the server with custom options.If no functions are found, an empty flux is returned.
- Parameters:
options- the custom options to apply.- Returns:
- a
Fluxcompleting with all eventing functions found or failed with an error. - Throws:
CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
dropFunction
Removes aEventingFunctionby its name if it exists.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to drop.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).EventingFunctionDeployedException- (async) if the function is currently deployed (undeploy first).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
dropFunction
Removes aEventingFunctionby its name if it exists with custom options.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to drop.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).EventingFunctionDeployedException- (async) if the function is currently deployed (undeploy first).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
deployFunction
Deploys anEventingFunctionidentified by its name.Calling this method effectively moves the function from state
EventingFunctionDeploymentStatus.UNDEPLOYEDto stateEventingFunctionDeploymentStatus.DEPLOYED.- Parameters:
name- the name of the function to deploy.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotBootstrappedException- (async) if the function is not bootstrapped yet (after creating it).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
deployFunction
Deploys anEventingFunctionidentified by its name with custom options.Calling this method effectively moves the function from state
EventingFunctionDeploymentStatus.UNDEPLOYEDto stateEventingFunctionDeploymentStatus.DEPLOYED.- Parameters:
name- the name of the function to deploy.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotBootstrappedException- (async) if the function is not bootstrapped yet (after creating it).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
undeployFunction
Undeploys anEventingFunctionidentified by its name.Calling this method effectively moves the function from state
EventingFunctionDeploymentStatus.DEPLOYEDto stateEventingFunctionDeploymentStatus.UNDEPLOYED.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to undeploy.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
undeployFunction
public reactor.core.publisher.Mono<Void> undeployFunction(String name, UndeployFunctionOptions options) Undeploys anEventingFunctionidentified by its name with custom options.Calling this method effectively moves the function from state
EventingFunctionDeploymentStatus.DEPLOYEDto stateEventingFunctionDeploymentStatus.UNDEPLOYED.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to undeploy.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
pauseFunction
Pauses anEventingFunctionidentified by its name.Calling this method effectively moves the function from state
EventingFunctionProcessingStatus.RUNNINGto stateEventingFunctionProcessingStatus.PAUSED.- Parameters:
name- the name of the function to pause.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotBootstrappedException- (async) if the function is not bootstrapped yet (after creating it).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
pauseFunction
Pauses anEventingFunctionidentified by its name with custom options.Calling this method effectively moves the function from state
EventingFunctionProcessingStatus.RUNNINGto stateEventingFunctionProcessingStatus.PAUSED.- Parameters:
name- the name of the function to pause.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotBootstrappedException- (async) if the function is not bootstrapped yet (after creating it).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
resumeFunction
Resumes anEventingFunctionidentified by its name.Calling this method effectively moves the function from state
EventingFunctionProcessingStatus.PAUSEDto stateEventingFunctionProcessingStatus.RUNNING.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to resume.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
resumeFunction
Resumes anEventingFunctionidentified by its name with custom options.Calling this method effectively moves the function from state
EventingFunctionProcessingStatus.PAUSEDto stateEventingFunctionProcessingStatus.RUNNING.Note that due to a bug on the server, depending on which version is used, both a
EventingFunctionNotFoundExceptionor aEventingFunctionNotDeployedExceptioncan be thrown if a function does not exist.- Parameters:
name- the name of the function to resume.options- the custom options to apply.- Returns:
- a
Monocompleting when the operation is applied or failed with an error. - Throws:
EventingFunctionNotFoundException- (async) if the function is not found on the server.EventingFunctionNotDeployedException- (async) if the function is not found on the server (see above).CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
functionsStatus
Retrieves helpful status information about all functions currently created on the cluster.- Returns:
- a
Monocompleting with the eventing status or failed with an error. - Throws:
CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-
functionsStatus
Retrieves helpful status information about all functions currently created on the cluster with custom options.- Parameters:
options- the custom options to apply.- Returns:
- a
Monocompleting with the eventing status or failed with an error. - Throws:
CouchbaseException- (async) if any other generic unhandled/unexpected errors.
-