You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2023/01/31 17:08:00 UTC
[airavata-data-catalog] 01/05: Initial commit, createDataProduct implemented
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-data-catalog.git
commit 96785f9fe0b4db9841a953c2e34590106b7e7156
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jan 23 15:30:03 2023 -0500
Initial commit, createDataProduct implemented
---
.gitignore | 3 +
data-catalog-api/client/pom.xml | 29 +++++++
.../api/client/DataCatalogAPIClient.java | 49 ++++++++++++
data-catalog-api/pom.xml | 39 +++++++++
data-catalog-api/server/pom.xml | 68 ++++++++++++++++
.../api/DataCatalogApiServiceApplication.java | 13 +++
.../datacatalog/api/model/DataProductEntity.java | 92 ++++++++++++++++++++++
.../api/repository/DataProductRepository.java | 10 +++
.../api/service/DataCatalogAPIService.java | 53 +++++++++++++
.../src/main/resources/application.properties | 5 ++
.../server/src/main/resources/logback.xml | 54 +++++++++++++
.../DataCatalogApiServerApplicationTests.java | 13 +++
data-catalog-api/stubs/pom.xml | 87 ++++++++++++++++++++
.../stubs/src/main/proto/DataCatalogAPI.proto | 39 +++++++++
pom.xml | 54 +++++++++++++
15 files changed, 608 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..79edcba
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+target
+.vscode
+logs
diff --git a/data-catalog-api/client/pom.xml b/data-catalog-api/client/pom.xml
new file mode 100644
index 0000000..431b57a
--- /dev/null
+++ b/data-catalog-api/client/pom.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>data-catalog-api</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>data-catalog-api-client</artifactId>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>data-catalog-api-stubs</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/data-catalog-api/client/src/main/java/org/apache/airavata/datacatalog/api/client/DataCatalogAPIClient.java b/data-catalog-api/client/src/main/java/org/apache/airavata/datacatalog/api/client/DataCatalogAPIClient.java
new file mode 100644
index 0000000..5ba7ebc
--- /dev/null
+++ b/data-catalog-api/client/src/main/java/org/apache/airavata/datacatalog/api/client/DataCatalogAPIClient.java
@@ -0,0 +1,49 @@
+package org.apache.airavata.datacatalog.api.client;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import io.grpc.Channel;
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+
+import java.text.MessageFormat;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.airavata.datacatalog.api.DataCatalogAPIServiceGrpc;
+import org.apache.airavata.datacatalog.api.DataProduct;
+import org.apache.airavata.datacatalog.api.DataProductCreateRequest;
+import org.apache.airavata.datacatalog.api.DataProductCreateResponse;
+import org.apache.airavata.datacatalog.api.DataCatalogAPIServiceGrpc.DataCatalogAPIServiceBlockingStub;;
+
+public class DataCatalogAPIClient {
+
+ private static final Logger logger = LoggerFactory.getLogger(DataCatalogAPIClient.class);
+
+ private final DataCatalogAPIServiceBlockingStub blockingStub;
+
+ public DataCatalogAPIClient(Channel channel) {
+ blockingStub = DataCatalogAPIServiceGrpc.newBlockingStub(channel);
+ }
+
+ public DataProduct createDataProduct(DataProduct dataProduct) {
+ DataProductCreateRequest request = DataProductCreateRequest.newBuilder().setDataProduct(dataProduct).build();
+ DataProductCreateResponse response = blockingStub.createDataProduct(request);
+ return response.getDataProduct();
+ }
+
+ public static void main(String[] args) throws InterruptedException {
+ String target = "localhost:6565";
+
+ ManagedChannel channel = ManagedChannelBuilder.forTarget(target).usePlaintext().build();
+ try {
+ DataCatalogAPIClient client = new DataCatalogAPIClient(channel);
+ DataProduct dataProduct = DataProduct.newBuilder().setName("testing").build();
+ DataProduct result = client.createDataProduct(dataProduct);
+ System.out.println(MessageFormat.format("Created data product with id [{0}]", result.getDataProductId()));
+
+ }finally {
+ channel.shutdownNow().awaitTermination(5, TimeUnit.SECONDS);
+ }
+ }
+}
diff --git a/data-catalog-api/pom.xml b/data-catalog-api/pom.xml
new file mode 100644
index 0000000..5d1da44
--- /dev/null
+++ b/data-catalog-api/pom.xml
@@ -0,0 +1,39 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-data-catalog</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>data-catalog-api</artifactId>
+ <modelVersion>4.0.0</modelVersion>
+
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>server</module>
+ <module>stubs</module>
+ <module>client</module>
+ </modules>
+</project>
diff --git a/data-catalog-api/server/pom.xml b/data-catalog-api/server/pom.xml
new file mode 100644
index 0000000..b3c9cf1
--- /dev/null
+++ b/data-catalog-api/server/pom.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>data-catalog-api</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>data-catalog-api-server</artifactId>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.github.lognet</groupId>
+ <artifactId>grpc-spring-boot-starter</artifactId>
+ <version>${grpc.spring.boot}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>data-catalog-api-stubs</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/DataCatalogApiServiceApplication.java b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/DataCatalogApiServiceApplication.java
new file mode 100644
index 0000000..5b3fa8e
--- /dev/null
+++ b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/DataCatalogApiServiceApplication.java
@@ -0,0 +1,13 @@
+package org.apache.airavata.datacatalog.api;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class DataCatalogApiServiceApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(DataCatalogApiServiceApplication.class, args);
+ }
+
+}
diff --git a/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/model/DataProductEntity.java b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/model/DataProductEntity.java
new file mode 100644
index 0000000..63af7e8
--- /dev/null
+++ b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/model/DataProductEntity.java
@@ -0,0 +1,92 @@
+package org.apache.airavata.datacatalog.api.model;
+
+import jakarta.persistence.Basic;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.SequenceGenerator;
+import jakarta.persistence.Table;
+
+@Entity
+@Table(name="data_product")
+public class DataProductEntity {
+
+ @Id
+ @SequenceGenerator(name="data_product_data_product_id_seq", sequenceName = "data_product_data_product_id_seq", allocationSize = 1)
+ @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "data_product_data_product_id_seq")
+ @Column(name="data_product_id")
+ private Long dataProductId;
+
+ @ManyToOne(optional = true)
+ @JoinColumn(name="parent_data_product_id", referencedColumnName = "data_product_id", nullable = true)
+ private DataProductEntity parentDataProductEntity;
+
+ @Basic
+ @Column(name="external_id", nullable = false)
+ private String externalId;
+
+ @Basic
+ @Column(name="name", nullable = false)
+ private String name;
+
+ public Long getDataProductId() {
+ return dataProductId;
+ }
+
+ public void setDataProductId(Long dataProductId) {
+ this.dataProductId = dataProductId;
+ }
+
+ public DataProductEntity getParentDataProductEntity() {
+ return parentDataProductEntity;
+ }
+
+ public void setParentDataProductEntity(DataProductEntity parentDataProductEntity) {
+ this.parentDataProductEntity = parentDataProductEntity;
+ }
+
+ public String getExternalId() {
+ return externalId;
+ }
+
+ public void setExternalId(String externalId) {
+ this.externalId = externalId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((dataProductId == null) ? 0 : dataProductId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DataProductEntity other = (DataProductEntity) obj;
+ if (dataProductId == null) {
+ if (other.dataProductId != null)
+ return false;
+ } else if (!dataProductId.equals(other.dataProductId))
+ return false;
+ return true;
+ }
+}
diff --git a/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/repository/DataProductRepository.java b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/repository/DataProductRepository.java
new file mode 100644
index 0000000..770eb8f
--- /dev/null
+++ b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/repository/DataProductRepository.java
@@ -0,0 +1,10 @@
+package org.apache.airavata.datacatalog.api.repository;
+
+import org.apache.airavata.datacatalog.api.model.DataProductEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface DataProductRepository extends JpaRepository<DataProductEntity, Long> {
+
+ DataProductEntity findByExternalId(String parentDataProductId);
+
+}
diff --git a/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/service/DataCatalogAPIService.java b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/service/DataCatalogAPIService.java
new file mode 100644
index 0000000..d4e9589
--- /dev/null
+++ b/data-catalog-api/server/src/main/java/org/apache/airavata/datacatalog/api/service/DataCatalogAPIService.java
@@ -0,0 +1,53 @@
+package org.apache.airavata.datacatalog.api.service;
+
+import java.util.UUID;
+
+import org.apache.airavata.datacatalog.api.DataCatalogAPIServiceGrpc;
+import org.apache.airavata.datacatalog.api.DataProduct;
+import org.apache.airavata.datacatalog.api.DataProductCreateRequest;
+import org.apache.airavata.datacatalog.api.DataProductCreateResponse;
+import org.apache.airavata.datacatalog.api.model.DataProductEntity;
+import org.apache.airavata.datacatalog.api.repository.DataProductRepository;
+import org.lognet.springboot.grpc.GRpcService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import io.grpc.stub.StreamObserver;
+
+@GRpcService
+public class DataCatalogAPIService extends DataCatalogAPIServiceGrpc.DataCatalogAPIServiceImplBase {
+
+ private static final Logger logger = LoggerFactory.getLogger(DataCatalogAPIService.class);
+
+ @Autowired
+ DataProductRepository dataProductRepository;
+
+ @Override
+ public void createDataProduct(DataProductCreateRequest request,
+ StreamObserver<DataProductCreateResponse> responseObserver) {
+
+ logger.info("Creating data product {}", request.getDataProduct());
+ DataProductEntity dataProductEntity = new DataProductEntity();
+ dataProductEntity.setExternalId(UUID.randomUUID().toString());
+ dataProductEntity.setName(request.getDataProduct().getName());
+ if (request.getDataProduct().hasParentDataProductId()) {
+ // TODO: handle parent data product not found
+ DataProductEntity parentDataProductEntity = dataProductRepository
+ .findByExternalId(request.getDataProduct().getParentDataProductId());
+ dataProductEntity.setParentDataProductEntity(parentDataProductEntity);
+ }
+ DataProductEntity savedDataProductEntity = dataProductRepository.save(dataProductEntity);
+
+ DataProductCreateResponse.Builder responseBuilder = DataProductCreateResponse.newBuilder();
+ responseBuilder.getDataProductBuilder()
+ .setDataProductId(savedDataProductEntity.getExternalId())
+ .setName(savedDataProductEntity.getName()).build();
+ if (savedDataProductEntity.getParentDataProductEntity() != null) {
+ responseBuilder.getDataProductBuilder()
+ .setParentDataProductId(savedDataProductEntity.getParentDataProductEntity().getExternalId());
+ }
+ responseObserver.onNext(responseBuilder.build());
+ responseObserver.onCompleted();
+ }
+}
diff --git a/data-catalog-api/server/src/main/resources/application.properties b/data-catalog-api/server/src/main/resources/application.properties
new file mode 100644
index 0000000..2064c00
--- /dev/null
+++ b/data-catalog-api/server/src/main/resources/application.properties
@@ -0,0 +1,5 @@
+spring.datasource.url=jdbc:postgresql://localhost:5432/data_catalog
+spring.datasource.username=postgres
+spring.datasource.password=example
+spring.jpa.hibernate.ddl-auto=update
+spring.jpa.show-sql=true
diff --git a/data-catalog-api/server/src/main/resources/logback.xml b/data-catalog-api/server/src/main/resources/logback.xml
new file mode 100644
index 0000000..5cd56ea
--- /dev/null
+++ b/data-catalog-api/server/src/main/resources/logback.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<configuration>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <File>../logs/airavata.log</File>
+ <Append>true</Append>
+ <encoder>
+ <pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
+ </encoder>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+ <maxHistory>30</maxHistory>
+ <totalSizeCap>1GB</totalSizeCap>
+ </rollingPolicy>
+ </appender>
+
+ <logger name="ch.qos.logback" level="WARN"/>
+ <logger name="org.apache.helix" level="WARN"/>
+ <logger name="org.apache.zookeeper" level="ERROR"/>
+ <logger name="org.apache.airavata" level="INFO"/>
+ <logger name="org.hibernate" level="INFO"/>
+ <logger name="net.schmizz.sshj" level="WARN"/>
+ <root level="INFO">
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="LOGFILE"/>
+ </root>
+</configuration>
diff --git a/data-catalog-api/server/src/test/java/org/apache/airavata/datacatalogapiserver/DataCatalogApiServerApplicationTests.java b/data-catalog-api/server/src/test/java/org/apache/airavata/datacatalogapiserver/DataCatalogApiServerApplicationTests.java
new file mode 100644
index 0000000..f7ed907
--- /dev/null
+++ b/data-catalog-api/server/src/test/java/org/apache/airavata/datacatalogapiserver/DataCatalogApiServerApplicationTests.java
@@ -0,0 +1,13 @@
+package org.apache.airavata.datacatalogapiserver;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class DataCatalogApiServerApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
diff --git a/data-catalog-api/stubs/pom.xml b/data-catalog-api/stubs/pom.xml
new file mode 100644
index 0000000..18f5fe6
--- /dev/null
+++ b/data-catalog-api/stubs/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<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">
+ <parent>
+ <artifactId>data-catalog-api</artifactId>
+ <groupId>org.apache.airavata</groupId>
+ <version>0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>data-catalog-api-stubs</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty-shaded</artifactId>
+ <version>${grpc.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-protobuf</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-stub</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency> <!-- necessary for Java 9+ -->
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>annotations-api</artifactId>
+ <version>${tomcat.annotations-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>kr.motd.maven</groupId>
+ <artifactId>os-maven-plugin</artifactId>
+ <version>${os.maven.plugin}</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.xolstice.maven.plugins</groupId>
+ <artifactId>protobuf-maven-plugin</artifactId>
+ <version>${protobuf.maven.plugin}</version>
+ <configuration>
+ <protocArtifact>com.google.protobuf:protoc:${protobuf.protoc.version}:exe:${os.detected.classifier}</protocArtifact>
+ <pluginId>grpc-java</pluginId>
+ <pluginArtifact>io.grpc:protoc-gen-grpc-java:${protoc-gen-grpc-java.version}:exe:${os.detected.classifier}</pluginArtifact>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>compile-custom</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/data-catalog-api/stubs/src/main/proto/DataCatalogAPI.proto b/data-catalog-api/stubs/src/main/proto/DataCatalogAPI.proto
new file mode 100644
index 0000000..0a2a083
--- /dev/null
+++ b/data-catalog-api/stubs/src/main/proto/DataCatalogAPI.proto
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.airavata.datacatalog.api";
+
+
+message DataProduct {
+ string data_product_id = 1;
+ optional string parent_data_product_id = 2;
+ string name = 3;
+}
+
+message DataProductCreateRequest {
+ DataProduct data_product = 1;
+}
+message DataProductCreateResponse {
+ DataProduct data_product = 1;
+}
+
+service DataCatalogAPIService {
+ rpc createDataProduct(DataProductCreateRequest) returns (DataProductCreateResponse){}
+}
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..2fd997b
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,54 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-data-catalog</artifactId>
+ <packaging>pom</packaging>
+ <version>0.1-SNAPSHOT</version>
+ <name>airavata-data-catalog</name>
+ <url>http://airavata.apache.org</url>
+
+ <modules>
+ <module>data-catalog-api</module>
+ </modules>
+
+ <properties>
+ <java.version>17</java.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <spring.boot.version>3.0.1</spring.boot.version>
+ <grpc.spring.boot>5.0.0</grpc.spring.boot>
+ <slf4j.version>2.0.6</slf4j.version>
+ <os.maven.plugin>1.6.2</os.maven.plugin>
+ <protobuf.maven.plugin>0.6.1</protobuf.maven.plugin>
+ <protobuf.protoc.version>3.21.7</protobuf.protoc.version>
+ <grpc.version>1.52.1</grpc.version>
+ <protoc-gen-grpc-java.version>${grpc.version}</protoc-gen-grpc-java.version>
+ <tomcat.annotations-api.version>6.0.53</tomcat.annotations-api.version>
+ </properties>
+
+ <dependencies>
+ </dependencies>
+</project>