-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wsimport - handshake and delete pending client tables on rerun
- Loading branch information
Showing
29 changed files
with
820 additions
and
974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
arc-core/src/main/java/fr/insee/arc/core/model/DataWarehouse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package fr.insee.arc.core.model; | ||
|
||
/** | ||
* Liste des entrepots de donnés Pour l'instant cela ne représente juste qu'un | ||
* répertoire ou arrive les données | ||
*/ | ||
public enum DataWarehouse { | ||
|
||
// nom de l'entrepot par défaut | ||
DEFAULT("DEFAULT"); | ||
|
||
private DataWarehouse(String name) { | ||
this.name = name; | ||
} | ||
|
||
private String name; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
arc-core/src/main/java/fr/insee/arc/core/service/global/dao/TableMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package fr.insee.arc.core.service.global.dao; | ||
|
||
import fr.insee.arc.core.dataobjects.ArcPreparedStatementBuilder; | ||
import fr.insee.arc.core.dataobjects.ColumnEnum; | ||
import fr.insee.arc.utils.dao.SQL; | ||
|
||
public class TableMetadata { | ||
|
||
private TableMetadata() { | ||
throw new IllegalStateException("Utility class"); | ||
} | ||
|
||
public static ArcPreparedStatementBuilder queryTablesFromPgMetadata() { | ||
ArcPreparedStatementBuilder query = new ArcPreparedStatementBuilder(); | ||
query.build(SQL.SELECT, ColumnEnum.TABLE_SCHEMA, "||'.'||", ColumnEnum.TABLE_NAME, SQL.AS, | ||
ColumnEnum.TABLE_NAME); | ||
query.build(SQL.FROM, "information_schema.tables"); | ||
return query; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
arc-core/src/test/java/fr/insee/arc/core/service/global/dao/TableNamingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package fr.insee.arc.core.service.global.dao; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
import fr.insee.arc.core.dataobjects.ColumnEnum; | ||
import fr.insee.arc.core.dataobjects.ViewEnum; | ||
|
||
public class TableNamingTest { | ||
|
||
@Test | ||
public void buildTableNameTokensSuffix() { | ||
|
||
String client = "ARTEMIS"; | ||
long timestamp = System.currentTimeMillis(); | ||
|
||
assertEquals("arc_bas2.artemis_"+timestamp+"_pilotage_fichier", TableNaming.buildTableNameWithTokens("arc_bas2", ViewEnum.PILOTAGE_FICHIER, client, timestamp)); | ||
assertEquals("arc_bas2.artemis_"+timestamp+"_id_source", TableNaming.buildTableNameWithTokens("arc_bas2", ColumnEnum.ID_SOURCE, client, timestamp)); | ||
assertEquals(null, TableNaming.buildTableNameWithTokens("arc_bas2", ColumnEnum.ID_SOURCE, null, timestamp)); | ||
assertEquals("arc_bas2.artemis_"+timestamp+"_test", TableNaming.buildTableNameWithTokens("arc_bas2", "test", client, timestamp)); | ||
assertEquals("arc_bas2.test", TableNaming.buildTableNameWithTokens("arc_bas2", "TEST")); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.