View Javadoc
1   package fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.service;
2   
3   import java.util.HashMap;
4   import java.util.List;
5   import java.util.Locale;
6   import java.util.Map.Entry;
7   
8   import fr.paris.lutece.plugins.appcenter.modules.fastdeployapplication.business.ServerApplicationInstance;
9   
10  public abstract class AbstractDatabaseService implements IDatabaseService
11  {
12  
13      
14      /*
15       * (non-Javadoc)
16       * 
17       * @see fr.paris.lutece.plugins.deployment.service.IDatabaseService#getHashDatabases(java.lang.String, java.util.HashMap, java.util.Locale)
18       */
19      @Override
20      public HashMap<String, List<String>> getHashDatabases( String strCodeApplication,
21              HashMap<String, List<ServerApplicationInstance>> hashServerApplicationInstanceMysql, Locale locale )
22      {
23  
24          HashMap<String, List<String>> hashDatabases = new HashMap<String, List<String>>( );
25          StringBuffer strKey;
26          List<String> lsDatabases;
27          for ( Entry<String, List<ServerApplicationInstance>> entry : hashServerApplicationInstanceMysql.entrySet( ) )
28          {
29  
30              for ( ServerApplicationInstance serverApplicationInstance : entry.getValue( ) )
31              {
32  
33                  strKey = new StringBuffer( );
34                  lsDatabases = getDatabases( strCodeApplication, serverApplicationInstance, locale );
35                  strKey.append( serverApplicationInstance.getCodeEnvironment( ) );
36                  strKey.append( "." );
37                  strKey.append( serverApplicationInstance.getCode( ) );
38                  strKey.append( "_" + serverApplicationInstance.getType( ) );
39  
40                  hashDatabases.put( strKey.toString( ), lsDatabases );
41              }
42  
43          }
44          return hashDatabases;
45      }
46  
47  }