com.isomorphic.datasource

## Class RestConnector

- java.lang.Object
- - com.isomorphic.base.Base
  - - com.isomorphic.datasource.DataSource
    - - com.isomorphic.datasource.BasicDataSource
      - - com.isomorphic.datasource.RestConnector

- All Implemented Interfaces:
    IToJSON
  Direct Known Subclasses:
    ODataDataSource, RESTDataSource

      public class RestConnector
      extends BasicDataSource

  This class is DataSource implementation that connect to many different types of REST webservice. `RestConnector` is configured in the DataSource descriptor (`*.ds.xml` file). Scan the client-side reference docs for "RestConnector" for full documentation of this class
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.isomorphic.datasource.DataSource

      `OP_ADD, OP_CLIENT_EXPORT, OP_CUSTOM, OP_DOWNLOAD_FILE, OP_FETCH, OP_GET_FILE, OP_GET_FILE_VERSION, OP_HAS_FILE, OP_HAS_FILE_VERSION, OP_LIST_FILE_VERSIONS, OP_LIST_FILES, OP_LOAD_SCHEMA, OP_REMOVE, OP_REMOVE_FILE, OP_REMOVE_FILE_VERSION, OP_RENAME_FILE, OP_SAVE_FILE, OP_UNIQUE_NAME, OP_UPDATE, OP_VALIDATE, OP_VIEW_FILE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `transformRawResponse(java.util.List untransformed, DSRequest dsRequest, DSResponse dsResponse)` Override point to allow your DataSource implementation to perform arbitrary transformations of the response data prior to processing the data through templating.

    - ### Methods inherited from class com.isomorphic.datasource.BasicDataSource

      `getAuditDataSource, getAuditRecord, getAuditRecord, hasCustomDefaultFetchOperation, hasCustomLogic, shouldAutoJoinTransaction, shouldAutoStartTransaction, transformMultipleFields, transformMultipleFields, writeMultiAudits`

    - ### Methods inherited from class com.isomorphic.datasource.DataSource

      `add, add, addDynamicDSGenerator, addDynamicDSGenerator, addDynamicDSGenerator, clearDynamicDSGenerators, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, execute, executeAdd, executeClientExport, executeCustom, executeFetch, executeFileSource, executeRemove, executeUpdate, fetch, fetch, fetchById, fetchById, fetchById, fetchSingle, fetchSingle, filter, filter, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, fromXML, getAuditChangedFieldsFieldName, getAuditRevisionFieldName, getAuditTimestampFieldName, getAuditTypeFieldName, getAuditUserFieldName, getDefaultDynamicDSGenerator, getDirectFields, getDynamicDSGenerators, getEnumConstantProperty, getEnumOrdinalProperty, getEnumTranslateStrategy, getField, getFieldNames, getFile, getFileAsInputStream, getFileAsString, getFileContentsField, getFileFormatField, getFileNameField, getFileTypeField, getID, getListProperties, getListProperties, getListProperty, getMapProperty, getName, getNonIncludedFields, getObjectProperty, getOperationProperty, getPrimaryKey, getProperties, getProperties, getProperties, getProperty, getPropertyJavaClass, getRecordXPath, getRelatedDisplayRecord, getRelatedDisplayRecord, getRelatedTableAlias, getTableName, getTransactionObject, getTransactionObject, hasFile, hasRecord, hasRecord, initialized, isModificationOperation, isServerOnly, listFiles, listFiles, listFiles, listFiles, remove, removeDynamicDSGenerator, removeDynamicDSGenerator, removeDynamicDSGenerator, removeFile, renameFile, saveFile, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setOmitNullMapValuesInResponse, setProperties, transformImportValue, transformImportValue, transformResponse, update, update, validate, validate, validate, validateRecord`

    - ### Methods inherited from interface com.isomorphic.js.IToJSON

      `toJSON`

- - ### Method Detail

    - #### transformRawResponse

          public void transformRawResponse(java.util.List untransformed,
                                           DSRequest dsRequest,
                                           DSResponse dsResponse)
                                    throws java.lang.Exception

      Override point to allow your DataSource implementation to perform arbitrary transformations of the response data prior to processing the data through templating. You should perform the transformations in place on the List passed in to the method. Note, if your use case does not involve templating (search the client-side documentation for "responseTemplate"), there is no difference between putting transformation logic in this method, or in `DataSource.transformResponse(List, DSRequest, DSResponse)`, because they are merely the pre-templating and post-templating transformation hooks. For the same reason, this method is specific to RESTDataSource - only RESTDataSource has the concept of templating.

      If you prefer a script-based approach, search the client-side documentation for "transformResponseScript". Note, if you override this method AND provide a `transformResponseScript`, this method runs first, and any transformations it makes will be visible to the script

      Throws:
        `java.lang.Exception`