diff --git a/.gitignore b/.gitignore index ca9c30474c250595093c18d7299b76d662d3d747..76d963dc1f92dc0530510eda3fe43c305bf0d39c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,36 @@ +HELP.md target/ -.mvn/wrapper/maven-wrapper.jar +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache ### IntelliJ IDEA ### .idea *.iws *.iml *.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ + +### Other ### +.mvn +target/* +*/target \ No newline at end of file diff --git a/indexer-service-azure/pom.xml b/indexer-service-azure/pom.xml index 8ce9dc791d6af2cff89e0576f2824f05ea336d0f..fc0000488bcb30d08c11c159556101385dd23153 100644 --- a/indexer-service-azure/pom.xml +++ b/indexer-service-azure/pom.xml @@ -2,31 +2,55 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> - <artifactId>os-indexer-boot-mvn</artifactId> - <groupId>com.slb</groupId> + <groupId>org.opendes.indexer</groupId> + <artifactId>indexer-service</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <modelVersion>4.0.0</modelVersion> <artifactId>indexer-service-azure</artifactId> + <version>1.0-SNAPSHOT</version> + <name>indexer-service-azure</name> + <description>Indexer Service Azure</description> + <packaging>jar</packaging> <dependencies> - <dependency> - <groupId>com.slb</groupId> - <artifactId>indexer-service-root</artifactId> + <groupId>org.opendes.core</groupId> + <artifactId>indexer-search-core-azure</artifactId> <version>0.0.1-SNAPSHOT</version> - <scope>compile</scope> </dependency> <dependency> - <groupId>com.slb.core</groupId> - <artifactId>indexer-search-core-azure</artifactId> - <version>0.0.1-SNAPSHOT</version> + <groupId>org.opendes.indexer</groupId> + <artifactId>indexer-service-root</artifactId> + <version>1.0-SNAPSHOT</version> </dependency> - </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + <configuration> + <classifier>spring-boot</classifier> + <mainClass> + org.opendes.indexer.IndexerAzureApplication + </mainClass> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </project> \ No newline at end of file diff --git a/indexer-service-azure/src/main/java/IndexerAzureApplication.java b/indexer-service-azure/src/main/java/IndexerAzureApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..4e2e80363e9327d204373e6a6d5177a924f04734 --- /dev/null +++ b/indexer-service-azure/src/main/java/IndexerAzureApplication.java @@ -0,0 +1,9 @@ +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class IndexerAzureApplication { + public static void main(String[] args) { + SpringApplication.run(IndexerAzureApplication.class, args); + } +} diff --git a/indexer-service-azure/src/main/java/org/opendes/util/indexer/RequestInfoImpl.java b/indexer-service-azure/src/main/java/org/opendes/indexer/azure/util/RequestInfoImpl.java similarity index 98% rename from indexer-service-azure/src/main/java/org/opendes/util/indexer/RequestInfoImpl.java rename to indexer-service-azure/src/main/java/org/opendes/indexer/azure/util/RequestInfoImpl.java index 014db97d4f635e0c3435a50ca0e62aacb1138921..eccd28d599acbcf4d2b697a25d290a5e36d1532b 100644 --- a/indexer-service-azure/src/main/java/org/opendes/util/indexer/RequestInfoImpl.java +++ b/indexer-service-azure/src/main/java/org/opendes/indexer/azure/util/RequestInfoImpl.java @@ -1,4 +1,4 @@ -package org.opendes.util.indexer; +package org.opendes.indexer.azure.util; import com.google.common.base.Strings; import com.slb.core.model.AppEngineHeaders; diff --git a/indexer-service-gcp/pom.xml b/indexer-service-gcp/pom.xml index 33929686a30a25245e8fed0c42de721b5a11f686..c469d2121518beae43ed39b4805a20b85f8753d3 100644 --- a/indexer-service-gcp/pom.xml +++ b/indexer-service-gcp/pom.xml @@ -2,32 +2,31 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> - <artifactId>os-indexer-boot-mvn</artifactId> - <groupId>com.slb</groupId> + <groupId>org.opendes.indexer</groupId> + <artifactId>indexer-service</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <modelVersion>4.0.0</modelVersion> - - <groupId>com.slb</groupId> <artifactId>indexer-service-gcp</artifactId> - <version>1.1-SNAPSHOT</version> + <version>1.0-SNAPSHOT</version> <name>indexer-service-gcp</name> + <description>Indexer Service GCP</description> + <packaging>jar</packaging> <dependencies> - <dependency> - <groupId>com.slb.core</groupId> - <artifactId>indexer-search-core-service-gcp</artifactId> - <version>1.0-SNAPSHOT</version> + <groupId>org.opendes.core</groupId> + <artifactId>indexer-search-core-gcp</artifactId> + <version>1.1-SNAPSHOT</version> </dependency> <dependency> - <groupId>com.slb</groupId> + <groupId>org.opendes.indexer</groupId> <artifactId>indexer-service-root</artifactId> - <version>0.0.1-SNAPSHOT</version> - <scope>compile</scope> + <version>1.0-SNAPSHOT</version> </dependency> <!-- <dependency>--> @@ -59,5 +58,27 @@ <!-- </dependency>--> </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + <configuration> + <classifier>spring-boot</classifier> + <mainClass> + org.opendes.indexer.IndexerGcpApplication + </mainClass> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </project> \ No newline at end of file diff --git a/indexer-service-gcp/src/main/java/IndexerGcpApplication.java b/indexer-service-gcp/src/main/java/IndexerGcpApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..5ad552ea7c7a5267a6f8612604a8badad0ff1d91 --- /dev/null +++ b/indexer-service-gcp/src/main/java/IndexerGcpApplication.java @@ -0,0 +1,11 @@ +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class IndexerGcpApplication { + + public static void main(String[] args) { + SpringApplication.run(IndexerGcpApplication.class, args); + } + +} \ No newline at end of file diff --git a/indexer-service-gcp/src/main/java/org/opendes/indexer/publish/PublisherImpl.java b/indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/publish/PublisherImpl.java similarity index 98% rename from indexer-service-gcp/src/main/java/org/opendes/indexer/publish/PublisherImpl.java rename to indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/publish/PublisherImpl.java index bd0084ed6d3da554e361937c0af258c2c74a3857..c40adc97f93ec4dee716febc343f659cd72efa7c 100644 --- a/indexer-service-gcp/src/main/java/org/opendes/indexer/publish/PublisherImpl.java +++ b/indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/publish/PublisherImpl.java @@ -12,18 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -package org.opendes.indexer.publish; +package org.opendes.indexer.gcp.publish; import com.google.api.gax.retrying.RetrySettings; import com.google.cloud.pubsub.v1.Publisher; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; +import com.google.gson.reflect.TypeToken; import com.google.protobuf.ByteString; import com.google.pubsub.v1.ProjectTopicName; import com.google.pubsub.v1.PubsubMessage; -import com.google.gson.reflect.TypeToken; - import com.slb.core.model.AppEngineHeaders; import com.slb.core.model.DeploymentEnvironment; import com.slb.core.util.AppException; @@ -35,6 +34,7 @@ import org.opendes.client.gcp.PubSub.PubSubExtensions; import org.opendes.client.multitenancy.ITenantFactory; import org.opendes.client.multitenancy.TenantInfo; import org.opendes.indexer.model.RecordStatus; +import org.opendes.indexer.publish.IPublisher; import org.opendes.indexer.util.JobStatus; import org.springframework.beans.factory.annotation.Autowired; import org.threeten.bp.Duration; diff --git a/indexer-service-gcp/src/main/java/org/opendes/indexer/util/RequestInfoImpl.java b/indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/util/RequestInfoImpl.java similarity index 94% rename from indexer-service-gcp/src/main/java/org/opendes/indexer/util/RequestInfoImpl.java rename to indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/util/RequestInfoImpl.java index 8d3139ed6cb27fcc56c8d0116852659b1cda2beb..0a645c8f26b0c332db80d14caa21d29a55498c12 100644 --- a/indexer-service-gcp/src/main/java/org/opendes/indexer/util/RequestInfoImpl.java +++ b/indexer-service-gcp/src/main/java/org/opendes/indexer/gcp/util/RequestInfoImpl.java @@ -1,4 +1,4 @@ -package org.opendes.indexer.util; +package org.opendes.indexer.gcp.util; import com.google.common.base.Strings; import com.slb.core.model.AppEngineHeaders; @@ -6,11 +6,12 @@ import com.slb.core.model.DeploymentEnvironment; import com.slb.core.util.*; import org.apache.http.HttpStatus; import org.opendes.client.api.DpsHeaders; +import org.opendes.indexer.util.IRequestInfo; import org.springframework.beans.factory.annotation.Autowired; import java.util.Map; -import static org.opendes.client.api.DpsHeaders.*; +import static org.opendes.client.api.DpsHeaders.AUTHORIZATION; public class RequestInfoImpl implements IRequestInfo { diff --git a/indexer-service-root/pom.xml b/indexer-service-root/pom.xml index 6bbc88c52fd3c045d1ca0408efe08da14b4f8a25..c20d3e2624ac4d4e69302b4e409d5fb19bf9e759 100644 --- a/indexer-service-root/pom.xml +++ b/indexer-service-root/pom.xml @@ -3,16 +3,16 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.slb</groupId> - <artifactId>os-indexer-boot-mvn</artifactId> + <groupId>org.opendes.indexer</groupId> + <artifactId>indexer-service</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <groupId>com.slb</groupId> <artifactId>indexer-service-root</artifactId> - <version>0.0.1-SNAPSHOT</version> - <name>indexer</name> - <description>Indexer Spring Boot</description> + <version>1.0-SNAPSHOT</version> + <name>indexer-service-root</name> + <description>Indexer Service Root</description> + <packaging>jar</packaging> <!--<repositories> <repository> @@ -28,11 +28,10 @@ </repositories>--> <dependencies> - <dependency> - <groupId>com.slb.core</groupId> - <artifactId>indexer-search-service-core-root</artifactId> - <version>1.0-SNAPSHOT</version> + <groupId>org.opendes.core</groupId> + <artifactId>indexer-search-core-root</artifactId> + <version>1.0.0</version> </dependency> <!-- spring boot dependencies --> <dependency> @@ -250,26 +249,26 @@ </dependencies> </dependencyManagement> - <build> - <plugins> - <plugin> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>repackage</goal> - </goals> - <configuration> - <classifier>spring-boot</classifier> - <mainClass> - org.opendes.indexer.IndexerApplication - </mainClass> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> +<!-- <build>--> +<!-- <plugins>--> +<!-- <plugin>--> +<!-- <groupId>org.springframework.boot</groupId>--> +<!-- <artifactId>spring-boot-maven-plugin</artifactId>--> +<!-- <executions>--> +<!-- <execution>--> +<!-- <goals>--> +<!-- <goal>repackage</goal>--> +<!-- </goals>--> +<!-- <configuration>--> +<!-- <classifier>spring-boot</classifier>--> +<!-- <mainClass>--> +<!-- org.opendes.indexer.IndexerApplication--> +<!-- </mainClass>--> +<!-- </configuration>--> +<!-- </execution>--> +<!-- </executions>--> +<!-- </plugin>--> +<!-- </plugins>--> +<!-- </build>--> </project> diff --git a/indexer-service-root/src/main/java/org/opendes/indexer/IndexerApplication.java b/indexer-service-root/src/main/java/org/opendes/indexer/IndexerApplication.java deleted file mode 100644 index a955e0785eb451cbffcbc02178dae33a7b86e686..0000000000000000000000000000000000000000 --- a/indexer-service-root/src/main/java/org/opendes/indexer/IndexerApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.opendes.indexer; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class IndexerApplication { - - public static void main(String[] args) { - SpringApplication.run(IndexerApplication.class, args); - } - -} diff --git a/indexer-service-root/src/main/java/org/opendes/indexer/model/RecordReindexRequest.java b/indexer-service-root/src/main/java/org/opendes/indexer/model/RecordReindexRequest.java index e078bd946ff72c66e9ced59de607cfd53f6ad8bc..588c9ac79a0135d5911f3ba891495310492a589a 100644 --- a/indexer-service-root/src/main/java/org/opendes/indexer/model/RecordReindexRequest.java +++ b/indexer-service-root/src/main/java/org/opendes/indexer/model/RecordReindexRequest.java @@ -14,13 +14,12 @@ package org.opendes.indexer.model; -import com.slb.core.SwaggerDoc; -import com.slb.core.validation.ValidKind; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.NotBlank; +import org.opendes.indexer.SwaggerDoc; @Data @Builder diff --git a/indexer-service-root/src/test/java/org/opendes/indexer/IndexerApplicationTests.java b/indexer-service-root/src/test/java/org/opendes/indexer/IndexerApplicationTests.java deleted file mode 100644 index 80a2eab75989f626a00b23ec14347871ce87e381..0000000000000000000000000000000000000000 --- a/indexer-service-root/src/test/java/org/opendes/indexer/IndexerApplicationTests.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.opendes.indexer; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class IndexerApplicationTests { - -// @Test -// public void contextLoads() { -// } - -} diff --git a/pom.xml b/pom.xml index 712ab54eb0a59db0f4551ed85f03839ac8917b89..2cf8e36ae6c3e867b89eee55dd635a605ebb5f2f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,33 +11,37 @@ <relativePath/> <!-- lookup parent from repository --> </parent> - <groupId>com.slb</groupId> - <artifactId>os-indexer-boot-mvn</artifactId> + <groupId>org.opendes.indexer</groupId> + <artifactId>indexer-service</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> - <modules> - <module>indexer-service-root</module> - <module>indexer-service-gcp</module> - <module>indexer-service-azure</module> - </modules> + <description>Indexer Service</description> +<!-- <modules>--> +<!-- <module>indexer-service-root</module>--> +<!-- <module>indexer-service-gcp</module>--> +<!-- <module>indexer-service-azure</module>--> +<!-- </modules>--> <properties> <java.version>1.8</java.version> - <maven.compiler.target>1.8</maven.compiler.target> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.war.plugin>2.6</maven.war.plugin> - <appengine.maven.plugin>1.0.0</appengine.maven.plugin> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <failOnMissingWebXml>false</failOnMissingWebXml> - <spring-cloud.version>Greenwich.SR2</spring-cloud.version> <springfox-version>2.7.0</springfox-version> + <spring-cloud.version>Greenwich.SR2</spring-cloud.version> +<!-- <java.version>1.8</java.version>--> +<!-- <maven.compiler.target>1.8</maven.compiler.target>--> +<!-- <maven.compiler.source>1.8</maven.compiler.source>--> +<!-- <maven.war.plugin>2.6</maven.war.plugin>--> +<!-- <appengine.maven.plugin>1.0.0</appengine.maven.plugin>--> +<!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>--> +<!-- <failOnMissingWebXml>false</failOnMissingWebXml>--> +<!-- <spring-cloud.version>Greenwich.SR2</spring-cloud.version>--> +<!-- <springfox-version>2.7.0</springfox-version>--> </properties> <profiles> <profile> - <id>indexer-service-root</id> + <id>root</id> <activation> <!-- this profile is active by default --> <activeByDefault>true</activeByDefault> @@ -49,7 +53,7 @@ </profile> <profile> - <id>indexer-service-gcp</id> + <id>gcp</id> <activation> <property> <name>vendor</name> @@ -63,7 +67,7 @@ </profile> <profile> - <id>indexer-service-azure</id> + <id>azure</id> <activation> <property> <name>vendor</name> @@ -77,30 +81,30 @@ </profile> - <!-- Unit test only --> - <profile> - <id>dev</id> - <properties> - <skip.unit.tests>false</skip.unit.tests> - <skip.integration.tests>true</skip.integration.tests> - </properties> - </profile> - <!-- Integration test only --> - <profile> - <id>integration-test</id> - <properties> - <skip.integration.tests>false</skip.integration.tests> - <skip.unit.tests>true</skip.unit.tests> - </properties> - </profile> - <!-- Unit and Integration tests combined --> - <profile> - <id>test-all</id> - <properties> - <skip.integration.tests>false</skip.integration.tests> - <skip.unit.tests>false</skip.unit.tests> - </properties> - </profile> +<!-- <!– Unit test only –>--> +<!-- <profile>--> +<!-- <id>dev</id>--> +<!-- <properties>--> +<!-- <skip.unit.tests>false</skip.unit.tests>--> +<!-- <skip.integration.tests>true</skip.integration.tests>--> +<!-- </properties>--> +<!-- </profile>--> +<!-- <!– Integration test only –>--> +<!-- <profile>--> +<!-- <id>integration-test</id>--> +<!-- <properties>--> +<!-- <skip.integration.tests>false</skip.integration.tests>--> +<!-- <skip.unit.tests>true</skip.unit.tests>--> +<!-- </properties>--> +<!-- </profile>--> +<!-- <!– Unit and Integration tests combined –>--> +<!-- <profile>--> +<!-- <id>test-all</id>--> +<!-- <properties>--> +<!-- <skip.integration.tests>false</skip.integration.tests>--> +<!-- <skip.unit.tests>false</skip.unit.tests>--> +<!-- </properties>--> +<!-- </profile>--> </profiles> </project> \ No newline at end of file