Class OperationDefinition

java.lang.Object
org.chenile.core.model.OperationDefinition

public class OperationDefinition extends Object
Contains details about the particular operation of a service. Operations are methods in a service
  • Field Details

    • successHttpStatus

      private HttpStatus successHttpStatus
    • warningHttpStatus

      private HttpStatus warningHttpStatus
    • name

      protected String name
      Operation Name needs to be unique within a service. The name of the method is specified in methodName 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

      protected String methodName
      The actual method in the service that needs to be invoked.
    • cacheId

      protected String cacheId
      If this service needs to be cached then this is the cache settings ID
    • description

      protected String description
    • componentName

      protected String componentName
    • httpMethod

      protected HTTPMethod httpMethod
    • url

      protected String url
      The URL to which this operation listens. It is handled at the level of chenile-http
    • fileWatchId

      protected String 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

      private List<ParamDefinition> params
    • serviceName

      protected String serviceName
      The service to which this operation is attached. This would be set at the time this operation is attached to a service by ChenileServiceDefinition.setOperations(List)
    • auditable

      private boolean auditable
    • acls

      private String[] 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

      private Class<?> input
      The input class expected within the body of the incoming ChenileExchange
    • output

      private Class<?> output
      The output class expected to be passed to the actual service class that will be invoked.
    • eventSubscribedTo

      private Set<String> 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 timeOutInMilliSeconds
      This 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

      protected MimeType 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

      protected MimeType consumes
      The incoming mime type determines the format of the input class. If it is a String 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

      protected List<Command<ChenileExchange>> interceptorCommands
    • interceptorComponentNames

      protected List<String> interceptorComponentNames
    • extensions

      protected Map<String,Object> extensions
    • extensionsAsAnnotation

      protected Map<Class<? extends Annotation>,Annotation> extensionsAsAnnotation
    • clientInterceptorCommands

      protected List<Command<ChenileExchange>> clientInterceptorCommands
    • clientInterceptorComponentNames

      protected List<String> clientInterceptorComponentNames
    • method

      protected Method method
    • outputAsParameterizedReference

      protected ParameterizedTypeReference<?> outputAsParameterizedReference
    • bodyTypeSelector

      protected Command<ChenileExchange> 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

      protected String[] bodyTypeSelectorComponentNames
  • Constructor Details

    • OperationDefinition

      public OperationDefinition()
  • Method Details

    • getCacheId

      public String getCacheId()
    • setCacheId

      public void setCacheId(String cacheId)
    • getClientInterceptorCommands

      public List<Command<ChenileExchange>> getClientInterceptorCommands()
    • setClientInterceptorCommands

      public void setClientInterceptorCommands(List<Command<ChenileExchange>> clientInterceptorCommands)
    • getClientInterceptorComponentNames

      public List<String> getClientInterceptorComponentNames()
    • setClientInterceptorComponentNames

      public void setClientInterceptorComponentNames(List<String> clientInterceptorComponentNames)
    • getBodyTypeSelectorComponentNames

      public String[] getBodyTypeSelectorComponentNames()
    • setBodyTypeSelectorComponentNames

      public void setBodyTypeSelectorComponentNames(String[] componentName)
    • setBodyTypeSelector

      public void setBodyTypeSelector(Command<ChenileExchange> command)
    • getMethod

      public Method getMethod()
    • setMethod

      public void setMethod(Method method)
    • getInterceptorComponentNames

      public List<String> getInterceptorComponentNames()
    • setInterceptorComponentNames

      public void setInterceptorComponentNames(List<String> interceptorComponentNames)
    • isSecure

      public boolean isSecure()
    • setSecure

      public void setSecure(boolean secure)
    • getProduces

      public MimeType getProduces()
    • setProduces

      public void setProduces(MimeType produces)
    • getConsumes

      public MimeType getConsumes()
    • setConsumes

      public void setConsumes(MimeType consumes)
    • getHttpMethod

      public HTTPMethod getHttpMethod()
    • setHttpMethod

      public void setHttpMethod(HTTPMethod httpMethod)
    • isAuditable

      public boolean isAuditable()
    • setAuditable

      public void setAuditable(boolean auditable)
    • getAcls

      public String[] getAcls()
    • setAcls

      public void setAcls(String[] acls)
    • getInput

      public Class<?> getInput()
    • setInput

      public void setInput(Class<?> input)
    • getOutput

      public Class<?> getOutput()
    • setOutput

      public void setOutput(Class<?> output)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getComponentName

      public String getComponentName()
    • setComponentName

      public void setComponentName(String componentName)
    • getUrl

      public String getUrl()
    • setUrl

      public void setUrl(String url)
    • getParams

      public List<ParamDefinition> getParams()
    • setParams

      public void setParams(List<ParamDefinition> params)
    • getServiceName

      public String getServiceName()
    • setServiceName

      public void setServiceName(String serviceName)
    • getInterceptorCommands

      public List<Command<ChenileExchange>> getInterceptorCommands()
    • setInterceptorCommands

      public void setInterceptorCommands(List<Command<ChenileExchange>> commands)
    • getBodyTypeSelector

      public Command<ChenileExchange> getBodyTypeSelector()
    • getMethodName

      public String getMethodName()
    • setMethodName

      public void setMethodName(String methodName)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getEventSubscribedTo

      public Set<String> getEventSubscribedTo()
    • setEventSubscribedTo

      public void setEventSubscribedTo(Set<String> eventSubscribedTo)
    • getTimeOutInMilliSeconds

      public int getTimeOutInMilliSeconds()
    • setTimeOutInMilliSeconds

      public void setTimeOutInMilliSeconds(int timeOutInMilliSeconds)
    • getFileWatchId

      public String getFileWatchId()
    • setFileWatchId

      public void setFileWatchId(String fileWatchId)
    • getSuccessHttpStatus

      public int getSuccessHttpStatus()
    • setSuccessHttpStatus

      public void setSuccessHttpStatus(int successHttpStatus)
    • getWarningHttpStatus

      public int getWarningHttpStatus()
    • setWarningHttpStatus

      public void setWarningHttpStatus(int warningHttpStatus)
    • getExtension

      @Deprecated public Object getExtension(String key)
      Deprecated.
    • putExtension

      public void putExtension(String key, Object value)
    • getExtensions

      @Deprecated public Map<String,Object> getExtensions()
      Deprecated.
    • getOutputAsParameterizedReference

      public ParameterizedTypeReference<?> getOutputAsParameterizedReference()
    • setOutputAsParameterizedReference

      public void setOutputAsParameterizedReference(ParameterizedTypeReference<?> ref)
    • putExtensionAsAnnotation

      public void putExtensionAsAnnotation(Class<? extends Annotation> klass, Annotation annotation)
    • getExtensionAsAnnotation

      public <T extends Annotation> T getExtensionAsAnnotation(Class<T> klass)