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 ofPrimaryDataEntity
to use eDAL system like the stand-alone implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientPrimaryDataEntityVersion
currentVersion
protected PrimaryDataEntityRmiInterface
myEntityRMI
-
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 void
addPublicReference(PersistentIdentifier identifierType)
int
compareTo(ClientPrimaryDataEntity other)
void
delete()
boolean
equals(java.lang.Object obj)
ClientPrimaryDataEntityVersion
getCurrentVersion()
java.lang.String
getID()
MetaData
getMetaData()
java.lang.String
getName()
ClientPrimaryDataDirectory
getParentDirectory()
java.lang.String
getPath()
java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>
getPermissions()
java.util.List<PublicReference>
getPublicReferences()
ClientPrimaryDataEntityVersion
getVersionByDate(java.util.Calendar date)
ClientPrimaryDataEntityVersion
getVersionByRevisionNumber(long revisionNumber)
java.util.SortedSet<ClientPrimaryDataEntityVersion>
getVersions()
void
grantPermission(java.security.Principal principal, GrantableMethods.Methods method)
PrimaryDataEntity#grantPermission(Principal, Methods)}int
hashCode()
boolean
isDirectory()
void
move(ClientPrimaryDataDirectory destinationDirectory)
void
rename(java.lang.String name)
void
revokePermission(java.security.Principal principal, GrantableMethods.Methods method)
PrimaryDataEntity#revokePermission(Principal, Enum)void
setMetaData(MetaData new_metadata)
void
switchCurrentVersion(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
- aPrimaryDataEntityRmiInterface
object.client
- theClientDataManager
-
-
Method Detail
-
addPublicReference
public void addPublicReference(PersistentIdentifier identifierType) throws java.rmi.RemoteException, PrimaryDataEntityException
- Throws:
java.rmi.RemoteException
PrimaryDataEntityException
-
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 rootPrimaryDataDirectory
PrimaryDataDirectoryException
- 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:
MetaData
object of the currentPrimaryDataEntityVersion
of 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
PrimaryDataDirectory
of thisPrimaryDataEntity
. - Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataDirectoryException
- if trying to access the parentPrimaryDataDirectory
of 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
String
to thePrimaryDataEntity
object - 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
List
with allPublicReference
s. - 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
SortedSet
containing 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 olderPrimaryDataEntityVersion
stored 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 noPrimaryDataEntityVersion
with this version stored.- See Also:
PrimaryDataEntity.getVersionByRevisionNumber(long)
-
grantPermission
public void grantPermission(java.security.Principal principal, GrantableMethods.Methods method) throws java.rmi.RemoteException, PrimaryDataEntityException
PrimaryDataEntity#grantPermission(Principal, Methods)}- Parameters:
principal
- to grant this methodmethod
-Enum
for 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:
true
when it is aPrimaryDataDirectory
;
false
otherwise.- 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 parentPrimaryDataDirectory
for 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 anPrimaryDataEntity
with 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, PrimaryDataEntityException
PrimaryDataEntity#revokePermission(Principal, Enum)- Parameters:
principal
- to revoke this method.method
-Enum
for a the method.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataEntityException
- if trying to revoke theEdalPermission
for PrimaryDataEntity#grantPermission(Principal, Enum) of your ownPrimaryDataEntity
.
-
setMetaData
public void setMetaData(MetaData new_metadata) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, MetaDataException
- Parameters:
new_metadata
- the newMetaData
object 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 theMetaData
object.java.security.AccessControlException
- if the user with the currentSubject
is 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 newPrimaryDataEntityVersion
to set as currentPrimaryDataEntityVersion
.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataEntityVersionException
- if requestedPrimaryDataEntityVersion
is not available or marked as deleted.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(ClientPrimaryDataEntity other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ClientPrimaryDataEntity>
-
-