Package org.ametys.core.group
Class GroupDirectoryContextHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.group.GroupDirectoryContextHelper
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class GroupDirectoryContextHelper extends AbstractLogEnabled implements Component, Serviceable
Helper for associatingGroupDirectory
(ies) to contexts.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__GROUP_DIRECTORIES_TABLE
The name of the JDBC table for group directories by contextprivate GroupDirectoryDAO
_groupDirectoryDAO
The DAO forGroupDirectory
(ies)static String
ADMIN_CONTEXT
The "admin" contextstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description GroupDirectoryContextHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Set<String>
_getDirectorieOnContextFromDatabase(String context)
Set<String>
getGroupDirectoriesOnContext(String context)
Gets the group directories linked to the given contextSet<String>
getGroupDirectoriesOnContexts(Set<String> contexts)
Gets the group directories linked to at least one of the given contextsprotected Connection
getSQLConnection()
Get the connection to the databaseList<String>
link(String context, List<String> ids)
Links given group directories to a context.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
ADMIN_CONTEXT
public static final String ADMIN_CONTEXT
The "admin" context- See Also:
- Constant Field Values
-
__GROUP_DIRECTORIES_TABLE
private static final String __GROUP_DIRECTORIES_TABLE
The name of the JDBC table for group directories by context- See Also:
- Constant Field Values
-
_groupDirectoryDAO
private GroupDirectoryDAO _groupDirectoryDAO
The DAO forGroupDirectory
(ies)
-
-
Constructor Detail
-
GroupDirectoryContextHelper
public GroupDirectoryContextHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSQLConnection
protected Connection getSQLConnection()
Get the connection to the database- Returns:
- the SQL connection
-
link
public List<String> link(String context, List<String> ids)
Links given group directories to a context.- Parameters:
context
- The contextids
- The ids of the group directories to link- Returns:
- The ids of the linked group directories
-
getGroupDirectoriesOnContext
public Set<String> getGroupDirectoriesOnContext(String context)
Gets the group directories linked to the given context- Parameters:
context
- The context- Returns:
- The ids of group directories linked to the context
-
getGroupDirectoriesOnContexts
public Set<String> getGroupDirectoriesOnContexts(Set<String> contexts)
Gets the group directories linked to at least one of the given contexts- Parameters:
contexts
- The contexts- Returns:
- The ids of group directories linked to the contexts
-
_getDirectorieOnContextFromDatabase
private Set<String> _getDirectorieOnContextFromDatabase(String context)
-
-