Package ddf.catalog.core.versioning.impl
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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ddf.catalog.core.versioning.MetacardVersion
ddf.catalog.core.versioning.MetacardVersion.Action -
Field Summary
Fields inherited from class ddf.catalog.data.impl.MetacardImpl
BASIC_METACARDFields inherited from interface ddf.catalog.data.Metacard
ANY_DATE, ANY_GEO, ANY_TEXT, CHECKSUM, CHECKSUM_ALGORITHM, CONTENT_TYPE, CONTENT_TYPE_VERSION, CREATED, DEFAULT_TAG, DERIVED, DERIVED_RESOURCE_DOWNLOAD_URL, DERIVED_RESOURCE_URI, DESCRIPTION, EFFECTIVE, EXPIRATION, GEOGRAPHY, ID, METADATA, MODIFIED, POINT_OF_CONTACT, RELATED, RESOURCE_DOWNLOAD_URL, RESOURCE_SIZE, RESOURCE_URI, SECURITY, SECURITY_MATCH_ALL, SECURITY_MATCH_ONE, SOURCE_ID, TAGS, TARGET_NAMESPACE, THUMBNAIL, TITLEFields inherited from interface ddf.catalog.core.versioning.MetacardVersion
ACTION, EDITED_BY, HISTORY_METACARDS_PROPERTY, PREFIX, PREFIXER, SKIP_VERSIONING, VERSION_OF_ID, VERSION_TAG, VERSION_TAGS, VERSION_TYPE, VERSION_TYPE_BINARY, VERSIONED_ON, VERSIONED_RESOURCE_URI -
Constructor Summary
ConstructorsConstructorDescriptionMetacardVersionImpl(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 givenMetacardto aMetacardVersionImplby cloning it and adding the current subject, time, and a random UUID.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 givenMetacardto aMetacardVersionImplby cloning it and adding the current subject, time, and a random UUID. -
Method Summary
Modifier and TypeMethodDescriptionddf.catalog.core.versioning.MetacardVersion.Actionddf.catalog.data.MetacardReverts theMetacardVersionImplto the originalMetacardddf.catalog.data.MetacardgetMetacard(List<ddf.catalog.data.MetacardType> types) Deprecated.The metacard types passed in are no longer usedstatic ddf.catalog.data.MetacardTypebyte[]static booleanisNotVersion(ddf.catalog.data.Metacard metacard) static booleanisVersion(ddf.catalog.data.Metacard metacard) voidsetAction(ddf.catalog.core.versioning.MetacardVersion.Action action) voidsetEditedBy(String editedBy) voidsetVersionedOn(Date date) voidsetVersionOfId(String idHistory) voidvoidsetVersionResourceUri(URI uri) voidsetVersionTags(Set<String> tags) voidsetVersionType(String versionType) voidsetVersionTypeBinary(byte[] versionType) static ddf.catalog.data.MetacardtoMetacard(ddf.catalog.data.Metacard source) Reverts the passed inMetacardto the originalMetacardIF it is a version metacard.static ddf.catalog.data.MetacardtoMetacard(ddf.catalog.data.Metacard source, List<ddf.catalog.data.MetacardType> types) Deprecated.The metacard types passed in are no longer usedprotected static ddf.catalog.core.versioning.MetacardVersiontoVersion(ddf.catalog.data.Metacard metacard) Methods inherited from class ddf.catalog.data.impl.MetacardImpl
equals, getAttribute, getContentTypeName, getContentTypeNamespace, getContentTypeVersion, getCreatedDate, getDescription, getEffectiveDate, getExpirationDate, getId, getLocation, getMetacardType, getMetadata, getModifiedDate, getPointOfContact, getResourceSize, getResourceURI, getSecurity, getSourceId, getThumbnail, getTitle, hashCode, requestBytes, requestData, requestDate, requestDouble, requestInputStream, requestInteger, requestLong, requestString, setAttribute, setAttribute, setContentTypeName, setContentTypeVersion, setCreatedDate, setDescription, setEffectiveDate, setExpirationDate, setId, setLocation, setMetadata, setModifiedDate, setPointOfContact, setResourceSize, setResourceURI, setSecurity, setSourceId, setTags, setTargetNamespace, setThumbnail, setTitle, setTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ddf.catalog.data.Metacard
getAttribute, getContentTypeName, getContentTypeNamespace, getContentTypeVersion, getCreatedDate, getEffectiveDate, getExpirationDate, getId, getLocation, getMetacardType, getMetadata, getModifiedDate, getResourceSize, getResourceURI, getSourceId, getTags, getThumbnail, getTitle, setAttribute, setSourceId
-
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 givenMetacardto aMetacardVersionImplby cloning it and adding the current subject, time, and a random UUID. Cannot take aMetacardVersionImplas the sourceMetacard.- Parameters:
sourceMetacard- Metacard to clone and create a history item fromaction- 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 givenMetacardto aMetacardVersionImplby cloning it and adding the current subject, time, and a random UUID. Cannot take aMetacardVersionImplas the sourceMetacard.
TheMetacardTypes 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 fromaction- Which action was done to modify the metacardtypes- A list of currently defined types in the system- Throws:
IllegalArgumentException
-
-
Method Details
-
getMetacard
Deprecated.The metacard types passed in are no longer usedReverts theMetacardVersionImplto the originalMetacard- Returns:
- the original metacard this version represents
-
getMetacard
public ddf.catalog.data.Metacard getMetacard()Reverts theMetacardVersionImplto the originalMetacard- 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 usedReverts the passed inMetacardto the originalMetacardIF 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 inMetacardto the originalMetacardIF 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
-
setVersionResourceUri
-
setVersionResourceUri
-
getVersionOfId
-
setVersionOfId
-
getVersionedOn
-
setVersionedOn
-
getEditedBy
-
setEditedBy
-
getVersionType
public byte[] getVersionType() -
setVersionType
-
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
-
setVersionTags
-
getMetacardVersionType
public static ddf.catalog.data.MetacardType getMetacardVersionType()
-