Package ch.helvethink.odoo4java.jsonrpc
Class OdooClient
java.lang.Object
ch.helvethink.odoo4java.jsonrpc.OdooClient
- All Implemented Interfaces:
OdooRpcClient
Abstraction of Odoo's JSON-RPC API
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOdooClient(String instanceUrl, String dbName, String username, String password) Constructor with direct connectionOdooClient(okhttp3.OkHttpClient httpCli, String instanceUrl, String dbName, String username, String password, boolean mustConnect) Constructor -
Method Summary
Modifier and TypeMethodDescriptionintcountByCriteria(Class<? extends OdooObj> objectType, Object... criteria) intcreateOdooObject(OdooObj toSave) intdeleteOdooObject(Integer id, Class<? extends OdooObj> classOfTheObject) findByCriteria(int limit, int page, Class<T> classToConvert, Object... criteria) findByCriteria(int limit, int page, String sort, Class<T> classToConvert, Object... criteria) findByCriteria(int limit, Class<T> classToConvert, Object... criteria) findListByIds(List<OdooId> idsToFetch, Class<T> classToConvert) findListByIdsInt(List<Integer> idsToFetch, Class<T> classToConvert) <T extends OdooObj>
TfindObjectById(OdooId idToFetch, Class<T> classToConvert) intupdateOdooObject(OdooObj toSave, Integer id)
-
Field Details
-
LOG
public static final org.slf4j.Logger LOGSimple logger -
JSONRPC_ENDPOINT
JSON RPC API endpoint- See Also:
-
RESULT_FIELD
Result field returned by the Odoo JSON RPC API- See Also:
-
-
Constructor Details
-
OdooClient
public OdooClient(String instanceUrl, String dbName, String username, String password) throws IOException Constructor with direct connection- Parameters:
instanceUrl- The odoo Instance URLdbName- The odoo DB Nameusername- The Odoo username when authenticatingpassword- The Odoo password when authenticating- Throws:
IOException- Exceptions from OkHttpClient
-
OdooClient
public OdooClient(okhttp3.OkHttpClient httpCli, String instanceUrl, String dbName, String username, String password, boolean mustConnect) throws IOException Constructor- Parameters:
httpCli- The ok http instanceinstanceUrl- The odoo Instance URLdbName- The odoo DB Nameusername- The Odoo username when authenticatingpassword- The Odoo password when authenticatingmustConnect- - describes if we must try to connect or not- Throws:
IOException- Exceptions from OkHttpClient
-
-
Method Details
-
findByCriteria
public <T extends OdooObj> List<T> findByCriteria(int limit, int page, Class<T> classToConvert, Object... criteria) - Specified by:
findByCriteriain interfaceOdooRpcClient
-
countByCriteria
- Specified by:
countByCriteriain interfaceOdooRpcClient
-
findByCriteria
public <T extends OdooObj> List<T> findByCriteria(int limit, Class<T> classToConvert, Object... criteria) - Specified by:
findByCriteriain interfaceOdooRpcClient
-
findByCriteria
public <T extends OdooObj> List<T> findByCriteria(int limit, int page, String sort, Class<T> classToConvert, Object... criteria) - Specified by:
findByCriteriain interfaceOdooRpcClient
-
findObjectById
- Specified by:
findObjectByIdin interfaceOdooRpcClient
-
findListByIdsInt
public <T extends OdooObj> List<T> findListByIdsInt(List<Integer> idsToFetch, Class<T> classToConvert) - Specified by:
findListByIdsIntin interfaceOdooRpcClient
-
findListByIds
- Specified by:
findListByIdsin interfaceOdooRpcClient
-
createOdooObject
-
updateOdooObject
-
deleteOdooObject
-