@Concealed
public abstract class MetadataRevisionSupport
extends java.lang.Object
MetadataRevision
feature.Modifier | Constructor and Description |
---|---|
protected |
MetadataRevisionSupport()
Constructs a default instance of this class.
|
Modifier and Type | Method and Description |
---|---|
abstract MetadataRevision |
create(java.lang.String note)
Creates a new metadata revision for the local host.
|
abstract boolean |
exists(MetadataRevision revision)
Returns
true if a given metadata revision exists. |
abstract MetadataRevision |
get(java.lang.String revisionId)
Gets the revision in the local history for a given ID.
|
abstract MetadataRevision |
getLatest()
Returns the latest revision in the local history.
|
abstract MetadataRevision |
getLatest(java.lang.String fromHostId)
Returns the latest revision imported from a host.
|
abstract java.lang.String |
getLocalHostId()
Returns the ID of the local host where the metadata revisions are stored.
|
abstract java.lang.String |
getNote(MetadataRevision revision)
Returns the revision note.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getPayload(MetadataRevision revision)
Returns the payload of a metadata revision.
|
abstract java.util.Date |
getRecordDate(MetadataRevision revision)
Returns the date when a metadata revision is recorded in the local history.
|
abstract java.lang.String |
getRecordedBy(MetadataRevision revision)
Returns the user that records the metadata revision in the local history.
|
abstract java.util.Map<java.lang.String,MetadataRepositoryBaseline> |
getRepositoryBaselines(MetadataRevision revision)
Returns the repository baselines associated with a metadata revision.
|
MetadataRevisionNoteDescriptor.ResourceDescription |
getResourceDescription(MetadataRevisionNoteURI uri)
Returns the resource description using the default descriptor if possible.
|
java.lang.String |
getSandboxName(MetadataRevision revision)
Returns the name of the sandbox associated with a revision.
|
boolean |
isEligibleForUnpublish(MetadataRevisionPortable revision)
Returns
true if the given revision is eligible to be
unpublished from the local history. |
java.util.List<MetadataRevision> |
list(java.util.Date startDateExclusive,
java.util.Date endDateExclusive,
int maxListSize)
Returns a list of metadata revisions from the local history.
|
abstract java.util.List<MetadataRevision> |
listAfter(MetadataRevision revision)
Lists all revisions in the local history after a revision.
|
java.util.Map<MetadataRepositoryBaseline,MetadataRevision> |
listMetadataRepositoryBaselines(java.lang.String repositoryId,
java.util.Date startDateExclusive,
java.util.Date endDateExclusive,
int maxSize)
Returns distinct baselines of a repository from the latest to the oldest
and the revisions they first appear in.
|
protected MetadataRevision |
newMetadataRevision()
Constructs a new metadata revision for the local host.
|
protected MetadataRevision |
newMetadataRevision(java.lang.String id,
java.lang.String hostId,
java.lang.String fromHostId)
Re-Constructs a new metadata revision.
|
protected java.lang.String |
newRevisionId()
Generates a new revision ID.
|
abstract void |
publish(MetadataRevisionPortable revision,
java.lang.String note)
Publishes a metadata revision from another host to the local host
|
boolean |
unpublish(MetadataRevisionPortable revision)
Removes a previously published metadata revision from the local history
if the metadata revision is the latest revision in the local history.
|
protected MetadataRevisionSupport()
protected java.lang.String newRevisionId()
UUID.randomUUID().toString()
.public abstract java.lang.String getLocalHostId()
protected final MetadataRevision newMetadataRevision()
newRevisionId()
,
getLocalHostId()
protected final MetadataRevision newMetadataRevision(java.lang.String id, java.lang.String hostId, java.lang.String fromHostId)
id
- the ID of the revisionhostId
- the ID of the host where the revision is createdfromHostId
- the ID of the host from which the revision is importedpublic abstract boolean exists(MetadataRevision revision)
true
if a given metadata revision exists.revision
- the metadata revision to be verifiedtrue
if the given metadata revision existspublic abstract MetadataRevision create(java.lang.String note)
note
- the revision note; null
is allowed.java.lang.UnsupportedOperationException
- if the application context does
not support the creation of new revisionspublic abstract void publish(MetadataRevisionPortable revision, java.lang.String note)
revision
- the metadata revision to be publishednote
- the revision note; null
is allowed.java.lang.IllegalArgumentException
- if the given object is nulljava.lang.UnsupportedOperationException
- if the application context does
not support the publishing of a portable revisionpublic boolean isEligibleForUnpublish(MetadataRevisionPortable revision)
true
if the given revision is eligible to be
unpublished from the local history. A revision is eligible for unpublish
when it has been published and no other revisions have been published
after the revision.revision
- the revision to be unpublishedtrue
if the given version is eligible to be
unpublishedjava.lang.IllegalArgumentException
- if the given revision is nulljava.lang.UnsupportedOperationException
- if this check is not supportedunpublish(oracle.adf.share.sandbox.MetadataRevisionPortable)
public boolean unpublish(MetadataRevisionPortable revision)
revision
- the latest published metadata revisiontrue
if the specified revision is successfully
unpublished; false
if the specified revision has
never been published to the local host or it is not the latest
revisionjava.lang.IllegalArgumentException
- if the given revision is nulljava.lang.UnsupportedOperationException
- if unpublishing is not supportedisEligibleForUnpublish(oracle.adf.share.sandbox.MetadataRevisionPortable)
public abstract MetadataRevision get(java.lang.String revisionId)
revisionId
- the ID of the revision in the local historypublic abstract java.util.List<MetadataRevision> listAfter(MetadataRevision revision)
revision
- the revision immediately before the returned list in the
local historypublic abstract MetadataRevision getLatest(java.lang.String fromHostId)
fromHostId
- the ID of the host where the returned revision is
imported fromnull
if no revision is found for the
given host, or the local host does not have any revisionspublic abstract MetadataRevision getLatest()
protected final java.util.Map<java.lang.String,java.lang.Object> getPayload(MetadataRevision revision)
MetadataRevision
objects holding on to other objects
that should be garbage collected.revision
- the metadata revision of which the payload should be
returnedjava.lang.NullPointerException
- if the given metadata revision is nullpublic abstract java.util.Map<java.lang.String,MetadataRepositoryBaseline> getRepositoryBaselines(MetadataRevision revision)
revision
- the metadata revision with which the repository baselines
are associatedjava.lang.NullPointerException
- if the given metadata revision is nullgetPayload(oracle.adf.share.sandbox.MetadataRevision)
public abstract java.util.Date getRecordDate(MetadataRevision revision)
revision
- the metadata revision of which the record date is to
be returnedjava.lang.NullPointerException
- if the given metadata revision is nullgetPayload(oracle.adf.share.sandbox.MetadataRevision)
public abstract java.lang.String getRecordedBy(MetadataRevision revision)
revision
- the metadata revision recorded by the returned userpublic abstract java.lang.String getNote(MetadataRevision revision)
revision
- the revision of which the note is to be returnednull
if there is no notejava.lang.NullPointerException
- if the given metadata revision is nullgetPayload(oracle.adf.share.sandbox.MetadataRevision)
public java.lang.String getSandboxName(MetadataRevision revision)
revision
- the revision that may be associated with a sandboxnull
if the given revision is not associated with
a sandbox. If the associated sandbox cannot be located, the
note of the revision is returned.java.lang.IllegalArgumentException
- if the given revision is nulljava.lang.UnsupportedOperationException
- if this method is not supportedpublic MetadataRevisionNoteDescriptor.ResourceDescription getResourceDescription(MetadataRevisionNoteURI uri)
uri
- the URI of the resource to be describednull
if the default
descriptor is unable to resolve the URIpublic java.util.List<MetadataRevision> list(java.util.Date startDateExclusive, java.util.Date endDateExclusive, int maxListSize)
startDateExclusive
- the low cutoff date. If specified, only the
revisions recorded after the date are returned. If
null
is passed in, the low cutoff date is
January 1, 1970, 00:00:00 GMT.endDateExclusive
- the high cutoff date. If specified, only the
revisions recorded before the date are returned. If
null
is passed in, roughly the time of the
invocation of this method will be the high cutoff date.maxListSize
- the maximum size of the returned list, a negative
number if all revisions before the cutoff date should
be returnedjava.lang.UnsupportedOperationException
- if this method is not supportedpublic java.util.Map<MetadataRepositoryBaseline,MetadataRevision> listMetadataRepositoryBaselines(java.lang.String repositoryId, java.util.Date startDateExclusive, java.util.Date endDateExclusive, int maxSize)
repositoryId
- the ID of the repositorystartDateExclusive
- the low cutoff date. If specified, only the
baselines recorded after the date are returned. If
null
is passed in, the low cutoff date is
January 1, 1970, 00:00:00 GMT.endDateExclusive
- the high cutoff date. If specified, only the
baselines recorded before the date are returned. If
null
is passed in, roughly the time of the
invocation of this method will be the high cutoff date.maxSize
- the maximum size of the returned map, a negative
number if all revisions before the cutoff date should
be returnedjava.lang.IllegalArgumentException
- if the given repository ID is nulljava.lang.UnsupportedOperationException
- if this method is not supported