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 protected
PrimaryDataEntityVersion()
non public constructor for internal use onlyprotected
PrimaryDataEntityVersion(PrimaryDataEntity entity, boolean delete, MetaData metadata)
Construct a newPrimaryDataEntityVersion
for aPrimaryDataEntity
.
-
Method Summary
Modifier and Type Method Description protected void
addPublicReference(PersistentIdentifier identifierType, PrimaryDataEntity entity)
int
compareTo(PrimaryDataEntityVersion o)
Compares byrevision
java.util.Calendar
getCreationDate()
Getter for the fieldcreationDate
.PrimaryDataEntity
getEntity()
Getter for the fieldentity
.MetaData
getMetaData()
Getter for theMetaData
of thisPrimaryDataEntityVersion
.java.lang.String
getName()
Convenience function to get theEnumDublinCoreElements.TITLE
of theMetaData
objectjava.security.Principal
getOwner()
PublicReference
getPublicReference(PersistentIdentifier identifierType)
Return a specific PublicReference defined by thePersistentIdentifier
type.java.util.List<PublicReference>
getPublicReferences()
long
getRevision()
Getter for the fieldrevision
.java.util.Calendar
getRevisionDate()
Getter for the fieldrevisionDate
.java.net.URL
getURL()
boolean
isDeleted()
Check if thisPrimaryDataEntityVersion
is marked as deleted.void
setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress)
Set allPublicReference
s of thisPrimaryDataEntityVersion
of thisPrimaryDataEntity
will be requested to set public without lock date.void
setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress, java.util.Calendar releaseDate)
Set allPublicReference
s of thisPrimaryDataEntityVersion
of thisPrimaryDataEntity
will be requested to set public.protected void
setCreationDate(java.util.Calendar creationDate)
Setter for the fieldcreationDate
.protected void
setDeleted(boolean isDeleted)
Setter for theisDeleted
flag.protected void
setEntity(PrimaryDataEntity entity)
Setter for the fieldentity
.protected void
setMetaData(MetaData metadata)
Setter for theMetaData
of thisPrimaryDataEntityVersion
.protected void
setOwner(java.security.Principal owner)
protected void
setPublicReferences(java.util.List<PublicReference> references)
protected void
setRevision(long revision)
Setter for the fieldrevision
.protected void
setRevisionDate(java.util.Calendar revisionDate)
Setter for the fieldrevisionDate
.java.lang.String
toString()
-
-
-
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 newPrimaryDataEntityVersion
for aPrimaryDataEntity
.Revision
is increased from previousrevision
.- Parameters:
entity
- thePrimaryDataEntity
for thisPrimaryDataEntityVersion
.delete
- set thisPrimaryDataEntityVersion
to be deleted.metadata
- theMetaData
for thisPrimaryDataEntityVersion
.- Throws:
PrimaryDataEntityVersionException
- if the lastPrimaryDataEntityVersion
is 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:
compareTo
in 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.TITLE
of theMetaData
object- Returns:
- the name of the
PrimaryDataEntityVersion
from theMetaData
.
-
getMetaData
public MetaData getMetaData()
Getter for theMetaData
of thisPrimaryDataEntityVersion
.- Returns:
- the
MetaData
of thisPrimaryDataEntityVersion
.
-
getPublicReference
public PublicReference getPublicReference(PersistentIdentifier identifierType) throws PrimaryDataEntityVersionException
Return a specific PublicReference defined by thePersistentIdentifier
type.- Parameters:
identifierType
- of thePublicReference
- Returns:
- the found
PublicReference
- Throws:
PrimaryDataEntityVersionException
- if there is noPublicReference
with thisPersistentIdentifier
defined.
-
getPublicReferences
public java.util.List<PublicReference> getPublicReferences()
- Returns:
- read only
List
ofPublicReference
-
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 thisPrimaryDataEntityVersion
is marked as deleted.- Returns:
true
if thePrimaryDataEntityVersion
is marked as deleted;false
otherwise.
-
setAllReferencesPublic
public void setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress, java.util.Calendar releaseDate) throws PublicReferenceException
Set allPublicReference
s of thisPrimaryDataEntityVersion
of thisPrimaryDataEntity
will be requested to set public.- Parameters:
emailNotificationAddress
- the eMail address of the requesting user.releaseDate
- the release date for thePublicReference
s.- Throws:
PublicReferenceException
- if unable to request thePublicReference
to set public.
-
setAllReferencesPublic
public void setAllReferencesPublic(javax.mail.internet.InternetAddress emailNotificationAddress) throws PublicReferenceException
Set allPublicReference
s of thisPrimaryDataEntityVersion
of thisPrimaryDataEntity
will be requested to set public without lock date.- Parameters:
emailNotificationAddress
- the eMail address of the requesting user.- Throws:
PublicReferenceException
- if unable to request thePublicReference
to 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 theisDeleted
flag.- 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 theMetaData
of thisPrimaryDataEntityVersion
.- Parameters:
metadata
- theMetaData
to 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:
toString
in 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
-
-