Class PrimaryDataEntityVersion
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataEntityVersion
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<PrimaryDataEntityVersion>
- Direct Known Subclasses:
PrimaryDataEntityVersionImplementation
public class PrimaryDataEntityVersion extends java.lang.Object implements java.lang.Comparable<PrimaryDataEntityVersion>, java.io.Serializable
Store version information of aPrimaryDataEntity- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPrimaryDataEntityVersion()non public constructor for internal use onlyprotectedPrimaryDataEntityVersion(PrimaryDataEntity entity, boolean delete, MetaData metadata)Construct a newPrimaryDataEntityVersionfor aPrimaryDataEntity.
-
Method Summary
Modifier and Type Method Description protected voidaddPublicReference(PersistentIdentifier identifierType, PrimaryDataEntity entity)intcompareTo(PrimaryDataEntityVersion o)Compares byrevisionjava.util.CalendargetCreationDate()Getter for the fieldcreationDate.PrimaryDataEntitygetEntity()Getter for the fieldentity.MetaDatagetMetaData()Getter for theMetaDataof thisPrimaryDataEntityVersion.java.lang.StringgetName()Convenience function to get theEnumDublinCoreElements.TITLEof theMetaDataobjectjava.security.PrincipalgetOwner()PublicReferencegetPublicReference(PersistentIdentifier identifierType)Return a specific PublicReference defined by thePersistentIdentifiertype.java.util.List<PublicReference>getPublicReferences()longgetRevision()Getter for the fieldrevision.java.util.CalendargetRevisionDate()Getter for the fieldrevisionDate.java.net.URLgetURL()booleanisDeleted()Check if thisPrimaryDataEntityVersionis marked as deleted.voidsetAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress)Set allPublicReferences of thisPrimaryDataEntityVersionof thisPrimaryDataEntitywill be requested to set public without lock date.voidsetAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress, java.util.Calendar releaseDate)Set allPublicReferences of thisPrimaryDataEntityVersionof thisPrimaryDataEntitywill be requested to set public.protected voidsetCreationDate(java.util.Calendar creationDate)Setter for the fieldcreationDate.protected voidsetDeleted(boolean isDeleted)Setter for theisDeletedflag.protected voidsetEntity(PrimaryDataEntity entity)Setter for the fieldentity.protected voidsetMetaData(MetaData metadata)Setter for theMetaDataof thisPrimaryDataEntityVersion.protected voidsetOwner(java.security.Principal owner)protected voidsetPublicReferences(java.util.List<PublicReference> references)protected voidsetRevision(long revision)Setter for the fieldrevision.protected voidsetRevisionDate(java.util.Calendar revisionDate)Setter for the fieldrevisionDate.java.lang.StringtoString()
-
-
-
Constructor Detail
-
PrimaryDataEntityVersion
protected PrimaryDataEntityVersion()
non public constructor for internal use only
-
PrimaryDataEntityVersion
protected PrimaryDataEntityVersion(PrimaryDataEntity entity, boolean delete, MetaData metadata) throws PrimaryDataEntityVersionException
Construct a newPrimaryDataEntityVersionfor aPrimaryDataEntity.Revisionis increased from previousrevision.- Parameters:
entity- thePrimaryDataEntityfor thisPrimaryDataEntityVersion.delete- set thisPrimaryDataEntityVersionto be deleted.metadata- theMetaDatafor thisPrimaryDataEntityVersion.- Throws:
PrimaryDataEntityVersionException- if the lastPrimaryDataEntityVersionis already deleted.
-
-
Method Detail
-
addPublicReference
protected void addPublicReference(PersistentIdentifier identifierType, PrimaryDataEntity entity) throws PrimaryDataEntityException
- Throws:
PrimaryDataEntityException
-
compareTo
public int compareTo(PrimaryDataEntityVersion o)
Compares byrevision- Specified by:
compareToin interfacejava.lang.Comparable<PrimaryDataEntityVersion>
-
getCreationDate
public java.util.Calendar getCreationDate()
Getter for the fieldcreationDate.- Returns:
- the creationDate.
-
getEntity
public PrimaryDataEntity getEntity()
Getter for the fieldentity.- Returns:
- entity.
-
getName
public final java.lang.String getName()
Convenience function to get theEnumDublinCoreElements.TITLEof theMetaDataobject- Returns:
- the name of the
PrimaryDataEntityVersionfrom theMetaData.
-
getMetaData
public MetaData getMetaData()
Getter for theMetaDataof thisPrimaryDataEntityVersion.- Returns:
- the
MetaDataof thisPrimaryDataEntityVersion.
-
getPublicReference
public PublicReference getPublicReference(PersistentIdentifier identifierType) throws PrimaryDataEntityVersionException
Return a specific PublicReference defined by thePersistentIdentifiertype.- Parameters:
identifierType- of thePublicReference- Returns:
- the found
PublicReference - Throws:
PrimaryDataEntityVersionException- if there is noPublicReferencewith thisPersistentIdentifierdefined.
-
getPublicReferences
public java.util.List<PublicReference> getPublicReferences()
- Returns:
- read only
ListofPublicReference
-
getRevision
public long getRevision()
Getter for the fieldrevision.- Returns:
- the revision.
-
getRevisionDate
public java.util.Calendar getRevisionDate()
Getter for the fieldrevisionDate.- Returns:
- revisionDate.
-
getURL
public java.net.URL getURL() throws PrimaryDataEntityException- Returns:
- the
URL - Throws:
PrimaryDataEntityException- if unable to load theURL.
-
isDeleted
public boolean isDeleted()
Check if thisPrimaryDataEntityVersionis marked as deleted.- Returns:
trueif thePrimaryDataEntityVersionis marked as deleted;falseotherwise.
-
setAllReferencesPublic
public void setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress, java.util.Calendar releaseDate) throws PublicReferenceExceptionSet allPublicReferences of thisPrimaryDataEntityVersionof thisPrimaryDataEntitywill be requested to set public.- Parameters:
emailNotificationAddress- the eMail address of the requesting user.releaseDate- the release date for thePublicReferences.- Throws:
PublicReferenceException- if unable to request thePublicReferenceto set public.
-
setAllReferencesPublic
public void setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress) throws PublicReferenceExceptionSet allPublicReferences of thisPrimaryDataEntityVersionof thisPrimaryDataEntitywill be requested to set public without lock date.- Parameters:
emailNotificationAddress- the eMail address of the requesting user.- Throws:
PublicReferenceException- if unable to request thePublicReferenceto set public.
-
setCreationDate
protected void setCreationDate(java.util.Calendar creationDate)
Setter for the fieldcreationDate.- Parameters:
creationDate- the creationDate to set.
-
setDeleted
protected void setDeleted(boolean isDeleted)
Setter for theisDeletedflag.- Parameters:
isDeleted- the isDeleted to set.
-
setEntity
protected void setEntity(PrimaryDataEntity entity)
Setter for the fieldentity.- Parameters:
entity- the entity to set
-
setMetaData
protected void setMetaData(MetaData metadata)
Setter for theMetaDataof thisPrimaryDataEntityVersion.- Parameters:
metadata- theMetaDatato set.
-
setPublicReferences
protected void setPublicReferences(java.util.List<PublicReference> references)
-
setRevision
protected void setRevision(long revision)
Setter for the fieldrevision.- Parameters:
revision- the revision to set
-
setRevisionDate
protected void setRevisionDate(java.util.Calendar revisionDate)
Setter for the fieldrevisionDate.- Parameters:
revisionDate- the revisionDate to set.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getOwner
public java.security.Principal getOwner()
- Returns:
- the owner
-
setOwner
protected void setOwner(java.security.Principal owner)
- Parameters:
owner- the owner to set
-
-