org.camunda.bpm.engine.rest.sub
Class AbstractResourceProvider<T extends Query<?,U>,U,DTO>

java.lang.Object
  extended by org.camunda.bpm.engine.rest.sub.AbstractResourceProvider<T,U,DTO>
Direct Known Subclasses:
HistoricDetailResourceImpl, HistoricVariableInstanceResourceImpl, VariableInstanceResourceImpl

public abstract class AbstractResourceProvider<T extends Query<?,U>,U,DTO>
extends Object

Base class to unify the getResource(boolean deserialized) and getResourceBinary() methods for several subclasses. (formerly getVariable() and getBinaryVariable())

Author:
Ronny Bräunlich

Field Summary
protected  ProcessEngine engine
           
protected  String id
           
 
Constructor Summary
AbstractResourceProvider(String detailId, ProcessEngine engine)
           
 
Method Summary
protected abstract  Query<T,U> baseQueryForBinaryVariable()
          Create the query we need for fetching the desired result.
protected abstract  Query<T,U> baseQueryForVariable(boolean deserializeObjectValue)
          TODO change comment Create the query we need for fetching the desired result.
protected  ProcessEngine getEngine()
           
protected  String getId()
           
 DTO getResource(boolean deserializeObjectValue)
           
 javax.ws.rs.core.Response getResourceBinary()
           
protected abstract  String getResourceNameForErrorMessage()
           
protected  javax.ws.rs.core.Response responseForByteVariable(org.camunda.bpm.engine.variable.value.TypedValue variableInstance)
          Creates a response for a variable of type ValueType.BYTES.
protected  javax.ws.rs.core.Response responseForFileVariable(org.camunda.bpm.engine.variable.value.FileValue fileValue)
          Creates a response for a variable of type ValueType.FILE.
protected abstract  org.camunda.bpm.engine.variable.value.TypedValue transformQueryResultIntoTypedValue(U queryResult)
           
protected abstract  DTO transformToDto(U queryResult)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected String id

engine

protected ProcessEngine engine
Constructor Detail

AbstractResourceProvider

public AbstractResourceProvider(String detailId,
                                ProcessEngine engine)
Method Detail

getResource

public DTO getResource(boolean deserializeObjectValue)

getResourceBinary

public javax.ws.rs.core.Response getResourceBinary()

responseForFileVariable

protected javax.ws.rs.core.Response responseForFileVariable(org.camunda.bpm.engine.variable.value.FileValue fileValue)
Creates a response for a variable of type ValueType.FILE.


responseForByteVariable

protected javax.ws.rs.core.Response responseForByteVariable(org.camunda.bpm.engine.variable.value.TypedValue variableInstance)
Creates a response for a variable of type ValueType.BYTES.


getId

protected String getId()

getEngine

protected ProcessEngine getEngine()

baseQueryForBinaryVariable

protected abstract Query<T,U> baseQueryForBinaryVariable()
Create the query we need for fetching the desired result. Setting properties in the query like disableCustomObjectDeserialization() or disableBinaryFetching() should be done in this method.


baseQueryForVariable

protected abstract Query<T,U> baseQueryForVariable(boolean deserializeObjectValue)
TODO change comment Create the query we need for fetching the desired result. Setting properties in the query like disableCustomObjectDeserialization() or disableBinaryFetching() should be done in this method.

Parameters:
deserializeObjectValue -

transformQueryResultIntoTypedValue

protected abstract org.camunda.bpm.engine.variable.value.TypedValue transformQueryResultIntoTypedValue(U queryResult)

transformToDto

protected abstract DTO transformToDto(U queryResult)

getResourceNameForErrorMessage

protected abstract String getResourceNameForErrorMessage()


Copyright © 2016 camunda services GmbH. All rights reserved.