com.gisgraphy.domain.repository
Class RepositoryStrategy
java.lang.Object
com.gisgraphy.domain.repository.RepositoryStrategy
- All Implemented Interfaces:
- IRepositoryStrategy
@Component
public class RepositoryStrategy
- extends Object
- implements IRepositoryStrategy
A class based on the stategy pattern
- Author:
- David Masclet
- See Also:
- Strategy pattern
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
daos
protected IGisDao<? extends GisFeature>[] daos
logger
protected static final org.slf4j.Logger logger
- The logger
daoMap
public static final Map<Class<? extends GisFeature>,IGisDao<? extends GisFeature>> daoMap
- A Map with GisFeature call as keys and Dao as Values. A (Gis)dao is
associated to a Class
RepositoryStrategy
public RepositoryStrategy()
initMap
@PostConstruct
public void initMap()
throws Exception
- Throws:
Exception
getDao
public IGisDao<? extends GisFeature> getDao(Class<?> placeType)
- Specified by:
getDao
in interface IRepositoryStrategy
- Parameters:
placeType
- the placetype we'd like to retrieve the dao. if the place
type is null the gisFeatureDao will be return
- Returns:
- the dao corresponding to the specified class
getAvailablesDaos
public Collection<IGisDao<? extends GisFeature>> getAvailablesDaos()
- Specified by:
getAvailablesDaos
in interface IRepositoryStrategy
- Returns:
- all the availables daos. never return null but an empty Arraylist
if there is no dao
Copyright © 2012. All Rights Reserved.