summaryrefslogtreecommitdiffstats
path: root/swift-client
diff options
context:
space:
mode:
authorSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-05-02 09:42:55 -0400
committerSmokowski, Steve (ss835w) <ss835w@us.att.com>2019-05-07 10:02:17 -0400
commit3f9a0c3183480d150089c0d5a6e507c877f7d121 (patch)
treeb3db04cbe2cef23f81503177a50edc5360ffa486 /swift-client
parente153f0adfbed711ce1e215748594a4d04fd1edaf (diff)
Enhance Openstack Client
Update Openstack Client to support additional fields Updat all formatting issues Issue-ID: SO-1844 Change-Id: I1369e0c18cc25274db8df7e12855a020b8da38da Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'swift-client')
-rw-r--r--swift-client/pom.xml47
-rw-r--r--swift-client/src/main/java/com/woorea/openstack/swift/Swift.java12
-rw-r--r--swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java4
-rw-r--r--swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java56
-rw-r--r--swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java31
5 files changed, 74 insertions, 76 deletions
diff --git a/swift-client/pom.xml b/swift-client/pom.xml
index de1f1b1..b7b0852 100644
--- a/swift-client/pom.xml
+++ b/swift-client/pom.xml
@@ -1,24 +1,25 @@
-<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>org.onap.so.libs</groupId>
- <artifactId>openstack-java-sdk</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
- <artifactId>swift-client</artifactId>
- <name>OpenStack Swift Client</name>
- <description>OpenStack Swift Client</description>
- <dependencies>
- <dependency>
- <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
- <artifactId>openstack-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
- <artifactId>swift-model</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
+<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>org.onap.so.libs</groupId>
+ <artifactId>openstack-java-sdk</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
+ <artifactId>swift-client</artifactId>
+ <name>OpenStack Swift Client</name>
+ <description>OpenStack Swift Client</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
+ <artifactId>openstack-client</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.so.libs.openstack-java-sdk</groupId>
+ <artifactId>swift-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java b/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java
index 8ae3200..1e3d498 100644
--- a/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java
+++ b/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java
@@ -23,25 +23,25 @@ import com.woorea.openstack.swift.api.AccountResource;
import com.woorea.openstack.swift.api.ContainersResource;
public class Swift extends OpenStackClient {
-
+
private final AccountResource ACCOUNT;
-
+
private final ContainersResource CONTAINERS;
-
+
public Swift(String endpoint, OpenStackClientConnector connector) {
super(endpoint, connector);
CONTAINERS = new ContainersResource(this);
ACCOUNT = new AccountResource(this);
}
-
+
public Swift(String endpoint) {
this(endpoint, null);
}
-
+
public ContainersResource containers() {
return CONTAINERS;
}
-
+
public AccountResource account() {
return ACCOUNT;
}
diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java
index a860c71..7ed0ca2 100644
--- a/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java
+++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java
@@ -20,9 +20,9 @@ import com.woorea.openstack.base.client.OpenStackClient;
import com.woorea.openstack.base.client.OpenStackRequest;
public class AccountResource {
-
+
private final OpenStackClient CLIENT;
-
+
public AccountResource(OpenStackClient client) {
CLIENT = client;
}
diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java
index 5b5cc02..b0ef16b 100644
--- a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java
+++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java
@@ -17,8 +17,6 @@
package com.woorea.openstack.swift.api;
import java.util.Map;
-
-
import com.woorea.openstack.base.client.OpenStackClient;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.base.client.OpenStackResponse;
@@ -26,72 +24,72 @@ import com.woorea.openstack.swift.model.ObjectDownload;
import com.woorea.openstack.swift.model.ObjectForUpload;
public class ContainerResource {
-
+
private final OpenStackClient CLIENT;
-
+
private String container;
-
+
public ContainerResource(OpenStackClient client, String container) {
CLIENT = client;
this.container = container;
}
-
+
public List list() {
return new List(container, null);
}
-
+
public CreateDirectory createDirectory(String path) {
return new CreateDirectory(container, path);
}
-
+
public Show show(String path) {
return new Show(container, path);
}
-
+
public Upload upload(ObjectForUpload objectForUpload) {
return new Upload(objectForUpload);
}
-
+
public Download download(String path) {
return new Download(container, path);
}
-
+
public Delete delete(String path) {
return new Delete(container, path);
}
-
+
public class List extends OpenStackRequest<java.util.List<Object>> {
private String containerName;
-
+
private Map<String, String> filters;
-
+
public List(String containerName, Map<String, String> filters) {
this.containerName = containerName;
this.filters = filters;
}
-
+
}
public class CreateDirectory extends OpenStackRequest<Void> {
private String container;
-
+
private String path;
-
+
public CreateDirectory(String container, String path) {
this.container = container;
this.path = path;
}
-
+
}
-
+
public class Show extends OpenStackRequest<Object> {
private String containerName;
-
+
private String objectName;
-
+
public Show(String containerName, String objectName) {
this.containerName = containerName;
this.objectName = objectName;
@@ -99,24 +97,24 @@ public class ContainerResource {
}
}
-
+
public class Upload extends OpenStackRequest<OpenStackResponse> {
private ObjectForUpload objectForUpload;
-
+
public Upload(ObjectForUpload objectForUpload) {
this.objectForUpload = objectForUpload;
}
}
-
+
public class Download extends OpenStackRequest<ObjectDownload> {
private String containerName;
-
+
private String objectName;
-
+
public Download(String containerName, String objectName) {
this.containerName = containerName;
this.objectName = objectName;
@@ -124,13 +122,13 @@ public class ContainerResource {
}
-
+
public class Delete extends OpenStackRequest<Void> {
private String containerName;
-
+
private String objectName;
-
+
public Delete(String containerName, String objectName) {
this.containerName = containerName;
this.objectName = objectName;
diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java
index 05147bc..04d8ba4 100644
--- a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java
+++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java
@@ -22,68 +22,67 @@ import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.swift.model.Container;
public class ContainersResource {
-
+
private final OpenStackClient CLIENT;
-
+
public ContainersResource(OpenStackClient client) {
CLIENT = client;
}
-
+
public List list() {
return new List();
}
-
+
public Create create(String name) {
return new Create(name);
}
-
+
public Show show(String name) {
return new Show(name);
}
-
+
public Delete delete(String name) {
return new Delete(name);
}
-
+
public ContainerResource container(String name) {
return new ContainerResource(CLIENT, name);
}
-
+
public class List extends OpenStackRequest<java.util.List<Container>> {
- public List() {
- }
+ public List() {}
}
public class Create extends OpenStackRequest<Container> {
-
+
public Create(String containerName) {
}
}
-
+
public class Show extends OpenStackRequest<Container> {
private String containerName;
-
+
public Show(String containerName) {
}
}
-
+
public class Delete extends OpenStackRequest<Void> {
private String containerName;
-
+
public Delete(String containerName) {
this.containerName = containerName;
}
}
-
+
}