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
FieldsModifier and TypeFieldDescriptionprivate String[]Acls of the incoming request.private booleanprotected 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 StringIf this service needs to be cached then this is the cache settings IDprotected List<Command<ChenileExchange>>protected Stringprotected MimeTypeThe incoming mime type determines the format of the input class.protected StringThe event to which this operation subscribes.protected Map<Class<? extends Annotation>,Annotation> protected StringAttach this operation to a file watch.protected HTTPMethodprivate Class<?>The input class expected within the body of the incoming ChenileExchangeprotected List<Command<ChenileExchange>>protected Methodprotected StringThe actual method in the service that needs to be invoked.protected StringOperation 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 MimeTypeWhat 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 booleanprotected StringThe service to which this operation is attached.private HttpStatusprivate intThis operation is expected to process this event within the time out period.protected StringThe URL to which this operation listens.private HttpStatus -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanString[]getAcls()String[]getExtension(String key) Deprecated.<T extends Annotation>
TgetExtensionAsAnnotation(Class<T> klass) Deprecated.Class<?>getInput()getName()Class<?>intintgetUrl()intinthashCode()booleanbooleanisSecure()voidputExtension(String key, Object value) voidputExtensionAsAnnotation(Class<? extends Annotation> klass, Annotation annotation) voidvoidsetAuditable(boolean auditable) voidsetBodyTypeSelector(Command<ChenileExchange> command) voidsetBodyTypeSelectorComponentNames(String[] componentName) voidsetCacheId(String cacheId) voidsetClientInterceptorCommands(List<Command<ChenileExchange>> clientInterceptorCommands) voidsetClientInterceptorComponentNames(List<String> clientInterceptorComponentNames) voidsetComponentName(String componentName) voidsetConsumes(MimeType consumes) voidsetDescription(String description) voidsetEventSubscribedTo(Set<String> eventSubscribedTo) voidsetFileWatchId(String fileWatchId) voidsetHttpMethod(HTTPMethod httpMethod) voidvoidsetInterceptorCommands(List<Command<ChenileExchange>> commands) voidsetInterceptorComponentNames(List<String> interceptorComponentNames) voidvoidsetMethodName(String methodName) voidvoidvoidvoidsetParams(List<ParamDefinition> params) voidsetProduces(MimeType produces) voidsetSecure(boolean secure) voidsetServiceName(String serviceName) voidsetSuccessHttpStatus(int successHttpStatus) voidsetTimeOutInMilliSeconds(int timeOutInMilliSeconds) voidvoidsetWarningHttpStatus(int warningHttpStatus)
-
Field Details
-
successHttpStatus
-
warningHttpStatus
-
name
Operation Name needs to be unique within a service. The name of the method is specified inmethodNamebelow. 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 aStringthen 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
-