-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
556 additions
and
329 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
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
18 changes: 0 additions & 18 deletions
18
example-context/example-service/example-initialisation-liquibase/pom.xml
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
.../example-service/example-initialisation-liquibase/src/main/resources/liquibase.properties
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...itialisation-liquibase/src/main/resources/liquibase/initialise-event-log-db-changelog.xml
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
...rc/main/resources/liquibase/initialise-event-log-db-changesets/001-add-initial-events.xml
This file was deleted.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
...ustice/services/eventsourcing/repository/jdbc/event/EventStreamJdbsRepositoryFactory.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,28 @@ | ||
package uk.gov.justice.services.eventsourcing.repository.jdbc.event; | ||
|
||
import static org.slf4j.LoggerFactory.getLogger; | ||
import static uk.gov.justice.services.test.utils.core.reflection.ReflectionUtil.setField; | ||
|
||
import uk.gov.justice.services.common.util.UtcClock; | ||
import uk.gov.justice.services.eventsourcing.repository.jdbc.eventstream.EventStreamJdbcRepository; | ||
import uk.gov.justice.services.jdbc.persistence.DefaultJdbcDataSourceProvider; | ||
import uk.gov.justice.services.jdbc.persistence.JdbcRepositoryHelper; | ||
|
||
import javax.sql.DataSource; | ||
|
||
public class EventStreamJdbsRepositoryFactory { | ||
|
||
public EventStreamJdbcRepository getEventStreamJdbcRepository(final DataSource dataSource) { | ||
|
||
final EventStreamJdbcRepository eventStreamJdbcRepository = new EventStreamJdbcRepository( | ||
new JdbcRepositoryHelper(), | ||
new DefaultJdbcDataSourceProvider(), | ||
new UtcClock(), | ||
null, | ||
getLogger(EventStreamJdbcRepository.class)); | ||
|
||
setField(eventStreamJdbcRepository, "dataSource", dataSource); | ||
|
||
return eventStreamJdbcRepository; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
.../justice/services/eventsourcing/repository/jdbc/event/LinkedEventRepositoryTruncator.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,20 @@ | ||
package uk.gov.justice.services.eventsourcing.repository.jdbc.event; | ||
|
||
import java.sql.SQLException; | ||
|
||
import javax.sql.DataSource; | ||
|
||
public class LinkedEventRepositoryTruncator { | ||
|
||
private final DataSource datasource; | ||
private final LinkedEventJdbcRepository linkedEventJdbcRepository; | ||
|
||
public LinkedEventRepositoryTruncator(final DataSource datasource) { | ||
this.datasource = datasource; | ||
this.linkedEventJdbcRepository = new LinkedEventJdbcRepository(); | ||
} | ||
|
||
public void truncate() throws SQLException { | ||
linkedEventJdbcRepository.truncate(datasource.getConnection()); | ||
} | ||
} |
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
Oops, something went wrong.