Class PrimaryDataEntityWrapper
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- de.ipk_gatersleben.bit.bi.edal.rmi.server.wrapper.PrimaryDataEntityWrapper
-
- All Implemented Interfaces:
PrimaryDataEntityRmiInterface
,java.io.Serializable
,java.rmi.Remote
- Direct Known Subclasses:
PrimaryDataDirectoryWrapper
,PrimaryDataFileWrapper
public abstract class PrimaryDataEntityWrapper extends java.rmi.server.UnicastRemoteObject implements PrimaryDataEntityRmiInterface
Wrapper class to wrapPrimaryDataEntity
functions on server side.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int
myDataPort
PrimaryDataEntity
myEntity
-
Constructor Summary
Constructors Constructor Description PrimaryDataEntityWrapper(int dataPort, PrimaryDataEntity entity)
Constructor forPrimaryDataEntityWrapper
.
-
Method Summary
Modifier and Type Method Description void
addPublicReference(PersistentIdentifier identifierType, javax.security.auth.Subject subject)
void
delete(javax.security.auth.Subject subject)
PrimaryDataEntityVersionRmiInterface
getCurrentVersion(javax.security.auth.Subject subject)
java.lang.String
getID(javax.security.auth.Subject subject)
MetaData
getMetaData(javax.security.auth.Subject subject)
java.lang.String
getName(javax.security.auth.Subject subject)
PrimaryDataDirectoryRmiInterface
getParentDirectory(javax.security.auth.Subject subject)
java.lang.String
getPath(javax.security.auth.Subject subject)
java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>>
getPermissions(javax.security.auth.Subject subject)
PrimaryDataEntityVersionRmiInterface
getVersionByDate(java.util.Calendar date, javax.security.auth.Subject subject)
PrimaryDataEntityVersionRmiInterface
getVersionByRevisionNumber(long revisionNumber, javax.security.auth.Subject subject)
java.util.Collection<PrimaryDataEntityVersionRmiInterface>
getVersions(javax.security.auth.Subject subject)
void
grantPermission(java.security.Principal principal, GrantableMethods.Methods method, javax.security.auth.Subject subject)
boolean
isDirectory(javax.security.auth.Subject subject)
void
move(PrimaryDataDirectoryRmiInterface destinationDirectory, javax.security.auth.Subject subject)
void
rename(java.lang.String name, javax.security.auth.Subject subject)
void
revokePermission(java.security.Principal principal, GrantableMethods.Methods method, javax.security.auth.Subject subject)
void
setMetaData(MetaData metadata, javax.security.auth.Subject subject)
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.ipk_gatersleben.bit.bi.edal.rmi.interfaces.PrimaryDataEntityRmiInterface
getPublicReferences
-
-
-
-
Field Detail
-
myEntity
public PrimaryDataEntity myEntity
-
myDataPort
public int myDataPort
-
-
Constructor Detail
-
PrimaryDataEntityWrapper
public PrimaryDataEntityWrapper(int dataPort, PrimaryDataEntity entity) throws java.rmi.RemoteException
Constructor forPrimaryDataEntityWrapper
.- Parameters:
dataPort
- the data port for the remote objects.entity
- aPrimaryDataEntity
object.- Throws:
java.rmi.RemoteException
- is unable to call remote function.
-
-
Method Detail
-
delete
public void delete(javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, PrimaryDataDirectoryException
- Specified by:
delete
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- 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:
PrimaryDataEntity.delete()
-
getCurrentVersion
public PrimaryDataEntityVersionRmiInterface getCurrentVersion(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getCurrentVersion
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission..- Returns:
- the currently set
PrimaryDataEntityVersion
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getCurrentVersion()
-
getID
public java.lang.String getID(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getID
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- the ID of this
PrimaryDataEntity
. - Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getID()
-
getMetaData
public MetaData getMetaData(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getMetaData
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
MetaData
object of the currentPrimaryDataEntityVersion
of thisPrimaryDataEntity
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getMetaData()
-
getName
public java.lang.String getName(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getName
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- the file name.
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getName()
-
getParentDirectory
public PrimaryDataDirectoryRmiInterface getParentDirectory(javax.security.auth.Subject subject) throws PrimaryDataDirectoryException, java.rmi.RemoteException
- Specified by:
getParentDirectory
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- the parent
PrimaryDataDirectory
of thisPrimaryDataEntity
. - Throws:
PrimaryDataDirectoryException
- if trying to access the parentPrimaryDataDirectory
of the rootPrimaryDataDirectory
.java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getParentDirectory()
-
getPermissions
public java.util.Map<java.security.Principal,java.util.List<GrantableMethods.Methods>> getPermissions(javax.security.auth.Subject subject) throws PrimaryDataEntityException, java.rmi.RemoteException
- Specified by:
getPermissions
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- an unmodifiable
List
containing allEdalPermission
. - Throws:
PrimaryDataEntityException
- if unable to load permissionsjava.rmi.RemoteException
- if unable to call remote function.
-
getPath
public java.lang.String getPath(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getPath
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- the complete path as
String
to thePrimaryDataEntity
object - Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getPath()
-
getVersions
public java.util.Collection<PrimaryDataEntityVersionRmiInterface> getVersions(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
getVersions
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
- an unmodifiable
SortedSet
containing allPrimaryDataEntity
- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getVersions()
-
getVersionByDate
public PrimaryDataEntityVersionRmiInterface getVersionByDate(java.util.Calendar date, javax.security.auth.Subject subject) throws PrimaryDataEntityVersionException, java.rmi.RemoteException
- Specified by:
getVersionByDate
in interfacePrimaryDataEntityRmiInterface
- Parameters:
date
- the date of thePrimaryDataEntityVersion
subject
- the authenticated subject for check permission.- Returns:
- the specified
PrimaryDataEntityVersion
- Throws:
PrimaryDataEntityVersionException
- if there is noPrimaryDataEntityVersion
with this version stored.java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getVersionByDate(Calendar)
-
getVersionByRevisionNumber
public PrimaryDataEntityVersionRmiInterface getVersionByRevisionNumber(long revisionNumber, javax.security.auth.Subject subject) throws PrimaryDataEntityVersionException, java.rmi.RemoteException
- Specified by:
getVersionByRevisionNumber
in interfacePrimaryDataEntityRmiInterface
- Parameters:
revisionNumber
- the number of thePrimaryDataEntityVersion
subject
- the authenticated subject for check permission.- Returns:
- the specified
PrimaryDataEntityVersion
- Throws:
PrimaryDataEntityVersionException
- if there is noPrimaryDataEntityVersion
with this version stored.java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.getVersionByRevisionNumber(long)
-
grantPermission
public void grantPermission(java.security.Principal principal, GrantableMethods.Methods method, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityException
- Specified by:
grantPermission
in interfacePrimaryDataEntityRmiInterface
- Parameters:
principal
- to grant this methodmethod
-GrantableMethods.Methods
for a the methodsubject
- the authenticated subject for check permission.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataEntityException
- if can not found method to grant.- See Also:
PrimaryDataEntity.grantPermission(Principal, de.ipk_gatersleben.bit.bi.edal.aspectj.security.GrantableMethods.Methods)
-
isDirectory
public boolean isDirectory(javax.security.auth.Subject subject) throws java.rmi.RemoteException
- Specified by:
isDirectory
in interfacePrimaryDataEntityRmiInterface
- Parameters:
subject
- the authenticated subject for check permission.- Returns:
true
when it is aPrimaryDataDirectory
;
false
otherwise.- Throws:
java.rmi.RemoteException
- if unable to call remote function.- See Also:
PrimaryDataEntity.isDirectory()
-
move
public void move(PrimaryDataDirectoryRmiInterface destinationDirectory, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataDirectoryException
- Specified by:
move
in interfacePrimaryDataEntityRmiInterface
- Parameters:
destinationDirectory
- the new parentPrimaryDataDirectory
for thisPrimaryDataEntity
.subject
- the authenticated subject for check permission.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataDirectoryException
- if trying to move the rootPrimaryDataDirectory
.- See Also:
PrimaryDataEntity.move(de.ipk_gatersleben.bit.bi.edal.primary_data.file.PrimaryDataDirectory)
-
rename
public void rename(java.lang.String name, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, PrimaryDataDirectoryException
- Specified by:
rename
in interfacePrimaryDataEntityRmiInterface
- Parameters:
name
- the new name for thisPrimaryDataEntity
.subject
- the authenticated subject for check permission.- 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:
PrimaryDataEntity.rename(String)
-
revokePermission
public void revokePermission(java.security.Principal principal, GrantableMethods.Methods method, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityException
- Specified by:
revokePermission
in interfacePrimaryDataEntityRmiInterface
- Parameters:
principal
- to revoke this method.method
-GrantableMethods.Methods
for a the method.subject
- the authenticated subject for check permission.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataEntityException
- if trying to revoke theEdalPermission
forPrimaryDataEntity.grantPermission(Principal, de.ipk_gatersleben.bit.bi.edal.aspectj.security.GrantableMethods.Methods)
of your ownPrimaryDataEntity
.- See Also:
PrimaryDataEntity.revokePermission(Principal, de.ipk_gatersleben.bit.bi.edal.aspectj.security.GrantableMethods.Methods)
-
setMetaData
public void setMetaData(MetaData metadata, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityVersionException, MetaDataException
- Specified by:
setMetaData
in interfacePrimaryDataEntityRmiInterface
- Parameters:
metadata
- the newMetaData
object to set.subject
- the authenticated subject for check permission.- 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.- See Also:
PrimaryDataEntity.setMetaData(MetaData)
-
addPublicReference
public void addPublicReference(PersistentIdentifier identifierType, javax.security.auth.Subject subject) throws java.rmi.RemoteException, PrimaryDataEntityException
- Specified by:
addPublicReference
in interfacePrimaryDataEntityRmiInterface
- Parameters:
identifierType
- the type of the new Identifier.subject
- the authenticated subject for check permission.- Throws:
java.rmi.RemoteException
- if unable to call remote function.PrimaryDataEntityException
- if unable to add thePublicReference
to thisPrimaryDataEntity
.
-
-