Package org.ametys.core.util.ldap
Class ScopeEnumerator
- java.lang.Object
-
- org.ametys.core.util.ldap.ScopeEnumerator
-
- All Implemented Interfaces:
Enumerator<String>
,Enumerator
public class ScopeEnumerator extends Object implements Enumerator<String>, Enumerator
Enumerator
for listing scopes supported in a LDAP query.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__CORE_IMPL_CATALOGUE
private static Map<String,I18nizableText>
__SCOPES
-
Constructor Summary
Constructors Constructor Description ScopeEnumerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getConfiguration()
Get the configuration of this enumeratorMap<Object,I18nizableText>
getEntries()
Provides the enumerated values with their optional label.I18nizableText
getEntry(String value)
Retrieves a single label from a value.Map<String,I18nizableText>
getTypedEntries()
Provides the enumerated values with their optional label.static int
parseScope(String scope)
Parses a scope config parameter into aint
for using it asSearchControls
.
-
-
-
Field Detail
-
__CORE_IMPL_CATALOGUE
private static final String __CORE_IMPL_CATALOGUE
- See Also:
- Constant Field Values
-
__SCOPES
private static final Map<String,I18nizableText> __SCOPES
-
-
Constructor Detail
-
ScopeEnumerator
public ScopeEnumerator()
-
-
Method Detail
-
parseScope
public static int parseScope(String scope) throws IllegalArgumentException
Parses a scope config parameter into aint
for using it asSearchControls
.- Parameters:
scope
- the scope string representation.- Returns:
- the scope as a
SearchControls.*_SCOPE
. - Throws:
IllegalArgumentException
- if the given scope is not valid.
-
getEntry
public I18nizableText getEntry(String value)
Description copied from interface:Enumerator
Retrieves a single label from a value.- Specified by:
getEntry
in interfaceEnumerator<String>
- Specified by:
getEntry
in interfaceEnumerator
- Parameters:
value
- the value.- Returns:
- the label or
null
if not found.
-
getTypedEntries
public Map<String,I18nizableText> getTypedEntries()
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getTypedEntries
in interfaceEnumerator<String>
- Returns:
- the enumerated values and their label.
-
getEntries
public Map<Object,I18nizableText> getEntries()
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getEntries
in interfaceEnumerator
- Returns:
- the enumerated values and their label.
-
getConfiguration
public Map<String,Object> getConfiguration()
Description copied from interface:Enumerator
Get the configuration of this enumerator- Specified by:
getConfiguration
in interfaceEnumerator<String>
- Specified by:
getConfiguration
in interfaceEnumerator
- Returns:
- the configuration
-
-