Interface PersistenceService

All Known Implementing Classes:
PersistenceServiceImpl

public interface PersistenceService
This service wraps the JIRA PropertySetManager as well as provides automatic xstream serialization for a map of data
  • Field Details

  • Method Details

    • delete

      void delete(String entityName, Long entityId, String key)
      Remove a property given the entity name, entity id and property key.
    • deleteAll

      void deleteAll(String entityName, Long entityId)
      Delete all properties for a given an entity name and entity id
    • setLong

      void setLong(String entityName, Long entityId, String key, Long value)
      Set a property value of type Long
    • getLong

      Long getLong(String entityName, Long entityId, String key)
      Get a property value of type Long. If there is no data, null is returned.
    • setDouble

      void setDouble(String entityName, Long entityId, String key, Double value)
      Set a property value of type Double
    • getDouble

      Double getDouble(String entityName, Long entityId, String key)
      Get a property value of type Double. If there is no data, null is returned.
    • setBoolean

      void setBoolean(String entityName, Long entityId, String key, Boolean value)
      Set a property value of type Boolean.
    • getBoolean

      Boolean getBoolean(String entityName, Long entityId, String key)
      Get a property value of type Boolean. If there is no data, null is returned.
    • setString

      void setString(@Nonnull String entityName, @Nonnull Long entityId, @Nonnull String key, @Nonnull String value)
      Set a property value of type String.
    • getString

      @Nullable String getString(@Nonnull String entityName, @Nonnull Long entityId, @Nonnull String key)
      Get a property value of type String. If there is no data, null is returned.
    • getData

      Map<String,Object> getData(String entityName, Long entityId, String key)
      Get a map data property for a given entity name, entity id and property key
      Returns:
      deserialised data or null if no record exists
    • setData

      void setData(String entityName, Long entityId, String key, Map<String,Object> data)
      Set a map data property. The map is serialized using xstream and stored in JIRA as a text property.
    • getListData

      List<Object> getListData(String entityName, Long entityId, String key)
      Get a list data property for a given entity name, entity id and property key
      Returns:
      deserialised data or null if no record exists
    • setListData

      void setListData(String entityName, Long entityId, String key, List<Object> data)
      Set a list data property. The list is serialised using xstream and stored in JIRA as a text property.
    • getKeys

      Set<String> getKeys(String entityName, Long entityId)
      Returns:
      all keys for a given entity name and entity id, or an empty set if there are none
    • exists

      boolean exists(String entityName, Long entityId, String key)
      Exists a property for a given entity name and id
      Returns:
      true if the property exists, false otherwise
    • getPropertyAsType

      Object getPropertyAsType(String entityName, Long entityId, String key)
      Return the property as whatever type it may be.
      Returns:
      object with the actual type