Package org.ametys.runtime.workspace
Class WorkspaceManager
- java.lang.Object
-
- org.ametys.runtime.workspace.WorkspaceManager
-
public final class WorkspaceManager extends Object
Main entry point for access to workspaces.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkspaceManager.InactivityCause
Cause of the deactivation of a workspace
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBaseURI(String workspaceName)
Returns the base URI associated with the given workspace, or null if the workspace does not existSet<String>
getEmbeddedWorskpacesIds()
Returns a String array containing the ids of the plugins embedded in jarsMap<String,WorkspaceManager.InactivityCause>
getInactiveWorkspaces()
Return the inactive workspacesstatic WorkspaceManager
getInstance()
Returns the shared instance of theWorkspaceManager
File
getLocation(String workspaceName)
Returns the workspace filesystem location for the given workspace or null if the workspace is loaded from the classpath.Set<String>
getWorkspaceNames()
Returns all active workspaces namesMap<String,Workspace>
getWorkspaces()
Returns active workspaces declarations.void
init(Collection<String> excludedWorkspace, String contextPath)
Initialize the WorkspaceManager.
It first looks for META-INF/runtime-workspace files in the classpath, then in the "workspaces" directory of the application.
-
-
-
Method Detail
-
getInstance
public static WorkspaceManager getInstance()
Returns the shared instance of theWorkspaceManager
- Returns:
- the shared instance of the
WorkspaceManager
-
getWorkspaceNames
public Set<String> getWorkspaceNames()
Returns all active workspaces names- Returns:
- all active workspaces names
-
getWorkspaces
public Map<String,Workspace> getWorkspaces()
Returns active workspaces declarations.- Returns:
- active workspaces declarations.
-
getInactiveWorkspaces
public Map<String,WorkspaceManager.InactivityCause> getInactiveWorkspaces()
Return the inactive workspaces- Returns:
- All the inactive workspaces
-
getEmbeddedWorskpacesIds
public Set<String> getEmbeddedWorskpacesIds()
Returns a String array containing the ids of the plugins embedded in jars- Returns:
- a String array containing the ids of the plugins embedded in jars
-
getBaseURI
public String getBaseURI(String workspaceName)
Returns the base URI associated with the given workspace, or null if the workspace does not exist- Parameters:
workspaceName
- the name of the working workspace- Returns:
- the URI associated with the given workspace
-
getLocation
public File getLocation(String workspaceName)
Returns the workspace filesystem location for the given workspace or null if the workspace is loaded from the classpath.- Parameters:
workspaceName
- the workspace name- Returns:
- the workspace location for the given workspace
-
init
public void init(Collection<String> excludedWorkspace, String contextPath) throws IOException
Initialize the WorkspaceManager.
It first looks for META-INF/runtime-workspace files in the classpath, then in the "workspaces" directory of the application.- Parameters:
excludedWorkspace
- the excluded workspaces, as given by the RuntimeConfigcontextPath
- the servlet context path- Throws:
IOException
- if an error occurs while retrieving resources
-
-