java.lang.Object
org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.mapping.InstancePropertiesMapping

public class InstancePropertiesMapping extends Object
Maps the properties of InstanceProperties between persistence and objects. The values of the properties (InstancePropertyValue) will be both JSON-serialized and searchable.
See Also:
  • Method Details

    • getFromDoc

      public static InstanceProperties getFromDoc(XTDBOMRSRepositoryConnector xtdbConnector, InstanceType type, xtdb.api.XtdbDocument xtdbDoc)
      Retrieve the instance property values from the provided XTDB document. NOTE: whether empty or null, the instance properties will always be returned back from the XTDB representation as an empty set of properties (not null).
      Parameters:
      xtdbConnector - connectivity to the repository
      type - of the Egeria instance from which we are retrieving the values
      xtdbDoc - from which to retrieve the values
      Returns:
      InstanceProperties
    • getFromMap

      public static InstanceProperties getFromMap(InstanceType type, clojure.lang.IPersistentMap doc) throws IOException
      Translate the provided XTDB representation into an Egeria representation.
      Parameters:
      type - of the Egeria instance from which we are retrieving the values
      doc - from which to map
      Returns:
      InstanceProperties
      Throws:
      IOException - on any issue deserializing values
    • addToDoc

      public static void addToDoc(XTDBOMRSRepositoryConnector xtdbConnector, xtdb.api.XtdbDocument.Builder builder, InstanceType type, InstanceProperties properties)
      Add the provided instance property values to the XTDB document.
      Parameters:
      xtdbConnector - connectivity to the repository
      builder - to which to add the properties
      type - of the Egeria instance to which the values are being added
      properties - to add
    • addToMap

      public static clojure.lang.IPersistentMap addToMap(clojure.lang.IPersistentMap doc, String typeDefGUID, InstanceProperties properties) throws InvalidParameterException, IOException
      Add the provided instance property values to the XTDB document map.
      Parameters:
      doc - metadata instance in XTDB document map form to which to add the properties
      typeDefGUID - of the Egeria instance to which the values are being added
      properties - full set of properties for the instance
      Returns:
      IPersistentMap giving the updated instance representation
      Throws:
      InvalidParameterException - if any of the properties cannot be persisted
      IOException - on any error serializing the properties