diff --git a/application/build.gradle b/application/build.gradle index 1fc89611..9110164d 100644 --- a/application/build.gradle +++ b/application/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':components:common') implementation project(':components:consumer-common') + implementation project(':components:govoffchain-scheduler') implementation project(':components:scheduler') implementation project(':components:healthcheck') diff --git a/components/govoffchain-scheduler/build.gradle b/components/govoffchain-scheduler/build.gradle new file mode 100644 index 00000000..8b88f249 --- /dev/null +++ b/components/govoffchain-scheduler/build.gradle @@ -0,0 +1,25 @@ +dependencies { + implementation project(":components:common") + implementation project(':components:consumer-common') + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation(libs.cardano.client.lib) + implementation(libs.yaci.store.governance) + implementation(libs.jsonld.java) + + compileOnly(libs.lombok) + annotationProcessor(libs.lombok) + + testImplementation 'org.springframework.boot:spring-boot-starter-test' +} + +publishing { + publications { + mavenJava(MavenPublication) { + pom { + name = 'Ledger Sync Scheduler OffChain' + description = 'Ledger Sync Scheduler OffChain Module' + } + } + } +} diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerConfiguration.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerConfiguration.java new file mode 100644 index 00000000..1547296b --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerConfiguration.java @@ -0,0 +1,81 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler; + +import org.cardanofoundation.ledgersync.govoffchainscheduler.jobs.OffChainDataScheduler; + +import lombok.extern.slf4j.Slf4j; + +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainPersistService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainRetryDataErrorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@ConditionalOnProperty( + prefix = "ledger-sync.scheduler", + name = "enabled", + havingValue = "true", + matchIfMissing = true +) +@Configuration +@EnableConfigurationProperties(GovOffChainSchedulerProperties.class) +@ComponentScan(basePackages = {"org.cardanofoundation.ledgersync.govoffchainscheduler"}) +@EnableJpaRepositories(basePackages = {"org.cardanofoundation.ledgersync.govoffchainscheduler"}) +@EntityScan(basePackages = {"org.cardanofoundation.ledgersync.govoffchainscheduler", + "com.bloxbean.cardano.yaci.store.core", + "com.bloxbean.cardano.yaci.store.governance"}) +@EnableTransactionManagement +@EnableScheduling +@EnableAsync +@Slf4j +public class GovOffChainSchedulerConfiguration { + + @Autowired + GovOffChainSchedulerProperties properties; + +// @Bean +// public PoolOfflineDataScheduler poolOfflineDataScheduler(PoolOfflineDataStoringService poolOfflineDataStoringService, +// PoolOfflineDataFetchingService poolOfflineDataFetchingService, +// PoolOfflineDataProperties poolOfflineDataProperties) { +// log.info("<<< Enable PoolOfflineDataScheduler >>>"); +// log.info("PoolOfflineDataScheduler: fixed delay time {} sec", poolOfflineDataProperties.getFixedDelay()); +// return new PoolOfflineDataScheduler(poolOfflineDataStoringService, poolOfflineDataFetchingService, poolOfflineDataProperties); +// } + + @Bean + public OffChainDataScheduler offChainVotingDataScheduler( + OffChainPersistService offChainPersistService, + OffChainRetryDataErrorService offChainDataFetchingErrorService, + OffChainDataProperties offChainDataProperties) { + log.info("<<< Enable OffChainDataScheduler >>>"); + log.info("OffChainDataScheduler: fixed delay time {} sec", offChainDataProperties.getFixedDelay()); + return new OffChainDataScheduler(offChainPersistService, offChainDataFetchingErrorService, offChainDataProperties); + } + +// @Bean +// PoolOfflineDataProperties poolOfflineDataProperties() { +// PoolOfflineDataProperties poolOfflineDataProperties = new PoolOfflineDataProperties(); +// poolOfflineDataProperties.setFixedDelay(properties.getPoolOfflineData().getFixedDelay()); +// poolOfflineDataProperties.setInitialDelay(properties.getPoolOfflineData().getInitialDelay()); +// return poolOfflineDataProperties; +// } + + @Bean + OffChainDataProperties offChainDataProperties() { + OffChainDataProperties offChainDataProperties = new OffChainDataProperties(); + offChainDataProperties.setFixedDelay(properties.getOffChainData().getFixedDelay()); + offChainDataProperties.setInitialDelay(properties.getOffChainData().getInitialDelay()); + offChainDataProperties.setFixedDelayFetchError(properties.getOffChainData().getFixedDelayFetchError()); + offChainDataProperties.setInitialDelayFetchError(properties.getOffChainData().getInitialDelayFetchError()); + offChainDataProperties.setRetryCount(properties.getOffChainData().getRetryCount()); + return offChainDataProperties; + } + +} diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerProperties.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerProperties.java new file mode 100644 index 00000000..3e11ddc3 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/GovOffChainSchedulerProperties.java @@ -0,0 +1,41 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@Getter +@Setter +@ConfigurationProperties(prefix = "ledger-sync.scheduler", ignoreUnknownFields = true) +public class GovOffChainSchedulerProperties { + private boolean enabled = true; + private PoolOfflineData poolOfflineData = new PoolOfflineData(); + private OffChainData offChainData = new OffChainData(); + private AsyncConfig asyncConfig = new AsyncConfig(); + + @Getter + @Setter + public static final class PoolOfflineData { + private long fixedDelay = 172800L; + private long initialDelay = 20000L; + } + + @Getter + @Setter + public static final class OffChainData { + private long fixedDelay = 300000L; + private long initialDelay = 20000L; + private long fixedDelayFetchError = 2000000L; + private long initialDelayFetchError = 2000000L; + private int retryCount = 10; + } + + @Getter + @Setter + public static final class AsyncConfig { + private int core = 10; + private int max = 12; + private String name = "Scheduler-Executorxx-"; + } + +} diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/OffChainDataProperties.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/OffChainDataProperties.java similarity index 81% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/OffChainDataProperties.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/OffChainDataProperties.java index fe4c8d2e..4effea57 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/OffChainDataProperties.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/OffChainDataProperties.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler; +package org.cardanofoundation.ledgersync.govoffchainscheduler; import lombok.Getter; import lombok.Setter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/ExecutorConfig.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/config/ExecutorConfig.java similarity index 94% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/ExecutorConfig.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/config/ExecutorConfig.java index b6cbe77a..dd8a9e8b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/ExecutorConfig.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/config/ExecutorConfig.java @@ -1,14 +1,14 @@ -package org.cardanofoundation.ledgersync.scheduler.config; +package org.cardanofoundation.ledgersync.govoffchainscheduler.config; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - import jakarta.annotation.PreDestroy; @Configuration diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java new file mode 100644 index 00000000..166a18b5 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/constant/JobConstants.java @@ -0,0 +1,8 @@ +// package org.cardanofoundation.ledgersync.scheduler.constant; + +// public final class JobConstants { +// private JobConstants() {} + +// public static final int DEFAULT_BATCH = 20; +// public static final char END_LINE = '\n'; +// } diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/AnchorDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/AnchorDTO.java similarity index 80% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/AnchorDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/AnchorDTO.java index aef8faf8..c2689c80 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/AnchorDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/AnchorDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/CommitteeDeregistrationDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/CommitteeDeregistrationDTO.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/CommitteeDeregistrationDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/CommitteeDeregistrationDTO.java index 5b0b53d1..0fd385fa 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/CommitteeDeregistrationDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/CommitteeDeregistrationDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/ConstitutionAnchorDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/ConstitutionAnchorDTO.java similarity index 88% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/ConstitutionAnchorDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/ConstitutionAnchorDTO.java index a6a7b08c..25fae026 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/ConstitutionAnchorDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/ConstitutionAnchorDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/DRepRegistrationDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/DRepRegistrationDTO.java similarity index 89% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/DRepRegistrationDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/DRepRegistrationDTO.java index 15125da7..3bfac10e 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/DRepRegistrationDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/DRepRegistrationDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/GovAnchorDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/GovAnchorDTO.java similarity index 88% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/GovAnchorDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/GovAnchorDTO.java index df1217bc..f08588a8 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/GovAnchorDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/GovAnchorDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/VotingDataAnchorDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/VotingDataAnchorDTO.java similarity index 87% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/VotingDataAnchorDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/VotingDataAnchorDTO.java index a8591984..808a6062 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/anchor/VotingDataAnchorDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/anchor/VotingDataAnchorDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.anchor; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor; import java.util.UUID; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java similarity index 87% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java index 63af4383..3e415b45 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainCommitteeDeregFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java similarity index 86% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java index 52d955c7..c6f8bb36 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainConstitutionFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java similarity index 86% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java index 115e04fc..8bfabc80 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainDRepRegistrationFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainFetchResultDTO.java similarity index 91% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainFetchResultDTO.java index ad0ab6a9..1721979e 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainGovFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainGovFetchResultDTO.java similarity index 86% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainGovFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainGovFetchResultDTO.java index 32d1dc8b..032335aa 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainGovFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainGovFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainVotingFetchResultDTO.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainVotingFetchResultDTO.java similarity index 86% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainVotingFetchResultDTO.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainVotingFetchResultDTO.java index 2e08d251..d9a53d33 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/dto/offchain/OffChainVotingFetchResultDTO.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/dto/offchain/OffChainVotingFetchResultDTO.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.dto.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain; import java.util.UUID; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/OffChainDataScheduler.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/jobs/OffChainDataScheduler.java similarity index 75% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/OffChainDataScheduler.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/jobs/OffChainDataScheduler.java index 7cf12457..092b3f0b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/jobs/OffChainDataScheduler.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/jobs/OffChainDataScheduler.java @@ -1,12 +1,12 @@ -package org.cardanofoundation.ledgersync.scheduler.jobs; +package org.cardanofoundation.ledgersync.govoffchainscheduler.jobs; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.experimental.FieldDefaults; import lombok.extern.slf4j.Slf4j; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainPersistService; -import org.cardanofoundation.ledgersync.scheduler.OffChainDataProperties; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainRetryDataErrorService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainPersistService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.OffChainDataProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainRetryDataErrorService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.transaction.annotation.Transactional; @@ -23,11 +23,11 @@ public class OffChainDataScheduler { @Scheduled(initialDelayString = "#{offChainDataProperties.getInitialDelay() * 1000}", fixedDelayString = "#{offChainDataProperties.getFixedDelay() * 1000}") public void fetchOffChain() { - log.info("-----------Start job fetch pool offline data-----------"); + log.info("-----------Start job fetch offchain data-----------"); final var startTime = System.currentTimeMillis(); offChainPersistService.validateAndPersistData(); log.info( - "----------End job fetch pool offline data, time taken: {} ms----------", + "----------End job fetch offchain data, time taken: {} ms----------", (System.currentTimeMillis() - startTime)); } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java new file mode 100644 index 00000000..abeee728 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/projection/PoolHashUrlProjection.java @@ -0,0 +1,9 @@ +// package org.cardanofoundation.ledgersync.scheduler.projection; + +// public interface PoolHashUrlProjection { +// Long getPoolId(); + +// String getUrl(); + +// Long getMetadataId(); +// } diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainPersistService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainPersistService.java similarity index 53% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainPersistService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainPersistService.java index e21ae8fa..887c1983 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainPersistService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainPersistService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service; public interface OffChainPersistService { diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainRetryDataErrorService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainRetryDataErrorService.java similarity index 55% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainRetryDataErrorService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainRetryDataErrorService.java index 575c6649..1cb853b4 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/OffChainRetryDataErrorService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/OffChainRetryDataErrorService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service; public interface OffChainRetryDataErrorService { void retryOffChainErrorData(); diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainPersistServiceImpl.java similarity index 93% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainPersistServiceImpl.java index 0a1aaa82..4bd56b79 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.impl; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.impl; import java.time.LocalTime; import java.util.Arrays; @@ -9,8 +9,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainPersistService; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainPersistService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainRetryDataErrorServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainRetryDataErrorServiceImpl.java similarity index 92% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainRetryDataErrorServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainRetryDataErrorServiceImpl.java index e2ac0f2b..3ac698e0 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/impl/OffChainRetryDataErrorServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/impl/OffChainRetryDataErrorServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.impl; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.impl; import java.time.LocalTime; import java.util.Arrays; @@ -9,8 +9,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainRetryDataErrorService; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.OffChainRetryDataErrorService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainFetchService.java similarity index 97% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainFetchService.java index 9ff56b53..fc837ae2 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain; import static com.bloxbean.cardano.client.util.JsonFieldWriter.mapper; @@ -29,8 +29,8 @@ import org.cardanofoundation.ledgersync.common.util.HexUtil; import org.cardanofoundation.ledgersync.common.util.UrlUtil; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.AnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.AnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessPersistDataService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessPersistDataService.java similarity index 77% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessPersistDataService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessPersistDataService.java index 1f559963..8134f844 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessPersistDataService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessPersistDataService.java @@ -1,12 +1,12 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain; import java.util.Optional; import org.cardanofoundation.ledgersync.common.common.Era; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDataCheckpoint; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; public interface OffChainProcessPersistDataService { void process(); diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessRetryDataService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessRetryDataService.java new file mode 100644 index 00000000..b589af82 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainProcessRetryDataService.java @@ -0,0 +1,7 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain; + + +public interface OffChainProcessRetryDataService { + void process(); + +} diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainStoringService.java similarity index 89% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainStoringService.java index d5f6c1dd..54fd198a 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/OffChainStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain; import java.util.Collection; import java.util.Set; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java similarity index 84% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java index 17386624..742baac1 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregExtractFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.committeederegistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.committeederegistration; import java.util.concurrent.ExecutorService; @@ -8,11 +8,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainCommitteeDeregFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainFetchService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainCommitteeDeregFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainFetchService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -26,9 +26,9 @@ public class CommitteeDeregExtractFetchService extends OffChainFetchService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; - public CommitteeDeregExtractFetchService(SchedulerProperties properties, + public CommitteeDeregExtractFetchService(GovOffChainSchedulerProperties properties, @Qualifier("offChainExecutor") ExecutorService executor) { super(executor); this.properties = properties; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java index 9e2a1bf8..7662025d 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.committeederegistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.committeederegistration; import java.sql.Timestamp; import java.util.List; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDataCheckpoint; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.governance.CommitteeDeregistrationRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance.CommitteeDeregistrationRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java similarity index 83% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java index 475910d8..e6eac2b6 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregRetryServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.committeederegistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.committeederegistration; import java.util.List; @@ -6,9 +6,9 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainCommitteeDeregStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainCommitteeDeregStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java similarity index 91% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java index cd0e3e21..55497e84 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/committeederegistration/CommitteeDeregStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.committeederegistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.committeederegistration; import java.sql.Timestamp; import java.util.Collection; @@ -13,10 +13,10 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainCommitteeDeregistrationId; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainStoringService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainCommitteeDeregStorage; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainFetchErrorStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainStoringService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainCommitteeDeregStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainFetchErrorStorage; import org.springframework.stereotype.Component; import lombok.AccessLevel; @@ -31,7 +31,7 @@ public class CommitteeDeregStoringService extends OffChainStoringService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; final OffChainFetchErrorStorage offChainFetchErrorStorage; final OffChainCommitteeDeregStorage offChainCommitteeDeregStorage; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionExtractFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionExtractFetchService.java similarity index 81% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionExtractFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionExtractFetchService.java index 1a72656f..e1da49bd 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionExtractFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionExtractFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.constitution; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.constitution; import java.util.concurrent.ExecutorService; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainConstitutionFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainFetchService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainConstitutionFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainFetchService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -25,9 +25,9 @@ public class ConstitutionExtractFetchService extends OffChainFetchService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; - public ConstitutionExtractFetchService(SchedulerProperties properties, + public ConstitutionExtractFetchService(GovOffChainSchedulerProperties properties, @Qualifier("offChainExecutor") ExecutorService executor) { super(executor); this.properties = properties; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java index ccd01936..f02d80d9 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.constitution; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.constitution; import java.sql.Timestamp; import java.util.List; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDataCheckpoint; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.governance.ConstitutionRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance.ConstitutionRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java index 924df22c..e8c64cf9 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionRetryServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.constitution; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.constitution; import java.util.List; @@ -6,9 +6,9 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainConstitutionStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainConstitutionStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionStoringService.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionStoringService.java index 65dafe54..e4d0c4b2 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/constitution/ConstitutionStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/constitution/ConstitutionStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.constitution; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.constitution; import java.sql.Timestamp; import java.util.Collection; @@ -12,10 +12,10 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainConstitution; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainStoringService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainConstitutionStorage; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainFetchErrorStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainStoringService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainConstitutionStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainFetchErrorStorage; import org.springframework.stereotype.Component; import lombok.AccessLevel; @@ -30,7 +30,7 @@ public class ConstitutionStoringService extends OffChainStoringService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; final OffChainFetchErrorStorage offChainFetchErrorStorage; final OffChainConstitutionStorage offChainConstitutionStorage; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java similarity index 84% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java index 86a95604..ea43c195 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationExtractFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.drepregistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.drepregistration; import java.util.concurrent.ExecutorService; @@ -8,11 +8,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainDRepRegistrationFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainFetchService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainDRepRegistrationFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainFetchService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -26,9 +26,9 @@ public class DRepRegistrationExtractFetchService extends OffChainFetchService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; - public DRepRegistrationExtractFetchService(SchedulerProperties properties, + public DRepRegistrationExtractFetchService(GovOffChainSchedulerProperties properties, @Qualifier("offChainExecutor") ExecutorService executor) { super(executor); this.properties = properties; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java index 59d01af8..d8709e6f 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.drepregistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.drepregistration; import java.sql.Timestamp; import java.util.List; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDataCheckpoint; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.governance.DRepRegistrationRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance.DRepRegistrationRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java similarity index 83% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java index 11080019..42e70627 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationRetryServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.drepregistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.drepregistration; import java.util.List; @@ -6,9 +6,9 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDRepRegistrationStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDRepRegistrationStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java index 56aca476..401b7d08 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/drepregistration/DRepRegistrationStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.drepregistration; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.drepregistration; import java.sql.Timestamp; import java.util.Collection; @@ -13,10 +13,10 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainDRepRegistrationId; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainStoringService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDRepRegistrationStorage; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainFetchErrorStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainStoringService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDRepRegistrationStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainFetchErrorStorage; import org.springframework.stereotype.Component; import lombok.AccessLevel; @@ -31,7 +31,7 @@ public class DRepRegistrationStoringService extends OffChainStoringService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; final OffChainFetchErrorStorage offChainFetchErrorStorage; final OffChainDRepRegistrationStorage offChainDRepRegistrationStorage; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionExtractFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionExtractFetchService.java similarity index 83% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionExtractFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionExtractFetchService.java index 3d621489..03fc7a15 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionExtractFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionExtractFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.govaction; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.govaction; import java.util.concurrent.ExecutorService; @@ -8,11 +8,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainGovActionId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainGovFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainFetchService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainGovFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainFetchService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -26,9 +26,9 @@ public class GovActionExtractFetchService extends OffChainFetchService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; - public GovActionExtractFetchService(SchedulerProperties properties, + public GovActionExtractFetchService(GovOffChainSchedulerProperties properties, @Qualifier("offChainExecutor") ExecutorService executor) { super(executor); this.properties = properties; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionPersistServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionPersistServiceImpl.java index 31628cf4..0b2de71b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.govaction; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.govaction; import java.sql.Timestamp; import java.util.List; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainGovAction; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.governance.GovActionProposalRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance.GovActionProposalRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionRetryServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionRetryServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionRetryServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionRetryServiceImpl.java index 984ad095..cf2c0341 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionRetryServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionRetryServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.govaction; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.govaction; import java.util.List; @@ -6,9 +6,9 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainGovAction; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainGovActionStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainGovActionStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionStoringService.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionStoringService.java index 84f8e4b7..96adab1b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/govaction/GovActionStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/govaction/GovActionStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.govaction; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.govaction; import java.sql.Timestamp; import java.util.Collection; @@ -13,10 +13,10 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainGovAction; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainGovActionId; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainStoringService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainFetchErrorStorage; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainGovActionStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainStoringService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainFetchErrorStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainGovActionStorage; import org.springframework.stereotype.Component; import lombok.AccessLevel; @@ -31,7 +31,7 @@ public class GovActionStoringService extends OffChainStoringService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; final OffChainFetchErrorStorage offChainFetchErrorStorage; final OffChainGovActionStorage offChainGovActionStorage; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataExtractFetchService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataExtractFetchService.java similarity index 81% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataExtractFetchService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataExtractFetchService.java index 18eb5da9..c370c9e3 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataExtractFetchService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataExtractFetchService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.votingdata; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.votingdata; import java.util.concurrent.ExecutorService; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.dto.offchain.OffChainVotingFetchResultDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainFetchService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.offchain.OffChainVotingFetchResultDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainFetchService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @@ -25,9 +25,9 @@ public class VotingDataExtractFetchService extends OffChainFetchService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; - public VotingDataExtractFetchService(SchedulerProperties properties, + public VotingDataExtractFetchService(GovOffChainSchedulerProperties properties, @Qualifier("offChainExecutor") ExecutorService executor) { super(executor); this.properties = properties; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java index 841f92ac..a64493dc 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataPersistServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.votingdata; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.votingdata; import java.sql.Timestamp; import java.util.List; @@ -7,11 +7,11 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainVotingData; import org.cardanofoundation.ledgersync.consumercommon.enumeration.OffChainCheckpointType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessPersistDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.EraRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.governance.VotingProcedureRepo; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainDataCheckpointStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessPersistDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.EraRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance.VotingProcedureRepo; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainDataCheckpointStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java index 7e10fcef..677f1a6f 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataRetryServiceImpl.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.votingdata; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.votingdata; import java.util.List; @@ -6,9 +6,9 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainVotingData; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; import org.cardanofoundation.ledgersync.consumercommon.enumeration.GovOffchainType; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainProcessRetryDataService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainVotingDataStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainProcessRetryDataService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainVotingDataStorage; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataStoringService.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataStoringService.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataStoringService.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataStoringService.java index 5e03774f..6c122eae 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/votingdata/VotingDataStoringService.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/service/offchain/votingdata/VotingDataStoringService.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain.votingdata; +package org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.votingdata; import java.sql.Timestamp; import java.util.Collection; @@ -13,10 +13,10 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainFetchError; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainVotingData; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainFetchErrorId; -import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; -import org.cardanofoundation.ledgersync.scheduler.service.offchain.OffChainStoringService; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainFetchErrorStorage; -import org.cardanofoundation.ledgersync.scheduler.storage.offchain.OffChainVotingDataStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.GovOffChainSchedulerProperties; +import org.cardanofoundation.ledgersync.govoffchainscheduler.service.offchain.OffChainStoringService; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainFetchErrorStorage; +import org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain.OffChainVotingDataStorage; import org.springframework.stereotype.Component; import lombok.AccessLevel; @@ -31,7 +31,7 @@ public class VotingDataStoringService extends OffChainStoringService { - final SchedulerProperties properties; + final GovOffChainSchedulerProperties properties; final OffChainFetchErrorStorage offChainFetchErrorStorage; final OffChainVotingDataStorage offChainVotingDataStorage; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/EraRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/EraRepo.java similarity index 88% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/EraRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/EraRepo.java index 141c4867..125aa1c8 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/EraRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/EraRepo.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage; import com.bloxbean.cardano.yaci.store.core.storage.impl.model.EraEntity; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/CommitteeDeregistrationRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/CommitteeDeregistrationRepo.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/CommitteeDeregistrationRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/CommitteeDeregistrationRepo.java index 481f7ea1..f254787b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/CommitteeDeregistrationRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/CommitteeDeregistrationRepo.java @@ -1,9 +1,9 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.governance; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance; import java.util.List; import java.util.Optional; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -22,7 +22,7 @@ SELECT MAX(cd.slot) as maxSlotNo Optional maxSlotNo(); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO( cd.anchorUrl, cd.anchorHash, cd.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/ConstitutionRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/ConstitutionRepo.java similarity index 75% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/ConstitutionRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/ConstitutionRepo.java index 9e1f2def..f64b01a7 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/ConstitutionRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/ConstitutionRepo.java @@ -1,9 +1,9 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.governance; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance; import java.util.List; import java.util.Optional; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -21,7 +21,7 @@ SELECT MAX(ce.slot) as maxSlotNo Optional maxSlotNo(); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO(ce.anchorUrl, ce.anchorHash, ce.slot, ce.id, 0) + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO(ce.anchorUrl, ce.anchorHash, ce.slot, ce.id, 0) FROM ConstitutionEntity ce WHERE ce.slot >= :fromSlot and ce.slot <= :toSlot AND ce.anchorUrl IS NOT NULL diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/DRepRegistrationRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/DRepRegistrationRepo.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/DRepRegistrationRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/DRepRegistrationRepo.java index 3c33cb26..46539d3b 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/DRepRegistrationRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/DRepRegistrationRepo.java @@ -1,9 +1,9 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.governance; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance; import java.util.List; import java.util.Optional; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -22,7 +22,7 @@ SELECT MAX(dr.slot) as maxSlotNo Optional maxSlotNo(); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO( dr.anchorUrl, dr.anchorHash, dr.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/GovActionProposalRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/GovActionProposalRepo.java similarity index 77% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/GovActionProposalRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/GovActionProposalRepo.java index c10a96aa..048b8146 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/GovActionProposalRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/GovActionProposalRepo.java @@ -1,10 +1,10 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.governance; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance; import com.bloxbean.cardano.yaci.store.governance.storage.impl.model.GovActionProposalEntity; import com.bloxbean.cardano.yaci.store.governance.storage.impl.model.GovActionProposalId; import java.util.List; import java.util.Optional; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -19,7 +19,7 @@ SELECT MAX(gap.slot) as maxSlotNo Optional maxSlotNo(); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO(gap.anchorUrl, gap.anchorHash, gap.slot, gap.txHash, gap.index, 0) + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO(gap.anchorUrl, gap.anchorHash, gap.slot, gap.txHash, gap.index, 0) FROM GovActionProposalEntity gap WHERE gap.slot >= :fromSlot and gap.slot <= :toSlot AND gap.anchorUrl IS NOT NULL diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/VotingProcedureRepo.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/VotingProcedureRepo.java similarity index 77% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/VotingProcedureRepo.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/VotingProcedureRepo.java index dbe788f1..2847f7f0 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/governance/VotingProcedureRepo.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/governance/VotingProcedureRepo.java @@ -1,9 +1,9 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.governance; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.governance; import java.util.List; import java.util.Optional; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; @@ -22,7 +22,7 @@ SELECT MAX(vp.slot) as maxSlotNo Optional maxSlotNo(); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO(vp.anchorUrl, vp.anchorHash, vp.slot, vp.id, 0) + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO(vp.anchorUrl, vp.anchorHash, vp.slot, vp.id, 0) FROM VotingProcedureEntity vp WHERE vp.slot >= :fromSlot and vp.slot <= :toSlot AND vp.anchorUrl IS NOT NULL diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainCommitteeDeregStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainCommitteeDeregStorage.java similarity index 83% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainCommitteeDeregStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainCommitteeDeregStorage.java index fea8cfad..81b8d655 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainCommitteeDeregStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainCommitteeDeregStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; @@ -6,7 +6,7 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainCommitteeDeregistration; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainCommitteeDeregistrationId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @@ -18,7 +18,7 @@ List findByCommitteeDeregistrationIdIn( Set committeeDeregistrationIds); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.CommitteeDeregistrationDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.CommitteeDeregistrationDTO( cd.anchorUrl, cd.anchorHash, cd.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainConstitutionStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainConstitutionStorage.java similarity index 80% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainConstitutionStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainConstitutionStorage.java index 2eb79bb5..b5c83917 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainConstitutionStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainConstitutionStorage.java @@ -1,11 +1,11 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainConstitution; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @@ -16,7 +16,7 @@ public interface OffChainConstitutionStorage extends JpaRepository findByConstitutionActiveEpochIn(Set constitutionActiveEpochs); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.ConstitutionAnchorDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.ConstitutionAnchorDTO( ce.anchorUrl, ce.anchorHash, ce.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDRepRegistrationStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDRepRegistrationStorage.java similarity index 83% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDRepRegistrationStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDRepRegistrationStorage.java index 82b9a4a7..8e15b7a0 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDRepRegistrationStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDRepRegistrationStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; @@ -6,7 +6,7 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDrepRegistration; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainDRepRegistrationId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @@ -18,7 +18,7 @@ List findByDrepRegistrationIdIn( Set dRepRegistrationIds); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.DRepRegistrationDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.DRepRegistrationDTO( cd.anchorUrl, cd.anchorHash, cd.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDataCheckpointStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDataCheckpointStorage.java similarity index 90% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDataCheckpointStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDataCheckpointStorage.java index 37cd7d06..1f8d0ca2 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainDataCheckpointStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainDataCheckpointStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.Optional; import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainDataCheckpoint; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainFetchErrorStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainFetchErrorStorage.java similarity index 87% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainFetchErrorStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainFetchErrorStorage.java index 252b7047..927f2c0a 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainFetchErrorStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainFetchErrorStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainGovActionStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainGovActionStorage.java similarity index 82% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainGovActionStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainGovActionStorage.java index 2ba6f671..c6fe7142 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainGovActionStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainGovActionStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; @@ -6,7 +6,7 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainGovAction; import org.cardanofoundation.ledgersync.consumercommon.entity.compositekey.OffChainGovActionId; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @@ -17,7 +17,7 @@ public interface OffChainGovActionStorage extends JpaRepository findByGovActionIdIn(Set govActionIds); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.GovAnchorDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.GovAnchorDTO( gap.anchorUrl, gap.anchorHash, gap.slot, diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainVotingDataStorage.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainVotingDataStorage.java similarity index 80% rename from components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainVotingDataStorage.java rename to components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainVotingDataStorage.java index 33459b23..335c778a 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/storage/offchain/OffChainVotingDataStorage.java +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/storage/offchain/OffChainVotingDataStorage.java @@ -1,4 +1,4 @@ -package org.cardanofoundation.ledgersync.scheduler.storage.offchain; +package org.cardanofoundation.ledgersync.govoffchainscheduler.storage.offchain; import java.util.List; import java.util.Set; @@ -6,7 +6,7 @@ import org.cardanofoundation.ledgersync.consumercommon.entity.OffChainVotingData; import org.cardanofoundation.ledgersync.consumercommon.enumeration.CheckValid; -import org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO; +import org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @@ -17,7 +17,7 @@ public interface OffChainVotingDataStorage extends JpaRepository findByVotingProcedureIdIn(Set votingProcedureId); @Query(""" - SELECT new org.cardanofoundation.ledgersync.scheduler.dto.anchor.VotingDataAnchorDTO( + SELECT new org.cardanofoundation.ledgersync.govoffchainscheduler.dto.anchor.VotingDataAnchorDTO( vp.anchorUrl, vp.anchorHash, vp.slot, diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java new file mode 100644 index 00000000..f87fe2e7 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/DataUtil.java @@ -0,0 +1,100 @@ +// package org.cardanofoundation.ledgersync.scheduler.util; + +// import java.text.DecimalFormat; +// import java.text.SimpleDateFormat; +// import java.time.Duration; +// import java.time.Instant; +// import java.time.LocalDateTime; +// import java.time.format.DateTimeFormatter; +// import java.util.Collection; +// import java.util.Date; +// import java.util.Map; + +// public class DataUtil { + +// public static boolean isNullOrEmpty(CharSequence cs) { +// int strLen; +// if (cs == null || (strLen = cs.length()) == 0) { +// return true; +// } +// for (int i = 0; i < strLen; i++) { +// if (!Character.isWhitespace(cs.charAt(i))) { +// return false; +// } +// } +// return true; +// } + +// public static boolean isNullOrEmpty(final Collection collection) { +// return collection == null || collection.isEmpty(); +// } + +// public static boolean isNullOrEmpty(final Object obj) { +// return obj == null || obj.toString().isEmpty(); +// } + +// public static boolean isNullOrEmpty(final Object[] collection) { +// return collection == null || collection.length == 0; +// } + +// public static boolean isNullOrEmpty(final Map map) { +// return map == null || map.isEmpty(); +// } + +// public static String instantToString(Instant value, String pattern) { +// if (pattern != null) { +// DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); +// return dtf.format(value.plus(Duration.ofHours(7))); +// } +// return ""; +// } + +// public static String localDateTimeToString(LocalDateTime value, String pattern) { +// if (pattern != null) { +// DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern); +// return dtf.format(value.plus(Duration.ofHours(7))); +// } +// return ""; +// } + +// public static String dateToString(Date value, String pattern) { +// if (pattern != null) { +// SimpleDateFormat dtf = new SimpleDateFormat(pattern); +// return dtf.format(Date.from(value.toInstant().plus(Duration.ofHours(7)))); +// } +// return ""; +// } + +// public static String enumToString(Enum value) { +// if (value == null) { +// return ""; +// } +// String text = value.name(); +// text = text.replaceAll("_", " "); +// text = text.toLowerCase(); +// return text.substring(0, 1).toUpperCase() + text.substring(1); +// } + +// public static String objectToString(Object value) { +// return (value == null) ? "" : value.toString(); +// } + +// public static String doubleToString(Double value) { +// if (value == null) { +// return ""; +// } +// DecimalFormat doubleFormat = new DecimalFormat("#.######"); +// String result = doubleFormat.format(value); +// if (result.endsWith(".0")) { +// result = result.split("\\.")[0]; +// } +// return result; +// } + +// public static String makeLikeQuery(String s) { +// if (DataUtil.isNullOrEmpty(s)) { +// return null; +// } +// return "%" + s + "%"; +// } +// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java new file mode 100644 index 00000000..3c7964a4 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/HexUtils.java @@ -0,0 +1,27 @@ +// package org.cardanofoundation.ledgersync.scheduler.util; + + +// public class HexUtils { + +// private HexUtils() { +// throw new IllegalStateException("Utility class"); +// } + +// /** +// * Convert from hex to UTF-8 +// * +// * @param hexString string hex +// * @return string UTF-8 +// */ +// // public static String fromHex(String hexString, String fingerprint) { +// // try { +// // byte[] bytes = Hex.decodeHex(hexString.toCharArray()); +// // if (StringUtil.isUtf8(bytes)) { +// // return new String(bytes, StandardCharsets.UTF_8); +// // } +// // return fingerprint; +// // } catch (Exception ex) { +// // return fingerprint; +// // } +// // } +// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java new file mode 100644 index 00000000..374d1731 --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/ReflectorUtil.java @@ -0,0 +1,46 @@ +// package org.cardanofoundation.ledgersync.scheduler.util; + +// import java.lang.reflect.Field; +// import java.util.*; + +// public class ReflectorUtil { +// public static List getAllFields(Class clazz) { +// List> classes = getAllSuperclasses(clazz); +// classes.add(clazz); +// return getAllFields(classes); +// } + +// /** +// * As {@link #getAllFields(Class)} but acts on a list of {@link Class}s and uses only {@link +// * Class#getDeclaredFields()}. +// * +// * @param classes The list of classes to reflect on +// * @return The complete list of fields +// */ +// private static List getAllFields(List> classes) { +// Set fields = new HashSet<>(); +// for (Class clazz : classes) { +// fields.addAll(Arrays.asList(clazz.getDeclaredFields())); +// } + +// return new ArrayList<>(fields); +// } + +// /** +// * Return a List of super-classes for the given class. +// * +// * @param clazz the class to look up +// * @return the List of super-classes in order going up from this one +// */ +// public static List> getAllSuperclasses(Class clazz) { +// List> classes = new ArrayList<>(); + +// Class superclass = clazz.getSuperclass(); +// while (superclass != null) { +// classes.add(superclass); +// superclass = superclass.getSuperclass(); +// } + +// return classes; +// } +// } diff --git a/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java new file mode 100644 index 00000000..187076ce --- /dev/null +++ b/components/govoffchain-scheduler/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/util/StreamUtil.java @@ -0,0 +1,86 @@ +// package org.cardanofoundation.ledgersync.scheduler.util; + +// import lombok.experimental.UtilityClass; + +// import java.util.Collection; +// import java.util.List; +// import java.util.Map; +// import java.util.Set; +// import java.util.function.Consumer; +// import java.util.function.Function; +// import java.util.function.Predicate; +// import java.util.stream.Collectors; + +// @UtilityClass +// public class StreamUtil { + +// public static List mapApply(Collection collection, Function function) { +// return collection.stream().map(function).collect(Collectors.toList()); +// } + +// public static Set mapApplySet(Collection collection, Function function) { +// return collection.stream().map(function).collect(Collectors.toSet()); +// } + +// public static List filterApply(Collection collection, Predicate filter) { +// return collection.stream().filter(filter).collect(Collectors.toList()); +// } + +// public static List mapThenFilterApply( +// Collection collection, Function function, Predicate predicate) { +// return collection.stream().map(function).filter(predicate).collect(Collectors.toList()); +// } + +// public static List filterThenMapApply( +// Collection collection, Predicate predicate, Function function) { +// return collection.stream().filter(predicate).map(function).collect(Collectors.toList()); +// } + +// public static Set mapThenFilterApplyToSet( +// Collection collection, Function function, Predicate predicate) { +// return collection.stream().map(function).filter(predicate).collect(Collectors.toSet()); +// } + +// public static Map toMap(Collection collection, Function function) { +// return collection.stream().collect(Collectors.toMap(function, Function.identity())); +// } + +// public static Map toMap( +// Collection collection, Function functionKey, Function functionVal) { +// return collection.stream().collect(Collectors.toMap(functionKey, functionVal)); +// } + +// public static Map filterApplyThenToMap( +// Collection collection, +// Predicate predicate, +// Function functionKey, +// Function functionVal) { +// return collection.stream() +// .filter(predicate) +// .collect(Collectors.toMap(functionKey, functionVal)); +// } + +// public static Map> groupingApply( +// Collection collection, Function function) { +// return collection.stream().collect(Collectors.groupingBy(function)); +// } + +// public static Map> groupingApply( +// Collection collection, Function functionKey, Function functionValue) { +// return collection.stream() +// .collect( +// Collectors.groupingBy( +// functionKey, Collectors.mapping(functionValue, Collectors.toList()))); +// } + +// public static Function of(Function function) { +// return function; +// } + +// public static Function peek(Consumer consumer) { +// return t -> { +// consumer.accept(t); +// return t; +// }; +// } +// } diff --git a/components/govoffchain-scheduler/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/SchedulerApplicationTests.java b/components/govoffchain-scheduler/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/SchedulerApplicationTests.java new file mode 100644 index 00000000..71958ea4 --- /dev/null +++ b/components/govoffchain-scheduler/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/SchedulerApplicationTests.java @@ -0,0 +1,165 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler; + +import io.netty.handler.logging.LogLevel; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.SslProvider; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.WriteTimeoutHandler; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatusCode; +import org.springframework.http.MediaType; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.netty.http.HttpProtocol; +import reactor.netty.http.client.HttpClient; +import reactor.netty.transport.logging.AdvancedByteBufFormat; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +import static org.springframework.http.HttpStatus.*; + +@SpringBootTest(classes = WebClientAutoConfiguration.class) +class SchedulerApplicationTests { + + @Autowired + WebClient.Builder webClientBuilder; + + @Test + void contextLoads() throws SSLException { + System.setProperty("https.protocols", "TLSv1.2,TLSv1.1,TLSv1"); + var sslContext = + SslContextBuilder.forClient() + .sslProvider(SslProvider.JDK) + .startTls(true) + .trustManager(InsecureTrustManagerFactory.INSTANCE) + .build(); + + var httpClient = + HttpClient.create() + .wiretap( + "reactor.netty.http.client.HttpClient", + LogLevel.DEBUG, + AdvancedByteBufFormat.TEXTUAL, + StandardCharsets.UTF_8) + // .wiretap(Boolean.FALSE) + // .secure(t -> t.sslContext(sslContext)) + .followRedirect(Boolean.TRUE) + .responseTimeout(Duration.ofSeconds(30000)) + .protocol(HttpProtocol.HTTP11) + .doOnConnected( + connection -> { + connection.addHandlerFirst(new ReadTimeoutHandler(19000, TimeUnit.SECONDS)); + connection.addHandlerFirst(new WriteTimeoutHandler(10000, TimeUnit.SECONDS)); + }); + + webClientBuilder + .clientConnector(new ReactorClientHttpConnector(httpClient)) + .build() + .get() + .uri("gist.github.com/pavanvora/42f63b97e3311fb344f8d0a1595fd4d4") + .retrieve() + .toEntity(String.class) + .map( + response -> { + HttpStatusCode statusCode = response.getStatusCode(); + if (statusCode.equals(NOT_FOUND)) { + return Optional.empty(); + } else if (statusCode.equals( + FORBIDDEN)) { // log.error("FORBIDDEN for url: {}", poolHash.getUrl()); + return Optional.empty(); + } else if (statusCode.equals( + REQUEST_TIMEOUT)) { // log.error("REQUEST_TIMEOUT for url: {}", + // poolHash.getUrl()); + return Optional.empty(); + } else if (statusCode.equals( + MOVED_PERMANENTLY)) { // log.error("MOVED PERMANENTLY for url: {}", + // poolHash.getUrl()); + return Optional.empty(); + } else if (statusCode.equals(OK)) { + if (response.getHeaders().get(HttpHeaders.CONTENT_TYPE).stream() + .noneMatch( + contentType -> + contentType.contains(MediaType.APPLICATION_JSON_VALUE) + || contentType.contains(MediaType.TEXT_PLAIN_VALUE) + || contentType.contains( + MediaType.APPLICATION_OCTET_STREAM_VALUE))) { + return Optional.empty(); + } + + if (response.getBody().getBytes().length > 512) { + return Optional.empty(); + } + return Optional.of(response); + } + return Optional.of(response); + }) + .block() + .ifPresent(System.out::println); + } + + @Test + void httpUrlClient() throws IOException { + URL url = new URL(("https://cardanostakehouse.com/1404d233-c0f4-47fb-bdcb-321.json")); + HttpURLConnection con = (HttpsURLConnection) url.openConnection(); + con.setRequestMethod(RequestMethod.GET.name()); + con.setRequestProperty("Content-Type", "application/json"); + con.setConnectTimeout(10000); + con.setReadTimeout(10000); + + StringBuilder builder = new StringBuilder(); + InputStreamReader streamReader = + new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8); + + int output; + while ((output = streamReader.read()) != -1) { + builder.append((char) output); + } + + streamReader.close(); + + System.out.println(builder.toString()); + } + + @Test + void httpClient() throws URISyntaxException { + java.net.http.HttpClient client = + java.net.http.HttpClient.newBuilder() + .version(java.net.http.HttpClient.Version.HTTP_1_1) + .followRedirects(java.net.http.HttpClient.Redirect.NORMAL) + .build(); + + HttpRequest request = + HttpRequest.newBuilder() + .uri(new URI("https://cardanostakehouse.com/1404d233-c0f4-47fb-bdcb-321.json")) + .GET() + .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .timeout(Duration.ofSeconds(10)) + .build(); + + client + .sendAsync(request, HttpResponse.BodyHandlers.ofString()) + .thenApply(HttpResponse::body) + .thenAccept(System.out::println) + .join(); + } + +} diff --git a/components/scheduler/build.gradle b/components/scheduler/build.gradle index 4d3c9786..55d2a187 100644 --- a/components/scheduler/build.gradle +++ b/components/scheduler/build.gradle @@ -4,8 +4,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation(libs.cardano.client.lib) - implementation(libs.yaci.store.governance) - implementation(libs.jsonld.java) compileOnly(libs.lombok) annotationProcessor(libs.lombok) diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java index 7b8c52ae..349195e3 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerConfiguration.java @@ -1,10 +1,7 @@ package org.cardanofoundation.ledgersync.scheduler; import lombok.extern.slf4j.Slf4j; -import org.cardanofoundation.ledgersync.scheduler.jobs.OffChainDataScheduler; import org.cardanofoundation.ledgersync.scheduler.jobs.PoolOfflineDataScheduler; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainPersistService; -import org.cardanofoundation.ledgersync.scheduler.service.OffChainRetryDataErrorService; import org.cardanofoundation.ledgersync.scheduler.service.PoolOfflineDataFetchingService; import org.cardanofoundation.ledgersync.scheduler.service.PoolOfflineDataStoringService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,18 +17,16 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @ConditionalOnProperty( - prefix = "ledger-sync.scheduler", - name = "enabled", - havingValue = "true", - matchIfMissing = true + prefix = "ledger-sync.scheduler", + name = "enabled", + havingValue = "true", + matchIfMissing = true ) @Configuration @EnableConfigurationProperties(SchedulerProperties.class) @ComponentScan(basePackages = {"org.cardanofoundation.ledgersync.scheduler"}) @EnableJpaRepositories(basePackages = {"org.cardanofoundation.ledgersync.scheduler"}) -@EntityScan(basePackages = {"org.cardanofoundation.ledgersync.scheduler", - "com.bloxbean.cardano.yaci.store.core", - "com.bloxbean.cardano.yaci.store.governance"}) +@EntityScan(basePackages = {"org.cardanofoundation.ledgersync.scheduler"}) @EnableTransactionManagement @EnableScheduling @EnableAsync @@ -43,23 +38,13 @@ public class SchedulerConfiguration { @Bean public PoolOfflineDataScheduler poolOfflineDataScheduler(PoolOfflineDataStoringService poolOfflineDataStoringService, - PoolOfflineDataFetchingService poolOfflineDataFetchingService, - PoolOfflineDataProperties poolOfflineDataProperties) { + PoolOfflineDataFetchingService poolOfflineDataFetchingService, + PoolOfflineDataProperties poolOfflineDataProperties) { log.info("<<< Enable PoolOfflineDataScheduler >>>"); log.info("PoolOfflineDataScheduler: fixed delay time {} sec", poolOfflineDataProperties.getFixedDelay()); return new PoolOfflineDataScheduler(poolOfflineDataStoringService, poolOfflineDataFetchingService, poolOfflineDataProperties); } - @Bean - public OffChainDataScheduler offChainVotingDataScheduler( - OffChainPersistService offChainPersistService, - OffChainRetryDataErrorService offChainDataFetchingErrorService, - OffChainDataProperties offChainDataProperties) { - log.info("<<< Enable OffChainDataScheduler >>>"); - log.info("OffChainDataScheduler: fixed delay time {} sec", offChainDataProperties.getFixedDelay()); - return new OffChainDataScheduler(offChainPersistService, offChainDataFetchingErrorService, offChainDataProperties); - } - @Bean PoolOfflineDataProperties poolOfflineDataProperties() { PoolOfflineDataProperties poolOfflineDataProperties = new PoolOfflineDataProperties(); @@ -68,15 +53,4 @@ PoolOfflineDataProperties poolOfflineDataProperties() { return poolOfflineDataProperties; } - @Bean - OffChainDataProperties offChainDataProperties() { - OffChainDataProperties offChainDataProperties = new OffChainDataProperties(); - offChainDataProperties.setFixedDelay(properties.getOffChainData().getFixedDelay()); - offChainDataProperties.setInitialDelay(properties.getOffChainData().getInitialDelay()); - offChainDataProperties.setFixedDelayFetchError(properties.getOffChainData().getFixedDelayFetchError()); - offChainDataProperties.setInitialDelayFetchError(properties.getOffChainData().getInitialDelayFetchError()); - offChainDataProperties.setRetryCount(properties.getOffChainData().getRetryCount()); - return offChainDataProperties; - } - -} +} \ No newline at end of file diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java index b1da7818..8795acfe 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/SchedulerProperties.java @@ -10,7 +10,6 @@ public class SchedulerProperties { private boolean enabled = true; private PoolOfflineData poolOfflineData = new PoolOfflineData(); - private OffChainData offChainData = new OffChainData(); private AsyncConfig asyncConfig = new AsyncConfig(); @Getter @@ -20,16 +19,6 @@ public static final class PoolOfflineData { private long initialDelay = 20000L; } - @Getter - @Setter - public static final class OffChainData { - private long fixedDelay = 300000L; - private long initialDelay = 20000L; - private long fixedDelayFetchError = 2000000L; - private long initialDelayFetchError = 2000000L; - private int retryCount = 10; - } - @Getter @Setter public static final class AsyncConfig { @@ -38,4 +27,4 @@ public static final class AsyncConfig { private String name = "Scheduler-Executorxx-"; } -} +} \ No newline at end of file diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/AsyncConfiguration.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/AsyncConfiguration.java index ae2793cb..51b12414 100644 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/AsyncConfiguration.java +++ b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/config/AsyncConfiguration.java @@ -1,5 +1,7 @@ package org.cardanofoundation.ledgersync.scheduler.config; +import java.util.concurrent.Executor; + import org.cardanofoundation.ledgersync.scheduler.SchedulerProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -10,8 +12,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.scheduling.config.ScheduledTaskRegistrar; -import java.util.concurrent.Executor; - @ConditionalOnProperty( prefix = "ledger-sync.scheduler", name = "enabled", diff --git a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessRetryDataService.java b/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessRetryDataService.java deleted file mode 100644 index 6e299646..00000000 --- a/components/scheduler/src/main/java/org/cardanofoundation/ledgersync/scheduler/service/offchain/OffChainProcessRetryDataService.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.cardanofoundation.ledgersync.scheduler.service.offchain; - - -public interface OffChainProcessRetryDataService { - void process(); - -} diff --git a/govoffchain-scheduler-app/build.gradle b/govoffchain-scheduler-app/build.gradle new file mode 100644 index 00000000..774a8b6e --- /dev/null +++ b/govoffchain-scheduler-app/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'org.springframework.boot' version '3.2.2' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter' + implementation 'org.springframework.boot:spring-boot-configuration-processor' + implementation project(':components:govoffchain-scheduler') + runtimeOnly 'org.postgresql:postgresql' + + compileOnly(libs.lombok) + annotationProcessor(libs.lombok) +} + +compileJava { + options.compilerArgs += ['-Amapstruct.defaultComponentModel=spring'] +} + +jar { + enabled = false +} diff --git a/govoffchain-scheduler-app/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplication.java b/govoffchain-scheduler-app/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplication.java new file mode 100644 index 00000000..37677921 --- /dev/null +++ b/govoffchain-scheduler-app/src/main/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplication.java @@ -0,0 +1,17 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler.app; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan(basePackages = "org.cardanofoundation.*") +@EntityScan("org.cardanofoundation.*") +public class GovOffChainSchedulerAppApplication { + + public static void main(String[] args) { + SpringApplication.run(GovOffChainSchedulerAppApplication.class, args); + } + +} diff --git a/govoffchain-scheduler-app/src/main/resources/application.properties b/govoffchain-scheduler-app/src/main/resources/application.properties new file mode 100644 index 00000000..102268b7 --- /dev/null +++ b/govoffchain-scheduler-app/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.banner.location=classpath:/banner.txt \ No newline at end of file diff --git a/govoffchain-scheduler-app/src/main/resources/banner.txt b/govoffchain-scheduler-app/src/main/resources/banner.txt new file mode 100644 index 00000000..94b54e34 --- /dev/null +++ b/govoffchain-scheduler-app/src/main/resources/banner.txt @@ -0,0 +1,5 @@ + ,----. ,-----. ,---. ,---. ,-----.,--. ,--. ,---. ,--. ,--. ,--. +' .-./ ,---.,--. ,--. ' .-. '/ .-'/ .-'' .--./| ,---. ,--,--.`--',--,--, ' .-' ,---.| ,---. ,---. ,-| |,--.,--.| |,---. ,--.--. +| | .---.| .-. |\ `' / | | | || `-,| `-,| | | .-. |' ,-. |,--.| \ `. `-.| .--'| .-. | .-. :' .-. || || || | .-. :| .--' +' '--' |' '-' ' \ / ' '-' '| .-'| .-'' '--'\| | | |\ '-' || || || | .-' \ `--.| | | \ --.\ `-' |' '' '| \ --.| | + `------' `---' `--' `-----' `--' `--' `-----'`--' `--' `--`--'`--'`--''--' `-----' `---'`--' `--'`----' `---' `----' `--'`----'`--' \ No newline at end of file diff --git a/govoffchain-scheduler-app/src/main/resources/config/application.yml b/govoffchain-scheduler-app/src/main/resources/config/application.yml new file mode 100644 index 00000000..e358619c --- /dev/null +++ b/govoffchain-scheduler-app/src/main/resources/config/application.yml @@ -0,0 +1,62 @@ +spring: + # Datasource specific configs + datasource: + # Hikari specific configs + hikari: + pool-name: explorer-consumer-pool + minimum-idle: 10 #minimum number of idle connections maintained by HikariCP in a connection pool + maximum-pool-size: ${MAXIMUM_POOL_SIZE:48} #maximum pool size + idle-timeout: 300000 #maximum idle time for connection + max-lifetime: 900000 #maximum lifetime in milliseconds of a connection in the pool after it is closed. + connection-timeout: 50000 #maximum number of milliseconds that a client will wait for a connection + auto-commit: true #default auto-commit behavior. + connection-init-sql: SELECT 1 + data-source-properties: + cachePrepStmts: true + prepStmtCacheSize: 250 + prepStmtCacheSqlLimit: 2048 + useServerPrepStmts: true + useLocalSessionState: true + rewriteBatchedStatements: true + cacheResultSetMetadata: true + cacheServerConfiguration: true + elideSetAutoCommits: true + maintainTimeStats: false + # JPA specific configs + jpa: + open-in-view: false + database-platform: org.hibernate.dialect.PostgreSQLDialect + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + jdbc.batch_size: 1000 + show_sql: false + format_sql: true + order_inserts: true + order_updates: true + hbm2ddl: + auto: none + codec: + max-in-memory-size: 10MB +# props: | +# max.poll.records: 10 +# fetch.min.bytes: 123456 +# prefix: "explorer-consumer-local" +logging: + level: + org.cardanofoundation: ${LOG:TRACE} +server: + port: 8081 + +ledger-sync: + scheduler: + off-chain-data: + retry-count: ${OFF_CHAIN_RETRY_COUNT:10} + fixed-delay: ${OFF_CHAIN_DATA_FIXED_DELAY:60} + initial-delay: ${OFF_CHAIN_DATA_INIT_DELAY:20} + fixed-delay-fetch-error: ${OFF_CHAIN_DATA_FIXED_DELAY_FETCH_ERROR:86400} + initial-delay-fetch-error: ${OFF_CHAIN_DATA_INIT_DELAY__FETCH_ERROR:20} + enabled: true + pool-offline-data: + fixed-delay: ${POOL_OFFLINE_DATA_FIXED_DELAY:172800} + initial-delay: ${POOL_OFFLINE_DATA_INIT_DELAY:20000} \ No newline at end of file diff --git a/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java b/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java new file mode 100644 index 00000000..c0203a79 --- /dev/null +++ b/govoffchain-scheduler-app/src/test/java/org/cardanofoundation/ledgersync/govoffchainscheduler/app/GovOffChainSchedulerAppApplicationTests.java @@ -0,0 +1,13 @@ +package org.cardanofoundation.ledgersync.govoffchainscheduler.app; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class GovOffChainSchedulerAppApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/settings.gradle b/settings.gradle index c368393e..be74a366 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,10 +10,12 @@ rootProject.name = 'ledger-sync' include 'components:common' include 'components:consumer-common' include 'components:scheduler' +include 'components:govoffchain-scheduler' include 'components:healthcheck' include 'aggregates:account' include 'application' include 'scheduler-app' +include 'govoffchain-scheduler-app' include 'streamer-app' include 'aggregation-app'