Class RefDataSvc

java.lang.Object
com.avoka.tm.svc.RefDataSvc

public class RefDataSvc extends Object

Provides a Reference Data Service.

Examples Link icon

Please find the reference data service examples below.

Create CSV Reference Data with File Upload Link icon

This Groovy example shows how to create or update CSV reference data set using FileItem file upload value.

 import com.avoka.tm.svc.RefDataSvc
 import org.apache.commons.fileupload.FileItem

 // Uploaded CSV format product list
 FileItem productsFileItem = ...

 new RefDataSvc()
     .setName("Product List")
     .setLocale("en_US")
     .setDataType("CSV")
     .setFileValue(productsFileItem)
     .createOrUpdate() 

Create JSON Reference Data Link icon

This Groovy example shows how to create or update JSON reference data set.

 import com.avoka.tm.svc.RefDataSvc

 String addressesJson = ...

 new RefDataSvc()
     .setName("Addresses")
     .setLocale("en_US")
     .setDataType("JSON")
     .setValue(addressesJson)
     .createOrUpdate() 

Delete Reference Data Set Link icon

This Groovy example shows how to delete a reference data set.

 import com.avoka.tm.svc.RefDataSvc

 new RefDataSvc()
     .setName("Addresses")
     .setLocale("en_US")
     .delete() 
Since:
17.10.0
  • Constructor Details Link icon

    • RefDataSvc Link icon

      public RefDataSvc()
  • Method Details Link icon

    • setClientCode Link icon

      public RefDataSvc setClientCode(String clientCode)
      Set the reference data set organization client code. Generally this is not required as the service executes in a client organization security context.
      Parameters:
      clientCode - reference data organization client code
      Returns:
      the service object
    • setName Link icon

      public RefDataSvc setName(String name)
      Set the name of the reference data set.
      Parameters:
      name - the name of the reference data
      Returns:
      the service object
    • setLocale Link icon

      public RefDataSvc setLocale(String locale)
      Set the locale of the reference data set.
      Parameters:
      locale - the locale of the reference data
      Returns:
      the service object
    • setCacheTimeout Link icon

      public RefDataSvc setCacheTimeout(int timeout)
      Set the cache timeout is seconds for the reference data set.
      Parameters:
      timeout - the cache timeout is seconds for the reference data set
      Returns:
      the service object
    • setDataType Link icon

      public RefDataSvc setDataType(String type)
      Set the data type of the reference data set [ CSV | JSON | XML ].
      Parameters:
      type - the data type of the reference data
      Returns:
      the service object
    • setValue Link icon

      public RefDataSvc setValue(String value)
      Set the value of the reference data set.
      Parameters:
      value - the locale of the reference data
      Returns:
      the service object
    • setFileValue Link icon

      public RefDataSvc setFileValue(org.apache.commons.fileupload.FileItem fileValue)
      Set the file item value for the reference data set. If a FileItem value is specified this will be used in preference to a value parameter.
      Parameters:
      fileValue - the file item value for the reference data
      Returns:
      the service object
    • createOrUpdate Link icon

      public void createOrUpdate()
      Create or update the given reference data set.
    • delete Link icon

      public boolean delete()
      Delete the specified organization reference data set.
      Returns:
      if the reference data set was found and deleted or false if not found