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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Map<Class<? extends GisFeature>,IGisDao<? extends GisFeature>>` | `daoMap` A Map with GisFeature call as keys and Dao as Values.
    `protected IGisDao<? extends GisFeature>[]` | `daos`
    `protected static org.slf4j.Logger` | `logger` The logger

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepositoryStrategy()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<IGisDao<? extends GisFeature>>` | `getAvailablesDaos()`
    `IGisDao<? extends GisFeature>` | `getDao(Class<?> placeType)`
    `void` | `initMap()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### daos

          @Autowired
          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

  - ### Constructor Detail

    - #### RepositoryStrategy

          public RepositoryStrategy()

  - ### Method Detail

    - #### 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 © 2015. All rights reserved.