org.gcube.portlets.user.homelibrary.home
Class HomeLibrary

java.lang.Object
  extended by org.gcube.portlets.user.homelibrary.home.HomeLibrary

public class HomeLibrary
extends Object

Author:
Federico De Faveri defaveri@isti.cnr.it

Field Summary
static String HOME_ATTRIBUTE_NAME
          Home attribute name in ASLSession.
protected static HomeManagerFactory instance
           
protected static org.gcube.common.core.utils.logging.GCUBELog staticLogger
           
 
Constructor Summary
HomeLibrary()
           
 
Method Summary
protected static void checkPersistenceFolder(String persistenceFolder)
          Check if the persistence folder exists otherwise create it.
protected static HomeManagerFactory createHomeManagerFactoryInstance(String persistenceRoot)
           
static HomeManagerFactory getHomeManagerFactory()
          Return the HomeManagerFactory.
static HomeManagerFactory getHomeManagerFactory(String persistenceRoot)
          Return an instance of HomeManager factory for the given path.
protected static HomeManagerFactory getHomeManagerFactoryImplementation()
          Returns the HomeManagerFactory implementation to use.
static DataArea getUserDataArea(org.gcube.application.framework.core.session.ASLSession session)
          Return the DataArea for the user in session.
static Home getUserHome(org.gcube.application.framework.core.session.ASLSession session)
          Return the Home for the user in session.
static Workspace getUserWorkspace(org.gcube.application.framework.core.session.ASLSession session)
          Return the Workspace for the user in session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOME_ATTRIBUTE_NAME

public static final String HOME_ATTRIBUTE_NAME
Home attribute name in ASLSession.

See Also:
Constant Field Values

staticLogger

protected static org.gcube.common.core.utils.logging.GCUBELog staticLogger

instance

protected static HomeManagerFactory instance
Constructor Detail

HomeLibrary

public HomeLibrary()
Method Detail

getHomeManagerFactoryImplementation

protected static HomeManagerFactory getHomeManagerFactoryImplementation()
                                                                 throws InternalErrorException
Returns the HomeManagerFactory implementation to use.

Returns:
an instance of HomeManagerFactory.
Throws:
InternalErrorException - if an error occurs retrieving the HomeManagerFactory implementation.

checkPersistenceFolder

protected static void checkPersistenceFolder(String persistenceFolder)
                                      throws InternalErrorException
Check if the persistence folder exists otherwise create it.

Parameters:
persistenceFolder - the persistence folder to check.
Throws:
InternalErrorException - if the persistence folder check fails.

createHomeManagerFactoryInstance

protected static HomeManagerFactory createHomeManagerFactoryInstance(String persistenceRoot)
                                                              throws InternalErrorException
Throws:
InternalErrorException

getHomeManagerFactory

public static HomeManagerFactory getHomeManagerFactory(String persistenceRoot)
                                                throws InternalErrorException
Return an instance of HomeManager factory for the given path.

Parameters:
persistenceRoot - the persistence root.
Returns:
the HomeManagerFactory.
Throws:
InternalErrorException - if an error occurs.

getHomeManagerFactory

public static HomeManagerFactory getHomeManagerFactory()
                                                throws InternalErrorException
Return the HomeManagerFactory.

Returns:
the HomeManagerFactory.
Throws:
InternalErrorException - if an error occurs.

getUserWorkspace

public static Workspace getUserWorkspace(org.gcube.application.framework.core.session.ASLSession session)
                                  throws InternalErrorException,
                                         HomeNotFoundException,
                                         WorkspaceFolderNotFoundException
Return the Workspace for the user in session.

Parameters:
session - the asl session.
Returns:
the user Workspace.
Throws:
InternalErrorException - if an error occurs.
HomeNotFoundException - if the user home is not found.
WorkspaceFolderNotFoundException - if the user workspace is not found.

getUserDataArea

public static DataArea getUserDataArea(org.gcube.application.framework.core.session.ASLSession session)
                                throws InternalErrorException,
                                       HomeNotFoundException
Return the DataArea for the user in session.

Parameters:
session - the ASL session.
Returns:
the user DataArea.
Throws:
InternalErrorException - if an error occurs.
HomeNotFoundException - if the user home is not found.

getUserHome

public static Home getUserHome(org.gcube.application.framework.core.session.ASLSession session)
                        throws InternalErrorException,
                               HomeNotFoundException
Return the Home for the user in session.

Parameters:
session - the asl session.
Returns:
the user Home.
Throws:
InternalErrorException - if an error occurs.
HomeNotFoundException - if the user home is not found.


Copyright © 2013. All Rights Reserved.