Class SearchServiceInstanceManager
- java.lang.Object
-
- org.ametys.web.frontoffice.search.instance.SearchServiceInstanceManager
-
- All Implemented Interfaces:
Disposable
,Component
,Serviceable
public class SearchServiceInstanceManager extends Object implements Component, Serviceable, Disposable
The component managing allSearchServiceInstance
s.
-
-
Field Summary
Fields Modifier and Type Field Description private SearchServiceInstanceFactory
_factory
private Map<String,SearchServiceInstance>
_instances
private AmetysObjectResolver
_resolver
static String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description SearchServiceInstanceManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_clearCache()
void
dispose()
SearchServiceInstance
get(String zoneItemId)
Gets, or creates if it does not exist yet, theSearchServiceInstance
which is placed at the givenZoneItem
.boolean
isSearchServiceInstance(String zoneItemId)
void
remove(String zoneItemId)
Removes theSearchServiceInstance
which is placed at the givenZoneItem
.void
service(ServiceManager manager)
-
-
-
Field Detail
-
_resolver
private AmetysObjectResolver _resolver
-
_factory
private SearchServiceInstanceFactory _factory
-
_instances
private Map<String,SearchServiceInstance> _instances
-
-
Constructor Detail
-
SearchServiceInstanceManager
public SearchServiceInstanceManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
_clearCache
private void _clearCache()
-
isSearchServiceInstance
public boolean isSearchServiceInstance(String zoneItemId)
- Parameters:
zoneItemId
- the id of theZoneItem
- Returns:
true
if the given id of aZoneItem
is an instance of aSearchService
-
get
public SearchServiceInstance get(String zoneItemId)
Gets, or creates if it does not exist yet, theSearchServiceInstance
which is placed at the givenZoneItem
.
You must callisSearchServiceInstance
before to ensure that the given id is an instance ofSearchService
(this check is not done in this method)- Parameters:
zoneItemId
- the id of theZoneItem
- Returns:
- the
SearchServiceInstance
which is placed at the givenZoneItem
-
remove
public void remove(String zoneItemId)
Removes theSearchServiceInstance
which is placed at the givenZoneItem
.- Parameters:
zoneItemId
- the id of theZoneItem
-
-