Class MetacardVersionImpl

java.lang.Object
ddf.catalog.data.impl.MetacardImpl
ddf.catalog.core.versioning.impl.MetacardVersionImpl
All Implemented Interfaces:
ddf.catalog.core.versioning.MetacardVersion, ddf.catalog.data.Metacard, Serializable

public class MetacardVersionImpl extends MetacardImpl implements ddf.catalog.core.versioning.MetacardVersion
Experimental. Subject to change.
Represents a version at a particular instant. Also included are the MetacardVersion.Action that was performed, who it was edited by, and what time it was edited on.
See Also:
  • Constructor Details

    • MetacardVersionImpl

      public MetacardVersionImpl(String id, ddf.catalog.data.Metacard sourceMetacard, ddf.catalog.core.versioning.MetacardVersion.Action action, org.apache.shiro.subject.Subject subject, ddf.security.SubjectOperations subjectOperations)
      Will convert the given Metacard to a MetacardVersionImpl by cloning it and adding the current subject, time, and a random UUID. Cannot take a MetacardVersionImpl as the sourceMetacard.
      Parameters:
      sourceMetacard - Metacard to clone and create a history item from
      action - Which action was done to modify the metacard
      Throws:
      IllegalArgumentException
    • MetacardVersionImpl

      public MetacardVersionImpl(String id, ddf.catalog.data.Metacard sourceMetacard, ddf.catalog.core.versioning.MetacardVersion.Action action, org.apache.shiro.subject.Subject subject, ddf.security.SubjectOperations subjectOperations, List<ddf.catalog.data.MetacardType> types)
      Will convert the given Metacard to a MetacardVersionImpl by cloning it and adding the current subject, time, and a random UUID. Cannot take a MetacardVersionImpl as the sourceMetacard.
      The MetacardTypes list will affect whether the metacard type is stored by name or entirely by serializing the type and storing it in the metacard.
      Parameters:
      sourceMetacard - Metacard to clone and create a history item from
      action - Which action was done to modify the metacard
      types - A list of currently defined types in the system
      Throws:
      IllegalArgumentException
  • Method Details

    • getMetacard

      @Deprecated public ddf.catalog.data.Metacard getMetacard(List<ddf.catalog.data.MetacardType> types)
      Deprecated.
      The metacard types passed in are no longer used
      Reverts the MetacardVersionImpl to the original Metacard
      Returns:
      the original metacard this version represents
    • getMetacard

      public ddf.catalog.data.Metacard getMetacard()
      Reverts the MetacardVersionImpl to the original Metacard
      Returns:
      The original metacard this version represents
    • toMetacard

      @Deprecated public static ddf.catalog.data.Metacard toMetacard(ddf.catalog.data.Metacard source, List<ddf.catalog.data.MetacardType> types)
      Deprecated.
      The metacard types passed in are no longer used
      Reverts the passed in Metacard to the original Metacard IF it is a version metacard.
      Returns:
      The original metacard this version represents
    • toMetacard

      public static ddf.catalog.data.Metacard toMetacard(ddf.catalog.data.Metacard source)
      Reverts the passed in Metacard to the original Metacard IF it is a version metacard.
      Parameters:
      source - The metacard to revert
      Returns:
      The original metacard this version represents
    • toVersion

      protected static ddf.catalog.core.versioning.MetacardVersion toVersion(ddf.catalog.data.Metacard metacard)
    • isNotVersion

      public static boolean isNotVersion(@Nullable ddf.catalog.data.Metacard metacard)
    • isVersion

      public static boolean isVersion(@Nullable ddf.catalog.data.Metacard metacard)
    • getVersionResourceUri

      public URI getVersionResourceUri()
    • setVersionResourceUri

      public void setVersionResourceUri(String uri)
    • setVersionResourceUri

      public void setVersionResourceUri(URI uri)
    • getVersionOfId

      public String getVersionOfId()
    • setVersionOfId

      public void setVersionOfId(String idHistory)
    • getVersionedOn

      public Date getVersionedOn()
    • setVersionedOn

      public void setVersionedOn(Date date)
    • getEditedBy

      public String getEditedBy()
    • setEditedBy

      public void setEditedBy(String editedBy)
    • getVersionType

      public byte[] getVersionType()
    • setVersionType

      public void setVersionType(String versionType)
    • getVersionTypeBinary

      public String getVersionTypeBinary()
    • setVersionTypeBinary

      public void setVersionTypeBinary(byte[] versionType)
    • getAction

      public ddf.catalog.core.versioning.MetacardVersion.Action getAction()
    • setAction

      public void setAction(ddf.catalog.core.versioning.MetacardVersion.Action action)
    • getVersionTags

      public Set<String> getVersionTags()
    • setVersionTags

      public void setVersionTags(Set<String> tags)
    • getMetacardVersionType

      public static ddf.catalog.data.MetacardType getMetacardVersionType()