Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.headless
Interface WorkspaceService

All Known Implementing Classes:
WorkspaceServiceImpl

public interface WorkspaceService

Service for acquiring workspace folders that can be used to store files related to a certain process, e.g. a transformation.

Author:
Simon Templer

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.
 

Method Detail

leaseWorkspace

String leaseWorkspace(org.joda.time.ReadableDuration duration)
Lease a workspace folder for the given duration. After the duration has passed, the folder is deleted by the service (the exact point in time depending on when the service is triggered).

Parameters:
duration - the lease duration
Returns:
the workspace identifier

getWorkspaceFolder

File getWorkspaceFolder(String id)
                        throws FileNotFoundException
Get the workspace folder for the given workspace identifier.

Parameters:
id - the workspace identifier
Returns:
the workspace folder
Throws:
FileNotFoundException - if the workspace does not exist

getLeaseEnd

org.joda.time.DateTime getLeaseEnd(String workspaceId)
                                   throws FileNotFoundException,
                                          IOException
Get the lease end date and time of the workspace with the given identifier.

Parameters:
workspaceId - the workspace identifier
Returns:
the lease end, if the workspace exists
Throws:
FileNotFoundException - if the workspace does not exist
IOException - if the workspace configuration file cannot be read

getSettings

Map<String,String> getSettings(String workspaceId)
                               throws FileNotFoundException,
                                      IOException
Get the workspace settings.

Parameters:
workspaceId - the workspace identifier
Returns:
the current workspace settings, changes to the map will not be reflected in the settings
Throws:
FileNotFoundException - if the workspace does not exist
IOException - if the workspace configuration file cannot be read
See Also:
set(String, String, String)

set

void set(String workspaceId,
         String setting,
         String value)
         throws FileNotFoundException,
                IOException
Change a workspace setting.

Parameters:
workspaceId - the workspace identifier
setting - the name of the setting
value - the value, null to remove the setting
Throws:
FileNotFoundException - if the workspace does not exist
IOException - if the workspace configuration file cannot be read or written
See Also:
getSettings(String)

deleteWorkspace

void deleteWorkspace(String id)
Delete the workspace with the given identifier.

Parameters:
id - the workspace identifier

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d