This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
Custom Datasource Sample - Data Services Server 3.2.2 - WSO2 Documentation
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

This sample demonstrates the use of custom data source feature in DSS. It uses custom datasource org.wso2.carbon.dataservices.core.custom.datasource.InMemoryDataSource which uses the interface org.wso2.carbon.dataservices.core.custom.datasource.TabularDataBasedDS and org.wso2.carbon.dataservices.core.custom.datasource.EchoDataSource which uses org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS

Building the sample

The sample data service InMemoryDSSample should be deployed using the instructions in Samples Setup section.

Running the sample

The sample service can be run using the TryIt tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in the Data Services Clients section.

 

Service description

 

The service contains the following operations:

 

  • "addVehicle": This operation adds a new vehicle to the datasource.

  • "getOldVehicles": This gives all the vehicles added with the year greater than 1970.

  • "getAllVehicles": This operation returns all the vehicles added in the datasource.

  • "getVehicleById": This operation gives the vehicle information which matches with the provided id. 

  • "getAllUsers": This operation returns the user information stored in the datasource.

  • "echo1" and "echo2": This operation returns the entered values

  • No labels