diff --git a/README.md b/README.md index 55b8f59..aa18218 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ For a Maven project, add the following to your `pom.xml` file: group.rxcloud cloud-runtimes-api - 1.15.RELEASE + 1.16-SNAPSHOT ... @@ -69,6 +69,6 @@ For a Gradle project, add the following to your `build.gradle` file: dependencies { // ... // https://mvnrepository.com/artifact/group.rxcloud/cloud-runtimes-api - implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.15.RELEASE' + implementation group: 'group.rxcloud', name: 'cloud-runtimes-api', version: '1.16-SNAPSHOT' } ``` diff --git a/cloud-runtimes-api/pom.xml b/cloud-runtimes-api/pom.xml index cd33d53..a268d05 100644 --- a/cloud-runtimes-api/pom.xml +++ b/cloud-runtimes-api/pom.xml @@ -23,7 +23,7 @@ group.rxcloud cloud-runtimes - 1.15.RELEASE + 1.16.RELEASE cloud-runtimes-api diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/NativeProtocolCloudRuntimes.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/NativeProtocolCloudRuntimes.java index 82e8bc4..19b134f 100644 --- a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/NativeProtocolCloudRuntimes.java +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/NativeProtocolCloudRuntimes.java @@ -19,6 +19,13 @@ import group.rxcloud.cloudruntimes.domain.nativeproto.NativeAwsS3Runtimes; import group.rxcloud.cloudruntimes.domain.nativeproto.NativeRedisRuntimes; import group.rxcloud.cloudruntimes.domain.nativeproto.NativeSqlRuntimes; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.InitRequest; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectOutput; import group.rxcloud.cloudruntimes.domain.nativeproto.redis.geo.GeoRadiusResponse; import group.rxcloud.cloudruntimes.domain.nativeproto.redis.geo.GeoUnit; import reactor.core.publisher.Mono; @@ -584,4 +591,24 @@ default Boolean msetnx(String... keysvalues) { default List mget(String... keys) { throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported."); } + + @Override + default void initClient(InitRequest initRequest) { + throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported."); + } + + @Override + default Mono putObject(PutObjectInput putObjectInput) { + throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported."); + } + + @Override + default Mono getObject(GetObjectInput getObjectInput) { + throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported."); + } + + @Override + default Mono deleteObject(DeleteObjectInput deleteObjectInput) { + throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported."); + } } diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/NativeAwsS3Runtimes.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/NativeAwsS3Runtimes.java index 3cf85be..10c10d1 100644 --- a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/NativeAwsS3Runtimes.java +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/NativeAwsS3Runtimes.java @@ -16,11 +16,46 @@ */ package group.rxcloud.cloudruntimes.domain.nativeproto; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.InitRequest; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectOutput; +import reactor.core.publisher.Mono; + /** * Native OSS AWS S3 API defined. */ public interface NativeAwsS3Runtimes { + /** + * Initialize the s3 client. + * @param initRequest + */ + void initClient(InitRequest initRequest); + + /** + * Put a object to oss。 + * @param putObjectInput + * @return + */ + Mono putObject(PutObjectInput putObjectInput); + + /** + * Get a object from oss. + * @param getObjectInput + * @return + */ + Mono getObject(GetObjectInput getObjectInput); + + /** + * Delete the object from oss。 + * @param deleteObjectInput + * @return + */ + Mono deleteObject(DeleteObjectInput deleteObjectInput); /* syntax = "proto3"; diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectInput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectInput.java new file mode 100644 index 0000000..c234b4b --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectInput.java @@ -0,0 +1,47 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +/** + * Delete object from oss by bucket name and object key name。 + */ +public class DeleteObjectInput { + /** + * Required. The bucket name containing the object. + */ + private String bucket; + /** + * Required. Key of the object to delete. + */ + private String key; + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectOutput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectOutput.java new file mode 100644 index 0000000..155d7e2 --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/DeleteObjectOutput.java @@ -0,0 +1,59 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +/** + * Delete object from oss by bucket name and object key name。 + */ +public class DeleteObjectOutput { + /** + * Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. + */ + private boolean deleteMarker; + /** + * The value of the RequestCharged property for this object. + */ + private String requestCharged; + /** + * Version of the object. + */ + private String versionId; + + public boolean isDeleteMarker() { + return deleteMarker; + } + + public void setDeleteMarker(boolean deleteMarker) { + this.deleteMarker = deleteMarker; + } + + public String getRequestCharged() { + return requestCharged; + } + + public void setRequestCharged(String requestCharged) { + this.requestCharged = requestCharged; + } + + public String getVersionId() { + return versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectInput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectInput.java new file mode 100644 index 0000000..eec7117 --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectInput.java @@ -0,0 +1,47 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +/** + * Get object from oss by bucket name and object key name。 + */ +public class GetObjectInput { + /** + * Required. The bucket name containing the object. + */ + private String bucket; + /** + * Required. Key of the object to get. + */ + private String key; + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectOutput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectOutput.java new file mode 100644 index 0000000..5626ed9 --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/GetObjectOutput.java @@ -0,0 +1,36 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +/** + * Get object from oss by bucket name and object key name。 + */ +public class GetObjectOutput { + + /** + * Byte stream for the specified object. + */ + private byte[] data; + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/InitRequest.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/InitRequest.java new file mode 100644 index 0000000..c1570ff --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/InitRequest.java @@ -0,0 +1,49 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +import java.util.Map; + +/** + * Initialize the client's request entity. + */ +public class InitRequest { + /** + * The name of oss. + */ + private String storeName; + /** + * Initialize the metadata required by the client + */ + private Map metadata; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectInput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectInput.java new file mode 100644 index 0000000..888b2fe --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectInput.java @@ -0,0 +1,73 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +import java.util.Map; + +/** + * Put object to oss by bucket name and object key name。 + */ +public class PutObjectInput { + /** + * Byte stream for the specified object. + */ + private byte[] data; + /** + * The bucket name for the object. + */ + private String bucket; + /** + * Key of the object to put. + */ + private String key; + /** + * Metadata of the object. + */ + private Map metadata; + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectOutput.java b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectOutput.java new file mode 100644 index 0000000..07e3033 --- /dev/null +++ b/cloud-runtimes-api/src/main/java/group/rxcloud/cloudruntimes/domain/nativeproto/awss3/PutObjectOutput.java @@ -0,0 +1,35 @@ +/* + * 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. + */ +package group.rxcloud.cloudruntimes.domain.nativeproto.awss3; + +/** + * Put object to oss by bucket name and object key name。 + */ +public class PutObjectOutput { + /** + * Entity tag for the uploaded object. + */ + private String eTag; + + public String eTag() { + return eTag; + } + + public void setETag(String eTag) { + this.eTag = eTag; + } +} diff --git a/cloud-runtimes-capa/pom.xml b/cloud-runtimes-capa/pom.xml index b4f18e8..0fedd24 100644 --- a/cloud-runtimes-capa/pom.xml +++ b/cloud-runtimes-capa/pom.xml @@ -23,7 +23,7 @@ cloud-runtimes group.rxcloud - 1.15.RELEASE + 1.16.RELEASE cloud-runtimes-capa diff --git a/cloud-runtimes-capa/src/main/java/group/rxcloud/cloudruntimes/capa/CapaCloudRuntimesClient.java b/cloud-runtimes-capa/src/main/java/group/rxcloud/cloudruntimes/capa/CapaCloudRuntimesClient.java index e4c0b26..ba02704 100644 --- a/cloud-runtimes-capa/src/main/java/group/rxcloud/cloudruntimes/capa/CapaCloudRuntimesClient.java +++ b/cloud-runtimes-capa/src/main/java/group/rxcloud/cloudruntimes/capa/CapaCloudRuntimesClient.java @@ -60,6 +60,13 @@ import group.rxcloud.cloudruntimes.domain.enhanced.lock.TryLockResponse; import group.rxcloud.cloudruntimes.domain.enhanced.lock.UnlockRequest; import group.rxcloud.cloudruntimes.domain.enhanced.lock.UnlockResponse; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.GetObjectOutput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.InitRequest; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectInput; +import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectOutput; import group.rxcloud.cloudruntimes.utils.TypeRef; import io.opentelemetry.api.metrics.Meter; import io.opentelemetry.api.trace.Tracer; @@ -532,4 +539,24 @@ public Mono shutdown() { @Override public void close() { } + + @Override + public void initClient(InitRequest initRequest) { + DefaultCloudRuntimesClient.super.initClient(initRequest); + } + + @Override + public Mono putObject(PutObjectInput putObjectInput) { + return DefaultCloudRuntimesClient.super.putObject(putObjectInput); + } + + @Override + public Mono getObject(GetObjectInput getObjectInput) { + return DefaultCloudRuntimesClient.super.getObject(getObjectInput); + } + + @Override + public Mono deleteObject(DeleteObjectInput deleteObjectInput) { + return DefaultCloudRuntimesClient.super.deleteObject(deleteObjectInput); + } } diff --git a/cloud-runtimes-dapr/pom.xml b/cloud-runtimes-dapr/pom.xml index b5a4742..0dcabba 100644 --- a/cloud-runtimes-dapr/pom.xml +++ b/cloud-runtimes-dapr/pom.xml @@ -23,7 +23,7 @@ cloud-runtimes group.rxcloud - 1.15.RELEASE + 1.16.RELEASE cloud-runtimes-dapr diff --git a/cloud-runtimes-layotto/pom.xml b/cloud-runtimes-layotto/pom.xml index b8ebed8..4650dca 100644 --- a/cloud-runtimes-layotto/pom.xml +++ b/cloud-runtimes-layotto/pom.xml @@ -23,7 +23,7 @@ cloud-runtimes group.rxcloud - 1.15.RELEASE + 1.16.RELEASE cloud-runtimes-layotto diff --git a/pom.xml b/pom.xml index d6a55af..3e14996 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ group.rxcloud cloud-runtimes pom - 1.15.RELEASE + 1.16.RELEASE cloud-runtimes-jvm Cloud Runtimes Specification for the JVM. @@ -171,6 +171,7 @@ org.apache.maven.plugins maven-resources-plugin + 3.1.0 copy-checkstyle