Interface VersionAwareAmetysObject
-
- All Superinterfaces:
AmetysObject
- All Known Subinterfaces:
DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractTraversableProgramPart
,Cart
,Container
,Course
,CourseList
,CoursePart
,DefaultAmetysObject
,DefaultContent
,DefaultLockableAmetysObject
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,JCRCalendarResource
,JCRPost
,JCRProjectMember
,JCRResource
,JCRTask
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,Query
,SubProgram
public interface VersionAwareAmetysObject extends AmetysObject
AmetysObject
that is versioned and knows about its revisions and labels.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String[]
getAllLabels()
List all labels that exist on this object, whatever the revision.String[]
getAllRevisions()
List all revisions of this object.String[]
getLabels()
Get the labels for this object, in the current revision (a single revision can hold several labels).String[]
getLabels(String revision)
Get the labels for this object fot the given revision (a single revision can hold several labels).String
getRevision()
Get the revision of this object, if any.Date
getRevisionTimestamp()
Get the creation time of the current revision, if any.Date
getRevisionTimestamp(String revision)
Get the creation time of the given revision.void
switchToLabel(String label)
Switch to the revision corresponding to the specified label.
All subsequent method calls on thisAmetysObject
will concern that version.void
switchToRevision(String revision)
Switch to the revision corresponding to the specified revision.
All subsequent method calls on thisAmetysObject
will concern that version.-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
-
-
-
Method Detail
-
getAllRevisions
String[] getAllRevisions() throws AmetysRepositoryException
List all revisions of this object. Revisions are ordered in chronological order.- Returns:
- the list of revisions (can be empty, but not
null
) - Throws:
AmetysRepositoryException
- if the revisions cannot be known.
-
getAllLabels
String[] getAllLabels() throws AmetysRepositoryException
List all labels that exist on this object, whatever the revision.- Returns:
- the list of all labels (can be empty, but not
null
). - Throws:
AmetysRepositoryException
- if the labels cannot be known.
-
getRevision
String getRevision() throws AmetysRepositoryException
Get the revision of this object, if any.- Returns:
- the revision or null if this is the latest.
- Throws:
AmetysRepositoryException
- if the revision cannot be known.
-
getRevisionTimestamp
Date getRevisionTimestamp() throws AmetysRepositoryException
Get the creation time of the current revision, if any.- Returns:
- the revision creation time, or null if there's no current revision.
- Throws:
AmetysRepositoryException
- if an error occurs
-
getRevisionTimestamp
Date getRevisionTimestamp(String revision) throws AmetysRepositoryException
Get the creation time of the given revision.- Parameters:
revision
- the revision.- Returns:
- the revision creation date.
- Throws:
UnknownAmetysObjectException
- if the given revision does not exist for this object.AmetysRepositoryException
- if an error occurs
-
getLabels
String[] getLabels() throws AmetysRepositoryException
Get the labels for this object, in the current revision (a single revision can hold several labels).- Returns:
- the list of labels for this revision (can be empty, but not
null
). - Throws:
AmetysRepositoryException
- if the labels cannot be known.
-
getLabels
String[] getLabels(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
Get the labels for this object fot the given revision (a single revision can hold several labels).- Parameters:
revision
- the revision- Returns:
- the list of labels for this revision (can be empty, but not
null
). - Throws:
UnknownAmetysObjectException
- if the given revision does not exist for this object.AmetysRepositoryException
- if the labels cannot be known.
-
switchToLabel
void switchToLabel(String label) throws UnknownAmetysObjectException, AmetysRepositoryException
Switch to the revision corresponding to the specified label.
All subsequent method calls on thisAmetysObject
will concern that version.- Parameters:
label
- the label to switch to, or null to specify the current version- Throws:
UnknownAmetysObjectException
- if the label does not correspond to any revisionAmetysRepositoryException
- if a problem occurs
-
switchToRevision
void switchToRevision(String revision) throws UnknownAmetysObjectException, AmetysRepositoryException
Switch to the revision corresponding to the specified revision.
All subsequent method calls on thisAmetysObject
will concern that version.- Parameters:
revision
- the revision, or null to specify the current version- Throws:
UnknownAmetysObjectException
- if the revision does not existAmetysRepositoryException
- if a problem occurs
-
-