Package org.chenile.core.model
Class OperationDefinition
java.lang.Object
org.chenile.core.model.OperationDefinition
Contains details about the particular operation of a service. Operations are methods in a service
-
Field Summary
Modifier and TypeFieldDescriptionprivate String[]
Acls of the incoming request.private boolean
protected Command<ChenileExchange>
Sometimes it is possible that the output is not specifiable since it can vary depending on the value of some headers.protected String[]
protected String
If this service needs to be cached then this is the cache settings IDprotected List<Command<ChenileExchange>>
protected String
protected MimeType
The incoming mime type determines the format of the input class.protected String
The event to which this operation subscribes.protected Map<Class<? extends Annotation>,
Annotation> protected String
Attach this operation to a file watch.protected HTTPMethod
private Class<?>
The input class expected within the body of the incoming ChenileExchangeprotected List<Command<ChenileExchange>>
protected Method
protected String
The actual method in the service that needs to be invoked.protected String
Operation Name needs to be unique within a service.private Class<?>
The output class expected to be passed to the actual service class that will be invoked.protected ParameterizedTypeReference<?>
private List<ParamDefinition>
protected MimeType
What is the mime type of the output produced? For all text based mime types it is assumed that the response object will contain the information that needs to be rendered.protected boolean
protected String
The service to which this operation is attached.private HttpStatus
private int
This operation is expected to process this event within the time out period.protected String
The URL to which this operation listens.private HttpStatus
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
String[]
getAcls()
String[]
getExtension
(String key) Deprecated.<T extends Annotation>
TgetExtensionAsAnnotation
(Class<T> klass) Deprecated.Class<?>
getInput()
getName()
Class<?>
int
int
getUrl()
int
int
hashCode()
boolean
boolean
isSecure()
void
putExtension
(String key, Object value) void
putExtensionAsAnnotation
(Class<? extends Annotation> klass, Annotation annotation) void
void
setAuditable
(boolean auditable) void
setBodyTypeSelector
(Command<ChenileExchange> command) void
setBodyTypeSelectorComponentNames
(String[] componentName) void
setCacheId
(String cacheId) void
setClientInterceptorCommands
(List<Command<ChenileExchange>> clientInterceptorCommands) void
setClientInterceptorComponentNames
(List<String> clientInterceptorComponentNames) void
setComponentName
(String componentName) void
setConsumes
(MimeType consumes) void
setDescription
(String description) void
setEventSubscribedTo
(Set<String> eventSubscribedTo) void
setFileWatchId
(String fileWatchId) void
setHttpMethod
(HTTPMethod httpMethod) void
void
setInterceptorCommands
(List<Command<ChenileExchange>> commands) void
setInterceptorComponentNames
(List<String> interceptorComponentNames) void
void
setMethodName
(String methodName) void
void
void
void
setParams
(List<ParamDefinition> params) void
setProduces
(MimeType produces) void
setSecure
(boolean secure) void
setServiceName
(String serviceName) void
setSuccessHttpStatus
(int successHttpStatus) void
setTimeOutInMilliSeconds
(int timeOutInMilliSeconds) void
void
setWarningHttpStatus
(int warningHttpStatus)
-
Field Details
-
successHttpStatus
-
warningHttpStatus
-
name
Operation Name needs to be unique within a service. The name of the method is specified inmethodName
below. We would default methodName to name to begin with. But it can be over-ridden. By keeping name and methodName separate, we would support the invocation of overloaded methods as well within the service. -
methodName
The actual method in the service that needs to be invoked. -
cacheId
If this service needs to be cached then this is the cache settings ID -
description
-
componentName
-
httpMethod
-
url
The URL to which this operation listens. It is handled at the level of chenile-http -
fileWatchId
Attach this operation to a file watch. The file watch can be associated with file watchers in a designated folder. Whenever a file appears in the folder, it is automatically processed line by line. Each line is then translated into headers and body. The operation is invoked for each line. -
params
-
serviceName
The service to which this operation is attached. This would be set at the time this operation is attached to a service byChenileServiceDefinition.setOperations(List)
-
auditable
private boolean auditable -
acls
Acls of the incoming request. These are expected to be handled by a security interceptor and will not be directly handled by Chenile itself -
input
The input class expected within the body of the incoming ChenileExchange -
output
The output class expected to be passed to the actual service class that will be invoked. -
eventSubscribedTo
The event to which this operation subscribes. Whenever the event occurs, this operation will be automatically invoked by Chenile. Event must be a valid event in the event registry -
timeOutInMilliSeconds
private int timeOutInMilliSecondsThis operation is expected to process this event within the time out period. In case, it does not process it then it would be timed out and considered an error. -
produces
What is the mime type of the output produced? For all text based mime types it is assumed that the response object will contain the information that needs to be rendered. For non text mime types, a file needs to be returned by the method. This file will be returned as an inline file -
consumes
The incoming mime type determines the format of the input class. If it is aString
then this determines what kind of string it is. (Example: JSON / XML / CSV etc.) This will enable Chenile to use the correct transformer to transform input to output -
secure
protected boolean secure -
interceptorCommands
-
interceptorComponentNames
-
extensions
-
extensionsAsAnnotation
-
clientInterceptorCommands
-
clientInterceptorComponentNames
-
method
-
outputAsParameterizedReference
-
bodyTypeSelector
Sometimes it is possible that the output is not specifiable since it can vary depending on the value of some headers. In that case, this class would be invoked to select the correct body type (i.e. output) class. -
bodyTypeSelectorComponentNames
-
-
Constructor Details
-
OperationDefinition
public OperationDefinition()
-
-
Method Details
-
getCacheId
-
setCacheId
-
getClientInterceptorCommands
-
setClientInterceptorCommands
-
getClientInterceptorComponentNames
-
setClientInterceptorComponentNames
-
getBodyTypeSelectorComponentNames
-
setBodyTypeSelectorComponentNames
-
setBodyTypeSelector
-
getMethod
-
setMethod
-
getInterceptorComponentNames
-
setInterceptorComponentNames
-
isSecure
public boolean isSecure() -
setSecure
public void setSecure(boolean secure) -
getProduces
-
setProduces
-
getConsumes
-
setConsumes
-
getHttpMethod
-
setHttpMethod
-
isAuditable
public boolean isAuditable() -
setAuditable
public void setAuditable(boolean auditable) -
getAcls
-
setAcls
-
getInput
-
setInput
-
getOutput
-
setOutput
-
getName
-
setName
-
getDescription
-
setDescription
-
getComponentName
-
setComponentName
-
getUrl
-
setUrl
-
getParams
-
setParams
-
getServiceName
-
setServiceName
-
getInterceptorCommands
-
setInterceptorCommands
-
getBodyTypeSelector
-
getMethodName
-
setMethodName
-
hashCode
public int hashCode() -
equals
-
getEventSubscribedTo
-
setEventSubscribedTo
-
getTimeOutInMilliSeconds
public int getTimeOutInMilliSeconds() -
setTimeOutInMilliSeconds
public void setTimeOutInMilliSeconds(int timeOutInMilliSeconds) -
getFileWatchId
-
setFileWatchId
-
getSuccessHttpStatus
public int getSuccessHttpStatus() -
setSuccessHttpStatus
public void setSuccessHttpStatus(int successHttpStatus) -
getWarningHttpStatus
public int getWarningHttpStatus() -
setWarningHttpStatus
public void setWarningHttpStatus(int warningHttpStatus) -
getExtension
Deprecated. -
putExtension
-
getExtensions
Deprecated. -
getOutputAsParameterizedReference
-
setOutputAsParameterizedReference
-
putExtensionAsAnnotation
-
getExtensionAsAnnotation
-