|
Humboldt Alignment Editor 2.5.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.esdihumboldt.hale.common.headless.impl.WorkspaceServiceImpl
public class WorkspaceServiceImpl
Default implementation of the WorkspaceService
.
Constructor Summary | |
---|---|
WorkspaceServiceImpl(File workspacesDir)
Create a workspace service instance. |
Method Summary | |
---|---|
void |
deleteWorkspace(String id)
Delete the workspace with the given identifier. |
org.joda.time.DateTime |
getLeaseEnd(String workspaceId)
Get the lease end date and time of the workspace with the given identifier. |
Map<String,String> |
getSettings(String workspaceId)
Get the workspace settings. |
File |
getWorkspaceFolder(String id)
Get the workspace folder for the given workspace identifier. |
String |
leaseWorkspace(org.joda.time.ReadableDuration duration)
Lease a workspace folder for the given duration. |
void |
set(String workspaceId,
String setting,
String value)
Change a workspace setting. |
void |
trigger()
Triggers the service scanning for workspace folders where the lease time has ended and deletes them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkspaceServiceImpl(File workspacesDir)
workspacesDir
- the base directory for workspaces, if the location
does not exist or is not accessible, a default location inside
the platform instance location is usedMethod Detail |
---|
public String leaseWorkspace(org.joda.time.ReadableDuration duration)
WorkspaceService
leaseWorkspace
in interface WorkspaceService
duration
- the lease duration
WorkspaceService.leaseWorkspace(ReadableDuration)
public File getWorkspaceFolder(String id) throws FileNotFoundException
WorkspaceService
getWorkspaceFolder
in interface WorkspaceService
id
- the workspace identifier
FileNotFoundException
- if the workspace does not existWorkspaceService.getWorkspaceFolder(String)
public org.joda.time.DateTime getLeaseEnd(String workspaceId) throws IOException
WorkspaceService
getLeaseEnd
in interface WorkspaceService
workspaceId
- the workspace identifier
FileNotFoundException
- if the workspace does not exist
IOException
- if the workspace configuration file cannot be readWorkspaceService.getLeaseEnd(String)
public Map<String,String> getSettings(String workspaceId) throws IOException
WorkspaceService
getSettings
in interface WorkspaceService
workspaceId
- the workspace identifier
FileNotFoundException
- if the workspace does not exist
IOException
- if the workspace configuration file cannot be readWorkspaceService.getSettings(String)
public void set(String workspaceId, String setting, String value) throws IOException
WorkspaceService
set
in interface WorkspaceService
workspaceId
- the workspace identifiersetting
- the name of the settingvalue
- the value, null
to remove the setting
FileNotFoundException
- if the workspace does not exist
IOException
- if the workspace configuration file cannot be read or
writtenWorkspaceService.set(String, String, String)
public void deleteWorkspace(String id)
WorkspaceService
deleteWorkspace
in interface WorkspaceService
id
- the workspace identifierWorkspaceService.deleteWorkspace(String)
public void trigger()
|
Humboldt Alignment Editor 2.5.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |