Skip to content

Commit

Permalink
feat(java-sdk): Merge java_sdk_reactor and java_sdk_1.1.0 into main b…
Browse files Browse the repository at this point in the history
…ranch (#349)


Co-authored-by: Kevin_T <596823919@qq.com>
Co-authored-by: ccx1024cc <1261138729@qq.com>
  • Loading branch information
3 people authored Dec 6, 2021
1 parent 17ec7a1 commit 978b472
Show file tree
Hide file tree
Showing 81 changed files with 5,389 additions and 100 deletions.
2 changes: 1 addition & 1 deletion sdk/java-sdk/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ PS: 建议用maven插件`protoc-gen-grpc-java`生成protobuf和grpc的java代码

如果您在使用 [IntelliJ IDEA](https://www.jetbrains.com/help/idea/discover-intellij-idea.html) ,双击 Maven插件中的 `compile` , IDE 会自动帮你编译 proto 文件:

![img.png](../../docs/img/sdk/img.png)
![img.png](img.png)
3 changes: 3 additions & 0 deletions sdk/java-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ protoc -I=. --java_out=../../../../sdk/java-sdk/sdk/src/main/java/ appcallback.
```

PS: We recommend that you use the maven plugin `protoc-gen-grpc-java` to generate these protobuf and grpc related java code.
If you are using [IntelliJ IDEA](https://www.jetbrains.com/help/idea/discover-intellij-idea.html) ,just double click `compile` in the Maven tab and the IDE will generate proto files automatically:

![img.png](img.png)
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@

import io.mosn.layotto.v1.RuntimeClientBuilder;
import io.mosn.layotto.v1.config.RuntimeProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import spec.sdk.runtime.v1.client.RuntimeClient;
import spec.sdk.runtime.v1.domain.file.PutFileRequest;
import spec.sdk.runtime.v1.domain.file.GetFileRequest;
import spec.sdk.runtime.v1.domain.file.ListFileRequest;
import spec.sdk.runtime.v1.domain.file.GetMetaRequest;
import spec.sdk.runtime.v1.domain.file.DelFileRequest;
import spec.sdk.runtime.v1.domain.file.GetFileResponse;
import spec.sdk.runtime.v1.domain.file.ListFileResponse;
import spec.sdk.runtime.v1.domain.file.FileInfo;
import spec.sdk.runtime.v1.domain.file.GetFileRequest;
import spec.sdk.runtime.v1.domain.file.GetFileResponse;
import spec.sdk.runtime.v1.domain.file.GetMetaRequest;
import spec.sdk.runtime.v1.domain.file.GetMeteResponse;
import spec.sdk.runtime.v1.domain.file.ListFileRequest;
import spec.sdk.runtime.v1.domain.file.ListFileResponse;
import spec.sdk.runtime.v1.domain.file.PutFileRequest;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

/**
* Specially
Expand All @@ -41,7 +42,7 @@
*/
public class File {

private static final Logger logger = Logger.getLogger(File.class.getName());
private static final Logger logger = LoggerFactory.getLogger(File.class.getName());

static String storeName = "local";
static String fileName = "/tmp/test.log";
Expand Down
Binary file added sdk/java-sdk/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions sdk/java-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<modules>
<module>sdk</module>
<module>examples</module>
<module>sdk-reactor</module>
<module>spec</module>
</modules>

<properties>
Expand All @@ -36,10 +38,9 @@
</dependency>
<dependency>
<groupId>io.mosn.layotto</groupId>
<artifactId>examples</artifactId>
<artifactId>runtime-spec-pb</artifactId>
<version>${project.version}</version>
</dependency>

<!-- json -->
<dependency>
<groupId>com.alibaba</groupId>
Expand All @@ -60,7 +61,21 @@
<artifactId>grpc-all</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</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>
<!-- unit test -->
<dependency>
<groupId>org.mockito</groupId>
Expand Down
53 changes: 53 additions & 0 deletions sdk/java-sdk/sdk-reactor/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.mosn.layotto</groupId>
<artifactId>runtime-sdk-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>

<artifactId>runtime-sdk-reactor</artifactId>

<name>runtime-sdk-reactor</name>
<description>reactor-style SDK for Runtime</description>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>io.mosn.layotto</groupId>
<artifactId>runtime-spec-pb</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.3.11.RELEASE</version>
</dependency>
<!-- serializer -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.3</version>
</dependency>
<!-- okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<!-- necessary for Java 9+ -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>annotations-api</artifactId>
<version>6.0.53</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright 2021 Layotto Authors
* Licensed 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.
*/
/**
* SDK JVM Client.
*/
package io.mosn.layotto.v1.client;
Loading

0 comments on commit 978b472

Please sign in to comment.