Package org.rapidcontext.core.type
Class Procedure
java.lang.Object
org.rapidcontext.core.storage.StorableObject
org.rapidcontext.core.type.Procedure
- All Implemented Interfaces:
Procedure
- Direct Known Subclasses:
AppListProcedure
,ConnectionListProcedure
,ConnectionMetricsProcedure
,ConnectionValidateProcedure
,JsProcedure
,PluginInstallProcedure
,PluginListProcedure
,PluginLoadProcedure
,PluginUninstallProcedure
,PluginUnloadProcedure
,ProcedureCallProcedure
,ProcedureDeleteProcedure
,ProcedureListProcedure
,ProcedureMetricsProcedure
,ProcedureReadProcedure
,ProcedureTraceProcedure
,ProcedureTypesProcedure
,ProcedureWriteProcedure
,ResetProcedure
,SessionAuthenticateProcedure
,SessionAuthenticateTokenProcedure
,SessionCurrentProcedure
,SessionTerminateProcedure
,StatusProcedure
,StorageCopyProcedure
,StorageDeleteProcedure
,StorageListProcedure
,StorageQueryProcedure
,StorageReadProcedure
,StorageWriteProcedure
,ThreadContextProcedure
,ThreadCreateProcedure
,ThreadInterruptProcedure
,ThreadListProcedure
,TypeListProcedure
,UserAccessProcedure
,UserAuthenticationTokenProcedure
,UserChangeProcedure
,UserListProcedure
,UserPasswordChangeProcedure
,UserSearchProcedure
,UserSettingsProcedure
A server-side function or operation. Procedures may take arguments, modify
data and/or return values. They can be invoked either server-side or
client-side (via API) if permissions allow.
This generic type is used only for direct Java implementations. A number
of subtypes allows creating procedures from configurable parameters (e.g.
SQL text, HTTP requests, etc) instead, sharing a common reusable Java
implementation. When implementing procedures in Java, care must be taken so
that all operations are properly checked for security.
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
The default active procedure time (5 minutes).static final String
The dictionary key for the optional alias.static final String
The dictionary key for the binding array.static final String
The dictionary key for the optional deprecation message.static final String
The dictionary key for the description.static final Path
The procedure object storage path.Fields inherited from class org.rapidcontext.core.storage.StorableObject
dict, KEY_ACTIVATED_TIME, KEY_CLASSNAME, KEY_ID, KEY_TYPE, PREFIX_COMPUTED, PREFIX_HIDDEN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalias()
Returns the optional procedure alias.Returns a stream of all procedures found in the storage.abstract Object
call
(CallContext cx, Bindings bindings) Executes a call of this procedure in the specified context and with the specified call bindings.Returns the optional deprecation message.Returns the procedure description.static Procedure
Searches for a specific procedure in the storage.Returns the bindings for this procedure.Deprecated, for removal: This API element is subject to removal in a future version.Use description() instead.getName()
Deprecated, for removal: This API element is subject to removal in a future version.Use id() instead.protected boolean
isActive()
Checks if this object is in active use.Methods inherited from class org.rapidcontext.core.storage.StorableObject
activate, activatedTime, destroy, id, init, isModified, passivate, path, serialize, sterilize, toString, type
-
Field Details
-
KEY_DESCRIPTION
The dictionary key for the description.- See Also:
-
KEY_ALIAS
The dictionary key for the optional alias.- See Also:
-
KEY_DEPRECATED
The dictionary key for the optional deprecation message.- See Also:
-
KEY_BINDING
The dictionary key for the binding array.- See Also:
-
PATH
The procedure object storage path. -
ACTIVE_MILLIS
public static final long ACTIVE_MILLISThe default active procedure time (5 minutes).- See Also:
-
-
Constructor Details
-
Procedure
Creates a new procedure from a serialized representation.- Parameters:
id
- the object identifiertype
- the object type namedict
- the serialized representation- See Also:
-
-
Method Details
-
all
Returns a stream of all procedures found in the storage.- Parameters:
storage
- the storage to search- Returns:
- a stream of procedure instances found
-
find
Searches for a specific procedure in the storage.- Parameters:
storage
- the storage to search inid
- the procedure identifier- Returns:
- the procedure found, or null if not found
-
isActive
protected boolean isActive()Checks if this object is in active use. This method will return true if the object was activated during the last 5 minutes.- Overrides:
isActive
in classStorableObject
- Returns:
- true if the object is considered active, or false otherwise
-
getName
Deprecated, for removal: This API element is subject to removal in a future version.Use id() instead.Returns the procedure name. -
description
Returns the procedure description.- Returns:
- the procedure description
-
getDescription
Deprecated, for removal: This API element is subject to removal in a future version.Use description() instead.Returns the procedure description.- Specified by:
getDescription
in interfaceProcedure
- Returns:
- the procedure description
-
alias
Returns the optional procedure alias.- Returns:
- the procedure alias, or null for none
-
deprecated
Returns the optional deprecation message.- Returns:
- the deprecation message, or null for none
-
getBindings
Returns the bindings for this procedure. If this procedure requires any special data, adapter connection or input argument binding, those bindings should be set (but possibly to null or blank values).- Specified by:
getBindings
in interfaceProcedure
- Returns:
- the bindings for this procedure
-
call
Executes a call of this procedure in the specified context and with the specified call bindings. The semantics of what the procedure actually does, is up to each implementation. Note that the call bindings are normally inherited from the procedure bindings with arguments bound to their call values.- Specified by:
call
in interfaceProcedure
- Parameters:
cx
- the procedure call contextbindings
- the call bindings to use- Returns:
- the result of the call, or null if the call produced no result
- Throws:
ProcedureException
- if the call execution caused an error
-