Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat s3 list #54

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloud-runtimes-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>group.rxcloud</groupId>
<artifactId>cloud-runtimes</artifactId>
<version>1.17.RELEASE</version>
<version>1.18.RELEASE</version>
</parent>

<artifactId>cloud-runtimes-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
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.IsObjectExistInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.IsObjectExistOutput;
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.ListObjectsInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.ListObjectsOutput;
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;
Expand Down Expand Up @@ -611,4 +615,14 @@ default Mono<GetObjectOutput> getObject(GetObjectInput getObjectInput) {
default Mono<DeleteObjectOutput> deleteObject(DeleteObjectInput deleteObjectInput) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<ListObjectsOutput> listObjects(ListObjectsInput listObjectsInput) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}

@Override
default Mono<IsObjectExistOutput> isObjectExist(IsObjectExistInput isObjectExistInput) {
throw new UnsupportedOperationException("CloudRuntimes Operate Unsupported.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.DeleteObjectOutput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.IsObjectExistInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.IsObjectExistOutput;
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.ListObjectsInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.ListObjectsOutput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectOutput;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -60,4 +64,18 @@ public interface NativeAwsS3Runtimes {
* @return mono of result
*/
Mono<DeleteObjectOutput> deleteObject(DeleteObjectInput deleteObjectInput);

/**
* List objects from oss.
* @param listObjectsInput
* @return
*/
Mono<ListObjectsOutput> listObjects(ListObjectsInput listObjectsInput);

/**
* Check if an object exists.
* @param isObjectExistInput
* @return
*/
Mono<IsObjectExistOutput> isObjectExist(IsObjectExistInput isObjectExistInput);
}
Original file line number Diff line number Diff line change
@@ -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;

/**
* Check if an object exists.
*/
public class IsObjectExistInput {
/**
* 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;
}
}
Original file line number Diff line number Diff line change
@@ -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;

/**
* Check if an object exists
*/
public class IsObjectExistOutput {
/**
* Object exist or not.
*/
private Boolean fileExist;

public Boolean getFileExist() {
return fileExist;
}

public void setFileExist(Boolean fileExist) {
this.fileExist = fileExist;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* 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;

/**
* List objects from oss by bucket name
*/
public class ListObjectsInput {
/**
* Sets the maximum number of keys returned in the response. By default the action
* returns up to 1,000 key names. The response might contain fewer keys but will
* never contain more.
*/
private Integer maxKeys;
/**
* Marker is where you want Amazon S3 to start listing from. Amazon S3 starts
* listing after this specified key. Marker can be any key in the bucket.
*/
private String marker ;
/**
* Bucket name.
*/
private String bucket;

/**
* Limits the response to keys that begin with the specified prefix.
*/
private String prefix;

public Integer getMaxKeys() {
return maxKeys;
}

public void setMaxKeys(Integer maxKeys) {
this.maxKeys = maxKeys;
}

public String getMarker() {
return marker;
}

public void setMarker(String marker) {
this.marker = marker;
}

public String getBucket() {
return bucket;
}

public void setBucket(String bucket) {
this.bucket = bucket;
}

public String getPrefix() {
return prefix;
}

public void setPrefix(String prefix) {
this.prefix = prefix;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* 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.List;

/**
* List objects from oss by bucket name
*/
public class ListObjectsOutput {
/**
* Key List.
*/
private List<String> contents;
/**
* A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.
*/
private Boolean isTruncated;

/**
* Indicates where in the bucket listing begins. Marker is included in the response
* if it was sent with the request.
*/
private String marker;

/**
* When response is truncated (the IsTruncated element value in the response is
* true), you can use the key name in this field as marker in the subsequent
* request to get next set of objects.
*/
private String nextMarker;

/**
* Keys that begin with the indicated prefix.
*/
private String prefix;

/**
* The maximum number of keys returned in the response body.
*/
private Integer maxKeys;

/**
* The bucket name.
*/
private String name;

public List<String> getContents() {
return contents;
}

public void setContents(List<String> contents) {
this.contents = contents;
}

public Boolean getTruncated() {
return isTruncated;
}

public void setTruncated(Boolean truncated) {
isTruncated = truncated;
}

public String getMarker() {
return marker;
}

public void setMarker(String marker) {
this.marker = marker;
}

public String getNextMarker() {
return nextMarker;
}

public void setNextMarker(String nextMarker) {
this.nextMarker = nextMarker;
}

public String getPrefix() {
return prefix;
}

public void setPrefix(String prefix) {
this.prefix = prefix;
}

public Integer getMaxKeys() {
return maxKeys;
}

public void setMaxKeys(Integer maxKeys) {
this.maxKeys = maxKeys;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
2 changes: 1 addition & 1 deletion cloud-runtimes-capa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>cloud-runtimes</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.17.RELEASE</version>
<version>1.18.RELEASE</version>
</parent>

<artifactId>cloud-runtimes-capa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@
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.IsObjectExistInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.IsObjectExistOutput;
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.ListObjectsInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.ListObjectsOutput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectInput;
import group.rxcloud.cloudruntimes.domain.nativeproto.awss3.PutObjectOutput;
import group.rxcloud.cloudruntimes.utils.TypeRef;
Expand Down Expand Up @@ -559,4 +563,14 @@ public Mono<GetObjectOutput> getObject(GetObjectInput getObjectInput) {
public Mono<DeleteObjectOutput> deleteObject(DeleteObjectInput deleteObjectInput) {
return DefaultCloudRuntimesClient.super.deleteObject(deleteObjectInput);
}

@Override
public Mono<ListObjectsOutput> listObjects(ListObjectsInput listObjectsInput) {
return DefaultCloudRuntimesClient.super.listObjects(listObjectsInput);
}

@Override
public Mono<IsObjectExistOutput> isObjectExist(IsObjectExistInput isObjectExistInput) {
return DefaultCloudRuntimesClient.super.isObjectExist(isObjectExistInput);
}
}
2 changes: 1 addition & 1 deletion cloud-runtimes-dapr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>cloud-runtimes</artifactId>
<groupId>group.rxcloud</groupId>
<version>1.17.RELEASE</version>
<version>1.18.RELEASE</version>
</parent>

<artifactId>cloud-runtimes-dapr</artifactId>
Expand Down
Loading