Class ClientPrimaryDataEntity
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.rmi.client.ClientContext
-
- de.ipk_gatersleben.bit.bi.edal.rmi.client.ClientPrimaryDataEntity
-
- All Implemented Interfaces:
java.lang.Comparable<ClientPrimaryDataEntity>
- Direct Known Subclasses:
ClientPrimaryDataDirectory,ClientPrimaryDataFile
public abstract class ClientPrimaryDataEntity extends ClientContext implements java.lang.Comparable<ClientPrimaryDataEntity>
SampleClient version ofPrimaryDataEntityto use eDAL system like the stand-alone implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientPrimaryDataEntityVersioncurrentVersionprotected PrimaryDataEntityRmiInterfacemyEntityRMI-
Fields inherited from class de.ipk_gatersleben.bit.bi.edal.rmi.client.ClientContext
clientDataManager
-
-
Constructor Summary
Constructors Constructor Description ClientPrimaryDataEntity(PrimaryDataEntityRmiInterface entity, ClientDataManager client)Constructor for ClientPrimaryDataEntity.
-
Method Summary
Modifier and Type Method Description voidaddPublicReference(PersistentIdentifier identifierType)intcompareTo(ClientPrimaryDataEntity other)voiddelete()booleanequals(java.lang.Object obj)ClientPrimaryDataEntityVersiongetCurrentVersion()java.lang.StringgetID()MetaDatagetMetaData()java.lang.StringgetName()ClientPrimaryDataDirectorygetParentDirectory()java.lang.StringgetPath()java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>getPermissions()java.util.List<PublicReference>getPublicReferences()ClientPrimaryDataEntityVersiongetVersionByDate(java.util.Calendar date)ClientPrimaryDataEntityVersiongetVersionByRevisionNumber(long revisionNumber)java.util.SortedSet<ClientPrimaryDataEntityVersion>getVersions()voidgrantPermission(java.security.Principal principal, GrantableMethods.Methods method)PrimaryDataEntity#grantPermission(Principal, Methods)}inthashCode()booleanisDirectory()voidmove(ClientPrimaryDataDirectory destinationDirectory)voidrename(java.lang.String name)voidrevokePermission(java.security.Principal principal, GrantableMethods.Methods method)PrimaryDataEntity#revokePermission(Principal, Enum)voidsetMetaData(MetaData new_metadata)voidswitchCurrentVersion(ClientPrimaryDataEntityVersion version)
-
-
-
Field Detail
-
myEntityRMI
protected PrimaryDataEntityRmiInterface myEntityRMI
-
currentVersion
protected ClientPrimaryDataEntityVersion currentVersion
-
-
Constructor Detail
-
ClientPrimaryDataEntity
public ClientPrimaryDataEntity(PrimaryDataEntityRmiInterface entity, ClientDataManager client)
Constructor for ClientPrimaryDataEntity.- Parameters:
entity- aPrimaryDataEntityRmiInterfaceobject.client- theClientDataManager
-
-
Method Detail
-
addPublicReference
public void addPublicReference(PersistentIdentifier identifierType) throws java.rmi.RemoteException, PrimaryDataEntityException
- Throws:
java.rmi.RemoteExceptionPrimaryDataEntityException
-
delete
public void delete() throws java.rmi.RemoteException, PrimaryDataEntityVersionException, PrimaryDataDirectoryException- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if trying to delete the rootPrimaryDataDirectoryPrimaryDataDirectoryException- if trying to delete a non-currentPrimaryDataEntityVersion.- See Also:
PrimaryDataEntityRmiInterface.delete(javax.security.auth.Subject)
-
getCurrentVersion
public ClientPrimaryDataEntityVersion getCurrentVersion() throws java.rmi.RemoteException
- Returns:
- the currently set
PrimaryDataEntityVersion - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getCurrentVersion(javax.security.auth.Subject)
-
getID
public java.lang.String getID() throws java.rmi.RemoteException- Returns:
- the ID of this
PrimaryDataEntity. - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getID(javax.security.auth.Subject)
-
getMetaData
public MetaData getMetaData() throws java.rmi.RemoteException
- Returns:
MetaDataobject of the currentPrimaryDataEntityVersionof thisPrimaryDataEntity.- Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getMetaData(javax.security.auth.Subject)
-
getName
public java.lang.String getName() throws java.rmi.RemoteException- Returns:
- the name of this
PrimaryDataEntity. - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getName(javax.security.auth.Subject)
-
getParentDirectory
public ClientPrimaryDataDirectory getParentDirectory() throws PrimaryDataDirectoryException, java.rmi.RemoteException
- Returns:
- the parent
PrimaryDataDirectoryof thisPrimaryDataEntity. - Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataDirectoryException- if trying to access the parentPrimaryDataDirectoryof the rootPrimaryDataDirectory.- See Also:
PrimaryDataEntityRmiInterface.getParentDirectory(javax.security.auth.Subject)
-
getPath
public java.lang.String getPath() throws java.rmi.RemoteException- Returns:
- the complete path as
Stringto thePrimaryDataEntityobject - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getPath(javax.security.auth.Subject)
-
getPermissions
public java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> getPermissions() throws java.rmi.RemoteException, PrimaryDataEntityException
- Returns:
- the map with all permissions
- Throws:
java.rmi.RemoteException- if unable to call remote functionPrimaryDataEntityException- if unable to load permissions- See Also:
PrimaryDataEntityRmiInterface.getPermissions(Subject)
-
getPublicReferences
public java.util.List<PublicReference> getPublicReferences() throws java.rmi.RemoteException
- Returns:
- a
Listwith allPublicReferences. - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getPublicReferences(Subject)
-
getVersions
public java.util.SortedSet<ClientPrimaryDataEntityVersion> getVersions() throws java.rmi.RemoteException
- Returns:
- an unmodifiable
SortedSetcontaining allPrimaryDataEntity - Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.getVersions(javax.security.auth.Subject)
-
getVersionByDate
public ClientPrimaryDataEntityVersion getVersionByDate(java.util.Calendar date) throws java.rmi.RemoteException, PrimaryDataEntityVersionException
- Parameters:
date- the date of thePrimaryDataEntityVersion- Returns:
- the specified
PrimaryDataEntityVersion - Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if there are only olderPrimaryDataEntityVersionstored for thisPrimaryDataEntity- See Also:
PrimaryDataEntity.getVersionByDate(Calendar)
-
getVersionByRevisionNumber
public ClientPrimaryDataEntityVersion getVersionByRevisionNumber(long revisionNumber) throws java.rmi.RemoteException, PrimaryDataEntityVersionException
- Parameters:
revisionNumber- the number of thePrimaryDataEntityVersion- Returns:
- the specified
PrimaryDataEntityVersion - Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if there is noPrimaryDataEntityVersionwith this version stored.- See Also:
PrimaryDataEntity.getVersionByRevisionNumber(long)
-
grantPermission
public void grantPermission(java.security.Principal principal, GrantableMethods.Methods method) throws java.rmi.RemoteException, PrimaryDataEntityExceptionPrimaryDataEntity#grantPermission(Principal, Methods)}- Parameters:
principal- to grant this methodmethod-Enumfor a the method- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityException- if can not found method to grant.
-
isDirectory
public boolean isDirectory() throws java.rmi.RemoteException- Returns:
truewhen it is aPrimaryDataDirectory;
falseotherwise.- Throws:
java.rmi.RemoteException- if unable to call remote function.- See Also:
PrimaryDataEntityRmiInterface.isDirectory(javax.security.auth.Subject)
-
move
public void move(ClientPrimaryDataDirectory destinationDirectory) throws java.rmi.RemoteException, PrimaryDataDirectoryException
- Parameters:
destinationDirectory- the new parentPrimaryDataDirectoryfor thisPrimaryDataEntity.- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataDirectoryException- if trying to move the rootPrimaryDataDirectory.- See Also:
PrimaryDataEntityRmiInterface.move(PrimaryDataDirectoryRmiInterface, javax.security.auth.Subject)
-
rename
public void rename(java.lang.String name) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, PrimaryDataDirectoryException- Parameters:
name- the new name for thisPrimaryDataEntity- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if unable to set the newPrimaryDataEntityVersion.PrimaryDataDirectoryException- if anPrimaryDataEntitywith this name already exists.- See Also:
PrimaryDataEntityRmiInterface.rename(java.lang.String, javax.security.auth.Subject)
-
revokePermission
public void revokePermission(java.security.Principal principal, GrantableMethods.Methods method) throws java.rmi.RemoteException, PrimaryDataEntityExceptionPrimaryDataEntity#revokePermission(Principal, Enum)- Parameters:
principal- to revoke this method.method-Enumfor a the method.- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityException- if trying to revoke theEdalPermissionfor PrimaryDataEntity#grantPermission(Principal, Enum) of your ownPrimaryDataEntity.
-
setMetaData
public void setMetaData(MetaData new_metadata) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, MetaDataException
- Parameters:
new_metadata- the newMetaDataobject to set.- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if unable to storePrimaryDataEntityVersion.MetaDataException- if there are non valid value for element in theMetaDataobject.java.security.AccessControlException- if the user with the currentSubjectis not allowed to execute this method. The AccessControlException is thrown by AspectJ.- See Also:
PrimaryDataEntityRmiInterface.setMetaData(MetaData, Subject)
-
switchCurrentVersion
public void switchCurrentVersion(ClientPrimaryDataEntityVersion version) throws java.rmi.RemoteException, PrimaryDataEntityVersionException
- Parameters:
version- the newPrimaryDataEntityVersionto set as currentPrimaryDataEntityVersion.- Throws:
java.rmi.RemoteException- if unable to call remote function.PrimaryDataEntityVersionException- if requestedPrimaryDataEntityVersionis not available or marked as deleted.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(ClientPrimaryDataEntity other)
- Specified by:
compareToin interfacejava.lang.Comparable<ClientPrimaryDataEntity>
-
-