org.nuxeo.core.resources.model.impl
Class ResourceManager

java.lang.Object
  extended by org.nuxeo.core.resources.model.impl.ResourceManager
All Implemented Interfaces:
IResourceManager, ISiteService

public class ResourceManager
extends java.lang.Object
implements IResourceManager

The default implementation for IResourceManager

Author:
Bogdan Stefanescu

Field Summary
 
Fields inherited from interface org.nuxeo.core.resources.model.IResourceManager
LOCAL_SCHEME
 
Constructor Summary
ResourceManager()
           
 
Method Summary
 ISiteControllerRegistry getControllerRegistry()
          Get the controller registry
static IResourceManager getInstance()
           
 IPropertyManager getPropertyManager()
          Get the property manager
 java.lang.Object getResourceProperty(ISiteResource resource, java.lang.String property)
          Get a resource property giving its name
This is a shortcut to the IPropertyManager.getProperty(ISiteResource, String)
 IResourceTreeRoot getRoot()
          The root of all resources owned by this resource manager
 ISiteController getSiteController(java.lang.String schema)
          Get the controller for the given schema or NullSiteController if none was defined
 ISiteFile newFile(ISite site, java.lang.String path)
           
 ISiteFolder newFolder(ISite site, java.lang.String path)
          Create a new folder given the owner site and the folder path
 ISite newSite(java.lang.String uri)
          Create a new site resource given the site URI
 void setResourceProperty(ISiteResource resource, java.lang.String property, java.lang.Object value)
           
 void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
          Shutdown the service.
 void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
          Start the service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getInstance

public static IResourceManager getInstance()

startup

public void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
             throws org.eclipse.core.runtime.CoreException
Description copied from interface: ISiteService
Start the service.

Specified by:
startup in interface ISiteService
Parameters:
monitor - the progress monitor if monitoring is required or null otherwise
Throws:
org.eclipse.core.runtime.CoreException - if an exception occured

shutdown

public void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
              throws org.eclipse.core.runtime.CoreException
Description copied from interface: ISiteService
Shutdown the service. All system resources used by the service must be freed

Specified by:
shutdown in interface ISiteService
Parameters:
monitor - the progress monitor if monitoring is required or null otherwise
Throws:
org.eclipse.core.runtime.CoreException - if an exception occured

getRoot

public IResourceTreeRoot getRoot()
Description copied from interface: IResourceManager
The root of all resources owned by this resource manager

Specified by:
getRoot in interface IResourceManager
Returns:
the resources root. Cannot be null

newSite

public ISite newSite(java.lang.String uri)
Description copied from interface: IResourceManager
Create a new site resource given the site URI

Specified by:
newSite in interface IResourceManager
Parameters:
uri - the site URI
Returns:
the site

newFile

public ISiteFile newFile(ISite site,
                         java.lang.String path)
Specified by:
newFile in interface IResourceManager
Parameters:
site - the owner site
path - the file path
Returns:
the file

newFolder

public ISiteFolder newFolder(ISite site,
                             java.lang.String path)
Description copied from interface: IResourceManager
Create a new folder given the owner site and the folder path

Specified by:
newFolder in interface IResourceManager
Parameters:
site - the owner site
path - the folder path
Returns:
the folder

getSiteController

public ISiteController getSiteController(java.lang.String schema)
Description copied from interface: IResourceManager
Get the controller for the given schema or NullSiteController if none was defined

Specified by:
getSiteController in interface IResourceManager
Parameters:
schema - the URI schema that defines the controlled site type.
Returns:
the site controller

getControllerRegistry

public ISiteControllerRegistry getControllerRegistry()
Description copied from interface: IResourceManager
Get the controller registry

Specified by:
getControllerRegistry in interface IResourceManager
Returns:
the controller registry

getPropertyManager

public IPropertyManager getPropertyManager()
Description copied from interface: IResourceManager
Get the property manager

Specified by:
getPropertyManager in interface IResourceManager
Returns:
the property manager

getResourceProperty

public java.lang.Object getResourceProperty(ISiteResource resource,
                                            java.lang.String property)
Description copied from interface: IResourceManager
Get a resource property giving its name
This is a shortcut to the IPropertyManager.getProperty(ISiteResource, String)

Specified by:
getResourceProperty in interface IResourceManager
Parameters:
resource - the resource
property - the property name
Returns:
the property value

setResourceProperty

public void setResourceProperty(ISiteResource resource,
                                java.lang.String property,
                                java.lang.Object value)
Specified by:
setResourceProperty in interface IResourceManager