public abstract class AbstractRevisioned extends AbstractNamed implements Revisioned
AbstractCloneable.Cloning, AbstractCloneable.CopyVisitor
Constructor and Description |
---|
AbstractRevisioned() |
AbstractRevisioned(String name) |
Modifier and Type | Method and Description |
---|---|
protected URI |
generateNewIdentifier() |
Revision |
getCurrentRevision()
Get the current Revision metadata.
|
URI |
getIdentifier()
Returns the identifier.
|
protected abstract URI |
getIdentifierRoot() |
Revision |
newRevision()
Make a new Revision to mark structural changes to this workflow bean.
|
Revision |
newRevision(URI revisionIdentifier)
Make a new Revision to mark structural changes to this workflow bean with
the given identifier.
|
void |
setCurrentRevision(Revision currentRevision)
Set the current Revision.
|
void |
setIdentifier(URI identifier)
Set the identifier.
|
cloneInto, compareTo, equals, getName, hashCode, setName, toString
clone, cloneWorkflowBean
finalize, getClass, notify, notifyAll, wait, wait, wait
accept, clone
public AbstractRevisioned()
public AbstractRevisioned(String name)
protected URI generateNewIdentifier()
protected abstract URI getIdentifierRoot()
public void setCurrentRevision(Revision currentRevision)
Revisioned
To preserve the existing revision chain, the new revision should point to
the current revision using Revision.setPreviousRevision(Revision)
setCurrentRevision
in interface Revisioned
currentRevision
- The Revision
to be setpublic Revision newRevision()
Revisioned
The identifier of the new Revisioned.getCurrentRevision()
will also be
identifying the Revisioned workflow bean and be returned from
Revisioned.getIdentifier()
.
The new revision will include the previous Revision as
Revision.getPreviousRevision()
and
Revision.getGeneratedAtTime()
on the new revision will match the
current GregorianCalendar
by default.
newRevision
in interface Revisioned
Revisioned.getCurrentRevision()
, for setting any further
details.public Revision newRevision(URI revisionIdentifier)
Revisioned
Revisioned.getIdentifier()
will match the new identifier. The new
Revisioned.getCurrentRevision()
will include the previous revision as
Revision.getPreviousRevision()
.
Note, unlike the convenience method Revisioned.newRevision()
this method
will not update Revision.getGeneratedAtTime()
.
newRevision
in interface Revisioned
revisionIdentifier
- The new workflow identifierRevisioned.getCurrentRevision()
, for setting any further
details.public Revision getCurrentRevision()
Revisioned
The Revision
typically contains information about when it was
made, and links to the previous revision chain.
getCurrentRevision
in interface Revisioned
public URI getIdentifier()
The the default identifier is based on #getIdentifierRoot() plus a random UUID.
getIdentifier
in interface Revisioned
#setIdentifier(URI)}
public void setIdentifier(URI identifier)
This will delete any previous revisions in getCurrentRevision()
setIdentifier
in interface Revisioned
identifier
- the identifiergetIdentifier()
,
getCurrentRevision()
Copyright © 2013 myGrid. All rights reserved.