Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.directory
Class DirectoryServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.directory.DirectoryServiceImpl
All Implemented Interfaces:
DirectoryService, Adaptable, Component, Extensible

public class DirectoryServiceImpl
extends DefaultComponent
implements DirectoryService


Field Summary
 
Fields inherited from interface org.nuxeo.ecm.directory.api.DirectoryService
NAME
 
Constructor Summary
DirectoryServiceImpl()
           
 
Method Summary
 void activate(ComponentContext context)
          Activates the component.
 void applicationStarted(ComponentContext context)
          Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
 void deactivate(ComponentContext context)
          Deactivates the component.
 List<Directory> getDirectories()
          Return all the directories registered into the service.
 Directory getDirectory(String directoryName)
          Return the directory with the name directoryName.
 Directory getDirectory(String name, DocumentModel documentContext)
          Return the directory for the specified context.
 String getDirectoryIdField(String directoryName)
           
 List<String> getDirectoryNames()
           
 String getDirectoryPasswordField(String directoryName)
           
 String getDirectorySchema(String directoryName)
           
 String getParentDirectoryName(String directoryName)
          Returns the name of the parent directory of specified directory, if applicable.
 Session open(String directoryName)
          Opens a session on specified directory.
 Session open(String directoryName, DocumentModel documentContext)
          Opens a session on the directory for the specified context.
 void registerDirectory(String directoryName, DirectoryFactory factory)
           
 void registerExtension(Extension extension)
          Registers the given extension.
 void unregisterDirectory(String directoryName, DirectoryFactory factory)
           
 void unregisterExtension(Extension extension)
          Unregisters the given extension.
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
getAdapter, registerContribution, unregisterContribution
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryServiceImpl

public DirectoryServiceImpl()
Method Detail

applicationStarted

public void applicationStarted(ComponentContext context)
                        throws Exception
Description copied from interface: Component
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.

Specified by:
applicationStarted in interface Component
Overrides:
applicationStarted in class DefaultComponent
Throws:
Exception

getDirectory

public Directory getDirectory(String directoryName)
                       throws DirectoryException
Description copied from interface: DirectoryService
Return the directory with the name directoryName.

If the directoryName is null, return null.

Specified by:
getDirectory in interface DirectoryService
Returns:
the directory, if the factory of the directory or the directory itself is not found return null
Throws:
DirectoryException

getDirectory

public Directory getDirectory(String name,
                              DocumentModel documentContext)
                       throws DirectoryException
Description copied from interface: DirectoryService
Return the directory for the specified context. The context is given by the document. The document service will try to find the directory local configuration of the document that will specify the suffix. The directory service will fetch the directoryName + suffix found. If no local configuration is found the service will return the directoryName directory.

If the directoryName is null, return null.

Specified by:
getDirectory in interface DirectoryService
Returns:
the directory, if the factory of the directory or the directory itself is not found return null
Throws:
DirectoryException

getDirectories

public List<Directory> getDirectories()
                               throws DirectoryException
Description copied from interface: DirectoryService
Return all the directories registered into the service.

Specified by:
getDirectories in interface DirectoryService
Throws:
DirectoryException

activate

public void activate(ComponentContext context)
              throws Exception
Description copied from interface: Component
Activates the component.

This method is called by the runtime when a component is activated.

Specified by:
activate in interface Component
Overrides:
activate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

deactivate

public void deactivate(ComponentContext context)
                throws Exception
Description copied from interface: Component
Deactivates the component.

This method is called by the runtime when a component is deactivated.

Specified by:
deactivate in interface Component
Overrides:
deactivate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

registerExtension

public void registerExtension(Extension extension)
                       throws Exception
Description copied from interface: Extensible
Registers the given extension.

Specified by:
registerExtension in interface Extensible
Overrides:
registerExtension in class DefaultComponent
Parameters:
extension - the extension to register
Throws:
Exception - if any error occurs

unregisterExtension

public void unregisterExtension(Extension extension)
                         throws Exception
Description copied from interface: Extensible
Unregisters the given extension.

Specified by:
unregisterExtension in interface Extensible
Overrides:
unregisterExtension in class DefaultComponent
Parameters:
extension - the extension to unregister
Throws:
Exception - if any error occurs

registerDirectory

public void registerDirectory(String directoryName,
                              DirectoryFactory factory)
Specified by:
registerDirectory in interface DirectoryService

unregisterDirectory

public void unregisterDirectory(String directoryName,
                                DirectoryFactory factory)
Specified by:
unregisterDirectory in interface DirectoryService

getDirectoryNames

public List<String> getDirectoryNames()
                               throws DirectoryException
Specified by:
getDirectoryNames in interface DirectoryService
Throws:
DirectoryException

getDirectorySchema

public String getDirectorySchema(String directoryName)
                          throws DirectoryException
Specified by:
getDirectorySchema in interface DirectoryService
Throws:
DirectoryException

getDirectoryIdField

public String getDirectoryIdField(String directoryName)
                           throws DirectoryException
Specified by:
getDirectoryIdField in interface DirectoryService
Throws:
DirectoryException

getDirectoryPasswordField

public String getDirectoryPasswordField(String directoryName)
                                 throws DirectoryException
Specified by:
getDirectoryPasswordField in interface DirectoryService
Throws:
DirectoryException

open

public Session open(String directoryName)
             throws DirectoryException
Description copied from interface: DirectoryService
Opens a session on specified directory.

This method prefers to throw rather than returning null.

Specified by:
open in interface DirectoryService
Returns:
the session
Throws:
DirectoryException - in case the session cannot be created

open

public Session open(String directoryName,
                    DocumentModel documentContext)
             throws DirectoryException
Description copied from interface: DirectoryService
Opens a session on the directory for the specified context. The context is given by the document. The document service will try to find the directory local configuration of the document that will specify the suffix. the directory will fetch the directoryName + suffix found. If no local configuration is found the service will return the directoryName directory.

This method prefers to throw rather than returning null.

Specified by:
open in interface DirectoryService
Returns:
the session
Throws:
DirectoryException - in case the session cannot be created

getParentDirectoryName

public String getParentDirectoryName(String directoryName)
                              throws DirectoryException
Description copied from interface: DirectoryService
Returns the name of the parent directory of specified directory, if applicable.

Specified by:
getParentDirectoryName in interface DirectoryService
Returns:
the name, or null
Throws:
DirectoryException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.