diff --git a/.gitattributes b/.gitattributes index 4bf4c97b7..cd914d4f4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,11 @@ +# When text is set to "auto", the path is marked for automatic end-of-line conversion. +# If Git decides that the content is text, its line endings are converted to LF on +# checkin. When the file has been committed with CRLF, no conversion is done. +# https://git-scm.com/docs/gitattributes +* text=auto + +# associate .txt files as text files. *.txt text +# Override default behavior: BAT files always have CRLF line endings. +*.bat text eol=crlf diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..b1650df74 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,40 @@ +name: DS3 Java SDK Tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-deps: + name: Compile main and test classes with fresh dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + check-latest: true + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - run: ./gradlew clean classes testClasses integrationTestClasses shadowJar --refresh-dependencies + test: + name: Test with multiple Temurin JDK versions + strategy: + matrix: + test-jdk-version: [ 8, 11, 17 ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + name: Setup Temurin JDK ${{ matrix.test-jdk-version }} + with: + distribution: 'temurin' + java-version: ${{ matrix.test-jdk-version }} + check-latest: true + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + - name: Compile and assemble main project with Temurin JDK ${{ matrix.test-jdk-version }} + run: ./gradlew clean assemble + - name: Test with Temurin JDK ${{ matrix.test-jdk-version }} + run: ./gradlew -S test${{ matrix.test-jdk-version }} diff --git a/.gitignore b/.gitignore index 204cfe08d..629bdb4d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle/ +.gradletasknamecache .idea/ out/ coverage-report/ @@ -17,3 +18,4 @@ atlassian-ide-plugin.xml bin/ *.log *.rc +.DS_Store diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5b850af23..000000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: java -jdk: - - oraclejdk8 - - oraclejdk7 - - openjdk7 -script: ./gradlew -S clean jar ds3-sdk:test ds3-utils:test ds3-metadata:test diff --git a/README.md b/README.md index 0bdba6178..673a0fea7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@ ds3_java_sdk ============ -[![Build Status](https://travis-ci.org/SpectraLogic/ds3_java_sdk.svg)](https://travis-ci.org/SpectraLogic/ds3_java_sdk) - - Coverity Scan Build Status - -[![Download](https://api.bintray.com/packages/spectralogic/ds3/ds3_java_sdk/images/download.svg) ](https://bintray.com/spectralogic/ds3/ds3_java_sdk/_latestVersion) -[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/SpectraLogic/ds3_java_sdk/blob/master/LICENSE.md) [![Open Hub project report for ds3_java_sdk](https://www.openhub.net/p/ds3_java_sdk/widgets/project_thin_badge.gif)](https://www.openhub.net/p/ds3_java_sdk?ref=sample) +[![Latest release](https://img.shields.io/github/release/SpectraLogic/ds3_java_sdk.svg)](https://github.com/SpectraLogic/ds3_java_sdk/releases/latest) +[![Maven Central](https://img.shields.io/maven-central/v/com.spectralogic.ds3/ds3-bom.svg)](https://search.maven.org/artifact/com.spectralogic.ds3/ds3-bom) +[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/SpectraLogic/ds3_java_sdk/blob/master/LICENSE.md) +[![Open Hub project report for ds3_java_sdk](https://www.openhub.net/p/ds3_java_sdk/widgets/project_thin_badge.gif)](https://www.openhub.net/p/ds3_java_sdk?ref=sample) ## Contact Us @@ -21,60 +18,53 @@ If using Intellij, simply import the project as a Gradle project. ## Install -To install the latest `ds3_java_sdk` either download the latest release jar file from the [Releases](../../releases) page or clone the repository with `git clone https://github.com/SpectraLogic/ds3_java_sdk.git`, cd to `ds3_java_sdk` and run `./gradlew clean ds3-sdk:install` to install the sdk into your local maven repository. It is compatible with Java 7 and above. +To install the latest `ds3_java_sdk` either download the latest release jar file from the [Releases](../../releases) page or clone the repository with `git clone https://github.com/SpectraLogic/ds3_java_sdk.git`, cd to `ds3_java_sdk` and run `./gradlew clean ds3-sdk:install` to install the sdk into your local maven repository. It is compatible with Java 8 and is additionally tested against Java 11 and 17. -The SDK can also be included directly into a Maven or Gradle build. There is also a fatjar version that you can optionally use with the `all` classifier, take a look at the commented out code in the examples below. To include the SDK into maven add the following to the `pom.xml` file: +Starting with the 5.6.0 release, the SDK is available on [Maven Central](https://central.sonatype.com/namespace/com.spectralogic.ds3) and can be included directly into a Maven or Gradle build. There is also a fatjar version that you can optionally use with the `all` classifier, take a look at the commented out code in the examples below. To include the SDK into maven add the following to the `pom.xml` file: ```xml - - ... - - - Spectra-Github - http://dl.bintray.com/spectralogic/ds3 - - ... ... - com.spectralogic.ds3 - ds3-sdk - 3.4.0 + com.spectralogic.ds3 + ds3-sdk + Tag - + ... +``` +To include the sdk into Gradle include the following in the `build.gradle.kts` file: + +```kotlin +dependencies { + implementation(platform("com.spectralogic.ds3:ds3-bom:Tag")) + implementation("com.spectralogic.ds3:ds3-sdk") + //implementation("com.spectralogic.ds3:ds3-sdk::all") +} ``` -To include the sdk into Gradle include the following in the `build.gradle` file: +or in the `build.gradle` file: ```groovy -repositories { - ... - maven { - url 'http://dl.bintray.com/spectralogic/ds3' - } - ... -} - dependencies { - ... - compile 'com.spectralogic.ds3:ds3-sdk:3.4.0' - // compile 'com.spectralogic.ds3:ds3-sdk:3.4.0:all' - ... + implementation platform('com.spectralogic.ds3:ds3-bom:Tag') + implementation 'com.spectralogic.ds3:ds3-sdk' + //implementation 'com.spectralogic.ds3:ds3-sdk::all' } - ``` -## Javadoc -The latest javadoc is located at [http://spectralogic.github.io/ds3_java_sdk/javadoc/](http://spectralogic.github.io/ds3_java_sdk/javadoc/) +### Previous versions + +Versions prior to 5.6.0 are available on [jitpack.io](https://jitpack.io/#SpectraLogic/ds3_java_sdk) under different maven coordinates. Unfortunately, the 5.6.0 version on jitpack.io is a pre-release version and is missing important fixes, and it is recommended that the artifacts on Maven Central are used going forward. To access versions earlier than 5.6.0, please see the instructions at https://jitpack.io/#SpectraLogic/ds3_java_sdk. ## Contributing + If you would like to contribute to the source code, sign the [Contributors Agreement](https://developer.spectralogic.com/contributors-agreement/) and make sure that your source conforms to our [Java Style Guide](https://github.com/SpectraLogic/spectralogic.github.com/wiki/Java-Style-Guide). For an overview of how we use Github, please review our [Github Workflow](https://github.com/SpectraLogic/spectralogic.github.com/wiki/Github-Workflow). ## Examples @@ -94,3 +84,21 @@ bridges, please see [SLF4j.org](http://www.slf4j.org/manual.html). In addition to unit tests in the main `ds3-sdk` module, there are additional integration tests in the `ds3-integration` module. Please see the integration [README](ds3-sdk-integration/README.md) for details on running the tests. To just run the SDK's unit tests use: ./gradlew clean ds3-sdk:test + +## Creating a New Release + +Update the version of the SDK before creating a new release. The format is `..`, where the +`.` numbers must match the version of BP. The `` is an incrementing number that increments with +each SDK release for a given major/minor release. + +The version is specified in `libs.versions.toml`: + +``` +[versions] +# +# project version +# +ds3SdkVersion = "5.6.1" +``` + +Once released, increment the minor version and add the suffix "-SNAPSHOT" to prepare for the next development cycle. diff --git a/SETUP.md b/SETUP.md index 82c281663..412b0690f 100644 --- a/SETUP.md +++ b/SETUP.md @@ -13,7 +13,7 @@ If using Eclipse: * In the results that are returned install `Gradle Integration for Eclipse (4.4) 3.7.1.RELEASE` or current version. Clicking `Install` will take you to the 'Confirm Selected Features' dialog. (De-select the two optional Spring checkboxes on older versions). `Gradle IDE` and `org.gradle.toolingapi.feature` should both be selected. Accept any dialogs that popup. * After Gradle has been installed into eclipse and git has been installed, you should be able to clone the repo and import that project into eclipse -If using Intelllij: +If using Intellij: * Open Intellij and select `Import Project` -* Find the `build.gradle` file contained at the root of the project and select it +* Find the `settings.gradle.kts` file contained at the root of the project and select it * Accept the defaults diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 36ddc0040..000000000 --- a/build.gradle +++ /dev/null @@ -1,76 +0,0 @@ -/* - * **************************************************************************** - * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -allprojects { - group = 'com.spectralogic.ds3' - version = '3.4.0' -} - -subprojects { - apply plugin: 'maven' - apply plugin: 'java' - apply plugin: 'findbugs' - - sourceCompatibility = JavaVersion.VERSION_1_7 - repositories { - mavenCentral() - mavenLocal() - } - - dependencies { - compile 'org.slf4j:slf4j-api:1.7.22' - testCompile ('org.mockito:mockito-core:1.10.19') { - exclude group: 'org.hamcrest' - } - - testCompile 'junit:junit:4.12' - testCompile 'org.slf4j:slf4j-simple:1.7.22' - } -} - -task wrapper(type: Wrapper) { - gradleVersion = '3.3' -} - -project(':ds3-sdk') { - dependencies { - compile project(':ds3-utils') - } -} - -project(':ds3-metadata') { - dependencies { - compile project(':ds3-utils') - } -} - -project(':ds3-sdk-integration') { - dependencies { - compile project(':ds3-sdk') - compile project(':ds3-metadata') - } -} - -project(':ds3-sdk-samples') { - dependencies { - compile project(':ds3-sdk') - } -} - -project(':ds3-utils') { - dependencies { - compile project(':ds3-interfaces') - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..49c2d2e8c --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,19 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +tasks.wrapper { + // to upgrade the gradle wrapper, bump the version below and run ./gradlew wrapper twice + gradleVersion = "8.3" +} \ No newline at end of file diff --git a/ds3-sdk-samples/build.gradle b/buildSrc/build.gradle.kts similarity index 75% rename from ds3-sdk-samples/build.gradle rename to buildSrc/build.gradle.kts index e0b2a6709..9688570a2 100644 --- a/ds3-sdk-samples/build.gradle +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -13,10 +13,12 @@ * **************************************************************************** */ -apply plugin: 'application' - -mainClassName = 'com.spectralogic.ds3client.samples.PartialObjectGetExample' +plugins { + `kotlin-dsl` +} dependencies { - compile 'org.slf4j:slf4j-simple:1.7.22' + implementation(libs.kotlinJvmPlugin) + implementation(libs.owaspDepCheckPlugin) + implementation(libs.gradleVersionsPlugin) } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 000000000..7640721ad --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,19 @@ +/* + * **************************************************************************** + * Copyright 2023 Spectra Logic Corporation. All Rights Reserved. + * *************************************************************************** + */ + +rootProject.name = "buildSrc" + +dependencyResolutionManagement { + repositories { + mavenCentral() + gradlePluginPortal() + versionCatalogs { + create("libs") { + from(files("../libs.versions.toml")) + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/ds3-java-sdk-internal-convention.gradle.kts b/buildSrc/src/main/kotlin/ds3-java-sdk-internal-convention.gradle.kts new file mode 100644 index 000000000..33df6655c --- /dev/null +++ b/buildSrc/src/main/kotlin/ds3-java-sdk-internal-convention.gradle.kts @@ -0,0 +1,58 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `java` + `jacoco` + id("com.github.ben-manes.versions") +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } +} + +tasks.test { + useJUnitPlatform() +} + +tasks.jacocoTestReport { + dependsOn(tasks.test) // report depends on running tests first + reports { + html.required.set(true) + } +} + +tasks.test { + finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run +} + +// convenience task name for github tests +tasks.register("test8") { + dependsOn(tasks.test) +} + +tasks.register("test11") { + javaLauncher.set(javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(11)) + }) +} + +tasks.register("test17") { + javaLauncher.set(javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(17)) + }) +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/ds3-java-sdk-library-convention.gradle.kts b/buildSrc/src/main/kotlin/ds3-java-sdk-library-convention.gradle.kts new file mode 100644 index 000000000..4ab27883d --- /dev/null +++ b/buildSrc/src/main/kotlin/ds3-java-sdk-library-convention.gradle.kts @@ -0,0 +1,61 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + id("ds3-java-sdk-version") + id("ds3-java-sdk-internal-convention") + id("org.jetbrains.kotlin.jvm") + `java-library` + `maven-publish` + id("ds3-java-sdk-publishing-common-convention") + signing + id("org.owasp.dependencycheck") +} + +kotlin { + jvmToolchain { + (this as JavaToolchainSpec).apply { + languageVersion.set(JavaLanguageVersion.of("8")) + } + } +} + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + create("Project") { + from(components["java"]) + } + } +} + +signing { + setRequired({ + (extra["isReleaseVersion"] as Boolean) && gradle.taskGraph.hasTask("publishProjectPublicationToOSSRHRepository") + }) + useGpgCmd() + sign(publishing.publications["Project"]) +} + +dependencyCheck { + // fail the build if any vulnerable dependencies are identified (CVSS score > 0) + failBuildOnCVSS = 0f; + suppressionFile = "project_files/owasp/dependency-check-suppression.xml" + nvd.apiKey = System.getenv("NVD_API_KEY") +} diff --git a/buildSrc/src/main/kotlin/ds3-java-sdk-publishing-common-convention.gradle.kts b/buildSrc/src/main/kotlin/ds3-java-sdk-publishing-common-convention.gradle.kts new file mode 100644 index 000000000..161889575 --- /dev/null +++ b/buildSrc/src/main/kotlin/ds3-java-sdk-publishing-common-convention.gradle.kts @@ -0,0 +1,125 @@ +import org.gradle.api.publish.maven.MavenPublication + +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `maven-publish` + signing +} + +var mavenCentralPrepDir = rootProject.layout.buildDirectory.dir("deployment/central/") + +publishing { + repositories { + maven { + name = "internal" + val releasesRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-releases/" + val snapshotsRepoUrl = "https://artifacts.eng.sldomain.com/repository/spectra-snapshots/" + url = uri(if (extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl) + credentials { + username = extra.has("artifactsUsername").let { + if (it) extra.get("artifactsUsername") as String else null + } + password = extra.has("artifactsPassword").let { + if (it) extra.get("artifactsPassword") as String else null + } + } + } + maven { + name = "OSSRH" + url = uri(mavenCentralPrepDir) + } + } +} + +tasks.register("publishToInternalRepository") { + group = "publishing" + description = "Publishes all Maven publications to the internal Maven repository." + dependsOn(tasks.withType().matching { + it.repository == publishing.repositories["internal"] + }) +} + +var prepareMavenCentralPayload = tasks.register("prepareMavenCentralPayload") { + group = "publishing" + description = "Generate files for payload to submit to maven central." + dependsOn(tasks.withType().matching { + it.repository == publishing.repositories["OSSRH"] + }) + doLast { + // remove maven metadata, as it is only used in the local repository and + // not published to maven central + delete(fileTree(mavenCentralPrepDir) { + include("**/maven-metadata.xml*") + }) + } +} + +tasks.register("generateMavenCentralPayload") { + // see https://central.sonatype.org/publish/publish-portal-upload/ + group = "publishing" + description = "Create .tar.gz payload for submission to maven central." + archiveBaseName.set("ds3-java-sdk-maven-central") + archiveVersion.set("${version}") + archiveExtension.set("tar.gz") + compression = Compression.GZIP + from(mavenCentralPrepDir) { + include("**/*") + } + destinationDirectory.set(mavenCentralPrepDir.get().asFile.parentFile) + dependsOn(prepareMavenCentralPayload) +} + +tasks.clean { + delete(mavenCentralPrepDir.get().asFile.parentFile) +} + +val augmentPom = tasks.register("augmentPom") { + publishing.publications.filterIsInstance().forEach { pub -> + pub.pom { + name.set("${project.group}:${project.name}") + url.set("https://github.com/SpectraLogic/ds3_java_sdk") + description.set("${project.description}") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + name.set("Spectra Logic Developers") + email.set("developer@spectralogic.com") + organization.set("Spectra Logic") + organizationUrl.set("https://spectralogic.com/") + } + } + scm { + connection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git") + developerConnection.set("scm:git:https://github.com/SpectraLogic/ds3_java_sdk.git") + url.set("https://github.com/SpectraLogic/ds3_java_sdk") + } + } + } +} + +tasks.withType().configureEach { + dependsOn(augmentPom) +} + +tasks.withType().configureEach { + onlyIf("isReleaseVersion is set") { project.extra["isReleaseVersion"] as Boolean } +} diff --git a/buildSrc/src/main/kotlin/ds3-java-sdk-version.gradle.kts b/buildSrc/src/main/kotlin/ds3-java-sdk-version.gradle.kts new file mode 100644 index 000000000..fc6f9a0c9 --- /dev/null +++ b/buildSrc/src/main/kotlin/ds3-java-sdk-version.gradle.kts @@ -0,0 +1,22 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +val catalogs = extensions + .getByType() + +group = "com.spectralogic.ds3" +version = catalogs.named("libs").findVersion("ds3SdkVersion").get().requiredVersion + +extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT") \ No newline at end of file diff --git a/contract/3_4_1_contract.xml b/contract/3_4_1_contract.xml deleted file mode 100644 index 10fd02c10..000000000 --- a/contract/3_4_1_contract.xml +++ /dev/null @@ -1,17060 +0,0 @@ - - - - - com.spectralogic.s3.common.platform.notification.domain.payload.AzureTargetFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.Ds3TargetFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.GenericDaoNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.JobCompletedNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.JobCreatedNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.JobCreationFailedNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.PoolFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsCachedNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsLostNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsPersistedNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.S3TargetFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.StorageDomainFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.SystemFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.TapeFailureNotificationPayload - - - com.spectralogic.s3.common.platform.notification.domain.payload.TapePartitionFailureNotificationPayload - - - - - - - - - - - - - 204 - - - - - - 1.9D854BF00D3B516D4045D9DBEB4B174A - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 404 - - - - - - 1.A4F544C672FC8C11593427E560385533 - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 409 - - - - - - 1.B17329949B488995473FD573BF5A0507 - - - - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.013CF864155A896718908128F7C31E1E - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 409 - - - - - - 410 - - - - - - 411 - - - - - - 503 - - - - - - 1.5B99BA64EAFD43AEC9359E716A93B234 - - - - - - - - - 204 - - - - - - 403 - - - - - - 404 - - - - - - 409 - - - - - - 1.416E43D944A06C824AD8BF5005FA1DC3 - - - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.46B3A42F88F14FF8E433CEF3CED4C70E - - - - - - - - - - - - - 200 - - - - - - 1.773E50A74C3DC9EB87D6CD924CA1B34A - - - - - - - - - - - - - - 200 - - - - - - 1.3A8DB55ED9BC0A138E7E63E96E6EF55F - - - - - - - - - 200 - - - - - - 1.8D18E6B210A254D12ACD074CF265700F - - - - - - - - - - - - 200 - - - - - - 206 - - - - - - 307 - - - - - - 400 - - - - - - 503 - - - - - - 1.F50E6F8DEFB864FE89D9385A71A6C25A - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.5AB983AB4BABA77BCD64173290A741B4 - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.CF182CD57551902A475553F26582BC78 - - - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.871E6F61ED03FE40EECFD0AAD53AAA34 - - - - - - - - - - - - - - 200 - - - - - - 1.12220CAF96D6A1B3E1BC31330E95EA51 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.51D7750881DA0A4621487FFE61533D85 - - - - - - - - - - - - - 201 - - - - - - 403 - - - - - - 1.E368236F01A4B820CB381ABB9DC6A481 - - - - - - - - - - - - - 201 - - - - - - 403 - - - - - - 1.8926D009A5E919B034A8C12CC7BC6AA4 - - - - - - - - - - - - 201 - - - - - - 1.AB6BB38915AC1B434AA79A746AEC1CA9 - - - - - - - - - - - - 201 - - - - - - 1.090A514BE0B269138CD466668F79C773 - - - - - - - - - - - - 201 - - - - - - 1.1AF4C0F11AB88FCD30536164F07B3944 - - - - - - - - - - - - 201 - - - - - - 1.878704403C5B1CFAD98804ABD56AB840 - - - - - - - - - - - 201 - - - - - - 1.09B5FAE5CF69BF5E945E124D60852125 - - - - - - - - - - - 201 - - - - - - 1.D65ECD1D08D1272AD5E969F80235DFAC - - - - - - - - - 204 - - - - - - 403 - - - - - - 1.0500995E51CDDBCFFC70327F12F2428F - - - - - - - - - 204 - - - - - - 1.C6B44D720B8BC5FEC46CEDA4EA04CA5F - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.CE89262FB9070D85EAB1C361CB74D99D - - - - - - - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.D561CC0BB1BDF0FCD73E2AC1509393F7 - - - - - - - - - 200 - - - - - - 1.14A107B85D096EB8554EDB0A4A8589B9 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.8A4F25C489C1E3C970CAD13B9AD4754E - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 403 - - - - - - 409 - - - - - - 1.4751D97F3546F963C451CE9F9AE16C76 - - - - - - - - - - - 204 - - - - - - 403 - - - - - - 404 - - - - - - 409 - - - - - - 1.7E0B95E1E222BB82689E2AA8CD3FE344 - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.4FAD1C67C3247080EFA33C224B87544D - - - - - - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.8C885A22F5F8EA044A104A020AE563D5 - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.0EB0673D4EFC79596617FFE680876C1F - - - - - - - - - - - 204 - - - - - - 1.E697E63D8C13C0C06626E57BB95305CD - - - - - - - - - 200 - - - - - - 1.90CDE2CBD14856E5FDA2474704819E6B - - - - - - - - - - - - - - - 200 - - - - - - 1.581382F387E3FC77A09A11F14FEB312D - - - - - - - - - 200 - - - - - - 1.4E2A47F1477F1A5E5D4BA9166FD13700 - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 404 - - - - - - 409 - - - - - - 1.8D11714D318A13D76782B5A71471D887 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.00FF753915ABC8F954677D57253B3230 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.002A078CDCBEB6844EA00B0BBAC7CAC8 - - - - - - - - - - - - - - - 200 - - - - - - 1.B27EA3CC583291FFD676193DBAA4551C - - - - - - - - - 200 - - - - - - 1.8E0A2BF92DD79E7C634778C97619CDEF - - - - - - - - - - - 200 - - - - - - 1.1789113D83DC2E48D1B5D1C221DC1872 - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 409 - - - - - - 1.C554C793C965F9B60414FF9092DD6907 - - - - - - - - - - - - - - - - 201 - - - - - - 1.15D63B0FD0C4257041795BA2235277C5 - - - - - - - - - - - - - - - - 201 - - - - - - 409 - - - - - - 1.A1CF121219F77829C8480AC814898D87 - - - - - - - - - - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 1.74C5BC1D5C856DAC66A4AC9893FC4BB9 - - - - - - - - - - - - - - - - 201 - - - - - - 1.B6E603A64C60859EEA83B2E687FB55AB - - - - - - - - - - - - - - - - - 201 - - - - - - 1.CC4C9ED25B1509ABD0F30B375ABA4D78 - - - - - - - - - 204 - - - - - - 1.377DC47D5802F8BBB59CC5D011268847 - - - - - - - - - 204 - - - - - - 1.E3B3238A4639A19B8507203907EA2D52 - - - - - - - - - 204 - - - - - - 1.5C597451975C08FCCE2F0647EDD16872 - - - - - - - - - 204 - - - - - - 1.D032BD8264B23E052A900CD171273D84 - - - - - - - - - 204 - - - - - - 1.779978550E2AC7519DBEE1B6418D7FA1 - - - - - - - - - 200 - - - - - - 1.BD89C8ADCBAC5C96569ABC8DE7D841D9 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.760344CC17CCA3AAC0D1AEAAB22664BE - - - - - - - - - 200 - - - - - - 1.7FE0018AE76D9D24DADF93BC83A73EF2 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.9A7A0BABDD6E7CC2D134B62D158E6C57 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.8C6D05D23CDCAFBC0344FE0C91513C32 - - - - - - - - - 200 - - - - - - 1.40C486BA0D58B76E2C253E81EB297D0E - - - - - - - - - 200 - - - - - - 1.18B2E9524D43E524BBB9C54ECA35E5F3 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.87B1B5789ECD05E15FC0C8BFED48E73E - - - - - - - - - 200 - - - - - - 1.B23CBBE34EDFFE1E8FBF444E4E0EA0ED - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.F85D09C772C76D466ECDE210ABD0F6E2 - - - - - - - - - - - - - 200 - - - - - - 1.D90C5C1EF5D3968AE776DED4DD4B41CA - - - - - - - - - - - - - 200 - - - - - - 409 - - - - - - 1.4C6316BC92D7D1285A6565E212E6999E - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 500 - - - - - - 1.BA76BEF97888F20DAAB5ABAF89492E6F - - - - - - - - - - - - - 200 - - - - - - 1.B024C098E863E2B1C9275B0EBFBA3BF6 - - - - - - - - - - - - - - 200 - - - - - - 1.E7A5FD996704C81CD95CC171BA42549E - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 409 - - - - - - 1.F51C99474F629A2CFD5CDB6BC5CB7C6D - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 409 - - - - - - 1.FB9358D923F09B224C1272BD9B459121 - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 409 - - - - - - 1.B030FA7F19336B7B8C64BAF6E6F6346B - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 409 - - - - - - 1.FCF1BFADC9D4DE1CF114901B69B22280 - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 409 - - - - - - 1.3970B4F7B6EEDF3D16C14B1FE8D74EA5 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.FCDDCC0EE93BE92A31D4BD84C9DD57C7 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.39020D24E8F55C01FF5ECC4524C78189 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.823E96C86A899E615759E3AADB7355E0 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.C8788BC1989E0E16F93945C2F157893B - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.0D4C916F64F122E94EEB6674D7B9F4D1 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.620EF529E4CD2E0912AE9F42E2B802C0 - - - - - - - - - - - - - - - - 200 - - - - - - 1.2F15899DE5E70055E0490AD29530C842 - - - - - - - - - - - - - - - - 200 - - - - - - 1.DE22EC0929BAB9F743BFC38EAB10D680 - - - - - - - - - - - - - - - - 200 - - - - - - 1.905EEF6FC284DC0AC05F8F1B347829C0 - - - - - - - - - - - - - - - - 200 - - - - - - 1.BEECB5756E585359144D71D4410D4846 - - - - - - - - - - - - - - - - 200 - - - - - - 1.B8E477B5613F3E518F79082D5552E7AC - - - - - - - - - - - - - - - - - 200 - - - - - - 1.1480092553E000D0103C80E1BC65B2C5 - - - - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.B32DA5E8C42BDE53830D288C86582A9B - - - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.8FB599E4270D6BDE67B81DDEAACACAC8 - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.1B32364BA03FED4EBBD9BEF15A49EFB1 - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.F1B9C4424263D106712B36B7809F8EFC - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.782935F97E84EF7CAABC357C5CEE2271 - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.F4A8A78DF6670ECDAB83A83A18D1547D - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.2C0E9739F7F0BF5B9C16B620D3C195EB - - - - - - - - - - - - 201 - - - - - - 403 - - - - - - 409 - - - - - - 1.8611905E16872C3EEFC979239C47CFFE - - - - - - - - - - - 201 - - - - - - 1.D6C48865C0991834DDDE193AB40E04EA - - - - - - - - - - - - 201 - - - - - - 403 - - - - - - 1.5A1DF310850382BEEFC771A9C1DECC3D - - - - - - - - - 204 - - - - - - 403 - - - - - - 1.33DEA650BE9ABCDCDF53E462D402DAFE - - - - - - - - - 204 - - - - - - 403 - - - - - - 1.E434ED8B2A34F104A95442717B1A4BA7 - - - - - - - - - 200 - - - - - - 1.25BA53F39517497CBFEC02F6F1A1281D - - - - - - - - - - - - - - - - - 200 - - - - - - 1.02D9D53D22A0F5B6893643EE40ADB324 - - - - - - - - - 200 - - - - - - 1.ABED6B8929079AC01A596C9E4C08CBF8 - - - - - - - - - - - - - - - - 200 - - - - - - 1.CA6D598467AAD4083472C11E72F28A8A - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 1.03E8ABF4920FE0C59B424EEDB8001FAB - - - - - - - - - - - - - 200 - - - - - - 204 - - - - - - 403 - - - - - - 1.3289F9FD0E9ACCD50787DB1A0055712D - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 404 - - - - - - 1.4DB23DDC56235578526ECD74A1E1D151 - - - - - - - - - - - 204 - - - - - - 1.278BB8E0110D66EDACF595107C09427A - - - - - - - - - - - - - - 204 - - - - - - 1.5787086FAAD0AEFD6965BE9007AEF32F - - - - - - - - - - - - - - 204 - - - - - - 1.F66A4CBE1684496D395E5546FEB8C8B8 - - - - - - - - - - - 204 - - - - - - 1.EDC1DDE6748591464113649924079D39 - - - - - - - - - 204 - - - - - - 1.5A6D3D3A60E77AC626275AF623C4C766 - - - - - - - - - 204 - - - - - - 1.C079F9483A04E55B04DBB93A82435427 - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 404 - - - - - - 500 - - - - - - 12.7853EE12A10929010211D370E4E9FCB8 - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 13.33017D3F34393D367E5E63FB7F1DEB3E - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 404 - - - - - - 1.1AA08A21610BD902ED2A0BFDBB145B9C - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.5F29580D0FA9D13D4F31F6FA1479253C - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.BE9B123D699A33A084C657EDA216FD46 - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.366B50C862A74986AFC2A1FD9AFA0DC8 - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.2CB8F6FD0FD4AAB2DBFDA3B66906F811 - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.82806C1E451AD1325DD45123292E6360 - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.AF1AD1BB3EE186EBC9E967F37EF47B63 - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.81935DED0B11C2F6579420B1D503F846 - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.96AA26481EDB1492BF1A4696FB4A5E90 - - - - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 409 - - - - - - 410 - - - - - - 12.E85F3447509D8658DC4747BDBC1124AE - - - - - - - - - 200 - - - - - - 12.D2E1E5F53C787AAE87CD6C64E57DF392 - - - - - - - - - - - 200 - - - - - - 1.5441D6DB77E32465283AFFCD70BF0BD9 - - - - - - - - - - - - 200 - - - - - - 1.A91ACBDE9427D4617DBA938B01FD4A65 - - - - - - - - - - - - - 200 - - - - - - 1.46852EDC36DDDB68792432241EBAB228 - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 1.8DD6A5CAEBA22CCE74B380322FB5EDD6 - - - - - - - - - - - - - - 200 - - - - - - 204 - - - - - - 1.6F544A6CED02468AF923384632138561 - - - - - - - - - 204 - - - - - - 1.A1093E63522E0D37459A3DD2ED4BA382 - - - - - - - - - - - - 204 - - - - - - 1.381372DCEE1323BA3EC6135F28BD40E7 - - - - - - - - - - - - 204 - - - - - - 411 - - - - - - 1.B66BD19B24CA38C77915186CAC7278FB - - - - - - - - - 204 - - - - - - 403 - - - - - - 1.61F4F2C6BB6C6B6682D36487830BB9DC - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 402 - - - - - - 1.5A3E7F31249938D514C56E364FC6D02F - - - - - - - - - 200 - - - - - - 1.6DAEDCFBF2E71F76371CDB2DE03FB216 - - - - - - - - - - - - - - 200 - - - - - - 1.4EB20E46D4C9A9D1A9C832A10416B269 - - - - - - - - - - - - 200 - - - - - - 1.D6574E9F317A632E897CC1497A014EE7 - - - - - - - - - - - - - - - 201 - - - - - - 1.2963DE5A15B7A94AE018A555B04855E3 - - - - - - - - - - - - - - - 201 - - - - - - 1.BA2D594EAC2171E3CD66A1E4B261C157 - - - - - - - - - - - - - - - - 201 - - - - - - 403 - - - - - - 1.F6F99FB1D96FAAB52761A4A6F9C007F4 - - - - - - - - - - - - - - - 201 - - - - - - 1.4493BC861FFB54D0474875CDA923917F - - - - - - - - - - - - - - - 201 - - - - - - 1.BCDE69D118A54DB3850A7A1DCB9044A5 - - - - - - - - - - - - - - - - 201 - - - - - - 1.B9B14FD95B7365854A4873C9E03CF714 - - - - - - - - - - - - - - - 201 - - - - - - 1.CB59926ABCCE409B8DA620D7098051EF - - - - - - - - - - - - - - - - 201 - - - - - - 1.8A412C738BCEA2E768EEE5AFA91A02E3 - - - - - - - - - - - - - - - 201 - - - - - - 1.F58DEB2156F89FEFF73AA296FB996076 - - - - - - - - - - - - - - - 201 - - - - - - 1.6D9C05CCD6FC973CEC7EC06B2852C004 - - - - - - - - - - - - - - - 201 - - - - - - 1.D2F89CEFD1D076C722E383CD47F54B0E - - - - - - - - - - - - - - - 201 - - - - - - 1.C3E90840E58C0ED58DE5285F1C629007 - - - - - - - - - - - - - - - 201 - - - - - - 1.697EEA5D819D1CCED8356F3707A80CC0 - - - - - - - - - - - - - - - 201 - - - - - - 1.F8EE6F2C578B71C30A5818323B8C63DD - - - - - - - - - 204 - - - - - - 1.CEC966DCE333C324697D8D2C014D5844 - - - - - - - - - 204 - - - - - - 1.F75FB6B03E5778971F18B3E156F1C368 - - - - - - - - - 204 - - - - - - 1.FB37D5236F8B9FAA3C23E1E1ED75EF7B - - - - - - - - - 204 - - - - - - 1.BF2D067D7C365D5CD381837F5376FBCC - - - - - - - - - 204 - - - - - - 1.1DCB7A5A19D0073AB4C529DE68EFF590 - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.AE62860962CCA944FDE6BA7A1FA29BE8 - - - - - - - - - 204 - - - - - - 1.74228C20E21299810A61BDC1D72981CB - - - - - - - - - 204 - - - - - - 1.5A5F6DB8F16E8BA2850BBC9786BF933A - - - - - - - - - 204 - - - - - - 1.9B0188827522EB7EEF626D5957F16EF7 - - - - - - - - - 204 - - - - - - 1.057E27FF0C7515839363635ABD87011B - - - - - - - - - 204 - - - - - - 1.815B2098111720A02816432FD0B11263 - - - - - - - - - 204 - - - - - - 1.F17A1AE113B6FD07741496A307004005 - - - - - - - - - 204 - - - - - - 1.3FD065CF09A9346481021BC207729FC8 - - - - - - - - - 204 - - - - - - 403 - - - - - - 1.67E8651E0A9719E5AA68ED2783076E40 - - - - - - - - - 200 - - - - - - 1.E7E2388B6F0182AA8B191836FDC2EF46 - - - - - - - - - - - - - - - 200 - - - - - - 1.0B3D7131A8DE08F23DD8F92E4FB445CE - - - - - - - - - 200 - - - - - - 1.E016A3B10B9E2BCFBDC052B607BEF218 - - - - - - - - - - - - - - - 200 - - - - - - 1.405BE0983E37E87E48E0D549DFFD22CD - - - - - - - - - 200 - - - - - - 1.D55B0B0605B4BF3AE32149CAD90110CE - - - - - - - - - - - - - - - 200 - - - - - - 1.89699929828B8EC5AE4F1F41003A1293 - - - - - - - - - 200 - - - - - - 1.02BC732C912E22F368101E336487D192 - - - - - - - - - - - - - - - 200 - - - - - - 1.58AA7409654D5D50B6B8F55539C0774B - - - - - - - - - 200 - - - - - - 1.6B1CA505E2302A04F63AA27099F0FCFF - - - - - - - - - - - - - - - 200 - - - - - - 1.96BE833135E4A5C8F7DE52803D85CCA1 - - - - - - - - - 200 - - - - - - 1.3FB901D98106C97ED02FBD2FCB72A368 - - - - - - - - - - - - - - - 200 - - - - - - 1.06D8300D0336BED673A20EF70C44CCCF - - - - - - - - - 200 - - - - - - 1.C9293362A29ABB99EA2382C6B71D0649 - - - - - - - - - - - - - - - 200 - - - - - - 1.351B871DFA1717273590632B38A4EBC7 - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.6DFABCE265B2455CBE17C12CF01CDDD2 - - - - - - - - - - - - - - - 200 - - - - - - 1.C4D2CFB128128AFB2C46656E3EE693BB - - - - - - - - - 200 - - - - - - 1.9222B04244CF97705F3488EE7906FC41 - - - - - - - - - - - - - - - 200 - - - - - - 1.AA0AD23B2F046B29AA8947581FDFB860 - - - - - - - - - 200 - - - - - - 1.D74722063AC27B6ECB815A78C0E790C5 - - - - - - - - - - - - - - - 200 - - - - - - 1.E5ACD5AF9B1F02DDDF00504737297CFD - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.8E55D6D6105C140A17D3438C4F4D8D54 - - - - - - - - - - - - - - - 200 - - - - - - 1.86F306440C4799F14DD5F4C0719E507C - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.301D82C48DB6624F74A9A6BD309A9E40 - - - - - - - - - - - - - - - 200 - - - - - - 1.098207A6680442B3FA9643BB23CB370E - - - - - - - - - 200 - - - - - - 1.0EC16E3818F17C785ABB022A34A7A083 - - - - - - - - - - - - - - - 200 - - - - - - 1.F1ED654859180EBA33AD4697444A2636 - - - - - - - - - 200 - - - - - - 1.84A39C5D428089EF64F5DB0558FA2C45 - - - - - - - - - - - - - - - 200 - - - - - - 1.4C47E15164EB0479D97A05D6AF22162F - - - - - - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.BEEFBBCACF4A979C567F1D144C04067C - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.51440FCFF3ADF3834C5500FF554FFBE2 - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.70D55191E13B0C77A5FF57DA126E0849 - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 403 - - - - - - 1.F5177563B1D7F1A4A055D706B82C6734 - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.B8DE45F9011916BD826DFA339DD3646B - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.8677D16DE53C2800647C7DB609C6EE44 - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.67D1B7BB3E64E9C05C62F59054DF73DE - - - - - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.867574E65E9156E31D51517D17DDE283 - - - - - - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.833E8B67365C5B36D6B3E2C048660EEB - - - - - - - - - - - 204 - - - - - - 1.E7BF64005D511F7DF092A1FD63CAFDB2 - - - - - - - - - - - 200 - - - - - - 1.6DA60D3A441DEB83245CF9390DB652C2 - - - - - - - - - - - 204 - - - - - - 1.FCB7A1CCECDBFE60B9F9268A4DA13E64 - - - - - - - - - - - 200 - - - - - - 1.5EDB52181C6563D67BB04B9F6F9FFCB3 - - - - - - - - - - - - - 204 - - - - - - 1.602C9239FB1B18A48D8E6AB920F9865E - - - - - - - - - - - - - 200 - - - - - - 1.613F01620D33F44F7F08DAD27477860D - - - - - - - - - - - - 201 - - - - - - 1.B3F196534F6B3239F608E60F46CC5054 - - - - - - - - - - - 204 - - - - - - 1.9395090644FD6A9EEDE620F2EDB2659C - - - - - - - - - 204 - - - - - - 1.51360490B8BC0FEA841584D3A7941DA9 - - - - - - - - - 204 - - - - - - 1.21D484F75EB67BB6E52299CFE9026E8C - - - - - - - - - 204 - - - - - - 1.B470C7165F3CC8ED799ED4F8B5BAEA45 - - - - - - - - - 204 - - - - - - 1.C56316687F31CD493F7064FD951EC99C - - - - - - - - - - - 204 - - - - - - 1.79EEE017A84D0C323D68CA23A8CB1076 - - - - - - - - - - - 200 - - - - - - 1.A4AFD3D5DA908492647C739E941CC97C - - - - - - - - - - - 200 - - - - - - 1.EF17F568146C914F8023380045758F9C - - - - - - - - - - - - - - - - - 200 - - - - - - 1.3D539F4D333D3240C489C26EC0A011EF - - - - - - - - - 200 - - - - - - 1.B0E4F8E2EF4C7507621D37BF97395F31 - - - - - - - - - - - - - - - - 200 - - - - - - 1.A426A6A86571D4DB76768FBF9E3540DF - - - - - - - - - 200 - - - - - - 1.BB0DDF53B3466065E0CC36A0EDFF2834 - - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.965E74D83E54746B6877B79D92E8768A - - - - - - - - - - - - - - - - - - - 204 - - - - - - 1.C21A692F9E87799AB2806A96B545C0C6 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.6B887FD15AF647C5F0ED993C439A0EE0 - - - - - - - - - - - 204 - - - - - - 409 - - - - - - 1.28359B909678D42A4868FB82F28934BB - - - - - - - - - - - 200 - - - - - - 1.486CB0412BAD44C82290FBD64DEC1F6D - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 404 - - - - - - 1.C2B1E38A255F67B820C6DB2C5A021FC5 - - - - - - - - - - - - - 204 - - - - - - 1.AA7061BA6F294ACDB2FA2282E0742BCC - - - - - - - - - - - - - 200 - - - - - - 1.A5E2220D36BE184AE56CCD3CFC42D0AE - - - - - - - - - - - 204 - - - - - - 1.F6BC5F562CC7CDDF11632321B21D97DF - - - - - - - - - - - - - - 201 - - - - - - 1.97CAA19C72182CEF847821F9E6FB3AAA - - - - - - - - - - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 409 - - - - - - 1.3B8F9F9CA8F1879985BF29BF5CBD21E6 - - - - - - - - - - - - - - - 201 - - - - - - 1.019396D4D4686224FF7C3CB6D1E0C0FF - - - - - - - - - 204 - - - - - - 1.56E9BDA78930F90CD41C280B94F3EC92 - - - - - - - - - 204 - - - - - - 1.A7B51CF0108CAE7FF2ED2ECFEEF990D9 - - - - - - - - - 204 - - - - - - 1.02F4797EB106FFD0157EC4EAB8FBB3BC - - - - - - - - - - - - - - - - - 200 - - - - - - 1.6D17F999F7BD299E10604D67FB269746 - - - - - - - - - 200 - - - - - - 1.FC523C8224CB7FBABCF213D5D951CB18 - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.0647B93684A5AF9B4EF9AAFC7148E0C7 - - - - - - - - - 200 - - - - - - 1.04BA526681D926E6F55834C3FF14C800 - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.C7CE8CF71088F3DB585CD3B02AD6C01E - - - - - - - - - - - 200 - - - - - - 1.C784129AA41D66504348A3879B18409C - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 409 - - - - - - 1.B3C891ADBE07985D8EB07F47AD5B9DA9 - - - - - - - - - 204 - - - - - - 1.574C8D1B7983E679131E37FD5C3DF1B3 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.75E4BA966FFC501D192F53E91B7DA97C - - - - - - - - - - - - - - - - 200 - - - - - - 1.CB9A35E0D20D8F23F42BE689119E06FA - - - - - - - - - 200 - - - - - - 1.D7B16FCF4CB54A4DDD0B7B96965B0C89 - - - - - - - - - 200 - - - - - - 1.6C78CB68979C1B30B65792A51C4909B4 - - - - - - - - - 200 - - - - - - 503 - - - - - - 1.1425C7EF3EB1C555EEDB3A7B83959C18 - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.6C71667DFCE4EFE9D2D594675F5D0548 - - - - - - - - - - - 200 - - - - - - 1.3FA058A0E73CD716458E4AD473D01D8E - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.7A7A1F423942BCD065A53F5E2C08CA10 - - - - - - - - - - - 200 - - - - - - 1.686D026F4E37237A3FB0CFDDADBC9F8A - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.285B3B8B3249390AC0EA62095620648D - - - - - - - - - - - 200 - - - - - - 1.483EDC95D9050419855BB2C9B7D9395A - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.57134A2893313DE704198EED54D5B6E6 - - - - - - - - - - - 200 - - - - - - 1.9193C0F29388C5B9B6583A6BF6C2B347 - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.424FC52414BFE0A49B6746D5DB1256AB - - - - - - - - - - - 200 - - - - - - 1.13C8280BFD2D49B31E703A6C942A14BB - - - - - - - - - - - 200 - - - - - - 1.2ED8A733A34F7268A165FCB3C4DE0232 - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 409 - - - - - - 1.BCD510DF25513B8FAF0352336F094053 - - - - - - - - - 204 - - - - - - 1.D24D24F09DCA78579C08ADE1D5528A18 - - - - - - - - - 204 - - - - - - 1.388A14B11DC4161D76E7BA3524CED336 - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.E8ECE9BA39F0B03F8394B4AB5065B60D - - - - - - - - - 204 - - - - - - 1.67C819CC3E37319CB3D533A2D31F00D7 - - - - - - - - - 204 - - - - - - 1.7A9D46F2B10E01B201BD25BF3DA3E3D6 - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.466E11BA31409FC6549BB27A0C1400CC - - - - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.5458586BDBC05CE6DC7B96FB305E279E - - - - - - - - - - - - - - - - - 204 - - - - - - 400 - - - - - - 1.D07A22B79C602A5E8C570C5E049FD7AB - - - - - - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.0AE60BB682E75CC3CB3CE074995267EF - - - - - - - - - - - - - - 200 - - - - - - 1.EF0CC59153D7673ED206E0F310880A6E - - - - - - - - - 204 - - - - - - 1.D946E977B16DE185BC7065F3C36BBA94 - - - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.6758EF1C334FA94EC51F836A229DFFCA - - - - - - - - - - - - - 200 - - - - - - 1.D96F1DC7CD390C447BBA6A55F52476AC - - - - - - - - - - - 200 - - - - - - 1.74729E8767FC62D9F49C309DA2993DE6 - - - - - - - - - 200 - - - - - - 1.D9690323F9BD00A1D7AC14D449C5C5F5 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.2BDEFEC679C5FBAF0D8D2934FE55F708 - - - - - - - - - 200 - - - - - - 404 - - - - - - 1.2ADB64C9DC3241D0FFE93910210E1FF9 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.12337E3CF98F2E0E44AEB002441C4918 - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.F0DCE0BD19F895084F3C461358ABB31B - - - - - - - - - - - - - - - - - 200 - - - - - - 1.362B98FD68A372E063F679FC32F89B31 - - - - - - - - - 200 - - - - - - 1.CB7932D0E8A306C5A2E35C8916C0E4B4 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.E62DED290400027E754EB45DBAC5062D - - - - - - - - - 200 - - - - - - 1.DBBD22390D6F477450A6966FDA2CA298 - - - - - - - - - - - 200 - - - - - - 1.FED65C1D6BB97C21B4F9DA0B7A997D35 - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.44F69227AF5D5C013E4E8870692550C7 - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.6B2469AA8D0FC2655F6EB394348EB437 - - - - - - - - - 200 - - - - - - 1.A0A9BFEABE8E3C638E51660CF67D0B3C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.4614C67BE4C4B0B22F40F86B47B40D2D - - - - - - - - - - - - - - - - - - - 204 - - - - - - 1.D86253165E5E58A4859699AF6C04C146 - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.DB420EA069BBE1730C24DC9EDA476595 - - - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.31CBB28C0277768C8BF04A6CF1BA98A5 - - - - - - - - - - - - - 200 - - - - - - 1.E6B45FD1B7595DCC123636DD01E50D8A - - - - - - - - - - - 204 - - - - - - 409 - - - - - - 1.AD707ECC69A1E835FADE9B7B896C7C53 - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.304855C6B7C0744B1F4E23991BD4CF83 - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.94A9B934CC18AB22E125F70FBB9F82DE - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.038E34A9C374FC176986FC568A165527 - - - - - - - - - - - 200 - - - - - - 1.CA5A1C1C65E431A37F3207B81767774B - - - - - - - - - - - - - - 204 - - - - - - 1.6E171A954319F5E7A916A6A47BB1BB39 - - - - - - - - - - - - - - 200 - - - - - - 1.55C29670AA54CE2E07EA9C9D31E82EAC - - - - - - - - - - - - - 204 - - - - - - 207 - - - - - - 1.A6D31BBFAFCCC9A55B9FEBF72E1C2953 - - - - - - - - - - - - - 200 - - - - - - 1.32E4082ED243CB134EA743FF78000BD5 - - - - - - - - - 204 - - - - - - 1.38E575DC2AF4B7D7CF3203E6B7BDA74D - - - - - - - - - - - - - 201 - - - - - - 1.220648A0923367BC4FA2794FA4BE4591 - - - - - - - - - - - - - 201 - - - - - - 1.38448C20E04942C66F6D9AB3169CEF09 - - - - - - - - - 204 - - - - - - 1.B7BB4C29193AC92DB35E9E206A01E30D - - - - - - - - - 204 - - - - - - 1.4D5F15EE9801D7E3BE0892FD38AFDE0D - - - - - - - - - 204 - - - - - - 1.E062F9FB6D3FA8A9EEE31C6A81CC6604 - - - - - - - - - 204 - - - - - - 1.78F8ED04EC79A126AEADE8C08B0E4F97 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.958F111DBDA1BCE46EFBC10511A145E9 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.1E72B20786B3BFB6DE896C380864C4ED - - - - - - - - - 200 - - - - - - 1.A62A0E7E1808EED079989D04772B6CB6 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.65E7DE349575885F8EC2E78FFBBD3484 - - - - - - - - - 200 - - - - - - 1.17A61EEDF79D76747BE37B3DA3F698DF - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.F0EE6E4715A3D2CFB1F5795EA52EF0A1 - - - - - - - - - - - 200 - - - - - - 1.59DE4FDFB535F952488C8C76082D1957 - - - - - - - - - - - - - - - - - 204 - - - - - - 1.E8DD94F2A92ABC73D6632A48722BDF66 - - - - - - - - - - - 204 - - - - - - 409 - - - - - - 1.83B487198471CDEAF5C95D371BE1227E - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 409 - - - - - - 1.B13DC16C4369B842DD1580DFC9A23E90 - - - - - - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 1.D9B3DB52DF8218B45D48BECB5131915E - - - - - - - - - - - - - 200 - - - - - - 1.CF52BFFDF3E12D43EFD5F614833B7DCE - - - - - - - - - - - - - 201 - - - - - - 1.FF43777C8C33E41102BCF3F2A2A90C64 - - - - - - - - - 204 - - - - - - 1.7B3676D45CECCC1D12D71EBA722FFF30 - - - - - - - - - 204 - - - - - - 1.71B0E6E68AA99863BE55E1D6D037301B - - - - - - - - - 204 - - - - - - 1.9F2F0F9EE78721BF80AD83701F9736A0 - - - - - - - - - - - 200 - - - - - - 1.680A6E46ADDF391752A3A89F95D73448 - - - - - - - - - 200 - - - - - - 1.496A9334045EC97BFFE3A5116694FF85 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.BC1C6F682219387D81896AD542BFDA1B - - - - - - - - - 200 - - - - - - 1.21E756DE8577C5778B49EB14777DE712 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.9066576F0656AE6BA8E13A019F6A59AB - - - - - - - - - 200 - - - - - - 1.444CF76C0D4A6C4E637033A4D4E9126A - - - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.3BFB533872841D46A011D369D3FF2977 - - - - - - - - - - - 204 - - - - - - 409 - - - - - - 1.3426C46B6878DDEC0DA8DA6A0D5554AA - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.068DA432A58C3D7331CA5C906158F229 - - - - - - - - - - - - - - - - - - - - - - - - 204 - - - - - - 1.B316331E65CCB79F118C8A178C4D1112 - - - - - - - - - - - - - - - - - - - - - - - 201 - - - - - - 1.27B9DEC971AF1E0443505F6381B2C647 - - - - - - - - - - - - - 200 - - - - - - 1.F528AE4144225E113F7B00825EE52AA2 - - - - - - - - - - - - - 201 - - - - - - 1.8D68C314C554FFCC800097F48EA2B2BF - - - - - - - - - - - - - 201 - - - - - - 1.B29CE6CAE05044347C6F6D2CD82D2B76 - - - - - - - - - 204 - - - - - - 1.0EDA4B68A5E0A7A119DF093167A9643B - - - - - - - - - 204 - - - - - - 1.25F94118327D5D07CF4BD4214EE33EC0 - - - - - - - - - 204 - - - - - - 1.AD3D66C9BD4CFDABA55559C35CECD9E1 - - - - - - - - - 204 - - - - - - 1.E336292FC529AF487A9AD66216D49654 - - - - - - - - - - - 200 - - - - - - 1.673FA4C32058D8D329E1630ADA8E73C1 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.B74A7AA44043A326AC2D7D7934967B14 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.75F9BD52CF2A252C3696A912624AF4E7 - - - - - - - - - 200 - - - - - - 1.1568E0AA2E38BC533DF1D9A3C26D9A80 - - - - - - - - - - - - - - - - - 200 - - - - - - 1.DA7E3AB4DC966A21CCA466E87760769B - - - - - - - - - 200 - - - - - - 1.AF491ABBC242A023D510DB3FEFC8D333 - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 1.D0BF3B5963590A886B4DECEFF9D5DA2C - - - - - - - - - - - - - - - - - 204 - - - - - - 1.F09CDCAD633DBE0BD4D81B4ACD40F402 - - - - - - - - - - - 204 - - - - - - 409 - - - - - - 1.4F8C9F278402E6FB2E4EA057B834CC73 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 409 - - - - - - 1.251760D30B95DDFD686CF5F8DD244B34 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 1.0FC6240C9AA47CA11A06C45AF5EED527 - - - - - - - - - - - - - 200 - - - - - - 1.AA72044B9C3357E0774AADA4EF555CC6 - - - - - - - - - - - - - - 201 - - - - - - 409 - - - - - - 500 - - - - - - 1.6BCFED905208FF2C3021E49E1113053C - - - - - - - - - 204 - - - - - - 500 - - - - - - 1.E7E6381C3DCFF65F04EFF2E13C486B02 - - - - - - - - - 200 - - - - - - 403 - - - - - - 404 - - - - - - 1.BCF75A4FA6D197563529575007325A9D - - - - - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 410 - - - - - - 1.4D283CDE0658BDE321C6C7B4CFB00DB5 - - - - - - - - - - - - - 200 - - - - - - 400 - - - - - - 1.6D32416F86CAE6372CEE63F13A13B4CE - - - - - - - - - - - 200 - - - - - - 403 - - - - - - 1.E49AE7C4E4606611A2264F17092383DE - - - - - - - - - - - 200 - - - - - - 1.AF255C11E7836E705C16FB2E0C5C5893 - - - - - - - - - - - - - - - - 201 - - - - - - 1.EDD41D719CF5C94BEBC543ED4E1FA92B - - - - - - - - - 204 - - - - - - 1.87C46F7702591A04073B685E3DCA18E8 - - - - - - - - - 200 - - - - - - 1.DF34657F1F638BF55CCB59D8766A7A40 - - - - - - - - - - - - - - - 200 - - - - - - 1.227468E94768C87DC18B9D82AE1DD73A - - - - - - - - - - - - - - - 201 - - - - - - 1.A11EBAEA1FB195A00CA8C77DAA86896E - - - - - - - - - - - 201 - - - - - - 1.ED42C99A3F7707AE33EA46D9155ACF67 - - - - - - - - - 204 - - - - - - 1.CB843F4F8FA5F1FD7A435EF77E9AB382 - - - - - - - - - 200 - - - - - - 1.55C741CC9A0D6215D57FB954E57DBF9E - - - - - - - - - 200 - - - - - - 1.A37E5119D3567CC0420518DD48F43AC6 - - - - - - - - - - - 204 - - - - - - 1.14B1920F8A49D1721022BDA3054DF8EB - - - - - - - - - 201 - - - - - - 1.BB98871AF82585B0C646B6954309CBC3 - - - - - - - - - - - - - - - 201 - - - - - - 400 - - - - - - 403 - - - - - - 1.6D706AB11308B480CF5A83510CFA437B - - - - - - - - - 204 - - - - - - 404 - - - - - - 1.EA981FC342B0BC7143D8A6B5C650CBA3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/contract/5_8_x_3150467_contract.xml b/contract/5_8_x_3150467_contract.xml new file mode 100644 index 000000000..5a18a9238 --- /dev/null +++ b/contract/5_8_x_3150467_contract.xml @@ -0,0 +1,19249 @@ + + + + com.spectralogic.s3.common.platform.notification.domain.payload.AzureTargetFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.BucketChangesNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.Ds3TargetFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.GenericDaoNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.JobCompletedNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.JobCreatedNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.JobCreationFailedNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.PoolFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsCachedNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsLostNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.S3ObjectsPersistedNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.S3TargetFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.StorageDomainFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.SystemFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.TapeFailureNotificationPayload + com.spectralogic.s3.common.platform.notification.domain.payload.TapePartitionFailureNotificationPayload + + + + + + + + + + + + 204 + + + + + + 1.9D854BF00D3B516D4045D9DBEB4B174A + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 404 + + + + + + 1.F3A87D9C7810A8FFFB44D111A3C392D2 + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 1.A4F544C672FC8C11593427E560385533 + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 409 + + + + + + 1.B17329949B488995473FD573BF5A0507 + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.013CF864155A896718908128F7C31E1E + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 409 + + + + + + 410 + + + + + + 411 + + + + + + 503 + + + + + + 1.5B99BA64EAFD43AEC9359E716A93B234 + + + + + + + + + + 204 + + + + + + 403 + + + + + + 404 + + + + + + 409 + + + + + + 1.416E43D944A06C824AD8BF5005FA1DC3 + + + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.2ADEBFA66BD7C8629539A7399BD3A755 + + + + + + + + + + + + 200 + + + + + + 1.3303E206BA09EA57A94B52B6205C4782 + + + + + + + + + + + + + + + + 200 + + + + + + 1.032AD615FE7006F89222B5D50F080D6A + + + + + + + + + + 200 + + + + + + 1.8D18E6B210A254D12ACD074CF265700F + + + + + + + + + + + + + + + 200 + + + + + + 206 + + + + + + 307 + + + + + + 400 + + + + + + 404 + + + + + + 1.96E158735C2EC75B428EB1DFF0DC121E + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.5AB983AB4BABA77BCD64173290A741B4 + + + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.BD093F5535B89F8338AE7E066E9BBFE2 + + + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.871E6F61ED03FE40EECFD0AAD53AAA34 + + + + + + + + + + + + + + + 200 + + + + + + 1.12220CAF96D6A1B3E1BC31330E95EA51 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.51D7750881DA0A4621487FFE61533D85 + + + + + + + + + + + + + + 201 + + + + + + 403 + + + + + + 1.E368236F01A4B820CB381ABB9DC6A481 + + + + + + + + + + + + + + 201 + + + + + + 403 + + + + + + 1.8926D009A5E919B034A8C12CC7BC6AA4 + + + + + + + + + + + + + 201 + + + + + + 1.AB6BB38915AC1B434AA79A746AEC1CA9 + + + + + + + + + + + + + 201 + + + + + + 1.090A514BE0B269138CD466668F79C773 + + + + + + + + + + + + + 201 + + + + + + 1.1AF4C0F11AB88FCD30536164F07B3944 + + + + + + + + + + + + + 201 + + + + + + 1.878704403C5B1CFAD98804ABD56AB840 + + + + + + + + + + + + 201 + + + + + + 1.09B5FAE5CF69BF5E945E124D60852125 + + + + + + + + + + + + 201 + + + + + + 1.D65ECD1D08D1272AD5E969F80235DFAC + + + + + + + + + + 204 + + + + + + 403 + + + + + + 1.0500995E51CDDBCFFC70327F12F2428F + + + + + + + + + + 204 + + + + + + 1.C6B44D720B8BC5FEC46CEDA4EA04CA5F + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.CE89262FB9070D85EAB1C361CB74D99D + + + + + + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.D561CC0BB1BDF0FCD73E2AC1509393F7 + + + + + + + + + + 200 + + + + + + 1.14A107B85D096EB8554EDB0A4A8589B9 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.8A4F25C489C1E3C970CAD13B9AD4754E + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 403 + + + + + + 409 + + + + + + 1.44A480497E699D9A16A2A2ABB356106B + + + + + + + + + + + + 204 + + + + + + 403 + + + + + + 404 + + + + + + 409 + + + + + + 1.7E0B95E1E222BB82689E2AA8CD3FE344 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.4FAD1C67C3247080EFA33C224B87544D + + + + + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.8C885A22F5F8EA044A104A020AE563D5 + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.565CC9AD475CF6B1DAB856F2FD41FC54 + + + + + + + + + + + + 204 + + + + + + 1.E697E63D8C13C0C06626E57BB95305CD + + + + + + + + + + 200 + + + + + + 1.90CDE2CBD14856E5FDA2474704819E6B + + + + + + + + + + + + + + + + 200 + + + + + + 1.581382F387E3FC77A09A11F14FEB312D + + + + + + + + + + 200 + + + + + + 1.4E2A47F1477F1A5E5D4BA9166FD13700 + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 409 + + + + + + 1.AA63804087FDC605BA9B9619926B2A13 + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.00FF753915ABC8F954677D57253B3230 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.002A078CDCBEB6844EA00B0BBAC7CAC8 + + + + + + + + + + + + + + + + 200 + + + + + + 1.B27EA3CC583291FFD676193DBAA4551C + + + + + + + + + + 200 + + + + + + 1.8E0A2BF92DD79E7C634778C97619CDEF + + + + + + + + + + + + 200 + + + + + + 1.1789113D83DC2E48D1B5D1C221DC1872 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 409 + + + + + + 1.7E43CF8DCCA94FF867D50196D9F7C1CC + + + + + + + + + + + + + + + + + 201 + + + + + + 1.15D63B0FD0C4257041795BA2235277C5 + + + + + + + + + + + + + + + + + 201 + + + + + + 409 + + + + + + 1.A1CF121219F77829C8480AC814898D87 + + + + + + + + + + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 1.7EA25AF7C646BCB2F9BDF8736B50093C + + + + + + + + + + + + + + + + + 201 + + + + + + 1.B6E603A64C60859EEA83B2E687FB55AB + + + + + + + + + + + + + + + + + + 201 + + + + + + 1.CC4C9ED25B1509ABD0F30B375ABA4D78 + + + + + + + + + + 204 + + + + + + 1.377DC47D5802F8BBB59CC5D011268847 + + + + + + + + + + 204 + + + + + + 1.E3B3238A4639A19B8507203907EA2D52 + + + + + + + + + + 204 + + + + + + 1.5C597451975C08FCCE2F0647EDD16872 + + + + + + + + + + 204 + + + + + + 1.D032BD8264B23E052A900CD171273D84 + + + + + + + + + + 204 + + + + + + 1.779978550E2AC7519DBEE1B6418D7FA1 + + + + + + + + + + 200 + + + + + + 1.BD89C8ADCBAC5C96569ABC8DE7D841D9 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.760344CC17CCA3AAC0D1AEAAB22664BE + + + + + + + + + + 200 + + + + + + 1.7FE0018AE76D9D24DADF93BC83A73EF2 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.9A7A0BABDD6E7CC2D134B62D158E6C57 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.8C6D05D23CDCAFBC0344FE0C91513C32 + + + + + + + + + + 200 + + + + + + 1.40C486BA0D58B76E2C253E81EB297D0E + + + + + + + + + + 200 + + + + + + 1.18B2E9524D43E524BBB9C54ECA35E5F3 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.87B1B5789ECD05E15FC0C8BFED48E73E + + + + + + + + + + 200 + + + + + + 1.B23CBBE34EDFFE1E8FBF444E4E0EA0ED + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.F85D09C772C76D466ECDE210ABD0F6E2 + + + + + + + + + + + + + + 200 + + + + + + 1.D90C5C1EF5D3968AE776DED4DD4B41CA + + + + + + + + + + + + + + 200 + + + + + + 409 + + + + + + 1.4C6316BC92D7D1285A6565E212E6999E + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 500 + + + + + + 1.8AB4C4419A05BBB45CC2EEEFE10CAA82 + + + + + + + + + + + + + + 200 + + + + + + 1.B024C098E863E2B1C9275B0EBFBA3BF6 + + + + + + + + + + + + + + + 200 + + + + + + 1.E7A5FD996704C81CD95CC171BA42549E + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 409 + + + + + + 1.F51C99474F629A2CFD5CDB6BC5CB7C6D + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 409 + + + + + + 1.FB9358D923F09B224C1272BD9B459121 + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 409 + + + + + + 1.B030FA7F19336B7B8C64BAF6E6F6346B + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 409 + + + + + + 1.FCF1BFADC9D4DE1CF114901B69B22280 + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 409 + + + + + + 1.3970B4F7B6EEDF3D16C14B1FE8D74EA5 + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.FCDDCC0EE93BE92A31D4BD84C9DD57C7 + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.39020D24E8F55C01FF5ECC4524C78189 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.823E96C86A899E615759E3AADB7355E0 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.C8788BC1989E0E16F93945C2F157893B + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.0D4C916F64F122E94EEB6674D7B9F4D1 + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.620EF529E4CD2E0912AE9F42E2B802C0 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.2F15899DE5E70055E0490AD29530C842 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.DE22EC0929BAB9F743BFC38EAB10D680 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.905EEF6FC284DC0AC05F8F1B347829C0 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.BEECB5756E585359144D71D4410D4846 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.B8E477B5613F3E518F79082D5552E7AC + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.1480092553E000D0103C80E1BC65B2C5 + + + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.B32DA5E8C42BDE53830D288C86582A9B + + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.FD0CCCBDAB885F5E5C8D9BD9DA12B9CE + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.1B32364BA03FED4EBBD9BEF15A49EFB1 + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.F1B9C4424263D106712B36B7809F8EFC + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.782935F97E84EF7CAABC357C5CEE2271 + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.F4A8A78DF6670ECDAB83A83A18D1547D + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.2C0E9739F7F0BF5B9C16B620D3C195EB + + + + + + + + + + + + + 201 + + + + + + 403 + + + + + + 409 + + + + + + 1.8611905E16872C3EEFC979239C47CFFE + + + + + + + + + + + + 201 + + + + + + 1.D6C48865C0991834DDDE193AB40E04EA + + + + + + + + + + + + + 201 + + + + + + 403 + + + + + + 1.5A1DF310850382BEEFC771A9C1DECC3D + + + + + + + + + + 204 + + + + + + 403 + + + + + + 1.33DEA650BE9ABCDCDF53E462D402DAFE + + + + + + + + + + 204 + + + + + + 403 + + + + + + 1.E434ED8B2A34F104A95442717B1A4BA7 + + + + + + + + + + 200 + + + + + + 1.25BA53F39517497CBFEC02F6F1A1281D + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.02D9D53D22A0F5B6893643EE40ADB324 + + + + + + + + + + 200 + + + + + + 1.ABED6B8929079AC01A596C9E4C08CBF8 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.CA6D598467AAD4083472C11E72F28A8A + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 1.03E8ABF4920FE0C59B424EEDB8001FAB + + + + + + + + + + + + + + 200 + + + + + + 204 + + + + + + 403 + + + + + + 1.3289F9FD0E9ACCD50787DB1A0055712D + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 1.4DB23DDC56235578526ECD74A1E1D151 + + + + + + + + + + + + 204 + + + + + + 1.278BB8E0110D66EDACF595107C09427A + + + + + + + + + + + + + + + 204 + + + + + + 1.5787086FAAD0AEFD6965BE9007AEF32F + + + + + + + + + + + + + + + 204 + + + + + + 1.F66A4CBE1684496D395E5546FEB8C8B8 + + + + + + + + + + + + 204 + + + + + + 1.EDC1DDE6748591464113649924079D39 + + + + + + + + + + 204 + + + + + + 1.5A6D3D3A60E77AC626275AF623C4C766 + + + + + + + + + + 204 + + + + + + 1.C079F9483A04E55B04DBB93A82435427 + + + + + + + + + + + + 200 + + + + + + 1.1212DC6708EBC50394B744582FAA65B4 + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 404 + + + + + + 500 + + + + + + 12.4521084E7C6C8D90D72D43B641CFC389 + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 13.A68A4880F347BA44083CB1F0C28E2404 + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 404 + + + + + + 1.1AA08A21610BD902ED2A0BFDBB145B9C + + + + + + + + + + 204 + + + + + + 1.A16175D85EED2CC89E132CB59AE50B1A + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.5F29580D0FA9D13D4F31F6FA1479253C + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.BE9B123D699A33A084C657EDA216FD46 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.366B50C862A74986AFC2A1FD9AFA0DC8 + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.2CB8F6FD0FD4AAB2DBFDA3B66906F811 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.82806C1E451AD1325DD45123292E6360 + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.AF1AD1BB3EE186EBC9E967F37EF47B63 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.81935DED0B11C2F6579420B1D503F846 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.96AA26481EDB1492BF1A4696FB4A5E90 + + + + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 409 + + + + + + 410 + + + + + + 12.E85F3447509D8658DC4747BDBC1124AE + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.FF74C34F6936A3185B7DF890EA50A6EA + + + + + + + + + + 200 + + + + + + 12.D2E1E5F53C787AAE87CD6C64E57DF392 + + + + + + + + + + + + 200 + + + + + + 1.5441D6DB77E32465283AFFCD70BF0BD9 + + + + + + + + + + + + + 200 + + + + + + 1.A91ACBDE9427D4617DBA938B01FD4A65 + + + + + + + + + + + + + + + + 200 + + + + + + 1.D10F011A18EEF4569C8A980431DF4850 + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 1.5F6A41FED3043165DFD47ADA4C45298D + + + + + + + + + + + + + + + 200 + + + + + + 204 + + + + + + 403 + + + + + + 1.6F544A6CED02468AF923384632138561 + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.0D522E432703A7E48DBEDD1A6BB5CEF8 + + + + + + + + + + 204 + + + + + + 1.A1093E63522E0D37459A3DD2ED4BA382 + + + + + + + + + + + + + 204 + + + + + + 1.381372DCEE1323BA3EC6135F28BD40E7 + + + + + + + + + + + + + 204 + + + + + + 411 + + + + + + 1.B66BD19B24CA38C77915186CAC7278FB + + + + + + + + + + 204 + + + + + + 403 + + + + + + 409 + + + + + + 1.61F4F2C6BB6C6B6682D36487830BB9DC + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 402 + + + + + + 1.5A3E7F31249938D514C56E364FC6D02F + + + + + + + + + + 200 + + + + + + 1.6DAEDCFBF2E71F76371CDB2DE03FB216 + + + + + + + + + + + + + + + 200 + + + + + + 1.4EB20E46D4C9A9D1A9C832A10416B269 + + + + + + + + + + + + + 200 + + + + + + 1.D6574E9F317A632E897CC1497A014EE7 + + + + + + + + + + + + + + + + 201 + + + + + + 1.2963DE5A15B7A94AE018A555B04855E3 + + + + + + + + + + + + + + + + + 201 + + + + + + 1.610DEA508CD26A5530855611329147F8 + + + + + + + + + + + + + + + + 201 + + + + + + 1.BA2D594EAC2171E3CD66A1E4B261C157 + + + + + + + + + + + + + + + + + 201 + + + + + + 403 + + + + + + 1.F6F99FB1D96FAAB52761A4A6F9C007F4 + + + + + + + + + + + + + + + + 201 + + + + + + 1.4493BC861FFB54D0474875CDA923917F + + + + + + + + + + + + + + + + 201 + + + + + + 1.BCDE69D118A54DB3850A7A1DCB9044A5 + + + + + + + + + + + + + + + + + 201 + + + + + + 1.B9B14FD95B7365854A4873C9E03CF714 + + + + + + + + + + + + + + + + 201 + + + + + + 1.CB59926ABCCE409B8DA620D7098051EF + + + + + + + + + + + + + + + + + 201 + + + + + + 1.8A412C738BCEA2E768EEE5AFA91A02E3 + + + + + + + + + + + + + + + + 201 + + + + + + 1.F58DEB2156F89FEFF73AA296FB996076 + + + + + + + + + + + + + + + + 201 + + + + + + 1.6D9C05CCD6FC973CEC7EC06B2852C004 + + + + + + + + + + + + + + + + 201 + + + + + + 1.D2F89CEFD1D076C722E383CD47F54B0E + + + + + + + + + + + + + + + + 201 + + + + + + 1.C3E90840E58C0ED58DE5285F1C629007 + + + + + + + + + + + + + + + + 201 + + + + + + 1.697EEA5D819D1CCED8356F3707A80CC0 + + + + + + + + + + + + + + + + 201 + + + + + + 1.F8EE6F2C578B71C30A5818323B8C63DD + + + + + + + + + + 204 + + + + + + 1.CEC966DCE333C324697D8D2C014D5844 + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.94FDDACEB38E1AEE4DE4BD04D5CA1715 + + + + + + + + + + 204 + + + + + + 1.F75FB6B03E5778971F18B3E156F1C368 + + + + + + + + + + 204 + + + + + + 1.FB37D5236F8B9FAA3C23E1E1ED75EF7B + + + + + + + + + + 204 + + + + + + 1.BF2D067D7C365D5CD381837F5376FBCC + + + + + + + + + + 204 + + + + + + 1.1DCB7A5A19D0073AB4C529DE68EFF590 + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.AE62860962CCA944FDE6BA7A1FA29BE8 + + + + + + + + + + 204 + + + + + + 1.74228C20E21299810A61BDC1D72981CB + + + + + + + + + + 204 + + + + + + 1.5A5F6DB8F16E8BA2850BBC9786BF933A + + + + + + + + + + 204 + + + + + + 1.9B0188827522EB7EEF626D5957F16EF7 + + + + + + + + + + 204 + + + + + + 1.057E27FF0C7515839363635ABD87011B + + + + + + + + + + 204 + + + + + + 1.815B2098111720A02816432FD0B11263 + + + + + + + + + + 204 + + + + + + 1.F17A1AE113B6FD07741496A307004005 + + + + + + + + + + 204 + + + + + + 1.3FD065CF09A9346481021BC207729FC8 + + + + + + + + + + 204 + + + + + + 403 + + + + + + 1.67E8651E0A9719E5AA68ED2783076E40 + + + + + + + + + + 200 + + + + + + 1.E7E2388B6F0182AA8B191836FDC2EF46 + + + + + + + + + + + + + + + + 200 + + + + + + 1.0B3D7131A8DE08F23DD8F92E4FB445CE + + + + + + + + + + 200 + + + + + + 1.A1F33C79ADB650C34CBA5470E455A17D + + + + + + + + + + + + + + + + 200 + + + + + + 1.156CA822F9C5F127EBE0310BB1B87C70 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.6418EF00E4F7D58B1FB1EFE7DEAC6277 + + + + + + + + + + 200 + + + + + + 1.E016A3B10B9E2BCFBDC052B607BEF218 + + + + + + + + + + + + + + + + 200 + + + + + + 1.405BE0983E37E87E48E0D549DFFD22CD + + + + + + + + + + 200 + + + + + + 1.D55B0B0605B4BF3AE32149CAD90110CE + + + + + + + + + + + + + + + + 200 + + + + + + 1.89699929828B8EC5AE4F1F41003A1293 + + + + + + + + + + 200 + + + + + + 1.02BC732C912E22F368101E336487D192 + + + + + + + + + + + + + + + + 200 + + + + + + 1.58AA7409654D5D50B6B8F55539C0774B + + + + + + + + + + 200 + + + + + + 1.6B1CA505E2302A04F63AA27099F0FCFF + + + + + + + + + + + + + + + + 200 + + + + + + 1.96BE833135E4A5C8F7DE52803D85CCA1 + + + + + + + + + + 200 + + + + + + 1.3FB901D98106C97ED02FBD2FCB72A368 + + + + + + + + + + + + + + + + 200 + + + + + + 1.06D8300D0336BED673A20EF70C44CCCF + + + + + + + + + + 200 + + + + + + 1.C9293362A29ABB99EA2382C6B71D0649 + + + + + + + + + + + + + + + + 200 + + + + + + 1.351B871DFA1717273590632B38A4EBC7 + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.6DFABCE265B2455CBE17C12CF01CDDD2 + + + + + + + + + + + + + + + + 200 + + + + + + 1.C4D2CFB128128AFB2C46656E3EE693BB + + + + + + + + + + 200 + + + + + + 1.9222B04244CF97705F3488EE7906FC41 + + + + + + + + + + + + + + + + 200 + + + + + + 1.AA0AD23B2F046B29AA8947581FDFB860 + + + + + + + + + + 200 + + + + + + 1.D74722063AC27B6ECB815A78C0E790C5 + + + + + + + + + + + + + + + + 200 + + + + + + 1.E5ACD5AF9B1F02DDDF00504737297CFD + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.8E55D6D6105C140A17D3438C4F4D8D54 + + + + + + + + + + + + + + + + 200 + + + + + + 1.86F306440C4799F14DD5F4C0719E507C + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.301D82C48DB6624F74A9A6BD309A9E40 + + + + + + + + + + + + + + + + 200 + + + + + + 1.098207A6680442B3FA9643BB23CB370E + + + + + + + + + + 200 + + + + + + 1.0EC16E3818F17C785ABB022A34A7A083 + + + + + + + + + + + + + + + + 200 + + + + + + 1.F1ED654859180EBA33AD4697444A2636 + + + + + + + + + + 200 + + + + + + 1.84A39C5D428089EF64F5DB0558FA2C45 + + + + + + + + + + + + + + + + 200 + + + + + + 1.4C47E15164EB0479D97A05D6AF22162F + + + + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.D65C68901F23BADFA697712B7F496D8B + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.51440FCFF3ADF3834C5500FF554FFBE2 + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.70D55191E13B0C77A5FF57DA126E0849 + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 403 + + + + + + 1.590227D4C2600E9BBB7B5082E4792767 + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.445C035DB924A9B0FA42C72674EE4F89 + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.AA975962B34D69CE1C78662B13A65313 + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.BDA9A7110ADB2C122D0CA705B6B1D6FA + + + + + + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.94C075BD3FE76604F8ED084C9B9E4AE5 + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 1.C861C307A1307B7D19E67CEF0C9FF674 + + + + + + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.9AC8B3AFD901820523B5E22441984736 + + + + + + + + + + + + 204 + + + + + + 1.E7BF64005D511F7DF092A1FD63CAFDB2 + + + + + + + + + + + + 200 + + + + + + 1.6DA60D3A441DEB83245CF9390DB652C2 + + + + + + + + + + + + 204 + + + + + + 1.FCB7A1CCECDBFE60B9F9268A4DA13E64 + + + + + + + + + + + + 200 + + + + + + 1.5EDB52181C6563D67BB04B9F6F9FFCB3 + + + + + + + + + + + + + + 204 + + + + + + 1.602C9239FB1B18A48D8E6AB920F9865E + + + + + + + + + + + + + + 200 + + + + + + 1.613F01620D33F44F7F08DAD27477860D + + + + + + + + + + + + + 201 + + + + + + 1.B3F196534F6B3239F608E60F46CC5054 + + + + + + + + + + + + 204 + + + + + + 1.9395090644FD6A9EEDE620F2EDB2659C + + + + + + + + + + 204 + + + + + + 1.51360490B8BC0FEA841584D3A7941DA9 + + + + + + + + + + 204 + + + + + + 1.21D484F75EB67BB6E52299CFE9026E8C + + + + + + + + + + 204 + + + + + + 1.B470C7165F3CC8ED799ED4F8B5BAEA45 + + + + + + + + + + 204 + + + + + + 1.C56316687F31CD493F7064FD951EC99C + + + + + + + + + + + + 204 + + + + + + 1.79EEE017A84D0C323D68CA23A8CB1076 + + + + + + + + + + + + 200 + + + + + + 1.A4AFD3D5DA908492647C739E941CC97C + + + + + + + + + + + + 200 + + + + + + 1.EF17F568146C914F8023380045758F9C + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.3D539F4D333D3240C489C26EC0A011EF + + + + + + + + + + 200 + + + + + + 1.B0E4F8E2EF4C7507621D37BF97395F31 + + + + + + + + + + + + + + + + + 200 + + + + + + 1.A426A6A86571D4DB76768FBF9E3540DF + + + + + + + + + + 200 + + + + + + 1.BB0DDF53B3466065E0CC36A0EDFF2834 + + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.25C2373230B0EA43C94F0DCAAAEEA6FB + + + + + + + + + + + + + + + + + + + 204 + + + + + + 1.179F228C42340ABB9EEB830006BC5F2A + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.3DDC7451EA1620AE50203012113A61CC + + + + + + + + + + + + 204 + + + + + + 409 + + + + + + 1.28359B909678D42A4868FB82F28934BB + + + + + + + + + + + + 200 + + + + + + 1.486CB0412BAD44C82290FBD64DEC1F6D + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 1.C2B1E38A255F67B820C6DB2C5A021FC5 + + + + + + + + + + + + + + 204 + + + + + + 1.AA7061BA6F294ACDB2FA2282E0742BCC + + + + + + + + + + + + + + 200 + + + + + + 1.A5E2220D36BE184AE56CCD3CFC42D0AE + + + + + + + + + + + + 204 + + + + + + 1.F6BC5F562CC7CDDF11632321B21D97DF + + + + + + + + + + + + + + + 201 + + + + + + 1.97CAA19C72182CEF847821F9E6FB3AAA + + + + + + + + + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 409 + + + + + + 1.3B8F9F9CA8F1879985BF29BF5CBD21E6 + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 1.E05E227E544680F0B4BB26DE70617352 + + + + + + + + + + 204 + + + + + + 1.56E9BDA78930F90CD41C280B94F3EC92 + + + + + + + + + + 204 + + + + + + 1.A7B51CF0108CAE7FF2ED2ECFEEF990D9 + + + + + + + + + + 204 + + + + + + 1.02F4797EB106FFD0157EC4EAB8FBB3BC + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.6D17F999F7BD299E10604D67FB269746 + + + + + + + + + + 200 + + + + + + 1.FC523C8224CB7FBABCF213D5D951CB18 + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.0647B93684A5AF9B4EF9AAFC7148E0C7 + + + + + + + + + + 200 + + + + + + 1.04BA526681D926E6F55834C3FF14C800 + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.C7CE8CF71088F3DB585CD3B02AD6C01E + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.2861D535C9E907B2316C6DD326F9C9DB + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 409 + + + + + + 1.B3C891ADBE07985D8EB07F47AD5B9DA9 + + + + + + + + + + 204 + + + + + + 1.574C8D1B7983E679131E37FD5C3DF1B3 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.75E4BA966FFC501D192F53E91B7DA97C + + + + + + + + + + + + + + + + + 200 + + + + + + 1.CB9A35E0D20D8F23F42BE689119E06FA + + + + + + + + + + 200 + + + + + + 1.D7B16FCF4CB54A4DDD0B7B96965B0C89 + + + + + + + + + + 200 + + + + + + 1.6C78CB68979C1B30B65792A51C4909B4 + + + + + + + + + + 200 + + + + + + 503 + + + + + + 1.1425C7EF3EB1C555EEDB3A7B83959C18 + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.6C71667DFCE4EFE9D2D594675F5D0548 + + + + + + + + + + + + 200 + + + + + + 1.3FA058A0E73CD716458E4AD473D01D8E + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.7A7A1F423942BCD065A53F5E2C08CA10 + + + + + + + + + + + + 200 + + + + + + 1.686D026F4E37237A3FB0CFDDADBC9F8A + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.285B3B8B3249390AC0EA62095620648D + + + + + + + + + + + + 200 + + + + + + 1.483EDC95D9050419855BB2C9B7D9395A + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.57134A2893313DE704198EED54D5B6E6 + + + + + + + + + + + + 200 + + + + + + 1.9193C0F29388C5B9B6583A6BF6C2B347 + + + + + + + + + + + + 200 + + + + + + 1.309FA7AAF19EEC5CCD22B2BC222D2BAC + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.424FC52414BFE0A49B6746D5DB1256AB + + + + + + + + + + + + 200 + + + + + + 1.13C8280BFD2D49B31E703A6C942A14BB + + + + + + + + + + + + 200 + + + + + + 1.2ED8A733A34F7268A165FCB3C4DE0232 + + + + + + + + + + + + 200 + + + + + + 1.A44097E7733B4F75C8C3F55B7223E894 + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 409 + + + + + + 1.BCD510DF25513B8FAF0352336F094053 + + + + + + + + + + 204 + + + + + + 1.D24D24F09DCA78579C08ADE1D5528A18 + + + + + + + + + + 204 + + + + + + 1.388A14B11DC4161D76E7BA3524CED336 + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.E8ECE9BA39F0B03F8394B4AB5065B60D + + + + + + + + + + 204 + + + + + + 1.67C819CC3E37319CB3D533A2D31F00D7 + + + + + + + + + + 204 + + + + + + 1.7A9D46F2B10E01B201BD25BF3DA3E3D6 + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.466E11BA31409FC6549BB27A0C1400CC + + + + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.5458586BDBC05CE6DC7B96FB305E279E + + + + + + + + + + + + + + + + + + 204 + + + + + + 400 + + + + + + 1.221F7DCAF04AE6EB1BADF4997871733E + + + + + + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.2C5C28BB2FF03BAE5647F7DA4B0FBC7C + + + + + + + + + + + + + + + 200 + + + + + + 1.EF0CC59153D7673ED206E0F310880A6E + + + + + + + + + + 204 + + + + + + 1.D946E977B16DE185BC7065F3C36BBA94 + + + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.6758EF1C334FA94EC51F836A229DFFCA + + + + + + + + + + + + + + 200 + + + + + + 1.D96F1DC7CD390C447BBA6A55F52476AC + + + + + + + + + + + + + + + + + 200 + + + + + + 1.A7D83C4D167D0650C16DF8831A5503C4 + + + + + + + + + + 200 + + + + + + 1.D9690323F9BD00A1D7AC14D449C5C5F5 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.2BDEFEC679C5FBAF0D8D2934FE55F708 + + + + + + + + + + 200 + + + + + + 404 + + + + + + 1.2ADB64C9DC3241D0FFE93910210E1FF9 + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.F03568C031D1937D3B54EA29D055333D + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.F0DCE0BD19F895084F3C461358ABB31B + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.362B98FD68A372E063F679FC32F89B31 + + + + + + + + + + 200 + + + + + + 1.CB7932D0E8A306C5A2E35C8916C0E4B4 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.E62DED290400027E754EB45DBAC5062D + + + + + + + + + + 200 + + + + + + 1.DBBD22390D6F477450A6966FDA2CA298 + + + + + + + + + + + + 200 + + + + + + 1.FED65C1D6BB97C21B4F9DA0B7A997D35 + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.44F69227AF5D5C013E4E8870692550C7 + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.6B2469AA8D0FC2655F6EB394348EB437 + + + + + + + + + + 200 + + + + + + 1.A0A9BFEABE8E3C638E51660CF67D0B3C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 500 + + + + + + 1.23E6F9A6049ADDD0E927CC18B54C3B38 + + + + + + + + + + + + + + + + + + + 204 + + + + + + 1.FF1951EAE0ACBAB8DB513DF209D32122 + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.B73F07D16A191E0EFD397E3DCB5CE051 + + + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.31CBB28C0277768C8BF04A6CF1BA98A5 + + + + + + + + + + + + + + 200 + + + + + + 1.E6B45FD1B7595DCC123636DD01E50D8A + + + + + + + + + + + + 200 + + + + + + 409 + + + + + + 1.488DE2B815EF3AA7ED005927F9CF0255 + + + + + + + + + + + + 204 + + + + + + 409 + + + + + + 1.AD707ECC69A1E835FADE9B7B896C7C53 + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.B4A550D4C92733C33F4F42DF5C62F48C + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.3354560A47DC27A0EB7E2791DCFFD76C + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.16F6604E1706C8BFE79C56B75C629259 + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.038E34A9C374FC176986FC568A165527 + + + + + + + + + + + + 200 + + + + + + 1.CA5A1C1C65E431A37F3207B81767774B + + + + + + + + + + + + + + + + 204 + + + + + + 1.7D48EAAB19465D9008EFE5C6E3C020EA + + + + + + + + + + + + + + + + 200 + + + + + + 1.3669C6C2F1550E1554DB9CF129DCD965 + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.BB44DAB83E2DEF71FDAB005430239AD3 + + + + + + + + + + + + + + 204 + + + + + + 207 + + + + + + 1.A6D31BBFAFCCC9A55B9FEBF72E1C2953 + + + + + + + + + + + + + + 200 + + + + + + 1.32E4082ED243CB134EA743FF78000BD5 + + + + + + + + + + 204 + + + + + + 1.38E575DC2AF4B7D7CF3203E6B7BDA74D + + + + + + + + + + + + + + 201 + + + + + + 1.220648A0923367BC4FA2794FA4BE4591 + + + + + + + + + + + + + + 201 + + + + + + 1.38448C20E04942C66F6D9AB3169CEF09 + + + + + + + + + + 204 + + + + + + 1.B7BB4C29193AC92DB35E9E206A01E30D + + + + + + + + + + 204 + + + + + + 1.4D5F15EE9801D7E3BE0892FD38AFDE0D + + + + + + + + + + 204 + + + + + + 1.E062F9FB6D3FA8A9EEE31C6A81CC6604 + + + + + + + + + + 204 + + + + + + 1.78F8ED04EC79A126AEADE8C08B0E4F97 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.958F111DBDA1BCE46EFBC10511A145E9 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.1E72B20786B3BFB6DE896C380864C4ED + + + + + + + + + + 200 + + + + + + 1.A62A0E7E1808EED079989D04772B6CB6 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.65E7DE349575885F8EC2E78FFBBD3484 + + + + + + + + + + 200 + + + + + + 1.17A61EEDF79D76747BE37B3DA3F698DF + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.F0EE6E4715A3D2CFB1F5795EA52EF0A1 + + + + + + + + + + + + 200 + + + + + + 1.59DE4FDFB535F952488C8C76082D1957 + + + + + + + + + + + + + + + + + 204 + + + + + + 1.AC6CF1A6EDCCAC74410543D331DCEBFC + + + + + + + + + + + + 204 + + + + + + 409 + + + + + + 1.83B487198471CDEAF5C95D371BE1227E + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 409 + + + + + + 1.B13DC16C4369B842DD1580DFC9A23E90 + + + + + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 1.D9B3DB52DF8218B45D48BECB5131915E + + + + + + + + + + + + + + 200 + + + + + + 1.CF52BFFDF3E12D43EFD5F614833B7DCE + + + + + + + + + + + + + + 201 + + + + + + 1.FF43777C8C33E41102BCF3F2A2A90C64 + + + + + + + + + + 204 + + + + + + 1.7B3676D45CECCC1D12D71EBA722FFF30 + + + + + + + + + + 204 + + + + + + 1.71B0E6E68AA99863BE55E1D6D037301B + + + + + + + + + + 204 + + + + + + 1.9F2F0F9EE78721BF80AD83701F9736A0 + + + + + + + + + + + + 200 + + + + + + 1.680A6E46ADDF391752A3A89F95D73448 + + + + + + + + + + 200 + + + + + + 1.496A9334045EC97BFFE3A5116694FF85 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.BC1C6F682219387D81896AD542BFDA1B + + + + + + + + + + 200 + + + + + + 1.21E756DE8577C5778B49EB14777DE712 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.9066576F0656AE6BA8E13A019F6A59AB + + + + + + + + + + 200 + + + + + + 1.444CF76C0D4A6C4E637033A4D4E9126A + + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.3BFB533872841D46A011D369D3FF2977 + + + + + + + + + + + + 204 + + + + + + 409 + + + + + + 1.3426C46B6878DDEC0DA8DA6A0D5554AA + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.068DA432A58C3D7331CA5C906158F229 + + + + + + + + + + + + + + + + + + + + + + + + + 204 + + + + + + 1.B316331E65CCB79F118C8A178C4D1112 + + + + + + + + + + + + + + + + + + + + + + + + 201 + + + + + + 1.27B9DEC971AF1E0443505F6381B2C647 + + + + + + + + + + + + + + 200 + + + + + + 1.F528AE4144225E113F7B00825EE52AA2 + + + + + + + + + + + + + + 201 + + + + + + 1.8D68C314C554FFCC800097F48EA2B2BF + + + + + + + + + + + + + + 201 + + + + + + 1.B29CE6CAE05044347C6F6D2CD82D2B76 + + + + + + + + + + 204 + + + + + + 1.0EDA4B68A5E0A7A119DF093167A9643B + + + + + + + + + + 204 + + + + + + 1.25F94118327D5D07CF4BD4214EE33EC0 + + + + + + + + + + 204 + + + + + + 1.AD3D66C9BD4CFDABA55559C35CECD9E1 + + + + + + + + + + 204 + + + + + + 1.E336292FC529AF487A9AD66216D49654 + + + + + + + + + + + + 200 + + + + + + 1.673FA4C32058D8D329E1630ADA8E73C1 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.B74A7AA44043A326AC2D7D7934967B14 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.75F9BD52CF2A252C3696A912624AF4E7 + + + + + + + + + + 200 + + + + + + 1.1568E0AA2E38BC533DF1D9A3C26D9A80 + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.DA7E3AB4DC966A21CCA466E87760769B + + + + + + + + + + 200 + + + + + + 1.AF491ABBC242A023D510DB3FEFC8D333 + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 1.9AE867341DC4E9D188C81105BB655840 + + + + + + + + + + + + + + + + + 204 + + + + + + 1.658474BB59B4C339A45CF52CB7F697C3 + + + + + + + + + + + + 204 + + + + + + 409 + + + + + + 1.4F8C9F278402E6FB2E4EA057B834CC73 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 409 + + + + + + 1.F68B18D7E344D6FA9B40E23E3D97B61F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 409 + + + + + + 1.D6CE3DF7A0C10820202A220ACFC9E213 + + + + + + + + + + + + + + 200 + + + + + + 1.AA72044B9C3357E0774AADA4EF555CC6 + + + + + + + + + + + + + + + + + 201 + + + + + + 409 + + + + + + 500 + + + + + + 1.671331B470E29F833F419F6BAD29384B + + + + + + + + + + 204 + + + + + + 500 + + + + + + 1.E7E6381C3DCFF65F04EFF2E13C486B02 + + + + + + + + + + 200 + + + + + + 403 + + + + + + 404 + + + + + + 1.BCF75A4FA6D197563529575007325A9D + + + + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 404 + + + + + + 1.4D283CDE0658BDE321C6C7B4CFB00DB5 + + + + + + + + + + + + + + + 200 + + + + + + 400 + + + + + + 1.10D8DE9FF8DAD881A8553CC2EA0B33D8 + + + + + + + + + + + + 200 + + + + + + 403 + + + + + + 1.E49AE7C4E4606611A2264F17092383DE + + + + + + + + + + + + 200 + + + + + + 1.AF255C11E7836E705C16FB2E0C5C5893 + + + + + + + + + + + + + + + + + 201 + + + + + + 1.EDD41D719CF5C94BEBC543ED4E1FA92B + + + + + + + + + + 204 + + + + + + 1.87C46F7702591A04073B685E3DCA18E8 + + + + + + + + + + 200 + + + + + + 1.DF34657F1F638BF55CCB59D8766A7A40 + + + + + + + + + + + + + + + + 200 + + + + + + 1.227468E94768C87DC18B9D82AE1DD73A + + + + + + + + + + + + + + + + 201 + + + + + + 1.A11EBAEA1FB195A00CA8C77DAA86896E + + + + + + + + + + + + 201 + + + + + + 1.ED42C99A3F7707AE33EA46D9155ACF67 + + + + + + + + + + 204 + + + + + + 1.CB843F4F8FA5F1FD7A435EF77E9AB382 + + + + + + + + + + 200 + + + + + + 1.55C741CC9A0D6215D57FB954E57DBF9E + + + + + + + + + + 200 + + + + + + 1.A37E5119D3567CC0420518DD48F43AC6 + + + + + + + + + + + + 204 + + + + + + 1.14B1920F8A49D1721022BDA3054DF8EB + + + + + + + + + + 201 + + + + + + 1.BB98871AF82585B0C646B6954309CBC3 + + + + + + + + + + + + + + + + + + 201 + + + + + + 400 + + + + + + 403 + + + + + + 1.577E0E6FD00116FDB9FCC4BA96BC82E6 + + + + + + + + + + 204 + + + + + + 404 + + + + + + 1.EA981FC342B0BC7143D8A6B5C650CBA3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/Dockerfile b/docker/Dockerfile index 00d7d6b08..5ce225695 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM greyrocksoftware/javastandalone7 +FROM greyrocksoftware/javastandalone # Set the locale RUN locale-gen en_US.UTF-8 diff --git a/docker/run_tests.sh b/docker/run_tests.sh index ce2523e82..685689ee5 100755 --- a/docker/run_tests.sh +++ b/docker/run_tests.sh @@ -20,5 +20,5 @@ cd ds3_java_sdk git rev-parse HEAD ./gradlew jar -./gradlew test +./gradlew test integrationTest diff --git a/ds3-bom/build.gradle.kts b/ds3-bom/build.gradle.kts new file mode 100644 index 000000000..cf6611420 --- /dev/null +++ b/ds3-bom/build.gradle.kts @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `ds3-java-sdk-version` + `maven-publish` + `ds3-java-sdk-publishing-common-convention` + signing + `java-platform` +} + +description = "The DS3 Java SDK Bill of Materials." + +dependencies { + constraints { + api(project(":ds3-interfaces")) + api(project(":ds3-utils")) + api(project(":ds3-metadata")) + api(project(":ds3-sdk")) + } +} + +publishing { + publications { + create("Ds3Bom") { + from(components["javaPlatform"]) + } + } +} + +signing { + setRequired({ + (extra["isReleaseVersion"] as Boolean) && gradle.taskGraph.hasTask("publishProjectPublicationToOSSRHRepository") + }) + useGpgCmd() + sign(publishing.publications["Ds3Bom"]) +} diff --git a/ds3-interfaces/build.gradle b/ds3-interfaces/build.gradle deleted file mode 100644 index ac8ff43ef..000000000 --- a/ds3-interfaces/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -buildscript { - repositories { jcenter() } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - } -} - -apply plugin: 'com.github.johnrengelman.shadow' - -dependencies { - compile 'commons-io:commons-io:2.4' -} - -shadowJar { - relocate 'org.apache', 'ds3fatjar.org.apache' - dependencies { - exclude(dependency('org.hamcrest:hamcrest-library:1.3')) - exclude(dependency('org.mockito:mockito-core:1.10.19')) - exclude(dependency('junit:junit:4.12')) - exclude(dependency('org.slf4j:slf4j-api:1.7.22')) - exclude(dependency('org.slf4j:slf4j-simple:1.7.22')) - } -} - -artifacts { - archives shadowJar -} diff --git a/ds3-interfaces/build.gradle.kts b/ds3-interfaces/build.gradle.kts new file mode 100644 index 000000000..d322d8143 --- /dev/null +++ b/ds3-interfaces/build.gradle.kts @@ -0,0 +1,21 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +description = "The interfaces module holds the interfaces for headers and " + + "metadata." + +plugins { + `ds3-java-sdk-library-convention` +} diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataAccess.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataAccess.java index f9a0e5258..2e552973d 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataAccess.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataAccess.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataReceivedListener.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataReceivedListener.java index ccc85d709..a2e821b7f 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataReceivedListener.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/helpers/MetadataReceivedListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataRestore.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataRestore.java index b328ee20e..0ddb5da5d 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataRestore.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataRestore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataStore.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataStore.java index 34908d2e1..fe0cd8141 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataStore.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/metadata/interfaces/MetadataStore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Headers.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Headers.java index 43d07f6dc..f02f57f86 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Headers.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Headers.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Metadata.java b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Metadata.java index 92061ef19..3d285dacb 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Metadata.java +++ b/ds3-interfaces/src/main/java/com/spectralogic/ds3client/networking/Metadata.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/build.gradle b/ds3-metadata/build.gradle deleted file mode 100644 index 9d45f587d..000000000 --- a/ds3-metadata/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -buildscript { - repositories { jcenter() } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - } -} - -apply plugin: 'com.github.johnrengelman.shadow' - -shadowJar { - relocate 'org.apache', 'ds3metafatjar.org.apache' - relocate 'com.google', 'ds3metafatjar.com.google' - relocate 'com.sun.jna', 'ds3metafatjar.net.java.dev.jna' - - dependencies { - exclude(dependency('org.hamcrest:hamcrest-library:1.3')) - exclude(dependency('org.mockito:mockito-core:1.10.19')) - exclude(dependency('junit:junit:4.12')) - exclude(dependency('org.slf4j:slf4j-api:1.7.22')) - exclude(dependency('org.slf4j:slf4j-simple:1.7.22')) - exclude(dependency('org.apache.commons:commons-lang3:3.0')) - } -} - -artifacts { - archives shadowJar -} - -dependencies { - compile group: 'net.java.dev.jna', name: 'jna-platform', version: '4.2.2' - compile group: 'net.java.dev.jna', name: 'jna', version: '4.2.2' - compile 'commons-io:commons-io:2.4' - compile 'org.apache.httpcomponents:httpclient:4.5.1' - - testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' -} diff --git a/ds3-metadata/build.gradle.kts b/ds3-metadata/build.gradle.kts new file mode 100644 index 000000000..46cbcbdb6 --- /dev/null +++ b/ds3-metadata/build.gradle.kts @@ -0,0 +1,63 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `ds3-java-sdk-library-convention` + alias(libs.plugins.shadowPlugin) +} + +description = "This module holds the classes for converting file system " + + "metadata to BlackPearl object store metadata so you can preserve and " + + "restore file times and OS specific metadata." + +dependencies { + api(project(":ds3-interfaces")) + api(project(":ds3-utils")) + + implementation(libs.guava) + implementation(libs.jna) + implementation(libs.jnaPlatform) + implementation(libs.slf4jApi) + + testImplementation(libs.commonsIo) + testImplementation(libs.commonsLang3) + testImplementation(libs.junit) + testImplementation(libs.junitJupiterApi) + testImplementation(libs.httpclient) + + testRuntimeOnly(libs.junitVintageEngine) + testRuntimeOnly(libs.slf4jSimple) +} + +tasks.named("shadowJar") { + relocate("org.apache", "ds3metafatjar.org.apache") + relocate("com.google", "ds3metafatjar.com.google") + relocate("com.sun.jna", "ds3metafatjar.net.java.dev.jna") + relocate("org.jetbrains", "ds3metafatjar.org.jetbrains") + relocate("org.intellij", "ds3metafatjar.org.intellij") + relocate("org.codehaus", "ds3metafatjar.org.codehaus") + dependencies { + exclude(project(":ds3-interfaces")) // this is being excluded since it must be used with the sdk, which already has this dependency included + exclude(project(":ds3-utils")) // this is being excluded since it must be used with the sdk, which already has this dependency included + exclude(dependency(libs.slf4jApi.get().toString())) + exclude(dependency(libs.slf4jSimple.get().toString())) + exclude(dependency(libs.hamcrest.get().toString())) + exclude(dependency(libs.mockitoCore.get().toString())) + exclude(dependency(libs.junit.get().toString())) + exclude(dependency(libs.junitJupiterApi.get().toString())) + exclude(dependency(libs.commonsLang3.get().toString())) + } + dependsOn(tasks.jar) +} diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataRestore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataRestore.java index 89d732ee4..b9e4cb09a 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataRestore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataRestore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -86,10 +86,10 @@ public void restoreOSName() { * @param lastModifiedTime modified time got from server * @param lastAccessedTime last aceess time got from server */ - private void setFileTimes(final String filePath, - final String creationTime, - final String lastModifiedTime, - final String lastAccessedTime) + private static void setFileTimes(final String filePath, + final String creationTime, + final String lastModifiedTime, + final String lastAccessedTime) throws IOException { final BasicFileAttributeView attributes = Files.getFileAttributeView(Paths.get(filePath), BasicFileAttributeView.class); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataStore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataStore.java index f911bc8f0..97dcc7726 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataStore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/AbstractMetadataStore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MACMetadataRestore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MACMetadataRestore.java index bc0ec1d12..95dadfe1d 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MACMetadataRestore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MACMetadataRestore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -77,7 +77,7 @@ public void restoreFileTimes() throws IOException, InterruptedException { * @param objectName path of the object where we need to restore * @param creationTime creation time got from server */ - private void restoreCreationTimeMAC(final String objectName, final String creationTime) throws IOException, InterruptedException { + private static void restoreCreationTimeMAC(final String objectName, final String creationTime) throws IOException, InterruptedException { final ProcessBuilder processBuilder = new ProcessBuilder("touch", "-t", getDate(Long.parseLong(creationTime), "YYYYMMddHHmm"), objectName); final Process process = processBuilder.start(); //Wait to get exit value @@ -94,7 +94,7 @@ private void restoreCreationTimeMAC(final String objectName, final String creati * @param objectName path of the object where we need to restore * @param modifiedTime modified time need to restore */ - private void restoreModifiedTimeMAC(final String objectName, final String modifiedTime) throws IOException, InterruptedException { + private static void restoreModifiedTimeMAC(final String objectName, final String modifiedTime) throws IOException, InterruptedException { final ProcessBuilder processBuilder = new ProcessBuilder("touch", "-mt", getDate(Long.parseLong(modifiedTime), "YYYYMMddHHmm"), objectName); final Process process = processBuilder.start(); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetaDataUtil.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetaDataUtil.java index b6ac53fc4..b784171ee 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetaDataUtil.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetaDataUtil.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl.java index b245651e3..e37f6eec6 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -77,11 +77,11 @@ public Map getMetadataValue(final String filename) { * @param file local path of file * @return map builder containing the data to be stored on server */ - private ImmutableMap storeMetaData(final Path file) throws IOException { + private static ImmutableMap storeMetaData(final Path file) throws IOException { final ImmutableMap.Builder builder = ImmutableMap.builder(); //get metadata store based on os type - final MetadataStore metadataStore = new MetadataStoreFactory().getOsSpecificMetadataStore(builder); + final MetadataStore metadataStore = MetadataStoreFactory.getOsSpecificMetadataStore(builder); metadataStore.saveOSMetaData(MetaDataUtil.getOS()); final BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataKeyConstants.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataKeyConstants.java index e2e4c7b1f..1f0f84634 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataKeyConstants.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataKeyConstants.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl.java index b282c5194..5d35b3a52 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -73,12 +73,12 @@ public void metadataReceived(final String filename, final Metadata metadata) { * @param objectName name of the file to be restored * @param metadata metadata which needs to be set on local file */ - private void restoreMetaData(final String objectName, final Metadata metadata) throws IOException, InterruptedException { + private static void restoreMetaData(final String objectName, final Metadata metadata) throws IOException, InterruptedException { final ImmutableList.Builder exceptionBuilder = ImmutableList.builder(); //get metadatarestore on the basis of os - final MetadataRestore metadataRestore = new MetadataRestoreFactory().getOSSpecificMetadataRestore(metadata, objectName); + final MetadataRestore metadataRestore = MetadataRestoreFactory.getOSSpecificMetadataRestore(metadata, objectName); //restore os name metadataRestore.restoreOSName(); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory.java index af9a3c67c..d6b5bba4b 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,7 +21,7 @@ public class MetadataRestoreFactory { - public MetadataRestore getOSSpecificMetadataRestore(final Metadata metadata, final String filePath) { + public static MetadataRestore getOSSpecificMetadataRestore(final Metadata metadata, final String filePath) { final String localOS = MetaDataUtil.getOS(); if (Platform.isWindows()) { diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataStoreFactory.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataStoreFactory.java index 01455d291..32b0d87b3 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataStoreFactory.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/MetadataStoreFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,7 +21,7 @@ public class MetadataStoreFactory { - public MetadataStore getOsSpecificMetadataStore(final ImmutableMap.Builder metadataMap) { + public static MetadataStore getOsSpecificMetadataStore(final ImmutableMap.Builder metadataMap) { if(MetaDataUtil.getOS().contains("Windows")) { return new WindowsMetadataStore(metadataMap); } diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PermissionsUtils.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PermissionsUtils.java index c16303c3d..b808f9c9b 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PermissionsUtils.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PermissionsUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore.java index 43db943d2..a26012c99 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -91,7 +91,7 @@ private void setOwnerNGroupLnx(final String ownerName, final String groupName) t * @param filePath path of the file * @param permissions permissions got from the blackperl server */ - private void setPermissionsLnx(final String filePath, final String permissions) throws IOException { + private static void setPermissionsLnx(final String filePath, final String permissions) throws IOException { final Path file = Paths.get(filePath); final Set perms = PosixFilePermissions.fromString(permissions); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataStore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataStore.java index e04d4243a..783a1c7a0 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataStore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/PosixMetadataStore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataException.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataException.java index aca646b23..0bbdf1029 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataException.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore.java index 9c1bcbfe2..86775a6b6 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,9 +16,9 @@ package com.spectralogic.ds3client.metadata; import com.google.common.collect.ImmutableList; -import com.spectralogic.ds3client.metadata.jna.Advapi32; import com.spectralogic.ds3client.networking.Metadata; import com.spectralogic.ds3client.utils.Guard; +import com.sun.jna.platform.win32.Advapi32; import com.sun.jna.platform.win32.WinNT; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -128,7 +128,7 @@ private void setPermissionsForWindows() throws IOException { * @return map */ - private Map defaultOrdinalPermission(){ + private static Map defaultOrdinalPermission(){ final Map defaultOrdinalMap = new HashMap<>(); defaultOrdinalMap.put("0",AclEntryPermission.READ_DATA); defaultOrdinalMap.put("1",AclEntryPermission.WRITE_DATA); @@ -147,9 +147,9 @@ private Map defaultOrdinalPermission(){ return defaultOrdinalMap; } - private void restorePermissionByUser(final String permission, - final String user, - final ImmutableList.Builder aclEntryBuilder) + private static void restorePermissionByUser(final String permission, + final String user, + final ImmutableList.Builder aclEntryBuilder) throws IOException { final AclEntry.Builder builderWindow = AclEntry.newBuilder(); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore.java index 5b1b25982..0e4ae1fe3 100644 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore.java +++ b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,8 +16,8 @@ package com.spectralogic.ds3client.metadata; import com.google.common.collect.ImmutableMap; -import com.spectralogic.ds3client.metadata.jna.Advapi32; import com.spectralogic.ds3client.utils.Guard; +import com.sun.jna.platform.win32.Advapi32; import com.sun.jna.platform.win32.WinNT; import com.sun.jna.ptr.PointerByReference; import org.slf4j.Logger; @@ -28,6 +28,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.AclEntry; @@ -95,21 +96,24 @@ private void saveWindowsDescriptors(final Path path) throws IOException { * @param acl acl got from jna * @return dacl string */ - private String getDaclString(final WinNT.ACL acl) { - final WinNT.ACCESS_ACEStructure[] aceStructures = acl.getACEStructures(); + private static String getDaclString(final WinNT.ACL acl) { + final WinNT.ACE_HEADER[] aceHeaders = acl.getACEs(); final StringBuilder daclStringBuffer = new StringBuilder(); - for (final WinNT.ACCESS_ACEStructure aceStructure : aceStructures) { + for (final WinNT.ACE_HEADER aceHeader : aceHeaders) { daclStringBuffer.append("("); - if (aceStructure.AceType == 0) { + if (aceHeader.AceType == 0) { daclStringBuffer.append("A;"); - } else if (aceStructure.AceType == 1) { + } else if (aceHeader.AceType == 1) { daclStringBuffer.append("D;"); - } else if (aceStructure.AceType == 2) { + } else if (aceHeader.AceType == 2) { daclStringBuffer.append("AU;"); } - daclStringBuffer.append("0x").append(Integer.toHexString(aceStructure.AceFlags)).append(";"); - daclStringBuffer.append("0x").append(Integer.toHexString(aceStructure.Mask)).append(";;;"); - daclStringBuffer.append(aceStructure.getSidString()).append(")"); + daclStringBuffer.append("0x").append(Integer.toHexString(aceHeader.AceFlags)).append(";"); + if (aceHeader instanceof WinNT.ACCESS_ACEStructure) { + WinNT.ACCESS_ACEStructure accessACEStructure = (WinNT.ACCESS_ACEStructure) aceHeader; + daclStringBuffer.append("0x").append(Integer.toHexString(accessACEStructure.Mask)).append(";;;"); + daclStringBuffer.append(accessACEStructure.getSidString()).append(")"); + } } return daclStringBuffer.toString(); } @@ -126,7 +130,7 @@ private String saveFlagMetaData(final Path file) throws IOException { final ProcessBuilder processBuilder = new ProcessBuilder("attrib", file.toString()); final Process process = processBuilder.start(); try (final BufferedReader reader = - new BufferedReader(new InputStreamReader(process.getInputStream(), Charset.forName("UTF-8")))) { + new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8))) { final String flagWindows = reader.readLine(); if (Guard.isStringNullOrEmpty(flagWindows)) { LOG.error("The flagWindows string was null"); diff --git a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/jna/Advapi32.java b/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/jna/Advapi32.java deleted file mode 100644 index ee5feb643..000000000 --- a/ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/jna/Advapi32.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.metadata.jna; - -import com.sun.jna.Library; -import com.sun.jna.Native; -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinNT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.W32APIOptions; - -public interface Advapi32 extends Library { - - Advapi32 INSTANCE = (Advapi32) Native.loadLibrary("advapi32", Advapi32.class, W32APIOptions.UNICODE_OPTIONS); - - int GetNamedSecurityInfo(final String pObjectName, final int ObjectType, final int SecurityInfo, - final PointerByReference ppsidOwner, final PointerByReference ppsidGroup, - final PointerByReference ppDacl, final PointerByReference ppSacl, - final PointerByReference ppSecurityDescriptor); - boolean ConvertStringSidToSid(final String StringSid, final WinNT.PSIDByReference Sid); - int SetNamedSecurityInfo(final String pObjectName, final int ObjectType, final int SecurityInfo, - final Pointer ppsidOwner, final Pointer ppsidGroup, - final Pointer ppDacl, final Pointer ppSacl); -} \ No newline at end of file diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeaders.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeaders.java index 9563fe716..fe4853d79 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeaders.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeaders.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeadersReturningKeys.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeadersReturningKeys.java index 60090218c..74d699807 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeadersReturningKeys.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/MockedHeadersReturningKeys.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MACMetadataRestore_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MACMetadataRestore_Test.java index 9b0645bd6..ee5828859 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MACMetadataRestore_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MACMetadataRestore_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -41,7 +41,7 @@ public class MACMetadataRestore_Test { private final File file = new File(getClass().getClassLoader().getResource("LoremIpsum.txt").getFile()); @Test - public void restoreFileTimes_Test() throws Exception { + public void restoreFileTimesTest() throws Exception { if (Platform.isMac()) { final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yy:HH:mm"); @@ -62,7 +62,7 @@ public void restoreFileTimes_Test() throws Exception { } - private Metadata genMetadata(final Header... headers) { + private static Metadata genMetadata(final Header... headers) { final ImmutableMultimap.Builder mapBuilder = ImmutableMultimap.builder(); for (final Header header : headers) { diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl_Test.java index 73f1b9f83..6f9d54a2c 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataAccessImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -29,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -45,7 +46,7 @@ public class MetadataAccessImpl_Test { private static final Logger LOG = LoggerFactory.getLogger(MetadataAccessImpl_Test.class); @Test - public void testGettingMetadata() throws IOException, InterruptedException { + public void testGettingMetadata() throws IOException { final String tempPathPrefix = null; final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); @@ -93,7 +94,7 @@ public void testGettingMetadata() throws IOException, InterruptedException { } @Test - public void testMetadataAccessFailureHandler() throws IOException, InterruptedException { + public void testMetadataAccessFailureHandler() { Assume.assumeFalse(Platform.isWindows()); try { @@ -121,7 +122,7 @@ public void testMetadataAccessFailureHandler() throws IOException, InterruptedEx } @Test - public void testMetadataAccessFailureHandlerWithEventHandler() throws IOException, InterruptedException { + public void testMetadataAccessFailureHandlerWithEventHandler() throws IOException { Assume.assumeFalse(Platform.isWindows()); final String tempPathPrefix = null; @@ -141,7 +142,7 @@ public void testMetadataAccessFailureHandlerWithEventHandler() throws IOExceptio final AtomicInteger numTimesFailureHandlerCalled = new AtomicInteger(0); try (final InputStream inputStream = Runtime.getRuntime().exec("ls -lR").getInputStream()) { - LOG.info(IOUtils.toString(inputStream)); + LOG.info(IOUtils.toString(inputStream, Charset.defaultCharset()) ); } new MetadataAccessImpl(fileMapper.build(), new FailureEventListener() { diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl_Test.java index 6d60cef59..c42d78f9c 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataReceivedListenerImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -68,7 +68,7 @@ public void testGettingMetadata() throws IOException, InterruptedException { // change permissions if (Platform.isWindows()) { - Runtime.getRuntime().exec("attrib -A " + filePath.toString()).waitFor(); + Runtime.getRuntime().exec("attrib -A " + filePath).waitFor(); } else { final PosixFileAttributes attributes = Files.readAttributes(filePath, PosixFileAttributes.class); final Set permissions = attributes.permissions(); diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory_Test.java index 81b2e95e0..431711f44 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/MetadataRestoreFactory_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -31,7 +31,7 @@ public void testThatRunningOnMacReturnsMacMetaDataRestore() { final Metadata metadata = null; final String filePath = "."; - final MetadataRestore metadataRestorer = new MetadataRestoreFactory().getOSSpecificMetadataRestore(metadata, filePath); + final MetadataRestore metadataRestorer = MetadataRestoreFactory.getOSSpecificMetadataRestore(metadata, filePath); assertEquals(MACMetadataRestore.class, metadataRestorer.getClass()); } @@ -43,7 +43,7 @@ public void testThatRunningOnWindowsReturnsWindowsMetaDataRestore() { final Metadata metadata = null; final String filePath = "."; - final MetadataRestore metadataRestorer = new MetadataRestoreFactory().getOSSpecificMetadataRestore(metadata, filePath); + final MetadataRestore metadataRestorer = MetadataRestoreFactory.getOSSpecificMetadataRestore(metadata, filePath); assertEquals(WindowsMetadataRestore.class, metadataRestorer.getClass()); } @@ -55,7 +55,7 @@ public void testThatRunningOnLinuxReturnsLinuxMetaDataRestore() { final Metadata metadata = null; final String filePath = "."; - final MetadataRestore metadataRestorer = new MetadataRestoreFactory().getOSSpecificMetadataRestore(metadata, filePath); + final MetadataRestore metadataRestorer = MetadataRestoreFactory.getOSSpecificMetadataRestore(metadata, filePath); assertEquals(PosixMetadataRestore.class, metadataRestorer.getClass()); } diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore_Test.java index 07ab02d07..fb4bf9aaf 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataRestore_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -53,7 +53,7 @@ public void checkPreconditions() { private final File file = new File(getClass().getClassLoader().getResource("LoremIpsum.txt").getFile()); @Test - public void restoreFileTimes_Test() throws Exception{ + public void restoreFileTimesTest() throws Exception{ final BasicHeader basicHeader[] = new BasicHeader[3]; final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); basicHeader[0] = new BasicHeader(MetadataKeyConstants.METADATA_PREFIX + MetadataKeyConstants.KEY_CREATION_TIME, String.valueOf(attr.creationTime().toMillis())); @@ -96,7 +96,7 @@ public void restorePermissions() throws Exception{ Assert.assertEquals(getPermissionInOctal(PosixFilePermissions.toString(fileAttributesAfterRestore.permissions())), basicHeader[0].getValue()); } - private Metadata genMetadata(final Header... headers) { + private static Metadata genMetadata(final Header... headers) { final ImmutableMultimap.Builder mapBuilder = ImmutableMultimap.builder(); for (final Header header : headers) { diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataStore_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataStore_Test.java index dd2a25af9..82de552bf 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataStore_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/PosixMetadataStore_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -38,7 +38,7 @@ public class PosixMetadataStore_Test { private final PosixMetadataStore posixMetadataStore = new PosixMetadataStore(mMetadataMap); @Test - public void saveCreationTimeMetaData_Test() throws IOException { + public void saveCreationTimeMetaDataTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long creationTime = attr.creationTime().toMillis(); posixMetadataStore.saveCreationTimeMetaData(attr); @@ -46,7 +46,7 @@ public void saveCreationTimeMetaData_Test() throws IOException { } @Test - public void saveAccessTimeMetaData_Test() throws IOException { + public void saveAccessTimeMetaDataTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long lastAccessTime = attr.lastAccessTime().toMillis(); posixMetadataStore.saveAccessTimeMetaData(attr); @@ -55,7 +55,7 @@ public void saveAccessTimeMetaData_Test() throws IOException { @Test - public void saveLastModifiedTime_Test() throws IOException { + public void saveLastModifiedTimeTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long lastModifiedTime = attr.lastModifiedTime().toMillis(); posixMetadataStore.saveLastModifiedTime(attr); @@ -63,7 +63,7 @@ public void saveLastModifiedTime_Test() throws IOException { } @Test - public void saveOSMetaData_Test() throws IOException { + public void saveOSMetaDataTest() throws IOException { final String localOSName = MetaDataUtil.getOS(); posixMetadataStore.saveOSMetaData(localOSName); Assert.assertEquals(mMetadataMap.build().get(MetadataKeyConstants.METADATA_PREFIX + MetadataKeyConstants.KEY_OS), String.valueOf(localOSName)); diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore_Test.java index 3da51176b..151d56954 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataRestore_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -56,7 +56,7 @@ public void checkPreconditions() { } @Test - public void restoreFileTimes_Test() throws Exception { + public void restoreFileTimesTest() throws Exception { final BasicHeader basicHeader[] = new BasicHeader[3]; final Path filePath = ResourceUtils.loadFileResource(FILE_NAME); @@ -75,7 +75,7 @@ public void restoreFileTimes_Test() throws Exception { @Test - public void restoreUserAndOwner_Test() throws Exception { + public void restoreUserAndOwnerTest() throws Exception { final ImmutableMap.Builder metadataMap = new ImmutableMap.Builder<>(); final WindowsMetadataStore windowsMetadataStore = new WindowsMetadataStore(metadataMap); final Class aClass = WindowsMetadataStore.class; @@ -117,7 +117,7 @@ public void restoreUserAndOwner_Test() throws Exception { @Test - public void restorePermissions_Test() throws NoSuchMethodException, IOException, URISyntaxException, InvocationTargetException, IllegalAccessException, InterruptedException { + public void restorePermissionsTest() throws NoSuchMethodException, IOException, URISyntaxException, InvocationTargetException, IllegalAccessException, InterruptedException { final ImmutableMap.Builder mMetadataMap = new ImmutableMap.Builder<>(); final WindowsMetadataStore windowsMetadataStore = new WindowsMetadataStore(mMetadataMap); final Class aClass = WindowsMetadataStore.class; @@ -148,7 +148,7 @@ public void restorePermissions_Test() throws NoSuchMethodException, IOException, windowsMetadataRestore.restorePermissions(); } - private Metadata genMetadata(final Header... headers) { + private static Metadata genMetadata(final Header... headers) { final ImmutableMultimap.Builder mapBuilder = ImmutableMultimap.builder(); for (final Header header : headers) { mapBuilder.put(header.getName(), header.getValue()); diff --git a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore_Test.java b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore_Test.java index e78f90df3..d33ce79e1 100644 --- a/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore_Test.java +++ b/ds3-metadata/src/test/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -38,7 +38,7 @@ public class WindowsMetadataStore_Test { private final WindowsMetadataStore windowsMetadataStore = new WindowsMetadataStore(mMetadataMap); @Test - public void saveCreationTimeMetaData_Test() throws IOException { + public void saveCreationTimeMetaDataTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long creationTime = attr.creationTime().toMillis(); windowsMetadataStore.saveCreationTimeMetaData(attr); @@ -46,7 +46,7 @@ public void saveCreationTimeMetaData_Test() throws IOException { } @Test - public void saveAccessTimeMetaData_Test() throws IOException { + public void saveAccessTimeMetaDataTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long lastAccessTime = attr.lastAccessTime().toMillis(); windowsMetadataStore.saveAccessTimeMetaData(attr); @@ -55,7 +55,7 @@ public void saveAccessTimeMetaData_Test() throws IOException { @Test - public void saveLastModifiedTime_Test() throws IOException { + public void saveLastModifiedTimeTest() throws IOException { final BasicFileAttributes attr = Files.readAttributes(file.toPath(), BasicFileAttributes.class); final long lastModifiedTime = attr.lastModifiedTime().toMillis(); windowsMetadataStore.saveLastModifiedTime(attr); @@ -63,14 +63,14 @@ public void saveLastModifiedTime_Test() throws IOException { } @Test - public void saveOSMetaData_Test() throws IOException { + public void saveOSMetaDataTest() throws IOException { final String localOSName = MetaDataUtil.getOS(); windowsMetadataStore.saveOSMetaData(localOSName); Assert.assertEquals(mMetadataMap.build().get(METADATA_PREFIX + MetadataKeyConstants.KEY_OS), String.valueOf(localOSName)); } @Test - public void saveWinDescriptor_Test() throws Exception { + public void saveWinDescriptorTest() throws Exception { if (MetaDataUtil.getOS().contains("Windows")) { final Class aClass = WindowsMetadataStore.class; final Method method = aClass.getDeclaredMethod("saveWindowsDescriptors", new Class[]{Path.class}); @@ -83,7 +83,7 @@ public void saveWinDescriptor_Test() throws Exception { } @Test - public void saveFlagMetadata_Test() throws Exception { + public void saveFlagMetadataTest() throws Exception { if (MetaDataUtil.getOS().contains("Windows")) { final Class aClass = WindowsMetadataStore.class; final Method method = aClass.getDeclaredMethod("saveFlagMetaData", new Class[]{Path.class}); @@ -94,7 +94,7 @@ public void saveFlagMetadata_Test() throws Exception { } @Test - public void saveWindowsfilePermissions_Test() throws Exception { + public void saveWindowsFilePermissionsTest() throws Exception { if (MetaDataUtil.getOS().contains("Windows")) { final Class aClass = WindowsMetadataStore.class; final Method method = aClass.getDeclaredMethod("saveWindowsfilePermissions", new Class[]{Path.class}); diff --git a/ds3-sdk-integration/README.md b/ds3-sdk-integration/README.md index 083732e36..6bacecee9 100644 --- a/ds3-sdk-integration/README.md +++ b/ds3-sdk-integration/README.md @@ -14,14 +14,14 @@ To run the integrations tests you must be at the root of the project `ds3_java_s To execute only the unit tests (no device connection required): - ./gradlew clean ds3-sdk:test + ./gradlew clean test To execute only the integration tests: - ./gradlew clean ds3-sdk-integration:test + ./gradlew clean integrationTest To run both the integration tests and the unit tests execute: - ./gradlew clean test + ./gradlew clean test integrationTest The integration tests **should** clean up after themselves. If they do not, that is considered an error. diff --git a/ds3-sdk-integration/build.gradle.kts b/ds3-sdk-integration/build.gradle.kts new file mode 100644 index 000000000..0bfe3f53c --- /dev/null +++ b/ds3-sdk-integration/build.gradle.kts @@ -0,0 +1,57 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `ds3-java-sdk-internal-convention` +} + +dependencies { + implementation(project(":ds3-utils")) + implementation(project(":ds3-sdk")) + + implementation(libs.commonsIo) + implementation(libs.guava) + implementation(libs.slf4jApi) + implementation(libs.hamcrest) + implementation(libs.junit) + implementation(libs.junitJupiterApi) + + testImplementation(project(":ds3-metadata")) + + testImplementation(libs.httpclient) + testImplementation(libs.commonsLang3) + + testRuntimeOnly(libs.junitVintageEngine) +} + +sourceSets { + create("integrationTest") { + compileClasspath += sourceSets.main.get().output + runtimeClasspath += sourceSets.main.get().output + } +} + +val integrationTest = task("integrationTest") { + description = "Run integration tests." + group = "verification" + testClassesDirs = sourceSets["integrationTest"].output.classesDirs + classpath = sourceSets["integrationTest"].runtimeClasspath + shouldRunAfter("test") +} + +configurations["integrationTestImplementation"].extendsFrom(configurations.testImplementation.get()) +configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get()) + +tasks.check { dependsOn(integrationTest) } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedHeaders.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedHeaders.java similarity index 96% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedHeaders.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedHeaders.java index b56609b2b..8553d1f61 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedHeaders.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedHeaders.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedWebResponse.java similarity index 96% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedWebResponse.java index 091fc95af..fe7fc3817 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/MockedWebResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java similarity index 90% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java index c38e226ef..c2bbb872f 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/FileSystemHelper_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,9 +15,6 @@ package com.spectralogic.ds3client.helpers; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; import com.spectralogic.ds3client.integration.Util; @@ -31,6 +28,8 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.BufferedReader; import java.io.IOException; @@ -39,17 +38,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import static com.spectralogic.ds3client.integration.Util.deleteAllContents; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.*; public class FileSystemHelper_Test { private static final Logger LOG = LoggerFactory.getLogger(FileSystemHelper_Test.class); @@ -101,7 +99,7 @@ public void testObjectsFitBucketWithNonExistentBucket() { maxNumObjectTransferAttempts); final ObjectStorageSpaceVerificationResult result = ds3ClientHelpers.objectsFromBucketWillFitInDirectory( - "bad bucket name", Arrays.asList(new String[] {}), Paths.get(".")); + "bad bucket name", Collections.emptyList(), Paths.get(".")); assertEquals(ObjectStorageSpaceVerificationResult.VerificationStatus.BucketDoesNotExist, result.getVerificationStatus()); assertEquals(0, result.getRequiredSpace()); @@ -122,7 +120,7 @@ public void testObjectsFitBucketWithPathNotDirectory() throws IOException { try { final ObjectStorageSpaceVerificationResult result = ds3ClientHelpers.objectsFromBucketWillFitInDirectory( - "bad bucket name", Arrays.asList(new String[]{}), textFile); + "bad bucket name", Collections.emptyList(), textFile); assertEquals(ObjectStorageSpaceVerificationResult.VerificationStatus.PathIsNotADirectory, result.getVerificationStatus()); assertEquals(0, result.getRequiredSpace()); @@ -146,7 +144,7 @@ public void testObjectsFitBucketPathDoesNotExist() throws IOException { FileUtils.deleteDirectory(directory.toFile()); final ObjectStorageSpaceVerificationResult result = ds3ClientHelpers.objectsFromBucketWillFitInDirectory( - "bad bucket name", Arrays.asList(new String[]{}), directory); + "bad bucket name", Collections.emptyList(), directory); assertEquals(ObjectStorageSpaceVerificationResult.VerificationStatus.PathDoesNotExist, result.getVerificationStatus()); assertEquals(0, result.getRequiredSpace()); @@ -168,7 +166,7 @@ public void testObjectsFitBucketPathLacksAccess() throws IOException, Interrupte // Deny write data access to everyone, making the directory unwritable Runtime.getRuntime().exec("icacls dir /deny Everyone:(WD)").waitFor(); } else { - Runtime.getRuntime().exec("chmod -w " + directory.toString()).waitFor(); + Runtime.getRuntime().exec("chmod -w " + directory).waitFor(); final Process lsProcess = Runtime.getRuntime().exec("ls -l"); lsProcess.waitFor(); try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(lsProcess.getInputStream()))) { @@ -183,7 +181,7 @@ public void testObjectsFitBucketPathLacksAccess() throws IOException, Interrupte try { final ObjectStorageSpaceVerificationResult result = ds3ClientHelpers.objectsFromBucketWillFitInDirectory( - "bad bucket name", Arrays.asList(new String[]{}), directory); + "bad bucket name", Collections.emptyList(), directory); LOG.info(result.toString()); @@ -197,7 +195,7 @@ public void testObjectsFitBucketPathLacksAccess() throws IOException, Interrupte // Grant write data access to everyone, making the directory writable, so we can delete it. Runtime.getRuntime().exec("icacls dir /grant Everyone:(WD)").waitFor(); } else { - Runtime.getRuntime().exec("chmod +w " + directory.toString()).waitFor(); + Runtime.getRuntime().exec("chmod +w " + directory).waitFor(); } FileUtils.deleteDirectory(directory.toFile()); @@ -224,8 +222,8 @@ private interface ResultVerifier { void verifyResult(final ObjectStorageSpaceVerificationResult result, final long totalRequiredSize); } - private void putObjectThenRunVerification(final FileSystemHelper fileSystemHelper, - final ResultVerifier resultVerifier) + private static void putObjectThenRunVerification(final FileSystemHelper fileSystemHelper, + final ResultVerifier resultVerifier) throws IOException, URISyntaxException { try { @@ -313,4 +311,26 @@ public long getAvailableFileSpace(final Path path) throws IOException { throw new IOException("IOExceptionAtor"); } } + + @Test + public void createFolderWithSlash() throws IOException { + final String folderName = "FolderNameWithSlash/"; + + try { + HELPERS.createFolder(BUCKET_NAME, folderName); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void createFolderWithNoSlash() throws IOException { + final String folderName = "FolderNameNoSlash"; + + try { + HELPERS.createFolder(BUCKET_NAME, folderName); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java similarity index 95% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java index 90949bbac..7e700a9b2 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectStreamBuilder_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -82,7 +82,7 @@ public void afterRunningTestMethod() throws IOException { } @Test - public void objectInputStreamBuilder_Test() throws IOException, URISyntaxException { + public void objectInputStreamBuilderTest() throws IOException, URISyntaxException { //Verify that the object was transferred correctly to the BP in beforeRunningTestMethod final GetObjectDetailsSpectraS3Request objectDetailsRequest = new GetObjectDetailsSpectraS3Request(OBJ_NAME, BUCKET_NAME); @@ -93,7 +93,7 @@ public void objectInputStreamBuilder_Test() throws IOException, URISyntaxExcepti } @Test - public void objectOutputStreamBuilder_Test() throws IOException, URISyntaxException { + public void objectOutputStreamBuilderTest() throws IOException, URISyntaxException { //Retrieve the object on the BP using ObjectOutputStreamBuilder and verify contents final Ds3Object obj = new Ds3Object(OBJ_NAME, OBJ_BYTES.length); final Ds3ClientHelpers.Job job = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList(obj)); diff --git a/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/RepeatStringObjectChannelBuilder.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/RepeatStringObjectChannelBuilder.java new file mode 100644 index 000000000..70075b55f --- /dev/null +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/helpers/channelbuilders/RepeatStringObjectChannelBuilder.java @@ -0,0 +1,102 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.channelbuilders; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; + +import java.nio.ByteBuffer; +import java.nio.channels.SeekableByteChannel; + +public class RepeatStringObjectChannelBuilder implements Ds3ClientHelpers.ObjectChannelBuilder { + private final int bufferSize; + private final long sizeOfFiles; + private final String inputDataHeader; + + public RepeatStringObjectChannelBuilder(final String inputDataHeader, final int bufferSize, final long sizeOfFile) { + this.bufferSize = bufferSize; + this.sizeOfFiles = sizeOfFile; + this.inputDataHeader = inputDataHeader; + } + + @Override + public SeekableByteChannel buildChannel(final String key) { + return new RepeatStringObjectChannelBuilder.RepeatStringByteChannel(inputDataHeader + key, this.bufferSize, this.sizeOfFiles); + } + + private static class RepeatStringByteChannel implements SeekableByteChannel { + final private byte[] backingArray; + final private int bufferSize; + final private long limit; + private boolean isOpen; + private int position; + + RepeatStringByteChannel(final String inputData, final int bufferSize, final long size) { + this.bufferSize = bufferSize; + final byte[] bytes = new byte[bufferSize]; + final byte[] stringBytes = inputData.getBytes(); + int stringPosition = 0; + for (int i = 0; i < bufferSize; i++) { + bytes[i] = stringBytes[stringPosition]; + if (++stringPosition >= inputData.length()) { + stringPosition = 0; + } + } + + backingArray = bytes; + + this.position = 0; + this.limit = size; + this.isOpen = true; + } + + public void close() { + this.isOpen = false; + } + + public boolean isOpen() { + return this.isOpen; + } + + public long position() { + return (long) this.position; + } + + public SeekableByteChannel position(final long newPosition) { + this.position = (int) newPosition; + return this; + } + + public int read(final ByteBuffer dst) { + final int amountToRead = Math.min(dst.remaining(), this.bufferSize); + dst.put(this.backingArray, 0, amountToRead); + return amountToRead; + } + + public long size() { + return this.limit; + } + + public SeekableByteChannel truncate(final long size) { + return this; + } + + public int write(final ByteBuffer src) { + final int amountToWrite = Math.min(src.remaining(), this.bufferSize); + src.get(this.backingArray, 0, amountToWrite); + return amountToWrite; + } + } +} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java similarity index 71% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java index 13f4392f1..3fbbc43bc 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/AdvancedBucketManagement_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -60,7 +60,7 @@ public static void teardown() throws IOException, SignatureException { } @Test - public void createDeleteDataPolicy_Test() throws IOException, SignatureException { + public void createDeleteDataPolicyTest() throws IOException, SignatureException { final String dataPolicyName = "ds3_java_sdk_create_delete_data_policy"; try { @@ -86,17 +86,18 @@ public void createDeleteDataPolicy_Test() throws IOException, SignatureException } @Test - public void createDeleteEmptyStorageDomain_Test() throws IOException, SignatureException { + public void createDeleteEmptyStorageDomainTest() throws IOException, SignatureException { final String storageDomainName = "create_delete_empty_storage_domain"; try { //Create a test storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); - assertThat(storageDomainResponse.getStorageDomainResult(), is(notNullValue())); - assertThat(storageDomainResponse.getStorageDomainResult().getName(), is(storageDomainName)); + assertThat(storageDomain, is(notNullValue())); + assertThat(storageDomain.getName(), is(storageDomainName)); } finally { //Delete the test storage domain deleteStorageDomain(storageDomainName, client); @@ -104,18 +105,19 @@ public void createDeleteEmptyStorageDomain_Test() throws IOException, SignatureE } @Test - public void createDeletePoolPartition_Test() throws IOException, SignatureException { + public void createDeletePoolPartitionTest() throws IOException, SignatureException { final String poolPartitionName = "create_delete_pool_partition"; try { //Create the pool partition - final PutPoolPartitionSpectraS3Response createPoolResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); - assertThat(createPoolResponse.getPoolPartitionResult(), is(notNullValue())); - assertThat(createPoolResponse.getPoolPartitionResult().getName(), is(poolPartitionName)); + assertThat(poolPartition, is(notNullValue())); + assertThat(poolPartition.getName(), is(poolPartitionName)); //Get the pool partition to verify that was created on the BP final GetPoolPartitionSpectraS3Response getPoolResponse = client @@ -130,40 +132,44 @@ public void createDeletePoolPartition_Test() throws IOException, SignatureExcept } @Test - public void createPoolStorageDomainMember_Test() throws IOException, SignatureException { + public void createPoolStorageDomainMemberTest() throws IOException, SignatureException { final String storageDomainName = "create_pool_storage_domain_member_sd"; final String poolPartitionName = "create_pool_storage_domain_member_pp"; UUID storageDomainMemberId = null; try { //Create storage domain - final PutStorageDomainSpectraS3Response createStorageDomain = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); //Create pool partition - final PutPoolPartitionSpectraS3Response createPoolPartition = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response createMemberResponse = createPoolStorageDomainMember( - createStorageDomain.getStorageDomainResult().getId(), - createPoolPartition.getPoolPartitionResult().getId(), - client); - storageDomainMemberId = createMemberResponse.getStorageDomainMemberResult().getId(); - assertThat(createMemberResponse.getStorageDomainMemberResult(), is(notNullValue())); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + true); + + assertThat(storageDomainMember, is(notNullValue())); + storageDomainMemberId = storageDomainMember.getId(); //Verify that the storage domain member exists final GetStorageDomainMembersSpectraS3Response getMembers = client.getStorageDomainMembersSpectraS3( new GetStorageDomainMembersSpectraS3Request() - .withPoolPartitionId(createPoolPartition.getPoolPartitionResult().getId().toString()) - .withStorageDomainId(createStorageDomain.getStorageDomainResult().getId().toString())); + .withPoolPartitionId(poolPartition.getId().toString()) + .withStorageDomainId(storageDomain.getId().toString())); final List members = getMembers.getStorageDomainMemberListResult().getStorageDomainMembers(); assertThat(members.size(), is(1)); - assertThat(members.get(0).getPoolPartitionId(), is(createPoolPartition.getPoolPartitionResult().getId())); - assertThat(members.get(0).getStorageDomainId(), is(createStorageDomain.getStorageDomainResult().getId())); + assertThat(members.get(0).getPoolPartitionId(), is(poolPartition.getId())); + assertThat(members.get(0).getStorageDomainId(), is(storageDomain.getId())); } finally { deleteStorageDomainMember(storageDomainMemberId, client); deletePoolPartition(poolPartitionName, client); @@ -172,7 +178,7 @@ public void createPoolStorageDomainMember_Test() throws IOException, SignatureEx } @Test - public void createBucketSpectraS3_Test() throws IOException, SignatureException { + public void createBucketSpectraS3Test() throws IOException, SignatureException { final String bucketName = "create_bucket_spectra_s3"; try { final PutBucketSpectraS3Response response = client @@ -186,7 +192,7 @@ public void createBucketSpectraS3_Test() throws IOException, SignatureException } @Test - public void createBucketSpectraS3_WithDataPolicy_Test() throws IOException, SignatureException { + public void createBucketSpectraS3WithDataPolicyTest() throws IOException, SignatureException { final String bucketName = "create_bucket_spectra_s3"; final String dataPolicyName = "create_bucket_spectra_s3_data_policy"; final String storageDomainName = "create_bucket_spectra_s3_storage_domain"; @@ -201,29 +207,33 @@ public void createBucketSpectraS3_WithDataPolicy_Test() throws IOException, Sign client); //Create storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); //Create pool partition - final PutPoolPartitionSpectraS3Response poolPartitionResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response memberResponse = createPoolStorageDomainMember( - storageDomainResponse.getStorageDomainResult().getId(), - poolPartitionResponse.getPoolPartitionResult().getId(), - client); - storageDomainMemberId = memberResponse.getStorageDomainMemberResult().getId(); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + true); + storageDomainMemberId = storageDomainMember.getId(); //create data persistence rule - final PutDataPersistenceRuleSpectraS3Response dataPersistenceResponse = createDataPersistenceRule( + final DataPersistenceRule dataPersistenceRule = createDataPersistenceRule( dataPolicyResponse.getDataPolicyResult().getId(), - storageDomainResponse.getStorageDomainResult().getId(), - client); - dataPersistenceRuleId = dataPersistenceResponse.getDataPersistenceRuleResult().getDataPolicyId(); + storageDomain.getId(), + client, + true); + dataPersistenceRuleId = dataPersistenceRule.getDataPolicyId(); //Create bucket with data policy final PutBucketSpectraS3Response bucketResponse = client @@ -244,7 +254,7 @@ public void createBucketSpectraS3_WithDataPolicy_Test() throws IOException, Sign } @Test - public void putDuplicateObjects_VersioningKeepLatest_Test() throws IOException, + public void putDuplicateObjectsVersioningKeepLatestTest() throws IOException, SignatureException, URISyntaxException { final String bucketName = "duplicate_object_versioning_keep_latest"; final String dataPolicyName = "duplicate_object_versioning_keep_latest_dp"; @@ -261,29 +271,33 @@ public void putDuplicateObjects_VersioningKeepLatest_Test() throws IOException, client); //Create storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); //Create pool partition - final PutPoolPartitionSpectraS3Response poolPartitionResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response memberResponse = createPoolStorageDomainMember( - storageDomainResponse.getStorageDomainResult().getId(), - poolPartitionResponse.getPoolPartitionResult().getId(), - client); - storageDomainMemberId = memberResponse.getStorageDomainMemberResult().getId(); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + true); + storageDomainMemberId = storageDomainMember.getId(); //create data persistence rule - final PutDataPersistenceRuleSpectraS3Response dataPersistenceResponse = createDataPersistenceRule( + final DataPersistenceRule dataPersistenceRule = createDataPersistenceRule( dataPolicyResponse.getDataPolicyResult().getId(), - storageDomainResponse.getStorageDomainResult().getId(), - client); - dataPersistenceRuleId = dataPersistenceResponse.getDataPersistenceRuleResult().getDataPolicyId(); + storageDomain.getId(), + client, + true); + dataPersistenceRuleId = dataPersistenceRule.getId(); //Create bucket with data policy client.putBucketSpectraS3(new PutBucketSpectraS3Request(bucketName) @@ -316,7 +330,7 @@ public void putDuplicateObjects_VersioningKeepLatest_Test() throws IOException, } @Test - public void putDuplicateObjects_VersioningNone_Test() throws IOException, + public void putDuplicateObjectsVersioningNoneTest() throws IOException, SignatureException, URISyntaxException { final String bucketName = "duplicate_object_versioning_none"; final String dataPolicyName = "duplicate_object_versioning_none_dp"; @@ -333,29 +347,33 @@ public void putDuplicateObjects_VersioningNone_Test() throws IOException, client); //Create storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); //Create pool partition - final PutPoolPartitionSpectraS3Response poolPartitionResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response memberResponse = createPoolStorageDomainMember( - storageDomainResponse.getStorageDomainResult().getId(), - poolPartitionResponse.getPoolPartitionResult().getId(), - client); - storageDomainMemberId = memberResponse.getStorageDomainMemberResult().getId(); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + true); + storageDomainMemberId = storageDomainMember.getId(); //create data persistence rule - final PutDataPersistenceRuleSpectraS3Response dataPersistenceResponse = createDataPersistenceRule( + final DataPersistenceRule dataPersistenceRule = createDataPersistenceRule( dataPolicyResponse.getDataPolicyResult().getId(), - storageDomainResponse.getStorageDomainResult().getId(), - client); - dataPersistenceRuleId = dataPersistenceResponse.getDataPersistenceRuleResult().getDataPolicyId(); + storageDomain.getId(), + client, + true); + dataPersistenceRuleId = dataPersistenceRule.getDataPolicyId(); //Create bucket with data policy client.putBucketSpectraS3(new PutBucketSpectraS3Request(bucketName) diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/CustomParser_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/CustomParser_Test.java similarity index 68% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/CustomParser_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/CustomParser_Test.java index 8323abcf5..fb3c5592e 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/CustomParser_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/CustomParser_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,7 +25,6 @@ import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Response; import com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; -import com.spectralogic.ds3client.helpers.channelbuilders.ObjectInputStreamBuilder; import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; import com.spectralogic.ds3client.models.ChecksumType; @@ -80,13 +79,7 @@ public void beforeRunningTestMethod() throws IOException { final Ds3Object obj = new Ds3Object(OBJ_NAME, OBJ_BYTES.length); final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj)); - job.transfer(new ObjectInputStreamBuilder() { - - @Override - public InputStream buildInputStream(final String key) { - return new ByteArrayInputStream(OBJ_BYTES); - } - }); + job.transfer(new ObjectInputStreamBuilder()); } @After @@ -95,7 +88,7 @@ public void afterRunningTestMethod() throws IOException { } @Test - public void getObjectCustomParser_Test() throws IOException, URISyntaxException { + public void getObjectCustomParserTest() throws IOException, URISyntaxException { final Ds3Object object = new Ds3Object(OBJ_NAME); final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client .getBulkJobSpectraS3(new GetBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(object))); @@ -108,36 +101,13 @@ public void getObjectCustomParser_Test() throws IOException, URISyntaxException 0, stream); - client.getObject(request, new Function() { - @Override - public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { - final WebResponse webResponse = getObjectParserParams.getWebResponse(); - final long objectSize = getSizeFromHeaders(webResponse.getHeaders()); - try (final InputStream responseStream = webResponse.getResponseStream()) { - final long totalBytes = IOUtils.copy( - responseStream, - getObjectParserParams.getDestinationChannel(), - getObjectParserParams.getBufferSize(), - getObjectParserParams.getObjectName(), - false); - getObjectParserParams.getDestinationChannel().close(); - - if (objectSize != -1 && totalBytes != objectSize) { - throw new ContentLengthNotMatchException(getObjectParserParams.getObjectName(), objectSize, totalBytes); - } - - } catch (final IOException e) { - fail(); - } - return null; - } - }); + client.getObject(request, new GetObjectCustomParserParametersGetObjectResponseFunction()); assertThat(stream.toByteArray(), is(OBJ_BYTES)); } @SuppressWarnings("deprecation") @Test (expected = FailedRequestException.class) - public void getObjectCustomParserNoObject_Test() throws IOException{ + public void getObjectCustomParserNoObjectTest() throws IOException{ final String objectName = "doesNotExistObject"; final GetObjectRequest request = new GetObjectRequest( @@ -146,11 +116,46 @@ public void getObjectCustomParserNoObject_Test() throws IOException{ new NullChannel()); //Get object that does not exist - client.getObject(request, new Function() { - @Override - public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { - return null; + client.getObject(request, new NullGetObjectCustomParserParametersGetObjectResponseFunction()); + } + + private static class ObjectInputStreamBuilder extends com.spectralogic.ds3client.helpers.channelbuilders.ObjectInputStreamBuilder { + + @Override + public InputStream buildInputStream(final String key) { + return new ByteArrayInputStream(OBJ_BYTES); + } + } + + private static class GetObjectCustomParserParametersGetObjectResponseFunction implements Function { + @Override + public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { + final WebResponse webResponse = getObjectParserParams.getWebResponse(); + final long objectSize = getSizeFromHeaders(webResponse.getHeaders()); + try (final InputStream responseStream = webResponse.getResponseStream()) { + final long totalBytes = IOUtils.copy( + responseStream, + getObjectParserParams.getDestinationChannel(), + getObjectParserParams.getBufferSize(), + getObjectParserParams.getObjectName(), + false); + getObjectParserParams.getDestinationChannel().close(); + + if (objectSize != -1 && totalBytes != objectSize) { + throw new ContentLengthNotMatchException(getObjectParserParams.getObjectName(), objectSize, totalBytes); + } + + } catch (final IOException e) { + fail(); } - }); + return null; + } + } + + private static class NullGetObjectCustomParserParametersGetObjectResponseFunction implements Function { + @Override + public GetObjectResponse apply(final GetObjectCustomParserParameters getObjectParserParams) { + return null; + } } } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java similarity index 97% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java index 85b3be4f0..6240d4983 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/DataIntegrity_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -173,6 +173,8 @@ public void autoChecksumming() throws IOException { final SingleChecksumListener listener = new SingleChecksumListener(); + job.attachChecksumListener(listener); + job.removeChecksumListener(listener); job.attachChecksumListener(listener); job.transfer(new ResourceObjectPutter("books/")); @@ -369,7 +371,7 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { } } - private class MultiFileChecksumListener implements ChecksumListener { + private static class MultiFileChecksumListener implements ChecksumListener { private final Map checksumMap; @@ -387,7 +389,7 @@ public String getChecksum(final String filename) { } } - private class SingleChecksumListener implements ChecksumListener { + private static class SingleChecksumListener implements ChecksumListener { public String getChecksum() { return checksum; @@ -401,7 +403,7 @@ public void value(final BulkObject obj, final ChecksumType.Type type, final Stri } } - public void sendAndVerifySingleFile(final String bucketName, final String fileName, final long seed, final int length) throws IOException { + public static void sendAndVerifySingleFile(final String bucketName, final String fileName, final long seed, final int length) throws IOException { try { HELPERS.ensureBucketExists(bucketName, envDataPolicyId); diff --git a/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java new file mode 100644 index 000000000..629009870 --- /dev/null +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java @@ -0,0 +1,1515 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.integration; + +import com.google.common.collect.Lists; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.Ds3ClientImpl; +import com.spectralogic.ds3client.commands.GetObjectRequest; +import com.spectralogic.ds3client.commands.GetObjectResponse; +import com.spectralogic.ds3client.commands.PutObjectRequest; +import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Response; +import com.spectralogic.ds3client.commands.spectrads3.GetJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetJobSpectraS3Response; +import com.spectralogic.ds3client.helpers.ChecksumListener; +import com.spectralogic.ds3client.helpers.DataTransferredListener; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.FailureEventListener; +import com.spectralogic.ds3client.helpers.FileObjectGetter; +import com.spectralogic.ds3client.helpers.FileObjectPutter; + +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.MetadataReceivedListener; +import com.spectralogic.ds3client.helpers.ObjectCompletedListener; + +import com.spectralogic.ds3client.helpers.UnrecoverableIOException; +import com.spectralogic.ds3client.helpers.WaitingForChunksListener; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; +import com.spectralogic.ds3client.helpers.options.ReadJobOptions; +import com.spectralogic.ds3client.helpers.options.WriteJobOptions; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.BlobStrategy; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.ChunkAttemptRetryBehavior; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.ChunkAttemptRetryDelayBehavior; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.ClientDefinedChunkAttemptRetryDelayBehavior; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.GetSequentialBlobStrategy; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.MaxChunkAttemptsRetryBehavior; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.SequentialFileWriterChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcherImpl; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.MaxNumObjectTransferAttemptsDecorator; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferMethod; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferRetryDecorator; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; +import com.spectralogic.ds3client.helpers.util.PartialObjectHelpers; +import com.spectralogic.ds3client.integration.test.helpers.ABMTestHelper; +import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShim; +import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShimFactory; +import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; +import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.models.bulk.PartialDs3Object; +import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.networking.Metadata; +import com.spectralogic.ds3client.utils.Platform; +import com.spectralogic.ds3client.utils.ResourceUtils; +import org.apache.commons.io.FileUtils; +import org.junit.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.InvocationTargetException; +import java.net.URISyntaxException; +import java.nio.ByteBuffer; +import java.nio.channels.SeekableByteChannel; +import java.nio.channels.WritableByteChannel; +import java.nio.file.AccessDeniedException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.security.AccessControlException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import static com.spectralogic.ds3client.commands.spectrads3.PutBulkJobSpectraS3Request.MIN_UPLOAD_SIZE_IN_BYTES; +import static com.spectralogic.ds3client.integration.Util.RESOURCE_BASE_NAME; +import static com.spectralogic.ds3client.integration.Util.deleteAllContents; +import static com.spectralogic.ds3client.integration.Util.deleteBucketContents; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.core.IsNull.notNullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +public class GetJobManagement_Test { + + private static final Logger LOG = LoggerFactory.getLogger(GetJobManagement_Test.class); + + private static final Ds3Client client = Util.fromEnv(); + private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(client); + private static final String BUCKET_NAME = "Get_Job_Management_Test"; + private static final String TEST_ENV_NAME = "GetJobManagement_Test"; + private static final String DISK_FULL_MESSAGE = "There is not enough space on the disk"; + private static TempStorageIds envStorageIds; + private static UUID dataPolicyId; + + @BeforeClass + public static void startup() throws Exception { + dataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, false, ChecksumType.Type.MD5, client); + envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, dataPolicyId, client); + setupBucket(dataPolicyId); + } + + @AfterClass + public static void teardown() throws IOException { + try { + deleteAllContents(client, BUCKET_NAME); + } finally { + TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client); + client.close(); + } + } + + /** + * Creates the test bucket with the specified data policy to prevent cascading test failure + * when there are multiple data policies + */ + private static void setupBucket(final UUID dataPolicy) { + try { + HELPERS.ensureBucketExists(BUCKET_NAME, dataPolicy); + } catch (final Exception e) { + LOG.error("Setting up test environment failed: " + e.getMessage()); + } + } + + @Before + public void setupForEachTest() throws Exception { + LOG.info("Setting up before test."); + putBigFiles(); + putBeowulf(); + } + + @After + public void teardownForEachtest() throws IOException { + LOG.info("Tearing down after test."); + deleteBucketContents(client, BUCKET_NAME); + } + + private static void putBeowulf() throws Exception { + final String book1 = "beowulf.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final Ds3Object obj = new Ds3Object(book1, Files.size(objPath1)); + final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(obj)); + final UUID jobId = job.getJobId(); + final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); + client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); + } + + @SuppressWarnings("deprecation") + @Test + public void nakedS3Get() throws IOException, + URISyntaxException, InterruptedException { + + final WritableByteChannel writeChannel = new NullChannel(); + + final GetObjectResponse getObjectResponse = client.getObject( + new GetObjectRequest(BUCKET_NAME, "beowulf.txt", writeChannel)); + + assertThat(getObjectResponse, is(notNullValue())); + assertThat(getObjectResponse.getObjectSize(), is(notNullValue())); + } + + @Test + public void createReadJob() throws IOException, InterruptedException, URISyntaxException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10))); + + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + } + + @Test + public void createReadJobWithBigFile() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis-copies.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Collections.singletonList(obj)); + + final AtomicBoolean dataTransferredEventReceived = new AtomicBoolean(false); + final AtomicBoolean objectCompletedEventReceived = new AtomicBoolean(false); + final AtomicBoolean checksumEventReceived = new AtomicBoolean(false); + final AtomicBoolean metadataEventReceived = new AtomicBoolean(false); + final AtomicBoolean waitingForChunksEventReceived = new AtomicBoolean(false); + final AtomicBoolean failureEventReceived = new AtomicBoolean(false); + + readJob.attachDataTransferredListener(new DataTransferredListener() { + @Override + public void dataTransferred(final long size) { + dataTransferredEventReceived.set(true); + assertEquals(bookSize, size); + } + }); + readJob.attachObjectCompletedListener(new ObjectCompletedListener() { + @Override + public void objectCompleted(final String name) { + objectCompletedEventReceived.set(true); + } + }); + readJob.attachChecksumListener(new ChecksumListener() { + @Override + public void value(final BulkObject obj, final ChecksumType.Type type, final String checksum) { + checksumEventReceived.set(true); + assertEquals("0feqCQBgdtmmgGs9pB/Huw==", checksum); + } + }); + readJob.attachMetadataReceivedListener(new MetadataReceivedListener() { + @Override + public void metadataReceived(final String filename, final Metadata metadata) { + metadataEventReceived.set(true); + } + }); + readJob.attachWaitingForChunksListener(new WaitingForChunksListener() { + @Override + public void waiting(final int secondsToWait) { + waitingForChunksEventReceived.set(true); + } + }); + readJob.attachFailureEventListener(new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + failureEventReceived.set(true); + } + }); + + final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + + readJob.transfer(new FileObjectGetter(tempDirectory)); + + final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), FILE_NAME).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + + assertTrue(dataTransferredEventReceived.get()); + assertTrue(objectCompletedEventReceived.get()); + assertTrue(checksumEventReceived.get()); + assertTrue(metadataEventReceived.get()); + assertFalse(waitingForChunksEventReceived.get()); + assertFalse(failureEventReceived.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private static void putBigFiles() throws IOException, URISyntaxException { + final String DIR_NAME = "largeFiles/"; + final String[] FILE_NAMES = new String[] {"lesmis.txt", "lesmis-copies.txt", "GreatExpectations.txt" }; + + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objects = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objects.add(obj); + } + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); + writeJob.transfer(new FileObjectPutter(dirPath)); + } + + @Test(expected = AccessDeniedException.class) + public void testReadRetryBugFixWithUnwritableDirectory() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InterruptedException { + Assume.assumeFalse(iAmRoot()); + + final String tempPathPrefix = null; + final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String tempDirectoryName = tempDirectoryPath.toString(); + + if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) { + // Deny write data access to everyone, making the directory unwritable. + Runtime.getRuntime().exec("icacls " + tempDirectoryName + " /deny Everyone:(WD)").waitFor(); + } else { + Runtime.getRuntime().exec("chmod -w " + tempDirectoryName).waitFor(); + } + + try { + disableWritePermissionForRoot(tempDirectoryName); + + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis-copies.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Collections.singletonList(obj)); + + final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + + readJob.transfer(new FileObjectGetter(tempDirectoryPath)); + + final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectoryPath.toString(), FILE_NAME).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + } finally { + enableWritePermissionForRoot(tempDirectoryName); + + if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) { + // Grant write data access to everyone, so we can delete the directory + Runtime.getRuntime().exec("icacls " + tempDirectoryName + " /grant Everyone:(WD)").waitFor(); + } else { + Runtime.getRuntime().exec("chmod +w " + tempDirectoryName).waitFor(); + } + FileUtils.deleteDirectory(tempDirectoryPath.toFile()); + } + } + + private static void disableWritePermissionForRoot(final String fileOrDirName) { + try { + if (iAmRoot()) { + Runtime.getRuntime().exec("chattr +i " + fileOrDirName).waitFor(); + } + } catch (final IOException | InterruptedException e) { + LOG.error("Error setting file immutable: " + fileOrDirName, e); + } + } + + private static boolean iAmRoot() { + if ( ! Platform.isLinux()) { + return false; + } + + BufferedReader idProcessStdOut = null; + + try { + final Process idProcess = Runtime.getRuntime().exec("id"); + idProcessStdOut = new BufferedReader(new InputStreamReader(idProcess.getInputStream())); + final String idProcessResult = idProcessStdOut.readLine(); + idProcess.waitFor(); + + final String[] idFields = idProcessResult.split("="); + + final String[] uidString = idFields[1].split("\\("); + + return uidString[0].equals("0"); + } catch (final IOException | InterruptedException e) { + LOG.error("Error getting user id.", e); + } finally { + try { + if (idProcessStdOut != null) { + idProcessStdOut.close(); + } + } catch (final IOException e) { + LOG.error("Failure closing stdout for process that gets user id."); + } + } + + return false; + } + + private static void enableWritePermissionForRoot(final String fileOrDirName) { + try { + if (iAmRoot()) { + Runtime.getRuntime().exec("chattr -i " + fileOrDirName).waitFor(); + } + } catch (final IOException | InterruptedException e) { + LOG.error("Error setting file immutable: " + fileOrDirName, e); + } + } + + @Test + public void testReadRetrybugWhenChannelThrowsAccessException() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis-copies.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Collections.singletonList(obj)); + + final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + + readJob.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + throw new AccessControlException(key); + } + }); + } catch (final IOException e) { + caughtException.set(true); + assertTrue(e.getCause() instanceof AccessControlException); + } finally { + FileUtils.deleteDirectory(tempDirectoryPath.toFile()); + } + + assertTrue(caughtException.get()); + } + + @Test + public void testReadRetryBugWhenDiskIsFull() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis-copies.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Collections.singletonList(obj)); + + final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + + try { + readJob.transfer(new FailingChannelBuilder()); + } catch (final UnrecoverableIOException e) { + assertEquals(DISK_FULL_MESSAGE, e.getCause().getMessage()); + } + } finally { + FileUtils.deleteDirectory(tempDirectoryPath.toFile()); + } + } + + private static class FailingChannelBuilder implements Ds3ClientHelpers.ObjectChannelBuilder { + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + final SeekableByteChannel seekableByteChannel = Files.newByteChannel(Paths.get(key), + StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE, + StandardOpenOption.DELETE_ON_CLOSE); + return new SeekableByteChannelWrapper(seekableByteChannel); + } + } + + private static class SeekableByteChannelWrapper implements SeekableByteChannel { + private final SeekableByteChannel seekableByteChannel; + + private SeekableByteChannelWrapper(final SeekableByteChannel seekableByteChannel) { + this.seekableByteChannel = seekableByteChannel; + } + + @Override + public int read(final ByteBuffer dst) throws IOException { + return seekableByteChannel.read(dst); + } + + @Override + public int write(final ByteBuffer src) throws IOException { + throw new IOException(DISK_FULL_MESSAGE); + } + + @Override + public long position() throws IOException { + return seekableByteChannel.position(); + } + + @Override + public SeekableByteChannel position(final long newPosition) throws IOException { + return seekableByteChannel.position(newPosition); + } + + @Override + public long size() throws IOException { + return seekableByteChannel.size(); + } + + @Override + public SeekableByteChannel truncate(final long size) throws IOException { + return seekableByteChannel.truncate(size); + } + + @Override + public boolean isOpen() { + return seekableByteChannel.isOpen(); + } + + @Override + public void close() throws IOException { + seekableByteChannel.close(); + } + } + + + @Test + public void createReadJobWithPriorityOption() throws IOException, + InterruptedException, URISyntaxException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withPriority(Priority.LOW)); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); + } + + @Test + public void testCreatingStreamedReadJobWithPriorityOption() throws IOException, + InterruptedException, URISyntaxException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJobUsingStreamedBehavior(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withPriority(Priority.LOW)); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); + } + + @Test + public void createReadJobWithNameOption() throws IOException, + URISyntaxException, InterruptedException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withName("test_job")); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); + } + + @Test + public void testCreatingStreamedReadJobWithNameOption() throws IOException, + URISyntaxException, InterruptedException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJobUsingStreamedBehavior(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withName("test_job")); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); + } + + @Test + public void createReadJobWithNameAndPriorityOptions() throws IOException, + URISyntaxException, InterruptedException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create() + .withName("test_job").withPriority(Priority.LOW)); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); + assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); + } + + @Test + public void testCreatingStreamedReadJobWithNameAndPriorityOption() throws IOException, + URISyntaxException, InterruptedException { + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJobUsingStreamedBehavior(BUCKET_NAME, Lists.newArrayList( + new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create() + .withName("test_job").withPriority(Priority.LOW)); + final GetJobSpectraS3Response jobSpectraS3Response = client + .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); + assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); + } + + @Test + public void testPartialRetriesWithInjectedFailures() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, URISyntaxException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final List filesToGet = new ArrayList<>(); + + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "GreatExpectations.txt"; + + final int offsetIntoFirstRange = 10; + + filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(200000, 100000))); + + filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(100000, 100000))); + + filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(offsetIntoFirstRange, 100000))); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 4; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job job = ds3ClientHelpers.startReadJob(BUCKET_NAME, filesToGet); + final AtomicInteger intValue = new AtomicInteger(); + + job.attachObjectCompletedListener(new ObjectCompletedListener() { + int numPartsCompleted = 0; + + @Override + public void objectCompleted(final String name) { + assertEquals(1, ++numPartsCompleted); + intValue.incrementAndGet(); + } + }); + + job.attachDataTransferredListener(new DataTransferredListener() { + @Override + public void dataTransferred(final long size) { + LOG.info("Data transferred size: {}", size); + } + }); + + job.transfer(new FileObjectGetter(tempDirectory)); + + assertEquals(1, intValue.get()); + + try (final InputStream originalFileStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(DIR_NAME + FILE_NAME)) { + final byte[] first300000Bytes = new byte[300000 - offsetIntoFirstRange]; + originalFileStream.skip(offsetIntoFirstRange); + int numBytesRead = originalFileStream.read(first300000Bytes, 0, 300000 - offsetIntoFirstRange); + + assertThat(numBytesRead, is(300000 -offsetIntoFirstRange )); + + try (final InputStream fileReadFromBP = Files.newInputStream(Paths.get(tempDirectory.toString(), FILE_NAME))) { + final byte[] first300000BytesFromBP = new byte[300000 - offsetIntoFirstRange]; + + numBytesRead = fileReadFromBP.read(first300000BytesFromBP, 0, 300000 - offsetIntoFirstRange); + assertThat(numBytesRead, is(300000 - offsetIntoFirstRange)); + + assertTrue(Arrays.equals(first300000Bytes, first300000BytesFromBP)); + } + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testFiringFailureHandlerWhenGettingChunks() + throws URISyntaxException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException + { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailuresRecorded = new AtomicInteger(); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailuresRecorded.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); + } + }; + + final Ds3ClientHelpers.Job readJob = createReadJobWithObjectsReadyToTransfer(Ds3ClientShimFactory.ClientFailureType.ChunkAllocation); + + readJob.attachFailureEventListener(failureEventListener); + + try { + readJob.transfer(new FileObjectGetter(tempDirectory)); + } catch (final IOException e) { + assertEquals(1, numFailuresRecorded.get()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private static Ds3ClientHelpers.Job createReadJobWithObjectsReadyToTransfer(final Ds3ClientShimFactory.ClientFailureType clientFailureType) + throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException + { + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis-copies.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3Client ds3Client = Ds3ClientShimFactory.makeWrappedDs3Client(clientFailureType, client); + + final int maxNumBlockAllocationRetries = 3; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3Client, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + return ds3ClientHelpers.startReadJob(BUCKET_NAME, Collections.singletonList(obj)); + } + + @Test + public void testFiringFailureHandlerWhenGettingObject() + throws URISyntaxException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException + { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailuresRecorded = new AtomicInteger(); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailuresRecorded.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); + } + }; + + final Ds3ClientHelpers.Job readJob = createReadJobWithObjectsReadyToTransfer(Ds3ClientShimFactory.ClientFailureType.GetObject); + + readJob.attachFailureEventListener(failureEventListener); + + try { + readJob.transfer(new FileObjectGetter(tempDirectory)); + } catch (final IOException e) { + assertEquals(1, numFailuresRecorded.get()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testCreatingReadJobWithStreamedBehavior() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + doReadJobWithJobStarter(new ReadJobStarter() { + @Override + public Ds3ClientHelpers.Job startReadJob(final Ds3ClientHelpers ds3ClientHelpers, final String bucketName, final Iterable objectsToread) + throws IOException + { + return ds3ClientHelpers.startReadJobUsingStreamedBehavior(BUCKET_NAME, objectsToread); + } + }); + } + + private interface ReadJobStarter { + Ds3ClientHelpers.Job startReadJob(final Ds3ClientHelpers ds3ClientHelpers, final String bucketName, Iterable objectsToread) throws IOException; + } + + private static void doReadJobWithJobStarter(final ReadJobStarter readJobStarter) throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final String DIR_NAME = "largeFiles/"; + final String FILE_NAME = "lesmis.txt"; + + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); + + final int maxNumBlockAllocationRetries = 1; + final int maxNumObjectTransferAttempts = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final Ds3ClientHelpers.Job readJob = readJobStarter.startReadJob(ds3ClientHelpers, BUCKET_NAME, Collections.singletonList(obj)); + + final AtomicBoolean dataTransferredEventReceived = new AtomicBoolean(false); + final AtomicBoolean objectCompletedEventReceived = new AtomicBoolean(false); + final AtomicBoolean checksumEventReceived = new AtomicBoolean(false); + final AtomicBoolean metadataEventReceived = new AtomicBoolean(false); + final AtomicBoolean waitingForChunksEventReceived = new AtomicBoolean(false); + final AtomicBoolean failureEventReceived = new AtomicBoolean(false); + + readJob.attachDataTransferredListener(new DataTransferredListener() { + @Override + public void dataTransferred(final long size) { + dataTransferredEventReceived.set(true); + assertEquals(bookSize, size); + } + }); + readJob.attachObjectCompletedListener(new ObjectCompletedListener() { + @Override + public void objectCompleted(final String name) { + objectCompletedEventReceived.set(true); + } + }); + readJob.attachChecksumListener(new ChecksumListener() { + @Override + public void value(final BulkObject obj, final ChecksumType.Type type, final String checksum) { + checksumEventReceived.set(true); + assertEquals("69+JXWeZuzl2HFTM6Lbo8A==", checksum); + } + }); + readJob.attachMetadataReceivedListener(new MetadataReceivedListener() { + @Override + public void metadataReceived(final String filename, final Metadata metadata) { + metadataEventReceived.set(true); + } + }); + readJob.attachWaitingForChunksListener(new WaitingForChunksListener() { + @Override + public void waiting(final int secondsToWait) { + waitingForChunksEventReceived.set(true); + } + }); + readJob.attachFailureEventListener(new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + failureEventReceived.set(true); + } + }); + + readJob.transfer(new FileObjectGetter(tempDirectory)); + + final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), FILE_NAME).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + + assertTrue(dataTransferredEventReceived.get()); + assertTrue(objectCompletedEventReceived.get()); + assertTrue(checksumEventReceived.get()); + assertTrue(metadataEventReceived.get()); + assertFalse(waitingForChunksEventReceived.get()); + assertFalse(failureEventReceived.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testCreatingReadJobWithRandomAccessBehavior() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + doReadJobWithJobStarter(new ReadJobStarter() { + @Override + public Ds3ClientHelpers.Job startReadJob(final Ds3ClientHelpers ds3ClientHelpers, final String bucketName, final Iterable objectsToread) + throws IOException + { + return ds3ClientHelpers.startReadJobUsingRandomAccessBehavior(BUCKET_NAME, objectsToread); + } + }); + } + + @Test + public void testStartReadAllJobUsingStreamedBehavior() throws IOException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailuresRecorded = new AtomicInteger(0); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailuresRecorded.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); + } + }; + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadAllJobUsingStreamedBehavior(BUCKET_NAME); + readJob.attachFailureEventListener(failureEventListener); + readJob.transfer(new FileObjectGetter(tempDirectory)); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + final List filesWeExpectToBeInTempDirectory = Arrays.asList("beowulf.txt", "lesmis.txt", "lesmis-copies.txt", "GreatExpectations.txt"); + + for (final File fileInTempDirectory : filesInTempDirectory) { + assertTrue(filesWeExpectToBeInTempDirectory.contains(fileInTempDirectory.getName())); + } + + assertEquals(0, numFailuresRecorded.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testStartReadAllJobUsingRandomAccessBehavior() throws IOException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailuresRecorded = new AtomicInteger(0); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailuresRecorded.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); + } + }; + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadAllJobUsingRandomAccessBehavior(BUCKET_NAME); + readJob.attachFailureEventListener(failureEventListener); + readJob.transfer(new FileObjectGetter(tempDirectory)); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + final List filesWeExpectToBeInTempDirectory = Arrays.asList("beowulf.txt", "lesmis.txt", "lesmis-copies.txt", "GreatExpectations.txt"); + + for (final File fileInTempDirectory : filesInTempDirectory) { + assertTrue(filesWeExpectToBeInTempDirectory.contains(fileInTempDirectory.getName())); + } + + assertEquals(0, numFailuresRecorded.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testGetJobUsingTransferStrategy() throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + transferStrategy.transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testReadJobUsingTransferStrategy() throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + Ds3ClientHelpers.wrap(client).startReadJob(transferStrategy).transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + @Test + public void testGetJobWithUserSuppliedBlobStrategy() throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final EventDispatcher eventDispatcher = new EventDispatcherImpl(new SameThreadEventRunner()); + + final AtomicInteger numChunkAllocationAttempts = new AtomicInteger(0); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))) + .withBlobStrategy(new UserSuppliedPutBlobStrategy(client, + masterObjectList, + eventDispatcher, + new MaxChunkAttemptsRetryBehavior(5), + new ClientDefinedChunkAttemptRetryDelayBehavior(1, eventDispatcher), + new Monitorable() { + @Override + public void monitor() { + numChunkAllocationAttempts.getAndIncrement(); + } + })); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + transferStrategy.transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + + assertEquals(1, numChunkAllocationAttempts.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private interface Monitorable { + void monitor(); + } + + private static class UserSuppliedPutBlobStrategy implements BlobStrategy { + private final BlobStrategy wrappedBlobStrategy; + private final Monitorable monitorable; + + private UserSuppliedPutBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior, + final Monitorable monitorable) + { + this.monitorable = monitorable; + + wrappedBlobStrategy = new GetSequentialBlobStrategy(client, masterObjectList, eventDispatcher, + retryBehavior, chunkAttemptRetryDelayBehavior); + } + + @Override + public Iterable getWork() throws IOException, InterruptedException { + monitorable.monitor(); + + return wrappedBlobStrategy.getWork(); + } + } + + @Test + public void testGetJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException { + testGetJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder; + } + }); + } + + private static void testGetJobWithUserSuppliedChannelStrategy(final TransferStrategyBuilderModifiable transferStrategyBuilderModifiable) throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final AtomicInteger numTimesChannelOpened = new AtomicInteger(0); + final AtomicInteger numTimesChannelClosed = new AtomicInteger(0); + + TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))) + .withChannelStrategy(new UserSuppliedPutChannelStrategy(new FileObjectGetter(tempDirectory), + new ChannelMonitorable() { + @Override + public void acquired() { + numTimesChannelOpened.getAndIncrement(); + } + + @Override + public void released() { + numTimesChannelClosed.getAndIncrement(); + } + })); + + transferStrategyBuilder = transferStrategyBuilderModifiable.modify(transferStrategyBuilder); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + transferStrategy.transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + + assertEquals(1, numTimesChannelOpened.get()); + assertEquals(1, numTimesChannelClosed.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private interface TransferStrategyBuilderModifiable { + TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder); + } + + private interface ChannelMonitorable { + void acquired(); + void released(); + } + + private static class UserSuppliedPutChannelStrategy implements ChannelStrategy { + private final ChannelMonitorable channelMonitorable; + private final ChannelStrategy wrappedPutStrategy; + + private UserSuppliedPutChannelStrategy(final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder, + final ChannelMonitorable channelMonitorable) + { + this.channelMonitorable = channelMonitorable; + wrappedPutStrategy = new SequentialFileWriterChannelStrategy(objectChannelBuilder); + } + + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + channelMonitorable.acquired(); + return wrappedPutStrategy.acquireChannelForBlob(blob); + } + + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + channelMonitorable.released(); + wrappedPutStrategy.releaseChannelForBlob(seekableByteChannel, blob); + } + } + + @Test + public void testStreamedGetJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException { + testGetJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder.usingStreamedTransferBehavior(); + } + }); + } + + @Test + public void testRandomAccessGetJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException { + testGetJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder.usingRandomAccessTransferBehavior(); + } + }); + } + + @Test + public void testGetJobUserSuppliedTransferRetryDecorator() throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final AtomicInteger numTimesTransferCalled = new AtomicInteger(0); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))) + .withTransferRetryDecorator(new UserSuppliedTransferRetryDecorator( + new Monitorable() { + @Override + public void monitor() { + numTimesTransferCalled.getAndIncrement(); + } + } + )); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + transferStrategy.transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + + assertEquals(1, numTimesTransferCalled.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private static class UserSuppliedTransferRetryDecorator implements TransferRetryDecorator { + private final TransferRetryDecorator transferRetryDecorator; + private final Monitorable monitorable; + + private UserSuppliedTransferRetryDecorator(final Monitorable monitorable) { + this.transferRetryDecorator = new MaxNumObjectTransferAttemptsDecorator(5); + this.monitorable = monitorable; + } + + @Override + public TransferMethod wrap(final TransferMethod transferMethod) { + transferRetryDecorator.wrap(transferMethod); + return this; + } + + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + monitorable.monitor(); + transferRetryDecorator.transferJobPart(jobPart); + } + } + + @Test + public void testGetJobUserSuppliedChunkAttemptRetryBehavior() throws IOException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final String fileName = "beowulf.txt"; + + try { + final List objects = Lists.newArrayList(new Ds3Object(fileName)); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(BUCKET_NAME, objects); + + final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); + + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + final AtomicInteger numTimesInvokeCalled = new AtomicInteger(0); + final AtomicInteger numTimesResetCalled = new AtomicInteger(0); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectGetter(tempDirectory)) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), + PartialObjectHelpers.getPartialObjectsRanges(objects))) + .withChunkAttemptRetryBehavior(new UserSuppliedChunkAttemptRetryBehavior( + new ChunkAttemptRetryBehaviorMonitorable() { + @Override + public void invoke() { + numTimesInvokeCalled.getAndIncrement(); + } + + @Override + public void reset() { + numTimesResetCalled.getAndIncrement(); + } + } + )); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makeGetTransferStrategy(); + + transferStrategy.transfer(); + + final Collection filesInTempDirectory = FileUtils.listFiles(tempDirectory.toFile(), null, false); + + for (final File file : filesInTempDirectory) { + assertEquals(fileName, file.getName()); + } + + assertEquals(0, numTimesInvokeCalled.get()); + assertEquals(1, numTimesResetCalled.get()); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } + + private static class UserSuppliedChunkAttemptRetryBehavior implements ChunkAttemptRetryBehavior { + private final ChunkAttemptRetryBehaviorMonitorable chunkAttemptRetryBehaviorMonitorable; + private final ChunkAttemptRetryBehavior wrappedChunkAttemptRetryBehavior; + + private UserSuppliedChunkAttemptRetryBehavior(final ChunkAttemptRetryBehaviorMonitorable chunkAttemptRetryBehaviorMonitorable) { + this.chunkAttemptRetryBehaviorMonitorable = chunkAttemptRetryBehaviorMonitorable; + wrappedChunkAttemptRetryBehavior = new MaxChunkAttemptsRetryBehavior(5); + } + + @Override + public void invoke() throws IOException { + chunkAttemptRetryBehaviorMonitorable.invoke(); + wrappedChunkAttemptRetryBehavior.invoke(); + } + + @Override + public void reset() { + chunkAttemptRetryBehaviorMonitorable.reset(); + wrappedChunkAttemptRetryBehavior.reset(); + } + } + + private interface ChunkAttemptRetryBehaviorMonitorable { + void invoke(); + void reset(); + } + + @Test + public void testThatFifoIsNotProcessed() throws IOException, InterruptedException { + Assume.assumeFalse(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String BEOWULF_FILE_NAME = "beowulf.txt"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Runtime.getRuntime().exec("mkfifo " + Paths.get(tempDirectory.toString(), BEOWULF_FILE_NAME)).waitFor(); + + final List ds3Objects = Collections.singletonList(new Ds3Object(BEOWULF_FILE_NAME)); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, ds3Objects); + readJob.transfer(new FileObjectPutter(tempDirectory)); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(BEOWULF_FILE_NAME)); + caughtException.set(true); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + + assertTrue(caughtException.get()); + } + + @Test + public void testStreamedGetJobWithBlobbedFile() throws Exception { + final int chunkSize = MIN_UPLOAD_SIZE_IN_BYTES; + final long biggerThanAChunkSize = chunkSize * 2L + 1024; + + final int numIntsInBiggerThanAChunkSize = (int)biggerThanAChunkSize / 4; + + final String originalFileName = "Gracie.bin"; + final String movedFileName = "Gracie.bak"; + + try { + final DataOutputStream originalFileStream = new DataOutputStream(new FileOutputStream(originalFileName)); + + byte[] bytes = new byte[4]; + + for (int i = 0; i < numIntsInBiggerThanAChunkSize; ++i) { + bytes[0] = (byte)i; + bytes[1] = (byte)(i >> 8); + bytes[2] = (byte)(i >> 16); + bytes[3] = (byte)(i >> 24); + originalFileStream.write(bytes); + } + + originalFileStream.close(); + + final Ds3Object ds3Object = new Ds3Object(); + ds3Object.setName(originalFileName); + ds3Object.setSize(biggerThanAChunkSize); + + final AtomicLong numBytesTransferred = new AtomicLong(0); + + final WriteJobOptions writeJobOptions = WriteJobOptions.create(); + writeJobOptions.withMaxUploadSize(chunkSize); + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJob(BUCKET_NAME, Collections.singletonList(ds3Object), writeJobOptions); + writeJob.attachDataTransferredListener(numBytesTransferred::addAndGet); + + final CountDownLatch writeCountDownLatch = new CountDownLatch(1); + + writeJob.attachObjectCompletedListener(name -> writeCountDownLatch.countDown()); + + writeJob.transfer(new FileObjectPutter(Paths.get("."))); + + writeCountDownLatch.await(); + + assertEquals(biggerThanAChunkSize, numBytesTransferred.get()); + + Files.move(Paths.get(originalFileName), Paths.get(movedFileName)); + + final CountDownLatch readCountdownLatch = new CountDownLatch(1); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJobUsingStreamedBehavior(BUCKET_NAME, Collections.singletonList(ds3Object)); + readJob.attachObjectCompletedListener(name -> readCountdownLatch.countDown()); + readJob.transfer(new FileObjectGetter(Paths.get("."))); + + readCountdownLatch.await(); + + assertTrue(FileUtils.contentEquals(new File(movedFileName), new File(originalFileName))); + } finally { + Files.deleteIfExists(Paths.get(originalFileName)); + Files.deleteIfExists(Paths.get(movedFileName)); + } + } +} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java similarity index 96% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java index b955d9c4d..6a003f121 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/GroupManagement_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -58,7 +58,7 @@ public static void teardown() throws IOException, SignatureException { } @Test - public void createDeleteGroup_Test() throws IOException, SignatureException { + public void createDeleteGroupTest() throws IOException, SignatureException { final String groupName = "create_delete_group_sdk_test"; try { @@ -77,7 +77,7 @@ public void createDeleteGroup_Test() throws IOException, SignatureException { } @Test - public void createDataPolicyForGroup_Test() throws IOException, SignatureException { + public void createDataPolicyForGroupTest() throws IOException, SignatureException { final String groupName = "create_data_policy_for_group_g"; final String dataPolicyName = "create_data_policy_for_group_dp"; UUID aclId = null; @@ -118,7 +118,7 @@ public void createDataPolicyForGroup_Test() throws IOException, SignatureExcepti } @Test - public void createGroupGroupMember_Test() throws IOException, SignatureException { + public void createGroupGroupMemberTest() throws IOException, SignatureException { final String parentGroupName = "create_group_group_member_parent"; final String childGroupName = "create_group_group_member_child"; @@ -159,7 +159,7 @@ public void createGroupGroupMember_Test() throws IOException, SignatureException } @Test - public void createBucketAclForGroup_Test() throws IOException, SignatureException { + public void createBucketAclForGroupTest() throws IOException, SignatureException { final String bucketName = "create_bucket_acl_for_group_b"; final String groupName = "create_bucket_acl_for_group_g"; diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Insecure_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Insecure_Test.java similarity index 96% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Insecure_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Insecure_Test.java index 4a3b2813e..0328c9241 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Insecure_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Insecure_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Iterators_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Iterators_Test.java similarity index 68% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Iterators_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Iterators_Test.java index b00eef72d..95e61406e 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Iterators_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Iterators_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,15 +15,18 @@ package com.spectralogic.ds3client.integration; +import com.google.common.collect.Lists; import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.helpers.pagination.GetBucketLoaderFactory; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.pagination.GetBucketKeyLoaderFactory; import com.spectralogic.ds3client.helpers.pagination.GetObjectsFullDetailsLoaderFactory; -import com.spectralogic.ds3client.utils.collections.LazyIterable; import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.models.Contents; +import com.spectralogic.ds3client.helpers.pagination.FileSystemKey; import com.spectralogic.ds3client.networking.FailedRequestException; +import com.spectralogic.ds3client.utils.collections.LazyIterable; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -33,10 +36,10 @@ import java.io.IOException; import java.net.URISyntaxException; import java.util.Iterator; +import java.util.List; import java.util.UUID; -import static com.spectralogic.ds3client.integration.Util.deleteAllContents; -import static com.spectralogic.ds3client.integration.Util.loadBookTestData; +import static com.spectralogic.ds3client.integration.Util.*; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -47,6 +50,7 @@ public class Iterators_Test { private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(CLIENT); private static final String TEST_ENV_NAME = "lazy_iterator_test"; private static final int RETRIES = 5; + private static final String TEST_DELIMITER = null; private static TempStorageIds envStorageIds; private static UUID envDataPolicyId; @@ -67,13 +71,31 @@ public static void teardown() throws IOException { LOG.info("Finished test teardown..."); } + @Test + public void iterateWithDelimiter() throws IOException, URISyntaxException { + try { + HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); + loadBookTestDataWithPrefix(CLIENT, TEST_ENV_NAME, "books/"); + final Iterable fileSystemKeysIterator = Ds3ClientHelpers.wrap(CLIENT).remoteListDirectory(TEST_ENV_NAME, "books/", null, 100); + final List fileSystemKeys = Lists.newArrayList(fileSystemKeysIterator); + assertThat(fileSystemKeys.size(), is(4)); + + loadBookTestDataWithPrefix(CLIENT, TEST_ENV_NAME, "books/more/"); + final Iterable anotherFileSystemKeysIterator = Ds3ClientHelpers.wrap(CLIENT).remoteListDirectory(TEST_ENV_NAME, "books/", null, 100); + final List anotherFileSystemKeys = Lists.newArrayList(anotherFileSystemKeysIterator); + assertThat(anotherFileSystemKeys.size(), is(5)); + } finally { + deleteAllContents(CLIENT, TEST_ENV_NAME); + } + } + @Test public void emptyGetBucket() throws IOException { final String prefix = ""; final String nextMarker = null; final int maxKeys = 100; - emptyTest(new GetBucketLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, nextMarker, maxKeys, RETRIES)); + emptyTest(new GetBucketKeyLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, TEST_DELIMITER, nextMarker, maxKeys, RETRIES, GetBucketKeyLoaderFactory.contentsFunction)); } @Test @@ -81,7 +103,7 @@ public void singlePageGetBucket() throws IOException, URISyntaxException { final String prefix = ""; final String nextMarker = null; final int maxKeys = 100; - paginate(new GetBucketLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, nextMarker, maxKeys, RETRIES)); + paginate(new GetBucketKeyLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, TEST_DELIMITER, nextMarker, maxKeys, RETRIES, GetBucketKeyLoaderFactory.contentsFunction)); } @@ -90,36 +112,36 @@ public void multiPageGetBucket() throws IOException, URISyntaxException { final String prefix = ""; final String nextMarker = null; final int maxKeys = 2; - paginate(new GetBucketLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, nextMarker, maxKeys, RETRIES)); + paginate(new GetBucketKeyLoaderFactory(CLIENT, TEST_ENV_NAME, prefix, nextMarker, TEST_DELIMITER, maxKeys, RETRIES, GetBucketKeyLoaderFactory.contentsFunction)); } @Test public void failedRequestGetBucket() { - testFailedRequest(new GetBucketLoaderFactory(CLIENT, "Unknown_Bucket",null, null, 1000, 5)); + testFailedRequest(new GetBucketKeyLoaderFactory(CLIENT, "Unknown_Bucket",null, TEST_DELIMITER,null, 1000, 5, GetBucketKeyLoaderFactory.contentsFunction)); } @Test public void emptyGetObjects() throws IOException { - emptyTest(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, "", 10, RETRIES, true)); + emptyTest(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, 10, RETRIES, true)); } @Test public void singlePageGetObjectsIterator() throws IOException, URISyntaxException { - paginate(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, "", 10, RETRIES, true)); + paginate(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, 10, RETRIES, true)); } @Test public void failedGetObjectsWithFullDetails() throws IOException, URISyntaxException { - testFailedRequest(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, "", 10, RETRIES, true)); + testFailedRequest(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, 10, RETRIES, true)); } @Test public void multiPageGetObjectsWithFullDetails() throws IOException, URISyntaxException { - paginate(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, "", 2, RETRIES, true)); + paginate(new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, 2, RETRIES, true)); } - private void emptyTest(final LazyIterable.LazyLoaderFactory lazyLoaderFactory) throws IOException { + private static void emptyTest(final LazyIterable.LazyLoaderFactory lazyLoaderFactory) throws IOException { HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); try { final LazyIterable iterable = new LazyIterable<>(lazyLoaderFactory); @@ -132,7 +154,7 @@ private void emptyTest(final LazyIterable.LazyLoaderFactory lazyLoaderFactory } } - private void paginate(final LazyIterable.LazyLoaderFactory loaderFactory) throws IOException, URISyntaxException { + private static void paginate(final LazyIterable.LazyLoaderFactory loaderFactory) throws IOException, URISyntaxException { HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); loadBookTestData(CLIENT, TEST_ENV_NAME); try { @@ -154,7 +176,7 @@ private void paginate(final LazyIterable.LazyLoaderFactory loaderFactory) thr } } - private void testFailedRequest(final LazyIterable.LazyLoaderFactory loaderFactory) { + private static void testFailedRequest(final LazyIterable.LazyLoaderFactory loaderFactory) { final LazyIterable iterable = new LazyIterable<>(loaderFactory); final Iterator iterator = iterable.iterator(); diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Metadata_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Metadata_Test.java similarity index 98% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Metadata_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Metadata_Test.java index 00733373e..6be9c54b1 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Metadata_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Metadata_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -125,7 +125,7 @@ public void multipleMetadataFields() throws IOException { @Test public void escapedMetadataWithSpaces() throws IOException { final String stringWithSpaces = "percent encoded space"; - final String escapedWithSpaces = MetadataStringManipulation.toEncodedString(stringWithSpaces); + final String escapedWithSpaces = MetadataStringManipulation.toEncodedKeyString(stringWithSpaces); final Metadata metadata = processMetadataRequest( "metadataBucket", @@ -145,7 +145,7 @@ public void escapedMetadataWithSpaces() throws IOException { @Test public void escapedMetadataWithSymbols() throws IOException { - final String escapedWithSymbols = MetadataStringManipulation.toEncodedString(STRING_WITH_SYMBOLS); + final String escapedWithSymbols = MetadataStringManipulation.toEncodedKeyString(STRING_WITH_SYMBOLS); final Metadata metadata = processMetadataRequest( "metadataBucket", diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java similarity index 99% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java index 3156e00f0..3d01ff4e9 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/NotificationsIntegration_test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java new file mode 100644 index 000000000..564b55e33 --- /dev/null +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java @@ -0,0 +1,2173 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.integration; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.Ds3ClientBuilder; +import com.spectralogic.ds3client.Ds3ClientImpl; +import com.spectralogic.ds3client.commands.*; +import com.spectralogic.ds3client.commands.spectrads3.*; +import com.spectralogic.ds3client.commands.spectrads3.notifications.*; +import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; +import com.spectralogic.ds3client.helpers.*; +import com.spectralogic.ds3client.helpers.channelbuilders.ObjectInputStreamBuilder; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; +import com.spectralogic.ds3client.helpers.options.WriteJobOptions; +import com.spectralogic.ds3client.helpers.pagination.GetBucketKeyLoaderFactory; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.*; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.SequentialFileReaderChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.*; +import com.spectralogic.ds3client.integration.test.helpers.*; +import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShimFactory.ClientFailureType; +import com.spectralogic.ds3client.metadata.MetadataAccessImpl; +import com.spectralogic.ds3client.models.*; +import com.spectralogic.ds3client.models.Objects; +import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import com.spectralogic.ds3client.utils.Platform; +import com.spectralogic.ds3client.utils.ResourceUtils; +import com.spectralogic.ds3client.utils.collections.LazyIterable; +import com.spectralogic.ds3client.utils.hashing.ChecksumUtils; +import com.spectralogic.ds3client.utils.hashing.Hasher; +import org.apache.commons.io.FileUtils; +import org.junit.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.net.URISyntaxException; +import java.nio.channels.ByteChannel; +import java.nio.channels.Channels; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +import static com.spectralogic.ds3client.commands.spectrads3.PutBulkJobSpectraS3Request.MIN_UPLOAD_SIZE_IN_BYTES; +import static com.spectralogic.ds3client.integration.Util.RESOURCE_BASE_NAME; +import static com.spectralogic.ds3client.integration.Util.cancelAllJobsForBucket; +import static com.spectralogic.ds3client.integration.Util.deleteAllContents; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +public class PutJobManagement_Test { + private static final Logger LOG = LoggerFactory.getLogger(PutJobManagement_Test.class); + + private static final Ds3Client client = Util.fromEnv(); + private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(client); + private static final String BUCKET_NAME = "Put_Job_Management_Test"; + private static final String TEST_ENV_NAME = "PutJobManagement_Test"; + private static TempStorageIds envStorageIds; + private static UUID envDataPolicyId; + + private static final String SOURCE_DIRECTORY = "little_files/"; + private static final String SOURCE_FILE_BASE_NAME = "tape"; + private static final String SOURCE_FILE_EXTENSION = "png"; + private static final String SOURCE_FILE_NAME = SOURCE_FILE_BASE_NAME + "." + SOURCE_FILE_EXTENSION; + + @BeforeClass + public static void startup() throws IOException { + envDataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, false, ChecksumType.Type.MD5, client); + envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, envDataPolicyId, client); + } + + @Before + public void setupBucket() throws IOException { + HELPERS.ensureBucketExists(BUCKET_NAME, envDataPolicyId); + } + + @AfterClass + public static void teardown() throws IOException { + TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client); + client.close(); + } + + @SuppressWarnings("deprecation") + @Test + public void nakedS3Put() throws IOException, URISyntaxException { + try { + final Path beowulfPath = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + "beowulf.txt"); + final SeekableByteChannel beowulfChannel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel("beowulf.txt"); + final PutObjectResponse putObjectResponse = client.putObject(new PutObjectRequest(BUCKET_NAME, "beowulf.txt", + beowulfChannel, Files.size(beowulfPath))); + assertThat(putObjectResponse, is(notNullValue())); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @SuppressWarnings("deprecation") + @Test + public void nakedS3PutEmptyFile() throws IOException, URISyntaxException { + try { + final String fileName = "emptyFile.txt"; + + final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(0); + final PutObjectResponse putObjectResponse = client.putObject( + new PutObjectRequest(BUCKET_NAME, fileName, channel, 0)); + assertThat(putObjectResponse, is(notNullValue())); + + final GetBucketResponse request = client.getBucket(new GetBucketRequest(BUCKET_NAME)); + final ListBucketResult result = request.getListBucketResult(); + + assertThat(result.getObjects().size(), is(1)); + final Contents contents = result.getObjects().get(0); + assertThat(contents.getKey(), is(fileName)); + assertThat(contents.getSize(), is((long) 0)); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @SuppressWarnings("deprecation") + @Test + public void nakedS3PutFolder() throws IOException, URISyntaxException { + try { + final String fileName = "NakedS3Folder/"; + + final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(0); + final PutObjectResponse putObjectResponse = client.putObject( + new PutObjectRequest(BUCKET_NAME, fileName, channel, 0)); + + assertThat(putObjectResponse, is(notNullValue())); + final GetBucketResponse request = client.getBucket(new GetBucketRequest(BUCKET_NAME)); + final ListBucketResult result = request.getListBucketResult(); + assertThat(result.getObjects().size(), is(1)); + + final Contents contents = result.getObjects().get(0); + assertThat(contents.getKey(), is(fileName)); + assertThat(contents.getSize(), is((long) 0)); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void getActiveJobs() throws IOException, URISyntaxException { + try { + final UUID jobID = HELPERS + .startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))).getJobId(); + final GetActiveJobsSpectraS3Response activeJobsResponse = client. + getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()); + final ArrayList activeJobsUUIDs = new ArrayList<>(); + for (final ActiveJob job : activeJobsResponse.getActiveJobListResult().getActiveJobs()) { + activeJobsUUIDs.add(job.getId()); + } + assertThat(activeJobsUUIDs, contains(jobID)); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void getJobs() throws IOException { + try { + final UUID jobID = HELPERS + .startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))).getJobId(); + final GetJobsSpectraS3Response getJobsResponse = client. + getJobsSpectraS3(new GetJobsSpectraS3Request()); + final ArrayList jobUUIDs = new ArrayList<>(); + for (final Job job : getJobsResponse.getJobListResult().getJobs()) { + jobUUIDs.add(job.getJobId()); + } + assertThat(jobUUIDs, contains(jobID)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void modifyJobPriority() throws IOException { + try { + final Ds3ClientHelpers.Job job = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)), + WriteJobOptions.create().withPriority(Priority.LOW)); + + client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) + .withPriority(Priority.HIGH)); + + final GetJobSpectraS3Response response = client + .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); + + assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void modifyJobName() throws IOException { + + try { + final Ds3ClientHelpers.Job job = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); + + client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) + .withName("newName")); + + final GetJobSpectraS3Response response = client + .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); + + assertThat(response.getMasterObjectListResult().getName(), is("newName")); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void modifyJobCreationDate() throws IOException { + + try { + final Ds3ClientHelpers.Job job = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); + final GetJobSpectraS3Response jobResponse = client + .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); + + final Date originalDate = jobResponse.getMasterObjectListResult().getStartDate(); + final Date newDate = new Date(originalDate.getTime() - 1000); + + client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) + .withCreatedAt(newDate)); + + final GetJobSpectraS3Response responseAfterModify = client + .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); + + assertThat(responseAfterModify.getMasterObjectListResult().getStartDate(), is(newDate)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void cancelJob() throws IOException { + + try { + final Ds3ClientHelpers.Job job = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); + + final CancelJobSpectraS3Response response = client + .cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId().toString())); + assertThat(response, is(notNullValue())); + + assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) + .getActiveJobListResult().getActiveJobs().isEmpty()); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void clearAllCanceledJobs() throws IOException { + + try { + final Ds3ClientHelpers.Job job = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); + client.cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId().toString())); + client.clearAllCanceledJobsSpectraS3(new ClearAllCanceledJobsSpectraS3Request()); + final List canceledJobsList = client. + getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()) + .getCanceledJobListResult().getCanceledJobs(); + + assertTrue(canceledJobsList.isEmpty()); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void truncatePutJob() throws Exception { + + final int testTimeOutSeconds = 5; + final String book1 = "beowulf.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); + + try { + final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); + final UUID jobId = putJob.getJobId(); + final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); + + client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); + + final TruncateJobSpectraS3Response truncateJobSpectraS3Response = client.truncateJobSpectraS3( + new TruncateJobSpectraS3Request(jobId.toString())); + assertThat(truncateJobSpectraS3Response, is(notNullValue())); + + final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId.toString())); + assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void cancelJobWithForce() throws Exception { + + final int testTimeOutSeconds = 5; + + final String book1 = "beowulf.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); + + try { + final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); + final UUID jobId = putJob.getJobId(); + final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); + + client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); + + final CancelJobSpectraS3Response responseWithForce = client + .cancelJobSpectraS3(new CancelJobSpectraS3Request(jobId.toString())); + assertThat(responseWithForce, is(notNullValue())); + + //Allow for lag time before canceled job appears~1.5 seconds in unloaded system + final long startTimeCanceledUpdate = System.nanoTime(); + boolean jobCanceled = false; + while (!jobCanceled) { + Thread.sleep(500); + final GetCanceledJobsSpectraS3Response canceledJobs = client.getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()); + for (final CanceledJob canceledJob : canceledJobs.getCanceledJobListResult().getCanceledJobs()) { + if (canceledJob.getId().equals(jobId)) { + jobCanceled = true; + } + } + assertThat((System.nanoTime() - startTimeCanceledUpdate) / 1000000000, lessThan((long) testTimeOutSeconds)); + } + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void cancelAllJobs() throws IOException { + + try { + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); + final List objectsTwo = Lists.newArrayList(new Ds3Object("testTwo", 2)); + HELPERS.startWriteJob(BUCKET_NAME, objectsTwo); + client.cancelAllJobsSpectraS3(new CancelAllJobsSpectraS3Request()); + + assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) + .getActiveJobListResult().getActiveJobs().isEmpty()); + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void truncateAllJobs() throws Exception { + + final int testTimeOutSeconds = 5; + final String book1 = "beowulf.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final String book2 = "ulysses.txt"; + final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object("place_holder_1", 5000000); + final Ds3Object obj3 = new Ds3Object(book2, Files.size(objPath2)); + final Ds3Object obj4 = new Ds3Object("place_holder_2", 5000000); + + try { + final Ds3ClientHelpers.Job putJob1 = HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(obj1, obj2)); + final UUID jobId1 = putJob1.getJobId(); + final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); + client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId1.toString(), 0, Files.size(objPath1))); + + final Ds3ClientHelpers.Job putJob2 = HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(obj3, obj4)); + final UUID jobId2 = putJob2.getJobId(); + final SeekableByteChannel book2Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book2); + client.putObject(new PutObjectRequest(BUCKET_NAME, book2, book2Channel, jobId2.toString(), 0, Files.size(objPath2))); + + HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(new Ds3Object("place_holder_3", 1000000))); + + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId1, client, 20); + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId2, client, 20); + + final TruncateAllJobsSpectraS3Response truncateAllJobsSpectraS3Response = client + .truncateAllJobsSpectraS3(new TruncateAllJobsSpectraS3Request()); + + assertThat(truncateAllJobsSpectraS3Response, is(notNullValue())); + + final GetJobSpectraS3Response truncatedJob1 = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId1.toString())); + assertEquals(truncatedJob1.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); + + final GetJobSpectraS3Response truncatedJob2 = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId2.toString())); + assertEquals(truncatedJob2.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath2)); + + assertThat(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) + .getActiveJobListResult().getActiveJobs().size(), is(2)); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void cancelAllJobsWithForce() throws Exception { + + final int testTimeOutSeconds = 5; + final String book1 = "beowulf.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final String book2 = "ulysses.txt"; + final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object("place_holder_1", 5000000); + final Ds3Object obj3 = new Ds3Object(book2, Files.size(objPath2)); + final Ds3Object obj4 = new Ds3Object("place_holder_2", 5000000); + + try { + final Ds3ClientHelpers.Job putJob1 = HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(obj1, obj2)); + final UUID jobId1 = putJob1.getJobId(); + final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); + client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId1.toString(), 0, Files.size(objPath1))); + + final Ds3ClientHelpers.Job putJob2 = HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(obj3, obj4)); + final UUID jobId2 = putJob2.getJobId(); + final SeekableByteChannel book2Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book2); + client.putObject(new PutObjectRequest(BUCKET_NAME, book2, book2Channel, jobId2.toString(), 0, Files.size(objPath2))); + + HELPERS.startWriteJob(BUCKET_NAME, Lists + .newArrayList(new Ds3Object("place_holder_3", 1000000))); + + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId1, client, 20); + ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId2, client, 20); + + client.cancelAllJobsSpectraS3(new CancelAllJobsSpectraS3Request()); + + assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) + .getActiveJobListResult().getActiveJobs().isEmpty()); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void getCanceledJobs() throws IOException { + + try { + final Ds3ClientHelpers.Job jobOne = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))); + final UUID jobOneId = jobOne.getJobId(); + client.cancelJobSpectraS3(new CancelJobSpectraS3Request(jobOneId.toString())); + + final GetCanceledJobsSpectraS3Response getCanceledJobsResponse = client + .getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()); + + final List canceledJobsUUIDs = new ArrayList<>(); + for (final CanceledJob job : getCanceledJobsResponse.getCanceledJobListResult().getCanceledJobs()) { + canceledJobsUUIDs.add(job.getId()); + } + + assertTrue(canceledJobsUUIDs.contains(jobOneId)); + + } finally { + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void getJobChunksReady() throws IOException { + + try { + final Ds3Object ds3Object = new Ds3Object("test", 2); + final Ds3ClientHelpers.Job jobOne = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(ds3Object)); + final UUID jobOneId = jobOne.getJobId(); + + final GetJobChunksReadyForClientProcessingSpectraS3Response response = client + .getJobChunksReadyForClientProcessingSpectraS3 + (new GetJobChunksReadyForClientProcessingSpectraS3Request(jobOneId.toString())); + + final List chunkNames = new ArrayList<>(); + for (final Objects objectList : response.getMasterObjectListResult().getObjects()) { + for (final BulkObject bulkObject : objectList.getObjects()) { + chunkNames.add(bulkObject.getName()); + } + } + + assertThat(chunkNames, contains(ds3Object.getName())); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void getJobChunk() throws IOException { + + try { + final Ds3Object ds3Object = new Ds3Object("test", 2); + final Ds3ClientHelpers.Job jobOne = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(ds3Object)); + final UUID jobOneId = jobOne.getJobId(); + + final GetJobChunksReadyForClientProcessingSpectraS3Response response = client + .getJobChunksReadyForClientProcessingSpectraS3 + (new GetJobChunksReadyForClientProcessingSpectraS3Request(jobOneId)); + + final UUID aJobChunkID = response.getMasterObjectListResult().getObjects().get(0).getChunkId(); + + final GetJobChunkSpectraS3Response getJobChunkSpectraS3Response = client.getJobChunkSpectraS3( + new GetJobChunkSpectraS3Request(aJobChunkID)); + + assertThat(getJobChunkSpectraS3Response.getObjectsResult(), is(notNullValue())); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void aggregateTwoJobs() throws IOException { + + try { + final WriteJobOptions writeJobOptions = WriteJobOptions.create().withAggregating(); + + final Ds3ClientHelpers.Job jobOne = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)), writeJobOptions); + final UUID jobOneId = jobOne.getJobId(); + + final Ds3ClientHelpers.Job jobTwo = + HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test2", 2)), writeJobOptions); + final UUID jobTwoId = jobTwo.getJobId(); + + assertThat(jobOneId, is(jobTwoId)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testPutJobOptionsWithStreamingBehavior() throws IOException { + + try { + final WriteJobOptions writeJobOptions = WriteJobOptions.create().withAggregating(); + + final Ds3ClientHelpers.Job jobOne = HELPERS.startWriteJobUsingStreamedBehavior(BUCKET_NAME, + Lists.newArrayList(new Ds3Object("test", 2)), + writeJobOptions); + final UUID jobOneId = jobOne.getJobId(); + + final Ds3ClientHelpers.Job jobTwo = HELPERS.startWriteJobUsingStreamedBehavior(BUCKET_NAME, + Lists.newArrayList(new Ds3Object("test2", 2)), + writeJobOptions); + final UUID jobTwoId = jobTwo.getJobId(); + + assertThat(jobOneId, is(jobTwoId)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testPutJobOptionsWithRandomAccessBehavior() throws IOException { + + try { + final WriteJobOptions writeJobOptions = WriteJobOptions.create().withAggregating(); + + final Ds3ClientHelpers.Job jobOne = HELPERS.startWriteJobUsingRandomAccessBehavior(BUCKET_NAME, + Lists.newArrayList(new Ds3Object("test", 2)), + writeJobOptions); + final UUID jobOneId = jobOne.getJobId(); + + final Ds3ClientHelpers.Job jobTwo = HELPERS.startWriteJobUsingRandomAccessBehavior(BUCKET_NAME, + Lists.newArrayList(new Ds3Object("test2", 2)), + writeJobOptions); + final UUID jobTwoId = jobTwo.getJobId(); + + assertThat(jobOneId, is(jobTwoId)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void allocateJobChunk() throws IOException { + + try { + final PutBulkJobSpectraS3Response putBulkResponse = client. + putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)))); + final UUID chunkUUID = putBulkResponse.getMasterObjectList().getObjects().get(0).getChunkId(); + final AllocateJobChunkSpectraS3Response allocateResponse = client + .allocateJobChunkSpectraS3(new AllocateJobChunkSpectraS3Request(chunkUUID.toString())); + + assertThat(allocateResponse.getStatus(), is(AllocateJobChunkSpectraS3Response.Status.ALLOCATED)); + + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void putObjectCachedNotification() throws IOException { + final PutObjectCachedNotificationRegistrationSpectraS3Response putNotificationResponse = client + .putObjectCachedNotificationRegistrationSpectraS3 + (new PutObjectCachedNotificationRegistrationSpectraS3Request("test@test.test")); + + assertThat(putNotificationResponse.getS3ObjectCachedNotificationRegistrationResult(), is(notNullValue())); + } + + @Test + public void getObjectCachedNotification() throws IOException { + + final PutObjectCachedNotificationRegistrationSpectraS3Response putNotificationResponse = client + .putObjectCachedNotificationRegistrationSpectraS3 + (new PutObjectCachedNotificationRegistrationSpectraS3Request("test@test.test")); + final GetObjectCachedNotificationRegistrationSpectraS3Response getNotificationResponse = client + .getObjectCachedNotificationRegistrationSpectraS3( + (new GetObjectCachedNotificationRegistrationSpectraS3Request + (putNotificationResponse.getS3ObjectCachedNotificationRegistrationResult().getId().toString()))); + + assertThat(getNotificationResponse.getS3ObjectCachedNotificationRegistrationResult(), is(notNullValue())); + } + + @Test + public void getCompletedJobs() throws IOException { + final GetCompletedJobsSpectraS3Response getCompletedJobsResponse = client. + getCompletedJobsSpectraS3(new GetCompletedJobsSpectraS3Request()); + + assertThat(getCompletedJobsResponse.getCompletedJobListResult(), is(notNullValue())); + } + + @Test + public void clearCompletedJobs() throws IOException { + final ClearAllCompletedJobsSpectraS3Response clearAllCompletedJobsResponse = client + .clearAllCompletedJobsSpectraS3(new ClearAllCompletedJobsSpectraS3Request()); + + assertThat(clearAllCompletedJobsResponse, is(notNullValue())); + } + + @Test + public void putJobCreatedNotification() throws IOException { + UUID notificationUUID = null; + try { + final PutJobCreatedNotificationRegistrationSpectraS3Response response = client + .putJobCreatedNotificationRegistrationSpectraS3(new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")); + notificationUUID = response.getJobCreatedNotificationRegistrationResult().getId(); + assertThat(response.getJobCreatedNotificationRegistrationResult(), is(notNullValue())); + + } finally { + if (notificationUUID != null) { + client.deleteJobCreatedNotificationRegistrationSpectraS3( + new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); + } + } + } + + @Test + public void getJobCreatedNotification() throws IOException { + UUID notificationUUID = null; + try { + notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( + new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) + .getJobCreatedNotificationRegistrationResult().getId(); + + final GetJobCreatedNotificationRegistrationSpectraS3Response response = client + .getJobCreatedNotificationRegistrationSpectraS3(new + GetJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); + + assertThat(response.getJobCreatedNotificationRegistrationResult(), is(notNullValue())); + + } finally { + if (notificationUUID != null) { + client.deleteJobCreatedNotificationRegistrationSpectraS3( + new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); + } + } + } + + @Test + public void deleteJobCreatedNotification() throws IOException { + final UUID notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( + new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) + .getJobCreatedNotificationRegistrationResult().getId(); + + final DeleteJobCreatedNotificationRegistrationSpectraS3Response response = client + .deleteJobCreatedNotificationRegistrationSpectraS3(new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); + + assertThat(response, is(notNullValue())); + } + + @Test + public void putJobCompletedNotification() throws IOException { + UUID notificationUUID = null; + try { + final PutJobCompletedNotificationRegistrationSpectraS3Response response = client + .putJobCompletedNotificationRegistrationSpectraS3( + new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")); + notificationUUID = response.getJobCompletedNotificationRegistrationResult().getId(); + assertThat(response.getJobCompletedNotificationRegistrationResult(), is(notNullValue())); + } finally { + if (notificationUUID != null) { + client.deleteJobCompletedNotificationRegistrationSpectraS3( + new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); + } + } + } + + @Test + public void getJobCompletedNotification() throws IOException { + UUID notificationUUID = null; + try { + notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( + new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) + .getJobCompletedNotificationRegistrationResult().getId(); + + final GetJobCompletedNotificationRegistrationSpectraS3Response response = client + .getJobCompletedNotificationRegistrationSpectraS3( + new GetJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); + + assertThat(response.getJobCompletedNotificationRegistrationResult(), is(notNullValue())); + + } finally { + if (notificationUUID != null) { + client.deleteJobCompletedNotificationRegistrationSpectraS3( + new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); + } + } + } + + @Test + public void deleteJobCompletedNotification() throws IOException { + final UUID notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( + new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) + .getJobCompletedNotificationRegistrationResult().getId(); + + final DeleteJobCompletedNotificationRegistrationSpectraS3Response response = client + .deleteJobCompletedNotificationRegistrationSpectraS3( + new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); + + assertThat(response, is(notNullValue())); + } + + @Test + public void testWriteJobWithRetries() throws Exception { + final int maxNumObjectTransferAttempts = 3; + final boolean computeChecksumWithUserSuppliedFunction = false; + + transferAndCheckFileContent(maxNumObjectTransferAttempts, + new ObjectTransferExceptionHandler() { + @Override + public boolean handleException(final Throwable t) { + t.printStackTrace(); + fail("Got unexpected exception: " + t.getMessage()); + return false; + } + }, computeChecksumWithUserSuppliedFunction); + } + + private static void transferAndCheckFileContent(final int maxNumObjectTransferAttempts, + final ObjectTransferExceptionHandler objectTransferExceptionHandler, + final boolean computeChecksumWithUserSuppliedFunction) + throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, URISyntaxException + { + final String userAgent = "Agent Provocateur"; + + final Ds3Client clientWithUserAgent = Ds3ClientBuilder.fromEnv() + .withUserAgent(userAgent) + .withHttps(false) + .build(); + + final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) clientWithUserAgent); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final String DIR_NAME = "largeFiles/"; + final String[] FILE_NAMES = new String[]{"lesmis-copies.txt"}; + + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objects = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objects.add(obj); + } + + final int maxNumBlockAllocationRetries = 1; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final AtomicInteger numTimesObjectCompletedEventCalled = new AtomicInteger(0); + final AtomicInteger numTimesDataTransferredEventCalled = new AtomicInteger(0); + final AtomicBoolean dataTransferredEventReceived = new AtomicBoolean(false); + final AtomicBoolean objectCompletedEventReceived = new AtomicBoolean(false); + final AtomicBoolean checksumEventReceived = new AtomicBoolean(false); + final AtomicBoolean waitingForChunksEventReceived = new AtomicBoolean(false); + final AtomicBoolean failureEventReceived = new AtomicBoolean(false); + final AtomicBoolean checksumFunctionCalled = new AtomicBoolean(false); + + final WriteJobOptions writeJobOptions = WriteJobOptions.create() + .withChecksumType(ChecksumType.Type.MD5); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects, writeJobOptions); + + if (computeChecksumWithUserSuppliedFunction) { + writeJob.withChecksum(new ChecksumFunction() { + @Override + public String compute(final BulkObject obj, final ByteChannel channel) { + checksumFunctionCalled.set(true); + try { + final InputStream dataStream = new BufferedInputStream(Channels.newInputStream(channel)); + + dataStream.mark(Integer.MAX_VALUE); + + final Hasher hasher = ChecksumUtils.getHasher(ChecksumType.Type.MD5); + + final String checksum = ChecksumUtils.hashInputStream(hasher, dataStream); + + LOG.info("Computed checksum for blob: {}", checksum); + + dataStream.reset(); + + return checksum; + } catch (final IOException e) { + LOG.error("Error calculating checksum for: " + obj.getName(), e); + fail("Error calculating checksum for: " + obj.getName()); + } + + return null; + } + }); + } + + writeJob.attachFailureEventListener(new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + failureEventReceived.set(true); + } + }); + + writeJob.attachChecksumListener(new ChecksumListener() { + @Override + public void value(final BulkObject obj, final ChecksumType.Type type, final String checksum) { + checksumEventReceived.set(true); + assertEquals("0feqCQBgdtmmgGs9pB/Huw==", checksum); + } + }); + + writeJob.attachObjectCompletedListener(new ObjectCompletedListener() { + private int numCompletedObjects = 0; + + @Override + public void objectCompleted(final String name) { + objectCompletedEventReceived.set(true); + assertTrue(bookTitles.contains(name)); + assertEquals(1, ++numCompletedObjects); + numTimesObjectCompletedEventCalled.getAndIncrement(); + } + }); + + writeJob.attachDataTransferredListener(new DataTransferredListener() { + @Override + public void dataTransferred(final long size) { + dataTransferredEventReceived.set(true); + assertEquals(objects.get(0).getSize(), size); + numTimesDataTransferredEventCalled.getAndIncrement(); + } + }); + + writeJob.attachWaitingForChunksListener(new WaitingForChunksListener() { + @Override + public void waiting(final int secondsToWait) { + waitingForChunksEventReceived.set(true); + } + }); + + boolean shouldContinueTest = true; + + try { + writeJob.transfer(new FileObjectPutter(dirPath)); + } catch (final Throwable t) { + shouldContinueTest = objectTransferExceptionHandler.handleException(t); + } + + if (!shouldContinueTest) { + return; + } + + if (computeChecksumWithUserSuppliedFunction) { + assertTrue(checksumFunctionCalled.get()); + } else { + assertFalse(checksumFunctionCalled.get()); + } + assertTrue(dataTransferredEventReceived.get()); + assertTrue(objectCompletedEventReceived.get()); + assertTrue(checksumEventReceived.get()); + assertFalse(waitingForChunksEventReceived.get()); + assertFalse(failureEventReceived.get()); + + assertEquals(1, numTimesObjectCompletedEventCalled.get()); + assertEquals(1, numTimesDataTransferredEventCalled.get()); + + final GetBucketResponse request = ds3ClientShim.getBucket(new GetBucketRequest(BUCKET_NAME)); + final ListBucketResult result = request.getListBucketResult(); + + assertEquals(bookTitles.size(), result.getObjects().size()); + + for (final Contents contents : result.getObjects()) { + assertTrue(bookTitles.contains(contents.getKey())); + } + + final Ds3ClientHelpers.Job readJob = Ds3ClientHelpers.wrap(ds3ClientShim, 1) + .startReadAllJob(BUCKET_NAME); + readJob.attachObjectCompletedListener(new ObjectCompletedListener() { + @Override + public void objectCompleted(final String name) { + assertTrue(bookTitles.contains(name)); + + try { + final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAMES[0]).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), FILE_NAMES[0]).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + } catch (final URISyntaxException | IOException e) { + fail("Failure trying to compare file we wrote to file we read."); + } + } + }); + + readJob.transfer(new FileObjectGetter(tempDirectory)); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + deleteAllContents(ds3ClientShim, BUCKET_NAME); + } + } + + private interface ObjectTransferExceptionHandler { + boolean handleException(final Throwable t); + } + + @Test + public void testWriteJobWithZeroLengthObject() throws Exception { + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), null); + final Path tempFile = Files.createTempFile(tempDirectory, "EmptyFile", null); + final String fileName = tempFile.getFileName().toString(); + + try { + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + + final ImmutableList objects = ImmutableList.of(new Ds3Object(fileName, 0)); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); + writeJob.transfer(new FileObjectPutter(tempDirectory)); + + final GetBucketResponse request = client.getBucket(new GetBucketRequest(BUCKET_NAME)); + final ListBucketResult result = request.getListBucketResult(); + assertThat(result.getObjects().size(), is(1)); + + final Contents contents = result.getObjects().get(0); + assertThat(contents.getKey(), is(fileName)); + assertThat(contents.getSize(), is((long) 0)); + + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testWriteJobWithRetriesAndUserDefinedChecksum() throws Exception { + final int maxNumObjectTransferAttempts = 3; + final boolean computeChecksumWithUserSuppliedFunction = true; + + transferAndCheckFileContent(maxNumObjectTransferAttempts, + new ObjectTransferExceptionHandler() { + @Override + public boolean handleException(final Throwable t) { + t.printStackTrace(); + fail("Got unexpected exception: " + t.getMessage()); + return false; + } + }, computeChecksumWithUserSuppliedFunction); + } + + @Test(timeout = 30000) + public void testWriteJobWithRetriesThrowsDs3NoMoreRetriesException() throws Exception { + final int maxNumObjectTransferAttempts = 1; + final boolean computeChecksumWithUserSuppliedFunction = false; + + transferAndCheckFileContent(maxNumObjectTransferAttempts, + new ObjectTransferExceptionHandler() { + @Override + public boolean handleException(final Throwable t) { + if (!(t instanceof Ds3NoMoreRetriesException)) { + fail("Got exception of unexpected type: " + t.getMessage()); + return true; + } + + return false; + } + }, computeChecksumWithUserSuppliedFunction); + } + + @Test(timeout = 30000) + public void testFiringOnFailureEventWithFailedChunkAllocation() + throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailureEventsFired = new AtomicInteger(0); + + final int maxNumObjectTransferAttempts = 1; + final Ds3ClientHelpers.Job writeJob = createWriteJobWithObjectsReadyToTransfer(maxNumObjectTransferAttempts, + ClientFailureType.ChunkAllocation); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailureEventsFired.getAndIncrement(); + assertEquals(FailureEvent.FailureActivity.PuttingObject, failureEvent.doingWhat()); + } + }; + + writeJob.attachFailureEventListener(failureEventListener); + + try { + writeJob.transfer(new FileObjectPutter(tempDirectory)); + } catch (final Ds3NoMoreRetriesException e) { + assertEquals(1, numFailureEventsFired.get()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + static Ds3ClientHelpers.Job createWriteJobWithObjectsReadyToTransfer(final int maxNumObjectTransferAttempts, + final ClientFailureType clientFailureType) + throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String DIR_NAME = "largeFiles/"; + final String[] FILE_NAMES = new String[]{"lesmis-copies.txt"}; + + final List bookTitles = new ArrayList<>(); + final List objects = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objects.add(obj); + } + + final Ds3Client ds3Client = Ds3ClientShimFactory.makeWrappedDs3Client(clientFailureType, client); + + final int maxNumBlockAllocationRetries = 3; + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3Client, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + return ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); + } + + @Test(timeout = 30000) + public void testFiringWaitingForChunksEventWithFailedChunkAllocation() + throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailureEventsFired = new AtomicInteger(0); + final AtomicInteger numWaitingForChunksEventsFired = new AtomicInteger(0); + + final int maxNumObjectTransferAttempts = 1; + final Ds3ClientHelpers.Job writeJob = createWriteJobWithObjectsReadyToTransfer(maxNumObjectTransferAttempts, + ClientFailureType.ChunkAllocation); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailureEventsFired.getAndIncrement(); + assertEquals(FailureEvent.FailureActivity.PuttingObject, failureEvent.doingWhat()); + } + }; + + writeJob.attachFailureEventListener(failureEventListener); + + writeJob.attachWaitingForChunksListener(new WaitingForChunksListener() { + @Override + public void waiting(final int secondsToWait) { + numWaitingForChunksEventsFired.getAndIncrement(); + } + }); + + try { + writeJob.transfer(new FileObjectPutter(tempDirectory)); + } catch (final Ds3NoMoreRetriesException e) { + assertThat(numWaitingForChunksEventsFired.get(), is(greaterThanOrEqualTo(1))); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testFiringOnFailureEventWithFailedPutObject() + throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final AtomicInteger numFailureEventsFired = new AtomicInteger(); + + final int maxNumObjectTransferAttempts = 1; + final Ds3ClientHelpers.Job writeJob = createWriteJobWithObjectsReadyToTransfer(maxNumObjectTransferAttempts, + ClientFailureType.PutObject); + + final FailureEventListener failureEventListener = new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numFailureEventsFired.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.PuttingObject, failureEvent.doingWhat()); + } + }; + + writeJob.attachFailureEventListener(failureEventListener); + + try { + writeJob.transfer(new FileObjectPutter(tempDirectory)); + } catch (final IOException | RuntimeException e) { + assertEquals(1, numFailureEventsFired.get()); + } + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testPutJobUsingTransferStrategy() throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(putBulkJobSpectraS3Response.getMasterObjectList()) + .withChannelBuilder(new FileObjectPutter(dirPath)); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + + transferStrategy.transfer(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testWriteJobUsingTransferStrategy() throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(putBulkJobSpectraS3Response.getMasterObjectList()) + .withChannelBuilder(new FileObjectPutter(dirPath)); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(transferStrategy); + + writeJob.transfer(); + + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testPutJobWithUserSuppliedBlobStrategy() throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final MasterObjectList masterObjectList = putBulkJobSpectraS3Response.getMasterObjectList(); + + final EventDispatcher eventDispatcher = new EventDispatcherImpl(new SameThreadEventRunner()); + + final AtomicInteger numChunkAllocationAttempts = new AtomicInteger(0); + + final BlobStrategy blobStrategy = new UserSuppliedPutBlobStrategy(client, + masterObjectList, + eventDispatcher, + new MaxChunkAttemptsRetryBehavior(5), + new ClientDefinedChunkAttemptRetryDelayBehavior(1, eventDispatcher), + new Monitorable() { + @Override + public void monitor() { + numChunkAllocationAttempts.incrementAndGet(); + } + }); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(new FileObjectPutter(dirPath)) + .withBlobStrategy(blobStrategy); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + transferStrategy.transfer(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + + assertEquals(1, numChunkAllocationAttempts.get()); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + private interface Monitorable { + void monitor(); + } + + private static class UserSuppliedPutBlobStrategy implements BlobStrategy { + private final BlobStrategy wrappedBlobStrategy; + private final Monitorable monitorable; + + private UserSuppliedPutBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior, + final Monitorable monitorable) + { + this.monitorable = monitorable; + + wrappedBlobStrategy = new PutSequentialBlobStrategy(client, masterObjectList, eventDispatcher, retryBehavior, chunkAttemptRetryDelayBehavior); + } + + @Override + public Iterable getWork() throws IOException, InterruptedException { + monitorable.monitor(); + + return wrappedBlobStrategy.getWork(); + } + } + + @Test + public void testPutJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException, URISyntaxException { + testPutJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder; + } + }); + } + + private static void testPutJobWithUserSuppliedChannelStrategy(final TransferStrategyBuilderModifiable strategyBuilderModifiable) throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final MasterObjectList masterObjectList = putBulkJobSpectraS3Response.getMasterObjectList(); + + final AtomicInteger numTimesChannelOpened = new AtomicInteger(0); + final AtomicInteger numTimesChannelClosed = new AtomicInteger(0); + + final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder = new FileObjectPutter(dirPath); + final ChannelStrategy channelStrategy = new UserSuppliedPutChannelStrategy(objectChannelBuilder, + new ChannelMonitorable() { + @Override + public void acquired() { + numTimesChannelOpened.incrementAndGet(); + } + + @Override + public void released() { + numTimesChannelClosed.incrementAndGet(); + } + }); + + TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(masterObjectList) + .withChannelStrategy(channelStrategy); + + transferStrategyBuilder = strategyBuilderModifiable.modify(transferStrategyBuilder); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + transferStrategy.transfer(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + + assertEquals(1, numTimesChannelOpened.get()); + assertEquals(1, numTimesChannelClosed.get()); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + private interface TransferStrategyBuilderModifiable { + TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder); + } + + private interface ChannelMonitorable { + void acquired(); + void released(); + } + + private static class UserSuppliedPutChannelStrategy implements ChannelStrategy { + private final ChannelMonitorable channelMonitorable; + private final ChannelStrategy wrappedPutStrategy; + + + private UserSuppliedPutChannelStrategy(final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder, + final ChannelMonitorable channelMonitorable) + { + this.channelMonitorable = channelMonitorable; + wrappedPutStrategy = new SequentialFileReaderChannelStrategy(objectChannelBuilder); + } + + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + channelMonitorable.acquired(); + return wrappedPutStrategy.acquireChannelForBlob(blob); + } + + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + channelMonitorable.released(); + wrappedPutStrategy.releaseChannelForBlob(seekableByteChannel, blob); + } + } + + @Test + public void testStreamingPutJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException, URISyntaxException { + testPutJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder.usingStreamedTransferBehavior(); + } + }); + } + + @Test + public void testRandomAccessPutJobWithUserSuppliedChannelStrategy() throws IOException, InterruptedException, URISyntaxException { + testPutJobWithUserSuppliedChannelStrategy(new TransferStrategyBuilderModifiable() { + @Override + public TransferStrategyBuilder modify(final TransferStrategyBuilder transferStrategyBuilder) { + return transferStrategyBuilder.usingRandomAccessTransferBehavior(); + } + }); + } + + @Test + public void testPutJobWithUserSuppliedTransferRetryDecorator() throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final AtomicInteger numTimesTransferCalled = new AtomicInteger(0); + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(putBulkJobSpectraS3Response.getMasterObjectList()) + .withChannelBuilder(new FileObjectPutter(dirPath)) + .withTransferRetryDecorator(new UserSuppliedTransferRetryDecorator(new Monitorable() { + @Override + public void monitor() { + numTimesTransferCalled.getAndIncrement(); + } + })); + + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + + transferStrategy.transfer(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + + assertEquals(1, numTimesTransferCalled.get()); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + private static class UserSuppliedTransferRetryDecorator implements TransferRetryDecorator { + private final TransferRetryDecorator transferRetryDecorator; + private final Monitorable monitorable; + + private UserSuppliedTransferRetryDecorator(final Monitorable monitorable) { + this.transferRetryDecorator = new MaxNumObjectTransferAttemptsDecorator(5); + this.monitorable = monitorable; + } + + @Override + public TransferMethod wrap(final TransferMethod transferMethod) { + transferRetryDecorator.wrap(transferMethod); + return this; + } + + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + monitorable.monitor(); + transferRetryDecorator.transferJobPart(jobPart); + } + } + + @Test + public void testPutJobWithUserSuppliedChunkAttemptRetryBehavior() throws IOException, InterruptedException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite)); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request); + + final AtomicInteger numTimesInvokeCalled = new AtomicInteger(0); + final AtomicInteger numTimesResetCalled = new AtomicInteger(0); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withDs3Client(client) + .withMasterObjectList(putBulkJobSpectraS3Response.getMasterObjectList()) + .withChannelBuilder(new FileObjectPutter(dirPath)) + .withChunkAttemptRetryBehavior( + new UserSuppliedChunkAttemptRetryBehavior(new ChunkAttemptRetryBehaviorMonitorable() { + @Override + public void invoke() { + numTimesInvokeCalled.getAndIncrement(); + } + + @Override + public void reset() { + numTimesResetCalled.getAndIncrement(); + } + })); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + + transferStrategy.transfer(); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + + assertEquals(0, numTimesInvokeCalled.get()); + assertEquals(1, numTimesResetCalled.get()); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + private static class UserSuppliedChunkAttemptRetryBehavior implements ChunkAttemptRetryBehavior { + private final ChunkAttemptRetryBehaviorMonitorable chunkAttemptRetryBehaviorMonitorable; + private final ChunkAttemptRetryBehavior wrappedChunkAttemptRetryBehavior; + + private UserSuppliedChunkAttemptRetryBehavior(final ChunkAttemptRetryBehaviorMonitorable chunkAttemptRetryBehaviorMonitorable) { + this.chunkAttemptRetryBehaviorMonitorable = chunkAttemptRetryBehaviorMonitorable; + wrappedChunkAttemptRetryBehavior = new MaxChunkAttemptsRetryBehavior(5); + } + + @Override + public void invoke() throws IOException { + chunkAttemptRetryBehaviorMonitorable.invoke(); + wrappedChunkAttemptRetryBehavior.invoke(); + } + + @Override + public void reset() { + chunkAttemptRetryBehaviorMonitorable.reset(); + wrappedChunkAttemptRetryBehavior.reset(); + } + } + + private interface ChunkAttemptRetryBehaviorMonitorable { + void invoke(); + void reset(); + } + + @Test + public void testPutJobUsingStreamedTransferStrategy() throws IOException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJobUsingStreamedBehavior(BUCKET_NAME, objectsToWrite); + writeJob.transfer(new FileObjectPutter(dirPath)); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + public static class StreamObjectPutter extends ObjectInputStreamBuilder { + final InputStream _is; + + public StreamObjectPutter(final InputStream is) { + _is = is; + } + + @Override + public InputStream buildInputStream(final String key) { + return _is; + } + } + + @Test + public void testPutJobUsingStreamedTransferStrategyAboveChunk() throws IOException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"Paw-3.1.9.zip"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + objectsToWrite.add(obj); + } + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJobUsingStreamedBehavior(BUCKET_NAME, objectsToWrite, WriteJobOptions.create()); + writeJob.transfer(new StreamObjectPutter(new FileInputStream(dirPath.resolve("Paw-3.1.9.zip").toFile()))); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testPutJobUsingRandomAccessTransferStrategy() throws IOException, URISyntaxException { + final String DIR_NAME = "books/"; + final String[] FILE_NAMES = new String[]{"beowulf.txt"}; + + try { + final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); + + final List bookTitles = new ArrayList<>(); + final List objectsToWrite = new ArrayList<>(); + for (final String book : FILE_NAMES) { + final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); + final long bookSize = Files.size(objPath); + final Ds3Object obj = new Ds3Object(book, bookSize); + + bookTitles.add(book); + objectsToWrite.add(obj); + } + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJobUsingRandomAccessBehavior(BUCKET_NAME, objectsToWrite); + writeJob.transfer(new FileObjectPutter(dirPath)); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Iterable bucketContentsIterable = ds3ClientHelpers.listObjects(BUCKET_NAME); + + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(FILE_NAMES[0], bucketContents.getKey()); + } + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + @Test + public void testThatMetadataAccessDoesNotTerminateTransfer() throws IOException, URISyntaxException, InterruptedException { + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String fileName = "Gracie.txt"; + + final Path filePath = Paths.get(tempDirectory.toString(), fileName); + + final List ds3Objects = new ArrayList<>(); + ds3Objects.add(new Ds3Object(fileName)); + + try { + if ( ! Platform.isWindows()) { + tempDirectory.toFile().setExecutable(false); + } else { + Runtime.getRuntime().exec("icacls " + tempDirectory + "/deny Everyone(RD)").waitFor(); + } + + final int maxNumBlockAllocationRetries = 3; + final int maxNumObjectTransferAttempts = 3; + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client, + maxNumBlockAllocationRetries, + maxNumObjectTransferAttempts); + + final AtomicInteger numTimesFailureHandlerCalled = new AtomicInteger(0); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, ds3Objects); + writeJob.withMetadata(new MetadataAccessImpl(ImmutableMap.builder().put(fileName, filePath).build(), + new FailureEventListener() { + @Override + public void onFailure(final FailureEvent failureEvent) { + numTimesFailureHandlerCalled.incrementAndGet(); + assertEquals(FailureEvent.FailureActivity.RecordingMetadata, failureEvent.doingWhat()); + assertEquals(client.getConnectionDetails().getEndpoint(), failureEvent.usingSystemWithEndpoint()); + } + }, + client.getConnectionDetails().getEndpoint())); + writeJob.transfer(new FileObjectGetter(Paths.get("."))); + + assertEquals(1, numTimesFailureHandlerCalled.get()); + } finally { + if ( ! Platform.isWindows()) { + tempDirectory.toFile().setExecutable(true); + } else { + Runtime.getRuntime().exec("icacls " + tempDirectory + "/grant Everyone(RD)").waitFor(); + } + + deleteAllContents(client, BUCKET_NAME); + FileUtils.deleteDirectory(tempDirectory.toFile()); + Files.delete(Paths.get(fileName)); + } + } + + @Test + public void testPutting15000Files() throws IOException, URISyntaxException { + final String tempPathPrefix = null; + Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + try { + final ImmutableList ds3Objects = copyFilesAndGenerateDsObjects(tempDirectory); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, ds3Objects); + + writeJob.transfer(new FileObjectPutter(tempDirectory)); + + FileUtils.deleteDirectory(tempDirectory.toFile()); + + tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Lists.newArrayList( + new Ds3Object(SOURCE_FILE_NAME, Files.size(sourceFilePath())))); + + final GetJobSpectraS3Response jobSpectraS3Response = client.getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); + + assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); + + readJob.transfer(new FileObjectGetter(tempDirectory)); + + final File originalFile = ResourceUtils.loadFileResource(SOURCE_DIRECTORY + SOURCE_FILE_NAME).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), SOURCE_FILE_NAME).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + } catch (final org.apache.http.client.ClientProtocolException e) { + fail("This test makes sure that we don't run out of connections when transferring lots of small files. Oops."); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + } + + private static Path sourceFilePath() throws IOException, URISyntaxException { + return ResourceUtils.loadFileResource(SOURCE_DIRECTORY + SOURCE_FILE_NAME); + } + + private static ImmutableList copyFilesAndGenerateDsObjects(final Path destinationDirectory) throws IOException, URISyntaxException { + final Path sourceFilePath = ResourceUtils.loadFileResource(SOURCE_DIRECTORY + SOURCE_FILE_NAME); + + final ImmutableList fileNames = generateFileNames(SOURCE_FILE_BASE_NAME, SOURCE_FILE_EXTENSION, 15000); + copyFiles(sourceFilePath, destinationDirectory, fileNames); + + return generateDs3Objects(destinationDirectory, fileNames); + } + + private static ImmutableList generateFileNames(final String baseFileName, final String baseFileExtension, final int numFileNames) { + final ImmutableList.Builder listBuilder = ImmutableList.builder(); + + listBuilder.add(baseFileName + "." + baseFileExtension); + + for (int i = 1; i < numFileNames; ++i) { + listBuilder.add(baseFileName + i + "." + baseFileExtension); + } + + return listBuilder.build(); + } + + private static void copyFiles(final Path sourceFilePath, final Path destinationDirectory, final ImmutableList fileNames) throws IOException { + for (final String fileName : fileNames) { + Files.copy(sourceFilePath, Paths.get(destinationDirectory.toString(), fileName)); + } + } + + private static ImmutableList generateDs3Objects(final Path destinationDirectory, final ImmutableList fileNames) throws IOException { + final ImmutableList.Builder listBuilder = ImmutableList.builder(); + + for (final String fileName : fileNames) { + final Path filePath = Paths.get(destinationDirectory.toString(), fileName); + final long fileSize = Files.size(filePath); + final Ds3Object ds3Object = new Ds3Object(fileName, fileSize); + + listBuilder.add(ds3Object); + } + + return listBuilder.build(); + } + + @Test + public void testCancelingJob() throws URISyntaxException, InterruptedException { + final String tempPathPrefix = null; + Path tempDirectory; + + try { + tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + } catch (final IOException e) { + fail("Could not create temp folder."); + return; + } + + try { + final ImmutableList ds3Objects = copyFilesAndGenerateDsObjects(tempDirectory); + + final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); + + final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, ds3Objects); + + final AtomicBoolean caughtExceptionWhileCanceling = new AtomicBoolean(false); + final AtomicBoolean cancelHandlerCalled = new AtomicBoolean(false); + final CountDownLatch countDownLatch = new CountDownLatch(1); + + final AtomicBoolean hasBeenCancelled = new AtomicBoolean(false); + writeJob.attachDataTransferredListener(dataTransferred -> { + if(hasBeenCancelled.compareAndSet(false, true)) { + new Thread(() -> { + try { + writeJob.cancel(); + } catch (IOException e) { + fail(); + } finally { + countDownLatch.countDown(); + } + }).start(); + } + }); + + writeJob.attachCanceledEventObserver(new CanceledEventObserver(eventData -> { + cancelHandlerCalled.set(true); + assertEquals(writeJob.getJobId(), eventData); + })); + + writeJob.transfer(new FileObjectPutter(tempDirectory)); + + countDownLatch.await(); + + assertFalse(caughtExceptionWhileCanceling.get()); + assertTrue(cancelHandlerCalled.get()); + + final String prefix = ""; + final String nextMarker = null; + final int maxKeys = 15000; + final String delimiter = null; + final int numRetries = 5; + + final GetBucketKeyLoaderFactory getBucketKeyLoaderFactory = new GetBucketKeyLoaderFactory<>(client, BUCKET_NAME, prefix, delimiter, nextMarker, maxKeys, numRetries, GetBucketKeyLoaderFactory.contentsFunction); + final LazyIterable iterable = new LazyIterable<>(getBucketKeyLoaderFactory); + final int numThingsInBucket = Iterables.size(iterable); + + assertTrue(numThingsInBucket < maxKeys); + + final GetCanceledJobSpectraS3Response getCanceledJobSpectraS3Response = client.getCanceledJobSpectraS3(new GetCanceledJobSpectraS3Request(writeJob.getJobId().toString())); + final CanceledJob canceledJob = getCanceledJobSpectraS3Response.getCanceledJobResult(); + assertEquals(writeJob.getJobId(), canceledJob.getId()); + } catch (final org.apache.http.client.ClientProtocolException e) { + fail("This test makes sure that we don't run out of connections when transferring lots of small files. Oops."); + } catch (final IOException e) { + fail("IOException from something other than job cancelation."); + } finally { + try { + FileUtils.deleteDirectory(tempDirectory.toFile()); + deleteAllContents(client, BUCKET_NAME); + } catch (final IOException e) { + LOG.error("Failure cleaning up.", e); + } + } + } + + @Test + public void testThatFifoIsNotProcessed() throws IOException, InterruptedException { + Assume.assumeFalse(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String A_FILE_NAME = "aFile.txt"; + final String C_FILE_NAME = "cFile.txt"; + final String FIFO_NAME = "bFifo"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Files.createFile(Paths.get(tempDirectory.toString(), A_FILE_NAME)); + Runtime.getRuntime().exec("mkfifo " + Paths.get(tempDirectory.toString(), FIFO_NAME)).waitFor(); + Files.createFile(Paths.get(tempDirectory.toString(), C_FILE_NAME)); + + final List ds3Objects = Arrays.asList(new Ds3Object(A_FILE_NAME), + new Ds3Object(FIFO_NAME), + new Ds3Object(C_FILE_NAME)); + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJob(BUCKET_NAME, ds3Objects); + writeJob.transfer(new FileObjectPutter(tempDirectory)); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(FIFO_NAME)); + caughtException.set(true); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + + assertTrue(caughtException.get()); + } + + @Test + public void testThatNonExistentFileDoesNotStopPutJob() throws IOException { + final String tempPathPrefix = null; + final Path tempDirectoryForFilesToPut = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + final Path tempDirectoryForFilesToGet = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String A_FILE_NAME = "aFile.txt"; + final String B_FILE_NAME = "bFile.txt"; + final String C_FILE_NAME = "cFile.txt"; + + final Path aFilePutPath = Files.createFile(Paths.get(tempDirectoryForFilesToPut.toString(), A_FILE_NAME)); + final Path cFilePutPath = Files.createFile(Paths.get(tempDirectoryForFilesToPut.toString(), C_FILE_NAME)); + + final AtomicBoolean caughtNoSuchFileException = new AtomicBoolean(false); + final AtomicBoolean getJobRan = new AtomicBoolean(false); + + try { + FileUtils.writeStringToFile(aFilePutPath.toFile(), "aFile"); + FileUtils.writeStringToFile(cFilePutPath.toFile(), "cFile"); + + final int sizeOfNonExistentFile = 5; + + final List ds3Objects = Arrays.asList(new Ds3Object(A_FILE_NAME, Files.size(aFilePutPath)), + new Ds3Object(B_FILE_NAME, sizeOfNonExistentFile), + new Ds3Object(C_FILE_NAME, Files.size(cFilePutPath))); + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJob(BUCKET_NAME, ds3Objects); + writeJob.transfer(new FileObjectPutter(tempDirectoryForFilesToPut)); + } catch (final NoSuchFileException e) { + caughtNoSuchFileException.set(true); + + final Path aFileGetPath = Files.createFile(Paths.get(tempDirectoryForFilesToGet.toString(), A_FILE_NAME)); + final Path cFileGetPath = Files.createFile(Paths.get(tempDirectoryForFilesToGet.toString(), C_FILE_NAME)); + + final List ds3Objects = Arrays.asList(new Ds3Object(A_FILE_NAME), new Ds3Object(C_FILE_NAME)); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, ds3Objects); + readJob.transfer(new FileObjectGetter(tempDirectoryForFilesToGet)); + + getJobRan.set(true); + + assertTrue(FileUtils.contentEquals(aFileGetPath.toFile(), aFilePutPath.toFile())); + assertTrue(FileUtils.contentEquals(cFileGetPath.toFile(), cFilePutPath.toFile())); + } finally { + FileUtils.deleteDirectory(tempDirectoryForFilesToGet.toFile()); + FileUtils.deleteDirectory(tempDirectoryForFilesToPut.toFile()); + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + } + + assertTrue(caughtNoSuchFileException.get()); + assertTrue(getJobRan.get()); + } + + @Test(timeout = 30000) + public void testStreamedPutJobWithBlobbedFile() throws Exception { + final int chunkSize = MIN_UPLOAD_SIZE_IN_BYTES; + final long biggerThanAChunkSize = chunkSize * 2L + 1024; + + final int numIntsInBiggerThanAChunkSize = (int)biggerThanAChunkSize / 4; + + final String originalFileName = "Gracie.bin"; + final String movedFileName = "Gracie.bak"; + + try { + final DataOutputStream originalFileStream = new DataOutputStream(new FileOutputStream(originalFileName)); + + byte[] bytes = new byte[4]; + + for (int i = 0; i < numIntsInBiggerThanAChunkSize; ++i) { + bytes[0] = (byte)i; + bytes[1] = (byte)(i >> 8); + bytes[2] = (byte)(i >> 16); + bytes[3] = (byte)(i >> 24); + originalFileStream.write(bytes); + } + + originalFileStream.close(); + + final Ds3Object ds3Object = new Ds3Object(); + ds3Object.setName(originalFileName); + ds3Object.setSize(biggerThanAChunkSize); + + final AtomicLong numBytesTransferred = new AtomicLong(0); + + final WriteJobOptions writeJobOptions = WriteJobOptions.create(); + writeJobOptions.withMaxUploadSize(chunkSize); + + final Ds3ClientHelpers.Job writeJob = HELPERS.startWriteJobUsingStreamedBehavior(BUCKET_NAME, Collections.singletonList(ds3Object), writeJobOptions); + writeJob.attachDataTransferredListener(numBytesTransferred::addAndGet); + + final CountDownLatch writeCountDownLatch = new CountDownLatch(1); + + writeJob.attachObjectCompletedListener(name -> writeCountDownLatch.countDown()); + + writeJob.transfer(new FileObjectPutter(Paths.get("."))); + + writeCountDownLatch.await(); + + assertEquals(biggerThanAChunkSize, numBytesTransferred.get()); + + Files.move(Paths.get(originalFileName), Paths.get(movedFileName)); + + final CountDownLatch readCountdownLatch = new CountDownLatch(1); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Collections.singletonList(ds3Object)); + readJob.attachObjectCompletedListener(name -> readCountdownLatch.countDown()); + readJob.transfer(new FileObjectGetter(Paths.get("."))); + + readCountdownLatch.await(); + + assertTrue(FileUtils.contentEquals(new File(movedFileName), new File(originalFileName))); + } finally { + cancelAllJobsForBucket(client, BUCKET_NAME); + deleteAllContents(client, BUCKET_NAME); + + Files.deleteIfExists(Paths.get(originalFileName)); + Files.deleteIfExists(Paths.get(movedFileName)); + } + } +} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Regression_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Regression_Test.java similarity index 95% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Regression_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Regression_Test.java index 43b8e1442..f8d7ff014 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Regression_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Regression_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -89,6 +89,7 @@ public void testMarkerWithSpaces() throws IOException { new Ds3Object("obj4 also has spaces.txt", 1024)); final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(bucketName, objects); + putJob.transfer(new RandomDataChannelBuilder(objects)); final Iterable objs = HELPERS.listObjects(bucketName, null, "obj3 has spaces.txt"); boolean foundObj4 = false; @@ -97,7 +98,7 @@ public void testMarkerWithSpaces() throws IOException { if (obj.getKey().equals("obj4 also has spaces.txt")) foundObj4 = true; LOG.info("marker with spaces size: " + obj.getSize()); } - assertTrue(Iterables.size(objs) == 1); + assertThat(Iterables.size(objs), is(1)); assertTrue(foundObj4); final CancelJobSpectraS3Response cancelJobResponse = client @@ -122,6 +123,7 @@ public void testPrefixWithSpaces() throws IOException { new Ds3Object("has spaces obj4.txt", 1024)); final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(bucketName, objects); + putJob.transfer(new RandomDataChannelBuilder(objects)); final Iterable objs = HELPERS.listObjects(bucketName, "has spaces"); boolean foundObj2 = false; @@ -132,7 +134,7 @@ public void testPrefixWithSpaces() throws IOException { if (obj.getKey().equals("has spaces obj2.txt")) foundObj2 = true; if (obj.getKey().equals("has spaces obj4.txt")) foundObj4 = true; } - assertTrue(Iterables.size(objs) == 2); + assertThat(Iterables.size(objs), is(2)); assertTrue(foundObj2); assertTrue(foundObj4); @@ -158,6 +160,7 @@ public void testPrefixForDirectoriesWithSpaces() throws IOException { new Ds3Object("dir 2/has spaces obj4.txt", 1024)); final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(bucketName, objects); + putJob.transfer(new RandomDataChannelBuilder(objects)); final Iterable dir1Objs = HELPERS.listObjects(bucketName, "dir1/"); boolean foundObj1 = false; @@ -168,7 +171,7 @@ public void testPrefixForDirectoriesWithSpaces() throws IOException { if (obj.getKey().equals("dir1/obj1_no_spaces.txt")) foundObj1 = true; if (obj.getKey().equals("dir1/has spaces obj2.txt")) foundObj2 = true; } - assertTrue(Iterables.size(dir1Objs) == 2); + assertThat(Iterables.size(dir1Objs), is(2)); assertTrue(foundObj1); assertTrue(foundObj2); @@ -181,7 +184,7 @@ public void testPrefixForDirectoriesWithSpaces() throws IOException { if (obj.getKey().equals("dir 2/obj3_no_spaces.txt")) foundObj3 = true; if (obj.getKey().equals("dir 2/has spaces obj4.txt")) foundObj4 = true; } - assertTrue(Iterables.size(objsDir2) == 2); + assertThat(Iterables.size(objsDir2), is(2)); assertTrue(foundObj3); assertTrue(foundObj4); @@ -206,6 +209,7 @@ public void testPrefixForNestedDirectories() throws IOException { new Ds3Object("dir1/dir 2/has spaces obj4.txt", 1024)); final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(bucketName, objects); + putJob.transfer(new RandomDataChannelBuilder(objects)); final Iterable dir1Objs = HELPERS.listObjects(bucketName, "dir1/"); boolean foundObj1 = false; @@ -216,7 +220,7 @@ public void testPrefixForNestedDirectories() throws IOException { if (obj.getKey().equals("dir1/obj1_no_spaces.txt")) foundObj1 = true; if (obj.getKey().equals("dir1/has spaces obj2.txt")) foundObj2 = true; } - assertTrue(Iterables.size(dir1Objs) == 4); + assertThat(Iterables.size(dir1Objs), is(4)); assertTrue(foundObj1); assertTrue(foundObj2); @@ -229,7 +233,7 @@ public void testPrefixForNestedDirectories() throws IOException { if (obj.getKey().equals("dir1/dir 2/obj3_no_spaces.txt")) foundObj3 = true; if (obj.getKey().equals("dir1/dir 2/has spaces obj4.txt")) foundObj4 = true; } - assertTrue(Iterables.size(objsDir2) == 2); + assertThat(Iterables.size(objsDir2), is(2)); assertTrue(foundObj3); assertTrue(foundObj4); @@ -243,7 +247,7 @@ public void testPrefixForNestedDirectories() throws IOException { @Test public void emptyObjectTest() throws IOException { - Util.assumeVersion1_2(client); + Util.assumeVersionOneDotTwo(client); final String bucketName = "emptyObject"; final List objects = Collections.singletonList(new Ds3Object("obj1.txt", 0)); diff --git a/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/ResourceTest.kt b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/ResourceTest.kt new file mode 100644 index 000000000..cf977b8fe --- /dev/null +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/ResourceTest.kt @@ -0,0 +1,114 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.integration + +import com.spectralogic.ds3client.commands.spectrads3.PutBucketSpectraS3Request +import com.spectralogic.ds3client.helpers.DeleteBucket +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers +import com.spectralogic.ds3client.helpers.channelbuilders.RepeatStringObjectChannelBuilder +import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds +import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil +import com.spectralogic.ds3client.models.ChecksumType +import com.spectralogic.ds3client.models.bulk.Ds3Object +import org.junit.AfterClass +import org.junit.BeforeClass +import org.junit.Test +import java.io.IOException +import org.hamcrest.MatcherAssert.assertThat +import org.hamcrest.Matchers.lessThan + +class ResourceTest { + private companion object { + private val numBuckets = 100 + private val numObjects = 1024 + private val numThreads = numObjects + private val objectSize = 1024 * 10 + private val baseBucketName = "putLotsaBuckets" + private val baseFileName = "file" + private val objectData = "Gracie" + private val dataBufferSize = 1024 + private val ds3Client = Util.fromEnv() + private val policyPrefix = ResourceTest::class.java.simpleName + private var envStorageIds : TempStorageIds? = null + + @BeforeClass + @JvmStatic + @Throws(IOException::class) + fun startup() { + val envDataPolicyId = TempStorageUtil.setupDataPolicy(policyPrefix, false, ChecksumType.Type.MD5, ds3Client) + envStorageIds = TempStorageUtil.setup(policyPrefix, envDataPolicyId, ds3Client) + } + + @AfterClass + @JvmStatic + @Throws(IOException::class) + fun teardown() { + TempStorageUtil.teardown(policyPrefix, envStorageIds, ds3Client) + ds3Client.close() + } + } + + @Test + fun putLotsaBuckets() { + val bucketNames = generateBucketNames() + + try { + createBuckets(bucketNames) + populateBuckets(bucketNames) + assertThat(Thread.activeCount(), lessThan(numThreads * 2)) + } finally { + deleteBuckets(bucketNames) + } + } + + private fun generateBucketNames() : List { + return (1 .. numBuckets) + .map { index -> baseBucketName + index } + .toList() + } + + private fun createBuckets(bucketNames: List) { + bucketNames.forEach({ bucketName -> ds3Client.putBucketSpectraS3(PutBucketSpectraS3Request(bucketName)) }) + } + + @Throws(IOException::class) + private fun populateBuckets(bucketNames: List) { + bucketNames + .forEach({ bucketName -> + Ds3ClientHelpers + .wrap(ds3Client) + .startWriteJob(bucketName, generateDs3Objects()) + .withMaxParallelRequests(numThreads) + .transfer(RepeatStringObjectChannelBuilder(objectData, objectData.length * 512, dataBufferSize.toLong())) + }) + + } + + private fun generateDs3Objects(): List { + return (1 .. numObjects) + .map { index -> + val ds3Object = Ds3Object() + ds3Object.name = baseFileName + index + ds3Object.size = objectSize.toLong() + ds3Object + } + .toList() + } + + private fun deleteBuckets(bucketNames: List) { + bucketNames.forEach({ bucketName -> DeleteBucket.deleteBucket(Ds3ClientHelpers.wrap(ds3Client), bucketName) }) + } +} \ No newline at end of file diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Smoke_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Smoke_Test.java similarity index 84% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Smoke_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Smoke_Test.java index aa0e5aa26..5633e212f 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Smoke_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/Smoke_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -35,6 +35,7 @@ import com.spectralogic.ds3client.networking.Metadata; import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; import com.spectralogic.ds3client.utils.ResourceUtils; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -42,17 +43,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -60,9 +60,11 @@ import static com.spectralogic.ds3client.integration.Util.*; import static com.spectralogic.ds3client.integration.test.helpers.ABMTestHelper.*; +import static com.spectralogic.ds3client.utils.Guard.isNotNullAndNotEmpty; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; import static org.junit.Assume.assumeThat; +import static org.junit.Assume.assumeTrue; public class Smoke_Test { @@ -139,8 +141,8 @@ public void getObjects() throws IOException, URISyntaxException { assertThat(response.getS3ObjectListResult().getS3Objects().size(), is(4)); assertTrue(s3ObjectExists(response.getS3ObjectListResult().getS3Objects(), "beowulf.txt")); - assertThat(response.getPagingTruncated(), is(nullValue())); - assertThat(response.getPagingTotalResultCount(), is(nullValue())); + assertThat(response.getPagingTruncated(), is(0)); + assertThat(response.getPagingTotalResultCount(), is(4)); } finally { deleteAllContents(client,bucketName); } @@ -503,6 +505,72 @@ public void testRecoverWriteJob() throws IOException, JobRecoveryException, URIS } } + @Test + public void testRecoverWriteJobUsingStreamedBehavior() throws IOException, JobRecoveryException, URISyntaxException { + runWriteRecoveryTest(new RecoveryJobFactory() { + @Override + public Ds3ClientHelpers.Job makeRecoveryJob(final Ds3ClientHelpers ds3ClientHelpers, final UUID jobId) throws JobRecoveryException, IOException { + return ds3ClientHelpers.recoverWriteJobUsingStreamedBehavior(jobId); + } + }); + } + + private static void runWriteRecoveryTest(final RecoveryJobFactory recoveryJobFactory) throws IOException, JobRecoveryException, URISyntaxException { + final String bucketName = "test_recover_write_job_bucket"; + final String book1 = "beowulf.txt"; + final String book2 = "ulysses.txt"; + + try { + HELPERS.ensureBucketExists(bucketName, envDataPolicyId); + + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object(book2, Files.size(objPath2)); + + final Map blobCollection = new HashMap<>(); + blobCollection.put(book1, obj1); + blobCollection.put(book2, obj2); + + final Ds3ClientHelpers.Job job = Ds3ClientHelpers.wrap(client).startWriteJob(bucketName, Lists.newArrayList(obj1, obj2)); + + final PutObjectResponse putResponse1 = client.putObject(new PutObjectRequest( + job.getBucketName(), + book1, + new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1), + job.getJobId().toString(), + 0, + Files.size(objPath1))); + assertThat(putResponse1, is(notNullValue())); + + // Interuption... + final Ds3ClientHelpers.Job recoverJob = recoveryJobFactory.makeRecoveryJob(HELPERS, job.getJobId()); + + recoverJob.transfer(new ResourceObjectPutter(RESOURCE_BASE_NAME)); + + final Iterable bucketContentsIterable = HELPERS.listObjects(bucketName); + for (final Contents bucketContents : bucketContentsIterable) { + assertEquals(blobCollection.get(bucketContents.getKey()).getSize(), bucketContents.getSize()); + } + } finally { + deleteAllContents(client, bucketName); + } + } + + private interface RecoveryJobFactory { + Ds3ClientHelpers.Job makeRecoveryJob(final Ds3ClientHelpers ds3ClientHelpers, final UUID jobId) throws JobRecoveryException, IOException; + } + + @Test + public void testRecoverWriteJobUsingRandomAccessBehavior() throws IOException, JobRecoveryException, URISyntaxException { + runWriteRecoveryTest(new RecoveryJobFactory() { + @Override + public Ds3ClientHelpers.Job makeRecoveryJob(final Ds3ClientHelpers ds3ClientHelpers, final UUID jobId) throws JobRecoveryException, IOException { + return ds3ClientHelpers.recoverWriteJobUsingRandomAccessBehavior(jobId); + } + }); + } + @Test (expected = JobRecoveryNotActiveException.class) public void testRecoverWriteJobCanceledJob() throws IOException, URISyntaxException, JobRecoveryException { final String bucketName = "test_canceled_recover_write_job_bucket"; @@ -562,29 +630,33 @@ public void verifySendCrc32cChecksum() throws IOException, URISyntaxException { client); //Create storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( storageDomainName, - client); + client, + true); //Create pool partition - final PutPoolPartitionSpectraS3Response poolPartitionResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( poolPartitionName, PoolType.ONLINE, - client); + client, + true); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response memberResponse = createPoolStorageDomainMember( - storageDomainResponse.getStorageDomainResult().getId(), - poolPartitionResponse.getPoolPartitionResult().getId(), - client); - storageDomainMemberId = memberResponse.getStorageDomainMemberResult().getId(); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + true); + storageDomainMemberId = storageDomainMember.getId(); //create data persistence rule - final PutDataPersistenceRuleSpectraS3Response dataPersistenceResponse = createDataPersistenceRule( + final DataPersistenceRule dataPersistenceRule = createDataPersistenceRule( dataPolicyResponse.getDataPolicyResult().getId(), - storageDomainResponse.getStorageDomainResult().getId(), - client); - dataPersistenceRuleId = dataPersistenceResponse.getDataPersistenceRuleResult().getDataPolicyId(); + storageDomain.getId(), + client, + true); + dataPersistenceRuleId = dataPersistenceRule.getDataPolicyId(); //Create bucket with data policy client.putBucketSpectraS3(new PutBucketSpectraS3Request(bucketName) @@ -726,6 +798,86 @@ public void testRecoverReadJob() throws IOException, JobRecoveryException, URISy } } + @Test + public void testRecoverReadJobUsingStreamedBehavior() throws IOException, JobRecoveryException, URISyntaxException { + runReadRecoveryJob(new RecoveryJobFactory() { + @Override + public Ds3ClientHelpers.Job makeRecoveryJob(final Ds3ClientHelpers ds3ClientHelpers, final UUID jobId) throws JobRecoveryException, IOException { + return ds3ClientHelpers.recoverReadJobsingStreamedBehavior(jobId); + } + }); + } + + private static void runReadRecoveryJob(final RecoveryJobFactory recoveryJobFactory) throws IOException, JobRecoveryException, URISyntaxException { + final String bucketName = "test_recover_read_job_bucket"; + final String book1 = "beowulf.txt"; + final String book2 = "ulysses.txt"; + final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); + final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); + final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); + final Ds3Object obj2 = new Ds3Object(book2, Files.size(objPath2)); + + final Path dirPath = FileSystems.getDefault().getPath("output"); + if (!Files.exists(dirPath)) { + Files.createDirectory(dirPath); + } + + try { + HELPERS.ensureBucketExists(bucketName, envDataPolicyId); + + final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(bucketName, Lists.newArrayList(obj1, obj2)); + putJob.transfer(new ResourceObjectPutter(RESOURCE_BASE_NAME)); + + final FileChannel channel1 = FileChannel.open( + dirPath.resolve(book1), + StandardOpenOption.WRITE, + StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING + ); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(bucketName, Lists.newArrayList(obj1, obj2)); + final GetObjectResponse readResponse1 = client.getObject( + new GetObjectRequest( + bucketName, + book1, + channel1, + readJob.getJobId().toString(), + 0)); + + assertThat(readResponse1, is(notNullValue())); + + // Interruption... + final Ds3ClientHelpers.Job recoverJob = recoveryJobFactory.makeRecoveryJob(HELPERS, readJob.getJobId()); + + recoverJob.transfer(new FileObjectGetter(dirPath)); + + final Map blobCollection = new HashMap<>(); + blobCollection.put(book1, obj1); + blobCollection.put(book2, obj2); + + final Collection filesInTempDirectory = FileUtils.listFiles(dirPath.toFile(), null, false); + for (final File fileInTempDirectory : filesInTempDirectory) { + assertEquals(blobCollection.get(fileInTempDirectory.getName()).getSize(), fileInTempDirectory.length()); + } + } finally { + deleteAllContents(client, bucketName); + for( final Path tempFile : Files.newDirectoryStream(dirPath) ){ + Files.delete(tempFile); + } + Files.delete(dirPath); + } + } + + @Test + public void testRecoverReadJobUsingRandomAccessBehavior() throws IOException, JobRecoveryException, URISyntaxException { + runReadRecoveryJob(new RecoveryJobFactory() { + @Override + public Ds3ClientHelpers.Job makeRecoveryJob(final Ds3ClientHelpers ds3ClientHelpers, final UUID jobId) throws JobRecoveryException, IOException { + return ds3ClientHelpers.recoverReadJobUsingRandomAccessBehavior(jobId); + } + }); + } + @Test (expected = JobRecoveryNotActiveException.class) public void testRecoverReadJobCanceledJob() throws IOException, JobRecoveryException, URISyntaxException { final String bucketName = "test_canceled_recover_read_job_bucket"; @@ -788,7 +940,7 @@ public void testRecoverReadJobDoesNotExist() throws IOException, JobRecoveryExce @Test public void putDirectory() throws IOException { - assumeVersion1_2(client); + assumeVersionOneDotTwo(client); final String bucketName = "putDir"; @@ -820,13 +972,13 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { @Test public void putDirectoryWithOtherObjects() throws IOException { - assumeVersion1_2(client); + assumeVersionOneDotTwo(client); final String bucketName = "mixedPutDir"; try { - final byte[] content = "I'm text with some more data so that it gets flushed to the output cache.".getBytes(Charset.forName("UTF-8")); + final byte[] content = "I'm text with some more data so that it gets flushed to the output cache.".getBytes(StandardCharsets.UTF_8); final List objs = Lists.newArrayList(new Ds3Object("dir/"), new Ds3Object("obj.txt", content.length)); @@ -1057,7 +1209,7 @@ public void partialGetWithBookOverChunkBoundry() throws IOException, URISyntaxEx final String bucketName = "partialGetOnBook"; final Path filePath = Files.createTempFile("ds3", FILE_NAME); - LOG.info("TempFile for partial get of book: " + filePath.toAbsolutePath().toString()); + LOG.info("TempFile for partial get of book: " + filePath.toAbsolutePath()); try { @@ -1086,9 +1238,9 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { final Path expectedResultPath = Paths.get(Smoke_Test.class.getResource("/largeFiles/output").toURI()); assertThat(Files.size(filePath), is(200L)); - final String partialFile = new String(Files.readAllBytes(filePath), Charset.forName("UTF-8")); - final String expectedResult = new String(Files.readAllBytes(expectedResultPath), Charset.forName("UTF-8")); - assertThat(partialFile, is(expectedResult.substring(0, expectedResult.length()))); + final String partialFile = new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8); + final String expectedResult = new String(Files.readAllBytes(expectedResultPath), StandardCharsets.UTF_8); + assertThat(partialFile, is(expectedResult)); } finally { deleteAllContents(client, bucketName); Files.delete(filePath); @@ -1328,6 +1480,41 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { } } + @Test + public void testQuestionMarkInQueryParam() throws IOException { + final String bucketName = "TestQuestionMarkInQueryParam"; + final String objectName = "Test?Question?Mark"; + try { + HELPERS.ensureBucketExists(bucketName, envDataPolicyId); + + final List objs = Lists.newArrayList(new Ds3Object(objectName, 10)); + + final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(bucketName, objs); + + job.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + + final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(124345, 10)); + final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); + + final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(10); + channel.write(randomBuffer); + + return channel; + } + }); + + final GetObjectsDetailsSpectraS3Response getObjectsSpectraS3Response = client + .getObjectsDetailsSpectraS3(new GetObjectsDetailsSpectraS3Request().withName(objectName)); + + assertThat(getObjectsSpectraS3Response.getS3ObjectListResult().getS3Objects().size(), is(1)); + + } finally { + deleteAllContents(client, bucketName); + } + } + @Test public void testPercentInQueryParam() throws IOException { final String bucketName = "TestPercentInQueryParam"; @@ -1471,4 +1658,19 @@ public void testGetObjectsWithFullDetails() throws IOException, URISyntaxExcepti deleteAllContents(client, bucketName); } } + + @Test + public void getBlobsOnTape() throws IOException { + final GetTapesSpectraS3Response getTapes = client.getTapesSpectraS3(new GetTapesSpectraS3Request()); + + // There must be at least one tape on the BP to run this test + assumeTrue(isNotNullAndNotEmpty(getTapes.getTapeListResult().getTapes())); + + final UUID tapeId = getTapes.getTapeListResult().getTapes().get(0).getId(); + + final GetBlobsOnTapeSpectraS3Response getBlobs = client + .getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(tapeId)); + + assertThat(getBlobs.getBulkObjectListResult(), is(notNullValue())); + } } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java similarity index 90% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java index d7772930d..e7ea737bb 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/SpectraS3PaginationLoader_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ import com.google.common.collect.ImmutableList; import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.commands.spectrads3.PutBulkJobSpectraS3Request; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; import com.spectralogic.ds3client.helpers.pagination.GetObjectsFullDetailsLoaderFactory; import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; @@ -39,7 +38,6 @@ import java.util.UUID; import static com.spectralogic.ds3client.integration.Util.deleteAllContents; -import static com.spectralogic.ds3client.integration.Util.insecureFromEnv; import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertTrue; @@ -77,9 +75,12 @@ public void basicPagination() throws IOException { // test setup HELPERS.ensureBucketExists(TEST_ENV_NAME); final int numObjects = 55; - CLIENT.putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(TEST_ENV_NAME, createTestList(numObjects))); - final GetObjectsFullDetailsLoaderFactory loaderFactory = new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, "", 10, RETRIES, false); + final List objects = createTestList(numObjects); + final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(TEST_ENV_NAME, objects); + putJob.transfer(new RandomDataChannelBuilder(objects)); + + final GetObjectsFullDetailsLoaderFactory loaderFactory = new GetObjectsFullDetailsLoaderFactory(CLIENT, TEST_ENV_NAME, 10, RETRIES, false); final Set foundItems = new HashSet<>(); @@ -98,7 +99,7 @@ public void basicPagination() throws IOException { } } - private List createTestList(final int numObjects) { + private static List createTestList(final int numObjects) { final ImmutableList.Builder builder = ImmutableList.builder(); for (int i = 0; i < numObjects; i++) { builder.add(new Ds3Object("obj." + i, i+1)); diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java similarity index 93% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java index 6cc097024..b1d8a01f9 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/UsersAndGroups_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -33,7 +33,9 @@ import java.security.SignatureException; import java.util.UUID; +import static com.spectralogic.ds3client.integration.Util.assumeVersion4orHigher; import static com.spectralogic.ds3client.integration.Util.deleteAllContents; +import static com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil.DEFAULT_USER; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertThat; @@ -75,7 +77,7 @@ private static void setupBucket(final UUID dataPolicy) { try { HELPERS.ensureBucketExists(BUCKET_NAME, dataPolicy); spectraUUID = client.getUserSpectraS3( - new GetUserSpectraS3Request("spectra")).getSpectraUserResult().getId(); + new GetUserSpectraS3Request(DEFAULT_USER)).getSpectraUserResult().getId(); administratorsUUID = client.getGroupSpectraS3( new GetGroupSpectraS3Request("Administrators")).getGroupResult().getId(); } catch (final Exception e) { @@ -89,16 +91,16 @@ public void getUserWithUUID() throws IOException, SignatureException { final GetUserSpectraS3Response getSpectraResponse = client .getUserSpectraS3(new GetUserSpectraS3Request(spectraUUID)); - assertThat(getSpectraResponse.getSpectraUserResult().getName(), is("spectra")); + assertThat(getSpectraResponse.getSpectraUserResult().getName(), is(DEFAULT_USER)); } @Test public void getUserWithString() throws IOException, SignatureException { final GetUserSpectraS3Response getSpectraResponse = client - .getUserSpectraS3(new GetUserSpectraS3Request("spectra")); + .getUserSpectraS3(new GetUserSpectraS3Request(DEFAULT_USER)); - assertThat(getSpectraResponse.getSpectraUserResult().getName(), is("spectra")); + assertThat(getSpectraResponse.getSpectraUserResult().getName(), is(DEFAULT_USER)); } @Test @@ -114,7 +116,7 @@ public void getUsers() throws IOException, SignatureException { public void getUsersWithName() throws IOException, SignatureException { final GetUsersSpectraS3Response getUsersResponse = client.getUsersSpectraS3( - new GetUsersSpectraS3Request().withName("spectra")); + new GetUsersSpectraS3Request().withName(DEFAULT_USER)); assertThat(getUsersResponse.getSpectraUserListResult(), is(notNullValue())); } @@ -175,10 +177,13 @@ public void getUsersWithCombination() throws IOException, SignatureException { } @Test - public void ModifyUserDefaultDataPolicy() throws IOException, SignatureException { + public void modifyUserDefaultDataPolicy() throws IOException, SignatureException { final GetUserSpectraS3Response getSpectraResponse = client .getUserSpectraS3(new GetUserSpectraS3Request(spectraUUID)); + + assertThat(getSpectraResponse.getSpectraUserResult(), is(notNullValue())); + final ModifyUserSpectraS3Response modifyUserSpectraS3Response = client .modifyUserSpectraS3(new ModifyUserSpectraS3Request(spectraUUID) .withDefaultDataPolicyId(dataPolicyId)); @@ -187,7 +192,7 @@ public void ModifyUserDefaultDataPolicy() throws IOException, SignatureException } @Test - public void ModifyUserName() throws IOException, SignatureException { + public void modifyUserName() throws IOException, SignatureException { final GetUserSpectraS3Response getSpectraResponse = client .getUserSpectraS3(new GetUserSpectraS3Request(spectraUUID)); @@ -202,7 +207,7 @@ public void ModifyUserName() throws IOException, SignatureException { @Test - public void ModifyUserNameAndDataPolicy() throws IOException, SignatureException { + public void modifyUserNameAndDataPolicy() throws IOException, SignatureException { final GetUserSpectraS3Response getSpectraResponse = client .getUserSpectraS3(new GetUserSpectraS3Request(spectraUUID)); @@ -216,7 +221,7 @@ public void ModifyUserNameAndDataPolicy() throws IOException, SignatureException } @Test - public void RegenerateUserSecretKey() throws IOException, SignatureException { + public void megenerateUserSecretKey() throws IOException, SignatureException { try { client.regenerateUserSecretKeySpectraS3( new RegenerateUserSecretKeySpectraS3Request(UUID.randomUUID())); @@ -339,7 +344,7 @@ public void getGroupsWithPageStartMarker() throws IOException, SignatureExceptio .withPageStartMarker(UUID.randomUUID())); fail("The above should not be found and throw exception."); } catch (final FailedRequestException e) { - assertThat(e.getStatusCode(), is(410)); + assertThat(e.getStatusCode(), is(404)); } } @@ -467,7 +472,7 @@ public void getUserGroupMembersWithMemberUserIDString() throws IOException, Sign final GetGroupMembersSpectraS3Response getGroupMembersSpectraS3Response = client .getGroupMembersSpectraS3(new GetGroupMembersSpectraS3Request() - .withMemberUserId("spectra")); + .withMemberUserId(DEFAULT_USER)); assertThat(getGroupMembersSpectraS3Response.getGroupMemberListResult(), is(notNullValue())); } @@ -545,22 +550,30 @@ public void getGroupGroupMembersWithLastPage() throws IOException, SignatureExce @Test public void getGroupGroupMembersWithPageStartMarkerUUID() throws IOException, SignatureException { + assumeVersion4orHigher(client); - final GetGroupMembersSpectraS3Response getGroupMembersSpectraS3Response = client - .getGroupMembersSpectraS3(new GetGroupMembersSpectraS3Request() - .withPageStartMarker(UUID.randomUUID())); + try { + client.getGroupMembersSpectraS3(new GetGroupMembersSpectraS3Request() + .withPageStartMarker(UUID.randomUUID())); + fail("The above should not be found and throw exception."); - assertThat(getGroupMembersSpectraS3Response.getGroupMemberListResult(), is(notNullValue())); + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test public void getGroupGroupMembersWithPageStartMarkerString() throws IOException, SignatureException { + assumeVersion4orHigher(client); - final GetGroupMembersSpectraS3Response getGroupMembersSpectraS3Response = client - .getGroupMembersSpectraS3(new GetGroupMembersSpectraS3Request() - .withPageStartMarker(UUID.randomUUID().toString())); + try { + client.getGroupMembersSpectraS3(new GetGroupMembersSpectraS3Request() + .withPageStartMarker(UUID.randomUUID().toString())); + fail("The above should not be found and throw exception."); - assertThat(getGroupMembersSpectraS3Response.getGroupMemberListResult(), is(notNullValue())); + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test @@ -612,7 +625,7 @@ public void putUserGroupMember() throws IOException, SignatureException { new PutGroupSpectraS3Request("test_group")); putUserGroupMemberSpectraS3Response = client - .putUserGroupMemberSpectraS3(new PutUserGroupMemberSpectraS3Request("test_group", "spectra")); + .putUserGroupMemberSpectraS3(new PutUserGroupMemberSpectraS3Request("test_group", DEFAULT_USER)); assertThat(putUserGroupMemberSpectraS3Response.getGroupMemberResult(), is(notNullValue())); @@ -688,7 +701,7 @@ public void putGlobalBucketAclForUserString() throws IOException, SignatureExcep try { putGlobalBucketAclForUserSpectraS3Response = client.putGlobalBucketAclForUserSpectraS3( new PutGlobalBucketAclForUserSpectraS3Request(BucketAclPermission.DELETE, - "spectra")); + DEFAULT_USER)); assertThat(putGlobalBucketAclForUserSpectraS3Response.getBucketAclResult(), is(notNullValue())); @@ -789,7 +802,7 @@ public void getBucketAclsWithUserUUID() throws IOException, SignatureException { @Test public void getBucketAclsWithUserIDString() throws IOException, SignatureException { final GetBucketAclsSpectraS3Response getBucketAclsSpectraS3Response = client - .getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request().withUserId("spectra")); + .getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request().withUserId(DEFAULT_USER)); assertThat(getBucketAclsSpectraS3Response.getBucketAclListResult(), is(notNullValue())); } @@ -850,20 +863,29 @@ public void getBucketAclsWithLastPage() throws IOException, SignatureException { @Test public void getBucketAclsWithPageStartMarkerUUID() throws IOException, SignatureException { - final GetBucketAclsSpectraS3Response getBucketAclsSpectraS3Response = client - .getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request() - .withPageStartMarker(UUID.randomUUID())); + assumeVersion4orHigher(client); - assertThat(getBucketAclsSpectraS3Response.getBucketAclListResult(), is(notNullValue())); + try { + client.getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request() + .withPageStartMarker(UUID.randomUUID())); + fail("The above should not be found and throw exception."); + + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test public void getBucketAclsWithPageStartMarkerString() throws IOException, SignatureException { - final GetBucketAclsSpectraS3Response getBucketAclsSpectraS3Response = client - .getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request() - .withPageStartMarker(UUID.randomUUID().toString())); + assumeVersion4orHigher(client); - assertThat(getBucketAclsSpectraS3Response.getBucketAclListResult(), is(notNullValue())); + try { + client.getBucketAclsSpectraS3(new GetBucketAclsSpectraS3Request() + .withPageStartMarker(UUID.randomUUID().toString())); + fail("The above should not be found and throw exception."); + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test @@ -912,7 +934,7 @@ public void putGlobalDataPolicyAclForUserString() throws IOException, SignatureE PutGlobalDataPolicyAclForUserSpectraS3Response putGlobalDataPolicyAclForUserSpectraS3Response = null; try { putGlobalDataPolicyAclForUserSpectraS3Response = client.putGlobalDataPolicyAclForUserSpectraS3( - new PutGlobalDataPolicyAclForUserSpectraS3Request("spectra")); + new PutGlobalDataPolicyAclForUserSpectraS3Request(DEFAULT_USER)); assertThat(putGlobalDataPolicyAclForUserSpectraS3Response.getDataPolicyAclResult(), is(notNullValue())); @@ -971,7 +993,7 @@ public void deleteDataPolicyAcl() throws IOException, SignatureException { = null; try { putGlobalDataPolicyAclForUserSpectraS3Response = client.putGlobalDataPolicyAclForUserSpectraS3( - new PutGlobalDataPolicyAclForUserSpectraS3Request("spectra")); + new PutGlobalDataPolicyAclForUserSpectraS3Request(DEFAULT_USER)); final DeleteDataPolicyAclSpectraS3Response deleteDataPolicyAclSpectraS3Response = client .deleteDataPolicyAclSpectraS3(new DeleteDataPolicyAclSpectraS3Request( @@ -998,7 +1020,7 @@ public void getDataPolicyAcl() throws IOException, SignatureException { try { putGlobalDataPolicyAclForUserSpectraS3Response = client .putGlobalDataPolicyAclForUserSpectraS3( - new PutGlobalDataPolicyAclForUserSpectraS3Request("spectra")); + new PutGlobalDataPolicyAclForUserSpectraS3Request(DEFAULT_USER)); final GetDataPolicyAclSpectraS3Response getDataPolicyAclSpectraS3Response = client .getDataPolicyAclSpectraS3(new GetDataPolicyAclSpectraS3Request( @@ -1114,7 +1136,7 @@ public void getDataPolicyAclsWithUserString() throws IOException, SignatureExcep final GetDataPolicyAclsSpectraS3Response getDataPolicyAclsSpectraS3Response = client .getDataPolicyAclsSpectraS3(new GetDataPolicyAclsSpectraS3Request() - .withUserId("spectra")); + .withUserId(DEFAULT_USER)); assertThat(getDataPolicyAclsSpectraS3Response.getDataPolicyAclListResult(), is(notNullValue())); } @@ -1181,22 +1203,28 @@ public void getDataPolicyAclsWithPageLength() throws IOException, SignatureExcep @Test public void getDataPolicyAclsWithPageStartMarkerString() throws IOException, SignatureException { + assumeVersion4orHigher(client); - final GetDataPolicyAclsSpectraS3Response getDataPolicyAclsSpectraS3Response = client - .getDataPolicyAclsSpectraS3(new GetDataPolicyAclsSpectraS3Request() - .withPageStartMarker(UUID.randomUUID().toString())); - - assertThat(getDataPolicyAclsSpectraS3Response.getDataPolicyAclListResult(), is(notNullValue())); + try { + client.getDataPolicyAclsSpectraS3(new GetDataPolicyAclsSpectraS3Request() + .withPageStartMarker(UUID.randomUUID().toString())); + fail("The above should not be found and throw exception."); + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test public void getDataPolicyAclsWithPageStartMarkerUUID() throws IOException, SignatureException { + assumeVersion4orHigher(client); - final GetDataPolicyAclsSpectraS3Response getDataPolicyAclsSpectraS3Response = client - .getDataPolicyAclsSpectraS3(new GetDataPolicyAclsSpectraS3Request() - .withPageStartMarker(UUID.randomUUID())); - - assertThat(getDataPolicyAclsSpectraS3Response.getDataPolicyAclListResult(), is(notNullValue())); + try { + client.getDataPolicyAclsSpectraS3(new GetDataPolicyAclsSpectraS3Request() + .withPageStartMarker(UUID.randomUUID())); + fail("The above should not be found and throw exception."); + } catch (final FailedRequestException e) { + assertThat(e.getStatusCode(), is(404)); + } } @Test diff --git a/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/VersionedObject_Test.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/VersionedObject_Test.java new file mode 100644 index 000000000..d0830be24 --- /dev/null +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/VersionedObject_Test.java @@ -0,0 +1,191 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.integration; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.GetBucketRequest; +import com.spectralogic.ds3client.commands.GetBucketResponse; +import com.spectralogic.ds3client.commands.spectrads3.DeleteBucketSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.StageObjectsJobSpectraS3Request; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.FileObjectGetter; +import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; +import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.models.VersioningLevel; +import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.utils.ResourceUtils; +import org.apache.commons.io.FileUtils; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +import static com.spectralogic.ds3client.integration.Util.*; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +public class VersionedObject_Test { + + private static final Logger LOG = LoggerFactory.getLogger(SpectraS3PaginationLoader_Test.class); + + private static final Ds3Client CLIENT = Util.fromEnv(); + private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(CLIENT); + private static final String TEST_ENV_NAME = "java_versioned_object_test"; + + private static TempStorageIds envStorageIds; + private static UUID envDataPolicyId; + + @BeforeClass + public static void startup() throws IOException { + LOG.info("Starting test Setup..."); + + // Create data policy with versioning + envDataPolicyId = TempStorageUtil.setupDataPolicy( + TEST_ENV_NAME, + false, + ChecksumType.Type.MD5, + VersioningLevel.KEEP_MULTIPLE_VERSIONS, + CLIENT); + + envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, envDataPolicyId, CLIENT); + LOG.info("Finished test Setup..."); + } + + @AfterClass + public static void teardown() throws IOException { + LOG.info("Starting test teardown..."); + TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, CLIENT); + CLIENT.close(); + LOG.info("Finished test teardown..."); + } + + @Test + public void getObjectsWithVersioning() throws IOException, URISyntaxException { + try { + HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); + final String objectName = "object_with_versions"; + + // Put different content for object twice + loadTestBook(CLIENT, BOOKS[0], objectName, TEST_ENV_NAME); // putting beowulf as content + loadTestBook(CLIENT, BOOKS[1], objectName, TEST_ENV_NAME); // putting sherlock holmes as content + + // Get the version of the objects + final GetBucketRequest getBucketRequest = new GetBucketRequest(TEST_ENV_NAME).withVersions(true); + final GetBucketResponse getBucketResponse = CLIENT.getBucket(getBucketRequest); + + assertThat(getBucketResponse.getListBucketResult().getObjects().size(), is(0)); + assertThat(getBucketResponse.getListBucketResult().getVersionedObjects().size(), is(2)); + + // Create bulk get job with both versions of object specified + final List objects = getBucketResponse.getListBucketResult().getVersionedObjects().stream() + .map(obj -> new Ds3Object(obj.getKey(), obj.getVersionId())) + .collect(Collectors.toList()); + + final GetBulkJobSpectraS3Request getBulkRequest = new GetBulkJobSpectraS3Request(TEST_ENV_NAME, objects); + CLIENT.getBulkJobSpectraS3(getBulkRequest); + + } finally { + cancelAllJobsForBucket(CLIENT, TEST_ENV_NAME); + deleteAllContents(CLIENT, TEST_ENV_NAME); + } + } + + @Test + public void stageObjectsWithVersioning() throws IOException, URISyntaxException { + try { + HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); + final String objectName = "object_with_versions"; + + // Put different content for object twice + loadTestBook(CLIENT, BOOKS[0], objectName, TEST_ENV_NAME); // putting beowulf as content + loadTestBook(CLIENT, BOOKS[1], objectName, TEST_ENV_NAME); // putting sherlock holmes as content + + // Get the version of the objects + final GetBucketRequest getBucketRequest = new GetBucketRequest(TEST_ENV_NAME).withVersions(true); + final GetBucketResponse getBucketResponse = CLIENT.getBucket(getBucketRequest); + + assertThat(getBucketResponse.getListBucketResult().getObjects().size(), is(0)); + assertThat(getBucketResponse.getListBucketResult().getVersionedObjects().size(), is(2)); + + // Create bulk get job with both versions of object specified + final List objects = getBucketResponse.getListBucketResult().getVersionedObjects().stream() + .map(obj -> new Ds3Object(obj.getKey(), obj.getVersionId())) + .collect(Collectors.toList()); + + final StageObjectsJobSpectraS3Request stageRequest = new StageObjectsJobSpectraS3Request(TEST_ENV_NAME, objects); + CLIENT.stageObjectsJobSpectraS3(stageRequest); + + } finally { + CLIENT.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(TEST_ENV_NAME).withForce(true)); + } + } + + @Test + public void getObjectsWithVersioningUsingHelpers() throws IOException, URISyntaxException, InterruptedException { + // Create temp directory for files we will retrieve from bp + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), null); + + try { + HELPERS.ensureBucketExists(TEST_ENV_NAME, envDataPolicyId); + final String objectName = "object_with_versions"; + + // Put different content for object twice + loadTestBook(CLIENT, BOOKS[0], objectName, TEST_ENV_NAME); // putting beowulf as content + loadTestBook(CLIENT, BOOKS[1], objectName, TEST_ENV_NAME); // putting sherlock holmes as content + + // Get the version of the objects + final GetBucketRequest getBucketRequest = new GetBucketRequest(TEST_ENV_NAME).withVersions(true); + final GetBucketResponse getBucketResponse = CLIENT.getBucket(getBucketRequest); + + assertThat(getBucketResponse.getListBucketResult().getObjects().size(), is(0)); + assertThat(getBucketResponse.getListBucketResult().getVersionedObjects().size(), is(2)); + + // Create bulk get job with the oldest version of the object + final List objects = getBucketResponse.getListBucketResult().getVersionedObjects().stream() + .filter(obj -> !obj.getIsLatest()) // filters out the latest version of the object + .map(obj -> new Ds3Object(obj.getKey(), obj.getVersionId())) + .collect(Collectors.toList()); + + final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(TEST_ENV_NAME, objects); + + readJob.transfer(new FileObjectGetter(tempDirectory)); + + // Check content is beowulf, which was the first version of content + final File originalFile = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + BOOKS[0]).toFile(); + final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), objectName).toFile(); + assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); + + } finally { + cancelAllJobsForBucket(CLIENT, TEST_ENV_NAME); + deleteAllContents(CLIENT, TEST_ENV_NAME); + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + } +} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java similarity index 87% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java index 6dc8b6e02..6552c7712 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/ABMTestHelper.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; +import java.util.List; import java.util.UUID; import static org.apache.http.util.TextUtils.isEmpty; @@ -162,14 +163,19 @@ public static void deleteBucketsWithDataPolicy( * partition with the same name does not currently exist. If a partition * already exists with the specified name, an error is thrown. */ - public static PutPoolPartitionSpectraS3Response createPoolPartition( + public static PoolPartition createPoolPartition( final String poolPartitionName, final PoolType poolType, - final Ds3Client client) throws IOException { + final Ds3Client client, + boolean failIfAlreadyExists) throws IOException { //Check if pool partition already exists try { - client.getPoolPartitionSpectraS3(new GetPoolPartitionSpectraS3Request(poolPartitionName)); - fail("Pool partition already exists, terminating to prevent conflict: " + poolPartitionName); + final GetPoolPartitionSpectraS3Response getPoolPartition = client.getPoolPartitionSpectraS3( + new GetPoolPartitionSpectraS3Request(poolPartitionName)); + if (failIfAlreadyExists) { + fail("Pool partition already exists, terminating to prevent conflict: " + poolPartitionName); + } + return getPoolPartition.getPoolPartitionResult(); } catch (final IOException e) { //Pass: expected pool partition to not exist } @@ -177,7 +183,7 @@ public static PutPoolPartitionSpectraS3Response createPoolPartition( //Create the pool partition return client.putPoolPartitionSpectraS3(new PutPoolPartitionSpectraS3Request( poolPartitionName, - poolType)); + poolType)).getPoolPartitionResult(); } /** @@ -212,19 +218,24 @@ public static void deletePoolPartition( * Creates a storage domain if one does not already exist with the specified name. If a * storage domain already exists with the specified name, an error is thrown. */ - public static PutStorageDomainSpectraS3Response createStorageDomain( + public static StorageDomain createStorageDomain( final String storageDomainName, - final Ds3Client client) throws IOException { + final Ds3Client client, + boolean failIfAlreadyExists) throws IOException { //Check if storage domain already exists try { - client.getStorageDomainSpectraS3(new GetStorageDomainSpectraS3Request(storageDomainName)); - fail("Storage domain already exists, terminating to prevent conflict: " + storageDomainName); + final GetStorageDomainSpectraS3Response getStorageDomain = client.getStorageDomainSpectraS3( + new GetStorageDomainSpectraS3Request(storageDomainName)); + if (failIfAlreadyExists) { + fail("Storage domain already exists, terminating to prevent conflict: " + storageDomainName); + } + return getStorageDomain.getStorageDomainResult(); } catch (final IOException e) { //Pass: expected storage domain to not exist } //Create the storage domain - return client.putStorageDomainSpectraS3(new PutStorageDomainSpectraS3Request(storageDomainName)); + return client.putStorageDomainSpectraS3(new PutStorageDomainSpectraS3Request(storageDomainName)).getStorageDomainResult(); } /** @@ -260,17 +271,23 @@ public static void deleteStorageDomain( * storage domain and pool partition. If a storage domain member already exists,an * error is thrown. */ - public static PutPoolStorageDomainMemberSpectraS3Response createPoolStorageDomainMember( + public static StorageDomainMember createPoolStorageDomainMember( final UUID storageDomainId, final UUID poolPartitionId, - final Ds3Client client) throws IOException { + final Ds3Client client, + boolean failIfAlreadyExists) throws IOException { //Check if storage domain member already exists between specified storage domain and pool partition try { final GetStorageDomainMembersSpectraS3Response getMembers = client.getStorageDomainMembersSpectraS3( new GetStorageDomainMembersSpectraS3Request() .withPoolPartitionId(poolPartitionId.toString()) .withStorageDomainId(storageDomainId.toString())); - assertThat(getMembers.getStorageDomainMemberListResult().getStorageDomainMembers().size(), is(0)); + if (failIfAlreadyExists) { + assertThat(getMembers.getStorageDomainMemberListResult().getStorageDomainMembers().size(), is(0)); + } + if (!getMembers.getStorageDomainMemberListResult().getStorageDomainMembers().isEmpty()) { + return getMembers.getStorageDomainMemberListResult().getStorageDomainMembers().get(0); + } } catch (final IOException e) { //Pass: expected storage domain member to not exist } @@ -278,7 +295,7 @@ public static PutPoolStorageDomainMemberSpectraS3Response createPoolStorageDomai //Create the storage domain return client.putPoolStorageDomainMemberSpectraS3(new PutPoolStorageDomainMemberSpectraS3Request( poolPartitionId.toString(), - storageDomainId.toString())); + storageDomainId.toString())).getStorageDomainMemberResult(); } /** @@ -298,14 +315,14 @@ public static void deleteStorageDomainMember( client.deleteStorageDomainMemberSpectraS3( new DeleteStorageDomainMemberSpectraS3Request(memberId.toString())); } catch (final IOException|AssertionError e) { - LOG.error("Storage domain member was not deleted as expected: " + memberId.toString()); + LOG.error("Storage domain member was not deleted as expected: " + memberId); } //Verify that the storage domain member was deleted try { client.getStorageDomainMemberSpectraS3( new GetStorageDomainMemberSpectraS3Request(memberId.toString())); - LOG.error("Storage domain member still exists despite deletion attempt: " + memberId.toString()); + LOG.error("Storage domain member still exists despite deletion attempt: " + memberId); } catch (final IOException e) { //Pass: expected storage domain member to not exist } @@ -315,23 +332,29 @@ public static void deleteStorageDomainMember( * Creates a data persistence rule to link the specified data policy and storage domain, * if said rule does not already exist. */ - public static PutDataPersistenceRuleSpectraS3Response createDataPersistenceRule( + public static DataPersistenceRule createDataPersistenceRule( final UUID dataPolicyId, final UUID storageDomainId, - final Ds3Client client) throws IOException { + final Ds3Client client, + boolean failIfAlreadyExists) throws IOException { //Check if data persistence rule already exists final GetDataPersistenceRulesSpectraS3Response response = client.getDataPersistenceRulesSpectraS3( new GetDataPersistenceRulesSpectraS3Request() .withDataPolicyId(dataPolicyId.toString()) .withStorageDomainId(storageDomainId.toString())); - assertThat(response.getDataPersistenceRuleListResult().getDataPersistenceRules().size(), is(0)); + if (failIfAlreadyExists) { + assertThat(response.getDataPersistenceRuleListResult().getDataPersistenceRules().size(), is(0)); + } + if (!response.getDataPersistenceRuleListResult().getDataPersistenceRules().isEmpty()) { + return response.getDataPersistenceRuleListResult().getDataPersistenceRules().get(0); + } //Create the data persistence rule return client.putDataPersistenceRuleSpectraS3(new PutDataPersistenceRuleSpectraS3Request( dataPolicyId.toString(), DataIsolationLevel.STANDARD, storageDomainId.toString(), - DataPersistenceRuleType.PERMANENT)); + DataPersistenceRuleType.PERMANENT)).getDataPersistenceRuleResult(); } /** @@ -352,14 +375,14 @@ public static void deleteDataPersistenceRule( client.deleteDataPersistenceRuleSpectraS3( new DeleteDataPersistenceRuleSpectraS3Request(dataPersistenceRuleId.toString())); } catch (final IOException|AssertionError e) { - LOG.error("Data persistence rule was not deleted as expected: " + dataPersistenceRuleId.toString()); + LOG.error("Data persistence rule was not deleted as expected: " + dataPersistenceRuleId); } //Verify that the data persistence rule was deleted try { client.getDataPersistenceRuleSpectraS3( new GetDataPersistenceRuleSpectraS3Request(dataPersistenceRuleId.toString())); - LOG.error("Data persistence rule still exists despite deletion attempt: " + dataPersistenceRuleId.toString()); + LOG.error("Data persistence rule still exists despite deletion attempt: " + dataPersistenceRuleId); } catch (final IOException e) { //Pass: expected data persistence rule to not exist } @@ -452,13 +475,13 @@ public static void deleteDataPolicyAclForGroup( try { client.deleteDataPolicyAclSpectraS3(new DeleteDataPolicyAclSpectraS3Request(aclId.toString())); } catch (final IOException|AssertionError e) { - LOG.error("Data policy Acl was not deleted as expected: " + aclId.toString()); + LOG.error("Data policy Acl was not deleted as expected: " + aclId); } //Verify that the Acl was deleted try { client.getDataPolicyAclSpectraS3(new GetDataPolicyAclSpectraS3Request(aclId.toString())); - LOG.error("Data policy Acl still exists despite deletion attempt: " + aclId.toString()); + LOG.error("Data policy Acl still exists despite deletion attempt: " + aclId); } catch (final IOException e) { //Pass: expected data policy acl to not exist } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java similarity index 83% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java index 968aff108..2472f972f 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShim.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -36,7 +36,9 @@ public class Ds3ClientShim extends Ds3ClientImpl { private static Method getNetClientMethod = null; - int numRetries = 0; + private final int maxNumRetries; + + private int numRetries = 0; static { try { @@ -48,17 +50,27 @@ public class Ds3ClientShim extends Ds3ClientImpl { getNetClientMethod.setAccessible(true); } - public Ds3ClientShim(final NetworkClient netClient) { + public Ds3ClientShim(final NetworkClient netClient, final int maxNumRetries) { super(netClient); + + this.maxNumRetries = maxNumRetries; + } + + public Ds3ClientShim(final NetworkClient netClient) { + this(netClient, 1); } public Ds3ClientShim(final Ds3ClientImpl ds3ClientImpl) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { - this((NetworkClient)getNetClientMethod.invoke(ds3ClientImpl)); + this((NetworkClient)getNetClientMethod.invoke(ds3ClientImpl), 1); + } + + public Ds3ClientShim(final Ds3ClientImpl ds3ClientImpl, final int maxNumRetries) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { + this((NetworkClient)getNetClientMethod.invoke(ds3ClientImpl), maxNumRetries); } @Override public PutObjectResponse putObject(final PutObjectRequest request) throws IOException { - if (numRetries++ >= 1) { + if (numRetries++ >= maxNumRetries) { return super.putObject(request); } @@ -67,7 +79,7 @@ public PutObjectResponse putObject(final PutObjectRequest request) throws IOExce @Override public GetObjectResponse getObject(final GetObjectRequest request) throws IOException { - if (numRetries++ >= 1) { + if (numRetries++ >= maxNumRetries) { return super.getObject(request); } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java similarity index 96% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java index a25106d12..e4d70fbc1 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java similarity index 70% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java index 3fdabded5..8af6c3ae0 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedChunkAllocation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,10 +17,7 @@ import com.spectralogic.ds3client.Ds3ClientImpl; import com.spectralogic.ds3client.MockedWebResponse; -import com.spectralogic.ds3client.commands.parsers.AllocateJobChunkSpectraS3ResponseParser; import com.spectralogic.ds3client.commands.parsers.GetJobChunksReadyForClientProcessingSpectraS3ResponseParser; -import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Request; -import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Response; import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; @@ -36,21 +33,11 @@ public Ds3ClientShimWithFailedChunkAllocation(final Ds3ClientImpl ds3ClientImpl) super(ds3ClientImpl); } - @Override - public AllocateJobChunkSpectraS3Response allocateJobChunkSpectraS3(final AllocateJobChunkSpectraS3Request request) - throws IOException - { - final AllocateJobChunkSpectraS3Response allocateJobChunkSpectraS3Response = - new AllocateJobChunkSpectraS3ResponseParser() - .parseXmlResponse(new MockedWebResponse("A response", 307, makeFailingResponseHeaders())); - - return allocateJobChunkSpectraS3Response; - } - private Map makeFailingResponseHeaders() { + private static Map makeFailingResponseHeaders() { final Map headers = new HashMap<>(); headers.put("content-NONE", "text/xml"); - headers.put("Retry-After", "1"); + headers.put("Retry-After", "0"); return headers; } @@ -61,7 +48,7 @@ public GetJobChunksReadyForClientProcessingSpectraS3Response getJobChunksReadyFo { final GetJobChunksReadyForClientProcessingSpectraS3Response getJobChunksReadyForClientProcessingSpectraS3Response = new GetJobChunksReadyForClientProcessingSpectraS3ResponseParser() - .parseXmlResponse(new MockedWebResponse("A response", 307, makeFailingResponseHeaders())); + .parseXmlResponse(new MockedWebResponse("", 200, makeFailingResponseHeaders())); return getJobChunksReadyForClientProcessingSpectraS3Response; } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java similarity index 92% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java index e9ed0d142..c23f045bf 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedGetObject.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.GetObjectRequest; import com.spectralogic.ds3client.commands.GetObjectResponse; import com.spectralogic.ds3client.models.JobNode; -import com.spectralogic.ds3client.networking.ConnectionDetails; import java.io.IOException; import java.lang.reflect.InvocationTargetException; @@ -41,7 +40,6 @@ public GetObjectResponse getObject(final GetObjectRequest request) throws IOExce @Override public Ds3Client newForNode(final JobNode node) { - final ConnectionDetails newConnectionDetails; try { final Ds3Client newClient = super.newForNode(node); return new Ds3ClientShimWithFailedGetObject((Ds3ClientImpl)newClient); diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java similarity index 95% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java index 9e2a75fa9..b28a705b7 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/Ds3ClientShimWithFailedPutObject.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java similarity index 97% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java index 02db191ab..127917c08 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/JobStatusHelper.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java similarity index 93% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java index c77c892b8..6b6818495 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/NotificationCleanupTestHelper.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public static void deleteObjectCachedNotification(final UUID id, final Ds3Client client.deleteObjectCachedNotificationRegistrationSpectraS3( new DeleteObjectCachedNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Object Cached Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Object Cached Notification Registration was not deleted as expected: " + id); } } @@ -62,7 +62,7 @@ public static void deleteJobCompletedNotification(final UUID id, final Ds3Client client.deleteJobCompletedNotificationRegistrationSpectraS3( new DeleteJobCompletedNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Job Completed Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Job Completed Notification Registration was not deleted as expected: " + id); } } @@ -80,7 +80,7 @@ public static void deleteJobCreatedNotification(final UUID id, final Ds3Client c client.deleteJobCreatedNotificationRegistrationSpectraS3( new DeleteJobCreatedNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Job Created Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Job Created Notification Registration was not deleted as expected: " + id); } } @@ -98,7 +98,7 @@ public static void deleteObjectLostNotification(final UUID id, final Ds3Client c client.deleteObjectLostNotificationRegistrationSpectraS3( new DeleteObjectLostNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Object Lost Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Object Lost Notification Registration was not deleted as expected: " + id); } } @@ -116,7 +116,7 @@ public static void deleteObjectPersistedNotification(final UUID id, final Ds3Cli client.deleteObjectPersistedNotificationRegistrationSpectraS3( new DeleteObjectPersistedNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Object Persisted Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Object Persisted Notification Registration was not deleted as expected: " + id); } } @@ -134,7 +134,7 @@ public static void deleteTapePartitionFailureNotification(final UUID id, final D client.deleteTapePartitionFailureNotificationRegistrationSpectraS3( new DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Tape Partition Failure Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Tape Partition Failure Notification Registration was not deleted as expected: " + id); } } @@ -152,7 +152,7 @@ public static void deleteTapeFailureNotification(final UUID id, final Ds3Client client.deleteTapeFailureNotificationRegistrationSpectraS3( new DeleteTapeFailureNotificationRegistrationSpectraS3Request(id)); } catch (final IOException e) { - LOG.error("Tape Failure Notification Registration was not deleted as expected: " + id.toString()); + LOG.error("Tape Failure Notification Registration was not deleted as expected: " + id); } } } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java similarity index 90% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java index 51ed48a2e..c226e408e 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageIds.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -23,8 +23,8 @@ * These IDs are stored for teardown of testing environment. */ public class TempStorageIds { - private UUID storageDomainMemberId; - private UUID dataPersistenceRuleId; + private final UUID storageDomainMemberId; + private final UUID dataPersistenceRuleId; public TempStorageIds(final UUID storageDomainMemberId, final UUID dataPersistenceRuleId) { this.storageDomainMemberId = storageDomainMemberId; diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java similarity index 60% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java rename to ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java index 34d4af2e7..4904eff78 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java +++ b/ds3-sdk-integration/src/integrationTest/java/com/spectralogic/ds3client/integration/test/helpers/TempStorageUtil.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,8 +17,7 @@ import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.commands.spectrads3.*; -import com.spectralogic.ds3client.models.ChecksumType; -import com.spectralogic.ds3client.models.PoolType; +import com.spectralogic.ds3client.models.*; import java.io.IOException; import java.util.UUID; @@ -30,12 +29,14 @@ * and partition for use in the integration tests to avoid error if the BP does not currently * have a partition available for running the unit tests. */ -public class TempStorageUtil { +public final class TempStorageUtil { private static final String DATA_POLICY_NAME = "_dp"; private static final String STORAGE_DOMAIN_NAME = "_sd"; private static final String POOL_PARTITION_NAME = "_pp"; + public static final String DEFAULT_USER = "Administrator"; + /** * Sets up a temporary data policy with a temporary storage domain and partition * for use in integration tests where the user may not currently have access to @@ -48,29 +49,33 @@ public static TempStorageIds setup( final UUID dataPolicyId, final Ds3Client client) throws IOException { //Create storage domain - final PutStorageDomainSpectraS3Response storageDomainResponse = createStorageDomain( + final StorageDomain storageDomain = createStorageDomain( testSetName + STORAGE_DOMAIN_NAME, - client); + client, + false); //Create pool partition - final PutPoolPartitionSpectraS3Response poolPartitionResponse = createPoolPartition( + final PoolPartition poolPartition = createPoolPartition( testSetName + POOL_PARTITION_NAME, PoolType.ONLINE, - client); + client, + false); //Create storage domain member linking pool partition to storage domain - final PutPoolStorageDomainMemberSpectraS3Response memberResponse = createPoolStorageDomainMember( - storageDomainResponse.getStorageDomainResult().getId(), - poolPartitionResponse.getPoolPartitionResult().getId(), - client); - final UUID storageDomainMemberId = memberResponse.getStorageDomainMemberResult().getId(); + final StorageDomainMember storageDomainMember = createPoolStorageDomainMember( + storageDomain.getId(), + poolPartition.getId(), + client, + false); + final UUID storageDomainMemberId = storageDomainMember.getId(); //create data persistence rule - final PutDataPersistenceRuleSpectraS3Response dataPersistenceResponse = createDataPersistenceRule( + final DataPersistenceRule dataPersistenceRule = createDataPersistenceRule( dataPolicyId, - storageDomainResponse.getStorageDomainResult().getId(), - client); - final UUID dataPersistenceRuleId = dataPersistenceResponse.getDataPersistenceRuleResult().getDataPolicyId(); + storageDomain.getId(), + client, + false); + final UUID dataPersistenceRuleId = dataPersistenceRule.getDataPolicyId(); return new TempStorageIds(storageDomainMemberId, dataPersistenceRuleId); } @@ -98,11 +103,45 @@ public static UUID setupDataPolicy( final boolean withEndToEndCrcRequired, final ChecksumType.Type checksumType, final Ds3Client client) throws IOException { + try { + return client.getDataPolicySpectraS3( + new GetDataPolicySpectraS3Request(testSetName + DATA_POLICY_NAME)).getDataPolicyResult().getId(); + } catch (final IOException e) { + // Pass: Expected data policy to not exist + } + + final PutDataPolicySpectraS3Response dataPolicyResponse = client.putDataPolicySpectraS3( new PutDataPolicySpectraS3Request(testSetName + DATA_POLICY_NAME) .withEndToEndCrcRequired(withEndToEndCrcRequired) .withChecksumType(checksumType).withAlwaysForcePutJobCreation(true)); - client.modifyUserSpectraS3(new ModifyUserSpectraS3Request("spectra") + client.modifyUserSpectraS3(new ModifyUserSpectraS3Request(DEFAULT_USER) + .withDefaultDataPolicyId(dataPolicyResponse.getDataPolicyResult().getId())); + return dataPolicyResponse.getDataPolicyResult().getId(); + } + + /** + * Creates a Data Policy with the specified checksum type, end-to-end crc, and versioning + */ + public static UUID setupDataPolicy( + final String testSetName, + final boolean withEndToEndCrcRequired, + final ChecksumType.Type checksumType, + final VersioningLevel versioningLevel, + final Ds3Client client) throws IOException { + try { + return client.getDataPolicySpectraS3( + new GetDataPolicySpectraS3Request(testSetName + DATA_POLICY_NAME)).getDataPolicyResult().getId(); + } catch (final IOException e) { + // Pass: Expected data policy to not exist + } + + final PutDataPolicySpectraS3Response dataPolicyResponse = client.putDataPolicySpectraS3( + new PutDataPolicySpectraS3Request(testSetName + DATA_POLICY_NAME) + .withEndToEndCrcRequired(withEndToEndCrcRequired) + .withChecksumType(checksumType).withAlwaysForcePutJobCreation(true) + .withVersioning(versioningLevel)); + client.modifyUserSpectraS3(new ModifyUserSpectraS3Request(DEFAULT_USER) .withDefaultDataPolicyId(dataPolicyResponse.getDataPolicyResult().getId())); return dataPolicyResponse.getDataPolicyResult().getId(); } diff --git a/ds3-sdk-integration/src/test/resources/.gitattributes b/ds3-sdk-integration/src/integrationTest/resources/.gitattributes similarity index 100% rename from ds3-sdk-integration/src/test/resources/.gitattributes rename to ds3-sdk-integration/src/integrationTest/resources/.gitattributes diff --git a/ds3-sdk-integration/src/integrationTest/resources/books/Paw-3.1.9.zip b/ds3-sdk-integration/src/integrationTest/resources/books/Paw-3.1.9.zip new file mode 100644 index 000000000..acd861b3e Binary files /dev/null and b/ds3-sdk-integration/src/integrationTest/resources/books/Paw-3.1.9.zip differ diff --git a/ds3-sdk-integration/src/test/resources/books/beowulf.txt b/ds3-sdk-integration/src/integrationTest/resources/books/beowulf.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/books/beowulf.txt rename to ds3-sdk-integration/src/integrationTest/resources/books/beowulf.txt diff --git a/ds3-sdk-integration/src/test/resources/books/sherlock_holmes.txt b/ds3-sdk-integration/src/integrationTest/resources/books/sherlock_holmes.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/books/sherlock_holmes.txt rename to ds3-sdk-integration/src/integrationTest/resources/books/sherlock_holmes.txt diff --git a/ds3-sdk-integration/src/test/resources/books/tale_of_two_cities.txt b/ds3-sdk-integration/src/integrationTest/resources/books/tale_of_two_cities.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/books/tale_of_two_cities.txt rename to ds3-sdk-integration/src/integrationTest/resources/books/tale_of_two_cities.txt diff --git a/ds3-sdk-integration/src/test/resources/books/ulysses.txt b/ds3-sdk-integration/src/integrationTest/resources/books/ulysses.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/books/ulysses.txt rename to ds3-sdk-integration/src/integrationTest/resources/books/ulysses.txt diff --git a/ds3-sdk-integration/src/test/resources/largeFiles/GreatExpectations.txt b/ds3-sdk-integration/src/integrationTest/resources/largeFiles/GreatExpectations.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/largeFiles/GreatExpectations.txt rename to ds3-sdk-integration/src/integrationTest/resources/largeFiles/GreatExpectations.txt diff --git a/ds3-sdk-integration/src/test/resources/largeFiles/lesmis-copies.txt b/ds3-sdk-integration/src/integrationTest/resources/largeFiles/lesmis-copies.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/largeFiles/lesmis-copies.txt rename to ds3-sdk-integration/src/integrationTest/resources/largeFiles/lesmis-copies.txt diff --git a/ds3-sdk-integration/src/test/resources/largeFiles/lesmis.txt b/ds3-sdk-integration/src/integrationTest/resources/largeFiles/lesmis.txt similarity index 100% rename from ds3-sdk-integration/src/test/resources/largeFiles/lesmis.txt rename to ds3-sdk-integration/src/integrationTest/resources/largeFiles/lesmis.txt diff --git a/ds3-sdk-integration/src/test/resources/largeFiles/output b/ds3-sdk-integration/src/integrationTest/resources/largeFiles/output similarity index 100% rename from ds3-sdk-integration/src/test/resources/largeFiles/output rename to ds3-sdk-integration/src/integrationTest/resources/largeFiles/output diff --git a/ds3-sdk-integration/src/test/resources/little_files/tape.png b/ds3-sdk-integration/src/integrationTest/resources/little_files/tape.png similarity index 100% rename from ds3-sdk-integration/src/test/resources/little_files/tape.png rename to ds3-sdk-integration/src/integrationTest/resources/little_files/tape.png diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/NullChannel.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/NullChannel.java index ba031cabc..49d542673 100644 --- a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/NullChannel.java +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/NullChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataChannelBuilder.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataChannelBuilder.java new file mode 100644 index 000000000..07b23b643 --- /dev/null +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataChannelBuilder.java @@ -0,0 +1,67 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.integration; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.SeekableByteChannel; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Creates a channel builder that generates random data. All object keys and sizes need to be specified. + */ +public class RandomDataChannelBuilder implements Ds3ClientHelpers.ObjectChannelBuilder { + + private static final int seed = 12345; + private final Map objectMap = new HashMap<>(); + + public RandomDataChannelBuilder() { + } + + public RandomDataChannelBuilder(final List objects) { + for (final Ds3Object obj : objects) { + this.objectMap.put(obj.getName(), obj.getSize()); + } + } + + RandomDataChannelBuilder withObject(final String key, final Long size) { + this.objectMap.put(key, size); + return this; + } + + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + if (!this.objectMap.containsKey(key)) { + throw new IllegalArgumentException(String.format("Object with name '%s' was not defined for this channel builder.", key)); + } + + final Long size = this.objectMap.get(key); + final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(seed, size)); + final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); + + final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(size.intValue()); + channel.write(randomBuffer); + + return channel; + } +} diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataInputStream.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataInputStream.java index e117c8a0b..b7884fc0c 100644 --- a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataInputStream.java +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/RandomDataInputStream.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/ResourceObjectPutter.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/ResourceObjectPutter.java index 50317671c..79f33e92e 100644 --- a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/ResourceObjectPutter.java +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/ResourceObjectPutter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/TransferredListener.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/TransferredListener.java index 0e64dc149..a1a10c010 100644 --- a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/TransferredListener.java +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/TransferredListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/Util.java b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/Util.java index a28570dd7..993736342 100644 --- a/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/Util.java +++ b/ds3-sdk-integration/src/main/java/com/spectralogic/ds3client/integration/Util.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,14 +15,16 @@ package com.spectralogic.ds3client.integration; +import com.google.common.collect.ImmutableList; import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.Ds3ClientBuilder; -import com.spectralogic.ds3client.commands.DeleteBucketRequest; -import com.spectralogic.ds3client.commands.DeleteObjectRequest; -import com.spectralogic.ds3client.commands.spectrads3.GetSystemInformationSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.*; +import com.spectralogic.ds3client.helpers.DeleteBucket; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; import com.spectralogic.ds3client.helpers.channelbuilders.PrefixAdderObjectChannelBuilder; -import com.spectralogic.ds3client.models.Contents; +import com.spectralogic.ds3client.models.Bucket; +import com.spectralogic.ds3client.models.Job; +import com.spectralogic.ds3client.models.JobStatus; import com.spectralogic.ds3client.models.bulk.Ds3Object; import com.spectralogic.ds3client.utils.ResourceUtils; import org.slf4j.Logger; @@ -30,16 +32,19 @@ import java.io.IOException; import java.net.URISyntaxException; +import java.nio.channels.FileChannel; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.List; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assume.assumeThat; +import static org.junit.Assume.assumeTrue; -public class Util { +public final class Util { private static final Logger LOG = LoggerFactory.getLogger(Util.class); public static final String RESOURCE_BASE_NAME = "books/"; public static final String[] BOOKS = {"beowulf.txt", "sherlock_holmes.txt", "tale_of_two_cities.txt", "ulysses.txt"}; @@ -58,12 +63,34 @@ public static Ds3Client insecureFromEnv() { return builder.build(); } - public static void assumeVersion1_2(final Ds3Client client) throws IOException { + /** + * Goes through all buckets on a BP and attempts to delete them and all their contents. It cancels all active jobs + * associated with this bucket. Created for cleaning up after cascade failures in functional tests. + * + * USE ONLY WHEN DELETING ALL BUCKETS AND ALL CONTENT IS YOUR GOAL. + */ + public static void forceCleanupBucketsOnBP(final Ds3Client client) throws IOException { + final GetBucketsSpectraS3Request request = new GetBucketsSpectraS3Request(); + final GetBucketsSpectraS3Response response = client.getBucketsSpectraS3(request); + + for (final Bucket bucket : response.getBucketListResult().getBuckets()) { + cancelAllJobsForBucket(client, bucket.getName()); + client.deleteBucketSpectraS3(new DeleteBucketSpectraS3Request(bucket.getName()).withForce(true)); + } + } + + public static void assumeVersionOneDotTwo(final Ds3Client client) throws IOException { final int majorVersion = Integer.parseInt(client.getSystemInformationSpectraS3( new GetSystemInformationSpectraS3Request()).getSystemInformationResult().getBuildInformation().getVersion().split("\\.")[0]); assumeThat(majorVersion, is(1)); } + public static void assumeVersion4orHigher(final Ds3Client client) throws IOException { + final int majorVersion = Integer.parseInt(client.getSystemInformationSpectraS3( + new GetSystemInformationSpectraS3Request()).getSystemInformationResult().getBuildInformation().getVersion().split("\\.")[0]); + assumeTrue(majorVersion >= 4); + } + public static void loadBookTestData(final Ds3Client client, final String bucketName) throws IOException, URISyntaxException { LOG.info("Loading test data..."); getLoadJob(client, bucketName, RESOURCE_BASE_NAME) @@ -71,6 +98,19 @@ public static void loadBookTestData(final Ds3Client client, final String bucketN LOG.info("Finished loading test data..."); } + /** + * Loads a single test book to a BP with the specified object name. + */ + public static void loadTestBook(final Ds3Client client, final String fileName, final String objectName, final String bucketName) throws IOException, URISyntaxException { + final Path filePath = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + fileName); + final Ds3Object obj = new Ds3Object(objectName, Files.size(filePath)); + + final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); + + final Ds3ClientHelpers.Job job = helpers.startWriteJob(bucketName, ImmutableList.of(obj)); + job.transfer(key -> FileChannel.open(filePath, StandardOpenOption.READ)); + } + public static Ds3ClientHelpers.Job getLoadJob(final Ds3Client client, final String bucketName, final String resourceBaseName) throws IOException, URISyntaxException { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); @@ -103,14 +143,29 @@ public static void loadBookTestDataWithPrefix(final Ds3Client client, final Stri } public static void deleteAllContents(final Ds3Client client, final String bucketName) throws IOException { + Ds3ClientHelpers.wrap(client).deleteBucket(bucketName); + } + + public static void deleteBucketContents(final Ds3Client client, final String bucketName) throws IOException { final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); + DeleteBucket.INSTANCE.deleteBucketContents(helpers, bucketName); + } - final Iterable objects = helpers.listObjects(bucketName); - for(final Contents contents : objects) { - client.deleteObject(new DeleteObjectRequest(bucketName, contents.getKey())); + // Cancels all in-progress jobs associated with a bucket + public static void cancelAllJobsForBucket(final Ds3Client client, final String bucketName) { + try { + final GetJobsSpectraS3Response getJobs = client.getJobsSpectraS3(new GetJobsSpectraS3Request().withBucketId(bucketName)); + + if (getJobs.getJobListResult() == null || getJobs.getJobListResult().getJobs() == null) { + return; + } + for (final Job job : getJobs.getJobListResult().getJobs()) { + if (job.getStatus() == JobStatus.IN_PROGRESS) { + client.cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId())); + } + } + } catch (final IOException e) { + LOG.debug("Could not cancel jobs for bucket '%s': %s", bucketName, e.getMessage()); } - - client.deleteBucket(new DeleteBucketRequest(bucketName)); } - } diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/JobImpl_Test.java b/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/JobImpl_Test.java deleted file mode 100644 index 3db21e966..000000000 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/helpers/JobImpl_Test.java +++ /dev/null @@ -1,728 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers; - -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.Ds3ClientImpl; -import com.spectralogic.ds3client.commands.DeleteObjectRequest; -import com.spectralogic.ds3client.integration.Util; -import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShim; -import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; -import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; -import com.spectralogic.ds3client.models.ChecksumType; -import com.spectralogic.ds3client.models.Contents; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.utils.ResourceUtils; -import com.spectralogic.ds3client.IntValue; - -import org.apache.commons.io.FileUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Before; -import org.junit.After; -import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.net.URISyntaxException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; - -import static com.spectralogic.ds3client.integration.Util.deleteAllContents; - -public class JobImpl_Test { - private static final Logger LOG = LoggerFactory.getLogger(JobImpl_Test.class); - - private static final Ds3Client client = Util.fromEnv(); - private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(client); - private static final String BUCKET_NAME = "JobImpl_Test"; - private static final String TEST_ENV_NAME = "JobImpl_Test"; - private static TempStorageIds envStorageIds; - private static UUID dataPolicyId; - - private static final String DIR_NAME = "largeFiles/"; - private static final String[] FILE_NAMES = new String[]{"lesmis-copies.txt"}; - - private long bookSize = -1; - private final List bookTitles = new ArrayList<>(); - private final List objects = new ArrayList<>(); - - private static Path dirPath; - - @BeforeClass - public static void startup() throws Exception { - dataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, false, ChecksumType.Type.MD5, client); - envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, dataPolicyId, client); - setupBucket(dataPolicyId); - dirPath = ResourceUtils.loadFileResource(DIR_NAME); - } - - @AfterClass - public static void teardown() throws IOException { - try { - deleteAllContents(client, BUCKET_NAME); - } finally { - TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client); - client.close(); - } - } - - @Before - public void beforeRunningTestMethod() { - try { - for (final String book : FILE_NAMES) { - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); - bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(book, bookSize); - bookTitles.add(book); - objects.add(obj); - } - } catch (final Throwable t) { - fail("Error running beforeRunningTestMethod: " + t.getMessage()); - } - } - - @After - public void afterRunningTestMethod() { - bookTitles.clear(); - objects.clear(); - - try { - deleteBigFileFromBlackPearlBucket(); - } catch (final Throwable t) { - fail("Error deleting file from black pearl: " + t.getMessage()); - } - } - - private void deleteBigFileFromBlackPearlBucket() throws IOException { - final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); - - final Iterable objects = helpers.listObjects(BUCKET_NAME); - for (final Contents contents : objects) { - if (contents.getKey().equals(FILE_NAMES[0])) { - client.deleteObject(new DeleteObjectRequest(BUCKET_NAME, contents.getKey())); - } - } - } - - /** - * Creates the test bucket with the specified data policy to prevent cascading test failure - * when there are multiple data policies - */ - private static void setupBucket(final UUID dataPolicy) { - try { - HELPERS.ensureBucketExists(BUCKET_NAME, dataPolicy); - } catch (final Exception e) { - LOG.error("Setting up test environment failed: " + e.getMessage()); - } - } - - /** - * This test verifies that object completed callback handler are added to the correct set. - * There are 2 sets: 1 for events we create to let us know when to close channels we have opened; - * and 1 for events clients have registered. It's important that we fire the events that close - * channels before calling client events, so that clients can rely on the channels having been - * closed. - * @throws IOException - * @throws URISyntaxException - * @throws NoSuchMethodException - * @throws IllegalAccessException - * @throws InvocationTargetException - * @throws NoSuchFieldException - * @throws ClassNotFoundException - */ - @Test - public void testWriteObjectCompletionEventsPopulateCorrectJobPartTracker() - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ClassNotFoundException - { - final IntValue intValue = new IntValue(); - - - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - // This is used just to make sure the callback handler ends up in the right place. - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForWriting); - - // trigger the callback - - jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().completePart(FILE_NAMES[0], new ObjectPart(0, bookSize)); - - assertEquals(1, intValue.getValue()); - } - - private enum AccessMode { - ForReading, - ForWriting - } - - private JobImplJobPartDecoratorPair createJobPartDecoratorAndEnsureObjectPartTrackersPopulated - ( - final ObjectCompletedListener objectCompletedListener, - final DataTransferredListener dataTransferredListener, - final AccessMode accessMode - ) - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ClassNotFoundException - { - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job job; - - if (accessMode == AccessMode.ForWriting) { - job = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); - } else { - job = ds3ClientHelpers.startReadJob(BUCKET_NAME, objects); - } - - job.attachObjectCompletedListener(objectCompletedListener); - - job.attachDataTransferredListener(dataTransferredListener); - return getJobImplJobPartDecoratorAndEnsureObjectPartTrackersPopulated(job); - } - - private JobImplJobPartDecoratorPair getJobImplJobPartDecoratorAndEnsureObjectPartTrackersPopulated(final Ds3ClientHelpers.Job job) - throws NoSuchFieldException, IllegalAccessException - { - // Check that the client has one callback registered - final Field partTrackerField = job.getClass().getSuperclass().getDeclaredField("jobPartTracker"); - partTrackerField.setAccessible(true); - final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator = (JobImpl.JobPartTrackerDecorator) partTrackerField.get(job); - - final Field clientJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("clientJobPartTracker"); - clientJobPartTrackerField.setAccessible(true); - final JobPartTrackerImpl clientJobPartTrackerImpl = (JobPartTrackerImpl) clientJobPartTrackerField.get(jobPartTrackerDecorator); - - final Field clientTackersField = clientJobPartTrackerImpl.getClass().getDeclaredField("trackers"); - clientTackersField.setAccessible(true); - final Map clientTrackers = (Map) clientTackersField.get(clientJobPartTrackerImpl); - final ObjectPartTrackerImpl clientObjectPartTrackerImpl = (ObjectPartTrackerImpl) clientTrackers.get(FILE_NAMES[0]); - - final Field clientObjectCompletedListenersField = clientObjectPartTrackerImpl.getClass().getDeclaredField("objectCompletedListeners"); - clientObjectCompletedListenersField.setAccessible(true); - final Set clientObjectCompletedListeners = (Set) clientObjectCompletedListenersField.get(clientObjectPartTrackerImpl); - - assertEquals(1, clientObjectCompletedListeners.size()); - - // Data transfer listeners - final Field clientDataTransferListenersField = clientObjectPartTrackerImpl.getClass().getDeclaredField("dataTransferredListeners"); - clientDataTransferListenersField.setAccessible(true); - final Set clientDataTransferredListeners = (Set) clientDataTransferListenersField.get(clientObjectPartTrackerImpl); - - assertEquals(1, clientDataTransferredListeners.size()); - - // Check that we have no internal callbacks registered. Registering internal callbacks doesn't happen until you - // call transfer - - final Field internalJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("internalJobPartTracker"); - internalJobPartTrackerField.setAccessible(true); - final JobPartTrackerImpl internalJobPartTrackerImpl = (JobPartTrackerImpl) internalJobPartTrackerField.get(jobPartTrackerDecorator); - - final Field internalTackersField = internalJobPartTrackerImpl.getClass().getDeclaredField("trackers"); - internalTackersField.setAccessible(true); - final Map internalTrackers = (Map) internalTackersField.get(internalJobPartTrackerImpl); - final ObjectPartTrackerImpl internalObjectPartTrackerImpl = (ObjectPartTrackerImpl) internalTrackers.get(FILE_NAMES[0]); - - final Field internalObjectCompletedListenersField = internalObjectPartTrackerImpl.getClass().getDeclaredField("objectCompletedListeners"); - internalObjectCompletedListenersField.setAccessible(true); - final Set internalObjectCompletedListeners = (Set) internalObjectCompletedListenersField.get(internalObjectPartTrackerImpl); - - assertEquals(0, internalObjectCompletedListeners.size()); - - // Data transfer listeners - final Field internalDataTransferListenersField = internalObjectPartTrackerImpl.getClass().getDeclaredField("dataTransferredListeners"); - internalDataTransferListenersField.setAccessible(true); - final Set internalDataTransferredListeners = (Set) internalDataTransferListenersField.get(internalObjectPartTrackerImpl); - - assertEquals(0, internalDataTransferredListeners.size()); - - return new JobImplJobPartDecoratorPair(jobPartTrackerDecorator, (JobImpl) job); - } - - private final class JobImplJobPartDecoratorPair { - private final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator; - private final JobImpl job; - - private JobImplJobPartDecoratorPair(final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator, - final JobImpl job) { - this.jobPartTrackerDecorator = jobPartTrackerDecorator; - this.job = job; - } - - public JobImpl.JobPartTrackerDecorator getJobPartTrackerDecorator() { - return jobPartTrackerDecorator; - } - - public JobImpl getJob() { - return job; - } - } - - - - /** - * This test verifies that there is 1 object completed callback handler registered in the internal job part - * tracker. This callback handler does not exist until you call transfer on the write job. - * @throws NoSuchMethodException - * @throws IOException - * @throws ClassNotFoundException - * @throws URISyntaxException - * @throws IllegalAccessException - * @throws InvocationTargetException - * @throws NoSuchFieldException - */ - @Test - public void testWriteObjectCompletionPopulatesInternalJobPartTrackers() - throws NoSuchMethodException, IOException, ClassNotFoundException, URISyntaxException, IllegalAccessException, InvocationTargetException, NoSuchFieldException - { - final IntValue intValue = new IntValue(); - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForWriting); - - jobImplJobPartDecoratorPair.getJob().transfer(new FileObjectPutter(dirPath)); - - final Field partTrackerField = jobImplJobPartDecoratorPair.getJob().getClass().getSuperclass().getDeclaredField("jobPartTracker"); - partTrackerField.setAccessible(true); - final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator = (JobImpl.JobPartTrackerDecorator)partTrackerField.get(jobImplJobPartDecoratorPair.getJob()); - - final Field internalJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("internalJobPartTracker"); - internalJobPartTrackerField.setAccessible(true); - final JobPartTrackerImpl internalJobPartTrackerImpl = (JobPartTrackerImpl)internalJobPartTrackerField.get(jobPartTrackerDecorator); - - final Field internalTackersField = internalJobPartTrackerImpl.getClass().getDeclaredField("trackers"); - internalTackersField.setAccessible(true); - final Map internalTrackers = (Map)internalTackersField.get(internalJobPartTrackerImpl); - final ObjectPartTrackerImpl internalObjectPartTrackerImpl = (ObjectPartTrackerImpl)internalTrackers.get(FILE_NAMES[0]); - - final Field internalObjectCompletedListenersField = internalObjectPartTrackerImpl.getClass().getDeclaredField("objectCompletedListeners"); - internalObjectCompletedListenersField.setAccessible(true); - final Set internalObjectCompletedListeners = (Set)internalObjectCompletedListenersField.get(internalObjectPartTrackerImpl); - - assertEquals(1, internalObjectCompletedListeners.size()); - } - - @Test - public void testWriteObjectCompletionFiresInternalHandlersFirst() - throws NoSuchMethodException, IOException, ClassNotFoundException, URISyntaxException, IllegalAccessException, InvocationTargetException, NoSuchFieldException { - final IntValue intValue = new IntValue(); - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForWriting); - - final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); - - final JobPartDecoratorInterceptor jobPartDecoratorInterceptor = new JobPartDecoratorInterceptor(jobImplJobPartDecoratorPair); - jobPartDecoratorInterceptor.transfer(new FileObjectPutter(dirPath)); - assertTrue(jobPartDecoratorInterceptor.bothHandlersFired()); - } - - private static final class JobPartDecoratorInterceptor implements JobPartTracker { - private final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair; - private final ObjectCompletedCallbackTracker objectCompletedCallbackTracker; - - private JobPartDecoratorInterceptor(final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair) - throws NoSuchFieldException, IllegalAccessException - { - this.jobImplJobPartDecoratorPair = jobImplJobPartDecoratorPair; - this.objectCompletedCallbackTracker = new ObjectCompletedCallbackTracker(); - - // Replace the job part trackers in JobPartTrackerDecorator with JobPartTrackerInterceptor - final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator = jobImplJobPartDecoratorPair.getJobPartTrackerDecorator(); - - final Field internalJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("internalJobPartTracker"); - internalJobPartTrackerField.setAccessible(true); - final JobPartTrackerInterceptor internalJobPartTrackerInterceptor = new JobPartTrackerInterceptor( - (JobPartTracker)internalJobPartTrackerField.get(jobPartTrackerDecorator), - objectCompletedCallbackTracker.getInternalObjectCompletedHandler()); - internalJobPartTrackerField.set(jobPartTrackerDecorator, internalJobPartTrackerInterceptor); - - final Field clientJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("clientJobPartTracker"); - clientJobPartTrackerField.setAccessible(true); - final JobPartTrackerInterceptor clientJobPartTrackerInterceptor = new JobPartTrackerInterceptor( - (JobPartTracker)clientJobPartTrackerField.get(jobPartTrackerDecorator), - objectCompletedCallbackTracker.getClientObjectCompletedHandler()); - clientJobPartTrackerField.set(jobPartTrackerDecorator, clientJobPartTrackerInterceptor); - } - - @Override - public void completePart(final String key, final ObjectPart objectPart) { - jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().completePart(key, objectPart); - } - - @Override - public boolean containsPart(final String key, final ObjectPart objectPart) { - return jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().containsPart(key, objectPart); - } - - @Override - public JobPartTracker attachDataTransferredListener(final DataTransferredListener listener) { - return jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().attachDataTransferredListener(listener); - } - - @Override - public JobPartTracker attachObjectCompletedListener(final ObjectCompletedListener listener) { - return jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().attachObjectCompletedListener(listener); - } - - @Override - public void removeDataTransferredListener(final DataTransferredListener listener) { - jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().removeDataTransferredListener(listener); - } - - @Override - public void removeObjectCompletedListener(final ObjectCompletedListener listener) { - jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().removeObjectCompletedListener(listener); - } - - private void transfer(final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) throws IOException { - jobImplJobPartDecoratorPair.getJob().transfer(channelBuilder); - } - - private boolean bothHandlersFired() { - return objectCompletedCallbackTracker.bothHandlersFired(); - } - } - - private static class ObjectCompletedCallbackTracker { - private final BooleanValue internalObjectCompletedHandlerCalled = new BooleanValue(); - private final BooleanValue clientObjectCompletedHandlerCalled = new BooleanValue(); - - private final ObjectCompletedCallbackRecorder clientObjectCompletedHandler = new ObjectCompletedCallbackRecorder() { - @Override - public void onObjectCompletedCalled() { - clientObjectCompletedHandlerCalled.setValue(true); - - if ( ! internalObjectCompletedHandlerCalled.getValue()) { - throw new IllegalStateException("Client object completed handler called before closing channels."); - } - } - }; - - private final ObjectCompletedCallbackRecorder internalObjectCompletedHandler = new ObjectCompletedCallbackRecorder() { - @Override - public void onObjectCompletedCalled() { - internalObjectCompletedHandlerCalled.setValue(true); - - if (clientObjectCompletedHandlerCalled.getValue()) { - throw new IllegalStateException("Client object completed handler called before closing channels."); - } - } - }; - - public ObjectCompletedCallbackRecorder getClientObjectCompletedHandler() { - return clientObjectCompletedHandler; - } - - public ObjectCompletedCallbackRecorder getInternalObjectCompletedHandler() { - return internalObjectCompletedHandler; - } - - public boolean bothHandlersFired() { - return internalObjectCompletedHandlerCalled.getValue() && clientObjectCompletedHandlerCalled.getValue(); - } - } - - private static class BooleanValue { - private boolean value = false; - - private boolean getValue() { - return this.value; - } - - private boolean setValue(final boolean value) { - this.value = value; - return getValue(); - } - } - - private interface ObjectCompletedCallbackRecorder { - void onObjectCompletedCalled(); - } - - private static final class JobPartTrackerInterceptor implements JobPartTracker { - private final JobPartTracker jobPartTracker; - private final ObjectCompletedCallbackRecorder objectCompletedCallbackRecorder; - - private JobPartTrackerInterceptor(final JobPartTracker jobPartTracker, final ObjectCompletedCallbackRecorder objectCompletedCallbackRecorder) { - this.jobPartTracker = jobPartTracker; - this.objectCompletedCallbackRecorder = objectCompletedCallbackRecorder; - } - - @Override - public void completePart(final String key, final ObjectPart objectPart) { - objectCompletedCallbackRecorder.onObjectCompletedCalled(); - jobPartTracker.completePart(key, objectPart); - } - - @Override - public boolean containsPart(final String key, final ObjectPart objectPart) { - return jobPartTracker.containsPart(key, objectPart); - } - - @Override - public JobPartTracker attachDataTransferredListener(final DataTransferredListener listener) { - return jobPartTracker.attachDataTransferredListener(listener); - } - - @Override - public JobPartTracker attachObjectCompletedListener(final ObjectCompletedListener listener) { - return jobPartTracker.attachObjectCompletedListener(listener); - } - - @Override - public void removeDataTransferredListener(final DataTransferredListener listener) { - jobPartTracker.removeDataTransferredListener(listener); - } - - @Override - public void removeObjectCompletedListener(final ObjectCompletedListener listener) { - jobPartTracker.removeObjectCompletedListener(listener); - } - } - - @Test - public void testWriteObjectRemovesEventsFromCorrectPartTracker() - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ClassNotFoundException - { - final IntValue intValue = new IntValue(); - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - // This is used just to make sure the callback handler ends up in the right place. - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForWriting); - - jobImplJobPartDecoratorPair.getJob().removeObjectCompletedListener(objectCompletedListener); - - final JobImpl job = jobImplJobPartDecoratorPair.getJob(); - - final Field partTrackerField = job.getClass().getSuperclass().getDeclaredField("jobPartTracker"); - partTrackerField.setAccessible(true); - final JobImpl.JobPartTrackerDecorator jobPartTrackerDecorator = (JobImpl.JobPartTrackerDecorator) partTrackerField.get(job); - - final Field clientJobPartTrackerField = jobPartTrackerDecorator.getClass().getDeclaredField("clientJobPartTracker"); - clientJobPartTrackerField.setAccessible(true); - final JobPartTrackerImpl clientJobPartTrackerImpl = (JobPartTrackerImpl) clientJobPartTrackerField.get(jobPartTrackerDecorator); - - final Field clientTackersField = clientJobPartTrackerImpl.getClass().getDeclaredField("trackers"); - clientTackersField.setAccessible(true); - final Map clientTrackers = (Map) clientTackersField.get(clientJobPartTrackerImpl); - final ObjectPartTrackerImpl clientObjectPartTrackerImpl = (ObjectPartTrackerImpl) clientTrackers.get(FILE_NAMES[0]); - - final Field clientObjectCompletedListenersField = clientObjectPartTrackerImpl.getClass().getDeclaredField("objectCompletedListeners"); - clientObjectCompletedListenersField.setAccessible(true); - final Set clientObjectCompletedListeners = (Set) clientObjectCompletedListenersField.get(clientObjectPartTrackerImpl); - - assertEquals(0, clientObjectCompletedListeners.size()); - - // Data transfer listeners - job.removeDataTransferredListener(dataTransferredListener); - final Field clientDataTransferListenersField = clientObjectPartTrackerImpl.getClass().getDeclaredField("dataTransferredListeners"); - clientDataTransferListenersField.setAccessible(true); - final Set clientDataTransferredListeners = (Set) clientDataTransferListenersField.get(clientObjectPartTrackerImpl); - - assertEquals(0, clientDataTransferredListeners.size()); - } - - @Test - public void testReadObjectCompletionEventsPopulateCorrectJobPartTracker() - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ClassNotFoundException - { - putBigFileIntoBlackPearl(); - - final IntValue intValue = new IntValue(); - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - // This is used just to make sure the callback handler ends up in the right place. - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForReading); - - // trigger the callback - - jobImplJobPartDecoratorPair.getJobPartTrackerDecorator().completePart(FILE_NAMES[0], new ObjectPart(0, bookSize)); - - assertEquals(1, intValue.getValue()); - } - - private void putBigFileIntoBlackPearl() throws IOException, URISyntaxException { - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); - writeJob.transfer(new FileObjectPutter(dirPath)); - } - - @Test - public void testReadObjectCompletionFiresInternalHandlersFirst() - throws NoSuchMethodException, IOException, ClassNotFoundException, URISyntaxException, IllegalAccessException, InvocationTargetException, NoSuchFieldException - { - putBigFileIntoBlackPearl(); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - final IntValue intValue = new IntValue(); - - final ObjectCompletedListener objectCompletedListener = new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - intValue.increment(); - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - } - }; - - final DataTransferredListener dataTransferredListener = new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - - } - }; - - try { - final JobImplJobPartDecoratorPair jobImplJobPartDecoratorPair = createJobPartDecoratorAndEnsureObjectPartTrackersPopulated( - objectCompletedListener, - dataTransferredListener, - AccessMode.ForReading); - - final JobPartDecoratorInterceptor jobPartDecoratorInterceptor = new JobPartDecoratorInterceptor(jobImplJobPartDecoratorPair); - jobPartDecoratorInterceptor.transfer(new FileObjectGetter(tempDirectory)); - assertTrue(jobPartDecoratorInterceptor.bothHandlersFired()); - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - } - } -} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java b/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java deleted file mode 100644 index dc4c47469..000000000 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/GetJobManagement_Test.java +++ /dev/null @@ -1,683 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.integration; - -import com.google.common.collect.Lists; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.Ds3ClientImpl; -import com.spectralogic.ds3client.IntValue; -import com.spectralogic.ds3client.commands.DeleteObjectRequest; -import com.spectralogic.ds3client.commands.GetObjectRequest; -import com.spectralogic.ds3client.commands.GetObjectResponse; -import com.spectralogic.ds3client.commands.PutObjectRequest; -import com.spectralogic.ds3client.commands.spectrads3.GetJobSpectraS3Request; -import com.spectralogic.ds3client.commands.spectrads3.GetJobSpectraS3Response; -import com.spectralogic.ds3client.helpers.*; -import com.spectralogic.ds3client.helpers.events.FailureEvent; -import com.spectralogic.ds3client.helpers.options.ReadJobOptions; -import com.spectralogic.ds3client.integration.test.helpers.*; -import com.spectralogic.ds3client.models.ChecksumType; -import com.spectralogic.ds3client.models.Contents; -import com.spectralogic.ds3client.models.Priority; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.PartialDs3Object; -import com.spectralogic.ds3client.models.common.Range; -import com.spectralogic.ds3client.utils.Platform; -import com.spectralogic.ds3client.utils.ResourceUtils; -import org.apache.commons.io.FileUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.reflect.InvocationTargetException; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.channels.SeekableByteChannel; -import java.nio.channels.WritableByteChannel; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; -import java.security.AccessControlException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -import static com.spectralogic.ds3client.integration.Util.RESOURCE_BASE_NAME; -import static com.spectralogic.ds3client.integration.Util.deleteAllContents; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.*; - -public class GetJobManagement_Test { - - private static final Logger LOG = LoggerFactory.getLogger(GetJobManagement_Test.class); - - private static final Ds3Client client = Util.fromEnv(); - private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(client); - private static final String BUCKET_NAME = "Get_Job_Management_Test"; - private static final String TEST_ENV_NAME = "GetJobManagement_Test"; - private static final String DISK_FULL_MESSAGE = "There is not enough space on the disk"; - private static TempStorageIds envStorageIds; - private static UUID dataPolicyId; - - @BeforeClass - public static void startup() throws Exception { - dataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, false, ChecksumType.Type.MD5, client); - envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, dataPolicyId, client); - setupBucket(dataPolicyId); - } - - @AfterClass - public static void teardown() throws IOException { - try { - deleteAllContents(client, BUCKET_NAME); - } finally { - TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client); - client.close(); - } - } - - /** - * Creates the test bucket with the specified data policy to prevent cascading test failure - * when there are multiple data policies - */ - private static void setupBucket(final UUID dataPolicy) { - try { - HELPERS.ensureBucketExists(BUCKET_NAME, dataPolicy); - putBeowulf(); - } catch (final Exception e) { - LOG.error("Setting up test environment failed: " + e.getMessage()); - } - } - - private static void putBeowulf() throws Exception { - final String book1 = "beowulf.txt"; - final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); - final Ds3Object obj = new Ds3Object(book1, Files.size(objPath1)); - final Ds3ClientHelpers.Job job = HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(obj)); - final UUID jobId = job.getJobId(); - final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); - client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); - } - - @SuppressWarnings("deprecation") - @Test - public void nakedS3Get() throws IOException, - URISyntaxException, InterruptedException { - - final WritableByteChannel writeChannel = new NullChannel(); - - final GetObjectResponse getObjectResponse = client.getObject( - new GetObjectRequest(BUCKET_NAME, "beowulf.txt", writeChannel)); - - assertThat(getObjectResponse, is(notNullValue())); - assertThat(getObjectResponse.getObjectSize(), is(notNullValue())); - } - - @Test - public void createReadJob() throws IOException, InterruptedException, URISyntaxException { - - final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( - new Ds3Object("beowulf.txt", 10))); - - final GetJobSpectraS3Response jobSpectraS3Response = client - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - } - - @Test - public void createReadJobWithBigFile() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "lesmis-copies.txt"; - - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Arrays.asList(obj)); - - final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - - readJob.transfer(new FileObjectGetter(tempDirectory)); - - final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME).toFile(); - final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), FILE_NAME).toFile(); - assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - private void putBigFiles() throws IOException, URISyntaxException { - final String DIR_NAME = "largeFiles/"; - final String[] FILE_NAMES = new String[] { "lesmis-copies.txt", "GreatExpectations.txt" }; - - final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); - - final List bookTitles = new ArrayList<>(); - final List objects = new ArrayList<>(); - for (final String book : FILE_NAMES) { - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(book, bookSize); - - bookTitles.add(book); - objects.add(obj); - } - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); - writeJob.transfer(new FileObjectPutter(dirPath)); - } - - private void deleteBigFileFromBlackPearlBucket() throws IOException { - final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); - - final Iterable objects = helpers.listObjects(BUCKET_NAME); - for (final Contents contents : objects) { - if (contents.getKey().equals("lesmis-copies.txt") || contents.getKey().equals("GreatExpectations.txt")) { - client.deleteObject(new DeleteObjectRequest(BUCKET_NAME, contents.getKey())); - } - } - } - - @Test(expected = RuntimeException.class) - public void testReadRetrybugFixWithUnwritableDirectory() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InterruptedException { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - final String tempDirectoryName = tempDirectoryPath.toString(); - - if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) { - // Deny write data access to everyone, making the directory unwritable. - Runtime.getRuntime().exec("icacls " + tempDirectoryName + " /deny Everyone:(WD)").waitFor(); - } else { - Runtime.getRuntime().exec("chmod -w " + tempDirectoryName).waitFor(); - } - - try { - disableWritePermissionForRoot(tempDirectoryName); - - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "lesmis-copies.txt"; - - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Arrays.asList(obj)); - - final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - - readJob.transfer(new FileObjectGetter(tempDirectoryPath)); - - final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME).toFile(); - final File fileCopiedFromBP = Paths.get(tempDirectoryPath.toString(), FILE_NAME).toFile(); - assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); - } finally { - enableWritePermissionForRoot(tempDirectoryName); - - if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) { - // Grant write data access to everyone, so we can delete the directory - Runtime.getRuntime().exec("icacls " + tempDirectoryName + " /grant Everyone:(WD)").waitFor(); - } else { - Runtime.getRuntime().exec("chmod +w " + tempDirectoryName).waitFor(); - } - FileUtils.deleteDirectory(tempDirectoryPath.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - private void disableWritePermissionForRoot(final String fileOrDirName) { - try { - if (iAmRoot()) { - Runtime.getRuntime().exec("chattr +i " + fileOrDirName).waitFor(); - } - } catch (final IOException | InterruptedException e) { - LOG.error("Error setting file immutable: " + fileOrDirName, e); - } - } - - private boolean iAmRoot() { - if ( ! Platform.isLinux()) { - return false; - } - - try { - final Process whoamiProcess = Runtime.getRuntime().exec("id | cut -d \"(\" -f 1 | cut -d \"=\" -f 2"); - whoamiProcess.waitFor(); - - try (final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(whoamiProcess.getInputStream()))) { - - final String userId = bufferedReader.readLine(); - - return userId.equals("0"); - } - } catch (final IOException | InterruptedException e) { - LOG.error("Error getting user id.", e); - } - - return false; - } - - private void enableWritePermissionForRoot(final String fileOrDirName) { - try { - if (iAmRoot()) { - Runtime.getRuntime().exec("chattr -i " + fileOrDirName).waitFor(); - } - } catch (final IOException | InterruptedException e) { - LOG.error("Error setting file immutable: " + fileOrDirName, e); - } - } - - @Test(expected = AccessControlException.class) - public void testReadRetrybugWhenChannelThrowsAccessException() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "lesmis-copies.txt"; - - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Arrays.asList(obj)); - - final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - - readJob.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { - @Override - public SeekableByteChannel buildChannel(final String key) throws IOException { - throw new AccessControlException(key); - } - }); - } finally { - FileUtils.deleteDirectory(tempDirectoryPath.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - @Test - public void testReadRetryBugWhenDiskIsFull() throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectoryPath = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "lesmis-copies.txt"; - - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl)client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Arrays.asList(obj)); - - final GetJobSpectraS3Response jobSpectraS3Response = ds3ClientShim - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - - try { - readJob.transfer(new FailingChannelBuilder()); - } catch (final UnrecoverableIOException e) { - assertEquals(DISK_FULL_MESSAGE, e.getCause().getMessage()); - } - } finally { - FileUtils.deleteDirectory(tempDirectoryPath.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - private static class FailingChannelBuilder implements Ds3ClientHelpers.ObjectChannelBuilder { - @Override - public SeekableByteChannel buildChannel(final String key) throws IOException { - final String filePath = key; - final SeekableByteChannel seekableByteChannel = Files.newByteChannel(Paths.get(filePath), - StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE, - StandardOpenOption.DELETE_ON_CLOSE); - return new SeekableByteChannelWrapper(seekableByteChannel); - } - } - - private static class SeekableByteChannelWrapper implements SeekableByteChannel { - private final SeekableByteChannel seekableByteChannel; - - private SeekableByteChannelWrapper(final SeekableByteChannel seekableByteChannel) { - this.seekableByteChannel = seekableByteChannel; - } - - @Override - public int read(final ByteBuffer dst) throws IOException { - return seekableByteChannel.read(dst); - } - - @Override - public int write(final ByteBuffer src) throws IOException { - throw new IOException(DISK_FULL_MESSAGE); - } - - @Override - public long position() throws IOException { - return seekableByteChannel.position(); - } - - @Override - public SeekableByteChannel position(final long newPosition) throws IOException { - return seekableByteChannel.position(newPosition); - } - - @Override - public long size() throws IOException { - return seekableByteChannel.size(); - } - - @Override - public SeekableByteChannel truncate(final long size) throws IOException { - return seekableByteChannel.truncate(size); - } - - @Override - public boolean isOpen() { - return seekableByteChannel.isOpen(); - } - - @Override - public void close() throws IOException { - seekableByteChannel.close(); - } - } - - - @Test - public void createReadJobWithPriorityOption() throws IOException, - InterruptedException, URISyntaxException { - - final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( - new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withPriority(Priority.LOW)); - final GetJobSpectraS3Response jobSpectraS3Response = client - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); - } - - @Test - public void createReadJobWithNameOption() throws IOException, - URISyntaxException, InterruptedException { - - final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( - new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withName("test_job")); - final GetJobSpectraS3Response jobSpectraS3Response = client - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); - } - - @Test - public void createReadJobWithNameAndPriorityOptions() throws IOException, - URISyntaxException, InterruptedException { - - final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( - new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create() - .withName("test_job").withPriority(Priority.LOW)); - final GetJobSpectraS3Response jobSpectraS3Response = client - .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); - assertThat(jobSpectraS3Response.getMasterObjectListResult().getPriority(), is(Priority.LOW)); - } - - @Test - public void testPartialRetriesWithInjectedFailures() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, URISyntaxException { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final List filesToGet = new ArrayList<>(); - - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "GreatExpectations.txt"; - - final int offsetIntoFirstRange = 10; - - filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(200000, 100000))); - - filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(100000, 100000))); - - filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(offsetIntoFirstRange, 100000))); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) client); - - final int maxNumBlockAllocationRetries = 1; - final int maxNumObjectTransferAttempts = 4; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job job = ds3ClientHelpers.startReadJob(BUCKET_NAME, filesToGet); - final IntValue intValue = new IntValue(); - - job.attachObjectCompletedListener(new ObjectCompletedListener() { - int numPartsCompleted = 0; - - @Override - public void objectCompleted(final String name) { - assertEquals(1, ++numPartsCompleted); - intValue.increment(); - } - }); - - job.attachDataTransferredListener(new DataTransferredListener() { - @Override - public void dataTransferred(final long size) { - LOG.info("Data transferred size: {}", size); - } - }); - - job.transfer(new FileObjectGetter(tempDirectory)); - - assertEquals(1, intValue.getValue()); - - try (final InputStream originalFileStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(DIR_NAME + FILE_NAME)) { - final byte[] first300000Bytes = new byte[300000 - offsetIntoFirstRange]; - originalFileStream.skip(10); - int numBytesRead = originalFileStream.read(first300000Bytes, 0, 300000 - offsetIntoFirstRange); - - assertThat(numBytesRead, is(300000 -offsetIntoFirstRange )); - - try (final InputStream fileReadFromBP = Files.newInputStream(Paths.get(tempDirectory.toString(), FILE_NAME))) { - final byte[] first300000BytesFromBP = new byte[300000 - offsetIntoFirstRange]; - - numBytesRead = fileReadFromBP.read(first300000BytesFromBP, 0, 300000 - offsetIntoFirstRange); - assertThat(numBytesRead, is(300000 - offsetIntoFirstRange)); - - assertTrue(Arrays.equals(first300000Bytes, first300000BytesFromBP)); - } - } - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - - @Test - public void testFiringFailureHandlerWhenGettingChunks() - throws URISyntaxException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException - { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final IntValue numFailuresRecorded = new IntValue(); - - final FailureEventListener failureEventListener = new FailureEventListener() { - @Override - public void onFailure(final FailureEvent failureEvent) { - numFailuresRecorded.increment(); - assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); - } - }; - - final Ds3ClientHelpers.Job readJob = createReadJobWithObjectsReadyToTransfer(Ds3ClientShimFactory.ClientFailureType.ChunkAllocation); - - readJob.attachFailureEventListener(failureEventListener); - - try { - readJob.transfer(new FileObjectGetter(tempDirectory)); - } catch (final IOException e) { - assertEquals(1, numFailuresRecorded.getValue()); - } - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } - - private Ds3ClientHelpers.Job createReadJobWithObjectsReadyToTransfer(final Ds3ClientShimFactory.ClientFailureType clientFailureType) - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException - { - final String DIR_NAME = "largeFiles/"; - final String FILE_NAME = "lesmis-copies.txt"; - - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAME); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(FILE_NAME, bookSize); - - final Ds3Client ds3Client = Ds3ClientShimFactory.makeWrappedDs3Client(clientFailureType, client); - - final int maxNumBlockAllocationRetries = 3; - final int maxNumObjectTransferAttempts = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3Client, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Arrays.asList(obj)); - - return readJob; - } - - @Test - public void testFiringFailureHandlerWhenGettingObject() - throws URISyntaxException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, IOException - { - putBigFiles(); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final IntValue numFailuresRecorded = new IntValue(); - - final FailureEventListener failureEventListener = new FailureEventListener() { - @Override - public void onFailure(final FailureEvent failureEvent) { - numFailuresRecorded.increment(); - assertEquals(FailureEvent.FailureActivity.GettingObject, failureEvent.doingWhat()); - } - }; - - final Ds3ClientHelpers.Job readJob = createReadJobWithObjectsReadyToTransfer(Ds3ClientShimFactory.ClientFailureType.GetObject); - - readJob.attachFailureEventListener(failureEventListener); - - try { - readJob.transfer(new FileObjectGetter(tempDirectory)); - } catch (final IOException e) { - assertEquals(1, numFailuresRecorded.getValue()); - } - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteBigFileFromBlackPearlBucket(); - } - } -} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java b/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java deleted file mode 100644 index e8f00744a..000000000 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/PutJobManagement_Test.java +++ /dev/null @@ -1,1168 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.integration; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.Ds3ClientBuilder; -import com.spectralogic.ds3client.Ds3ClientImpl; -import com.spectralogic.ds3client.IntValue; -import com.spectralogic.ds3client.commands.*; -import com.spectralogic.ds3client.commands.spectrads3.*; -import com.spectralogic.ds3client.commands.spectrads3.notifications.*; -import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; -import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; -import com.spectralogic.ds3client.helpers.FailureEventListener; -import com.spectralogic.ds3client.helpers.FileObjectGetter; -import com.spectralogic.ds3client.helpers.FileObjectPutter; -import com.spectralogic.ds3client.helpers.ObjectCompletedListener; -import com.spectralogic.ds3client.helpers.events.FailureEvent; -import com.spectralogic.ds3client.helpers.options.WriteJobOptions; -import com.spectralogic.ds3client.integration.test.helpers.ABMTestHelper; -import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShimFactory; -import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds; -import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil; -import com.spectralogic.ds3client.metadata.MetadataAccessImpl; -import com.spectralogic.ds3client.models.*; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.networking.FailedRequestException; -import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; -import com.spectralogic.ds3client.utils.Platform; -import com.spectralogic.ds3client.utils.ResourceUtils; - -import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShimFactory.ClientFailureType; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.junit.*; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.channels.SeekableByteChannel; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.atomic.AtomicInteger; - -import com.spectralogic.ds3client.integration.test.helpers.Ds3ClientShim; - -import static com.spectralogic.ds3client.integration.Util.RESOURCE_BASE_NAME; -import static com.spectralogic.ds3client.integration.Util.deleteAllContents; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; - -public class PutJobManagement_Test { - - private static final Ds3Client client = Util.fromEnv(); - private static final Ds3ClientHelpers HELPERS = Ds3ClientHelpers.wrap(client); - private static final String BUCKET_NAME = "Put_Job_Management_Test"; - - private static final String TEST_ENV_NAME = "PutJobManagement_Test"; - private static TempStorageIds envStorageIds; - private static UUID envDataPolicyId; - - @BeforeClass - public static void startup() throws IOException { - envDataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, false, ChecksumType.Type.MD5, client); - envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, envDataPolicyId, client); - } - - @Before - public void setupBucket() throws IOException { - HELPERS.ensureBucketExists(BUCKET_NAME, envDataPolicyId); - } - - @AfterClass - public static void teardown() throws IOException { - TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client); - client.close(); - } - - private long getCacheBytesAvailable() throws IOException { - long cacheAvailableBytes = 0; - final List cacheFilesystemInformationList = client.getCacheStateSpectraS3( - new GetCacheStateSpectraS3Request()).getCacheInformationResult().getFilesystems(); - for (final CacheFilesystemInformation filesystemInformation : cacheFilesystemInformationList) { - if (filesystemInformation.getAvailableCapacityInBytes() > cacheAvailableBytes) { - cacheAvailableBytes = filesystemInformation.getAvailableCapacityInBytes(); - } - } - return cacheAvailableBytes; - } - - @SuppressWarnings("deprecation") - @Test - public void nakedS3Put() throws IOException, URISyntaxException { - try { - final Path beowulfPath = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + "beowulf.txt"); - final SeekableByteChannel beowulfChannel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel("beowulf.txt"); - final PutObjectResponse putObjectResponse = client.putObject(new PutObjectRequest(BUCKET_NAME, "beowulf.txt", - beowulfChannel, Files.size(beowulfPath))); - assertThat(putObjectResponse, is(notNullValue())); - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void getActiveJobs() throws IOException, URISyntaxException { - try { - final UUID jobID = HELPERS - .startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))).getJobId(); - final GetActiveJobsSpectraS3Response activeJobsResponse = client. - getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()); - final ArrayList activeJobsUUIDs = new ArrayList<>(); - for (final ActiveJob job : activeJobsResponse.getActiveJobListResult().getActiveJobs()) { - activeJobsUUIDs.add(job.getId()); - } - assertThat(activeJobsUUIDs, contains(jobID)); - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void getJobs() throws IOException { - try { - final UUID jobID = HELPERS - .startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))).getJobId(); - final GetJobsSpectraS3Response getJobsResponse = client. - getJobsSpectraS3(new GetJobsSpectraS3Request()); - final ArrayList jobUUIDs = new ArrayList<>(); - for (final Job job : getJobsResponse.getJobListResult().getJobs()) { - jobUUIDs.add(job.getJobId()); - } - assertThat(jobUUIDs, contains(jobID)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void modifyJobPriority() throws IOException { - try { - final Ds3ClientHelpers.Job job = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)), - WriteJobOptions.create().withPriority(Priority.LOW)); - - client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) - .withPriority(Priority.HIGH)); - - final GetJobSpectraS3Response response = client - .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); - - assertThat(response.getMasterObjectListResult().getPriority(), is(Priority.HIGH)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void modifyJobName() throws IOException { - - try { - final Ds3ClientHelpers.Job job = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); - - client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) - .withName("newName")); - - final GetJobSpectraS3Response response = client - .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); - - assertThat(response.getMasterObjectListResult().getName(), is("newName")); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void modifyJobCreationDate() throws IOException { - - try { - final Ds3ClientHelpers.Job job = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); - final GetJobSpectraS3Response jobResponse = client - .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); - - final Date originalDate = jobResponse.getMasterObjectListResult().getStartDate(); - final Date newDate = new Date(originalDate.getTime() - 1000); - - client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(job.getJobId().toString()) - .withCreatedAt(newDate)); - - final GetJobSpectraS3Response responseAfterModify = client - .getJobSpectraS3(new GetJobSpectraS3Request(job.getJobId().toString())); - - assertThat(responseAfterModify.getMasterObjectListResult().getStartDate(), is(newDate)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void cancelJob() throws IOException { - - try { - final Ds3ClientHelpers.Job job = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); - - final CancelJobSpectraS3Response response = client - .cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId().toString())); - assertThat(response, is(notNullValue())); - - assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) - .getActiveJobListResult().getActiveJobs().isEmpty()); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void clearAllCanceledJobs() throws IOException { - - try { - final Ds3ClientHelpers.Job job = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); - client.cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId().toString())); - client.clearAllCanceledJobsSpectraS3(new ClearAllCanceledJobsSpectraS3Request()); - final List canceledJobsList = client. - getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()) - .getCanceledJobListResult().getCanceledJobs(); - - assertTrue(canceledJobsList.isEmpty()); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void truncatePutJob() throws Exception { - - final int testTimeOutSeconds = 5; - final String book1 = "beowulf.txt"; - final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); - final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); - final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); - - try { - final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); - final UUID jobId = putJob.getJobId(); - final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); - - client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); - - final TruncateJobSpectraS3Response truncateJobSpectraS3Response = client.truncateJobSpectraS3( - new TruncateJobSpectraS3Request(jobId.toString())); - assertThat(truncateJobSpectraS3Response, is(notNullValue())); - - final GetJobSpectraS3Response truncatedJob = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId.toString())); - assertEquals(truncatedJob.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void cancelJobWithForce() throws Exception { - - final int testTimeOutSeconds = 5; - - final String book1 = "beowulf.txt"; - final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); - final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); - final Ds3Object obj2 = new Ds3Object("place_holder", 5000000); - - try { - final Ds3ClientHelpers.Job putJob = HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(obj1, obj2)); - final UUID jobId = putJob.getJobId(); - final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); - - client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId, 0, Files.size(objPath1))); - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId, client, 20); - - final CancelJobSpectraS3Response responseWithForce = client - .cancelJobSpectraS3(new CancelJobSpectraS3Request(jobId.toString())); - assertThat(responseWithForce, is(notNullValue())); - - //Allow for lag time before canceled job appears~1.5 seconds in unloaded system - final long startTimeCanceledUpdate = System.nanoTime(); - boolean jobCanceled = false; - while (!jobCanceled) { - Thread.sleep(500); - final GetCanceledJobsSpectraS3Response canceledJobs = client.getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()); - for (final CanceledJob canceledJob : canceledJobs.getCanceledJobListResult().getCanceledJobs()) { - if (canceledJob.getId().equals(jobId)) { - jobCanceled = true; - } - } - assertThat((System.nanoTime() - startTimeCanceledUpdate) / 1000000000, lessThan((long) testTimeOutSeconds)); - } - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void cancelAllJobs() throws IOException { - - try { - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("testOne", 2))); - final List objectsTwo = Lists.newArrayList(new Ds3Object("testTwo", 2)); - HELPERS.startWriteJob(BUCKET_NAME, objectsTwo); - client.cancelAllJobsSpectraS3(new CancelAllJobsSpectraS3Request()); - - assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) - .getActiveJobListResult().getActiveJobs().isEmpty()); - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void truncateAllJobs() throws Exception { - - final int testTimeOutSeconds = 5; - final String book1 = "beowulf.txt"; - final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); - final String book2 = "ulysses.txt"; - final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); - final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); - final Ds3Object obj2 = new Ds3Object("place_holder_1", 5000000); - final Ds3Object obj3 = new Ds3Object(book2, Files.size(objPath2)); - final Ds3Object obj4 = new Ds3Object("place_holder_2", 5000000); - - try { - final Ds3ClientHelpers.Job putJob1 = HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(obj1, obj2)); - final UUID jobId1 = putJob1.getJobId(); - final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); - client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId1.toString(), 0, Files.size(objPath1))); - - final Ds3ClientHelpers.Job putJob2 = HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(obj3, obj4)); - final UUID jobId2 = putJob2.getJobId(); - final SeekableByteChannel book2Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book2); - client.putObject(new PutObjectRequest(BUCKET_NAME, book2, book2Channel, jobId2.toString(), 0, Files.size(objPath2))); - - HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(new Ds3Object("place_holder_3", 1000000))); - - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId1, client, 20); - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId2, client, 20); - - final TruncateAllJobsSpectraS3Response truncateAllJobsSpectraS3Response = client - .truncateAllJobsSpectraS3(new TruncateAllJobsSpectraS3Request()); - - assertThat(truncateAllJobsSpectraS3Response, is(notNullValue())); - - final GetJobSpectraS3Response truncatedJob1 = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId1.toString())); - assertEquals(truncatedJob1.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath1)); - - final GetJobSpectraS3Response truncatedJob2 = client.getJobSpectraS3(new GetJobSpectraS3Request(jobId2.toString())); - assertEquals(truncatedJob2.getMasterObjectListResult().getOriginalSizeInBytes(), Files.size(objPath2)); - - assertThat(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) - .getActiveJobListResult().getActiveJobs().size(), is(2)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void cancelAllJobsWithForce() throws Exception { - - final int testTimeOutSeconds = 5; - final String book1 = "beowulf.txt"; - final Path objPath1 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book1); - final String book2 = "ulysses.txt"; - final Path objPath2 = ResourceUtils.loadFileResource(RESOURCE_BASE_NAME + book2); - final Ds3Object obj1 = new Ds3Object(book1, Files.size(objPath1)); - final Ds3Object obj2 = new Ds3Object("place_holder_1", 5000000); - final Ds3Object obj3 = new Ds3Object(book2, Files.size(objPath2)); - final Ds3Object obj4 = new Ds3Object("place_holder_2", 5000000); - - try { - final Ds3ClientHelpers.Job putJob1 = HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(obj1, obj2)); - final UUID jobId1 = putJob1.getJobId(); - final SeekableByteChannel book1Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book1); - client.putObject(new PutObjectRequest(BUCKET_NAME, book1, book1Channel, jobId1.toString(), 0, Files.size(objPath1))); - - final Ds3ClientHelpers.Job putJob2 = HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(obj3, obj4)); - final UUID jobId2 = putJob2.getJobId(); - final SeekableByteChannel book2Channel = new ResourceObjectPutter(RESOURCE_BASE_NAME).buildChannel(book2); - client.putObject(new PutObjectRequest(BUCKET_NAME, book2, book2Channel, jobId2.toString(), 0, Files.size(objPath2))); - - HELPERS.startWriteJob(BUCKET_NAME, Lists - .newArrayList(new Ds3Object("place_holder_3", 1000000))); - - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId1, client, 20); - ABMTestHelper.waitForJobCachedSizeToBeMoreThanZero(jobId2, client, 20); - - client.cancelAllJobsSpectraS3(new CancelAllJobsSpectraS3Request()); - - assertTrue(client.getActiveJobsSpectraS3(new GetActiveJobsSpectraS3Request()) - .getActiveJobListResult().getActiveJobs().isEmpty()); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void getCanceledJobs() throws IOException { - - try { - final Ds3ClientHelpers.Job jobOne = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2))); - final UUID jobOneId = jobOne.getJobId(); - client.cancelJobSpectraS3(new CancelJobSpectraS3Request(jobOneId.toString())); - - final GetCanceledJobsSpectraS3Response getCanceledJobsResponse = client - .getCanceledJobsSpectraS3(new GetCanceledJobsSpectraS3Request()); - - final List canceledJobsUUIDs = new ArrayList<>(); - for (final CanceledJob job : getCanceledJobsResponse.getCanceledJobListResult().getCanceledJobs()) { - canceledJobsUUIDs.add(job.getId()); - } - - assertTrue(canceledJobsUUIDs.contains(jobOneId)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void getJobChunksReady() throws IOException { - - try { - final Ds3Object ds3Object = new Ds3Object("test", 2); - final Ds3ClientHelpers.Job jobOne = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(ds3Object)); - final UUID jobOneId = jobOne.getJobId(); - - final GetJobChunksReadyForClientProcessingSpectraS3Response response = client - .getJobChunksReadyForClientProcessingSpectraS3 - (new GetJobChunksReadyForClientProcessingSpectraS3Request(jobOneId.toString())); - - final List chunkNames = new ArrayList<>(); - for (final Objects objectList : response.getMasterObjectListResult().getObjects()) { - for (final BulkObject bulkObject : objectList.getObjects()) { - chunkNames.add(bulkObject.getName()); - } - } - - assertThat(chunkNames, contains(ds3Object.getName())); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void getJobChunk() throws IOException { - - try { - final Ds3Object ds3Object = new Ds3Object("test", 2); - final Ds3ClientHelpers.Job jobOne = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(ds3Object)); - final UUID jobOneId = jobOne.getJobId(); - - final GetJobChunksReadyForClientProcessingSpectraS3Response response = client - .getJobChunksReadyForClientProcessingSpectraS3 - (new GetJobChunksReadyForClientProcessingSpectraS3Request(jobOneId)); - - final UUID aJobChunkID = response.getMasterObjectListResult().getObjects().get(0).getChunkId(); - - final GetJobChunkSpectraS3Response getJobChunkSpectraS3Response = client.getJobChunkSpectraS3( - new GetJobChunkSpectraS3Request(aJobChunkID)); - - assertThat(getJobChunkSpectraS3Response.getObjectsResult(), is(notNullValue())); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void aggregateTwoJobs() throws IOException { - - try { - final WriteJobOptions writeJobOptions = WriteJobOptions.create().withAggregating(); - - final Ds3ClientHelpers.Job jobOne = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)), writeJobOptions); - final UUID jobOneId = jobOne.getJobId(); - - final Ds3ClientHelpers.Job jobTwo = - HELPERS.startWriteJob(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test2", 2)), writeJobOptions); - final UUID jobTwoId = jobTwo.getJobId(); - - assertThat(jobOneId, is(jobTwoId)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void allocateJobChunk() throws IOException { - - try { - final PutBulkJobSpectraS3Response putBulkResponse = client. - putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(new Ds3Object("test", 2)))); - final UUID chunkUUID = putBulkResponse.getMasterObjectList().getObjects().get(0).getChunkId(); - final AllocateJobChunkSpectraS3Response allocateResponse = client - .allocateJobChunkSpectraS3(new AllocateJobChunkSpectraS3Request(chunkUUID.toString())); - - assertThat(allocateResponse.getStatus(), is(AllocateJobChunkSpectraS3Response.Status.ALLOCATED)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void putObjectCachedNotification() throws IOException { - final PutObjectCachedNotificationRegistrationSpectraS3Response putNotificationResponse = client - .putObjectCachedNotificationRegistrationSpectraS3 - (new PutObjectCachedNotificationRegistrationSpectraS3Request("test@test.test")); - - assertThat(putNotificationResponse.getS3ObjectCachedNotificationRegistrationResult(), is(notNullValue())); - } - - @Test - public void getObjectCachedNotification() throws IOException { - - final PutObjectCachedNotificationRegistrationSpectraS3Response putNotificationResponse = client - .putObjectCachedNotificationRegistrationSpectraS3 - (new PutObjectCachedNotificationRegistrationSpectraS3Request("test@test.test")); - final GetObjectCachedNotificationRegistrationSpectraS3Response getNotificationResponse = client - .getObjectCachedNotificationRegistrationSpectraS3( - (new GetObjectCachedNotificationRegistrationSpectraS3Request - (putNotificationResponse.getS3ObjectCachedNotificationRegistrationResult().getId().toString()))); - - assertThat(getNotificationResponse.getS3ObjectCachedNotificationRegistrationResult(), is(notNullValue())); - } - - @Test - public void getCompletedJobs() throws IOException { - final GetCompletedJobsSpectraS3Response getCompletedJobsResponse = client. - getCompletedJobsSpectraS3(new GetCompletedJobsSpectraS3Request()); - - assertThat(getCompletedJobsResponse.getCompletedJobListResult(), is(notNullValue())); - } - - @Test - public void clearCompletedJobs() throws IOException { - final ClearAllCompletedJobsSpectraS3Response clearAllCompletedJobsResponse = client - .clearAllCompletedJobsSpectraS3(new ClearAllCompletedJobsSpectraS3Request()); - - assertThat(clearAllCompletedJobsResponse, is(notNullValue())); - } - - @Test - public void putJobCreatedNotification() throws IOException { - UUID notificationUUID = null; - try { - final PutJobCreatedNotificationRegistrationSpectraS3Response response = client - .putJobCreatedNotificationRegistrationSpectraS3(new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")); - notificationUUID = response.getJobCreatedNotificationRegistrationResult().getId(); - assertThat(response.getJobCreatedNotificationRegistrationResult(), is(notNullValue())); - - } finally { - if (notificationUUID != null) { - client.deleteJobCreatedNotificationRegistrationSpectraS3( - new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); - } - } - } - - @Test - public void getJobCreatedNotification() throws IOException { - UUID notificationUUID = null; - try { - notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( - new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) - .getJobCreatedNotificationRegistrationResult().getId(); - - final GetJobCreatedNotificationRegistrationSpectraS3Response response = client - .getJobCreatedNotificationRegistrationSpectraS3(new - GetJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); - - assertThat(response.getJobCreatedNotificationRegistrationResult(), is(notNullValue())); - - } finally { - if (notificationUUID != null) { - client.deleteJobCreatedNotificationRegistrationSpectraS3( - new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); - } - } - } - - @Test - public void deleteJobCreatedNotification() throws IOException { - final UUID notificationUUID = client.putJobCreatedNotificationRegistrationSpectraS3( - new PutJobCreatedNotificationRegistrationSpectraS3Request("test@test.test")) - .getJobCreatedNotificationRegistrationResult().getId(); - - final DeleteJobCreatedNotificationRegistrationSpectraS3Response response = client - .deleteJobCreatedNotificationRegistrationSpectraS3(new DeleteJobCreatedNotificationRegistrationSpectraS3Request(notificationUUID)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void putJobCompletedNotification() throws IOException { - UUID notificationUUID = null; - try { - final PutJobCompletedNotificationRegistrationSpectraS3Response response = client - .putJobCompletedNotificationRegistrationSpectraS3( - new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")); - notificationUUID = response.getJobCompletedNotificationRegistrationResult().getId(); - assertThat(response.getJobCompletedNotificationRegistrationResult(), is(notNullValue())); - } finally { - if (notificationUUID != null) { - client.deleteJobCompletedNotificationRegistrationSpectraS3( - new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); - } - } - } - - @Test - public void getJobCompletedNotification() throws IOException { - UUID notificationUUID = null; - try { - notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( - new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) - .getJobCompletedNotificationRegistrationResult().getId(); - - final GetJobCompletedNotificationRegistrationSpectraS3Response response = client - .getJobCompletedNotificationRegistrationSpectraS3( - new GetJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); - - assertThat(response.getJobCompletedNotificationRegistrationResult(), is(notNullValue())); - - } finally { - if (notificationUUID != null) { - client.deleteJobCompletedNotificationRegistrationSpectraS3( - new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); - } - } - } - - @Test - public void deleteJobCompletedNotification() throws IOException { - final UUID notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( - new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) - .getJobCompletedNotificationRegistrationResult().getId(); - - final DeleteJobCompletedNotificationRegistrationSpectraS3Response response = client - .deleteJobCompletedNotificationRegistrationSpectraS3( - new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); - - assertThat(response, is(notNullValue())); - } - - @Test - public void initiateMultipartUpload() throws IOException { - try { - final InitiateMultiPartUploadResponse multiPartUploadResponse = client.initiateMultiPartUpload( - new InitiateMultiPartUploadRequest(BUCKET_NAME, "beowulf")); - - assertThat(multiPartUploadResponse.getInitiateMultipartUploadResult(), is(notNullValue())); - } catch (final FailedRequestException e) { - - assertThat(getCacheBytesAvailable(), lessThan(5000000000000L)); - assertThat(e.getStatusCode(), is(400)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void abortMultipartUpload() throws IOException { - String uploadID = null; - try { - try { - final InitiateMultiPartUploadResponse multiPartUploadResponse = client.initiateMultiPartUpload( - new InitiateMultiPartUploadRequest(BUCKET_NAME, "beowulf")); - uploadID = multiPartUploadResponse.getInitiateMultipartUploadResult().getUploadId(); - } catch (final FailedRequestException e) { - assertThat(getCacheBytesAvailable(), lessThan(5000000000000L)); - assertThat(e.getStatusCode(), is(400)); - } - - final UUID uuid; - if (uploadID != null) { - uuid = UUID.fromString(uploadID); - } else { - uuid = UUID.randomUUID(); - } - - final AbortMultiPartUploadResponse abortResponse = client.abortMultiPartUpload( - new AbortMultiPartUploadRequest(BUCKET_NAME, "beowulf", uuid)); - - assertThat(abortResponse, is(notNullValue())); - - } catch (final FailedRequestException e) { - - assertThat(e.getStatusCode(), is(404)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test //TODO expand positive test if test target >5 TB cache is available - public void listMultiPartUploadParts() throws IOException { - try { - final ListMultiPartUploadPartsResponse response = client.listMultiPartUploadParts( - new ListMultiPartUploadPartsRequest(BUCKET_NAME, "beowulf", UUID.randomUUID())); - - assertThat(response.getListPartsResult(), is(notNullValue())); - assertTrue(response.getListPartsResult().getParts().isEmpty()); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test //TODO expand positive test if test target >5 TB cache is available - public void completeMultiPartUpload() throws IOException { - try { - client.completeMultiPartUpload( - //Passing in a null request payload, which is sufficient for checking error code - new CompleteMultiPartUploadRequest(BUCKET_NAME, "beowulf", null, UUID.randomUUID())); - - fail("Response should have failed because upload part does not exist"); - - } catch (final FailedRequestException e) { - - assertThat(e.getStatusCode(), is(404)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test //TODO expand positive test if test target >5 TB cache is available - public void listMultiPartUploads() throws IOException { - try { - final ListMultiPartUploadsResponse response = client.listMultiPartUploads( - new ListMultiPartUploadsRequest(BUCKET_NAME)); - - assertThat(response.getListMultiPartUploadsResult(), is(notNullValue())); - assertTrue(response.getListMultiPartUploadsResult().getUploads().isEmpty()); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test //TODO expand positive test if test target >5 TB cache is available - public void putMultiPartUploadPart() throws IOException { - try { - final int length = 1024; - final Ds3Object obj = new Ds3Object("obj.txt", length); - final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(System.currentTimeMillis(), obj.getSize())); - final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); - - final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(length); - channel.write(randomBuffer); - - client.putMultiPartUploadPart( - new PutMultiPartUploadPartRequest(BUCKET_NAME, obj.getName(), channel, 5, length, UUID.randomUUID())); - - fail("Response should have failed because part does not exist"); - - } catch (final FailedRequestException e) { - - assertThat(e.getStatusCode(), is(404)); - - } finally { - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void testWriteJobWithRetries() throws Exception { - final int maxNumObjectTransferAttempts = 3; - transferAndCheckFileContent(maxNumObjectTransferAttempts, - new ObjectTransferExceptionHandler() { - @Override - public boolean handleException(final Throwable t) { - fail("Got unexpected exception: " + t.getMessage()); - return false; - } - }); - } - - private void transferAndCheckFileContent(final int maxNumObjectTransferAttempts, - final ObjectTransferExceptionHandler objectTransferExceptionHandler) - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException, URISyntaxException - { - final String userAgent = "Agent Provocateur"; - - final Ds3Client clientWithUserAgent = Ds3ClientBuilder.fromEnv() - .withUserAgent(userAgent) - .withHttps(false) - .build(); - - final Ds3ClientShim ds3ClientShim = new Ds3ClientShim((Ds3ClientImpl) clientWithUserAgent); - - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final String DIR_NAME = "largeFiles/"; - final String[] FILE_NAMES = new String[]{"lesmis.txt"}; - - final Path dirPath = ResourceUtils.loadFileResource(DIR_NAME); - - final List bookTitles = new ArrayList<>(); - final List objects = new ArrayList<>(); - for (final String book : FILE_NAMES) { - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(book, bookSize); - - bookTitles.add(book); - objects.add(obj); - } - - final int maxNumBlockAllocationRetries = 1; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3ClientShim, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final IntValue intValue = new IntValue(); - - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); - writeJob.attachObjectCompletedListener(new ObjectCompletedListener() { - private int numCompletedObjects = 0; - - @Override - public void objectCompleted(final String name) { - assertTrue(bookTitles.contains(name)); - assertEquals(1, ++numCompletedObjects); - intValue.increment(); - } - }); - - boolean shouldContinueTest = true; - - try { - writeJob.transfer(new FileObjectPutter(dirPath)); - } catch (final Throwable t) { - shouldContinueTest = objectTransferExceptionHandler.handleException(t); - } - - if (!shouldContinueTest) { - return; - } - - assertEquals(1, intValue.getValue()); - - final GetBucketResponse request = ds3ClientShim.getBucket(new GetBucketRequest(BUCKET_NAME)); - final ListBucketResult result = request.getListBucketResult(); - - assertEquals(bookTitles.size(), result.getObjects().size()); - - for (final Contents contents : result.getObjects()) { - assertTrue(bookTitles.contains(contents.getKey())); - } - - final Ds3ClientHelpers.Job readJob = Ds3ClientHelpers.wrap(ds3ClientShim, 1) - .startReadAllJob(BUCKET_NAME); - readJob.attachObjectCompletedListener(new ObjectCompletedListener() { - @Override - public void objectCompleted(final String name) { - assertTrue(bookTitles.contains(name)); - - try { - final File originalFile = ResourceUtils.loadFileResource(DIR_NAME + FILE_NAMES[0]).toFile(); - final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), FILE_NAMES[0]).toFile(); - assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); - } catch (final URISyntaxException | IOException e) { - fail("Failure trying to compare file we wrote to file we read."); - } - } - }); - - readJob.transfer(new FileObjectGetter(tempDirectory)); - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteAllContents(ds3ClientShim, BUCKET_NAME); - } - } - - private interface ObjectTransferExceptionHandler { - boolean handleException(final Throwable t); - } - - @Test - public void testWriteJobWithRetriesThrowsDs3NoMoreRetriesException() throws Exception { - final int maxNumObjectTransferAttempts = 1; - transferAndCheckFileContent(maxNumObjectTransferAttempts, - new ObjectTransferExceptionHandler() { - @Override - public boolean handleException(final Throwable t) { - if (!(t instanceof Ds3NoMoreRetriesException)) { - fail("Got exception of unexpected type: " + t.getMessage()); - return true; - } - - return false; - } - }); - } - - @Test - public void testFiringOnFailureEventWithFailedChunkAllocation() - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final IntValue numFailureEventsFired = new IntValue(); - - final int maxNumObjectTransferAttempts = 1; - final Ds3ClientHelpers.Job writeJob = createWriteJobWithObjectsReadyToTransfer(maxNumObjectTransferAttempts, - ClientFailureType.ChunkAllocation); - - final FailureEventListener failureEventListener = new FailureEventListener() { - @Override - public void onFailure(final FailureEvent failureEvent) { - numFailureEventsFired.increment(); - assertEquals(FailureEvent.FailureActivity.PuttingObject, failureEvent.doingWhat()); - } - }; - - writeJob.attachFailureEventListener(failureEventListener); - - try { - writeJob.transfer(new FileObjectPutter(tempDirectory)); - } catch (final Ds3NoMoreRetriesException e) { - assertEquals(1, numFailureEventsFired.getValue()); - } - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteAllContents(client, BUCKET_NAME); - } - } - - Ds3ClientHelpers.Job createWriteJobWithObjectsReadyToTransfer(final int maxNumObjectTransferAttempts, - final ClientFailureType clientFailureType) - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - final String DIR_NAME = "largeFiles/"; - final String[] FILE_NAMES = new String[]{"lesmis-copies.txt"}; - - final List bookTitles = new ArrayList<>(); - final List objects = new ArrayList<>(); - for (final String book : FILE_NAMES) { - final Path objPath = ResourceUtils.loadFileResource(DIR_NAME + book); - final long bookSize = Files.size(objPath); - final Ds3Object obj = new Ds3Object(book, bookSize); - - bookTitles.add(book); - objects.add(obj); - } - - final Ds3Client ds3Client = Ds3ClientShimFactory.makeWrappedDs3Client(clientFailureType, client); - - final int maxNumBlockAllocationRetries = 3; - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(ds3Client, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, objects); - - return writeJob; - } - - @Test - public void testFiringOnFailureEventWithFailedPutObject() - throws IOException, URISyntaxException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final IntValue numFailureEventsFired = new IntValue(); - - final int maxNumObjectTransferAttempts = 1; - final Ds3ClientHelpers.Job writeJob = createWriteJobWithObjectsReadyToTransfer(maxNumObjectTransferAttempts, - ClientFailureType.PutObject); - - final FailureEventListener failureEventListener = new FailureEventListener() { - @Override - public void onFailure(final FailureEvent failureEvent) { - numFailureEventsFired.increment(); - assertEquals(FailureEvent.FailureActivity.PuttingObject, failureEvent.doingWhat()); - } - }; - - writeJob.attachFailureEventListener(failureEventListener); - - try { - writeJob.transfer(new FileObjectPutter(tempDirectory)); - } catch (final RuntimeException e) { - assertEquals(1, numFailureEventsFired.getValue()); - } - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteAllContents(client, BUCKET_NAME); - } - } - - @Test - public void testThatMetadataAccessDoesNotTerminateTransfer() throws IOException, URISyntaxException, InterruptedException { - final String tempPathPrefix = null; - final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - final String fileName = "Gracie.txt"; - - final Path filePath = Paths.get(tempDirectory.toString(), fileName); - - final List ds3Objects = new ArrayList<>(); - ds3Objects.add(new Ds3Object(fileName)); - - try { - if ( ! Platform.isWindows()) { - tempDirectory.toFile().setExecutable(false); - } else { - Runtime.getRuntime().exec("icacls " + tempDirectory.toString() + "/deny Everyone(RD)").waitFor(); - } - - final int maxNumBlockAllocationRetries = 3; - final int maxNumObjectTransferAttempts = 3; - - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client, - maxNumBlockAllocationRetries, - maxNumObjectTransferAttempts); - - final AtomicInteger numTimesFailureHandlerCalled = new AtomicInteger(0); - - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, ds3Objects); - writeJob.withMetadata(new MetadataAccessImpl(ImmutableMap.builder().put(fileName, filePath).build(), - new FailureEventListener() { - @Override - public void onFailure(final FailureEvent failureEvent) { - numTimesFailureHandlerCalled.incrementAndGet(); - assertEquals(FailureEvent.FailureActivity.RecordingMetadata, failureEvent.doingWhat()); - assertEquals(client.getConnectionDetails().getEndpoint(), failureEvent.usingSystemWithEndpoint()); - } - }, - client.getConnectionDetails().getEndpoint())); - writeJob.transfer(new FileObjectGetter(Paths.get("."))); - - assertEquals(1, numTimesFailureHandlerCalled.get()); - } finally { - if ( ! Platform.isWindows()) { - tempDirectory.toFile().setExecutable(true); - } else { - Runtime.getRuntime().exec("icacls " + tempDirectory.toString() + "/grant Everyone(RD)").waitFor(); - } - - deleteAllContents(client, BUCKET_NAME); - FileUtils.deleteDirectory(tempDirectory.toFile()); - Files.delete(Paths.get(fileName)); - } - } - - @Test - public void testPutting15000Files() throws IOException, URISyntaxException { - final String tempPathPrefix = null; - Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - try { - final String sourceDirectory = "little_files/"; - final String sourceFileName = "tape.png"; - - final Path sourceFilePath = ResourceUtils.loadFileResource(sourceDirectory + sourceFileName); - - Files.copy(sourceFilePath, Paths.get(tempDirectory.toString(), sourceFileName)); - - final List fileNames = new ArrayList<>(15001); - fileNames.add(sourceFileName); - - for (int i = 1; i <= 15000; ++i) { - final String destinationFileName = "tape" + i + ".png"; - fileNames.add(destinationFileName); - Files.copy(sourceFilePath, Paths.get(tempDirectory.toString(), destinationFileName)); - } - - final List ds3Objects = new ArrayList<>(); - - for (final String fileName : fileNames) { - final Path filePath = Paths.get(tempDirectory.toString(), fileName); - final long fileSize = Files.size(filePath); - final Ds3Object ds3Object = new Ds3Object(fileName, fileSize); - - ds3Objects.add(ds3Object); - } - - final Ds3ClientHelpers ds3ClientHelpers = Ds3ClientHelpers.wrap(client); - final Ds3ClientHelpers.Job writeJob = ds3ClientHelpers.startWriteJob(BUCKET_NAME, ds3Objects); - - writeJob.transfer(new FileObjectPutter(tempDirectory)); - - FileUtils.deleteDirectory(tempDirectory.toFile()); - - tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); - - final Ds3ClientHelpers.Job readJob = ds3ClientHelpers.startReadJob(BUCKET_NAME, Lists.newArrayList( - new Ds3Object(sourceFileName, Files.size(sourceFilePath)))); - - final GetJobSpectraS3Response jobSpectraS3Response = client.getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); - - assertThat(jobSpectraS3Response.getMasterObjectListResult(), is(notNullValue())); - - readJob.transfer(new FileObjectGetter(tempDirectory)); - - final File originalFile = ResourceUtils.loadFileResource(sourceDirectory + sourceFileName).toFile(); - final File fileCopiedFromBP = Paths.get(tempDirectory.toString(), sourceFileName).toFile(); - assertTrue(FileUtils.contentEquals(originalFile, fileCopiedFromBP)); - } catch (final org.apache.http.client.ClientProtocolException e) { - fail("This test makes sure that we don't run out of connections when transferring lots of small files. Oops"); - } finally { - FileUtils.deleteDirectory(tempDirectory.toFile()); - deleteAllContents(client, BUCKET_NAME); - } - } -} diff --git a/ds3-sdk-samples/build.gradle.kts b/ds3-sdk-samples/build.gradle.kts new file mode 100644 index 000000000..e06d4df38 --- /dev/null +++ b/ds3-sdk-samples/build.gradle.kts @@ -0,0 +1,30 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `ds3-java-sdk-internal-convention` + `application` +} + +dependencies { + implementation(project(":ds3-sdk")) + implementation(project(":ds3-utils")) + + implementation(libs.guava) +} + +application { + mainClass.set("com.spectralogic.ds3client.samples.PartialObjectGetExample") +} \ No newline at end of file diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkGetWithMetadata.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkGetWithMetadata.java index fbe635f5a..fea3d13ab 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkGetWithMetadata.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkGetWithMetadata.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -71,6 +71,6 @@ private static void printMetadata(final String objectName, final Metadata metada .append("> "); } - System.out.println(builder.toString()); + System.out.println(builder); } } diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutExample.java index 942dcf0aa..b59724940 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithChecksums.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithChecksums.java index 52f37cc02..349271d3a 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithChecksums.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithChecksums.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithMetadata.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithMetadata.java index 6d1c7fe6a..227cf21bd 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithMetadata.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/BulkPutWithMetadata.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -57,7 +57,7 @@ public static void main(final String[] args) throws IOException { public Map getMetadataValue(final String objectName) { // Return a map of the metadata that you want assigned to the request object final Map metadata = new HashMap<>(); - metadata.put("file-format", "txt"); + metadata.put("File-Format", "txt"); return metadata; } }); diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3BulkGetExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3BulkGetExample.java index ae8080a56..03127abf4 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3BulkGetExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3BulkGetExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3PutObjectRelativePathExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3PutObjectRelativePathExample.java index 252fe4bf9..42bbec3db 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3PutObjectRelativePathExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3PutObjectRelativePathExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3ServiceListExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3ServiceListExample.java index c4d8a777b..0f1f5b487 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3ServiceListExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/Ds3ServiceListExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,7 +26,6 @@ import com.spectralogic.ds3client.networking.FailedRequestUsingMgmtPortException; import java.io.IOException; -import java.net.UnknownHostException; import java.security.SignatureException; import java.net.UnknownHostException; diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PartialObjectGetExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PartialObjectGetExample.java index e3523df09..16b39243e 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PartialObjectGetExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PartialObjectGetExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PutEmptyFolderExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PutEmptyFolderExample.java index 2cb921e58..d2177a58d 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PutEmptyFolderExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/PutEmptyFolderExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,8 +19,6 @@ import com.spectralogic.ds3client.Ds3ClientBuilder; import com.spectralogic.ds3client.commands.PutObjectRequest; import com.spectralogic.ds3client.commands.PutObjectResponse; -import com.spectralogic.ds3client.commands.spectrads3.GetBucketSpectraS3Request; -import com.spectralogic.ds3client.commands.spectrads3.GetBucketSpectraS3Response; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; import com.spectralogic.ds3client.models.Contents; import com.spectralogic.ds3client.networking.FailedRequestException; diff --git a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/RecoverJobExample.java b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/RecoverJobExample.java index d4e4ee4e7..bf37a38f0 100644 --- a/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/RecoverJobExample.java +++ b/ds3-sdk-samples/src/main/java/com/spectralogic/ds3client/samples/RecoverJobExample.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/build.gradle b/ds3-sdk/build.gradle deleted file mode 100644 index 6688a07f5..000000000 --- a/ds3-sdk/build.gradle +++ /dev/null @@ -1,88 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -import java.nio.file.Files -import java.nio.file.Path - -buildscript { - repositories { jcenter() } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - } -} - -apply plugin: 'com.github.johnrengelman.shadow' - -shadowJar { - relocate 'com.google', 'ds3fatjar.com.google' - relocate 'org.apache', 'ds3fatjar.org.apache' - relocate 'org.codehaus', 'ds3fatjar.org.codehaus' - relocate 'com.fasterxml', 'ds3fatjar.com.fasterxml' - dependencies { - exclude(dependency('org.hamcrest:hamcrest-library:1.3')) - exclude(dependency('org.mockito:mockito-core:1.10.19')) - exclude(dependency('junit:junit:4.12')) - exclude(dependency('org.slf4j:slf4j-api:1.7.22')) - exclude(dependency('org.slf4j:slf4j-simple:1.7.22')) - exclude(dependency('org.apache.commons:commons-lang3:3.0')) - } -} - -artifacts { - archives shadowJar -} - -task genConfigProperties { - doLast { - def productionBuild = System.getenv('productionBuild') - if (productionBuild == null) { productionBuild = 'false' } - - File configFile = new File(sourceSets.main.output.resourcesDir, "/ds3_sdk.properties") - Path configPath = sourceSets.main.output.resourcesDir.toPath() - if (!Files.exists(configPath)) { - Files.createDirectories(configPath) - } - - configFile.withWriter{out -> - out.writeLine("productionBuild=" + productionBuild.toString()) - out.writeLine("version=" + version.toString()) - out.writeLine("build.date=" + new Date().toString()) - } - } -} - -task zip(type: Zip) { - from configurations.runtime.allArtifacts.files - from configurations.runtime - into (project.name + "-" + project.version) -} - -zip.dependsOn jar - -jar { - from sourceSets.main.allJava -} - -jar.dependsOn genConfigProperties - -dependencies { - compile 'org.apache.httpcomponents:httpclient:4.5.1' - compile 'org.codehaus.woodstox:woodstox-core-asl:4.4.1' - compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.7.1' - compile 'com.google.guava:guava:20.0' - compile 'com.google.code.findbugs:annotations:3.0.1' - testCompile 'org.hamcrest:hamcrest-library:1.3' - testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' -} diff --git a/ds3-sdk/build.gradle.kts b/ds3-sdk/build.gradle.kts new file mode 100644 index 000000000..e1afa6e9e --- /dev/null +++ b/ds3-sdk/build.gradle.kts @@ -0,0 +1,98 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +import java.time.Instant + +plugins { + `ds3-java-sdk-library-convention` + alias(libs.plugins.shadowPlugin) + alias(libs.plugins.gitVersionPlugin) +} + +description = "The BlackPearl SDK module holds the classes used to " + + "communicate with the BlackPearl dataport." + +dependencies { + implementation(platform(libs.jacksonBom)) + + api(project(":ds3-interfaces")) + api(project(":ds3-utils")) + + implementation(libs.kotlinStdLib) + implementation(libs.commonsIo) + implementation(libs.guava) + implementation(libs.httpclient) + implementation(libs.jacksonDatatypeJdk8) + implementation(libs.jacksonDataformatXml) + implementation(libs.slf4jApi) + implementation(libs.findbugs) + implementation(libs.woodstoxCoreAsl) + + testImplementation(platform(libs.mockitoBom)) + + testImplementation(libs.junit) + testImplementation(libs.junitJupiterApi) + testImplementation(libs.hamcrest) + testImplementation(libs.mockitoCore) + + testRuntimeOnly(libs.junitVintageEngine) + testRuntimeOnly(libs.slf4jSimple) +} + +val versionDetails: groovy.lang.Closure by extra + +val genConfigProperties by tasks.registering(WriteProperties::class,) { + group = BasePlugin.BUILD_GROUP + description = "Create properties file with build information." + val getProdBuild = { value: String? -> value ?: "false" } + val gitDetails = versionDetails() + property("productionBuild", getProdBuild(System.getenv("productionBuild"))) + property("version", version.toString()) + property("build.date", Instant.now()) + property("git.commitHash", gitDetails.gitHash) + outputFile = file("${buildDir}/ds3_sdk.properties") + encoding = "UTF-8" +} + +tasks.jar { + dependsOn(genConfigProperties) +} + +tasks.named("shadowJar") { + relocate("com.ctc", "ds3fatjar.com.ctc") + relocate("com.fasterxml", "ds3fatjar.com.fasterxml") + relocate("com.google", "ds3fatjar.com.google") + relocate("edu.umd", "ds3fatjar.edu.emd") + relocate("kotlin", "ds3fatjar.kotlin") + relocate("net.jcip", "ds3fatjar.net.jcip") + relocate("org.apache", "ds3fatjar.org.apache") + relocate("org.codehaus", "ds3fatjar.org.codehaus") + relocate("org.intellij", "ds3fatjar.org.intellij") + relocate("org.jetbrains", "ds3fatjar.org.jetbrains") + dependencies { + exclude(dependency(libs.slf4jApi.get().toString())) + } + mergeServiceFiles() + dependsOn(tasks.jar) +} + +val allProjectJars by tasks.registering(Zip::class) { + group = "distribution" + description = "Create zip file containing all SDK jars and its dependencies." + archiveFileName.set(project.name + "-" + project.version + ".zip") + destinationDirectory.set(layout.buildDirectory.dir("dist")) + from(configurations.runtimeClasspath) + dependsOn(tasks.jar) +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/BulkCommand.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/BulkCommand.java index f3696985d..7e9370234 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/BulkCommand.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/BulkCommand.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/ConnectionDetailsImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/ConnectionDetailsImpl.java index 9f931d38a..1376cc703 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/ConnectionDetailsImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/ConnectionDetailsImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -117,8 +117,7 @@ public static ConnectionDetails newForNode(final JobNode node, final ConnectionD } private static String buildAuthority(final JobNode node, final ConnectionDetails connectionDetails) { - return node.getEndPoint() + ":" + Integer.toString( - connectionDetails.isHttps() ? node.getHttpsPort() : node.getHttpPort()); + return node.getEndPoint() + ":" + (connectionDetails.isHttps() ? node.getHttpsPort() : node.getHttpPort()); } private final String endpoint; @@ -199,7 +198,7 @@ public String getUserAgent() { return Guard.isStringNullOrEmpty(userAgent) ? getDefaultSdkVersion() : userAgent; } - private String getDefaultSdkVersion() { + private static String getDefaultSdkVersion() { final String sdkVersion = PropertyUtils.getSdkVersion(); if (Guard.isStringNullOrEmpty(sdkVersion)) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3Client.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3Client.java index 0268450de..f641645f6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3Client.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3Client.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -37,12 +37,7 @@ public interface Ds3Client extends Closeable { - AbortMultiPartUploadResponse abortMultiPartUpload(final AbortMultiPartUploadRequest request) - throws IOException; - - - - CompleteMultiPartUploadResponse completeMultiPartUpload(final CompleteMultiPartUploadRequest request) + CompleteBlobResponse completeBlob(final CompleteBlobRequest request) throws IOException; @@ -52,11 +47,6 @@ PutBucketResponse putBucket(final PutBucketRequest request) - PutMultiPartUploadPartResponse putMultiPartUploadPart(final PutMultiPartUploadPartRequest request) - throws IOException; - - - PutObjectResponse putObject(final PutObjectRequest request) throws IOException; @@ -95,21 +85,6 @@ HeadBucketResponse headBucket(final HeadBucketRequest request) HeadObjectResponse headObject(final HeadObjectRequest request) throws IOException; - - - InitiateMultiPartUploadResponse initiateMultiPartUpload(final InitiateMultiPartUploadRequest request) - throws IOException; - - - - ListMultiPartUploadPartsResponse listMultiPartUploadParts(final ListMultiPartUploadPartsRequest request) - throws IOException; - - - - ListMultiPartUploadsResponse listMultiPartUploads(final ListMultiPartUploadsRequest request) - throws IOException; - @ResponsePayloadModel("BucketAcl") @Action("CREATE") @Resource("BUCKET_ACL") @@ -240,6 +215,19 @@ GetBucketsSpectraS3Response getBucketsSpectraS3(final GetBucketsSpectraS3Request ModifyBucketSpectraS3Response modifyBucketSpectraS3(final ModifyBucketSpectraS3Request request) throws IOException; + @ResponsePayloadModel("CacheThrottleRule") + @Action("CREATE") + @Resource("CACHE_THROTTLE_RULE") + + PutCacheThrottleRuleSpectraS3Response putCacheThrottleRuleSpectraS3(final PutCacheThrottleRuleSpectraS3Request request) + throws IOException; + + @Action("DELETE") + @Resource("CACHE_THROTTLE_RULE") + + DeleteCacheThrottleRuleSpectraS3Response deleteCacheThrottleRuleSpectraS3(final DeleteCacheThrottleRuleSpectraS3Request request) + throws IOException; + @Action("BULK_MODIFY") @Resource("CACHE_FILESYSTEM") @@ -267,6 +255,20 @@ GetCacheFilesystemsSpectraS3Response getCacheFilesystemsSpectraS3(final GetCache GetCacheStateSpectraS3Response getCacheStateSpectraS3(final GetCacheStateSpectraS3Request request) throws IOException; + @ResponsePayloadModel("CacheThrottleRule") + @Action("SHOW") + @Resource("CACHE_THROTTLE_RULE") + + GetCacheThrottleRuleSpectraS3Response getCacheThrottleRuleSpectraS3(final GetCacheThrottleRuleSpectraS3Request request) + throws IOException; + + @ResponsePayloadModel("CacheThrottleRuleList") + @Action("LIST") + @Resource("CACHE_THROTTLE_RULE") + + GetCacheThrottleRulesSpectraS3Response getCacheThrottleRulesSpectraS3(final GetCacheThrottleRulesSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("CacheFilesystem") @Action("MODIFY") @Resource("CACHE_FILESYSTEM") @@ -274,6 +276,13 @@ GetCacheStateSpectraS3Response getCacheStateSpectraS3(final GetCacheStateSpectra ModifyCacheFilesystemSpectraS3Response modifyCacheFilesystemSpectraS3(final ModifyCacheFilesystemSpectraS3Request request) throws IOException; + @ResponsePayloadModel("CacheThrottleRule") + @Action("MODIFY") + @Resource("CACHE_THROTTLE_RULE") + + ModifyCacheThrottleRuleSpectraS3Response modifyCacheThrottleRuleSpectraS3(final ModifyCacheThrottleRuleSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("CapacitySummaryContainer") @Action("LIST") @Resource("CAPACITY_SUMMARY") @@ -723,6 +732,8 @@ VerifyUserIsMemberOfGroupSpectraS3Response verifyUserIsMemberOfGroupSpectraS3(fi @Action("MODIFY") @Resource("JOB_CHUNK") + /** @deprecated Use {@link #getJobChunksReadyForClientProcessingSpectraS3(GetJobChunksReadyForClientProcessingSpectraS3Request)} instead */ + @Deprecated AllocateJobChunkSpectraS3Response allocateJobChunkSpectraS3(final AllocateJobChunkSpectraS3Request request) throws IOException; @@ -762,6 +773,13 @@ ClearAllCanceledJobsSpectraS3Response clearAllCanceledJobsSpectraS3(final ClearA ClearAllCompletedJobsSpectraS3Response clearAllCompletedJobsSpectraS3(final ClearAllCompletedJobsSpectraS3Request request) throws IOException; + @ResponsePayloadModel("MasterObjectList") + @Action("MODIFY") + @Resource("JOB") + + CloseAggregatingJobSpectraS3Response closeAggregatingJobSpectraS3(final CloseAggregatingJobSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("MasterObjectList") @Action("MODIFY") @Resource("BUCKET") @@ -783,6 +801,12 @@ PutBulkJobSpectraS3Response putBulkJobSpectraS3(final PutBulkJobSpectraS3Request VerifyBulkJobSpectraS3Response verifyBulkJobSpectraS3(final VerifyBulkJobSpectraS3Request request) throws IOException; + @Action("DELETE") + @Resource("JOB_CREATION_FAILED") + + DeleteJobCreationFailureSpectraS3Response deleteJobCreationFailureSpectraS3(final DeleteJobCreationFailureSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("ActiveJob") @Action("SHOW") @Resource("ACTIVE_JOB") @@ -846,6 +870,20 @@ GetJobChunkSpectraS3Response getJobChunkSpectraS3(final GetJobChunkSpectraS3Requ GetJobChunksReadyForClientProcessingSpectraS3Response getJobChunksReadyForClientProcessingSpectraS3(final GetJobChunksReadyForClientProcessingSpectraS3Request request) throws IOException; + @ResponsePayloadModel("JobCreationFailedList") + @Action("LIST") + @Resource("JOB_CREATION_FAILED") + + GetJobCreationFailuresSpectraS3Response getJobCreationFailuresSpectraS3(final GetJobCreationFailuresSpectraS3Request request) + throws IOException; + + @ResponsePayloadModel("JobEntryList") + @Action("LIST") + @Resource("JOB_CHUNK_DAO") + + GetJobEntriesSpectraS3Response getJobEntriesSpectraS3(final GetJobEntriesSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("MasterObjectList") @Action("SHOW") @Resource("JOB") @@ -853,6 +891,13 @@ GetJobChunksReadyForClientProcessingSpectraS3Response getJobChunksReadyForClient GetJobSpectraS3Response getJobSpectraS3(final GetJobSpectraS3Request request) throws IOException; + @ResponsePayloadModel("JobSummaryApiBean") + @Action("SHOW") + @Resource("JOB") + + GetJobSummarySpectraS3Response getJobSummarySpectraS3(final GetJobSummarySpectraS3Request request) + throws IOException; + @ResponsePayloadModel("String") @Action("SHOW") @Resource("JOB") @@ -888,6 +933,13 @@ ModifyJobSpectraS3Response modifyJobSpectraS3(final ModifyJobSpectraS3Request re ReplicatePutJobSpectraS3Response replicatePutJobSpectraS3(final ReplicatePutJobSpectraS3Request request) throws IOException; + @ResponsePayloadModel("MasterObjectList") + @Action("MODIFY") + @Resource("BUCKET") + + StageObjectsJobSpectraS3Response stageObjectsJobSpectraS3(final StageObjectsJobSpectraS3Request request) + throws IOException; + @Action("DELETE") @Resource("ACTIVE_JOB") @@ -946,6 +998,13 @@ ModifyNodeSpectraS3Response modifyNodeSpectraS3(final ModifyNodeSpectraS3Request PutAzureTargetFailureNotificationRegistrationSpectraS3Response putAzureTargetFailureNotificationRegistrationSpectraS3(final PutAzureTargetFailureNotificationRegistrationSpectraS3Request request) throws IOException; + @ResponsePayloadModel("BucketChangesNotificationRegistration") + @Action("CREATE") + @Resource("BUCKET_CHANGES_NOTIFICATION_REGISTRATION") + + PutBucketChangesNotificationRegistrationSpectraS3Response putBucketChangesNotificationRegistrationSpectraS3(final PutBucketChangesNotificationRegistrationSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("Ds3TargetFailureNotificationRegistration") @Action("CREATE") @Resource("DS3_TARGET_FAILURE_NOTIFICATION_REGISTRATION") @@ -1043,6 +1102,12 @@ PutTapePartitionFailureNotificationRegistrationSpectraS3Response putTapePartitio DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response deleteAzureTargetFailureNotificationRegistrationSpectraS3(final DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request request) throws IOException; + @Action("DELETE") + @Resource("BUCKET_CHANGES_NOTIFICATION_REGISTRATION") + + DeleteBucketChangesNotificationRegistrationSpectraS3Response deleteBucketChangesNotificationRegistrationSpectraS3(final DeleteBucketChangesNotificationRegistrationSpectraS3Request request) + throws IOException; + @Action("DELETE") @Resource("DS3_TARGET_FAILURE_NOTIFICATION_REGISTRATION") @@ -1135,6 +1200,27 @@ GetAzureTargetFailureNotificationRegistrationSpectraS3Response getAzureTargetFai GetAzureTargetFailureNotificationRegistrationsSpectraS3Response getAzureTargetFailureNotificationRegistrationsSpectraS3(final GetAzureTargetFailureNotificationRegistrationsSpectraS3Request request) throws IOException; + @ResponsePayloadModel("BucketChangesNotificationRegistration") + @Action("SHOW") + @Resource("BUCKET_CHANGES_NOTIFICATION_REGISTRATION") + + GetBucketChangesNotificationRegistrationSpectraS3Response getBucketChangesNotificationRegistrationSpectraS3(final GetBucketChangesNotificationRegistrationSpectraS3Request request) + throws IOException; + + @ResponsePayloadModel("BucketChangesNotificationRegistrationList") + @Action("LIST") + @Resource("BUCKET_CHANGES_NOTIFICATION_REGISTRATION") + + GetBucketChangesNotificationRegistrationsSpectraS3Response getBucketChangesNotificationRegistrationsSpectraS3(final GetBucketChangesNotificationRegistrationsSpectraS3Request request) + throws IOException; + + @ResponsePayloadModel("BucketHistoryEventList") + @Action("LIST") + @Resource("BUCKET_HISTORY") + + GetBucketHistorySpectraS3Response getBucketHistorySpectraS3(final GetBucketHistorySpectraS3Request request) + throws IOException; + @ResponsePayloadModel("Ds3TargetFailureNotificationRegistration") @Action("SHOW") @Resource("DS3_TARGET_FAILURE_NOTIFICATION_REGISTRATION") @@ -1365,6 +1451,13 @@ GetPhysicalPlacementForObjectsSpectraS3Response getPhysicalPlacementForObjectsSp GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response getPhysicalPlacementForObjectsWithFullDetailsSpectraS3(final GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request request) throws IOException; + @ResponsePayloadModel("S3Object") + @Action("BULK_MODIFY") + @Resource("OBJECT") + + UndeleteObjectSpectraS3Response undeleteObjectSpectraS3(final UndeleteObjectSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("PhysicalPlacement") @Action("SHOW") @Resource("BUCKET") @@ -1656,6 +1749,13 @@ ModifyStorageDomainSpectraS3Response modifyStorageDomainSpectraS3(final ModifySt ForceFeatureKeyValidationSpectraS3Response forceFeatureKeyValidationSpectraS3(final ForceFeatureKeyValidationSpectraS3Request request) throws IOException; + @ResponsePayloadModel("AbmConfigApiBean") + @Action("LIST") + @Resource("ABM_CONFIG") + + GetAbmConfigSpectraS3Response getAbmConfigSpectraS3(final GetAbmConfigSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("FeatureKeyList") @Action("LIST") @Resource("FEATURE_KEY") @@ -1747,6 +1847,13 @@ CancelOnlineOnAllTapesSpectraS3Response cancelOnlineOnAllTapesSpectraS3(final Ca CancelOnlineTapeSpectraS3Response cancelOnlineTapeSpectraS3(final CancelOnlineTapeSpectraS3Request request) throws IOException; + @ResponsePayloadModel("TapeDrive") + @Action("MODIFY") + @Resource("TAPE_DRIVE") + + CancelTestTapeDriveSpectraS3Response cancelTestTapeDriveSpectraS3(final CancelTestTapeDriveSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("TapeFailureList") @Action("BULK_MODIFY") @Resource("TAPE") @@ -1768,6 +1875,13 @@ CancelVerifyTapeSpectraS3Response cancelVerifyTapeSpectraS3(final CancelVerifyTa CleanTapeDriveSpectraS3Response cleanTapeDriveSpectraS3(final CleanTapeDriveSpectraS3Request request) throws IOException; + @ResponsePayloadModel("TapeDrive") + @Action("MODIFY") + @Resource("TAPE_DRIVE") + + PutDriveDumpSpectraS3Response putDriveDumpSpectraS3(final PutDriveDumpSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("TapeDensityDirective") @Action("CREATE") @Resource("TAPE_DENSITY_DIRECTIVE") @@ -1990,12 +2104,26 @@ InspectAllTapesSpectraS3Response inspectAllTapesSpectraS3(final InspectAllTapesS InspectTapeSpectraS3Response inspectTapeSpectraS3(final InspectTapeSpectraS3Request request) throws IOException; + @ResponsePayloadModel("Tape") + @Action("MODIFY") + @Resource("TAPE") + + MarkTapeForCompactionSpectraS3Response markTapeForCompactionSpectraS3(final MarkTapeForCompactionSpectraS3Request request) + throws IOException; + @Action("BULK_MODIFY") @Resource("TAPE_PARTITION") ModifyAllTapePartitionsSpectraS3Response modifyAllTapePartitionsSpectraS3(final ModifyAllTapePartitionsSpectraS3Request request) throws IOException; + @ResponsePayloadModel("TapeDrive") + @Action("MODIFY") + @Resource("TAPE_DRIVE") + + ModifyTapeDriveSpectraS3Response modifyTapeDriveSpectraS3(final ModifyTapeDriveSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("TapePartition") @Action("MODIFY") @Resource("TAPE_PARTITION") @@ -2037,6 +2165,13 @@ RawImportAllTapesSpectraS3Response rawImportAllTapesSpectraS3(final RawImportAll RawImportTapeSpectraS3Response rawImportTapeSpectraS3(final RawImportTapeSpectraS3Request request) throws IOException; + @ResponsePayloadModel("TapeDrive") + @Action("MODIFY") + @Resource("TAPE_DRIVE") + + TestTapeDriveSpectraS3Response testTapeDriveSpectraS3(final TestTapeDriveSpectraS3Request request) + throws IOException; + @ResponsePayloadModel("TapeFailureList") @Action("BULK_MODIFY") @Resource("TAPE") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java index c8bc9058b..104ee7f69 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -40,6 +40,7 @@ public class Ds3ClientBuilder implements Builder { static final private String ACCESS_KEY = "DS3_ACCESS_KEY"; static final private String SECRET_KEY = "DS3_SECRET_KEY"; + private NetworkClient networkClient; final private String endpoint; final private Credentials credentials; @@ -198,11 +199,22 @@ public Ds3ClientBuilder withUserAgent(final String userAgent) { return this; } + /** + * Set a custom NetworkClient implementation. If this is set, all other connection parameters will be ignored. + */ + public Ds3ClientBuilder withNetworkClient(final NetworkClient networkClient) { + this.networkClient = networkClient; + return this; + } + /** * Returns a new Ds3Client instance. */ @Override public Ds3Client build() { + if (this.networkClient != null) { + return new Ds3ClientImpl(this.networkClient); + } LOG.info("Making connection details for endpoint [{}] using this authorization id [{}]", this.endpoint, this.credentials.getClientId()); final ConnectionDetailsImpl.Builder connBuilder = ConnectionDetailsImpl diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientImpl.java index 8a92e5bb3..ab30c381c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -46,22 +46,14 @@ public ConnectionDetails getConnectionDetails() { } @Override - public AbortMultiPartUploadResponse abortMultiPartUpload(final AbortMultiPartUploadRequest request) throws IOException { - return new AbortMultiPartUploadResponseParser().response(this.netClient.getResponse(request)); - } - @Override - public CompleteMultiPartUploadResponse completeMultiPartUpload(final CompleteMultiPartUploadRequest request) throws IOException { - return new CompleteMultiPartUploadResponseParser().response(this.netClient.getResponse(request)); + public CompleteBlobResponse completeBlob(final CompleteBlobRequest request) throws IOException { + return new CompleteBlobResponseParser().response(this.netClient.getResponse(request)); } @Override public PutBucketResponse putBucket(final PutBucketRequest request) throws IOException { return new PutBucketResponseParser().response(this.netClient.getResponse(request)); } @Override - public PutMultiPartUploadPartResponse putMultiPartUploadPart(final PutMultiPartUploadPartRequest request) throws IOException { - return new PutMultiPartUploadPartResponseParser().response(this.netClient.getResponse(request)); - } - @Override public PutObjectResponse putObject(final PutObjectRequest request) throws IOException { return new PutObjectResponseParser().response(this.netClient.getResponse(request)); } @@ -94,18 +86,6 @@ public HeadObjectResponse headObject(final HeadObjectRequest request) throws IOE return new HeadObjectResponseParser().response(this.netClient.getResponse(request)); } @Override - public InitiateMultiPartUploadResponse initiateMultiPartUpload(final InitiateMultiPartUploadRequest request) throws IOException { - return new InitiateMultiPartUploadResponseParser().response(this.netClient.getResponse(request)); - } - @Override - public ListMultiPartUploadPartsResponse listMultiPartUploadParts(final ListMultiPartUploadPartsRequest request) throws IOException { - return new ListMultiPartUploadPartsResponseParser().response(this.netClient.getResponse(request)); - } - @Override - public ListMultiPartUploadsResponse listMultiPartUploads(final ListMultiPartUploadsRequest request) throws IOException { - return new ListMultiPartUploadsResponseParser().response(this.netClient.getResponse(request)); - } - @Override public PutBucketAclForGroupSpectraS3Response putBucketAclForGroupSpectraS3(final PutBucketAclForGroupSpectraS3Request request) throws IOException { return new PutBucketAclForGroupSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -182,6 +162,14 @@ public ModifyBucketSpectraS3Response modifyBucketSpectraS3(final ModifyBucketSpe return new ModifyBucketSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public PutCacheThrottleRuleSpectraS3Response putCacheThrottleRuleSpectraS3(final PutCacheThrottleRuleSpectraS3Request request) throws IOException { + return new PutCacheThrottleRuleSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override + public DeleteCacheThrottleRuleSpectraS3Response deleteCacheThrottleRuleSpectraS3(final DeleteCacheThrottleRuleSpectraS3Request request) throws IOException { + return new DeleteCacheThrottleRuleSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public ForceFullCacheReclaimSpectraS3Response forceFullCacheReclaimSpectraS3(final ForceFullCacheReclaimSpectraS3Request request) throws IOException { return new ForceFullCacheReclaimSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -198,10 +186,22 @@ public GetCacheStateSpectraS3Response getCacheStateSpectraS3(final GetCacheState return new GetCacheStateSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public GetCacheThrottleRuleSpectraS3Response getCacheThrottleRuleSpectraS3(final GetCacheThrottleRuleSpectraS3Request request) throws IOException { + return new GetCacheThrottleRuleSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override + public GetCacheThrottleRulesSpectraS3Response getCacheThrottleRulesSpectraS3(final GetCacheThrottleRulesSpectraS3Request request) throws IOException { + return new GetCacheThrottleRulesSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public ModifyCacheFilesystemSpectraS3Response modifyCacheFilesystemSpectraS3(final ModifyCacheFilesystemSpectraS3Request request) throws IOException { return new ModifyCacheFilesystemSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public ModifyCacheThrottleRuleSpectraS3Response modifyCacheThrottleRuleSpectraS3(final ModifyCacheThrottleRuleSpectraS3Request request) throws IOException { + return new ModifyCacheThrottleRuleSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetBucketCapacitySummarySpectraS3Response getBucketCapacitySummarySpectraS3(final GetBucketCapacitySummarySpectraS3Request request) throws IOException { return new GetBucketCapacitySummarySpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -466,6 +466,8 @@ public VerifyUserIsMemberOfGroupSpectraS3Response verifyUserIsMemberOfGroupSpect return new VerifyUserIsMemberOfGroupSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + /** @deprecated Use {@link #getJobChunksReadyForClientProcessingSpectraS3(GetJobChunksReadyForClientProcessingSpectraS3Request)} instead */ + @Deprecated public AllocateJobChunkSpectraS3Response allocateJobChunkSpectraS3(final AllocateJobChunkSpectraS3Request request) throws IOException { return new AllocateJobChunkSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -494,6 +496,10 @@ public ClearAllCompletedJobsSpectraS3Response clearAllCompletedJobsSpectraS3(fin return new ClearAllCompletedJobsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public CloseAggregatingJobSpectraS3Response closeAggregatingJobSpectraS3(final CloseAggregatingJobSpectraS3Request request) throws IOException { + return new CloseAggregatingJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetBulkJobSpectraS3Response getBulkJobSpectraS3(final GetBulkJobSpectraS3Request request) throws IOException { return new GetBulkJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -506,6 +512,10 @@ public VerifyBulkJobSpectraS3Response verifyBulkJobSpectraS3(final VerifyBulkJob return new VerifyBulkJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public DeleteJobCreationFailureSpectraS3Response deleteJobCreationFailureSpectraS3(final DeleteJobCreationFailureSpectraS3Request request) throws IOException { + return new DeleteJobCreationFailureSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetActiveJobSpectraS3Response getActiveJobSpectraS3(final GetActiveJobSpectraS3Request request) throws IOException { return new GetActiveJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -542,10 +552,22 @@ public GetJobChunksReadyForClientProcessingSpectraS3Response getJobChunksReadyFo return new GetJobChunksReadyForClientProcessingSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public GetJobCreationFailuresSpectraS3Response getJobCreationFailuresSpectraS3(final GetJobCreationFailuresSpectraS3Request request) throws IOException { + return new GetJobCreationFailuresSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override + public GetJobEntriesSpectraS3Response getJobEntriesSpectraS3(final GetJobEntriesSpectraS3Request request) throws IOException { + return new GetJobEntriesSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetJobSpectraS3Response getJobSpectraS3(final GetJobSpectraS3Request request) throws IOException { return new GetJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public GetJobSummarySpectraS3Response getJobSummarySpectraS3(final GetJobSummarySpectraS3Request request) throws IOException { + return new GetJobSummarySpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetJobToReplicateSpectraS3Response getJobToReplicateSpectraS3(final GetJobToReplicateSpectraS3Request request) throws IOException { return new GetJobToReplicateSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -566,6 +588,10 @@ public ReplicatePutJobSpectraS3Response replicatePutJobSpectraS3(final Replicate return new ReplicatePutJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public StageObjectsJobSpectraS3Response stageObjectsJobSpectraS3(final StageObjectsJobSpectraS3Request request) throws IOException { + return new StageObjectsJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public TruncateActiveJobSpectraS3Response truncateActiveJobSpectraS3(final TruncateActiveJobSpectraS3Request request) throws IOException { return new TruncateActiveJobSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -602,6 +628,10 @@ public PutAzureTargetFailureNotificationRegistrationSpectraS3Response putAzureTa return new PutAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public PutBucketChangesNotificationRegistrationSpectraS3Response putBucketChangesNotificationRegistrationSpectraS3(final PutBucketChangesNotificationRegistrationSpectraS3Request request) throws IOException { + return new PutBucketChangesNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public PutDs3TargetFailureNotificationRegistrationSpectraS3Response putDs3TargetFailureNotificationRegistrationSpectraS3(final PutDs3TargetFailureNotificationRegistrationSpectraS3Request request) throws IOException { return new PutDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -658,6 +688,10 @@ public DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response deleteA return new DeleteAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public DeleteBucketChangesNotificationRegistrationSpectraS3Response deleteBucketChangesNotificationRegistrationSpectraS3(final DeleteBucketChangesNotificationRegistrationSpectraS3Request request) throws IOException { + return new DeleteBucketChangesNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response deleteDs3TargetFailureNotificationRegistrationSpectraS3(final DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request request) throws IOException { return new DeleteDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -718,6 +752,18 @@ public GetAzureTargetFailureNotificationRegistrationsSpectraS3Response getAzureT return new GetAzureTargetFailureNotificationRegistrationsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public GetBucketChangesNotificationRegistrationSpectraS3Response getBucketChangesNotificationRegistrationSpectraS3(final GetBucketChangesNotificationRegistrationSpectraS3Request request) throws IOException { + return new GetBucketChangesNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override + public GetBucketChangesNotificationRegistrationsSpectraS3Response getBucketChangesNotificationRegistrationsSpectraS3(final GetBucketChangesNotificationRegistrationsSpectraS3Request request) throws IOException { + return new GetBucketChangesNotificationRegistrationsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override + public GetBucketHistorySpectraS3Response getBucketHistorySpectraS3(final GetBucketHistorySpectraS3Request request) throws IOException { + return new GetBucketHistorySpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetDs3TargetFailureNotificationRegistrationSpectraS3Response getDs3TargetFailureNotificationRegistrationSpectraS3(final GetDs3TargetFailureNotificationRegistrationSpectraS3Request request) throws IOException { return new GetDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -850,6 +896,10 @@ public GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response getPhysica return new GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public UndeleteObjectSpectraS3Response undeleteObjectSpectraS3(final UndeleteObjectSpectraS3Request request) throws IOException { + return new UndeleteObjectSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public VerifyPhysicalPlacementForObjectsSpectraS3Response verifyPhysicalPlacementForObjectsSpectraS3(final VerifyPhysicalPlacementForObjectsSpectraS3Request request) throws IOException { return new VerifyPhysicalPlacementForObjectsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -1026,6 +1076,10 @@ public ForceFeatureKeyValidationSpectraS3Response forceFeatureKeyValidationSpect return new ForceFeatureKeyValidationSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public GetAbmConfigSpectraS3Response getAbmConfigSpectraS3(final GetAbmConfigSpectraS3Request request) throws IOException { + return new GetAbmConfigSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public GetFeatureKeysSpectraS3Response getFeatureKeysSpectraS3(final GetFeatureKeysSpectraS3Request request) throws IOException { return new GetFeatureKeysSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -1078,6 +1132,10 @@ public CancelOnlineTapeSpectraS3Response cancelOnlineTapeSpectraS3(final CancelO return new CancelOnlineTapeSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public CancelTestTapeDriveSpectraS3Response cancelTestTapeDriveSpectraS3(final CancelTestTapeDriveSpectraS3Request request) throws IOException { + return new CancelTestTapeDriveSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public CancelVerifyOnAllTapesSpectraS3Response cancelVerifyOnAllTapesSpectraS3(final CancelVerifyOnAllTapesSpectraS3Request request) throws IOException { return new CancelVerifyOnAllTapesSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -1090,6 +1148,10 @@ public CleanTapeDriveSpectraS3Response cleanTapeDriveSpectraS3(final CleanTapeDr return new CleanTapeDriveSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public PutDriveDumpSpectraS3Response putDriveDumpSpectraS3(final PutDriveDumpSpectraS3Request request) throws IOException { + return new PutDriveDumpSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public PutTapeDensityDirectiveSpectraS3Response putTapeDensityDirectiveSpectraS3(final PutTapeDensityDirectiveSpectraS3Request request) throws IOException { return new PutTapeDensityDirectiveSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -1222,10 +1284,18 @@ public InspectTapeSpectraS3Response inspectTapeSpectraS3(final InspectTapeSpectr return new InspectTapeSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public MarkTapeForCompactionSpectraS3Response markTapeForCompactionSpectraS3(final MarkTapeForCompactionSpectraS3Request request) throws IOException { + return new MarkTapeForCompactionSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public ModifyAllTapePartitionsSpectraS3Response modifyAllTapePartitionsSpectraS3(final ModifyAllTapePartitionsSpectraS3Request request) throws IOException { return new ModifyAllTapePartitionsSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public ModifyTapeDriveSpectraS3Response modifyTapeDriveSpectraS3(final ModifyTapeDriveSpectraS3Request request) throws IOException { + return new ModifyTapeDriveSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public ModifyTapePartitionSpectraS3Response modifyTapePartitionSpectraS3(final ModifyTapePartitionSpectraS3Request request) throws IOException { return new ModifyTapePartitionSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @@ -1250,6 +1320,10 @@ public RawImportTapeSpectraS3Response rawImportTapeSpectraS3(final RawImportTape return new RawImportTapeSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } @Override + public TestTapeDriveSpectraS3Response testTapeDriveSpectraS3(final TestTapeDriveSpectraS3Request request) throws IOException { + return new TestTapeDriveSpectraS3ResponseParser().response(this.netClient.getResponse(request)); + } + @Override public VerifyAllTapesSpectraS3Response verifyAllTapesSpectraS3(final VerifyAllTapesSpectraS3Request request) throws IOException { return new VerifyAllTapesSpectraS3ResponseParser().response(this.netClient.getResponse(request)); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3InputStreamEntity.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3InputStreamEntity.java index 666b08136..700271fe9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3InputStreamEntity.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3InputStreamEntity.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -39,18 +39,14 @@ public void setBufferSize(final int bufferSize) { this.bufferSize = bufferSize; } - public long getBufferSize() { - return bufferSize; - } - @Override public void writeTo(final OutputStream outStream) throws IOException { final long startTime = PerformanceUtils.getCurrentTime(); final long totalBytes = IOUtils.copy(this.getContent(), outStream, bufferSize, path, true); final long endTime = PerformanceUtils.getCurrentTime(); - - if (this.getContentLength() != -1 && totalBytes != this.getContentLength()) { - throw new ContentLengthNotMatchException(path, this.getContentLength(), totalBytes); + final long length = this.getContentLength(); + if (length != -1 && totalBytes != length) { + throw new ContentLengthNotMatchException(path, length, totalBytes); } PerformanceUtils.logMbps(startTime, endTime, totalBytes, path, true); diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/GetObjectCustomParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/GetObjectCustomParser.java index 263c5a6b6..39149e305 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/GetObjectCustomParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/GetObjectCustomParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Action.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Action.java index 4fabc6cd7..748dab36d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Action.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Action.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Resource.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Resource.java index 014ea211a..1e92037e9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Resource.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/Resource.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/ResponsePayloadModel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/ResponsePayloadModel.java index b971fc209..bdbd138c7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/ResponsePayloadModel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/annotations/ResponsePayloadModel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobRequest.java similarity index 58% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadRequest.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobRequest.java index 2c4c8d79f..2592a263e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,8 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; -public class AbortMultiPartUploadRequest extends AbstractRequest { +public class CompleteBlobRequest extends AbstractRequest { // Variables @@ -29,32 +28,51 @@ public class AbortMultiPartUploadRequest extends AbstractRequest { private final String objectName; - private final String uploadId; + private final String blob; + + private final String job; + + private long size; // Constructor - public AbortMultiPartUploadRequest(final String bucketName, final String objectName, final UUID uploadId) { + public CompleteBlobRequest(final String bucketName, final String objectName, final UUID blob, final UUID job) { this.bucketName = bucketName; this.objectName = objectName; - this.uploadId = uploadId.toString(); + this.blob = blob.toString(); + this.job = job.toString(); - this.getQueryParams().put("upload_id", uploadId.toString()); + this.updateQueryParam("blob", blob); + + this.updateQueryParam("job", job); + } - public AbortMultiPartUploadRequest(final String bucketName, final String objectName, final String uploadId) { + public CompleteBlobRequest(final String bucketName, final String objectName, final String blob, final String job) { this.bucketName = bucketName; this.objectName = objectName; - this.uploadId = uploadId; + this.blob = blob; + this.job = job; - this.getQueryParams().put("upload_id", UrlEscapers.urlFragmentEscaper().escape(uploadId).replace("+", "%2B")); + this.updateQueryParam("blob", blob); + + this.updateQueryParam("job", job); + + } + + public CompleteBlobRequest withSize(final long size) { + this.size = size; + this.updateQueryParam("size", size); + return this; } + @Override public HttpVerb getVerb() { - return HttpVerb.DELETE; + return HttpVerb.POST; } @Override @@ -72,8 +90,18 @@ public String getObjectName() { } - public String getUploadId() { - return this.uploadId; + public String getBlob() { + return this.blob; + } + + + public String getJob() { + return this.job; + } + + + public long getSize() { + return this.size; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobResponse.java similarity index 80% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobResponse.java index eec1f01b1..f989804ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/AbortMultiPartUploadResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteBlobResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,9 @@ import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class AbortMultiPartUploadResponse extends AbstractResponse { +public class CompleteBlobResponse extends AbstractResponse { - public AbortMultiPartUploadResponse(final String checksum, final ChecksumType.Type checksumType) { + public CompleteBlobResponse(final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadRequest.java deleted file mode 100644 index b4f5164a2..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadRequest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; - -import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.multipart.CompleteMultipartUpload; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import com.spectralogic.ds3client.serializer.XmlOutput; -import java.nio.charset.Charset; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; - -public class CompleteMultiPartUploadRequest extends AbstractRequest { - - // Variables - - private final String bucketName; - - private final String objectName; - - private final String uploadId; - - private final CompleteMultipartUpload requestPayload; - private long size = 0; - - // Constructor - - - public CompleteMultiPartUploadRequest(final String bucketName, final String objectName, final CompleteMultipartUpload requestPayload, final UUID uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.uploadId = uploadId.toString(); - this.requestPayload = requestPayload; - - this.getQueryParams().put("upload_id", uploadId.toString()); - } - - - public CompleteMultiPartUploadRequest(final String bucketName, final String objectName, final CompleteMultipartUpload requestPayload, final String uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.uploadId = uploadId; - this.requestPayload = requestPayload; - - this.getQueryParams().put("upload_id", UrlEscapers.urlFragmentEscaper().escape(uploadId).replace("+", "%2B")); - } - - - @Override - public HttpVerb getVerb() { - return HttpVerb.POST; - } - - @Override - public String getPath() { - return "/" + this.bucketName + "/" + this.objectName; - } - @Override - public long getSize() { - return this.size; - } - - @Override - public InputStream getStream() { - if (requestPayload == null) { - return null; - } - - final String xmlOutput = XmlOutput.toXml(requestPayload); - - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); - } - - - public String getBucketName() { - return this.bucketName; - } - - - public String getObjectName() { - return this.objectName; - } - - - public String getUploadId() { - return this.uploadId; - } - - - public CompleteMultipartUpload getRequestPayload() { - return this.requestPayload; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketRequest.java index 3e873326b..339ecca31 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketResponse.java index 37b4bd41e..909a71542 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteBucketResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectRequest.java index bb2da1b05..ed2d94cd6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; public class DeleteObjectRequest extends AbstractRequest { @@ -27,7 +28,7 @@ public class DeleteObjectRequest extends AbstractRequest { private final String objectName; - private boolean rollBack; + private String versionId; // Constructor @@ -38,13 +39,16 @@ public DeleteObjectRequest(final String bucketName, final String objectName) { } - public DeleteObjectRequest withRollBack(final boolean rollBack) { - this.rollBack = rollBack; - if (this.rollBack) { - this.getQueryParams().put("roll_back", null); - } else { - this.getQueryParams().remove("roll_back"); - } + public DeleteObjectRequest withVersionId(final UUID versionId) { + this.versionId = versionId.toString(); + this.updateQueryParam("version_id", versionId); + return this; + } + + + public DeleteObjectRequest withVersionId(final String versionId) { + this.versionId = versionId; + this.updateQueryParam("version_id", versionId); return this; } @@ -70,8 +74,8 @@ public String getObjectName() { } - public boolean getRollBack() { - return this.rollBack; + public String getVersionId() { + return this.versionId; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectResponse.java index dff71b33e..6bf8fd341 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsRequest.java index 7b370467c..baa417b03 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,17 +26,15 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.List; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; public class DeleteObjectsRequest extends AbstractRequest { // Variables - private final List objects; + private final List objects; private final String bucketName; - - private boolean rollBack; private boolean quiet = false; private long size; @@ -45,39 +43,36 @@ public class DeleteObjectsRequest extends AbstractRequest { public DeleteObjectsRequest(final String bucketName, final List objects) { this.bucketName = bucketName; - this.objects = objects; this.getQueryParams().put("delete", null); + this.objects = namesToDeleteObjects(objects); } - public DeleteObjectsRequest(final String bucketName, final Iterable objs) { + public DeleteObjectsRequest(final String bucketName, final Iterable objects) { this.bucketName = bucketName; this.getQueryParams().put("delete", null); - this.objects = contentsToString(objs); + this.objects = contentsToDeleteObjects(objects); } - private static List contentsToString(final Iterable objs) { - final List objKeyList = new ArrayList<>(); - for (final Contents obj : objs) { - objKeyList.add(obj.getKey()); + private static List contentsToDeleteObjects(final Iterable objects) { + final List objectsToDelete = new ArrayList<>(); + for (final Contents obj : objects) { + objectsToDelete.add(new DeleteObject(obj.getKey(), obj.getVersionId())); } - return objKeyList; + return objectsToDelete; } - public DeleteObjectsRequest withRollBack(final boolean rollBack) { - this.rollBack = rollBack; - if (this.rollBack) { - this.getQueryParams().put("roll_back", null); - } else { - this.getQueryParams().remove("roll_back"); + private static List namesToDeleteObjects(final Iterable objNames) { + final List objectsToDelete = new ArrayList<>(); + for (final String objName : objNames) { + objectsToDelete.add(new DeleteObject(objName)); } - return this; + return objectsToDelete; } - public DeleteObjectsRequest withQuiet(final boolean quiet) { this.quiet = quiet; return this; @@ -88,16 +83,10 @@ public InputStream getStream() { final Delete delete = new Delete(); delete.setQuiet(quiet); - final List deleteObjects = new ArrayList<>(); - - for(final String objName : objects) { - deleteObjects.add(new DeleteObject(objName)); - } - - delete.setDeleteObjectList(deleteObjects); + delete.setDeleteObjectList(objects); final String xmlOutput = XmlOutput.toXml(delete); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); @@ -112,7 +101,7 @@ public HttpVerb getVerb() { public String getPath() { return "/" + this.bucketName; } - public List getObjects() { + public List getObjects() { return this.objects; } @@ -128,11 +117,6 @@ public String getBucketName() { } - public boolean getRollBack() { - return this.rollBack; - } - - @Override public long getSize() { return this.size; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsResponse.java index 8fd6a4c94..97f138510 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/DeleteObjectsResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketRequest.java index d2c38fa11..1f9d983ab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBucketRequest extends AbstractRequest { @@ -34,6 +33,8 @@ public class GetBucketRequest extends AbstractRequest { private String prefix; + private boolean versions; + // Constructor @@ -70,6 +71,17 @@ public GetBucketRequest withPrefix(final String prefix) { } + public GetBucketRequest withVersions(final boolean versions) { + this.versions = versions; + if (this.versions) { + this.getQueryParams().put("versions", null); + } else { + this.getQueryParams().remove("versions"); + } + return this; + } + + @Override public HttpVerb getVerb() { @@ -105,4 +117,9 @@ public String getPrefix() { return this.prefix; } + + public boolean getVersions() { + return this.versions; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketResponse.java index 86ead6a9a..dc86ac153 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetBucketResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectRequest.java index d7332cd64..c16450fb9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -28,7 +28,8 @@ import java.util.Collection; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; +import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; import com.spectralogic.ds3client.models.ChecksumType; public class GetObjectRequest extends AbstractRequest { @@ -41,9 +42,13 @@ public class GetObjectRequest extends AbstractRequest { private final String objectName; + private boolean cachedOnly; + private String job; private long offset; + + private String versionId; private ImmutableCollection byteRanges = null; private ChecksumType checksum = ChecksumType.none(); private ChecksumType.Type checksumType = ChecksumType.Type.NONE; @@ -52,7 +57,8 @@ public class GetObjectRequest extends AbstractRequest { /** @deprecated use {@link #GetObjectRequest(String, String, WritableByteChannel, UUID, long)} instead */ @Deprecated - public GetObjectRequest(final String bucketName, final String objectName, final WritableByteChannel channel) { + public GetObjectRequest(final String bucketName, final String objectName, @Nonnull final WritableByteChannel channel) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.channel = channel; @@ -61,58 +67,81 @@ public GetObjectRequest(final String bucketName, final String objectName, final } - public GetObjectRequest(final String bucketName, final String objectName, final WritableByteChannel channel, final UUID job, final long offset) { + public GetObjectRequest(final String bucketName, final String objectName, @Nonnull final WritableByteChannel channel, final UUID job, final long offset) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.job = job.toString(); this.offset = offset; this.channel = channel; - this.getQueryParams().put("job", job.toString()); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public GetObjectRequest(final String bucketName, final String objectName, final WritableByteChannel channel, final String job, final long offset) { + public GetObjectRequest(final String bucketName, final String objectName, @Nonnull final WritableByteChannel channel, final String job, final long offset) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.job = job; this.offset = offset; this.channel = channel; - this.getQueryParams().put("job", UrlEscapers.urlFragmentEscaper().escape(job).replace("+", "%2B")); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public GetObjectRequest(final String bucketName, final String objectName, final UUID job, final long offset, final OutputStream stream) { + public GetObjectRequest(final String bucketName, final String objectName, final UUID job, final long offset, @Nonnull final OutputStream stream) { + Preconditions.checkNotNull(stream, "Stream may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.job = job.toString(); this.offset = offset; this.channel = Channels.newChannel(stream); - this.getQueryParams().put("job", job.toString()); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public GetObjectRequest(final String bucketName, final String objectName, final String job, final long offset, final OutputStream stream) { + public GetObjectRequest(final String bucketName, final String objectName, final String job, final long offset, @Nonnull final OutputStream stream) { + Preconditions.checkNotNull(stream, "Stream may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.job = job; this.offset = offset; this.channel = Channels.newChannel(stream); - this.getQueryParams().put("job", UrlEscapers.urlFragmentEscaper().escape(job).replace("+", "%2B")); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } + public GetObjectRequest withCachedOnly(final boolean cachedOnly) { + this.cachedOnly = cachedOnly; + if (this.cachedOnly) { + this.getQueryParams().put("cached_only", null); + } else { + this.getQueryParams().remove("cached_only"); + } + return this; + } + + public GetObjectRequest withJob(final UUID job) { this.job = job.toString(); this.updateQueryParam("job", job); @@ -134,6 +163,20 @@ public GetObjectRequest withOffset(final long offset) { } + public GetObjectRequest withVersionId(final UUID versionId) { + this.versionId = versionId.toString(); + this.updateQueryParam("version_id", versionId); + return this; + } + + + public GetObjectRequest withVersionId(final String versionId) { + this.versionId = versionId; + this.updateQueryParam("version_id", versionId); + return this; + } + + /** * Set a MD5 checksum for the request. @@ -225,6 +268,11 @@ public String getObjectName() { } + public boolean getCachedOnly() { + return this.cachedOnly; + } + + public String getJob() { return this.job; } @@ -235,6 +283,11 @@ public long getOffset() { } + public String getVersionId() { + return this.versionId; + } + + public Collection getByteRanges() { return this.byteRanges; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectResponse.java index f5526b225..132126e9d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetObjectResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceRequest.java index 24d4fe8b4..0e15e2265 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceResponse.java index 295daaaed..f32f5406a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/GetServiceResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketRequest.java index 808281c72..4f64a6404 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketResponse.java index 5782b3577..fe4ab5659 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadBucketResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectRequest.java index 10bace3d2..6be9f6430 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; public class HeadObjectRequest extends AbstractRequest { @@ -27,6 +28,8 @@ public class HeadObjectRequest extends AbstractRequest { private final String objectName; + private String versionId; + // Constructor @@ -36,6 +39,20 @@ public HeadObjectRequest(final String bucketName, final String objectName) { } + public HeadObjectRequest withVersionId(final UUID versionId) { + this.versionId = versionId.toString(); + this.updateQueryParam("version_id", versionId); + return this; + } + + + public HeadObjectRequest withVersionId(final String versionId) { + this.versionId = versionId; + this.updateQueryParam("version_id", versionId); + return this; + } + + @Override public HttpVerb getVerb() { @@ -56,4 +73,9 @@ public String getObjectName() { return this.objectName; } + + public String getVersionId() { + return this.versionId; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectResponse.java index 8097b9fc1..f0b93fa9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/HeadObjectResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,22 +19,49 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; import com.spectralogic.ds3client.networking.Metadata; import com.spectralogic.ds3client.models.ChecksumType; +import com.google.common.collect.ImmutableMap; +import java.time.ZonedDateTime; +import java.util.UUID; public class HeadObjectResponse extends AbstractResponse { public enum Status { EXISTS, DOESNTEXIST, UNKNOWN } + private final ImmutableMap blobChecksums; + + private final ChecksumType.Type blobChecksumType; + + private final ZonedDateTime creationDate; + private final Metadata metadata; private final long objectSize; private final Status status; - public HeadObjectResponse(final Metadata metadata, final long objectSize, final Status status, final String checksum, final ChecksumType.Type checksumType) { + private final UUID versionId; + + public HeadObjectResponse(final ImmutableMap blobChecksums, final ChecksumType.Type blobChecksumType, final ZonedDateTime creationDate, final Metadata metadata, final long objectSize, final Status status, final UUID versionId, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); + this.blobChecksums = blobChecksums; + this.blobChecksumType = blobChecksumType; + this.creationDate = creationDate; this.metadata = metadata; this.objectSize = objectSize; this.status = status; + this.versionId = versionId; + } + + public ImmutableMap getBlobChecksums() { + return this.blobChecksums; + } + + public ChecksumType.Type getBlobChecksumType() { + return this.blobChecksumType; + } + + public ZonedDateTime getCreationDate() { + return this.creationDate; } public Metadata getMetadata() { @@ -49,4 +76,8 @@ public Status getStatus() { return this.status; } + public UUID getVersionId() { + return this.versionId; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsRequest.java deleted file mode 100644 index 8b2d97ffe..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsRequest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; - -import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; -import java.lang.Integer; - -public class ListMultiPartUploadPartsRequest extends AbstractRequest { - - // Variables - - private final String bucketName; - - private final String objectName; - - private final String uploadId; - - private int maxParts; - - private Integer partNumberMarker; - - // Constructor - - - public ListMultiPartUploadPartsRequest(final String bucketName, final String objectName, final UUID uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.uploadId = uploadId.toString(); - - this.getQueryParams().put("upload_id", uploadId.toString()); - } - - - public ListMultiPartUploadPartsRequest(final String bucketName, final String objectName, final String uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.uploadId = uploadId; - - this.getQueryParams().put("upload_id", UrlEscapers.urlFragmentEscaper().escape(uploadId).replace("+", "%2B")); - } - - public ListMultiPartUploadPartsRequest withMaxParts(final int maxParts) { - this.maxParts = maxParts; - this.updateQueryParam("max_parts", maxParts); - return this; - } - - - public ListMultiPartUploadPartsRequest withPartNumberMarker(final Integer partNumberMarker) { - this.partNumberMarker = partNumberMarker; - this.updateQueryParam("part_number_marker", partNumberMarker); - return this; - } - - - - @Override - public HttpVerb getVerb() { - return HttpVerb.GET; - } - - @Override - public String getPath() { - return "/" + this.bucketName + "/" + this.objectName; - } - - public String getBucketName() { - return this.bucketName; - } - - - public String getObjectName() { - return this.objectName; - } - - - public String getUploadId() { - return this.uploadId; - } - - - public int getMaxParts() { - return this.maxParts; - } - - - public Integer getPartNumberMarker() { - return this.partNumberMarker; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsRequest.java deleted file mode 100644 index d38f4ba76..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsRequest.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; - -import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; - -public class ListMultiPartUploadsRequest extends AbstractRequest { - - // Variables - - private final String bucketName; - - private String delimiter; - - private String keyMarker; - - private int maxUploads; - - private String prefix; - - private String uploadIdMarker; - - // Constructor - - - public ListMultiPartUploadsRequest(final String bucketName) { - this.bucketName = bucketName; - - this.getQueryParams().put("uploads", null); - } - - public ListMultiPartUploadsRequest withDelimiter(final String delimiter) { - this.delimiter = delimiter; - this.updateQueryParam("delimiter", delimiter); - return this; - } - - - public ListMultiPartUploadsRequest withKeyMarker(final String keyMarker) { - this.keyMarker = keyMarker; - this.updateQueryParam("key_marker", keyMarker); - return this; - } - - - public ListMultiPartUploadsRequest withMaxUploads(final int maxUploads) { - this.maxUploads = maxUploads; - this.updateQueryParam("max_uploads", maxUploads); - return this; - } - - - public ListMultiPartUploadsRequest withPrefix(final String prefix) { - this.prefix = prefix; - this.updateQueryParam("prefix", prefix); - return this; - } - - - public ListMultiPartUploadsRequest withUploadIdMarker(final String uploadIdMarker) { - this.uploadIdMarker = uploadIdMarker; - this.updateQueryParam("upload_id_marker", uploadIdMarker); - return this; - } - - - - @Override - public HttpVerb getVerb() { - return HttpVerb.GET; - } - - @Override - public String getPath() { - return "/" + this.bucketName; - } - - public String getBucketName() { - return this.bucketName; - } - - - public String getDelimiter() { - return this.delimiter; - } - - - public String getKeyMarker() { - return this.keyMarker; - } - - - public int getMaxUploads() { - return this.maxUploads; - } - - - public String getPrefix() { - return this.prefix; - } - - - public String getUploadIdMarker() { - return this.uploadIdMarker; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketRequest.java index 148c95439..ad64def83 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketResponse.java index ddf9fc3d7..d6d418a86 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutBucketResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartRequest.java deleted file mode 100644 index 09ed0d4f4..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartRequest.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; - -import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.utils.SeekableByteChannelInputStream; -import java.nio.channels.SeekableByteChannel; -import java.io.InputStream; - -public class PutMultiPartUploadPartRequest extends AbstractRequest { - - // Variables - - private final String bucketName; - - private final String objectName; - - private final int partNumber; - - private final String uploadId; - - private final long size; - - private final InputStream stream; - - private SeekableByteChannel channel; - - // Constructor - - - public PutMultiPartUploadPartRequest(final String bucketName, final String objectName, final SeekableByteChannel channel, final int partNumber, final long size, final UUID uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.partNumber = partNumber; - this.uploadId = uploadId.toString(); - this.size = size; - this.channel = channel; - - this.getQueryParams().put("part_number", Integer.toString(partNumber)); - this.getQueryParams().put("upload_id", uploadId.toString()); - this.stream = new SeekableByteChannelInputStream(channel); - } - - - public PutMultiPartUploadPartRequest(final String bucketName, final String objectName, final SeekableByteChannel channel, final int partNumber, final long size, final String uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.partNumber = partNumber; - this.uploadId = uploadId; - this.size = size; - this.channel = channel; - - this.getQueryParams().put("part_number", Integer.toString(partNumber)); - this.getQueryParams().put("upload_id", UrlEscapers.urlFragmentEscaper().escape(uploadId).replace("+", "%2B")); - this.stream = new SeekableByteChannelInputStream(channel); - } - - - public PutMultiPartUploadPartRequest(final String bucketName, final String objectName, final int partNumber, final long size, final InputStream stream, final UUID uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.partNumber = partNumber; - this.uploadId = uploadId.toString(); - this.size = size; - this.stream = stream; - - this.getQueryParams().put("part_number", Integer.toString(partNumber)); - this.getQueryParams().put("upload_id", uploadId.toString()); - } - - - public PutMultiPartUploadPartRequest(final String bucketName, final String objectName, final int partNumber, final long size, final InputStream stream, final String uploadId) { - this.bucketName = bucketName; - this.objectName = objectName; - this.partNumber = partNumber; - this.uploadId = uploadId; - this.size = size; - this.stream = stream; - - this.getQueryParams().put("part_number", Integer.toString(partNumber)); - this.getQueryParams().put("upload_id", UrlEscapers.urlFragmentEscaper().escape(uploadId).replace("+", "%2B")); - } - - - @Override - public HttpVerb getVerb() { - return HttpVerb.PUT; - } - - @Override - public String getPath() { - return "/" + this.bucketName + "/" + this.objectName; - } - - public String getBucketName() { - return this.bucketName; - } - - - public String getObjectName() { - return this.objectName; - } - - - public int getPartNumber() { - return this.partNumber; - } - - - public String getUploadId() { - return this.uploadId; - } - - - public long getSize() { - return this.size; - } - - - public InputStream getStream() { - return this.stream; - } - - - public SeekableByteChannel getChannel() { - return this.channel; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectRequest.java index 7ebc8d945..0d5c77107 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,7 +25,8 @@ import org.slf4j.LoggerFactory; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; +import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; import com.spectralogic.ds3client.models.ChecksumType; public class PutObjectRequest extends AbstractRequest { @@ -53,7 +54,8 @@ public class PutObjectRequest extends AbstractRequest { /** @deprecated use {@link #PutObjectRequest(String, String, SeekableByteChannel, UUID, long, long)} instead */ @Deprecated - public PutObjectRequest(final String bucketName, final String objectName, final SeekableByteChannel channel, final long size) { + public PutObjectRequest(final String bucketName, final String objectName, @Nonnull final SeekableByteChannel channel, final long size) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.size = size; @@ -64,7 +66,8 @@ public PutObjectRequest(final String bucketName, final String objectName, final } - public PutObjectRequest(final String bucketName, final String objectName, final SeekableByteChannel channel, final UUID job, final long offset, final long size) { + public PutObjectRequest(final String bucketName, final String objectName, @Nonnull final SeekableByteChannel channel, final UUID job, final long offset, final long size) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.size = size; @@ -73,13 +76,16 @@ public PutObjectRequest(final String bucketName, final String objectName, final this.channel = channel; this.stream = new SeekableByteChannelInputStream(channel); - this.getQueryParams().put("job", job.toString()); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public PutObjectRequest(final String bucketName, final String objectName, final SeekableByteChannel channel, final String job, final long offset, final long size) { + public PutObjectRequest(final String bucketName, final String objectName, @Nonnull final SeekableByteChannel channel, final String job, final long offset, final long size) { + Preconditions.checkNotNull(channel, "Channel may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.size = size; @@ -88,13 +94,16 @@ public PutObjectRequest(final String bucketName, final String objectName, final this.channel = channel; this.stream = new SeekableByteChannelInputStream(channel); - this.getQueryParams().put("job", UrlEscapers.urlFragmentEscaper().escape(job).replace("+", "%2B")); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public PutObjectRequest(final String bucketName, final String objectName, final UUID job, final long offset, final long size, final InputStream stream) { + public PutObjectRequest(final String bucketName, final String objectName, final UUID job, final long offset, final long size, @Nonnull final InputStream stream) { + Preconditions.checkNotNull(stream, "Stream may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.size = size; @@ -102,13 +111,16 @@ public PutObjectRequest(final String bucketName, final String objectName, final this.offset = offset; this.stream = stream; - this.getQueryParams().put("job", job.toString()); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } - public PutObjectRequest(final String bucketName, final String objectName, final String job, final long offset, final long size, final InputStream stream) { + public PutObjectRequest(final String bucketName, final String objectName, final String job, final long offset, final long size, @Nonnull final InputStream stream) { + Preconditions.checkNotNull(stream, "Stream may not be null."); this.bucketName = bucketName; this.objectName = objectName; this.size = size; @@ -116,8 +128,10 @@ public PutObjectRequest(final String bucketName, final String objectName, final this.offset = offset; this.stream = stream; - this.getQueryParams().put("job", UrlEscapers.urlFragmentEscaper().escape(job).replace("+", "%2B")); - this.getQueryParams().put("offset", Long.toString(offset)); + this.updateQueryParam("job", job); + + this.updateQueryParam("offset", offset); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectResponse.java index b0a27c05d..7a636ee68 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutObjectResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractCreateNotificationRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractCreateNotificationRequest.java index 020a438b5..5ce3e6f72 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractCreateNotificationRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractCreateNotificationRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractDeleteNotificationRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractDeleteNotificationRequest.java index e5e6c1314..d547468e6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractDeleteNotificationRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractDeleteNotificationRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractGetNotificationRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractGetNotificationRequest.java index c327618a2..cf20784b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractGetNotificationRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractGetNotificationRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractIdsPayloadRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractIdsPayloadRequest.java new file mode 100644 index 000000000..d3e53cb36 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractIdsPayloadRequest.java @@ -0,0 +1,55 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.commands.interfaces; + +import com.spectralogic.ds3client.models.requestpayloads.Ids; +import com.spectralogic.ds3client.serializer.XmlOutput; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * Abstract class that handles request payload of ids, in format: + * {@code id1id2...} + */ +public abstract class AbstractIdsPayloadRequest extends AbstractRequest { + + private final List ids; + private long size; + + public AbstractIdsPayloadRequest(final List ids) { + super(); + this.ids = ids; + } + + @Override + public InputStream getStream() { + final Ids requestPayload = new Ids(ids); + final String xmlOutput = XmlOutput.toXml(requestPayload); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); + this.size = stringBytes.length; + + return new ByteArrayInputStream(stringBytes); + } + + @Override + public long getSize() { + return this.size; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationRequest.java index cce28b623..d1daa869b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationResponse.java index 84cc9e0c2..0b1ee2da2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractPaginationResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,8 +19,8 @@ public abstract class AbstractPaginationResponse extends AbstractResponse implements PaginationResponse { - private Integer pagingTruncated; - private Integer pagingTotalResultCount; + private final Integer pagingTruncated; + private final Integer pagingTotalResultCount; public AbstractPaginationResponse(final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractRequest.java index faae9155a..558128d51 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -36,7 +36,7 @@ private static RequestHeaders buildDefaultHeaders() { @Override public String getContentType() { - return ContentType.APPLICATION_XML.toString(); + return ContentType.APPLICATION_XML.getMimeType(); } @Override diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractResponse.java index 38c0f0435..9af026305 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/AbstractResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkRequest.java index 22984cdb4..6dd3a50db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,14 +18,13 @@ import com.spectralogic.ds3client.BulkCommand; import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.models.Priority; -import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; -import com.spectralogic.ds3client.models.WriteOptimization; import com.spectralogic.ds3client.models.bulk.*; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; public abstract class BulkRequest extends AbstractRequest { @@ -34,8 +33,6 @@ public abstract class BulkRequest extends AbstractRequest { private InputStream stream; private long size; private Priority priority; - private WriteOptimization writeOptimization; - protected JobChunkClientProcessingOrderGuarantee chunkOrdering; public BulkRequest(final String bucket, final Iterable objects) { this.bucket = bucket; @@ -44,11 +41,7 @@ public BulkRequest(final String bucket, final Iterable objects) { public BulkRequest withPriority(final Priority priority) { this.priority = priority; - return this; - } - - public BulkRequest withWriteOptimization(final WriteOptimization writeOptimization) { - this.writeOptimization = writeOptimization; + this.updateQueryParam("priority", priority); return this; } @@ -56,9 +49,6 @@ private InputStream generateStream() { final Ds3ObjectList objects = new Ds3ObjectList(); objects.setObjects(this.ds3Objects); - objects.setPriority(this.priority); - objects.setWriteOptimization(this.writeOptimization); - objects.setChunkClientProcessingOrderGuarantee(this.chunkOrdering); final StringBuilder xmlOutputBuilder = new StringBuilder(); if (this.getCommand() == BulkCommand.PUT) { @@ -67,7 +57,7 @@ private InputStream generateStream() { xmlOutputBuilder.append(XmlOutput.toXml(objects, false)); } - final byte[] stringBytes = xmlOutputBuilder.toString().getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutputBuilder.toString().getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -108,8 +98,4 @@ public InputStream getStream() { public Priority getPriority() { return priority; } - - public WriteOptimization getWriteOptimization() { - return writeOptimization; - } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkResponse.java index aaaebd8a7..e24eef06b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/BulkResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Request.java index 8160985c4..afed6f301 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Response.java index 94c2f2bbf..b421d355f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/Ds3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationRequest.java index d3decb82d..e3f7f3e85 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationResponse.java index 6407d4f46..128ef66bf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/PaginationResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeaders.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeaders.java index b17818dd9..a8e0d85aa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeaders.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeaders.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl.java index cb6e7f5fb..143ce6ea1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -23,7 +23,8 @@ import java.util.Set; import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toDecodedString; -import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedString; +import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedKeyString; +import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedValueString; /** * Implementation of request headers which percent encodes key and values. @@ -37,7 +38,7 @@ public class RequestHeadersImpl implements RequestHeaders { */ @Override public void put(final String key, final String value) { - headers.put(toEncodedString(key), toEncodedString(value)); + headers.put(toEncodedKeyString(key), toEncodedValueString(value)); } /** @@ -47,7 +48,7 @@ public void put(final String key, final String value) { @Override public Collection get(final String key) { final ImmutableList.Builder builder = ImmutableList.builder(); - for (final String value : headers.get(toEncodedString(key))) { + for (final String value : headers.get(toEncodedKeyString(key))) { builder.add(toDecodedString(value)); } return builder.build(); @@ -67,7 +68,7 @@ public int size() { */ @Override public boolean containsKey(final String key) { - return headers.containsKey(toEncodedString(key)); + return headers.containsKey(toEncodedKeyString(key)); } /** @@ -76,7 +77,7 @@ public boolean containsKey(final String key) { */ @Override public Collection removeAll(final String key) { - return headers.removeAll(toEncodedString(key)); + return headers.removeAll(toEncodedKeyString(key)); } /** diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/package-info.java index 37052d33e..d50e303c6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AllocateJobChunkSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AllocateJobChunkSpectraS3ResponseParser.java index 1fd53aca9..1d13ff8c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AllocateJobChunkSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AllocateJobChunkSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,6 +26,8 @@ import java.io.IOException; import java.io.InputStream; +/** @deprecated Use {@link GetJobChunksReadyForClientProcessingSpectraS3ResponseParser} instead */ +@Deprecated public class AllocateJobChunkSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200, 307, 503}; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelActiveJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelActiveJobSpectraS3ResponseParser.java index f35d67f31..270892ad8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelActiveJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelActiveJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllActiveJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllActiveJobsSpectraS3ResponseParser.java index b8ae0807e..d632a69c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllActiveJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllActiveJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllJobsSpectraS3ResponseParser.java index 7b2f7b0c8..59e9e1847 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelAllJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectOnAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectOnAllTapesSpectraS3ResponseParser.java index eb5321a69..08f0b6477 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectOnAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectOnAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectTapeSpectraS3ResponseParser.java index 831e95418..741a21e1a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelEjectTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatOnAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatOnAllTapesSpectraS3ResponseParser.java index 0a17966e3..a9718103c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatOnAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatOnAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatTapeSpectraS3ResponseParser.java index 35a0052b6..92b310b6a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelFormatTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllPoolsSpectraS3ResponseParser.java index aa24be424..784957ba4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllTapesSpectraS3ResponseParser.java index 791f9dc2f..3a7c662f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportOnAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportPoolSpectraS3ResponseParser.java index bedb39414..0c7b06560 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportTapeSpectraS3ResponseParser.java index ad3b8c150..a4eda7eac 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelImportTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelJobSpectraS3ResponseParser.java index 2227cca92..460578561 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineOnAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineOnAllTapesSpectraS3ResponseParser.java index 5affbb062..1a679b2f0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineOnAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineOnAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineTapeSpectraS3ResponseParser.java index 9a2ccf708..c2adf533f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelOnlineTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadsResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelTestTapeDriveSpectraS3ResponseParser.java similarity index 72% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadsResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelTestTapeDriveSpectraS3ResponseParser.java index 2448bd554..a4f889b2d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadsResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelTestTapeDriveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,27 +16,27 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.ListMultiPartUploadsResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; -import com.spectralogic.ds3client.models.ListMultiPartUploadsResult; +import com.spectralogic.ds3client.commands.spectrads3.CancelTestTapeDriveSpectraS3Response; +import com.spectralogic.ds3client.models.TapeDrive; import com.spectralogic.ds3client.networking.WebResponse; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.IOException; import java.io.InputStream; -public class ListMultiPartUploadsResponseParser extends AbstractResponseParser { +public class CancelTestTapeDriveSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200}; @Override - public ListMultiPartUploadsResponse parseXmlResponse(final WebResponse response) throws IOException { + public CancelTestTapeDriveSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { - final ListMultiPartUploadsResult result = XmlOutput.fromXml(inputStream, ListMultiPartUploadsResult.class); - return new ListMultiPartUploadsResponse(result, this.getChecksum(), this.getChecksumType()); + final TapeDrive result = XmlOutput.fromXml(inputStream, TapeDrive.class); + return new CancelTestTapeDriveSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllPoolsSpectraS3ResponseParser.java index 97c901283..59e153d35 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllTapesSpectraS3ResponseParser.java index 17e4150b5..27793da15 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyOnAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyPoolSpectraS3ResponseParser.java index bca23d3df..6e6e6615b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyTapeSpectraS3ResponseParser.java index 03fab3315..611aa4b3a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CancelVerifyTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CleanTapeDriveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CleanTapeDriveSpectraS3ResponseParser.java index 6888c5f38..872b29c1b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CleanTapeDriveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CleanTapeDriveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCanceledJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCanceledJobsSpectraS3ResponseParser.java index 95bf2bdfe..59c60e9a7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCanceledJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCanceledJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCompletedJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCompletedJobsSpectraS3ResponseParser.java index d373893f3..efa471eb2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCompletedJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearAllCompletedJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobAzureTargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobAzureTargetsSpectraS3ResponseParser.java index 689a73089..0d4f8a9fb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobAzureTargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobAzureTargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobDs3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobDs3TargetsSpectraS3ResponseParser.java index 8c7b12c53..586fc67ba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobDs3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobDs3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobPoolsSpectraS3ResponseParser.java index d042c68f2..641573bcc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobS3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobS3TargetsSpectraS3ResponseParser.java index 2ee566738..5b73520a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobS3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobS3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobTapesSpectraS3ResponseParser.java index 6e0746428..a6b229664 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ClearSuspectBlobTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteMultiPartUploadResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CloseAggregatingJobSpectraS3ResponseParser.java similarity index 71% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteMultiPartUploadResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CloseAggregatingJobSpectraS3ResponseParser.java index e6f22fcea..244154d22 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteMultiPartUploadResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CloseAggregatingJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,27 +16,27 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.CompleteMultiPartUploadResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; -import com.spectralogic.ds3client.models.CompleteMultipartUploadResult; +import com.spectralogic.ds3client.commands.spectrads3.CloseAggregatingJobSpectraS3Response; +import com.spectralogic.ds3client.models.MasterObjectList; import com.spectralogic.ds3client.networking.WebResponse; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.IOException; import java.io.InputStream; -public class CompleteMultiPartUploadResponseParser extends AbstractResponseParser { +public class CloseAggregatingJobSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200}; @Override - public CompleteMultiPartUploadResponse parseXmlResponse(final WebResponse response) throws IOException { + public CloseAggregatingJobSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { - final CompleteMultipartUploadResult result = XmlOutput.fromXml(inputStream, CompleteMultipartUploadResult.class); - return new CompleteMultiPartUploadResponse(result, this.getChecksum(), this.getChecksumType()); + final MasterObjectList result = XmlOutput.fromXml(inputStream, MasterObjectList.class); + return new CloseAggregatingJobSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactAllPoolsSpectraS3ResponseParser.java index 709d4b9c0..548904960 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactPoolSpectraS3ResponseParser.java index 92fe1c073..3fd6a5cc1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompactPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutMultiPartUploadPartResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteBlobResponseParser.java similarity index 77% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutMultiPartUploadPartResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteBlobResponseParser.java index a2606255e..035fe19aa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutMultiPartUploadPartResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/CompleteBlobResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,23 +16,23 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.PutMultiPartUploadPartResponse; +import com.spectralogic.ds3client.commands.CompleteBlobResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; import com.spectralogic.ds3client.networking.WebResponse; import java.io.IOException; -public class PutMultiPartUploadPartResponseParser extends AbstractResponseParser { +public class CompleteBlobResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200}; @Override - public PutMultiPartUploadPartResponse parseXmlResponse(final WebResponse response) throws IOException { + public CompleteBlobResponse parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: //There is no payload, return an empty response handler - return new PutMultiPartUploadPartResponse(this.getChecksum(), this.getChecksumType()); + return new CompleteBlobResponse(this.getChecksum(), this.getChecksumType()); default: assert false: "validateStatusCode should have made it impossible to reach this line"; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ConvertStorageDomainToDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ConvertStorageDomainToDs3TargetSpectraS3ResponseParser.java index da5115383..660d429c6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ConvertStorageDomainToDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ConvertStorageDomainToDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeallocatePoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeallocatePoolSpectraS3ResponseParser.java index 2ba12ab21..0d1d5adcb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeallocatePoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeallocatePoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateCreateUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateCreateUserSpectraS3ResponseParser.java index dab076ee3..2be720dee 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateCreateUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateCreateUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateDeleteUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateDeleteUserSpectraS3ResponseParser.java index e8af083ac..427826efb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateDeleteUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DelegateDeleteUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureDataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureDataReplicationRuleSpectraS3ResponseParser.java index 2bb6d38bb..ac14df773 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureDataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureDataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetBucketNameSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetBucketNameSpectraS3ResponseParser.java index 6ca12263b..ba5bd44a4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetBucketNameSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetBucketNameSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 248af58b8..31be32949 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureSpectraS3ResponseParser.java index f3ce7b33a..a58eae82e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetReadPreferenceSpectraS3ResponseParser.java index 6f857194b..070cd681e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetSpectraS3ResponseParser.java index 8d2338329..482b0d5b6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketAclSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketAclSpectraS3ResponseParser.java index 5c566bece..b99936668 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketAclSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketAclSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketChangesNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketChangesNotificationRegistrationSpectraS3ResponseParser.java new file mode 100644 index 000000000..77d8c93d9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketChangesNotificationRegistrationSpectraS3ResponseParser.java @@ -0,0 +1,44 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.DeleteBucketChangesNotificationRegistrationSpectraS3Response; +import com.spectralogic.ds3client.networking.WebResponse; +import java.io.IOException; + +public class DeleteBucketChangesNotificationRegistrationSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{204}; + + @Override + public DeleteBucketChangesNotificationRegistrationSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 204: + //There is no payload, return an empty response handler + return new DeleteBucketChangesNotificationRegistrationSpectraS3Response(this.getChecksum(), this.getChecksumType()); + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketResponseParser.java index 77dfb943a..6fde83909 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketSpectraS3ResponseParser.java index 635358864..e551c6aba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteBucketSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AbortMultiPartUploadResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteCacheThrottleRuleSpectraS3ResponseParser.java similarity index 75% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AbortMultiPartUploadResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteCacheThrottleRuleSpectraS3ResponseParser.java index bff3111fc..2c32f93be 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/AbortMultiPartUploadResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteCacheThrottleRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,23 +16,23 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.AbortMultiPartUploadResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.DeleteCacheThrottleRuleSpectraS3Response; import com.spectralogic.ds3client.networking.WebResponse; import java.io.IOException; -public class AbortMultiPartUploadResponseParser extends AbstractResponseParser { +public class DeleteCacheThrottleRuleSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{204}; @Override - public AbortMultiPartUploadResponse parseXmlResponse(final WebResponse response) throws IOException { + public DeleteCacheThrottleRuleSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 204: //There is no payload, return an empty response handler - return new AbortMultiPartUploadResponse(this.getChecksum(), this.getChecksumType()); + return new DeleteCacheThrottleRuleSpectraS3Response(this.getChecksum(), this.getChecksumType()); default: assert false: "validateStatusCode should have made it impossible to reach this line"; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPersistenceRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPersistenceRuleSpectraS3ResponseParser.java index 322928d3c..3e330745a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPersistenceRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPersistenceRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicyAclSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicyAclSpectraS3ResponseParser.java index 0440888ce..a127897ac 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicyAclSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicyAclSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicySpectraS3ResponseParser.java index 73f495ed0..a7a353e71 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDataPolicySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3DataReplicationRuleSpectraS3ResponseParser.java index 551f97634..74c381b5d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 11ae265f6..9f8f13766 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureSpectraS3ResponseParser.java index bd7e2831d..7e9315bb7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetReadPreferenceSpectraS3ResponseParser.java index 48fa72f88..3e283a42c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetSpectraS3ResponseParser.java index 8de4d7f5d..809c873eb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteFolderRecursivelySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteFolderRecursivelySpectraS3ResponseParser.java index 776b5f5b6..aead5d140 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteFolderRecursivelySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteFolderRecursivelySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupMemberSpectraS3ResponseParser.java index 696dc32ea..26a57a92e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupSpectraS3ResponseParser.java index 6623f2f7f..56212bc2b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCompletedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCompletedNotificationRegistrationSpectraS3ResponseParser.java index 29ea91210..9da6ed3f3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCompletedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCompletedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreatedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreatedNotificationRegistrationSpectraS3ResponseParser.java index 68a30f974..a293d5fa1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreatedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreatedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java index e2f7edb32..fad895d6b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailureSpectraS3ResponseParser.java new file mode 100644 index 000000000..f4a2eb417 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteJobCreationFailureSpectraS3ResponseParser.java @@ -0,0 +1,44 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.DeleteJobCreationFailureSpectraS3Response; +import com.spectralogic.ds3client.networking.WebResponse; +import java.io.IOException; + +public class DeleteJobCreationFailureSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{204}; + + @Override + public DeleteJobCreationFailureSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 204: + //There is no payload, return an empty response handler + return new DeleteJobCreationFailureSpectraS3Response(this.getChecksum(), this.getChecksumType()); + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectCachedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectCachedNotificationRegistrationSpectraS3ResponseParser.java index 3c040d884..295384e5a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectCachedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectCachedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectLostNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectLostNotificationRegistrationSpectraS3ResponseParser.java index 88b900e6c..245f031b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectLostNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectLostNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java index 7e9b75953..3e7c9cb77 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectResponseParser.java index bb7f40797..f099f8051 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectsResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectsResponseParser.java index c00646fca..a7e912f88 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectsResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteObjectsResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostPoolSpectraS3ResponseParser.java index df0785cfc..9e1d3929f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostTapeSpectraS3ResponseParser.java index 301a5ef39..f6682ebb6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePermanentlyLostTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureNotificationRegistrationSpectraS3ResponseParser.java index 46fa2e9cf..776a33453 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureSpectraS3ResponseParser.java index 0b9d83b2e..04308e541 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolPartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolPartitionSpectraS3ResponseParser.java index ff392c838..552d4ec0f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolPartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeletePoolPartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3DataReplicationRuleSpectraS3ResponseParser.java index 7f7ae615c..5c68abd4d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetBucketNameSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetBucketNameSpectraS3ResponseParser.java index be3d0bf05..30d961102 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetBucketNameSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetBucketNameSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 664a45eb5..fa130dbfc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureSpectraS3ResponseParser.java index 4869ff73a..0900b6fb3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetReadPreferenceSpectraS3ResponseParser.java index 95a406174..34039417f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetSpectraS3ResponseParser.java index 87c24f22b..c6f532022 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java index d11a1d196..e730331b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureSpectraS3ResponseParser.java index a1b20a586..8919bfe5a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainMemberSpectraS3ResponseParser.java index 5b1349e3e..5ca232832 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainSpectraS3ResponseParser.java index 73e36978f..64fed3179 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteStorageDomainSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteSystemFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteSystemFailureNotificationRegistrationSpectraS3ResponseParser.java index d67d7068c..c77451835 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteSystemFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteSystemFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDensityDirectiveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDensityDirectiveSpectraS3ResponseParser.java index 66702318d..b10d8134d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDensityDirectiveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDensityDirectiveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDriveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDriveSpectraS3ResponseParser.java index 9591d6baa..9e824eeb0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDriveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeDriveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureNotificationRegistrationSpectraS3ResponseParser.java index 692684fb0..741202c98 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureSpectraS3ResponseParser.java index 8ef3e0058..d5aff3b2a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapeFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java index 9c7f37858..3fef0af15 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureSpectraS3ResponseParser.java index dcb120d50..5c8dff611 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionFailureSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionSpectraS3ResponseParser.java index 47fa44872..9e83d1e3a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/DeleteTapePartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectAllTapesSpectraS3ResponseParser.java index e64bbcb86..2bf12bf81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainBlobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainBlobsSpectraS3ResponseParser.java index 144ab7708..209bcff48 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainBlobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainBlobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainSpectraS3ResponseParser.java index 2116ab562..a5146aa6b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectStorageDomainSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectTapeSpectraS3ResponseParser.java index 5848063fd..9788aeba9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/EjectTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFeatureKeyValidationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFeatureKeyValidationSpectraS3ResponseParser.java index 77ded7f99..79085da93 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFeatureKeyValidationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFeatureKeyValidationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFullCacheReclaimSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFullCacheReclaimSpectraS3ResponseParser.java index 90b2cd928..d2df49c05 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFullCacheReclaimSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceFullCacheReclaimSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForcePoolEnvironmentRefreshSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForcePoolEnvironmentRefreshSpectraS3ResponseParser.java index e0f99e7fe..9d03709ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForcePoolEnvironmentRefreshSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForcePoolEnvironmentRefreshSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTapeEnvironmentRefreshSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTapeEnvironmentRefreshSpectraS3ResponseParser.java index c8c43e44d..1a16a23fb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTapeEnvironmentRefreshSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTapeEnvironmentRefreshSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTargetEnvironmentRefreshSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTargetEnvironmentRefreshSpectraS3ResponseParser.java index f9d49343d..905c41a00 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTargetEnvironmentRefreshSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ForceTargetEnvironmentRefreshSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllForeignPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllForeignPoolsSpectraS3ResponseParser.java index 285468d79..e8f50d55b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllForeignPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllForeignPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllTapesSpectraS3ResponseParser.java index 56b0a1ed6..eb8bad1bf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatForeignPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatForeignPoolSpectraS3ResponseParser.java index 07f97fd53..cf24e4c16 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatForeignPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatForeignPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatTapeSpectraS3ResponseParser.java index 297672e49..09a5c58a3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/FormatTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAbmConfigSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAbmConfigSpectraS3ResponseParser.java new file mode 100644 index 000000000..788eba251 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAbmConfigSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetAbmConfigSpectraS3Response; +import com.spectralogic.ds3client.models.AbmConfigApiBean; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetAbmConfigSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetAbmConfigSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final AbmConfigApiBean result = XmlOutput.fromXml(inputStream, AbmConfigApiBean.class); + return new GetAbmConfigSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobSpectraS3ResponseParser.java index bf84240ba..9174ac1ec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobsSpectraS3ResponseParser.java index 69987de82..b9a425dbf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetActiveJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRuleSpectraS3ResponseParser.java index 1c96094f8..2e5fc1ab4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRulesSpectraS3ResponseParser.java index c36967b52..d3a8184eb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureDataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetBucketNamesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetBucketNamesSpectraS3ResponseParser.java index 4a709ffea..86b23301e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetBucketNamesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetBucketNamesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java index f192d5242..f67f8f1c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationsSpectraS3ResponseParser.java index 4f90e9f1e..d2fa2201f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailuresSpectraS3ResponseParser.java index 1d724da8c..21df5216d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferenceSpectraS3ResponseParser.java index c3fecefb2..56760ec14 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferencesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferencesSpectraS3ResponseParser.java index b795c13b9..a1d4e6062 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferencesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetReadPreferencesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetSpectraS3ResponseParser.java index fc42c339e..c71be8fe7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetsSpectraS3ResponseParser.java index 37e08e730..a927602c2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetAzureTargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobPersistenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobPersistenceSpectraS3ResponseParser.java index 5d76b29bf..c21039b2b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobPersistenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobPersistenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnAzureTargetSpectraS3ResponseParser.java index b1aebf9f9..8a44c8e76 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnDs3TargetSpectraS3ResponseParser.java index cd0abbd7a..1499aa80f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnPoolSpectraS3ResponseParser.java index 588d5675c..205cefb1a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnS3TargetSpectraS3ResponseParser.java index dd81fc1ef..ea47be3e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnTapeSpectraS3ResponseParser.java index 150e6711b..72803261b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBlobsOnTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -31,12 +31,14 @@ public class GetBlobsOnTapeSpectraS3ResponseParser extends AbstractResponseParse @Override public GetBlobsOnTapeSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { final BulkObjectList result = XmlOutput.fromXml(inputStream, BulkObjectList.class); - return new GetBlobsOnTapeSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + return new GetBlobsOnTapeSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclSpectraS3ResponseParser.java index 4461080df..8322a972b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclsSpectraS3ResponseParser.java index c8dc5ed17..ca1f038a4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketAclsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketCapacitySummarySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketCapacitySummarySpectraS3ResponseParser.java index 314b0b8e8..07a71ba01 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketCapacitySummarySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketCapacitySummarySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationSpectraS3ResponseParser.java new file mode 100644 index 000000000..22f66fa88 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetBucketChangesNotificationRegistrationSpectraS3Response; +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistration; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetBucketChangesNotificationRegistrationSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetBucketChangesNotificationRegistrationSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final BucketChangesNotificationRegistration result = XmlOutput.fromXml(inputStream, BucketChangesNotificationRegistration.class); + return new GetBucketChangesNotificationRegistrationSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationsSpectraS3ResponseParser.java new file mode 100644 index 000000000..8fd7d3058 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketChangesNotificationRegistrationsSpectraS3ResponseParser.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetBucketChangesNotificationRegistrationsSpectraS3Response; +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistrationList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetBucketChangesNotificationRegistrationsSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetBucketChangesNotificationRegistrationsSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final BucketChangesNotificationRegistrationList result = XmlOutput.fromXml(inputStream, BucketChangesNotificationRegistrationList.class); + return new GetBucketChangesNotificationRegistrationsSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketHistorySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketHistorySpectraS3ResponseParser.java new file mode 100644 index 000000000..4c4932d71 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketHistorySpectraS3ResponseParser.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetBucketHistorySpectraS3Response; +import com.spectralogic.ds3client.models.BucketHistoryEventList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetBucketHistorySpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetBucketHistorySpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final BucketHistoryEventList result = XmlOutput.fromXml(inputStream, BucketHistoryEventList.class); + return new GetBucketHistorySpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketResponseParser.java index e74d22e03..ef6494930 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketSpectraS3ResponseParser.java index f83a65313..950c9a563 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketsSpectraS3ResponseParser.java index 8cb8b967a..244e541fa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBucketsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBulkJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBulkJobSpectraS3ResponseParser.java index fe3adc583..293d31b05 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBulkJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetBulkJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemSpectraS3ResponseParser.java index 3769f37ba..f00b7fefc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemsSpectraS3ResponseParser.java index 2604784ee..c4e1e51da 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheFilesystemsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheStateSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheStateSpectraS3ResponseParser.java index 789ea90fa..860a639f4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheStateSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheStateSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRuleSpectraS3ResponseParser.java new file mode 100644 index 000000000..416273a92 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRuleSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetCacheThrottleRuleSpectraS3Response; +import com.spectralogic.ds3client.models.CacheThrottleRule; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetCacheThrottleRuleSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetCacheThrottleRuleSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final CacheThrottleRule result = XmlOutput.fromXml(inputStream, CacheThrottleRule.class); + return new GetCacheThrottleRuleSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRulesSpectraS3ResponseParser.java new file mode 100644 index 000000000..e6c65bb63 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCacheThrottleRulesSpectraS3ResponseParser.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetCacheThrottleRulesSpectraS3Response; +import com.spectralogic.ds3client.models.CacheThrottleRuleList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetCacheThrottleRulesSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetCacheThrottleRulesSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final CacheThrottleRuleList result = XmlOutput.fromXml(inputStream, CacheThrottleRuleList.class); + return new GetCacheThrottleRulesSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobSpectraS3ResponseParser.java index 14ab0152d..be4bd1810 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobsSpectraS3ResponseParser.java index 5dd993a93..5b2ab30f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCanceledJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobSpectraS3ResponseParser.java index 85178aa5a..976294799 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobsSpectraS3ResponseParser.java index 37efabe90..99bbf142a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetCompletedJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPathBackendSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPathBackendSpectraS3ResponseParser.java index 764574600..33d16477a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPathBackendSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPathBackendSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRuleSpectraS3ResponseParser.java index db6a5656f..2c908912d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRulesSpectraS3ResponseParser.java index 89fe05c8d..9715a6e45 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPersistenceRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPlannerBlobStoreTasksSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPlannerBlobStoreTasksSpectraS3ResponseParser.java index e9a416347..9cc37d705 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPlannerBlobStoreTasksSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPlannerBlobStoreTasksSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPoliciesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPoliciesSpectraS3ResponseParser.java index 4de71d628..f77312eb1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPoliciesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPoliciesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclSpectraS3ResponseParser.java index 7faf19c13..af9d3ee26 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclsSpectraS3ResponseParser.java index b95036f7f..c773cea77 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicyAclsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicySpectraS3ResponseParser.java index d3b2b2a66..0f5fdabb6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDataPolicySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedAzureDataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedAzureDataReplicationRulesSpectraS3ResponseParser.java index 9f00b0034..52aedc77a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedAzureDataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedAzureDataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBlobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBlobsSpectraS3ResponseParser.java index f6022b208..2ee315b1c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBlobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBlobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBucketsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBucketsSpectraS3ResponseParser.java index ed19abcae..6c7ad3008 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBucketsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedBucketsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDataPersistenceRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDataPersistenceRulesSpectraS3ResponseParser.java index 88070b99c..5554ee86d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDataPersistenceRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDataPersistenceRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDs3DataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDs3DataReplicationRulesSpectraS3ResponseParser.java index 11603125c..dfaff71a1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDs3DataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedDs3DataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedS3DataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedS3DataReplicationRulesSpectraS3ResponseParser.java index f3985dfe1..b52e15ea0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedS3DataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDegradedS3DataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRuleSpectraS3ResponseParser.java index 4179d71ad..70475f2a7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRulesSpectraS3ResponseParser.java index 5fe7ca60a..7908fa147 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3DataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetDataPoliciesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetDataPoliciesSpectraS3ResponseParser.java index da3a49224..d871c64b2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetDataPoliciesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetDataPoliciesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 7bdbe833f..98cd2ae60 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java index ae453303e..f5c9123d2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailuresSpectraS3ResponseParser.java index d98962449..b832767e2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferenceSpectraS3ResponseParser.java index 321bfa7de..4969c3a02 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferencesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferencesSpectraS3ResponseParser.java index 304288f61..af7fd60b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferencesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetReadPreferencesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetSpectraS3ResponseParser.java index 182c4a2e9..9d76864c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetsSpectraS3ResponseParser.java index 83335a6f5..bad3933ca 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetDs3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetFeatureKeysSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetFeatureKeysSpectraS3ResponseParser.java index ff43e4b6b..681ba6836 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetFeatureKeysSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetFeatureKeysSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMemberSpectraS3ResponseParser.java index c6428fd67..4c4dd2e3e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMembersSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMembersSpectraS3ResponseParser.java index 1c898f96b..3cce9795e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMembersSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupMembersSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupSpectraS3ResponseParser.java index 5c34232f3..7e5e88325 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupsSpectraS3ResponseParser.java index 3b191d61b..414b1d4bb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetGroupsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkDaoSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkDaoSpectraS3ResponseParser.java index 3f956f657..07f504394 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkDaoSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkDaoSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkSpectraS3ResponseParser.java index f91f79b36..a4d4dc762 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunkSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunksReadyForClientProcessingSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunksReadyForClientProcessingSpectraS3ResponseParser.java index c5a54ac9a..2328454ba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunksReadyForClientProcessingSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobChunksReadyForClientProcessingSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -42,7 +42,7 @@ public GetJobChunksReadyForClientProcessingSpectraS3Response parseXmlResponse(fi if (isNullOrEmpty(result.getObjects())) { return new GetJobChunksReadyForClientProcessingSpectraS3Response(result, parseRetryAfter(response), GetJobChunksReadyForClientProcessingSpectraS3Response.Status.RETRYLATER, this.getChecksum(), this.getChecksumType()); } - return new GetJobChunksReadyForClientProcessingSpectraS3Response(result, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, this.getChecksum(), this.getChecksumType()); + return new GetJobChunksReadyForClientProcessingSpectraS3Response(result, parseRetryAfter(response), GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationSpectraS3ResponseParser.java index 1810023ad..cd19b0d97 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationsSpectraS3ResponseParser.java index 4411c3601..06f8b9288 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCompletedNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationSpectraS3ResponseParser.java index c77a68339..0563c394f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationsSpectraS3ResponseParser.java index 0622e5193..52fc55c17 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreatedNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java index f102e0378..6344bc73c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationsSpectraS3ResponseParser.java index 1959b8027..59e4755a2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailedNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailuresSpectraS3ResponseParser.java new file mode 100644 index 000000000..20121583d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobCreationFailuresSpectraS3ResponseParser.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetJobCreationFailuresSpectraS3Response; +import com.spectralogic.ds3client.models.JobCreationFailedList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetJobCreationFailuresSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetJobCreationFailuresSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final JobCreationFailedList result = XmlOutput.fromXml(inputStream, JobCreationFailedList.class); + return new GetJobCreationFailuresSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobEntriesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobEntriesSpectraS3ResponseParser.java new file mode 100644 index 000000000..ebafbba61 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobEntriesSpectraS3ResponseParser.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetJobEntriesSpectraS3Response; +import com.spectralogic.ds3client.models.JobEntryList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetJobEntriesSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetJobEntriesSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + final Integer pagingTruncated = parseIntHeader("page-truncated"); + final Integer pagingTotalResultCount = parseIntHeader("total-result-count"); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final JobEntryList result = XmlOutput.fromXml(inputStream, JobEntryList.class); + return new GetJobEntriesSpectraS3Response(result, pagingTotalResultCount, pagingTruncated, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSpectraS3ResponseParser.java index 795fe0db0..09efcdc04 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSummarySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSummarySpectraS3ResponseParser.java new file mode 100644 index 000000000..dcd9b3cd9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobSummarySpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.GetJobSummarySpectraS3Response; +import com.spectralogic.ds3client.models.JobSummaryApiBean; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class GetJobSummarySpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public GetJobSummarySpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final JobSummaryApiBean result = XmlOutput.fromXml(inputStream, JobSummaryApiBean.class); + return new GetJobSummarySpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobToReplicateSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobToReplicateSpectraS3ResponseParser.java index 2907e145c..915e0d03c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobToReplicateSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobToReplicateSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobsSpectraS3ResponseParser.java index 00b8c2047..79ee60587 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodeSpectraS3ResponseParser.java index 4b0d9ad21..05a220254 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodesSpectraS3ResponseParser.java index a523685fb..71256a6d1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetNodesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationSpectraS3ResponseParser.java index 5b985b554..336ab1d99 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationsSpectraS3ResponseParser.java index 8ce3ca9ae..ad7eada61 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectCachedNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectDetailsSpectraS3ResponseParser.java index ade3dc111..1ac4efebb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationSpectraS3ResponseParser.java index 01402f6be..670ea902d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationsSpectraS3ResponseParser.java index 82c4e8162..c468270a1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectLostNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java index 07b6e049b..a1b2ea2a3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationsSpectraS3ResponseParser.java index 834f8f456..68e2ff1aa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectPersistedNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectResponseParser.java index ecfd0d11f..c9b617358 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsDetailsSpectraS3ResponseParser.java index e62caf22e..45e599dc1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsWithFullDetailsSpectraS3ResponseParser.java index 94f3e215f..8bb9ef5e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetObjectsWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsSpectraS3ResponseParser.java index eb590d40e..18853d020 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java index b228f94fa..6927110f0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationSpectraS3ResponseParser.java index 285ec7d4b..c74ee28b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationsSpectraS3ResponseParser.java index 417c9dc2d..ee8f34a77 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailuresSpectraS3ResponseParser.java index 8ff2873ca..1a646a170 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionSpectraS3ResponseParser.java index 4e55ff9f5..14637e80d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionsSpectraS3ResponseParser.java index b79eefeb3..f673b230d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolPartitionsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolSpectraS3ResponseParser.java index ea4d8b27e..105d036f8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolsSpectraS3ResponseParser.java index 2f69757ad..a756ab734 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRuleSpectraS3ResponseParser.java index 3aed5c12e..93ac72d0b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRulesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRulesSpectraS3ResponseParser.java index db51d4263..c9b5f4ec4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRulesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3DataReplicationRulesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetBucketNamesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetBucketNamesSpectraS3ResponseParser.java index bb80522ff..84e5b614d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetBucketNamesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetBucketNamesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 583853b11..b9ee12a5b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java index 5e239a476..0b60f01e7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailuresSpectraS3ResponseParser.java index 373bab392..12f385bea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferenceSpectraS3ResponseParser.java index fad4fb420..cbc96030f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferencesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferencesSpectraS3ResponseParser.java index 5ecf7e831..ccfda4a13 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferencesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetReadPreferencesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetSpectraS3ResponseParser.java index 053591ff9..fff554aec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetsSpectraS3ResponseParser.java index 0975a52a5..63af2a830 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetS3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetServiceResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetServiceResponseParser.java index 63a217134..9c1939ab8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetServiceResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetServiceResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainCapacitySummarySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainCapacitySummarySpectraS3ResponseParser.java index 0beb58f35..263bcfbce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainCapacitySummarySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainCapacitySummarySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java index f5d24aff8..f5795a6ab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationsSpectraS3ResponseParser.java index 591e84073..435d6339a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailuresSpectraS3ResponseParser.java index 14549fda4..53cd7f065 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMemberSpectraS3ResponseParser.java index 8139d8d16..dbdedbb50 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMembersSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMembersSpectraS3ResponseParser.java index 43f56e09a..f2ff35093 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMembersSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainMembersSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainSpectraS3ResponseParser.java index fc7bafb53..874f85a60 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainsSpectraS3ResponseParser.java index c543d501a..7775074f5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetStorageDomainsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobAzureTargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobAzureTargetsSpectraS3ResponseParser.java index d8a906419..30f2587ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobAzureTargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobAzureTargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobDs3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobDs3TargetsSpectraS3ResponseParser.java index d64c63d2f..01c37c305 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobDs3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobDs3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobPoolsSpectraS3ResponseParser.java index 5f077d6a7..069073db0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobS3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobS3TargetsSpectraS3ResponseParser.java index e29d392db..453889eeb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobS3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobS3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobTapesSpectraS3ResponseParser.java index 6fe2a1917..39e6b600f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBlobTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBucketsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBucketsSpectraS3ResponseParser.java index 5cc196985..dc39a84de 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBucketsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectBucketsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsSpectraS3ResponseParser.java index 8d7f93961..6e5d66bd9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsWithFullDetailsSpectraS3ResponseParser.java index 6ce4cc863..c18b3c3fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSuspectObjectsWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemCapacitySummarySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemCapacitySummarySpectraS3ResponseParser.java index fd6dcc106..617bcc662 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemCapacitySummarySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemCapacitySummarySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationSpectraS3ResponseParser.java index 02d89c997..ebe885dd7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser.java index a5c1c780b..dfda663a4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailuresSpectraS3ResponseParser.java index 24cdcca19..5862b7695 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemInformationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemInformationSpectraS3ResponseParser.java index 207f9b3ed..2a78626f2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemInformationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetSystemInformationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectiveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectiveSpectraS3ResponseParser.java index 2db38f531..0ab9a7810 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectiveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectiveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectivesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectivesSpectraS3ResponseParser.java index ad8ad3ef9..70052f623 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectivesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDensityDirectivesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDriveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDriveSpectraS3ResponseParser.java index 800d2f582..9b1753be2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDriveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDriveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDrivesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDrivesSpectraS3ResponseParser.java index ae9da8e01..bfa493cbf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDrivesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeDrivesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationSpectraS3ResponseParser.java index cd29fda53..9e1c42aca 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationsSpectraS3ResponseParser.java index 0bb4a47b9..8a3603db0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailuresSpectraS3ResponseParser.java index 2e8990db6..093f09992 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrariesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrariesSpectraS3ResponseParser.java index 42bc299cf..482b28c07 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrariesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrariesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrarySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrarySpectraS3ResponseParser.java index 6a796a6df..cdf683a1b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrarySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeLibrarySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java index ac843f99c..5429783a0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationsSpectraS3ResponseParser.java index 98bc0a99c..5363c22c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailureNotificationRegistrationsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailuresSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailuresSpectraS3ResponseParser.java index e3ad9d3e5..b60ede6fa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailuresSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionFailuresSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionSpectraS3ResponseParser.java index 859418f76..09102a2ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionWithFullDetailsSpectraS3ResponseParser.java index 9d3e38355..e668db1fe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsSpectraS3ResponseParser.java index bebd37b91..e9b653c9f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsWithFullDetailsSpectraS3ResponseParser.java index ac72a5654..c10241f59 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapePartitionsWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeSpectraS3ResponseParser.java index 00c18f0ea..de4051999 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapesSpectraS3ResponseParser.java index 59369e668..0c30145f4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUserSpectraS3ResponseParser.java index 24ff37bf5..1dd55903e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUsersSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUsersSpectraS3ResponseParser.java index f6a28fef3..31f964125 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUsersSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetUsersSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadBucketResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadBucketResponseParser.java index a1b4867f2..568bbd996 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadBucketResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadBucketResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadObjectResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadObjectResponseParser.java index 94e887093..03f3b50ee 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadObjectResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/HeadObjectResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,13 +18,17 @@ import com.spectralogic.ds3client.commands.interfaces.MetadataImpl; import com.spectralogic.ds3client.networking.Metadata; +import com.google.common.collect.ImmutableMap; +import com.spectralogic.ds3client.models.ChecksumType; +import java.time.ZonedDateTime; +import java.util.UUID; import com.spectralogic.ds3client.commands.HeadObjectResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; import com.spectralogic.ds3client.networking.WebResponse; import java.io.IOException; -import static com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils.getSizeFromHeaders; +import static com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils.*; public class HeadObjectResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200, 404}; @@ -37,10 +41,14 @@ public HeadObjectResponse parseXmlResponse(final WebResponse response) throws IO final long objectSize = getSizeFromHeaders(response.getHeaders()); switch (statusCode) { case 200: - return new HeadObjectResponse(metadata, objectSize, HeadObjectResponse.Status.EXISTS, this.getChecksum(), this.getChecksumType()); + final ChecksumType.Type blobChecksumType = getBlobChecksumType(response.getHeaders()); + final ImmutableMap blobChecksumMap = getBlobChecksumMap(response.getHeaders()); + final ZonedDateTime creationDate = getCreationDate(response.getHeaders()); + final UUID versionId = getVersionId(response.getHeaders()); + return new HeadObjectResponse(blobChecksumMap, blobChecksumType, creationDate, metadata, objectSize, HeadObjectResponse.Status.EXISTS, versionId, this.getChecksum(), this.getChecksumType()); case 404: - return new HeadObjectResponse(metadata, objectSize, HeadObjectResponse.Status.DOESNTEXIST, this.getChecksum(), this.getChecksumType()); + return new HeadObjectResponse(ImmutableMap.of(), ChecksumType.Type.NONE, null, metadata, objectSize, HeadObjectResponse.Status.DOESNTEXIST, null, this.getChecksum(), this.getChecksumType()); default: assert false: "validateStatusCode should have made it impossible to reach this line"; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllPoolsSpectraS3ResponseParser.java index 0c9595e00..dc81fefcf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllTapesSpectraS3ResponseParser.java index 4b046ea7c..6655eb8e2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAzureTargetSpectraS3ResponseParser.java index 761fe2b41..d8521b07c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportPoolSpectraS3ResponseParser.java index a9252c9ba..752414058 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportS3TargetSpectraS3ResponseParser.java index 1d505b521..231fd392d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportTapeSpectraS3ResponseParser.java index 6c55786d6..b18ffa835 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ImportTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectAllTapesSpectraS3ResponseParser.java index 2df623a35..0522863a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectTapeSpectraS3ResponseParser.java index ae2040d38..733a28ce0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InspectTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3ResponseParser.java index d2f465a58..632ff69d0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3ResponseParser.java index 6b5749123..e7d910413 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobPoolsAsDegradedSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobPoolsAsDegradedSpectraS3ResponseParser.java index d78973b2c..7b91dc59f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobPoolsAsDegradedSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobPoolsAsDegradedSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobS3TargetsAsDegradedSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobS3TargetsAsDegradedSpectraS3ResponseParser.java index 554b24aae..516fdcb98 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobS3TargetsAsDegradedSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobS3TargetsAsDegradedSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobTapesAsDegradedSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobTapesAsDegradedSpectraS3ResponseParser.java index b20a8acc6..24975409b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobTapesAsDegradedSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkSuspectBlobTapesAsDegradedSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkTapeForCompactionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkTapeForCompactionSpectraS3ResponseParser.java new file mode 100644 index 000000000..b51510e4b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/MarkTapeForCompactionSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.MarkTapeForCompactionSpectraS3Response; +import com.spectralogic.ds3client.models.Tape; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class MarkTapeForCompactionSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public MarkTapeForCompactionSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final Tape result = XmlOutput.fromXml(inputStream, Tape.class); + return new MarkTapeForCompactionSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyActiveJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyActiveJobSpectraS3ResponseParser.java index 9e07c71dc..9f936adf5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyActiveJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyActiveJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllAzureTargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllAzureTargetsSpectraS3ResponseParser.java index 3c7aac12f..7d94461e0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllAzureTargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllAzureTargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllDs3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllDs3TargetsSpectraS3ResponseParser.java index b4b0d03df..e6e82115b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllDs3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllDs3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllPoolsSpectraS3ResponseParser.java index ec03f9897..b305b05e7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllS3TargetsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllS3TargetsSpectraS3ResponseParser.java index 6c22652a9..f52f4bb60 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllS3TargetsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllS3TargetsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllTapePartitionsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllTapePartitionsSpectraS3ResponseParser.java index 299884f54..9f412e405 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllTapePartitionsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAllTapePartitionsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureDataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureDataReplicationRuleSpectraS3ResponseParser.java index 3e1e567a7..daeeaf00d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureDataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureDataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureTargetSpectraS3ResponseParser.java index bf43559b9..a1a2b603b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyBucketSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyBucketSpectraS3ResponseParser.java index 02859831a..ead648749 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyBucketSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyBucketSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheFilesystemSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheFilesystemSpectraS3ResponseParser.java index 09cef1dd8..9d6a0f79a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheFilesystemSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheFilesystemSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheThrottleRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheThrottleRuleSpectraS3ResponseParser.java new file mode 100644 index 000000000..1640af7f7 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyCacheThrottleRuleSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.ModifyCacheThrottleRuleSpectraS3Response; +import com.spectralogic.ds3client.models.CacheThrottleRule; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class ModifyCacheThrottleRuleSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public ModifyCacheThrottleRuleSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final CacheThrottleRule result = XmlOutput.fromXml(inputStream, CacheThrottleRule.class); + return new ModifyCacheThrottleRuleSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPathBackendSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPathBackendSpectraS3ResponseParser.java index c61946a9b..6cb774a20 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPathBackendSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPathBackendSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPersistenceRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPersistenceRuleSpectraS3ResponseParser.java index 074019d58..ee67d454e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPersistenceRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPersistenceRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPolicySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPolicySpectraS3ResponseParser.java index 18fcc20ff..02799e7ab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPolicySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDataPolicySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3DataReplicationRuleSpectraS3ResponseParser.java index 160e658b3..eeeb2858d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3TargetSpectraS3ResponseParser.java index b08e59282..99649d638 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyGroupSpectraS3ResponseParser.java index ebc9f9be6..d94d97f26 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyJobSpectraS3ResponseParser.java index d939e8993..9278bf6a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyNodeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyNodeSpectraS3ResponseParser.java index b73b9ff8a..2488c71ed 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyNodeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyNodeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolPartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolPartitionSpectraS3ResponseParser.java index 6238b5bed..8937eef6d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolPartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolPartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolSpectraS3ResponseParser.java index abc8c7ca1..f1c5d1ad8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3DataReplicationRuleSpectraS3ResponseParser.java index 7b54de98e..686f90235 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3TargetSpectraS3ResponseParser.java index 4465579a2..14d475609 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainMemberSpectraS3ResponseParser.java index fdf75a492..16a0b5b99 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainSpectraS3ResponseParser.java index 94fa84821..2557105d0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyStorageDomainSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadPartsResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeDriveSpectraS3ResponseParser.java similarity index 77% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadPartsResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeDriveSpectraS3ResponseParser.java index f20e0d437..115a869dc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ListMultiPartUploadPartsResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeDriveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,27 +16,27 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.ListMultiPartUploadPartsResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; -import com.spectralogic.ds3client.models.ListPartsResult; +import com.spectralogic.ds3client.commands.spectrads3.ModifyTapeDriveSpectraS3Response; +import com.spectralogic.ds3client.models.TapeDrive; import com.spectralogic.ds3client.networking.WebResponse; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.IOException; import java.io.InputStream; -public class ListMultiPartUploadPartsResponseParser extends AbstractResponseParser { +public class ModifyTapeDriveSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200}; @Override - public ListMultiPartUploadPartsResponse parseXmlResponse(final WebResponse response) throws IOException { + public ModifyTapeDriveSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { - final ListPartsResult result = XmlOutput.fromXml(inputStream, ListPartsResult.class); - return new ListMultiPartUploadPartsResponse(result, this.getChecksum(), this.getChecksumType()); + final TapeDrive result = XmlOutput.fromXml(inputStream, TapeDrive.class); + return new ModifyTapeDriveSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapePartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapePartitionSpectraS3ResponseParser.java index df62d3106..e05ad8670 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapePartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapePartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeSpectraS3ResponseParser.java index ef4d77985..cd1914009 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyUserSpectraS3ResponseParser.java index 3276180ba..3ded65738 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ModifyUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineAllTapesSpectraS3ResponseParser.java index 48eea5bc6..a33aa68a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineTapeSpectraS3ResponseParser.java index 6c81a14a9..ed558f57f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/OnlineTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PairBackRegisteredDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PairBackRegisteredDs3TargetSpectraS3ResponseParser.java index 99fba4fd7..917909f1e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PairBackRegisteredDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PairBackRegisteredDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureDataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureDataReplicationRuleSpectraS3ResponseParser.java index 4b293c956..adcca1029 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureDataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureDataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetBucketNameSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetBucketNameSpectraS3ResponseParser.java index e96384e50..78cc5e57f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetBucketNameSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetBucketNameSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java index fa2da5ba6..226ab88c5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetReadPreferenceSpectraS3ResponseParser.java index 482e36995..001e28e86 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutAzureTargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForGroupSpectraS3ResponseParser.java index 34d497849..53b2624cf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForUserSpectraS3ResponseParser.java index 0802a776a..f0cdfa3f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketAclForUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketChangesNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketChangesNotificationRegistrationSpectraS3ResponseParser.java new file mode 100644 index 000000000..20d1e0ce7 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketChangesNotificationRegistrationSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.PutBucketChangesNotificationRegistrationSpectraS3Response; +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistration; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class PutBucketChangesNotificationRegistrationSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{201}; + + @Override + public PutBucketChangesNotificationRegistrationSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 201: + try (final InputStream inputStream = response.getResponseStream()) { + final BucketChangesNotificationRegistration result = XmlOutput.fromXml(inputStream, BucketChangesNotificationRegistration.class); + return new PutBucketChangesNotificationRegistrationSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketResponseParser.java index 6be5052bd..a1253a8a7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketSpectraS3ResponseParser.java index 87fe9cbd1..e723e77f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBucketSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBulkJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBulkJobSpectraS3ResponseParser.java index 05321ffe5..359a5083a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBulkJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutBulkJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutCacheThrottleRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutCacheThrottleRuleSpectraS3ResponseParser.java new file mode 100644 index 000000000..585780ec2 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutCacheThrottleRuleSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.PutCacheThrottleRuleSpectraS3Response; +import com.spectralogic.ds3client.models.CacheThrottleRule; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class PutCacheThrottleRuleSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{201}; + + @Override + public PutCacheThrottleRuleSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 201: + try (final InputStream inputStream = response.getResponseStream()) { + final CacheThrottleRule result = XmlOutput.fromXml(inputStream, CacheThrottleRule.class); + return new PutCacheThrottleRuleSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPersistenceRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPersistenceRuleSpectraS3ResponseParser.java index 1e128a39b..7ad3d4f4d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPersistenceRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPersistenceRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForGroupSpectraS3ResponseParser.java index 2f6e9f089..f0fc97325 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForUserSpectraS3ResponseParser.java index 78287373e..4ce57ff75 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicyAclForUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicySpectraS3ResponseParser.java index c6d54e73d..7b737fcc7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDataPolicySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDriveDumpSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDriveDumpSpectraS3ResponseParser.java new file mode 100644 index 000000000..0a8d10f35 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDriveDumpSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.PutDriveDumpSpectraS3Response; +import com.spectralogic.ds3client.models.TapeDrive; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class PutDriveDumpSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public PutDriveDumpSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final TapeDrive result = XmlOutput.fromXml(inputStream, TapeDrive.class); + return new PutDriveDumpSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3DataReplicationRuleSpectraS3ResponseParser.java index 45182f9bd..f8c46e8f6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index f3f29863c..1d55c49d1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetReadPreferenceSpectraS3ResponseParser.java index a4a4c2b1e..6458f750f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutDs3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForGroupSpectraS3ResponseParser.java index 29c05c46e..7f74b7d76 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForUserSpectraS3ResponseParser.java index d8d0a07f9..56e4ce82b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalBucketAclForUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForGroupSpectraS3ResponseParser.java index 2b5f068c0..52d0b1460 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForUserSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForUserSpectraS3ResponseParser.java index 7c99e5a3f..fc6293c31 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForUserSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGlobalDataPolicyAclForUserSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupGroupMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupGroupMemberSpectraS3ResponseParser.java index 1ce147811..d8f225465 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupGroupMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupGroupMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupSpectraS3ResponseParser.java index 4cbe46ae3..e41745d72 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCompletedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCompletedNotificationRegistrationSpectraS3ResponseParser.java index c20b16583..a0e9ca5f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCompletedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCompletedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreatedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreatedNotificationRegistrationSpectraS3ResponseParser.java index 0adb8232e..d8f9ec26c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreatedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreatedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java index fc3c23a8c..615b361a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutJobCreationFailedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectCachedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectCachedNotificationRegistrationSpectraS3ResponseParser.java index afb79000f..e4b201b0b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectCachedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectCachedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectLostNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectLostNotificationRegistrationSpectraS3ResponseParser.java index 99e01c57f..a3bc097e4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectLostNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectLostNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java index f2f50ebe0..afdca5871 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectPersistedNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectResponseParser.java index 51b41e30c..c82f0bc3f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutObjectResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolFailureNotificationRegistrationSpectraS3ResponseParser.java index 37645e7bd..e990d2d20 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolPartitionSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolPartitionSpectraS3ResponseParser.java index 9ce023fd9..a080bbf5d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolPartitionSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolPartitionSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolStorageDomainMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolStorageDomainMemberSpectraS3ResponseParser.java index c82e5fc29..fbf8d021d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolStorageDomainMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutPoolStorageDomainMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3DataReplicationRuleSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3DataReplicationRuleSpectraS3ResponseParser.java index 603bff2af..e0a34efe9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3DataReplicationRuleSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3DataReplicationRuleSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetBucketNameSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetBucketNameSpectraS3ResponseParser.java index c648ba7df..199c93e7c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetBucketNameSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetBucketNameSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java index 32b445f0e..99e7a926d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetReadPreferenceSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetReadPreferenceSpectraS3ResponseParser.java index 96f2b8cad..e89b70f28 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetReadPreferenceSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutS3TargetReadPreferenceSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java index 754b24fcb..f2ee29125 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainSpectraS3ResponseParser.java index 49f0820e6..40cd62efc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutStorageDomainSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutSystemFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutSystemFailureNotificationRegistrationSpectraS3ResponseParser.java index 0a0985a7f..5e5825e9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutSystemFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutSystemFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeDensityDirectiveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeDensityDirectiveSpectraS3ResponseParser.java index 1574b86a7..f788435da 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeDensityDirectiveSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeDensityDirectiveSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeFailureNotificationRegistrationSpectraS3ResponseParser.java index 3c974e786..1f34499be 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java index 46be2eb7e..3cba5bfff 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapePartitionFailureNotificationRegistrationSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeStorageDomainMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeStorageDomainMemberSpectraS3ResponseParser.java index a0c14dee6..5d93851f4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeStorageDomainMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutTapeStorageDomainMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutUserGroupMemberSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutUserGroupMemberSpectraS3ResponseParser.java index 37da52c08..05abc1a18 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutUserGroupMemberSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/PutUserGroupMemberSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportAllTapesSpectraS3ResponseParser.java index d7669d863..c76795e22 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportTapeSpectraS3ResponseParser.java index 3b85333b1..1df0f9786 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RawImportTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegenerateUserSecretKeySpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegenerateUserSecretKeySpectraS3ResponseParser.java index 6feaeea06..4978ff1bb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegenerateUserSecretKeySpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegenerateUserSecretKeySpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterAzureTargetSpectraS3ResponseParser.java index 0e75baf41..7fba9bc02 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterDs3TargetSpectraS3ResponseParser.java index c91422e95..5223a8d4a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterS3TargetSpectraS3ResponseParser.java index 9638df699..1bb97b771 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/RegisterS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ReplicatePutJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ReplicatePutJobSpectraS3ResponseParser.java index 9ef54ad18..6961eabc7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ReplicatePutJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ReplicatePutJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ResetInstanceIdentifierSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ResetInstanceIdentifierSpectraS3ResponseParser.java index 7f5635d55..8cd2f0f02 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ResetInstanceIdentifierSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/ResetInstanceIdentifierSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/StageObjectsJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/StageObjectsJobSpectraS3ResponseParser.java new file mode 100644 index 000000000..4592e0996 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/StageObjectsJobSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.StageObjectsJobSpectraS3Response; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class StageObjectsJobSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public StageObjectsJobSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final MasterObjectList result = XmlOutput.fromXml(inputStream, MasterObjectList.class); + return new StageObjectsJobSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TestTapeDriveSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TestTapeDriveSpectraS3ResponseParser.java new file mode 100644 index 000000000..dd6aaf9b4 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TestTapeDriveSpectraS3ResponseParser.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.parsers; + +import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; +import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; +import com.spectralogic.ds3client.commands.spectrads3.TestTapeDriveSpectraS3Response; +import com.spectralogic.ds3client.models.TapeDrive; +import com.spectralogic.ds3client.networking.WebResponse; +import com.spectralogic.ds3client.serializer.XmlOutput; +import java.io.IOException; +import java.io.InputStream; + +public class TestTapeDriveSpectraS3ResponseParser extends AbstractResponseParser { + private final int[] expectedStatusCodes = new int[]{200}; + + @Override + public TestTapeDriveSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { + final int statusCode = response.getStatusCode(); + if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { + switch (statusCode) { + case 200: + try (final InputStream inputStream = response.getResponseStream()) { + final TapeDrive result = XmlOutput.fromXml(inputStream, TapeDrive.class); + return new TestTapeDriveSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); + } + + default: + assert false: "validateStatusCode should have made it impossible to reach this line"; + } + } + + throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateActiveJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateActiveJobSpectraS3ResponseParser.java index 070f69627..50e955041 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateActiveJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateActiveJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllActiveJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllActiveJobsSpectraS3ResponseParser.java index 2593e531d..7dfab1d4c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllActiveJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllActiveJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllJobsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllJobsSpectraS3ResponseParser.java index ebcdaa645..7e722f1c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllJobsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateAllJobsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateJobSpectraS3ResponseParser.java index b329dc3b0..af3762589 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/TruncateJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InitiateMultiPartUploadResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/UndeleteObjectSpectraS3ResponseParser.java similarity index 75% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InitiateMultiPartUploadResponseParser.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/UndeleteObjectSpectraS3ResponseParser.java index aeeea2b20..8b39d19c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/InitiateMultiPartUploadResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/UndeleteObjectSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,27 +16,27 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.commands.parsers; -import com.spectralogic.ds3client.commands.InitiateMultiPartUploadResponse; import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser; import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils; -import com.spectralogic.ds3client.models.InitiateMultipartUploadResult; +import com.spectralogic.ds3client.commands.spectrads3.UndeleteObjectSpectraS3Response; +import com.spectralogic.ds3client.models.S3Object; import com.spectralogic.ds3client.networking.WebResponse; import com.spectralogic.ds3client.serializer.XmlOutput; import java.io.IOException; import java.io.InputStream; -public class InitiateMultiPartUploadResponseParser extends AbstractResponseParser { +public class UndeleteObjectSpectraS3ResponseParser extends AbstractResponseParser { private final int[] expectedStatusCodes = new int[]{200}; @Override - public InitiateMultiPartUploadResponse parseXmlResponse(final WebResponse response) throws IOException { + public UndeleteObjectSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException { final int statusCode = response.getStatusCode(); if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) { switch (statusCode) { case 200: try (final InputStream inputStream = response.getResponseStream()) { - final InitiateMultipartUploadResult result = XmlOutput.fromXml(inputStream, InitiateMultipartUploadResult.class); - return new InitiateMultiPartUploadResponse(result, this.getChecksum(), this.getChecksumType()); + final S3Object result = XmlOutput.fromXml(inputStream, S3Object.class); + return new UndeleteObjectSpectraS3Response(result, this.getChecksum(), this.getChecksumType()); } default: diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllPoolsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllPoolsSpectraS3ResponseParser.java index ec71ea882..5d16b2b2f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllPoolsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllPoolsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllTapesSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllTapesSpectraS3ResponseParser.java index f4b5e4dbd..fa1944658 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllTapesSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAllTapesSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAzureTargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAzureTargetSpectraS3ResponseParser.java index 10fbfe845..a63a49eb7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAzureTargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyAzureTargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyBulkJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyBulkJobSpectraS3ResponseParser.java index 89b5411c0..fc61ff1e9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyBulkJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyBulkJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyDs3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyDs3TargetSpectraS3ResponseParser.java index 4e1e03c4a..ad2d8c941 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyDs3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyDs3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsSpectraS3ResponseParser.java index d67ddfd54..432b8dc61 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java index 894c3dc81..89066a3a8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPoolSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPoolSpectraS3ResponseParser.java index be5bf8195..def6dc415 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPoolSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyPoolSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyS3TargetSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyS3TargetSpectraS3ResponseParser.java index a98d302c0..61a9c7ddb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyS3TargetSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyS3TargetSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySafeToCreatePutJobSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySafeToCreatePutJobSpectraS3ResponseParser.java index 9cc0628bf..5ba0f40a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySafeToCreatePutJobSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySafeToCreatePutJobSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySystemHealthSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySystemHealthSpectraS3ResponseParser.java index a8c8daef1..0801fba26 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySystemHealthSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifySystemHealthSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyTapeSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyTapeSpectraS3ResponseParser.java index 787fd7663..a2c0e9806 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyTapeSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyTapeSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyUserIsMemberOfGroupSpectraS3ResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyUserIsMemberOfGroupSpectraS3ResponseParser.java index df4b8d5ff..98dc3392f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyUserIsMemberOfGroupSpectraS3ResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/VerifyUserIsMemberOfGroupSpectraS3ResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/AbstractResponseParser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/AbstractResponseParser.java index dd1faa2bf..b5c8eb6a0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/AbstractResponseParser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/AbstractResponseParser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/GetObjectCustomParserParameters.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/GetObjectCustomParserParameters.java index 93351e932..33452a695 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/GetObjectCustomParserParameters.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/interfaces/GetObjectCustomParserParameters.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/Function.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/Function.java index 81b2ea7ce..77932a213 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/Function.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/Function.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils.java index 58349a1cb..c2081a7e4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,6 +17,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.models.Error; @@ -34,13 +35,20 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; +import java.time.ZonedDateTime; import java.util.List; +import java.util.UUID; public final class ResponseParserUtils { private final static Logger LOG = LoggerFactory.getLogger(ResponseParserUtils.class); final public static String UTF8 = "UTF-8"; + private static final String BLOB_CHECKSUM_TYPE_HEADER = "ds3-blob-checksum-type"; + private static final String BLOB_CHECKSUM_HEADER = "ds3-blob-checksum-offset-"; + private static final String VERSION_ID_HEADER = "version-id"; + private static final String CREATION_DATE_HEADER = "creation-date"; + private ResponseParserUtils() { // pass } @@ -145,4 +153,108 @@ private static String readResponseString(final WebResponse response) throws IOEx return writer.toString(); } } + + /** + * Retrieves the version id from the response headers. If there is no version id header, + * then null is returned. This is used in HeadObject response parsing. + * @param headers The http response headers from the BP. + * @return The version id if one exists. + */ + public static UUID getVersionId(final Headers headers) { + final List versions = headers.get(VERSION_ID_HEADER); + switch (versions.size()) { + case 0: + return null; + case 1: + return UUID.fromString(versions.get(0)); + default: + throw new IllegalArgumentException(String.format("Response has more than one header value for '%s'", VERSION_ID_HEADER)); + } + } + + /** + * Retrieves the creation date from the response headers. If there is no creation date header, + * then null is returned. This is used in HeadObject response parsing. + * @param headers The http response headers from the BP. + * @return The creation date if one exists. + */ + public static ZonedDateTime getCreationDate(final Headers headers) { + final List dates = headers.get(CREATION_DATE_HEADER); + switch (dates.size()) { + case 0: + return null; + case 1: + return ZonedDateTime.parse(dates.get(0)); + default: + throw new IllegalArgumentException(String.format("Response has more than one header value for '%s'", CREATION_DATE_HEADER)); + } + } + + /** + * Retrieves the blob checksum type from the response headers. If there is no blob checksum + * type header, than NONE is returned. If there is more than one value for the blob checksum + * type header, than an illegal argument exception is thrown. + */ + public static ChecksumType.Type getBlobChecksumType(final Headers headers) { + final List types = headers.get(BLOB_CHECKSUM_TYPE_HEADER); + switch (types.size()) { + case 0: + return ChecksumType.Type.NONE; + case 1: + return toBlobChecksumType(types.get(0)); + default: + throw new IllegalArgumentException(String.format("Response has more than one header value for '%s'", BLOB_CHECKSUM_TYPE_HEADER)); + } + } + + /** + * Converts the response header value for {@code BLOB_CHECKSUM_TYPE_HEADER} into a {@code ChecksumType.Type} + */ + static ChecksumType.Type toBlobChecksumType(final String checksumType) { + if (Guard.isStringNullOrEmpty(checksumType)) { + return ChecksumType.Type.NONE; + } + return ChecksumType.Type.valueOf(checksumType); + } + + /** + * Retrieves a map of blob offset to blob checksum from response headers. + */ + public static ImmutableMap getBlobChecksumMap(final Headers headers) { + if (headers.keys() == null) { + return ImmutableMap.of(); + } + + final ImmutableMap.Builder builder = ImmutableMap.builder(); + headers.keys().stream() + .filter(key -> key.startsWith(BLOB_CHECKSUM_HEADER)) + .forEach(key -> builder.put(getOffsetFromHeaderKey(key), getBlobChecksumValue(key, headers))); + + return builder.build(); + } + + /** + * Retrieves the offset from the blob checksum header key. This assumes that the + * provided key has the prefix {@code BLOB_CHECKSUM_HEADER} and that the postfix can be + * converted into a Long. + */ + private static Long getOffsetFromHeaderKey(final String key) { + final String offset = key.substring(BLOB_CHECKSUM_HEADER.length()); + return Long.valueOf(offset); + } + + /** + * Retrieves the value from the specified header key assuming there is at most one value. + * If there are no values for the key, then an empty string is returned. + * If there is more than one value for the given key, an illegal argument exception is thrown. + */ + private static String getBlobChecksumValue(final String key, final Headers headers) { + final List values = headers.get(key); + switch (values.size()) { + case 1: + return values.get(0); + default: + throw new IllegalArgumentException(String.format("Expected response to have 1 value for blob checksum header '%s', but found '%d' values", key, values.size())); + } + } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Request.java index db7db0702..d107c72fa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,8 +19,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; +/** @deprecated Use {@link GetJobChunksReadyForClientProcessingSpectraS3Request} instead */ +@Deprecated public class AllocateJobChunkSpectraS3Request extends AbstractRequest { // Variables diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Response.java index 6a79008f8..7a87b1ef3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/AllocateJobChunkSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,6 +20,8 @@ import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; +/** @deprecated Use {@link GetJobChunksReadyForClientProcessingSpectraS3Response} instead */ +@Deprecated public class AllocateJobChunkSpectraS3Response extends AbstractResponse { public enum Status { ALLOCATED, RETRYLATER } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Request.java index bb10d0f36..24210579c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelActiveJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Response.java index b50f7a8df..9e9b2e1a0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelActiveJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Request.java index f4af0657c..db4ade8f1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobRequestType; public class CancelAllActiveJobsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Response.java index cbf9d23ce..9ffd08952 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllActiveJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Request.java index 98a81700e..2961b91b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobRequestType; public class CancelAllJobsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Response.java index 4df9d3eba..ef882b658 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelAllJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Request.java index 541346dea..29d10b167 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Response.java index d0fc570fa..0f8449a24 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectOnAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Request.java index db96978aa..129d2acda 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelEjectTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Response.java index 68b7c6e39..abe96bc4b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelEjectTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Request.java index 8cff282e5..ed6f4124d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Response.java index e82958f8e..60b3d2ee5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatOnAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Request.java index 3e2ebd0d1..5fb92376e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelFormatTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Response.java index 728c6c279..240b54b7a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelFormatTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Request.java index c64f5346c..28cf31d55 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Response.java index fdb9d3a0d..c27f7c0c8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Request.java index 661f73451..e7f452809 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Response.java index d256965b6..5ff1a9bac 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportOnAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Request.java index 8a523911e..410eb85d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class CancelImportPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Response.java index e4b70d611..6d2a9a5b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Request.java index b48969805..a1ff599b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelImportTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Response.java index 24df9ecca..5895ca614 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelImportTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Request.java index fb0012fdc..116e42e61 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Response.java index 866dcf6ba..009f445c9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Request.java index 12169c609..2059b1674 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Response.java index d44c662c7..189ebe4c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineOnAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Request.java index f78613863..dba5d96e3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelOnlineTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Response.java index 8461d2393..01f84b0c2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelOnlineTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Request.java new file mode 100644 index 000000000..09c2f67fb --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Request.java @@ -0,0 +1,62 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class CancelTestTapeDriveSpectraS3Request extends AbstractRequest { + + // Variables + + private final String tapeDriveId; + + // Constructor + + + public CancelTestTapeDriveSpectraS3Request(final UUID tapeDriveId) { + this.tapeDriveId = tapeDriveId.toString(); + + this.getQueryParams().put("operation", "cancel_test"); + + } + + + public CancelTestTapeDriveSpectraS3Request(final String tapeDriveId) { + this.tapeDriveId = tapeDriveId; + + this.getQueryParams().put("operation", "cancel_test"); + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/tape_drive/" + tapeDriveId; + } + + public String getTapeDriveId() { + return this.tapeDriveId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Response.java new file mode 100644 index 000000000..acb428bd9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelTestTapeDriveSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.TapeDrive; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class CancelTestTapeDriveSpectraS3Response extends AbstractResponse { + + private final TapeDrive tapeDriveResult; + + public CancelTestTapeDriveSpectraS3Response(final TapeDrive tapeDriveResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.tapeDriveResult = tapeDriveResult; + } + + public TapeDrive getTapeDriveResult() { + return this.tapeDriveResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Request.java index 3cdbdddba..41dee4ab8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Response.java index 95512e7a3..da6ce139b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Request.java index eb8625fd7..5a4c4d76d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Response.java index 740d12429..e57adf245 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyOnAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Request.java index 2c340197d..fe5d2c0a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class CancelVerifyPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Response.java index d028c6fe8..6d2617696 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Request.java index 53e893c10..fbd374fb3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CancelVerifyTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Response.java index 140331356..ab06cdfc7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CancelVerifyTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Request.java index aec0ca583..db4c48837 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class CleanTapeDriveSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Response.java index 56a9460b1..9c3513dab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CleanTapeDriveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Request.java index 5193ecf5c..4b8aed2d1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Response.java index d2b8e0b09..52a9c4a2f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCanceledJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Request.java index b4e238bbe..26ba0a71b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Response.java index d06682383..7ce8d4798 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearAllCompletedJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Request.java index 58be2d5f7..87d0c33b4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class ClearSuspectBlobAzureTargetsSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class ClearSuspectBlobAzureTargetsSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class ClearSuspectBlobAzureTargetsSpectraS3Request extends AbstractReques // Constructor - - public ClearSuspectBlobAzureTargetsSpectraS3Request() { + public ClearSuspectBlobAzureTargetsSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Response.java index 4832777cf..2005e576d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobAzureTargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Request.java index d310a8436..25ef56d4d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class ClearSuspectBlobDs3TargetsSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class ClearSuspectBlobDs3TargetsSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class ClearSuspectBlobDs3TargetsSpectraS3Request extends AbstractRequest // Constructor - - public ClearSuspectBlobDs3TargetsSpectraS3Request() { + public ClearSuspectBlobDs3TargetsSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Response.java index c569ddb75..33838af65 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobDs3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Request.java index 3bebff3c7..f04ae56b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class ClearSuspectBlobPoolsSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class ClearSuspectBlobPoolsSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class ClearSuspectBlobPoolsSpectraS3Request extends AbstractRequest { // Constructor - - public ClearSuspectBlobPoolsSpectraS3Request() { + public ClearSuspectBlobPoolsSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Response.java index 7e4cbb65e..cea38a891 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Request.java index 8be876acb..fd726c532 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class ClearSuspectBlobS3TargetsSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class ClearSuspectBlobS3TargetsSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class ClearSuspectBlobS3TargetsSpectraS3Request extends AbstractRequest { // Constructor - - public ClearSuspectBlobS3TargetsSpectraS3Request() { + public ClearSuspectBlobS3TargetsSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Response.java index e664fe12f..ed01c160f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobS3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Request.java index 85de3c5c1..5be34a866 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class ClearSuspectBlobTapesSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class ClearSuspectBlobTapesSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class ClearSuspectBlobTapesSpectraS3Request extends AbstractRequest { // Constructor - - public ClearSuspectBlobTapesSpectraS3Request() { + public ClearSuspectBlobTapesSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Response.java index 49036abcb..c4a93ee69 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ClearSuspectBlobTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Request.java new file mode 100644 index 000000000..0910a8f98 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Request.java @@ -0,0 +1,60 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class CloseAggregatingJobSpectraS3Request extends AbstractRequest { + + // Variables + + private final String jobId; + + // Constructor + + + public CloseAggregatingJobSpectraS3Request(final UUID jobId) { + this.jobId = jobId.toString(); + + this.getQueryParams().put("close_aggregating_job", null); + } + + + public CloseAggregatingJobSpectraS3Request(final String jobId) { + this.jobId = jobId; + + this.getQueryParams().put("close_aggregating_job", null); + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/job/" + jobId; + } + + public String getJobId() { + return this.jobId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Response.java new file mode 100644 index 000000000..144ed6173 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CloseAggregatingJobSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class CloseAggregatingJobSpectraS3Response extends AbstractResponse { + + private final MasterObjectList masterObjectListResult; + + public CloseAggregatingJobSpectraS3Response(final MasterObjectList masterObjectListResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.masterObjectListResult = masterObjectListResult; + } + + public MasterObjectList getMasterObjectListResult() { + return this.masterObjectListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Request.java index 39a3e0cf5..c0c329e2a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Response.java index deae731c5..021849282 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Request.java index 41925c2d5..d4bfb312f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Priority; -import com.google.common.net.UrlEscapers; public class CompactPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Response.java index 177e08983..24855315b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/CompactPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Request.java index 9d398f61a..5e88ba05a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class ConvertStorageDomainToDs3TargetSpectraS3Request extends AbstractRequest { @@ -36,7 +35,8 @@ public ConvertStorageDomainToDs3TargetSpectraS3Request(final UUID convertToDs3Ta this.storageDomain = storageDomain; this.convertToDs3Target = convertToDs3Target.toString(); - this.getQueryParams().put("convert_to_ds3_target", convertToDs3Target.toString()); + this.updateQueryParam("convert_to_ds3_target", convertToDs3Target); + } @@ -44,7 +44,8 @@ public ConvertStorageDomainToDs3TargetSpectraS3Request(final String convertToDs3 this.storageDomain = storageDomain; this.convertToDs3Target = convertToDs3Target; - this.getQueryParams().put("convert_to_ds3_target", UrlEscapers.urlFragmentEscaper().escape(convertToDs3Target).replace("+", "%2B")); + this.updateQueryParam("convert_to_ds3_target", convertToDs3Target); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Response.java index fb233924e..4504bbfaa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ConvertStorageDomainToDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Request.java index 110dc368b..cf7884a4f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeallocatePoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Response.java index 780f5db6c..078d3c666 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeallocatePoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Request.java index 567de8e16..310af04df 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class DelegateCreateUserSpectraS3Request extends AbstractRequest { @@ -27,8 +26,12 @@ public class DelegateCreateUserSpectraS3Request extends AbstractRequest { private final String name; + private String defaultDataPolicyId; + private String id; + private int maxBuckets; + private String secretKey; // Constructor @@ -37,9 +40,24 @@ public class DelegateCreateUserSpectraS3Request extends AbstractRequest { public DelegateCreateUserSpectraS3Request(final String name) { this.name = name; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("name", name); + + } + + public DelegateCreateUserSpectraS3Request withDefaultDataPolicyId(final UUID defaultDataPolicyId) { + this.defaultDataPolicyId = defaultDataPolicyId.toString(); + this.updateQueryParam("default_data_policy_id", defaultDataPolicyId); + return this; } + + public DelegateCreateUserSpectraS3Request withDefaultDataPolicyId(final String defaultDataPolicyId) { + this.defaultDataPolicyId = defaultDataPolicyId; + this.updateQueryParam("default_data_policy_id", defaultDataPolicyId); + return this; + } + + public DelegateCreateUserSpectraS3Request withId(final UUID id) { this.id = id.toString(); this.updateQueryParam("id", id); @@ -54,6 +72,13 @@ public DelegateCreateUserSpectraS3Request withId(final String id) { } + public DelegateCreateUserSpectraS3Request withMaxBuckets(final int maxBuckets) { + this.maxBuckets = maxBuckets; + this.updateQueryParam("max_buckets", maxBuckets); + return this; + } + + public DelegateCreateUserSpectraS3Request withSecretKey(final String secretKey) { this.secretKey = secretKey; this.updateQueryParam("secret_key", secretKey); @@ -77,11 +102,21 @@ public String getName() { } + public String getDefaultDataPolicyId() { + return this.defaultDataPolicyId; + } + + public String getId() { return this.id; } + public int getMaxBuckets() { + return this.maxBuckets; + } + + public String getSecretKey() { return this.secretKey; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Response.java index 676e01dc0..a66c96bd1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateCreateUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Request.java index a1cdaae8a..da05d207c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class DelegateDeleteUserSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Response.java index a5956a86d..e96602139 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DelegateDeleteUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Request.java index 2a7ce1402..ce2684adb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureDataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Response.java index c1e1c62a8..e2c563219 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureDataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Request.java index 4525c243e..375160083 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureTargetBucketNameSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Response.java index 7a1cd9de4..68c32df34 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetBucketNameSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request.java index 3e1ff512b..36530da75 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureTargetFailureNotificationRegistrationSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response.java index c1bdbddce..4b39dba8e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Request.java index c593c9f2b..ba08d6ad7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureTargetFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Response.java index 1c52a3f04..c2010f282 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Request.java index 4d19a3264..d14419ef0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureTargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Response.java index 5b1adfb9c..8145747f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Request.java index 59291d07f..1863d5934 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteAzureTargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Response.java index ce1e5c410..150bf0cb1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Request.java index 792cbcac1..ed90a498a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteBucketAclSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Response.java index 320524c0c..9e63970c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketAclSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Request.java new file mode 100644 index 000000000..6d3a044b1 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Request.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; + +public class DeleteBucketChangesNotificationRegistrationSpectraS3Request extends AbstractRequest { + + // Variables + + private final String bucketChangesNotificationRegistration; + + // Constructor + + + public DeleteBucketChangesNotificationRegistrationSpectraS3Request(final String bucketChangesNotificationRegistration) { + this.bucketChangesNotificationRegistration = bucketChangesNotificationRegistration; + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.DELETE; + } + + @Override + public String getPath() { + return "/_rest_/bucket_changes_notification_registration/" + bucketChangesNotificationRegistration; + } + + public String getBucketChangesNotificationRegistration() { + return this.bucketChangesNotificationRegistration; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Response.java new file mode 100644 index 000000000..c3845298c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketChangesNotificationRegistrationSpectraS3Response.java @@ -0,0 +1,28 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class DeleteBucketChangesNotificationRegistrationSpectraS3Response extends AbstractResponse { + + public DeleteBucketChangesNotificationRegistrationSpectraS3Response(final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Request.java index 035cd51a0..d06785d15 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteBucketSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Response.java index 054ce4ae6..60f6844d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteBucketSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadRequest.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Request.java similarity index 59% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadRequest.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Request.java index d10dde46f..02bdc9cbd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadRequest.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,47 +14,38 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -public class InitiateMultiPartUploadRequest extends AbstractRequest { +public class DeleteCacheThrottleRuleSpectraS3Request extends AbstractRequest { // Variables - private final String bucketName; - - private final String objectName; + private final String cacheThrottleRule; // Constructor - public InitiateMultiPartUploadRequest(final String bucketName, final String objectName) { - this.bucketName = bucketName; - this.objectName = objectName; + public DeleteCacheThrottleRuleSpectraS3Request(final String cacheThrottleRule) { + this.cacheThrottleRule = cacheThrottleRule; - this.getQueryParams().put("uploads", null); } @Override public HttpVerb getVerb() { - return HttpVerb.POST; + return HttpVerb.DELETE; } @Override public String getPath() { - return "/" + this.bucketName + "/" + this.objectName; + return "/_rest_/cache_throttle_rule/" + cacheThrottleRule; } - public String getBucketName() { - return this.bucketName; - } - - - public String getObjectName() { - return this.objectName; + public String getCacheThrottleRule() { + return this.cacheThrottleRule; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Response.java similarity index 74% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Response.java index 6cca26577..c96a01e76 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/PutMultiPartUploadPartResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteCacheThrottleRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,14 +14,14 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class PutMultiPartUploadPartResponse extends AbstractResponse { +public class DeleteCacheThrottleRuleSpectraS3Response extends AbstractResponse { - public PutMultiPartUploadPartResponse(final String checksum, final ChecksumType.Type checksumType) { + public DeleteCacheThrottleRuleSpectraS3Response(final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Request.java index b12176b72..dc2ec6baa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,19 +18,25 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; +import java.util.UUID; public class DeleteDataPersistenceRuleSpectraS3Request extends AbstractRequest { // Variables - private final String dataPersistenceRule; + private final String dataPersistenceRuleId; // Constructor - public DeleteDataPersistenceRuleSpectraS3Request(final String dataPersistenceRule) { - this.dataPersistenceRule = dataPersistenceRule; + public DeleteDataPersistenceRuleSpectraS3Request(final UUID dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId.toString(); + + } + + + public DeleteDataPersistenceRuleSpectraS3Request(final String dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId; } @@ -42,11 +48,11 @@ public HttpVerb getVerb() { @Override public String getPath() { - return "/_rest_/data_persistence_rule/" + dataPersistenceRule; + return "/_rest_/data_persistence_rule/" + dataPersistenceRuleId; } - public String getDataPersistenceRule() { - return this.dataPersistenceRule; + public String getDataPersistenceRuleId() { + return this.dataPersistenceRuleId; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Response.java index cc3f76ccf..a5087200c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPersistenceRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Request.java index ff9489850..b636b2456 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteDataPolicyAclSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Response.java index cf8d64205..2508077bd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicyAclSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Request.java index 99bea1bd9..dee1d32fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class DeleteDataPolicySpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Response.java index 3d2115475..566158aa4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDataPolicySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Request.java index 2be0dd1b3..90a39e61b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteDs3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Response.java index 6351e563e..0d2da9fae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Request.java index f8984e67a..d73750f37 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteDs3TargetFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Response.java index 9928a6370..46f0bc352 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Request.java index e10b82418..41276f333 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteDs3TargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Response.java index b4b43d83d..92f92e798 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Request.java index 5727d76af..20cebb189 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteDs3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Response.java index 8e82eff9c..cbdd0b2ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Request.java index f07f093b4..f9231cf81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteFolderRecursivelySpectraS3Request extends AbstractRequest { @@ -28,8 +27,6 @@ public class DeleteFolderRecursivelySpectraS3Request extends AbstractRequest { private final String bucketId; - private boolean rollBack; - // Constructor @@ -37,22 +34,12 @@ public DeleteFolderRecursivelySpectraS3Request(final String bucketId, final Stri this.folder = folder; this.bucketId = bucketId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("recursive", null); - } + this.updateQueryParam("bucket_id", bucketId); - public DeleteFolderRecursivelySpectraS3Request withRollBack(final boolean rollBack) { - this.rollBack = rollBack; - if (this.rollBack) { - this.getQueryParams().put("roll_back", null); - } else { - this.getQueryParams().remove("roll_back"); - } - return this; + this.getQueryParams().put("recursive", null); } - @Override public HttpVerb getVerb() { return HttpVerb.DELETE; @@ -72,9 +59,4 @@ public String getBucketId() { return this.bucketId; } - - public boolean getRollBack() { - return this.rollBack; - } - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Response.java index 8fb4b2f49..ef13deace 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteFolderRecursivelySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Request.java index 0e663feb6..78006e4e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteGroupMemberSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Response.java index 4eb4d67f1..f0ea3ba7e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Request.java index d6fa6b078..82a9183d6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteGroupSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Response.java index ed3e01053..93886dee2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Request.java new file mode 100644 index 000000000..5be13090d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Request.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; + +public class DeleteJobCreationFailureSpectraS3Request extends AbstractRequest { + + // Variables + + private final String jobCreationFailed; + + // Constructor + + + public DeleteJobCreationFailureSpectraS3Request(final String jobCreationFailed) { + this.jobCreationFailed = jobCreationFailed; + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.DELETE; + } + + @Override + public String getPath() { + return "/_rest_/job_creation_failed/" + jobCreationFailed; + } + + public String getJobCreationFailed() { + return this.jobCreationFailed; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Response.java new file mode 100644 index 000000000..e58c40521 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteJobCreationFailureSpectraS3Response.java @@ -0,0 +1,28 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class DeleteJobCreationFailureSpectraS3Response extends AbstractResponse { + + public DeleteJobCreationFailureSpectraS3Response(final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Request.java index a83803230..5c1c19503 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeletePermanentlyLostPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Response.java index 53ffcbb4b..e28c0a030 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Request.java index bc6c23644..f02c55cb0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class DeletePermanentlyLostTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Response.java index ae0fd0f14..c22755ac4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePermanentlyLostTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Request.java index ee40859aa..871119c7b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeletePoolFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Response.java index e18757e27..989cab524 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Request.java index e6782b938..290221361 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeletePoolPartitionSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Response.java index 6a637df32..cd69d0fa7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeletePoolPartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Request.java index 3826b8ed0..76bec63d6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Response.java index 5b4dc035f..0f80258fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Request.java index 72930cdfb..98f06a3ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3TargetBucketNameSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Response.java index d280bb40b..9ae7dd8bc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetBucketNameSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Request.java index fc9512d81..e7c996a13 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3TargetFailureNotificationRegistrationSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Response.java index 75a97719c..16a02b276 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Request.java index e76892e0a..7355b95e1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3TargetFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Response.java index b054ae50d..3bde0277d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Request.java index 877511499..faf22bcc7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3TargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Response.java index 337443f55..aa45ba7dc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Request.java index c17463eb4..9da25e4e7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteS3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Response.java index 9fe24fe06..d8ff5820b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Request.java index cc4e8c304..fe2899edf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteStorageDomainFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Response.java index 306010f14..ff4804d45 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Request.java index e4fb4e7de..883ee5bd8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteStorageDomainMemberSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Response.java index 921bad876..44ffffa0d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Request.java index a3c7358da..cd1291cd1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteStorageDomainSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Response.java index 8bf9d7ccd..9be0bb8b3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteStorageDomainSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Request.java index 7117aa234..c8921a287 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteTapeDensityDirectiveSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Response.java index bc473207a..c70240382 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDensityDirectiveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Request.java index d05b89886..db8a47303 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class DeleteTapeDriveSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Response.java index 71bc38946..e2c8f0657 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeDriveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Request.java index 976462b73..47369dbe5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteTapeFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Response.java index 410cf8b13..ce24a8b25 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapeFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Request.java index e6b1fad52..68a017d8d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteTapePartitionFailureSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Response.java index f93a8b01e..c02a4b405 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionFailureSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Request.java index 7b73db819..2140c789f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class DeleteTapePartitionSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Response.java index edfdfd605..dd784cdb3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/DeleteTapePartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Request.java index d7fa0da13..964b0e7d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class EjectAllTapesSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Response.java index 3f9a74f37..0ee9b28b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Request.java index 218424b33..c920a80b4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,9 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; -import java.util.UUID; public class EjectStorageDomainBlobsSpectraS3Request extends AbstractRequest { @@ -36,7 +35,7 @@ public class EjectStorageDomainBlobsSpectraS3Request extends AbstractRequest { private final String bucketId; - private final String storageDomainId; + private final String storageDomain; private final List objects; @@ -48,29 +47,18 @@ public class EjectStorageDomainBlobsSpectraS3Request extends AbstractRequest { // Constructor - public EjectStorageDomainBlobsSpectraS3Request(final String bucketId, final List objects, final UUID storageDomainId) { + public EjectStorageDomainBlobsSpectraS3Request(final String bucketId, final List objects, final String storageDomain) { this.bucketId = bucketId; - this.storageDomainId = storageDomainId.toString(); + this.storageDomain = storageDomain; this.objects = objects; this.getQueryParams().put("operation", "eject"); this.getQueryParams().put("blobs", null); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); - } + this.updateQueryParam("bucket_id", bucketId); - - public EjectStorageDomainBlobsSpectraS3Request(final String bucketId, final List objects, final String storageDomainId) { - this.bucketId = bucketId; - this.storageDomainId = storageDomainId; - this.objects = objects; - - this.getQueryParams().put("operation", "eject"); + this.updateQueryParam("storage_domain", storageDomain); - this.getQueryParams().put("blobs", null); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); } public EjectStorageDomainBlobsSpectraS3Request withEjectLabel(final String ejectLabel) { @@ -98,7 +86,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -123,8 +111,8 @@ public String getBucketId() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Response.java index f02e68ae1..a4551e767 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainBlobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Request.java index fb2e3f966..dbd6cb693 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,14 +18,12 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; public class EjectStorageDomainSpectraS3Request extends AbstractRequest { // Variables - private final String storageDomainId; + private final String storageDomain; private String bucketId; @@ -36,21 +34,13 @@ public class EjectStorageDomainSpectraS3Request extends AbstractRequest { // Constructor - public EjectStorageDomainSpectraS3Request(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); + public EjectStorageDomainSpectraS3Request(final String storageDomain) { + this.storageDomain = storageDomain; this.getQueryParams().put("operation", "eject"); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); - } - - - public EjectStorageDomainSpectraS3Request(final String storageDomainId) { - this.storageDomainId = storageDomainId; - - this.getQueryParams().put("operation", "eject"); + this.updateQueryParam("storage_domain", storageDomain); - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); } public EjectStorageDomainSpectraS3Request withBucketId(final String bucketId) { @@ -85,8 +75,8 @@ public String getPath() { return "/_rest_/tape"; } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Response.java index 8c000bf9f..8665e6e04 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectStorageDomainSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Request.java index 75cf0de9f..e2f4cd967 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class EjectTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Response.java index 7e8c9b066..df2ce74db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/EjectTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Request.java index 127609ab1..01163df13 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Response.java index f22cd05bc..bdf9a01bc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFeatureKeyValidationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Request.java index 08ce3d26a..2db3954eb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Response.java index fdb28cf9e..0cb0e9f29 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceFullCacheReclaimSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Request.java index b3015481b..f9d2ce6e5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Response.java index 07443b6ff..7e775a969 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForcePoolEnvironmentRefreshSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Request.java index f5d4fa619..b9d1e1f47 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Response.java index 20ab9e2c7..792dc8644 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTapeEnvironmentRefreshSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Request.java index 764aeae84..1c9628ea3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Response.java index e3c42b79b..6d7fd4a13 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ForceTargetEnvironmentRefreshSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Request.java index a815b7572..9adc41a3a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Response.java index 18434b5a5..7b7e6ffab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllForeignPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Request.java index fc893ff10..ab5b70ab6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -23,6 +23,8 @@ public class FormatAllTapesSpectraS3Request extends AbstractRequest { // Variables + private boolean characterize; + private boolean force; // Constructor @@ -34,6 +36,17 @@ public FormatAllTapesSpectraS3Request() { } + public FormatAllTapesSpectraS3Request withCharacterize(final boolean characterize) { + this.characterize = characterize; + if (this.characterize) { + this.getQueryParams().put("characterize", null); + } else { + this.getQueryParams().remove("characterize"); + } + return this; + } + + public FormatAllTapesSpectraS3Request withForce(final boolean force) { this.force = force; if (this.force) { @@ -56,6 +69,11 @@ public String getPath() { return "/_rest_/tape"; } + public boolean getCharacterize() { + return this.characterize; + } + + public boolean getForce() { return this.force; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Response.java index cf5d72294..2f6c5006d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Request.java index 1a4b92bab..1ba7fc623 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class FormatForeignPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Response.java index 9d97f32ee..eb0b998af 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatForeignPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Request.java index 58713fe8c..b68affb15 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class FormatTapeSpectraS3Request extends AbstractRequest { @@ -27,6 +26,8 @@ public class FormatTapeSpectraS3Request extends AbstractRequest { private final String tapeId; + private boolean characterize; + private boolean force; // Constructor @@ -47,6 +48,17 @@ public FormatTapeSpectraS3Request(final String tapeId) { } + public FormatTapeSpectraS3Request withCharacterize(final boolean characterize) { + this.characterize = characterize; + if (this.characterize) { + this.getQueryParams().put("characterize", null); + } else { + this.getQueryParams().remove("characterize"); + } + return this; + } + + public FormatTapeSpectraS3Request withForce(final boolean force) { this.force = force; if (this.force) { @@ -74,6 +86,11 @@ public String getTapeId() { } + public boolean getCharacterize() { + return this.characterize; + } + + public boolean getForce() { return this.force; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Response.java index 65042e7ca..760326622 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/FormatTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Request.java new file mode 100644 index 000000000..01e32bfcc --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Request.java @@ -0,0 +1,43 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; + +public class GetAbmConfigSpectraS3Request extends AbstractRequest { + + // Variables + + // Constructor + + + public GetAbmConfigSpectraS3Request() { + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/abm_config"; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Response.java new file mode 100644 index 000000000..aa5cca4ed --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAbmConfigSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.AbmConfigApiBean; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class GetAbmConfigSpectraS3Response extends AbstractResponse { + + private final AbmConfigApiBean abmConfigApiBeanResult; + + public GetAbmConfigSpectraS3Response(final AbmConfigApiBean abmConfigApiBeanResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.abmConfigApiBeanResult = abmConfigApiBeanResult; + } + + public AbmConfigApiBean getAbmConfigApiBeanResult() { + return this.abmConfigApiBeanResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Request.java index 48f90f7ad..4619deff7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetActiveJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Response.java index 31a45a660..157dfd581 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Request.java index 290af54a8..1c2447055 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; import java.util.UUID; import com.spectralogic.ds3client.models.Priority; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Response.java index 10c961473..8e7d02ed9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetActiveJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Request.java index ba4380977..e16cf09a8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetAzureDataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Response.java index bf4b910f1..bc0edf173 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Request.java index d87bf4760..bacb7d122 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Response.java index b6f9f2047..c33f29ffe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureDataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Request.java index bb2b302e0..887c0298d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetAzureTargetBucketNamesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Response.java index 6a44ea4fa..eea33db36 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetBucketNamesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Request.java index c3bb79878..d635fb38b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetAzureTargetFailureNotificationRegistrationSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Response.java index 7ba2e2310..9cbc075e1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Request.java index 75e50302f..9137a570f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetAzureTargetFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Response.java index 800a7df02..e082a707a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Request.java index 8c1268248..5a40c13af 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Response.java index 6bdd9b8d4..bb13f38c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Request.java index f74df5299..1da99e4d4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetAzureTargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Response.java index 30d72509f..09f43ad29 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Request.java index 0e5f79cf3..9066c22f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetReadPreferenceType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Response.java index ce5e6ebca..e465f763a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetReadPreferencesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Request.java index 7f5e82c1f..a30d67f10 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetAzureTargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Response.java index 2a78a0f1d..2280e1ce3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Request.java index 1c54822c9..9a2abeab5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import java.util.UUID; import com.spectralogic.ds3client.models.Quiesced; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Response.java index 0940693a9..d3804b470 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetAzureTargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Request.java index 4cb06b735..dfd9f5b8b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,6 +21,7 @@ import java.io.InputStream; import java.nio.charset.Charset; import com.spectralogic.ds3client.utils.Guard; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; public class GetBlobPersistenceSpectraS3Request extends AbstractRequest { @@ -53,7 +54,7 @@ public InputStream getStream() { if (Guard.isStringNullOrEmpty(requestPayload)) { return null; } - final byte[] stringBytes = requestPayload.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = requestPayload.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Response.java index dde154595..5316aecf2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobPersistenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Request.java index 88de54734..fd4132017 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,17 +17,7 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; -import com.spectralogic.ds3client.serializer.XmlOutput; -import com.spectralogic.ds3client.utils.Guard; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.nio.charset.Charset; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBlobsOnAzureTargetSpectraS3Request extends AbstractRequest { @@ -35,41 +25,17 @@ public class GetBlobsOnAzureTargetSpectraS3Request extends AbstractRequest { private final String azureTarget; - private final List objects; - private long size = 0; - // Constructor - public GetBlobsOnAzureTargetSpectraS3Request(final String azureTarget, final List objects) { + public GetBlobsOnAzureTargetSpectraS3Request(final String azureTarget) { this.azureTarget = azureTarget; - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - @Override - public InputStream getStream() { - if (Guard.isNullOrEmpty(objects)) { - return null; - } - final Ds3ObjectList objects = new Ds3ObjectList(); - objects.setObjects(this.objects); - - final String xmlOutput = XmlOutput.toXml(objects, false); - - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); - } - - @Override - public long getSize() { - return this.size; - } - @Override public HttpVerb getVerb() { return HttpVerb.GET; @@ -84,10 +50,4 @@ public String getAzureTarget() { return this.azureTarget; } - - public List getObjects() { - return this.objects; - } - - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Response.java index 1c14f3cb4..8d7faa266 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Request.java index 23c37d74f..df60e09b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,17 +17,7 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; -import com.spectralogic.ds3client.serializer.XmlOutput; -import com.spectralogic.ds3client.utils.Guard; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.nio.charset.Charset; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBlobsOnDs3TargetSpectraS3Request extends AbstractRequest { @@ -35,41 +25,17 @@ public class GetBlobsOnDs3TargetSpectraS3Request extends AbstractRequest { private final String ds3Target; - private final List objects; - private long size = 0; - // Constructor - public GetBlobsOnDs3TargetSpectraS3Request(final String ds3Target, final List objects) { + public GetBlobsOnDs3TargetSpectraS3Request(final String ds3Target) { this.ds3Target = ds3Target; - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - @Override - public InputStream getStream() { - if (Guard.isNullOrEmpty(objects)) { - return null; - } - final Ds3ObjectList objects = new Ds3ObjectList(); - objects.setObjects(this.objects); - - final String xmlOutput = XmlOutput.toXml(objects, false); - - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); - } - - @Override - public long getSize() { - return this.size; - } - @Override public HttpVerb getVerb() { return HttpVerb.GET; @@ -84,10 +50,4 @@ public String getDs3Target() { return this.ds3Target; } - - public List getObjects() { - return this.objects; - } - - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Response.java index 0dfedc828..c400853bb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Request.java index 8d21607b8..16da1e6eb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,17 +17,7 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; -import com.spectralogic.ds3client.serializer.XmlOutput; -import com.spectralogic.ds3client.utils.Guard; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.nio.charset.Charset; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBlobsOnPoolSpectraS3Request extends AbstractRequest { @@ -35,41 +25,17 @@ public class GetBlobsOnPoolSpectraS3Request extends AbstractRequest { private final String pool; - private final List objects; - private long size = 0; - // Constructor - public GetBlobsOnPoolSpectraS3Request(final List objects, final String pool) { + public GetBlobsOnPoolSpectraS3Request(final String pool) { this.pool = pool; - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - @Override - public InputStream getStream() { - if (Guard.isNullOrEmpty(objects)) { - return null; - } - final Ds3ObjectList objects = new Ds3ObjectList(); - objects.setObjects(this.objects); - - final String xmlOutput = XmlOutput.toXml(objects, false); - - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); - } - - @Override - public long getSize() { - return this.size; - } - @Override public HttpVerb getVerb() { return HttpVerb.GET; @@ -84,10 +50,4 @@ public String getPool() { return this.pool; } - - public List getObjects() { - return this.objects; - } - - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Response.java index cad05cfde..5b81e71b5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Request.java index 0ba390808..4b3af8acc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,17 +17,7 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; -import com.spectralogic.ds3client.serializer.XmlOutput; -import com.spectralogic.ds3client.utils.Guard; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.nio.charset.Charset; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBlobsOnS3TargetSpectraS3Request extends AbstractRequest { @@ -35,41 +25,17 @@ public class GetBlobsOnS3TargetSpectraS3Request extends AbstractRequest { private final String s3Target; - private final List objects; - private long size = 0; - // Constructor - public GetBlobsOnS3TargetSpectraS3Request(final List objects, final String s3Target) { + public GetBlobsOnS3TargetSpectraS3Request(final String s3Target) { this.s3Target = s3Target; - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - @Override - public InputStream getStream() { - if (Guard.isNullOrEmpty(objects)) { - return null; - } - final Ds3ObjectList objects = new Ds3ObjectList(); - objects.setObjects(this.objects); - - final String xmlOutput = XmlOutput.toXml(objects, false); - - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); - } - - @Override - public long getSize() { - return this.size; - } - @Override public HttpVerb getVerb() { return HttpVerb.GET; @@ -84,10 +50,4 @@ public String getS3Target() { return this.s3Target; } - - public List getObjects() { - return this.objects; - } - - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Response.java index 95ad60028..e838c3ba2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Request.java index 09d3aa238..39a5a017c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,69 +17,81 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.models.bulk.Ds3Object; -import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; -import com.spectralogic.ds3client.serializer.XmlOutput; -import com.spectralogic.ds3client.utils.Guard; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.nio.charset.Charset; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; -public class GetBlobsOnTapeSpectraS3Request extends AbstractRequest { +public class GetBlobsOnTapeSpectraS3Request extends AbstractPaginationRequest { // Variables private final String tapeId; - private final List objects; - private long size = 0; + private boolean lastPage; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; // Constructor - public GetBlobsOnTapeSpectraS3Request(final List objects, final UUID tapeId) { + public GetBlobsOnTapeSpectraS3Request(final UUID tapeId) { this.tapeId = tapeId.toString(); - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - public GetBlobsOnTapeSpectraS3Request(final List objects, final String tapeId) { + public GetBlobsOnTapeSpectraS3Request(final String tapeId) { this.tapeId = tapeId; - this.objects = objects; this.getQueryParams().put("operation", "get_physical_placement"); } - - @Override - public InputStream getStream() { - if (Guard.isNullOrEmpty(objects)) { - return null; + public GetBlobsOnTapeSpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); } - final Ds3ObjectList objects = new Ds3ObjectList(); - objects.setObjects(this.objects); + return this; + } - final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); - this.size = stringBytes.length; - return new ByteArrayInputStream(stringBytes); + public GetBlobsOnTapeSpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; } - @Override - public long getSize() { - return this.size; + + public GetBlobsOnTapeSpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetBlobsOnTapeSpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetBlobsOnTapeSpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; } + + @Override public HttpVerb getVerb() { return HttpVerb.GET; @@ -95,9 +107,23 @@ public String getTapeId() { } - public List getObjects() { - return this.objects; + public boolean getLastPage() { + return this.lastPage; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; } + public String getPageStartMarker() { + return this.pageStartMarker; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Response.java index e20f6dcf3..360bdfc42 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBlobsOnTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,14 +18,14 @@ import com.spectralogic.ds3client.models.BulkObjectList; import com.spectralogic.ds3client.models.ChecksumType; -import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetBlobsOnTapeSpectraS3Response extends AbstractPaginationResponse { -public class GetBlobsOnTapeSpectraS3Response extends AbstractResponse { - private final BulkObjectList bulkObjectListResult; - public GetBlobsOnTapeSpectraS3Response(final BulkObjectList bulkObjectListResult, final String checksum, final ChecksumType.Type checksumType) { - super(checksum, checksumType); + public GetBlobsOnTapeSpectraS3Response(final BulkObjectList bulkObjectListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); this.bulkObjectListResult = bulkObjectListResult; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Request.java index 069bd5998..32bf65306 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBucketAclSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Response.java index 159f68fa7..4e7581193 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Request.java index 4a6252740..29e5bb2b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.BucketAclPermission; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Response.java index 5a03d4065..349c03eaf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketAclsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Request.java index 876798b94..5dc34371c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,13 +18,11 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.PoolHealth; import com.spectralogic.ds3client.models.PoolState; import com.spectralogic.ds3client.models.PoolType; import com.spectralogic.ds3client.models.TapeState; -import com.spectralogic.ds3client.models.TapeType; public class GetBucketCapacitySummarySpectraS3Request extends AbstractRequest { @@ -42,7 +40,7 @@ public class GetBucketCapacitySummarySpectraS3Request extends AbstractRequest { private TapeState tapeState; - private TapeType tapeType; + private String tapeType; // Constructor @@ -51,8 +49,10 @@ public GetBucketCapacitySummarySpectraS3Request(final String bucketId, final UUI this.bucketId = bucketId; this.storageDomainId = storageDomainId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("storage_domain_id", storageDomainId); + } @@ -60,8 +60,10 @@ public GetBucketCapacitySummarySpectraS3Request(final String bucketId, final Str this.bucketId = bucketId; this.storageDomainId = storageDomainId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("storage_domain_id", storageDomainId); + } public GetBucketCapacitySummarySpectraS3Request withPoolHealth(final PoolHealth poolHealth) { @@ -92,7 +94,7 @@ public GetBucketCapacitySummarySpectraS3Request withTapeState(final TapeState ta } - public GetBucketCapacitySummarySpectraS3Request withTapeType(final TapeType tapeType) { + public GetBucketCapacitySummarySpectraS3Request withTapeType(final String tapeType) { this.tapeType = tapeType; this.updateQueryParam("tape_type", tapeType); return this; @@ -140,7 +142,7 @@ public TapeState getTapeState() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Response.java index 603470447..85ef3000c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketCapacitySummarySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Request.java new file mode 100644 index 000000000..8b13f9fca --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Request.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; + +public class GetBucketChangesNotificationRegistrationSpectraS3Request extends AbstractRequest { + + // Variables + + private final String bucketChangesNotificationRegistration; + + // Constructor + + + public GetBucketChangesNotificationRegistrationSpectraS3Request(final String bucketChangesNotificationRegistration) { + this.bucketChangesNotificationRegistration = bucketChangesNotificationRegistration; + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/bucket_changes_notification_registration/" + bucketChangesNotificationRegistration; + } + + public String getBucketChangesNotificationRegistration() { + return this.bucketChangesNotificationRegistration; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Response.java similarity index 51% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Response.java index 7c71f813f..1db3dd34b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/CompleteMultiPartUploadResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,23 +14,23 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; -import com.spectralogic.ds3client.models.CompleteMultipartUploadResult; +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistration; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class CompleteMultiPartUploadResponse extends AbstractResponse { +public class GetBucketChangesNotificationRegistrationSpectraS3Response extends AbstractResponse { - private final CompleteMultipartUploadResult completeMultipartUploadResult; + private final BucketChangesNotificationRegistration bucketChangesNotificationRegistrationResult; - public CompleteMultiPartUploadResponse(final CompleteMultipartUploadResult completeMultipartUploadResult, final String checksum, final ChecksumType.Type checksumType) { + public GetBucketChangesNotificationRegistrationSpectraS3Response(final BucketChangesNotificationRegistration bucketChangesNotificationRegistrationResult, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); - this.completeMultipartUploadResult = completeMultipartUploadResult; + this.bucketChangesNotificationRegistrationResult = bucketChangesNotificationRegistrationResult; } - public CompleteMultipartUploadResult getCompleteMultipartUploadResult() { - return this.completeMultipartUploadResult; + public BucketChangesNotificationRegistration getBucketChangesNotificationRegistrationResult() { + return this.bucketChangesNotificationRegistrationResult; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Request.java new file mode 100644 index 000000000..c350babce --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Request.java @@ -0,0 +1,132 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import java.util.UUID; + +public class GetBucketChangesNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { + + // Variables + + private boolean lastPage; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; + + private String userId; + + // Constructor + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request() { + + } + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); + } + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withUserId(final UUID userId) { + this.userId = userId.toString(); + this.updateQueryParam("user_id", userId); + return this; + } + + + public GetBucketChangesNotificationRegistrationsSpectraS3Request withUserId(final String userId) { + this.userId = userId; + this.updateQueryParam("user_id", userId); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/bucket_changes_notification_registration"; + } + + public boolean getLastPage() { + return this.lastPage; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; + } + + + public String getPageStartMarker() { + return this.pageStartMarker; + } + + + public String getUserId() { + return this.userId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Response.java new file mode 100644 index 000000000..03926d02b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketChangesNotificationRegistrationsSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistrationList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetBucketChangesNotificationRegistrationsSpectraS3Response extends AbstractPaginationResponse { + + private final BucketChangesNotificationRegistrationList bucketChangesNotificationRegistrationListResult; + + public GetBucketChangesNotificationRegistrationsSpectraS3Response(final BucketChangesNotificationRegistrationList bucketChangesNotificationRegistrationListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); + this.bucketChangesNotificationRegistrationListResult = bucketChangesNotificationRegistrationListResult; + } + + public BucketChangesNotificationRegistrationList getBucketChangesNotificationRegistrationListResult() { + return this.bucketChangesNotificationRegistrationListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Request.java new file mode 100644 index 000000000..1370776e0 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Request.java @@ -0,0 +1,139 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import java.util.UUID; + +public class GetBucketHistorySpectraS3Request extends AbstractPaginationRequest { + + // Variables + + private String bucketId; + + private boolean lastPage; + + private long minSequenceNumber; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; + + // Constructor + + + public GetBucketHistorySpectraS3Request() { + + } + + public GetBucketHistorySpectraS3Request withBucketId(final String bucketId) { + this.bucketId = bucketId; + this.updateQueryParam("bucket_id", bucketId); + return this; + } + + + public GetBucketHistorySpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); + } + return this; + } + + + public GetBucketHistorySpectraS3Request withMinSequenceNumber(final long minSequenceNumber) { + this.minSequenceNumber = minSequenceNumber; + this.updateQueryParam("min_sequence_number", minSequenceNumber); + return this; + } + + + public GetBucketHistorySpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; + } + + + public GetBucketHistorySpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetBucketHistorySpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetBucketHistorySpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/bucket_history"; + } + + public String getBucketId() { + return this.bucketId; + } + + + public boolean getLastPage() { + return this.lastPage; + } + + + public long getMinSequenceNumber() { + return this.minSequenceNumber; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; + } + + + public String getPageStartMarker() { + return this.pageStartMarker; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Response.java new file mode 100644 index 000000000..4d86211aa --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketHistorySpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.BucketHistoryEventList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetBucketHistorySpectraS3Response extends AbstractPaginationResponse { + + private final BucketHistoryEventList bucketHistoryEventListResult; + + public GetBucketHistorySpectraS3Response(final BucketHistoryEventList bucketHistoryEventListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); + this.bucketHistoryEventListResult = bucketHistoryEventListResult; + } + + public BucketHistoryEventList getBucketHistoryEventListResult() { + return this.bucketHistoryEventListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Request.java index 22f4f639c..e0c353a49 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetBucketSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Response.java index 40d53fef7..178fdd177 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Request.java index acfc829bb..f399669cb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetBucketsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Response.java index e0bfc0c0a..c3afa0cc9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBucketsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Request.java index 10f20fec2..ce22bd9fe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.models.bulk.Ds3Object; import com.spectralogic.ds3client.commands.interfaces.BulkRequest; import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class GetBulkJobSpectraS3Request extends BulkRequest { @@ -31,10 +30,14 @@ public class GetBulkJobSpectraS3Request extends BulkRequest { private JobChunkClientProcessingOrderGuarantee chunkClientProcessingOrderGuarantee; + private boolean deadJobCleanupAllowed; + private boolean implicitJobIdResolution; private String name; + private boolean protectedFlag; + // Constructor public GetBulkJobSpectraS3Request(final String bucketName, final Iterable objects) { @@ -58,6 +61,13 @@ public GetBulkJobSpectraS3Request withChunkClientProcessingOrderGuarantee(final } + public GetBulkJobSpectraS3Request withDeadJobCleanupAllowed(final boolean deadJobCleanupAllowed) { + this.deadJobCleanupAllowed = deadJobCleanupAllowed; + this.updateQueryParam("dead_job_cleanup_allowed", deadJobCleanupAllowed); + return this; + } + + public GetBulkJobSpectraS3Request withImplicitJobIdResolution(final boolean implicitJobIdResolution) { this.implicitJobIdResolution = implicitJobIdResolution; this.updateQueryParam("implicit_job_id_resolution", implicitJobIdResolution); @@ -79,6 +89,13 @@ public GetBulkJobSpectraS3Request withPriority(final Priority priority) { } + public GetBulkJobSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + public boolean getAggregating() { @@ -91,6 +108,11 @@ public JobChunkClientProcessingOrderGuarantee getChunkClientProcessingOrderGuara } + public boolean getDeadJobCleanupAllowed() { + return this.deadJobCleanupAllowed; + } + + public boolean getImplicitJobIdResolution() { return this.implicitJobIdResolution; } @@ -101,6 +123,11 @@ public String getName() { } + public boolean getProtected() { + return this.protectedFlag; + } + + @Override public BulkCommand getCommand() { return BulkCommand.GET; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Response.java index 552b34d95..8fe7d1c5f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetBulkJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Request.java index bad047937..dbe7929ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetCacheFilesystemSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Response.java index 41fc0ebfd..1c747780e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Request.java index caa0d9ff2..1ee7d5dac 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetCacheFilesystemsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Response.java index ce89d8ee2..a485b632d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheFilesystemsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Request.java index 56398dca0..e899389fc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Response.java index 31965c028..a9d5cd6ef 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheStateSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Request.java new file mode 100644 index 000000000..2ca783c5a --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Request.java @@ -0,0 +1,51 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; + +public class GetCacheThrottleRuleSpectraS3Request extends AbstractRequest { + + // Variables + + private final String cacheThrottleRule; + + // Constructor + + + public GetCacheThrottleRuleSpectraS3Request(final String cacheThrottleRule) { + this.cacheThrottleRule = cacheThrottleRule; + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/cache_throttle_rule/" + cacheThrottleRule; + } + + public String getCacheThrottleRule() { + return this.cacheThrottleRule; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Response.java new file mode 100644 index 000000000..fa0a7e41a --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRuleSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.CacheThrottleRule; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class GetCacheThrottleRuleSpectraS3Response extends AbstractResponse { + + private final CacheThrottleRule cacheThrottleRuleResult; + + public GetCacheThrottleRuleSpectraS3Response(final CacheThrottleRule cacheThrottleRuleResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.cacheThrottleRuleResult = cacheThrottleRuleResult; + } + + public CacheThrottleRule getCacheThrottleRuleResult() { + return this.cacheThrottleRuleResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Request.java new file mode 100644 index 000000000..92c4865d2 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Request.java @@ -0,0 +1,184 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import java.lang.Double; +import java.util.UUID; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.models.JobRequestType; + +public class GetCacheThrottleRulesSpectraS3Request extends AbstractPaginationRequest { + + // Variables + + private String bucketId; + + private Double burstThreshold; + + private boolean lastPage; + + private double maxCachePercent; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; + + private Priority priority; + + private JobRequestType requestType; + + // Constructor + + + public GetCacheThrottleRulesSpectraS3Request() { + + } + + public GetCacheThrottleRulesSpectraS3Request withBucketId(final String bucketId) { + this.bucketId = bucketId; + this.updateQueryParam("bucket_id", bucketId); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withBurstThreshold(final Double burstThreshold) { + this.burstThreshold = burstThreshold; + this.updateQueryParam("burst_threshold", burstThreshold); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); + } + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withMaxCachePercent(final double maxCachePercent) { + this.maxCachePercent = maxCachePercent; + this.updateQueryParam("max_cache_percent", maxCachePercent); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withPriority(final Priority priority) { + this.priority = priority; + this.updateQueryParam("priority", priority); + return this; + } + + + public GetCacheThrottleRulesSpectraS3Request withRequestType(final JobRequestType requestType) { + this.requestType = requestType; + this.updateQueryParam("request_type", requestType); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/cache_throttle_rule"; + } + + public String getBucketId() { + return this.bucketId; + } + + + public Double getBurstThreshold() { + return this.burstThreshold; + } + + + public boolean getLastPage() { + return this.lastPage; + } + + + public double getMaxCachePercent() { + return this.maxCachePercent; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; + } + + + public String getPageStartMarker() { + return this.pageStartMarker; + } + + + public Priority getPriority() { + return this.priority; + } + + + public JobRequestType getRequestType() { + return this.requestType; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Response.java new file mode 100644 index 000000000..f244ffa1f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCacheThrottleRulesSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.CacheThrottleRuleList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetCacheThrottleRulesSpectraS3Response extends AbstractPaginationResponse { + + private final CacheThrottleRuleList cacheThrottleRuleListResult; + + public GetCacheThrottleRulesSpectraS3Response(final CacheThrottleRuleList cacheThrottleRuleListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); + this.cacheThrottleRuleListResult = cacheThrottleRuleListResult; + } + + public CacheThrottleRuleList getCacheThrottleRuleListResult() { + return this.cacheThrottleRuleListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Request.java index 2ea961b6a..6bc21f616 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetCanceledJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Response.java index ea6d08666..7bae774d4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Request.java index 76c1f6206..201cd6a51 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; import java.util.UUID; import com.spectralogic.ds3client.models.Priority; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Response.java index 40c514f9c..8bf691387 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCanceledJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Request.java index 7eea21603..120d9e5f5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetCompletedJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Response.java index 4bfb12f5a..d01655423 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Request.java index 37ff601ac..76d88746c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; import java.util.UUID; import com.spectralogic.ds3client.models.Priority; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Response.java index 077c0c9c5..e5016c0ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetCompletedJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Request.java index 28b417e62..9e307a0ee 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Response.java index 105a32d70..4adb90b08 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPathBackendSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Request.java index e0152754e..05a28920a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,19 +18,25 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; +import java.util.UUID; public class GetDataPersistenceRuleSpectraS3Request extends AbstractRequest { // Variables - private final String dataPersistenceRule; + private final String dataPersistenceRuleId; // Constructor - public GetDataPersistenceRuleSpectraS3Request(final String dataPersistenceRule) { - this.dataPersistenceRule = dataPersistenceRule; + public GetDataPersistenceRuleSpectraS3Request(final UUID dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId.toString(); + + } + + + public GetDataPersistenceRuleSpectraS3Request(final String dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId; } @@ -42,11 +48,11 @@ public HttpVerb getVerb() { @Override public String getPath() { - return "/_rest_/data_persistence_rule/" + dataPersistenceRule; + return "/_rest_/data_persistence_rule/" + dataPersistenceRuleId; } - public String getDataPersistenceRule() { - return this.dataPersistenceRule; + public String getDataPersistenceRuleId() { + return this.dataPersistenceRuleId; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Response.java index b17f2c726..6707da6da 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Request.java index 2c2886a36..9e426f92a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataIsolationLevel; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataPersistenceRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Response.java index a57a10b3f..1674095f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPersistenceRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Request.java index af9c08996..3e6a5778c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; public class GetDataPlannerBlobStoreTasksSpectraS3Request extends AbstractRequest { @@ -25,6 +26,8 @@ public class GetDataPlannerBlobStoreTasksSpectraS3Request extends AbstractReques private boolean fullDetails; + private String job; + // Constructor @@ -43,6 +46,20 @@ public GetDataPlannerBlobStoreTasksSpectraS3Request withFullDetails(final boolea } + public GetDataPlannerBlobStoreTasksSpectraS3Request withJob(final UUID job) { + this.job = job.toString(); + this.updateQueryParam("job", job); + return this; + } + + + public GetDataPlannerBlobStoreTasksSpectraS3Request withJob(final String job) { + this.job = job; + this.updateQueryParam("job", job); + return this; + } + + @Override public HttpVerb getVerb() { @@ -58,4 +75,9 @@ public boolean getFullDetails() { return this.fullDetails; } + + public String getJob() { + return this.job; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Response.java index e5a737bd5..93496f33b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPlannerBlobStoreTasksSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Request.java index 45049dad7..a5baf870a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import com.spectralogic.ds3client.models.ChecksumType; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetDataPoliciesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Response.java index c49fbb206..c789ae3a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPoliciesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Request.java index 4255f7860..58183b834 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetDataPolicyAclSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Response.java index 0654c4892..2172469a3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Request.java index df0637fef..7eec654a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetDataPolicyAclsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Response.java index f988ba938..a281d9bb0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicyAclsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Request.java index a2b2d2f52..899eee22b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetDataPolicySpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Response.java index 8e163f8b9..3eaabe989 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDataPolicySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Request.java index 4f880c35b..d92937bf5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Response.java index c535340aa..141930884 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedAzureDataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Request.java index ea756ba50..d91a730a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetDegradedBlobsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Response.java index 21e5da316..429a24250 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBlobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Request.java index 1fcbb7ac6..02343ebfe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetDegradedBucketsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Response.java index be10baf02..2f85c8ed9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedBucketsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Request.java index 7ac267b77..4f91f377f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataIsolationLevel; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataPersistenceRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Response.java index 8e6f847b9..d240dfc9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDataPersistenceRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Request.java index 67c615246..c375bef48 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Response.java index 4091b6fea..9782c9d2c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedDs3DataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Request.java index 10428a6d1..fb8267748 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Response.java index 178411e3e..0c05e49b0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDegradedS3DataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Request.java index ad5e7fb7e..555162f9d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetDs3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Response.java index 9163066ae..634421d83 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Request.java index c24e53b60..b22d890aa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Response.java index eacac3d34..9828ecbca 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3DataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Request.java index 344f6d670..4d52be36b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetDs3TargetDataPoliciesSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Response.java index ace792507..388ab09c9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetDataPoliciesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Request.java index afe266f66..e7fed6772 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Response.java index 1066e90f1..1ff25dada 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Request.java index 659829437..dd5139f32 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetDs3TargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Response.java index be667d1cd..644d2fec5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Request.java index dcb01c7f7..4f053b5cf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetReadPreferenceType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Response.java index d979a944d..48d29082e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetReadPreferencesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Request.java index 519f0e946..71b000ee8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetDs3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Response.java index b86f5e145..512b11ea4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Request.java index 86c96e036..4c3b28ec5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import java.util.UUID; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Response.java index 008dc3888..948db3e1f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetDs3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Request.java index d44b824e4..290cda87d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.Date; import com.spectralogic.ds3client.models.FeatureKeyType; import java.util.UUID; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Response.java index 613c04de1..5cdeb7a72 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetFeatureKeysSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Request.java index 050a12f6b..3ad576053 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetGroupMemberSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Response.java index 1c6865ece..e82eef95b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Request.java index 60dca5055..869fa6fae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetGroupMembersSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Response.java index e0423228f..d8c2d15c6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupMembersSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Request.java index d5c30e4e9..f261a88b6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetGroupSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Response.java index a48d69b38..695747a9a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Request.java index 13e9d5530..2bc3ef9df 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetGroupsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Response.java index 3bea17a61..556a2de53 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetGroupsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Request.java index 12e29e392..ce94c9b81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetJobChunkDaoSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Response.java index 25a187369..4b5b30666 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkDaoSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Request.java index 69a1237d1..a9cf9573b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobChunkSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Response.java index 7e44e974b..5b083785f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunkSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Request.java index b43559332..79cc85695 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobChunksReadyForClientProcessingSpectraS3Request extends AbstractRequest { @@ -37,14 +36,16 @@ public class GetJobChunksReadyForClientProcessingSpectraS3Request extends Abstra public GetJobChunksReadyForClientProcessingSpectraS3Request(final UUID job) { this.job = job.toString(); - this.getQueryParams().put("job", job.toString()); + this.updateQueryParam("job", job); + } public GetJobChunksReadyForClientProcessingSpectraS3Request(final String job) { this.job = job; - this.getQueryParams().put("job", UrlEscapers.urlFragmentEscaper().escape(job).replace("+", "%2B")); + this.updateQueryParam("job", job); + } public GetJobChunksReadyForClientProcessingSpectraS3Request withJobChunk(final UUID jobChunk) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Response.java index f9962ecab..d817fec7f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobChunksReadyForClientProcessingSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Request.java new file mode 100644 index 000000000..91576e01e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Request.java @@ -0,0 +1,154 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import java.util.Date; +import java.util.UUID; + +public class GetJobCreationFailuresSpectraS3Request extends AbstractPaginationRequest { + + // Variables + + private Date date; + + private String errorMessage; + + private boolean lastPage; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; + + private String userName; + + // Constructor + + + public GetJobCreationFailuresSpectraS3Request() { + + } + + public GetJobCreationFailuresSpectraS3Request withDate(final Date date) { + this.date = date; + this.updateQueryParam("date", date); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withErrorMessage(final String errorMessage) { + this.errorMessage = errorMessage; + this.updateQueryParam("error_message", errorMessage); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); + } + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetJobCreationFailuresSpectraS3Request withUserName(final String userName) { + this.userName = userName; + this.updateQueryParam("user_name", userName); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/job_creation_failed"; + } + + public Date getDate() { + return this.date; + } + + + public String getErrorMessage() { + return this.errorMessage; + } + + + public boolean getLastPage() { + return this.lastPage; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; + } + + + public String getPageStartMarker() { + return this.pageStartMarker; + } + + + public String getUserName() { + return this.userName; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Response.java new file mode 100644 index 000000000..bcc208873 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobCreationFailuresSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.JobCreationFailedList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetJobCreationFailuresSpectraS3Response extends AbstractPaginationResponse { + + private final JobCreationFailedList jobCreationFailedListResult; + + public GetJobCreationFailuresSpectraS3Response(final JobCreationFailedList jobCreationFailedListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); + this.jobCreationFailedListResult = jobCreationFailedListResult; + } + + public JobCreationFailedList getJobCreationFailedListResult() { + return this.jobCreationFailedListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Request.java new file mode 100644 index 000000000..1c6df07d7 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Request.java @@ -0,0 +1,129 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import java.util.UUID; + +public class GetJobEntriesSpectraS3Request extends AbstractPaginationRequest { + + // Variables + + private final String jobId; + + private boolean lastPage; + + private int pageLength; + + private int pageOffset; + + private String pageStartMarker; + + // Constructor + + + public GetJobEntriesSpectraS3Request(final UUID jobId) { + this.jobId = jobId.toString(); + + this.updateQueryParam("job_id", jobId); + + } + + + public GetJobEntriesSpectraS3Request(final String jobId) { + this.jobId = jobId; + + this.updateQueryParam("job_id", jobId); + + } + + public GetJobEntriesSpectraS3Request withLastPage(final boolean lastPage) { + this.lastPage = lastPage; + if (this.lastPage) { + this.getQueryParams().put("last_page", null); + } else { + this.getQueryParams().remove("last_page"); + } + return this; + } + + + public GetJobEntriesSpectraS3Request withPageLength(final int pageLength) { + this.pageLength = pageLength; + this.updateQueryParam("page_length", pageLength); + return this; + } + + + public GetJobEntriesSpectraS3Request withPageOffset(final int pageOffset) { + this.pageOffset = pageOffset; + this.updateQueryParam("page_offset", pageOffset); + return this; + } + + + public GetJobEntriesSpectraS3Request withPageStartMarker(final UUID pageStartMarker) { + this.pageStartMarker = pageStartMarker.toString(); + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + public GetJobEntriesSpectraS3Request withPageStartMarker(final String pageStartMarker) { + this.pageStartMarker = pageStartMarker; + this.updateQueryParam("page_start_marker", pageStartMarker); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/job_chunk_dao"; + } + + public String getJobId() { + return this.jobId; + } + + + public boolean getLastPage() { + return this.lastPage; + } + + + public int getPageLength() { + return this.pageLength; + } + + + public int getPageOffset() { + return this.pageOffset; + } + + + public String getPageStartMarker() { + return this.pageStartMarker; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Response.java new file mode 100644 index 000000000..209bb5280 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobEntriesSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.JobEntryList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationResponse; + +public class GetJobEntriesSpectraS3Response extends AbstractPaginationResponse { + + private final JobEntryList jobEntryListResult; + + public GetJobEntriesSpectraS3Response(final JobEntryList jobEntryListResult, final Integer pagingTotalResultCount, final Integer pagingTruncated, final String checksum, final ChecksumType.Type checksumType) { + super(pagingTotalResultCount, pagingTruncated, checksum, checksumType); + this.jobEntryListResult = jobEntryListResult; + } + + public JobEntryList getJobEntryListResult() { + return this.jobEntryListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Request.java index dc13af2d0..4643764d0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Response.java index c85a91b4b..f0238f391 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Request.java new file mode 100644 index 000000000..d71080cff --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Request.java @@ -0,0 +1,72 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class GetJobSummarySpectraS3Request extends AbstractRequest { + + // Variables + + private final String jobId; + + // Constructor + + + public GetJobSummarySpectraS3Request(final UUID jobId) { + this.jobId = jobId.toString(); + + this.getQueryParams().put("summary", null); + } + + + public GetJobSummarySpectraS3Request(final String jobId) { + this.jobId = jobId; + + this.getQueryParams().put("summary", null); + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.GET; + } + + @Override + public String getPath() { + return "/_rest_/job/" + jobId; + } + + public String getJobId() { + return this.jobId; + } + + + @Override + public int hashCode() { + return jobId.hashCode(); + } + + @Override + public boolean equals(final Object obj) { + if (! (obj instanceof GetJobSummarySpectraS3Request)) return false; + final GetJobSummarySpectraS3Request other = (GetJobSummarySpectraS3Request) obj; + return other.getJobId().equals(this.getJobId()); + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Response.java new file mode 100644 index 000000000..d17b95b15 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobSummarySpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.JobSummaryApiBean; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class GetJobSummarySpectraS3Response extends AbstractResponse { + + private final JobSummaryApiBean jobSummaryApiBeanResult; + + public GetJobSummarySpectraS3Response(final JobSummaryApiBean jobSummaryApiBeanResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.jobSummaryApiBeanResult = jobSummaryApiBeanResult; + } + + public JobSummaryApiBean getJobSummaryApiBeanResult() { + return this.jobSummaryApiBeanResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Request.java index 82ccc1656..514273f0b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobToReplicateSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Response.java index e889811b2..9a3d18294 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobToReplicateSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Request.java index 6230aed02..8c87dabcd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetJobsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Response.java index 8cd408c34..4ef79d9a4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Request.java index 23325b228..bcb889c38 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetNodeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Response.java index c39e43d8b..822a3312f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Request.java index 20be4e82c..6a5ccf9a7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetNodesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Response.java index a5a12a6e4..4814c2cf3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetNodesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Request.java index f87b7332d..360a9a6bf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetObjectDetailsSpectraS3Request extends AbstractRequest { @@ -35,7 +34,8 @@ public GetObjectDetailsSpectraS3Request(final String objectName, final String bu this.objectName = objectName; this.bucketId = bucketId; - this.getQueryParams().put("bucket_id", bucketId); + this.updateQueryParam("bucket_id", bucketId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Response.java index 216672e0d..e73fff57b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Request.java index 69d00b6f7..40bc34bf8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.S3ObjectType; @@ -28,7 +27,7 @@ public class GetObjectsDetailsSpectraS3Request extends AbstractPaginationRequest private String bucketId; - private String folder; + private long endDate; private boolean lastPage; @@ -42,9 +41,9 @@ public class GetObjectsDetailsSpectraS3Request extends AbstractPaginationRequest private String pageStartMarker; - private S3ObjectType type; + private long startDate; - private long version; + private S3ObjectType type; // Constructor @@ -60,9 +59,9 @@ public GetObjectsDetailsSpectraS3Request withBucketId(final String bucketId) { } - public GetObjectsDetailsSpectraS3Request withFolder(final String folder) { - this.folder = folder; - this.updateQueryParam("folder", folder); + public GetObjectsDetailsSpectraS3Request withEndDate(final long endDate) { + this.endDate = endDate; + this.updateQueryParam("end_date", endDate); return this; } @@ -120,16 +119,16 @@ public GetObjectsDetailsSpectraS3Request withPageStartMarker(final String pageSt } - public GetObjectsDetailsSpectraS3Request withType(final S3ObjectType type) { - this.type = type; - this.updateQueryParam("type", type); + public GetObjectsDetailsSpectraS3Request withStartDate(final long startDate) { + this.startDate = startDate; + this.updateQueryParam("start_date", startDate); return this; } - public GetObjectsDetailsSpectraS3Request withVersion(final long version) { - this.version = version; - this.updateQueryParam("version", version); + public GetObjectsDetailsSpectraS3Request withType(final S3ObjectType type) { + this.type = type; + this.updateQueryParam("type", type); return this; } @@ -150,8 +149,8 @@ public String getBucketId() { } - public String getFolder() { - return this.folder; + public long getEndDate() { + return this.endDate; } @@ -185,13 +184,13 @@ public String getPageStartMarker() { } - public S3ObjectType getType() { - return this.type; + public long getStartDate() { + return this.startDate; } - public long getVersion() { - return this.version; + public S3ObjectType getType() { + return this.type; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Response.java index 9e49904b4..b9c2508d6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Request.java index 45ea25e44..819e64d0d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.S3ObjectType; @@ -28,7 +27,7 @@ public class GetObjectsWithFullDetailsSpectraS3Request extends AbstractPaginatio private String bucketId; - private String folder; + private long endDate; private boolean includePhysicalPlacement; @@ -44,9 +43,9 @@ public class GetObjectsWithFullDetailsSpectraS3Request extends AbstractPaginatio private String pageStartMarker; - private S3ObjectType type; + private long startDate; - private long version; + private S3ObjectType type; // Constructor @@ -63,9 +62,9 @@ public GetObjectsWithFullDetailsSpectraS3Request withBucketId(final String bucke } - public GetObjectsWithFullDetailsSpectraS3Request withFolder(final String folder) { - this.folder = folder; - this.updateQueryParam("folder", folder); + public GetObjectsWithFullDetailsSpectraS3Request withEndDate(final long endDate) { + this.endDate = endDate; + this.updateQueryParam("end_date", endDate); return this; } @@ -134,16 +133,16 @@ public GetObjectsWithFullDetailsSpectraS3Request withPageStartMarker(final Strin } - public GetObjectsWithFullDetailsSpectraS3Request withType(final S3ObjectType type) { - this.type = type; - this.updateQueryParam("type", type); + public GetObjectsWithFullDetailsSpectraS3Request withStartDate(final long startDate) { + this.startDate = startDate; + this.updateQueryParam("start_date", startDate); return this; } - public GetObjectsWithFullDetailsSpectraS3Request withVersion(final long version) { - this.version = version; - this.updateQueryParam("version", version); + public GetObjectsWithFullDetailsSpectraS3Request withType(final S3ObjectType type) { + this.type = type; + this.updateQueryParam("type", type); return this; } @@ -164,8 +163,8 @@ public String getBucketId() { } - public String getFolder() { - return this.folder; + public long getEndDate() { + return this.endDate; } @@ -204,13 +203,13 @@ public String getPageStartMarker() { } - public S3ObjectType getType() { - return this.type; + public long getStartDate() { + return this.startDate; } - public long getVersion() { - return this.version; + public S3ObjectType getType() { + return this.type; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Response.java index 5b48db778..768bc1722 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetObjectsWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Request.java index 0e0ae220c..a73503422 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,9 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetPhysicalPlacementForObjectsSpectraS3Request extends AbstractRequest { @@ -38,7 +37,7 @@ public class GetPhysicalPlacementForObjectsSpectraS3Request extends AbstractRequ private final List objects; - private String storageDomainId; + private String storageDomain; private long size = 0; // Constructor @@ -52,16 +51,9 @@ public GetPhysicalPlacementForObjectsSpectraS3Request(final String bucketName, f } - public GetPhysicalPlacementForObjectsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); - return this; - } - - - public GetPhysicalPlacementForObjectsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetPhysicalPlacementForObjectsSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } @@ -77,7 +69,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -107,8 +99,8 @@ public List getObjects() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Response.java index 197bc236f..8c38b53c1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java index 891dd21f5..5da4736b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,9 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request extends AbstractRequest { @@ -38,7 +37,7 @@ public class GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request exten private final List objects; - private String storageDomainId; + private String storageDomain; private long size = 0; // Constructor @@ -53,16 +52,9 @@ public GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request(final Strin this.getQueryParams().put("full_details", null); } - public GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); - return this; - } - - - public GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } @@ -78,7 +70,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -108,8 +100,8 @@ public List getObjects() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java index 87b0416a2..fb6611617 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Request.java index f290c8ac8..d56f145f5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.PoolFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Response.java index 1109e51df..9df65eb07 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Request.java index 6b27d56fe..519eb38c8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetPoolPartitionSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Response.java index 8ba7424ed..d745809b3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Request.java index 16d42dedb..44b31ae27 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.PoolType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Response.java index ccb4b2a8c..3edd77749 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolPartitionsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Request.java index 1a486c626..e01c621c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Response.java index 03fcae0b4..7a1f6ab57 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Request.java index 730e861c3..786d9ac78 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.PoolHealth; import java.util.Date; import java.util.UUID; @@ -33,6 +32,8 @@ public class GetPoolsSpectraS3Request extends AbstractPaginationRequest { private String bucketId; + private String guid; + private PoolHealth health; private boolean lastPage; @@ -53,7 +54,7 @@ public class GetPoolsSpectraS3Request extends AbstractPaginationRequest { private PoolState state; - private String storageDomainId; + private String storageDomainMemberId; private PoolType type; @@ -78,6 +79,13 @@ public GetPoolsSpectraS3Request withBucketId(final String bucketId) { } + public GetPoolsSpectraS3Request withGuid(final String guid) { + this.guid = guid; + this.updateQueryParam("guid", guid); + return this; + } + + public GetPoolsSpectraS3Request withHealth(final PoolHealth health) { this.health = health; this.updateQueryParam("health", health); @@ -166,16 +174,16 @@ public GetPoolsSpectraS3Request withState(final PoolState state) { } - public GetPoolsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetPoolsSpectraS3Request withStorageDomainMemberId(final UUID storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId.toString(); + this.updateQueryParam("storage_domain_member_id", storageDomainMemberId); return this; } - public GetPoolsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetPoolsSpectraS3Request withStorageDomainMemberId(final String storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId; + this.updateQueryParam("storage_domain_member_id", storageDomainMemberId); return this; } @@ -208,6 +216,11 @@ public String getBucketId() { } + public String getGuid() { + return this.guid; + } + + public PoolHealth getHealth() { return this.health; } @@ -258,8 +271,8 @@ public PoolState getState() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomainMemberId() { + return this.storageDomainMemberId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Response.java index 6e4b612db..c57df23fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Request.java index f359dfca8..7a6153f2a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetS3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Response.java index d7b8af749..969edd594 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Request.java index 1d64c8ed6..6047ac042 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.S3InitialDataPlacementPolicy; import com.spectralogic.ds3client.models.DataPlacementRuleState; import com.spectralogic.ds3client.models.DataReplicationRuleType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Response.java index f1a3382e8..12e0c2dfb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3DataReplicationRulesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Request.java index 18bae1d93..789df3f67 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetS3TargetBucketNamesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Response.java index b5b775c8b..932f5e0d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetBucketNamesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Request.java index ea67fe9c9..89c3f0577 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetS3TargetFailureNotificationRegistrationSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Response.java index 32743c831..ce25088c9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Request.java index 3c4cf7566..df0251024 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetS3TargetFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Response.java index 4d5b82515..012e71b46 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Request.java index ae151b50b..36a58ec3a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Response.java index 1e9ff0ecd..a2526ac11 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Request.java index 26d78f6d0..1c7d5b2a8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetS3TargetReadPreferenceSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Response.java index bd594a752..d95dc6190 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Request.java index e854a2195..3b7de6e9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TargetReadPreferenceType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Response.java index 89a72b586..c0b7edcee 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetReadPreferencesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Request.java index ada1c2fe6..8f365a198 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetS3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Response.java index 46cb5c54b..82e28b479 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Request.java index 3b9312f25..d26d850c5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,8 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.TargetReadPreferenceType; +import com.spectralogic.ds3client.models.CloudNamingMode; import java.util.UUID; import com.spectralogic.ds3client.models.Quiesced; import com.spectralogic.ds3client.models.S3Region; @@ -41,6 +41,8 @@ public class GetS3TargetsSpectraS3Request extends AbstractPaginationRequest { private String name; + private CloudNamingMode namingMode; + private int pageLength; private int pageOffset; @@ -108,6 +110,13 @@ public GetS3TargetsSpectraS3Request withName(final String name) { } + public GetS3TargetsSpectraS3Request withNamingMode(final CloudNamingMode namingMode) { + this.namingMode = namingMode; + this.updateQueryParam("naming_mode", namingMode); + return this; + } + + public GetS3TargetsSpectraS3Request withPageLength(final int pageLength) { this.pageLength = pageLength; this.updateQueryParam("page_length", pageLength); @@ -205,6 +214,11 @@ public String getName() { } + public CloudNamingMode getNamingMode() { + return this.namingMode; + } + + public int getPageLength() { return this.pageLength; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Response.java index e139dd4bc..5838851ef 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetS3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Request.java index ebc8b972b..7a4dc9879 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,12 +19,10 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.PoolHealth; import com.spectralogic.ds3client.models.PoolState; import com.spectralogic.ds3client.models.PoolType; import com.spectralogic.ds3client.models.TapeState; -import com.spectralogic.ds3client.models.TapeType; public class GetStorageDomainCapacitySummarySpectraS3Request extends AbstractRequest { @@ -40,7 +38,7 @@ public class GetStorageDomainCapacitySummarySpectraS3Request extends AbstractReq private TapeState tapeState; - private TapeType tapeType; + private String tapeType; // Constructor @@ -48,14 +46,16 @@ public class GetStorageDomainCapacitySummarySpectraS3Request extends AbstractReq public GetStorageDomainCapacitySummarySpectraS3Request(final UUID storageDomainId) { this.storageDomainId = storageDomainId.toString(); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); + this.updateQueryParam("storage_domain_id", storageDomainId); + } public GetStorageDomainCapacitySummarySpectraS3Request(final String storageDomainId) { this.storageDomainId = storageDomainId; - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); + this.updateQueryParam("storage_domain_id", storageDomainId); + } public GetStorageDomainCapacitySummarySpectraS3Request withPoolHealth(final PoolHealth poolHealth) { @@ -86,7 +86,7 @@ public GetStorageDomainCapacitySummarySpectraS3Request withTapeState(final TapeS } - public GetStorageDomainCapacitySummarySpectraS3Request withTapeType(final TapeType tapeType) { + public GetStorageDomainCapacitySummarySpectraS3Request withTapeType(final String tapeType) { this.tapeType = tapeType; this.updateQueryParam("tape_type", tapeType); return this; @@ -129,7 +129,7 @@ public TapeState getTapeState() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Response.java index 8ac5f8c11..9659ee573 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainCapacitySummarySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Request.java index 6058e6009..6c0915ce1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.StorageDomainFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Response.java index 802c06e6c..76d649926 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Request.java index 19e83b6bd..541e6f7bf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetStorageDomainMemberSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Response.java index 04253a679..4dd4832db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Request.java index 158978d0f..ed4852eaf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.StorageDomainMemberState; -import com.spectralogic.ds3client.models.TapeType; import com.spectralogic.ds3client.models.WritePreferenceLevel; public class GetStorageDomainMembersSpectraS3Request extends AbstractPaginationRequest { @@ -44,7 +42,7 @@ public class GetStorageDomainMembersSpectraS3Request extends AbstractPaginationR private String tapePartitionId; - private TapeType tapeType; + private String tapeType; private WritePreferenceLevel writePreference; @@ -143,7 +141,7 @@ public GetStorageDomainMembersSpectraS3Request withTapePartitionId(final String } - public GetStorageDomainMembersSpectraS3Request withTapeType(final TapeType tapeType) { + public GetStorageDomainMembersSpectraS3Request withTapeType(final String tapeType) { this.tapeType = tapeType; this.updateQueryParam("tape_type", tapeType); return this; @@ -208,7 +206,7 @@ public String getTapePartitionId() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Response.java index cd7f093af..cc34bb825 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainMembersSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Request.java index 746583850..9ee05eecb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetStorageDomainSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Response.java index cf7144722..0a7129ad2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Request.java index c5675c95f..0e1e3bc31 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.WriteOptimization; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Response.java index 02bcc279f..44a159668 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetStorageDomainsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Request.java index f9a1b85fe..44a0430d9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBlobAzureTargetsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Response.java index d05384119..a06e0ae51 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobAzureTargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Request.java index d508dbe2b..7cb56dc24 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBlobDs3TargetsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Response.java index 12d34c922..242156a22 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobDs3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Request.java index 5d129daf6..a5ccfcabf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBlobPoolsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Response.java index 19cfe12c4..880566944 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Request.java index 3979baf18..c6939c070 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBlobS3TargetsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Response.java index 390a41f3f..facafecd8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobS3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Request.java index fd56916fc..76efbecd6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBlobTapesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Response.java index 15b39ce85..40afbd3b4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBlobTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Request.java index a6579fcf3..13e32b2d4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSuspectBucketsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Response.java index b9c6edc0c..28b9fcebb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectBucketsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Request.java index 7f3b53a97..8245807d9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetSuspectObjectsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Response.java index 41c2ebcc1..0f734d491 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Request.java index 3622a162a..b5c96e9cf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; -import java.util.UUID; public class GetSuspectObjectsWithFullDetailsSpectraS3Request extends AbstractRequest { @@ -27,7 +25,7 @@ public class GetSuspectObjectsWithFullDetailsSpectraS3Request extends AbstractRe private String bucketId; - private String storageDomainId; + private String storageDomain; // Constructor @@ -44,16 +42,9 @@ public GetSuspectObjectsWithFullDetailsSpectraS3Request withBucketId(final Strin } - public GetSuspectObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); - return this; - } - - - public GetSuspectObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetSuspectObjectsWithFullDetailsSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } @@ -74,8 +65,8 @@ public String getBucketId() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Response.java index a0cd2c576..1f056ef0c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSuspectObjectsWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Request.java index 20d144d05..30573de18 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -22,7 +22,6 @@ import com.spectralogic.ds3client.models.PoolState; import com.spectralogic.ds3client.models.PoolType; import com.spectralogic.ds3client.models.TapeState; -import com.spectralogic.ds3client.models.TapeType; public class GetSystemCapacitySummarySpectraS3Request extends AbstractRequest { @@ -36,7 +35,7 @@ public class GetSystemCapacitySummarySpectraS3Request extends AbstractRequest { private TapeState tapeState; - private TapeType tapeType; + private String tapeType; // Constructor @@ -73,7 +72,7 @@ public GetSystemCapacitySummarySpectraS3Request withTapeState(final TapeState ta } - public GetSystemCapacitySummarySpectraS3Request withTapeType(final TapeType tapeType) { + public GetSystemCapacitySummarySpectraS3Request withTapeType(final String tapeType) { this.tapeType = tapeType; this.updateQueryParam("tape_type", tapeType); return this; @@ -111,7 +110,7 @@ public TapeState getTapeState() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Response.java index ff5a66118..609f23e49 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemCapacitySummarySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Request.java index a4e3fa6c3..f271940a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.SystemFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Response.java index 244c1f790..36b006bc7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Request.java index a7be5c7e6..2d3c5e741 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Response.java index d984eab78..b3837e160 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetSystemInformationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Request.java index d247f23d3..117f16e78 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetTapeDensityDirectiveSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Response.java index 248e3ee01..06fe6477d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectiveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Request.java index 11d69f24e..834f0ec03 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import com.spectralogic.ds3client.models.TapeDriveType; import java.util.UUID; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.TapeType; public class GetTapeDensityDirectivesSpectraS3Request extends AbstractPaginationRequest { @@ -39,7 +37,7 @@ public class GetTapeDensityDirectivesSpectraS3Request extends AbstractPagination private String partitionId; - private TapeType tapeType; + private String tapeType; // Constructor @@ -108,7 +106,7 @@ public GetTapeDensityDirectivesSpectraS3Request withPartitionId(final String par } - public GetTapeDensityDirectivesSpectraS3Request withTapeType(final TapeType tapeType) { + public GetTapeDensityDirectivesSpectraS3Request withTapeType(final String tapeType) { this.tapeType = tapeType; this.updateQueryParam("tape_type", tapeType); return this; @@ -156,7 +154,7 @@ public String getPartitionId() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Response.java index 89f70a9ad..72a9da9fe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDensityDirectivesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Request.java index 62784f620..966104e1e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetTapeDriveSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Response.java index 4feb35168..256ea13d8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDriveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Request.java index 3480caaa4..84ff04f0a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; +import com.spectralogic.ds3client.models.Priority; import java.util.UUID; -import com.google.common.net.UrlEscapers; +import com.spectralogic.ds3client.models.ReservedTaskType; import com.spectralogic.ds3client.models.TapeDriveState; import com.spectralogic.ds3client.models.TapeDriveType; @@ -29,6 +30,8 @@ public class GetTapeDrivesSpectraS3Request extends AbstractPaginationRequest { private boolean lastPage; + private Priority minimumTaskPriority; + private int pageLength; private int pageOffset; @@ -37,6 +40,8 @@ public class GetTapeDrivesSpectraS3Request extends AbstractPaginationRequest { private String partitionId; + private ReservedTaskType reservedTaskType; + private String serialNumber; private TapeDriveState state; @@ -61,6 +66,13 @@ public GetTapeDrivesSpectraS3Request withLastPage(final boolean lastPage) { } + public GetTapeDrivesSpectraS3Request withMinimumTaskPriority(final Priority minimumTaskPriority) { + this.minimumTaskPriority = minimumTaskPriority; + this.updateQueryParam("minimum_task_priority", minimumTaskPriority); + return this; + } + + public GetTapeDrivesSpectraS3Request withPageLength(final int pageLength) { this.pageLength = pageLength; this.updateQueryParam("page_length", pageLength); @@ -103,6 +115,13 @@ public GetTapeDrivesSpectraS3Request withPartitionId(final String partitionId) { } + public GetTapeDrivesSpectraS3Request withReservedTaskType(final ReservedTaskType reservedTaskType) { + this.reservedTaskType = reservedTaskType; + this.updateQueryParam("reserved_task_type", reservedTaskType); + return this; + } + + public GetTapeDrivesSpectraS3Request withSerialNumber(final String serialNumber) { this.serialNumber = serialNumber; this.updateQueryParam("serial_number", serialNumber); @@ -140,6 +159,11 @@ public boolean getLastPage() { } + public Priority getMinimumTaskPriority() { + return this.minimumTaskPriority; + } + + public int getPageLength() { return this.pageLength; } @@ -160,6 +184,11 @@ public String getPartitionId() { } + public ReservedTaskType getReservedTaskType() { + return this.reservedTaskType; + } + + public String getSerialNumber() { return this.serialNumber; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Response.java index 6d8a6301d..430360e28 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeDrivesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Request.java index da5b7f294..e3c8598e6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TapeFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Response.java index 97d326e2b..3dc6bd0f8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Request.java index e248c1eaa..8b0c831c8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetTapeLibrariesSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Response.java index a994994b1..03175555e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrariesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Request.java index 2d1df5beb..90cff92a0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetTapeLibrarySpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Response.java index 2e393edae..5519b8f29 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeLibrarySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Request.java index 26d68532f..a2cd106de 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.TapePartitionFailureType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Response.java index c5df5d071..21beb3497 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionFailuresSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Request.java index 0cdd21c5d..23f25128a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetTapePartitionSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Response.java index 4bf5f1a18..a60b87f90 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Request.java index bbfbc6711..3c2dd50d7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class GetTapePartitionWithFullDetailsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Response.java index 025c98074..02f010e9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Request.java index d79ecdd6c..405e5ac3e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import com.spectralogic.ds3client.models.ImportExportConfiguration; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Quiesced; import com.spectralogic.ds3client.models.TapePartitionState; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Response.java index e471f814e..edf1ea990 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Request.java index cfe0207c6..4fc2eb6f8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import com.spectralogic.ds3client.models.ImportExportConfiguration; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Quiesced; import com.spectralogic.ds3client.models.TapePartitionState; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Response.java index a2ad1703b..c63594510 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapePartitionsWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Request.java index 9e9da94f1..a7e83a2e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Response.java index 36d7f24bb..d78377c06 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Request.java index 11e205f88..8660b20ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,11 +19,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.lang.Long; -import com.google.common.net.UrlEscapers; import java.util.Date; import java.util.UUID; import com.spectralogic.ds3client.models.TapeState; -import com.spectralogic.ds3client.models.TapeType; import com.spectralogic.ds3client.models.Priority; public class GetTapesSpectraS3Request extends AbstractPaginationRequest { @@ -36,6 +34,8 @@ public class GetTapesSpectraS3Request extends AbstractPaginationRequest { private String barCode; + private String bucket; + private String bucketId; private String ejectLabel; @@ -56,17 +56,23 @@ public class GetTapesSpectraS3Request extends AbstractPaginationRequest { private Date partiallyVerifiedEndOfTape; + private String partition; + private String partitionId; private TapeState previousState; private String serialNumber; + private String sortBy; + private TapeState state; - private String storageDomainId; + private String storageDomain; + + private String storageDomainMemberId; - private TapeType type; + private String type; private Priority verifyPending; @@ -100,6 +106,13 @@ public GetTapesSpectraS3Request withBarCode(final String barCode) { } + public GetTapesSpectraS3Request withBucket(final String bucket) { + this.bucket = bucket; + this.updateQueryParam("bucket", bucket); + return this; + } + + public GetTapesSpectraS3Request withBucketId(final String bucketId) { this.bucketId = bucketId; this.updateQueryParam("bucket_id", bucketId); @@ -181,6 +194,13 @@ public GetTapesSpectraS3Request withPartiallyVerifiedEndOfTape(final Date partia } + public GetTapesSpectraS3Request withPartition(final String partition) { + this.partition = partition; + this.updateQueryParam("partition", partition); + return this; + } + + public GetTapesSpectraS3Request withPartitionId(final UUID partitionId) { this.partitionId = partitionId.toString(); this.updateQueryParam("partition_id", partitionId); @@ -209,6 +229,13 @@ public GetTapesSpectraS3Request withSerialNumber(final String serialNumber) { } + public GetTapesSpectraS3Request withSortBy(final String sortBy) { + this.sortBy = sortBy; + this.updateQueryParam("sort_by", sortBy); + return this; + } + + public GetTapesSpectraS3Request withState(final TapeState state) { this.state = state; this.updateQueryParam("state", state); @@ -216,21 +243,28 @@ public GetTapesSpectraS3Request withState(final TapeState state) { } - public GetTapesSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetTapesSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } - public GetTapesSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public GetTapesSpectraS3Request withStorageDomainMemberId(final UUID storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId.toString(); + this.updateQueryParam("storage_domain_member_id", storageDomainMemberId); return this; } - public GetTapesSpectraS3Request withType(final TapeType type) { + public GetTapesSpectraS3Request withStorageDomainMemberId(final String storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId; + this.updateQueryParam("storage_domain_member_id", storageDomainMemberId); + return this; + } + + + public GetTapesSpectraS3Request withType(final String type) { this.type = type; this.updateQueryParam("type", type); return this; @@ -277,6 +311,11 @@ public String getBarCode() { } + public String getBucket() { + return this.bucket; + } + + public String getBucketId() { return this.bucketId; } @@ -327,6 +366,11 @@ public Date getPartiallyVerifiedEndOfTape() { } + public String getPartition() { + return this.partition; + } + + public String getPartitionId() { return this.partitionId; } @@ -342,17 +386,27 @@ public String getSerialNumber() { } + public String getSortBy() { + return this.sortBy; + } + + public TapeState getState() { return this.state; } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; + } + + + public String getStorageDomainMemberId() { + return this.storageDomainMemberId; } - public TapeType getType() { + public String getType() { return this.type; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Response.java index 26dd6f3f0..24dfa2c81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Request.java index 47fe03510..e8b7a3268 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetUserSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Response.java index 82612e9ea..e9393bc87 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Request.java index 5ab5166f8..1a7e71bd0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class GetUsersSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Response.java index eb37c6536..22165820c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/GetUsersSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Request.java index d9e13c021..5cdfe73b0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,17 +18,13 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class ImportAllPoolsSpectraS3Request extends AbstractRequest { // Variables - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -50,13 +46,6 @@ public ImportAllPoolsSpectraS3Request() { } - public ImportAllPoolsSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; - } - - public ImportAllPoolsSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -131,11 +120,6 @@ public String getPath() { return "/_rest_/pool"; } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Response.java index c544c2aa8..376d3cbb2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Request.java index d7c174b90..21581c626 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,17 +18,13 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class ImportAllTapesSpectraS3Request extends AbstractRequest { // Variables - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -50,13 +46,6 @@ public ImportAllTapesSpectraS3Request() { } - public ImportAllTapesSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; - } - - public ImportAllTapesSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -131,11 +120,6 @@ public String getPath() { return "/_rest_/tape"; } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Response.java index 308905461..f86773818 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Request.java index f7167b6f4..de3ed0d00 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; import com.spectralogic.ds3client.models.Priority; @@ -31,8 +29,6 @@ public class ImportAzureTargetSpectraS3Request extends AbstractRequest { private final String cloudBucketName; - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -48,16 +44,10 @@ public ImportAzureTargetSpectraS3Request(final String azureTarget, final String this.getQueryParams().put("operation", "import"); - this.getQueryParams().put("cloud_bucket_name", UrlEscapers.urlFragmentEscaper().escape(cloudBucketName).replace("+", "%2B")); - } + this.updateQueryParam("cloud_bucket_name", cloudBucketName); - public ImportAzureTargetSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; } - public ImportAzureTargetSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -114,11 +104,6 @@ public String getCloudBucketName() { } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Response.java index 8911bf469..1425d9ee0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Request.java index 4adf8a55b..20e220059 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class ImportPoolSpectraS3Request extends AbstractRequest { @@ -29,8 +27,6 @@ public class ImportPoolSpectraS3Request extends AbstractRequest { private final String pool; - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -53,13 +49,6 @@ public ImportPoolSpectraS3Request(final String pool) { } - public ImportPoolSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; - } - - public ImportPoolSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -139,11 +128,6 @@ public String getPool() { } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Response.java index 0ef8493dd..23d775f98 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Request.java index 1d9e4e886..7ae92c002 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; import com.spectralogic.ds3client.models.Priority; @@ -31,8 +29,6 @@ public class ImportS3TargetSpectraS3Request extends AbstractRequest { private final String cloudBucketName; - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -48,16 +44,10 @@ public ImportS3TargetSpectraS3Request(final String cloudBucketName, final String this.getQueryParams().put("operation", "import"); - this.getQueryParams().put("cloud_bucket_name", UrlEscapers.urlFragmentEscaper().escape(cloudBucketName).replace("+", "%2B")); - } + this.updateQueryParam("cloud_bucket_name", cloudBucketName); - public ImportS3TargetSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; } - public ImportS3TargetSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -114,11 +104,6 @@ public String getCloudBucketName() { } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Response.java index 484311bed..5493176cc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Request.java index dc8bfd7f7..5322fb1fa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class ImportTapeSpectraS3Request extends AbstractRequest { @@ -29,8 +27,6 @@ public class ImportTapeSpectraS3Request extends AbstractRequest { private final String tapeId; - private ImportConflictResolutionMode conflictResolutionMode; - private String dataPolicyId; private Priority priority; @@ -61,13 +57,6 @@ public ImportTapeSpectraS3Request(final String tapeId) { } - public ImportTapeSpectraS3Request withConflictResolutionMode(final ImportConflictResolutionMode conflictResolutionMode) { - this.conflictResolutionMode = conflictResolutionMode; - this.updateQueryParam("conflict_resolution_mode", conflictResolutionMode); - return this; - } - - public ImportTapeSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { this.dataPolicyId = dataPolicyId.toString(); this.updateQueryParam("data_policy_id", dataPolicyId); @@ -147,11 +136,6 @@ public String getTapeId() { } - public ImportConflictResolutionMode getConflictResolutionMode() { - return this.conflictResolutionMode; - } - - public String getDataPolicyId() { return this.dataPolicyId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Response.java index 29a9bbceb..09796222e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ImportTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Request.java index 8b4a4eeef..d7c73e021 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Response.java index c7fc6972a..c9dc73ee6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Request.java index f5cdb1c85..d09e9563c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Priority; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class InspectTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Response.java index 4c9cb59ae..eeabb167a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/InspectTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request.java index 6bf269469..ea13bcc4e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request extends Abstr // Constructor - - public MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request() { + public MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Response.java index 0c207312d..1069dabea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request.java index be8b21f0e..32042ba90 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request extends Abstrac // Constructor - - public MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request() { + public MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Response.java index 417d83b3d..d54fecccf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Request.java index 24754359e..7e9e429ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class MarkSuspectBlobPoolsAsDegradedSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class MarkSuspectBlobPoolsAsDegradedSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class MarkSuspectBlobPoolsAsDegradedSpectraS3Request extends AbstractRequ // Constructor - - public MarkSuspectBlobPoolsAsDegradedSpectraS3Request() { + public MarkSuspectBlobPoolsAsDegradedSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Response.java index 4decd6d81..7413ba02c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobPoolsAsDegradedSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request.java index 8410e7b2e..22acf41c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request extends Abstract // Constructor - - public MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request() { + public MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Response.java index b12d79664..6ddd2c59f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobS3TargetsAsDegradedSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Request.java index f6687cc3a..3833eddf2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,9 +17,11 @@ package com.spectralogic.ds3client.commands.spectrads3; import com.spectralogic.ds3client.networking.HttpVerb; -import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest; -public class MarkSuspectBlobTapesAsDegradedSpectraS3Request extends AbstractRequest { +import java.util.List; + +public class MarkSuspectBlobTapesAsDegradedSpectraS3Request extends AbstractIdsPayloadRequest { // Variables @@ -27,8 +29,8 @@ public class MarkSuspectBlobTapesAsDegradedSpectraS3Request extends AbstractRequ // Constructor - - public MarkSuspectBlobTapesAsDegradedSpectraS3Request() { + public MarkSuspectBlobTapesAsDegradedSpectraS3Request(final List ids) { + super(ids); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Response.java index 95c3d7b1e..745171b83 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkSuspectBlobTapesAsDegradedSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Request.java new file mode 100644 index 000000000..18950c892 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Request.java @@ -0,0 +1,62 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class MarkTapeForCompactionSpectraS3Request extends AbstractRequest { + + // Variables + + private final String tapeId; + + // Constructor + + + public MarkTapeForCompactionSpectraS3Request(final UUID tapeId) { + this.tapeId = tapeId.toString(); + + this.getQueryParams().put("operation", "mark_for_compaction"); + + } + + + public MarkTapeForCompactionSpectraS3Request(final String tapeId) { + this.tapeId = tapeId; + + this.getQueryParams().put("operation", "mark_for_compaction"); + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/tape/" + tapeId; + } + + public String getTapeId() { + return this.tapeId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Response.java new file mode 100644 index 000000000..9b6782e0b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.Tape; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class MarkTapeForCompactionSpectraS3Response extends AbstractResponse { + + private final Tape tapeResult; + + public MarkTapeForCompactionSpectraS3Response(final Tape tapeResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.tapeResult = tapeResult; + } + + public Tape getTapeResult() { + return this.tapeResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Request.java index f1c9bbe3f..46278919c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.Date; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; import java.util.UUID; @@ -31,10 +30,14 @@ public class ModifyActiveJobSpectraS3Request extends AbstractRequest { private Date createdAt; + private boolean deadJobCleanupAllowed; + private String name; private Priority priority; + private boolean protectedFlag; + // Constructor @@ -56,6 +59,13 @@ public ModifyActiveJobSpectraS3Request withCreatedAt(final Date createdAt) { } + public ModifyActiveJobSpectraS3Request withDeadJobCleanupAllowed(final boolean deadJobCleanupAllowed) { + this.deadJobCleanupAllowed = deadJobCleanupAllowed; + this.updateQueryParam("dead_job_cleanup_allowed", deadJobCleanupAllowed); + return this; + } + + public ModifyActiveJobSpectraS3Request withName(final String name) { this.name = name; this.updateQueryParam("name", name); @@ -70,6 +80,13 @@ public ModifyActiveJobSpectraS3Request withPriority(final Priority priority) { } + public ModifyActiveJobSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + @Override public HttpVerb getVerb() { @@ -91,6 +108,11 @@ public Date getCreatedAt() { } + public boolean getDeadJobCleanupAllowed() { + return this.deadJobCleanupAllowed; + } + + public String getName() { return this.name; } @@ -100,4 +122,9 @@ public Priority getPriority() { return this.priority; } + + public boolean getProtected() { + return this.protectedFlag; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Response.java index 6acf0182f..d454194ed 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyActiveJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Request.java index 47ebe6827..decd81d73 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,8 @@ public class ModifyAllAzureTargetsSpectraS3Request extends AbstractRequest { public ModifyAllAzureTargetsSpectraS3Request(final Quiesced quiesced) { this.quiesced = quiesced; - this.getQueryParams().put("quiesced", quiesced.toString()); + this.updateQueryParam("quiesced", quiesced); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Response.java index 142c331db..e92c49fdf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllAzureTargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Request.java index c3acd9f07..08c72a3b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,8 @@ public class ModifyAllDs3TargetsSpectraS3Request extends AbstractRequest { public ModifyAllDs3TargetsSpectraS3Request(final Quiesced quiesced) { this.quiesced = quiesced; - this.getQueryParams().put("quiesced", quiesced.toString()); + this.updateQueryParam("quiesced", quiesced); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Response.java index 1f0275c94..7b3be09aa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllDs3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Request.java index 6046b865b..52ad90d3e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,8 @@ public class ModifyAllPoolsSpectraS3Request extends AbstractRequest { public ModifyAllPoolsSpectraS3Request(final Quiesced quiesced) { this.quiesced = quiesced; - this.getQueryParams().put("quiesced", quiesced.toString()); + this.updateQueryParam("quiesced", quiesced); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Response.java index a8bbeaf8a..bc2c3092f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Request.java index 2b5b8b8b5..9e0f6688e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,8 @@ public class ModifyAllS3TargetsSpectraS3Request extends AbstractRequest { public ModifyAllS3TargetsSpectraS3Request(final Quiesced quiesced) { this.quiesced = quiesced; - this.getQueryParams().put("quiesced", quiesced.toString()); + this.updateQueryParam("quiesced", quiesced); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Response.java index 3e2339710..36239f833 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllS3TargetsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Request.java index b5f209c3f..e006d8555 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,8 @@ public class ModifyAllTapePartitionsSpectraS3Request extends AbstractRequest { public ModifyAllTapePartitionsSpectraS3Request(final Quiesced quiesced) { this.quiesced = quiesced; - this.getQueryParams().put("quiesced", quiesced.toString()); + this.updateQueryParam("quiesced", quiesced); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Response.java index 29a7c3c7e..7ffa1e9e9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAllTapePartitionsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Request.java index 6cf8ce767..737c8e25c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.DataReplicationRuleType; -import com.google.common.net.UrlEscapers; public class ModifyAzureDataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Response.java index 2224c2dae..66736e4b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureDataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Request.java index 72f6ac3ad..6ae86debc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import com.spectralogic.ds3client.models.Quiesced; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Response.java index 583793be9..f99257038 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Request.java index 14aaab17d..e06f40e56 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class ModifyBucketSpectraS3Request extends AbstractRequest { @@ -29,6 +28,8 @@ public class ModifyBucketSpectraS3Request extends AbstractRequest { private String dataPolicyId; + private boolean protectedFlag; + private String userId; // Constructor @@ -53,6 +54,13 @@ public ModifyBucketSpectraS3Request withDataPolicyId(final String dataPolicyId) } + public ModifyBucketSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + public ModifyBucketSpectraS3Request withUserId(final UUID userId) { this.userId = userId.toString(); this.updateQueryParam("user_id", userId); @@ -88,6 +96,11 @@ public String getDataPolicyId() { } + public boolean getProtected() { + return this.protectedFlag; + } + + public String getUserId() { return this.userId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Response.java index 115c2e525..ce15ddbbb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyBucketSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Request.java index 6b46bd6fe..94cfef774 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.lang.Long; -import com.google.common.net.UrlEscapers; public class ModifyCacheFilesystemSpectraS3Request extends AbstractRequest { @@ -33,8 +32,12 @@ public class ModifyCacheFilesystemSpectraS3Request extends AbstractRequest { private double burstThreshold; + private boolean cacheSafetyEnabled; + private Long maxCapacityInBytes; + private boolean needsReconcile; + // Constructor @@ -64,6 +67,13 @@ public ModifyCacheFilesystemSpectraS3Request withBurstThreshold(final double bur } + public ModifyCacheFilesystemSpectraS3Request withCacheSafetyEnabled(final boolean cacheSafetyEnabled) { + this.cacheSafetyEnabled = cacheSafetyEnabled; + this.updateQueryParam("cache_safety_enabled", cacheSafetyEnabled); + return this; + } + + public ModifyCacheFilesystemSpectraS3Request withMaxCapacityInBytes(final Long maxCapacityInBytes) { this.maxCapacityInBytes = maxCapacityInBytes; this.updateQueryParam("max_capacity_in_bytes", maxCapacityInBytes); @@ -71,6 +81,13 @@ public ModifyCacheFilesystemSpectraS3Request withMaxCapacityInBytes(final Long m } + public ModifyCacheFilesystemSpectraS3Request withNeedsReconcile(final boolean needsReconcile) { + this.needsReconcile = needsReconcile; + this.updateQueryParam("needs_reconcile", needsReconcile); + return this; + } + + @Override public HttpVerb getVerb() { @@ -102,8 +119,18 @@ public double getBurstThreshold() { } + public boolean getCacheSafetyEnabled() { + return this.cacheSafetyEnabled; + } + + public Long getMaxCapacityInBytes() { return this.maxCapacityInBytes; } + + public boolean getNeedsReconcile() { + return this.needsReconcile; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Response.java index e10957725..ddcba2ea9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheFilesystemSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Request.java new file mode 100644 index 000000000..3cf9da5c3 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Request.java @@ -0,0 +1,124 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.lang.Double; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.models.JobRequestType; + +public class ModifyCacheThrottleRuleSpectraS3Request extends AbstractRequest { + + // Variables + + private final String cacheThrottleRule; + + private String bucketId; + + private Double burstThreshold; + + private double maxCachePercent; + + private Priority priority; + + private JobRequestType requestType; + + // Constructor + + + public ModifyCacheThrottleRuleSpectraS3Request(final String cacheThrottleRule) { + this.cacheThrottleRule = cacheThrottleRule; + + } + + public ModifyCacheThrottleRuleSpectraS3Request withBucketId(final String bucketId) { + this.bucketId = bucketId; + this.updateQueryParam("bucket_id", bucketId); + return this; + } + + + public ModifyCacheThrottleRuleSpectraS3Request withBurstThreshold(final Double burstThreshold) { + this.burstThreshold = burstThreshold; + this.updateQueryParam("burst_threshold", burstThreshold); + return this; + } + + + public ModifyCacheThrottleRuleSpectraS3Request withMaxCachePercent(final double maxCachePercent) { + this.maxCachePercent = maxCachePercent; + this.updateQueryParam("max_cache_percent", maxCachePercent); + return this; + } + + + public ModifyCacheThrottleRuleSpectraS3Request withPriority(final Priority priority) { + this.priority = priority; + this.updateQueryParam("priority", priority); + return this; + } + + + public ModifyCacheThrottleRuleSpectraS3Request withRequestType(final JobRequestType requestType) { + this.requestType = requestType; + this.updateQueryParam("request_type", requestType); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/cache_throttle_rule/" + cacheThrottleRule; + } + + public String getCacheThrottleRule() { + return this.cacheThrottleRule; + } + + + public String getBucketId() { + return this.bucketId; + } + + + public Double getBurstThreshold() { + return this.burstThreshold; + } + + + public double getMaxCachePercent() { + return this.maxCachePercent; + } + + + public Priority getPriority() { + return this.priority; + } + + + public JobRequestType getRequestType() { + return this.requestType; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Response.java similarity index 60% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Response.java index f9f6093aa..f4157865b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadsResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyCacheThrottleRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,23 +14,23 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; -import com.spectralogic.ds3client.models.ListMultiPartUploadsResult; +import com.spectralogic.ds3client.models.CacheThrottleRule; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class ListMultiPartUploadsResponse extends AbstractResponse { +public class ModifyCacheThrottleRuleSpectraS3Response extends AbstractResponse { - private final ListMultiPartUploadsResult listMultiPartUploadsResult; + private final CacheThrottleRule cacheThrottleRuleResult; - public ListMultiPartUploadsResponse(final ListMultiPartUploadsResult listMultiPartUploadsResult, final String checksum, final ChecksumType.Type checksumType) { + public ModifyCacheThrottleRuleSpectraS3Response(final CacheThrottleRule cacheThrottleRuleResult, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); - this.listMultiPartUploadsResult = listMultiPartUploadsResult; + this.cacheThrottleRuleResult = cacheThrottleRuleResult; } - public ListMultiPartUploadsResult getListMultiPartUploadsResult() { - return this.listMultiPartUploadsResult; + public CacheThrottleRule getCacheThrottleRuleResult() { + return this.cacheThrottleRuleResult; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Request.java index c6fb0ff64..4fecfa487 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.lang.Integer; import com.spectralogic.ds3client.models.AutoInspectMode; -import com.spectralogic.ds3client.models.ImportConflictResolutionMode; import com.spectralogic.ds3client.models.Priority; import com.spectralogic.ds3client.models.UnavailableMediaUsagePolicy; @@ -30,24 +29,40 @@ public class ModifyDataPathBackendSpectraS3Request extends AbstractRequest { private boolean activated; + private boolean allowNewJobRequests; + + private boolean alwaysRollback; + private Integer autoActivateTimeoutInMins; private AutoInspectMode autoInspect; - private ImportConflictResolutionMode defaultImportConflictResolutionMode; + private int cacheAvailableRetryAfterInSeconds; private Priority defaultVerifyDataAfterImport; private boolean defaultVerifyDataPriorToImport; + private double iomCacheLimitationPercent; + + private boolean iomEnabled; + + private int maxAggregatedBlobsPerChunk; + + private int maxNumberOfConcurrentJobs; + private Integer partiallyVerifyLastPercentOfTapes; + private boolean poolSafetyEnabled; + private UnavailableMediaUsagePolicy unavailableMediaPolicy; private int unavailablePoolMaxJobRetryInMins; private int unavailableTapePartitionMaxJobRetryInMins; + private boolean verifyCheckpointBeforeRead; + // Constructor @@ -62,6 +77,20 @@ public ModifyDataPathBackendSpectraS3Request withActivated(final boolean activat } + public ModifyDataPathBackendSpectraS3Request withAllowNewJobRequests(final boolean allowNewJobRequests) { + this.allowNewJobRequests = allowNewJobRequests; + this.updateQueryParam("allow_new_job_requests", allowNewJobRequests); + return this; + } + + + public ModifyDataPathBackendSpectraS3Request withAlwaysRollback(final boolean alwaysRollback) { + this.alwaysRollback = alwaysRollback; + this.updateQueryParam("always_rollback", alwaysRollback); + return this; + } + + public ModifyDataPathBackendSpectraS3Request withAutoActivateTimeoutInMins(final Integer autoActivateTimeoutInMins) { this.autoActivateTimeoutInMins = autoActivateTimeoutInMins; this.updateQueryParam("auto_activate_timeout_in_mins", autoActivateTimeoutInMins); @@ -76,9 +105,9 @@ public ModifyDataPathBackendSpectraS3Request withAutoInspect(final AutoInspectMo } - public ModifyDataPathBackendSpectraS3Request withDefaultImportConflictResolutionMode(final ImportConflictResolutionMode defaultImportConflictResolutionMode) { - this.defaultImportConflictResolutionMode = defaultImportConflictResolutionMode; - this.updateQueryParam("default_import_conflict_resolution_mode", defaultImportConflictResolutionMode); + public ModifyDataPathBackendSpectraS3Request withCacheAvailableRetryAfterInSeconds(final int cacheAvailableRetryAfterInSeconds) { + this.cacheAvailableRetryAfterInSeconds = cacheAvailableRetryAfterInSeconds; + this.updateQueryParam("cache_available_retry_after_in_seconds", cacheAvailableRetryAfterInSeconds); return this; } @@ -97,6 +126,34 @@ public ModifyDataPathBackendSpectraS3Request withDefaultVerifyDataPriorToImport( } + public ModifyDataPathBackendSpectraS3Request withIomCacheLimitationPercent(final double iomCacheLimitationPercent) { + this.iomCacheLimitationPercent = iomCacheLimitationPercent; + this.updateQueryParam("iom_cache_limitation_percent", iomCacheLimitationPercent); + return this; + } + + + public ModifyDataPathBackendSpectraS3Request withIomEnabled(final boolean iomEnabled) { + this.iomEnabled = iomEnabled; + this.updateQueryParam("iom_enabled", iomEnabled); + return this; + } + + + public ModifyDataPathBackendSpectraS3Request withMaxAggregatedBlobsPerChunk(final int maxAggregatedBlobsPerChunk) { + this.maxAggregatedBlobsPerChunk = maxAggregatedBlobsPerChunk; + this.updateQueryParam("max_aggregated_blobs_per_chunk", maxAggregatedBlobsPerChunk); + return this; + } + + + public ModifyDataPathBackendSpectraS3Request withMaxNumberOfConcurrentJobs(final int maxNumberOfConcurrentJobs) { + this.maxNumberOfConcurrentJobs = maxNumberOfConcurrentJobs; + this.updateQueryParam("max_number_of_concurrent_jobs", maxNumberOfConcurrentJobs); + return this; + } + + public ModifyDataPathBackendSpectraS3Request withPartiallyVerifyLastPercentOfTapes(final Integer partiallyVerifyLastPercentOfTapes) { this.partiallyVerifyLastPercentOfTapes = partiallyVerifyLastPercentOfTapes; this.updateQueryParam("partially_verify_last_percent_of_tapes", partiallyVerifyLastPercentOfTapes); @@ -104,6 +161,13 @@ public ModifyDataPathBackendSpectraS3Request withPartiallyVerifyLastPercentOfTap } + public ModifyDataPathBackendSpectraS3Request withPoolSafetyEnabled(final boolean poolSafetyEnabled) { + this.poolSafetyEnabled = poolSafetyEnabled; + this.updateQueryParam("pool_safety_enabled", poolSafetyEnabled); + return this; + } + + public ModifyDataPathBackendSpectraS3Request withUnavailableMediaPolicy(final UnavailableMediaUsagePolicy unavailableMediaPolicy) { this.unavailableMediaPolicy = unavailableMediaPolicy; this.updateQueryParam("unavailable_media_policy", unavailableMediaPolicy); @@ -125,6 +189,13 @@ public ModifyDataPathBackendSpectraS3Request withUnavailableTapePartitionMaxJobR } + public ModifyDataPathBackendSpectraS3Request withVerifyCheckpointBeforeRead(final boolean verifyCheckpointBeforeRead) { + this.verifyCheckpointBeforeRead = verifyCheckpointBeforeRead; + this.updateQueryParam("verify_checkpoint_before_read", verifyCheckpointBeforeRead); + return this; + } + + @Override public HttpVerb getVerb() { @@ -141,6 +212,16 @@ public boolean getActivated() { } + public boolean getAllowNewJobRequests() { + return this.allowNewJobRequests; + } + + + public boolean getAlwaysRollback() { + return this.alwaysRollback; + } + + public Integer getAutoActivateTimeoutInMins() { return this.autoActivateTimeoutInMins; } @@ -151,8 +232,8 @@ public AutoInspectMode getAutoInspect() { } - public ImportConflictResolutionMode getDefaultImportConflictResolutionMode() { - return this.defaultImportConflictResolutionMode; + public int getCacheAvailableRetryAfterInSeconds() { + return this.cacheAvailableRetryAfterInSeconds; } @@ -166,11 +247,36 @@ public boolean getDefaultVerifyDataPriorToImport() { } + public double getIomCacheLimitationPercent() { + return this.iomCacheLimitationPercent; + } + + + public boolean getIomEnabled() { + return this.iomEnabled; + } + + + public int getMaxAggregatedBlobsPerChunk() { + return this.maxAggregatedBlobsPerChunk; + } + + + public int getMaxNumberOfConcurrentJobs() { + return this.maxNumberOfConcurrentJobs; + } + + public Integer getPartiallyVerifyLastPercentOfTapes() { return this.partiallyVerifyLastPercentOfTapes; } + public boolean getPoolSafetyEnabled() { + return this.poolSafetyEnabled; + } + + public UnavailableMediaUsagePolicy getUnavailableMediaPolicy() { return this.unavailableMediaPolicy; } @@ -185,4 +291,9 @@ public int getUnavailableTapePartitionMaxJobRetryInMins() { return this.unavailableTapePartitionMaxJobRetryInMins; } + + public boolean getVerifyCheckpointBeforeRead() { + return this.verifyCheckpointBeforeRead; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Response.java index 8ee2766a9..8332773e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPathBackendSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Request.java index f82a0d730..f22d488fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,13 +21,13 @@ import com.spectralogic.ds3client.models.DataIsolationLevel; import java.lang.Integer; import com.spectralogic.ds3client.models.DataPersistenceRuleType; -import com.google.common.net.UrlEscapers; +import java.util.UUID; public class ModifyDataPersistenceRuleSpectraS3Request extends AbstractRequest { // Variables - private final String dataPersistenceRule; + private final String dataPersistenceRuleId; private DataIsolationLevel isolationLevel; @@ -38,8 +38,14 @@ public class ModifyDataPersistenceRuleSpectraS3Request extends AbstractRequest { // Constructor - public ModifyDataPersistenceRuleSpectraS3Request(final String dataPersistenceRule) { - this.dataPersistenceRule = dataPersistenceRule; + public ModifyDataPersistenceRuleSpectraS3Request(final UUID dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId.toString(); + + } + + + public ModifyDataPersistenceRuleSpectraS3Request(final String dataPersistenceRuleId) { + this.dataPersistenceRuleId = dataPersistenceRuleId; } @@ -72,11 +78,11 @@ public HttpVerb getVerb() { @Override public String getPath() { - return "/_rest_/data_persistence_rule/" + dataPersistenceRule; + return "/_rest_/data_persistence_rule/" + dataPersistenceRuleId; } - public String getDataPersistenceRule() { - return this.dataPersistenceRule; + public String getDataPersistenceRuleId() { + return this.dataPersistenceRuleId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Response.java index e4e6ea059..19b3c4515 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPersistenceRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Request.java index 945506790..211acc8c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,7 +21,6 @@ import com.spectralogic.ds3client.models.ChecksumType; import java.lang.Long; import com.spectralogic.ds3client.models.Priority; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.VersioningLevel; import java.util.UUID; @@ -51,6 +50,8 @@ public class ModifyDataPolicySpectraS3Request extends AbstractRequest { private boolean endToEndCrcRequired; + private int maxVersionsToKeep; + private String name; private Priority rebuildPriority; @@ -141,6 +142,13 @@ public ModifyDataPolicySpectraS3Request withEndToEndCrcRequired(final boolean en } + public ModifyDataPolicySpectraS3Request withMaxVersionsToKeep(final int maxVersionsToKeep) { + this.maxVersionsToKeep = maxVersionsToKeep; + this.updateQueryParam("max_versions_to_keep", maxVersionsToKeep); + return this; + } + + public ModifyDataPolicySpectraS3Request withName(final String name) { this.name = name; this.updateQueryParam("name", name); @@ -228,6 +236,11 @@ public boolean getEndToEndCrcRequired() { } + public int getMaxVersionsToKeep() { + return this.maxVersionsToKeep; + } + + public String getName() { return this.name; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Response.java index 36d1e2c27..b0a3eaf2f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDataPolicySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Request.java index a4b5060bc..c0373fbaf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataReplicationRuleType; public class ModifyDs3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Response.java index adb2a334c..e3b245e65 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Request.java index 0c00d61d9..387169330 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Ds3TargetAccessControlReplication; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import com.spectralogic.ds3client.models.Quiesced; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Response.java index 357862dac..83a61b848 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Request.java index 6e263d612..ac76f11b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class ModifyGroupSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Response.java index 0165d7ecc..b4ed50558 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Request.java index d700a5914..3fac5131b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.Date; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; import java.util.UUID; @@ -31,10 +30,14 @@ public class ModifyJobSpectraS3Request extends AbstractRequest { private Date createdAt; + private boolean deadJobCleanupAllowed; + private String name; private Priority priority; + private boolean protectedFlag; + // Constructor @@ -56,6 +59,13 @@ public ModifyJobSpectraS3Request withCreatedAt(final Date createdAt) { } + public ModifyJobSpectraS3Request withDeadJobCleanupAllowed(final boolean deadJobCleanupAllowed) { + this.deadJobCleanupAllowed = deadJobCleanupAllowed; + this.updateQueryParam("dead_job_cleanup_allowed", deadJobCleanupAllowed); + return this; + } + + public ModifyJobSpectraS3Request withName(final String name) { this.name = name; this.updateQueryParam("name", name); @@ -70,6 +80,13 @@ public ModifyJobSpectraS3Request withPriority(final Priority priority) { } + public ModifyJobSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + @Override public HttpVerb getVerb() { @@ -91,6 +108,11 @@ public Date getCreatedAt() { } + public boolean getDeadJobCleanupAllowed() { + return this.deadJobCleanupAllowed; + } + + public String getName() { return this.name; } @@ -100,4 +122,9 @@ public Priority getPriority() { return this.priority; } + + public boolean getProtected() { + return this.protectedFlag; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Response.java index 4292d1961..9debd32b5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Request.java index 50391f471..8de978291 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class ModifyNodeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Response.java index 1715f937b..57de74253 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyNodeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Request.java index 957bf5ea0..0e96ef058 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class ModifyPoolPartitionSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Response.java index a4eded32f..d51359fce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolPartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Request.java index a0e5162f3..db5158d8a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Quiesced; public class ModifyPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Response.java index 337cf6d68..a8b9c8455 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Request.java index d965786c4..a0cdb36ee 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.S3InitialDataPlacementPolicy; import com.spectralogic.ds3client.models.DataReplicationRuleType; -import com.google.common.net.UrlEscapers; public class ModifyS3DataReplicationRuleSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Response.java index 5021d5701..e52b603f2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Request.java index 4024ff2fb..673cbe5f3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; +import com.spectralogic.ds3client.models.CloudNamingMode; import com.spectralogic.ds3client.models.Quiesced; import com.spectralogic.ds3client.models.S3Region; @@ -46,6 +46,8 @@ public class ModifyS3TargetSpectraS3Request extends AbstractRequest { private String name; + private CloudNamingMode namingMode; + private int offlineDataStagingWindowInTb; private boolean permitGoingOutOfSync; @@ -64,6 +66,8 @@ public class ModifyS3TargetSpectraS3Request extends AbstractRequest { private S3Region region; + private boolean restrictedAccess; + private String secretKey; private int stagedDataExpirationInDays; @@ -132,6 +136,13 @@ public ModifyS3TargetSpectraS3Request withName(final String name) { } + public ModifyS3TargetSpectraS3Request withNamingMode(final CloudNamingMode namingMode) { + this.namingMode = namingMode; + this.updateQueryParam("naming_mode", namingMode); + return this; + } + + public ModifyS3TargetSpectraS3Request withOfflineDataStagingWindowInTb(final int offlineDataStagingWindowInTb) { this.offlineDataStagingWindowInTb = offlineDataStagingWindowInTb; this.updateQueryParam("offline_data_staging_window_in_tb", offlineDataStagingWindowInTb); @@ -195,6 +206,13 @@ public ModifyS3TargetSpectraS3Request withRegion(final S3Region region) { } + public ModifyS3TargetSpectraS3Request withRestrictedAccess(final boolean restrictedAccess) { + this.restrictedAccess = restrictedAccess; + this.updateQueryParam("restricted_access", restrictedAccess); + return this; + } + + public ModifyS3TargetSpectraS3Request withSecretKey(final String secretKey) { this.secretKey = secretKey; this.updateQueryParam("secret_key", secretKey); @@ -265,6 +283,11 @@ public String getName() { } + public CloudNamingMode getNamingMode() { + return this.namingMode; + } + + public int getOfflineDataStagingWindowInTb() { return this.offlineDataStagingWindowInTb; } @@ -310,6 +333,11 @@ public S3Region getRegion() { } + public boolean getRestrictedAccess() { + return this.restrictedAccess; + } + + public String getSecretKey() { return this.secretKey; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Response.java index e568c8953..766587461 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Request.java index 5fe3583a4..83163a40b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.lang.Integer; +import com.spectralogic.ds3client.models.StorageDomainMemberState; import com.spectralogic.ds3client.models.WritePreferenceLevel; -import com.google.common.net.UrlEscapers; public class ModifyStorageDomainMemberSpectraS3Request extends AbstractRequest { @@ -27,6 +28,10 @@ public class ModifyStorageDomainMemberSpectraS3Request extends AbstractRequest { private final String storageDomainMember; + private Integer autoCompactionThreshold; + + private StorageDomainMemberState state; + private WritePreferenceLevel writePreference; // Constructor @@ -37,6 +42,20 @@ public ModifyStorageDomainMemberSpectraS3Request(final String storageDomainMembe } + public ModifyStorageDomainMemberSpectraS3Request withAutoCompactionThreshold(final Integer autoCompactionThreshold) { + this.autoCompactionThreshold = autoCompactionThreshold; + this.updateQueryParam("auto_compaction_threshold", autoCompactionThreshold); + return this; + } + + + public ModifyStorageDomainMemberSpectraS3Request withState(final StorageDomainMemberState state) { + this.state = state; + this.updateQueryParam("state", state); + return this; + } + + public ModifyStorageDomainMemberSpectraS3Request withWritePreference(final WritePreferenceLevel writePreference) { this.writePreference = writePreference; this.updateQueryParam("write_preference", writePreference); @@ -60,6 +79,16 @@ public String getStorageDomainMember() { } + public Integer getAutoCompactionThreshold() { + return this.autoCompactionThreshold; + } + + + public StorageDomainMemberState getState() { + return this.state; + } + + public WritePreferenceLevel getWritePreference() { return this.writePreference; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Response.java index 00d8666e3..fd64be2dc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Request.java index 78374ac43..7b2d704c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.lang.Long; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.LtfsFileNamingMode; import java.lang.Integer; import com.spectralogic.ds3client.models.Priority; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Response.java index 9a5750727..74c723c12 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyStorageDomainSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Request.java new file mode 100644 index 000000000..dac46b7c9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Request.java @@ -0,0 +1,118 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.lang.Integer; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.models.Quiesced; +import com.spectralogic.ds3client.models.ReservedTaskType; +import java.util.UUID; + +public class ModifyTapeDriveSpectraS3Request extends AbstractRequest { + + // Variables + + private final String tapeDriveId; + + private Integer maxFailedTapes; + + private Priority minimumTaskPriority; + + private Quiesced quiesced; + + private ReservedTaskType reservedTaskType; + + // Constructor + + + public ModifyTapeDriveSpectraS3Request(final UUID tapeDriveId) { + this.tapeDriveId = tapeDriveId.toString(); + + } + + + public ModifyTapeDriveSpectraS3Request(final String tapeDriveId) { + this.tapeDriveId = tapeDriveId; + + } + + public ModifyTapeDriveSpectraS3Request withMaxFailedTapes(final Integer maxFailedTapes) { + this.maxFailedTapes = maxFailedTapes; + this.updateQueryParam("max_failed_tapes", maxFailedTapes); + return this; + } + + + public ModifyTapeDriveSpectraS3Request withMinimumTaskPriority(final Priority minimumTaskPriority) { + this.minimumTaskPriority = minimumTaskPriority; + this.updateQueryParam("minimum_task_priority", minimumTaskPriority); + return this; + } + + + public ModifyTapeDriveSpectraS3Request withQuiesced(final Quiesced quiesced) { + this.quiesced = quiesced; + this.updateQueryParam("quiesced", quiesced); + return this; + } + + + public ModifyTapeDriveSpectraS3Request withReservedTaskType(final ReservedTaskType reservedTaskType) { + this.reservedTaskType = reservedTaskType; + this.updateQueryParam("reserved_task_type", reservedTaskType); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/tape_drive/" + tapeDriveId; + } + + public String getTapeDriveId() { + return this.tapeDriveId; + } + + + public Integer getMaxFailedTapes() { + return this.maxFailedTapes; + } + + + public Priority getMinimumTaskPriority() { + return this.minimumTaskPriority; + } + + + public Quiesced getQuiesced() { + return this.quiesced; + } + + + public ReservedTaskType getReservedTaskType() { + return this.reservedTaskType; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Response.java similarity index 62% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Response.java index 09ea6828a..e644063df 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/ListMultiPartUploadPartsResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeDriveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,23 +14,23 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; -import com.spectralogic.ds3client.models.ListPartsResult; +import com.spectralogic.ds3client.models.TapeDrive; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class ListMultiPartUploadPartsResponse extends AbstractResponse { +public class ModifyTapeDriveSpectraS3Response extends AbstractResponse { - private final ListPartsResult listPartsResult; + private final TapeDrive tapeDriveResult; - public ListMultiPartUploadPartsResponse(final ListPartsResult listPartsResult, final String checksum, final ChecksumType.Type checksumType) { + public ModifyTapeDriveSpectraS3Response(final TapeDrive tapeDriveResult, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); - this.listPartsResult = listPartsResult; + this.tapeDriveResult = tapeDriveResult; } - public ListPartsResult getListPartsResult() { - return this.listPartsResult; + public TapeDrive getTapeDriveResult() { + return this.tapeDriveResult; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Request.java index efc6b9149..4e52a4f17 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,8 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.lang.Integer; import com.spectralogic.ds3client.models.Quiesced; -import com.google.common.net.UrlEscapers; public class ModifyTapePartitionSpectraS3Request extends AbstractRequest { @@ -27,8 +27,20 @@ public class ModifyTapePartitionSpectraS3Request extends AbstractRequest { private final String tapePartition; + private boolean autoCompactionEnabled; + + private boolean autoQuiesceEnabled; + + private Integer driveIdleTimeoutInMinutes; + + private int minimumReadReservedDrives; + + private int minimumWriteReservedDrives; + private Quiesced quiesced; + private String serialNumber; + // Constructor @@ -37,6 +49,41 @@ public ModifyTapePartitionSpectraS3Request(final String tapePartition) { } + public ModifyTapePartitionSpectraS3Request withAutoCompactionEnabled(final boolean autoCompactionEnabled) { + this.autoCompactionEnabled = autoCompactionEnabled; + this.updateQueryParam("auto_compaction_enabled", autoCompactionEnabled); + return this; + } + + + public ModifyTapePartitionSpectraS3Request withAutoQuiesceEnabled(final boolean autoQuiesceEnabled) { + this.autoQuiesceEnabled = autoQuiesceEnabled; + this.updateQueryParam("auto_quiesce_enabled", autoQuiesceEnabled); + return this; + } + + + public ModifyTapePartitionSpectraS3Request withDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) { + this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes; + this.updateQueryParam("drive_idle_timeout_in_minutes", driveIdleTimeoutInMinutes); + return this; + } + + + public ModifyTapePartitionSpectraS3Request withMinimumReadReservedDrives(final int minimumReadReservedDrives) { + this.minimumReadReservedDrives = minimumReadReservedDrives; + this.updateQueryParam("minimum_read_reserved_drives", minimumReadReservedDrives); + return this; + } + + + public ModifyTapePartitionSpectraS3Request withMinimumWriteReservedDrives(final int minimumWriteReservedDrives) { + this.minimumWriteReservedDrives = minimumWriteReservedDrives; + this.updateQueryParam("minimum_write_reserved_drives", minimumWriteReservedDrives); + return this; + } + + public ModifyTapePartitionSpectraS3Request withQuiesced(final Quiesced quiesced) { this.quiesced = quiesced; this.updateQueryParam("quiesced", quiesced); @@ -44,6 +91,13 @@ public ModifyTapePartitionSpectraS3Request withQuiesced(final Quiesced quiesced) } + public ModifyTapePartitionSpectraS3Request withSerialNumber(final String serialNumber) { + this.serialNumber = serialNumber; + this.updateQueryParam("serial_number", serialNumber); + return this; + } + + @Override public HttpVerb getVerb() { @@ -60,8 +114,38 @@ public String getTapePartition() { } + public boolean getAutoCompactionEnabled() { + return this.autoCompactionEnabled; + } + + + public boolean getAutoQuiesceEnabled() { + return this.autoQuiesceEnabled; + } + + + public Integer getDriveIdleTimeoutInMinutes() { + return this.driveIdleTimeoutInMinutes; + } + + + public int getMinimumReadReservedDrives() { + return this.minimumReadReservedDrives; + } + + + public int getMinimumWriteReservedDrives() { + return this.minimumWriteReservedDrives; + } + + public Quiesced getQuiesced() { return this.quiesced; } + + public String getSerialNumber() { + return this.serialNumber; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Response.java index c6aa2e75c..a5ec952db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapePartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Request.java index 2c3a350c1..5ba419426 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; +import com.spectralogic.ds3client.models.TapeRole; import com.spectralogic.ds3client.models.TapeState; import java.util.UUID; @@ -28,10 +28,14 @@ public class ModifyTapeSpectraS3Request extends AbstractRequest { private final String tapeId; + private boolean allowRollback; + private String ejectLabel; private String ejectLocation; + private TapeRole role; + private TapeState state; // Constructor @@ -48,6 +52,13 @@ public ModifyTapeSpectraS3Request(final String tapeId) { } + public ModifyTapeSpectraS3Request withAllowRollback(final boolean allowRollback) { + this.allowRollback = allowRollback; + this.updateQueryParam("allow_rollback", allowRollback); + return this; + } + + public ModifyTapeSpectraS3Request withEjectLabel(final String ejectLabel) { this.ejectLabel = ejectLabel; this.updateQueryParam("eject_label", ejectLabel); @@ -62,6 +73,13 @@ public ModifyTapeSpectraS3Request withEjectLocation(final String ejectLocation) } + public ModifyTapeSpectraS3Request withRole(final TapeRole role) { + this.role = role; + this.updateQueryParam("role", role); + return this; + } + + public ModifyTapeSpectraS3Request withState(final TapeState state) { this.state = state; this.updateQueryParam("state", state); @@ -85,6 +103,11 @@ public String getTapeId() { } + public boolean getAllowRollback() { + return this.allowRollback; + } + + public String getEjectLabel() { return this.ejectLabel; } @@ -95,6 +118,11 @@ public String getEjectLocation() { } + public TapeRole getRole() { + return this.role; + } + + public TapeState getState() { return this.state; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Response.java index 5187ed75b..d4d9c8d35 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Request.java index a4350dd3d..d69e858bc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class ModifyUserSpectraS3Request extends AbstractRequest { @@ -29,6 +28,8 @@ public class ModifyUserSpectraS3Request extends AbstractRequest { private String defaultDataPolicyId; + private int maxBuckets; + private String name; private String secretKey; @@ -61,6 +62,13 @@ public ModifyUserSpectraS3Request withDefaultDataPolicyId(final String defaultDa } + public ModifyUserSpectraS3Request withMaxBuckets(final int maxBuckets) { + this.maxBuckets = maxBuckets; + this.updateQueryParam("max_buckets", maxBuckets); + return this; + } + + public ModifyUserSpectraS3Request withName(final String name) { this.name = name; this.updateQueryParam("name", name); @@ -96,6 +104,11 @@ public String getDefaultDataPolicyId() { } + public int getMaxBuckets() { + return this.maxBuckets; + } + + public String getName() { return this.name; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Response.java index 5f30d8efe..fcff0a4e6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ModifyUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Request.java index 7100d19d3..54ee3b0f6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Response.java index 0244d237d..634f7fd20 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Request.java index b375f9fae..c2be66d82 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class OnlineTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Response.java index ffba82784..e74d01c07 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/OnlineTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Request.java index 6d0cbcd80..5afa84743 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Ds3TargetAccessControlReplication; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Response.java index 81705e130..aae2f097e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PairBackRegisteredDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Request.java index 95d9fc6af..108768a86 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataReplicationRuleType; public class PutAzureDataReplicationRuleSpectraS3Request extends AbstractRequest { @@ -44,9 +43,12 @@ public PutAzureDataReplicationRuleSpectraS3Request(final UUID dataPolicyId, fina this.targetId = targetId.toString(); this.type = type; - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("target_id", targetId.toString()); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } @@ -55,9 +57,12 @@ public PutAzureDataReplicationRuleSpectraS3Request(final String dataPolicyId, fi this.targetId = targetId; this.type = type; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } public PutAzureDataReplicationRuleSpectraS3Request withMaxBlobPartSizeInBytes(final long maxBlobPartSizeInBytes) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Response.java index 5271109db..9921384eb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureDataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Request.java index d57343e36..e172ff13b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class PutAzureTargetBucketNameSpectraS3Request extends AbstractRequest { @@ -39,9 +38,12 @@ public PutAzureTargetBucketNameSpectraS3Request(final String bucketId, final Str this.name = name; this.targetId = targetId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("target_id", targetId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("name", name); + + this.updateQueryParam("target_id", targetId); + } @@ -50,9 +52,12 @@ public PutAzureTargetBucketNameSpectraS3Request(final String bucketId, final Str this.name = name; this.targetId = targetId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("name", name); + + this.updateQueryParam("target_id", targetId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Response.java index c57ddce1f..78836b8cc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetBucketNameSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Request.java index a3e631214..42d4daa75 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -41,7 +40,8 @@ public class PutAzureTargetFailureNotificationRegistrationSpectraS3Request exten public PutAzureTargetFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { this.notificationEndPoint = notificationEndPoint; - this.getQueryParams().put("notification_end_point", UrlEscapers.urlFragmentEscaper().escape(notificationEndPoint).replace("+", "%2B")); + this.updateQueryParam("notification_end_point", notificationEndPoint); + } public PutAzureTargetFailureNotificationRegistrationSpectraS3Request withFormat(final HttpResponseFormatType format) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Response.java index 612eefe5a..e6dda3f09 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Request.java index 35c8c9964..cc7fdf7fe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import java.util.UUID; @@ -40,9 +39,12 @@ public PutAzureTargetReadPreferenceSpectraS3Request(final String bucketId, final this.readPreference = readPreference; this.targetId = targetId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", targetId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } @@ -51,9 +53,12 @@ public PutAzureTargetReadPreferenceSpectraS3Request(final String bucketId, final this.readPreference = readPreference; this.targetId = targetId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Response.java index 61a164410..5efd29959 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutAzureTargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Request.java index aa2e5a500..0eeb06c24 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; import com.spectralogic.ds3client.models.BucketAclPermission; @@ -40,9 +39,12 @@ public PutBucketAclForGroupSpectraS3Request(final String bucketId, final UUID gr this.groupId = groupId.toString(); this.permission = permission; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("group_id", groupId.toString()); - this.getQueryParams().put("permission", permission.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("permission", permission); + } @@ -51,9 +53,12 @@ public PutBucketAclForGroupSpectraS3Request(final String bucketId, final String this.groupId = groupId; this.permission = permission; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); - this.getQueryParams().put("permission", permission.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("permission", permission); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Response.java index 24d21d416..07205e72f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Request.java index cd16c9c5b..79fd8bae7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.BucketAclPermission; import java.util.UUID; @@ -40,9 +39,12 @@ public PutBucketAclForUserSpectraS3Request(final String bucketId, final BucketAc this.permission = permission; this.userId = userId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("permission", permission.toString()); - this.getQueryParams().put("user_id", userId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("permission", permission); + + this.updateQueryParam("user_id", userId); + } @@ -51,9 +53,12 @@ public PutBucketAclForUserSpectraS3Request(final String bucketId, final BucketAc this.permission = permission; this.userId = userId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("permission", permission.toString()); - this.getQueryParams().put("user_id", UrlEscapers.urlFragmentEscaper().escape(userId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("permission", permission); + + this.updateQueryParam("user_id", userId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Response.java index 301a43d19..5217f8628 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketAclForUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Request.java new file mode 100644 index 000000000..88a9c4d73 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Request.java @@ -0,0 +1,112 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import com.spectralogic.ds3client.models.HttpResponseFormatType; +import com.spectralogic.ds3client.models.NamingConventionType; +import com.spectralogic.ds3client.models.RequestType; + +public class PutBucketChangesNotificationRegistrationSpectraS3Request extends AbstractRequest { + + // Variables + + private final String notificationEndPoint; + + private String bucketId; + + private HttpResponseFormatType format; + + private NamingConventionType namingConvention; + + private RequestType notificationHttpMethod; + + // Constructor + + + public PutBucketChangesNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { + this.notificationEndPoint = notificationEndPoint; + + this.updateQueryParam("notification_end_point", notificationEndPoint); + + } + + public PutBucketChangesNotificationRegistrationSpectraS3Request withBucketId(final String bucketId) { + this.bucketId = bucketId; + this.updateQueryParam("bucket_id", bucketId); + return this; + } + + + public PutBucketChangesNotificationRegistrationSpectraS3Request withFormat(final HttpResponseFormatType format) { + this.format = format; + this.updateQueryParam("format", format); + return this; + } + + + public PutBucketChangesNotificationRegistrationSpectraS3Request withNamingConvention(final NamingConventionType namingConvention) { + this.namingConvention = namingConvention; + this.updateQueryParam("naming_convention", namingConvention); + return this; + } + + + public PutBucketChangesNotificationRegistrationSpectraS3Request withNotificationHttpMethod(final RequestType notificationHttpMethod) { + this.notificationHttpMethod = notificationHttpMethod; + this.updateQueryParam("notification_http_method", notificationHttpMethod); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.POST; + } + + @Override + public String getPath() { + return "/_rest_/bucket_changes_notification_registration"; + } + + public String getNotificationEndPoint() { + return this.notificationEndPoint; + } + + + public String getBucketId() { + return this.bucketId; + } + + + public HttpResponseFormatType getFormat() { + return this.format; + } + + + public NamingConventionType getNamingConvention() { + return this.namingConvention; + } + + + public RequestType getNotificationHttpMethod() { + return this.notificationHttpMethod; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Response.java similarity index 51% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadResponse.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Response.java index ddd5d2647..bc04d8011 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/InitiateMultiPartUploadResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketChangesNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -14,23 +14,23 @@ */ // This code is auto-generated, do not modify -package com.spectralogic.ds3client.commands; +package com.spectralogic.ds3client.commands.spectrads3; -import com.spectralogic.ds3client.models.InitiateMultipartUploadResult; +import com.spectralogic.ds3client.models.BucketChangesNotificationRegistration; import com.spectralogic.ds3client.models.ChecksumType; import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; -public class InitiateMultiPartUploadResponse extends AbstractResponse { +public class PutBucketChangesNotificationRegistrationSpectraS3Response extends AbstractResponse { - private final InitiateMultipartUploadResult initiateMultipartUploadResult; + private final BucketChangesNotificationRegistration bucketChangesNotificationRegistrationResult; - public InitiateMultiPartUploadResponse(final InitiateMultipartUploadResult initiateMultipartUploadResult, final String checksum, final ChecksumType.Type checksumType) { + public PutBucketChangesNotificationRegistrationSpectraS3Response(final BucketChangesNotificationRegistration bucketChangesNotificationRegistrationResult, final String checksum, final ChecksumType.Type checksumType) { super(checksum, checksumType); - this.initiateMultipartUploadResult = initiateMultipartUploadResult; + this.bucketChangesNotificationRegistrationResult = bucketChangesNotificationRegistrationResult; } - public InitiateMultipartUploadResult getInitiateMultipartUploadResult() { - return this.initiateMultipartUploadResult; + public BucketChangesNotificationRegistration getBucketChangesNotificationRegistrationResult() { + return this.bucketChangesNotificationRegistrationResult; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Request.java index 06d73b38d..547c3a95e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class PutBucketSpectraS3Request extends AbstractRequest { @@ -31,6 +30,8 @@ public class PutBucketSpectraS3Request extends AbstractRequest { private String id; + private boolean protectedFlag; + private String userId; // Constructor @@ -39,7 +40,8 @@ public class PutBucketSpectraS3Request extends AbstractRequest { public PutBucketSpectraS3Request(final String name) { this.name = name; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("name", name); + } public PutBucketSpectraS3Request withDataPolicyId(final UUID dataPolicyId) { @@ -70,6 +72,13 @@ public PutBucketSpectraS3Request withId(final String id) { } + public PutBucketSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + public PutBucketSpectraS3Request withUserId(final UUID userId) { this.userId = userId.toString(); this.updateQueryParam("user_id", userId); @@ -110,6 +119,11 @@ public String getId() { } + public boolean getProtected() { + return this.protectedFlag; + } + + public String getUserId() { return this.userId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Response.java index 3fd44c256..c53b7a96b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBucketSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Request.java index 0539f2f6c..3b1ff3b86 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.BulkCommand; import com.spectralogic.ds3client.models.bulk.Ds3Object; import com.spectralogic.ds3client.commands.interfaces.BulkRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class PutBulkJobSpectraS3Request extends BulkRequest { @@ -30,6 +29,8 @@ public class PutBulkJobSpectraS3Request extends BulkRequest { private boolean aggregating; + private boolean deadJobCleanupAllowed; + private boolean force; private boolean ignoreNamingConflicts; @@ -40,6 +41,10 @@ public class PutBulkJobSpectraS3Request extends BulkRequest { private String name; + private boolean preAllocateJobSpace; + + private boolean protectedFlag; + private boolean verifyAfterWrite; // Constructor @@ -58,6 +63,13 @@ public PutBulkJobSpectraS3Request withAggregating(final boolean aggregating) { } + public PutBulkJobSpectraS3Request withDeadJobCleanupAllowed(final boolean deadJobCleanupAllowed) { + this.deadJobCleanupAllowed = deadJobCleanupAllowed; + this.updateQueryParam("dead_job_cleanup_allowed", deadJobCleanupAllowed); + return this; + } + + public PutBulkJobSpectraS3Request withForce(final boolean force) { this.force = force; if (this.force) { @@ -88,7 +100,7 @@ public PutBulkJobSpectraS3Request withImplicitJobIdResolution(final boolean impl public PutBulkJobSpectraS3Request withMaxUploadSize(final long maxUploadSize) { - if (maxUploadSize > MIN_UPLOAD_SIZE_IN_BYTES) { + if (maxUploadSize >= MIN_UPLOAD_SIZE_IN_BYTES) { this.getQueryParams().put("max_upload_size", Long.toString(maxUploadSize)); } else { this.getQueryParams().put("max_upload_size", MAX_UPLOAD_SIZE_IN_BYTES); @@ -111,6 +123,17 @@ public PutBulkJobSpectraS3Request withName(final String name) { } + public PutBulkJobSpectraS3Request withPreAllocateJobSpace(final boolean preAllocateJobSpace) { + this.preAllocateJobSpace = preAllocateJobSpace; + if (this.preAllocateJobSpace) { + this.getQueryParams().put("pre_allocate_job_space", null); + } else { + this.getQueryParams().remove("pre_allocate_job_space"); + } + return this; + } + + @Override public PutBulkJobSpectraS3Request withPriority(final Priority priority) { super.withPriority(priority); @@ -118,6 +141,13 @@ public PutBulkJobSpectraS3Request withPriority(final Priority priority) { } + public PutBulkJobSpectraS3Request withProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + this.updateQueryParam("protected", protectedFlag); + return this; + } + + public PutBulkJobSpectraS3Request withVerifyAfterWrite(final boolean verifyAfterWrite) { this.verifyAfterWrite = verifyAfterWrite; this.updateQueryParam("verify_after_write", verifyAfterWrite); @@ -132,6 +162,11 @@ public boolean getAggregating() { } + public boolean getDeadJobCleanupAllowed() { + return this.deadJobCleanupAllowed; + } + + public boolean getForce() { return this.force; } @@ -157,6 +192,16 @@ public String getName() { } + public boolean getPreAllocateJobSpace() { + return this.preAllocateJobSpace; + } + + + public boolean getProtected() { + return this.protectedFlag; + } + + public boolean getVerifyAfterWrite() { return this.verifyAfterWrite; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Response.java index 3afb4d212..b14d2aefd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutBulkJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Request.java new file mode 100644 index 000000000..a55d400e4 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Request.java @@ -0,0 +1,112 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.lang.Double; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.models.JobRequestType; + +public class PutCacheThrottleRuleSpectraS3Request extends AbstractRequest { + + // Variables + + private final double maxCachePercent; + + private String bucketId; + + private Double burstThreshold; + + private Priority priority; + + private JobRequestType requestType; + + // Constructor + + + public PutCacheThrottleRuleSpectraS3Request(final double maxCachePercent) { + this.maxCachePercent = maxCachePercent; + + this.updateQueryParam("max_cache_percent", maxCachePercent); + + } + + public PutCacheThrottleRuleSpectraS3Request withBucketId(final String bucketId) { + this.bucketId = bucketId; + this.updateQueryParam("bucket_id", bucketId); + return this; + } + + + public PutCacheThrottleRuleSpectraS3Request withBurstThreshold(final Double burstThreshold) { + this.burstThreshold = burstThreshold; + this.updateQueryParam("burst_threshold", burstThreshold); + return this; + } + + + public PutCacheThrottleRuleSpectraS3Request withPriority(final Priority priority) { + this.priority = priority; + this.updateQueryParam("priority", priority); + return this; + } + + + public PutCacheThrottleRuleSpectraS3Request withRequestType(final JobRequestType requestType) { + this.requestType = requestType; + this.updateQueryParam("request_type", requestType); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.POST; + } + + @Override + public String getPath() { + return "/_rest_/cache_throttle_rule"; + } + + public double getMaxCachePercent() { + return this.maxCachePercent; + } + + + public String getBucketId() { + return this.bucketId; + } + + + public Double getBurstThreshold() { + return this.burstThreshold; + } + + + public Priority getPriority() { + return this.priority; + } + + + public JobRequestType getRequestType() { + return this.requestType; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Response.java new file mode 100644 index 000000000..024be8cae --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutCacheThrottleRuleSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.CacheThrottleRule; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class PutCacheThrottleRuleSpectraS3Response extends AbstractResponse { + + private final CacheThrottleRule cacheThrottleRuleResult; + + public PutCacheThrottleRuleSpectraS3Response(final CacheThrottleRule cacheThrottleRuleResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.cacheThrottleRuleResult = cacheThrottleRuleResult; + } + + public CacheThrottleRule getCacheThrottleRuleResult() { + return this.cacheThrottleRuleResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Request.java index 56ff347db..ae7c16332 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataIsolationLevel; import com.spectralogic.ds3client.models.DataPersistenceRuleType; import java.lang.Integer; @@ -47,10 +46,14 @@ public PutDataPersistenceRuleSpectraS3Request(final UUID dataPolicyId, final Dat this.storageDomainId = storageDomainId.toString(); this.type = type; - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("isolation_level", isolationLevel.toString()); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("isolation_level", isolationLevel); + + this.updateQueryParam("storage_domain_id", storageDomainId); + + this.updateQueryParam("type", type); + } @@ -60,10 +63,14 @@ public PutDataPersistenceRuleSpectraS3Request(final String dataPolicyId, final D this.storageDomainId = storageDomainId; this.type = type; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("isolation_level", isolationLevel.toString()); - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("isolation_level", isolationLevel); + + this.updateQueryParam("storage_domain_id", storageDomainId); + + this.updateQueryParam("type", type); + } public PutDataPersistenceRuleSpectraS3Request withMinimumDaysToRetain(final Integer minimumDaysToRetain) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Response.java index 3fe99b50d..1e5859873 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPersistenceRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Request.java index 756961f88..b879c1548 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutDataPolicyAclForGroupSpectraS3Request extends AbstractRequest { @@ -36,8 +35,10 @@ public PutDataPolicyAclForGroupSpectraS3Request(final UUID dataPolicyId, final U this.dataPolicyId = dataPolicyId.toString(); this.groupId = groupId.toString(); - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("group_id", groupId.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("group_id", groupId); + } @@ -45,8 +46,10 @@ public PutDataPolicyAclForGroupSpectraS3Request(final String dataPolicyId, final this.dataPolicyId = dataPolicyId; this.groupId = groupId; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("group_id", groupId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Response.java index 58727c706..ed5008f61 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Request.java index dfc89df3d..b4b391166 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutDataPolicyAclForUserSpectraS3Request extends AbstractRequest { @@ -36,8 +35,10 @@ public PutDataPolicyAclForUserSpectraS3Request(final UUID dataPolicyId, final UU this.dataPolicyId = dataPolicyId.toString(); this.userId = userId.toString(); - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("user_id", userId.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("user_id", userId); + } @@ -45,8 +46,10 @@ public PutDataPolicyAclForUserSpectraS3Request(final String dataPolicyId, final this.dataPolicyId = dataPolicyId; this.userId = userId; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("user_id", UrlEscapers.urlFragmentEscaper().escape(userId).replace("+", "%2B")); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("user_id", userId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Response.java index 14fbcff5b..443a563f4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicyAclForUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Request.java index 67990f327..46f66e341 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.ChecksumType; import java.lang.Long; import com.spectralogic.ds3client.models.Priority; @@ -50,6 +49,8 @@ public class PutDataPolicySpectraS3Request extends AbstractRequest { private boolean endToEndCrcRequired; + private int maxVersionsToKeep; + private Priority rebuildPriority; private VersioningLevel versioning; @@ -60,7 +61,8 @@ public class PutDataPolicySpectraS3Request extends AbstractRequest { public PutDataPolicySpectraS3Request(final String name) { this.name = name; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("name", name); + } public PutDataPolicySpectraS3Request withAlwaysForcePutJobCreation(final boolean alwaysForcePutJobCreation) { @@ -133,6 +135,13 @@ public PutDataPolicySpectraS3Request withEndToEndCrcRequired(final boolean endTo } + public PutDataPolicySpectraS3Request withMaxVersionsToKeep(final int maxVersionsToKeep) { + this.maxVersionsToKeep = maxVersionsToKeep; + this.updateQueryParam("max_versions_to_keep", maxVersionsToKeep); + return this; + } + + public PutDataPolicySpectraS3Request withRebuildPriority(final Priority rebuildPriority) { this.rebuildPriority = rebuildPriority; this.updateQueryParam("rebuild_priority", rebuildPriority); @@ -213,6 +222,11 @@ public boolean getEndToEndCrcRequired() { } + public int getMaxVersionsToKeep() { + return this.maxVersionsToKeep; + } + + public Priority getRebuildPriority() { return this.rebuildPriority; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Response.java index e2be91d3e..7e4ce6d5e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDataPolicySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Request.java new file mode 100644 index 000000000..eda25f4bf --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Request.java @@ -0,0 +1,62 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class PutDriveDumpSpectraS3Request extends AbstractRequest { + + // Variables + + private final String tapeDriveId; + + // Constructor + + + public PutDriveDumpSpectraS3Request(final UUID tapeDriveId) { + this.tapeDriveId = tapeDriveId.toString(); + + this.getQueryParams().put("operation", "dump"); + + } + + + public PutDriveDumpSpectraS3Request(final String tapeDriveId) { + this.tapeDriveId = tapeDriveId; + + this.getQueryParams().put("operation", "dump"); + + } + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/tape_drive/" + tapeDriveId; + } + + public String getTapeDriveId() { + return this.tapeDriveId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Response.java new file mode 100644 index 000000000..00b4eb780 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDriveDumpSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.TapeDrive; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class PutDriveDumpSpectraS3Response extends AbstractResponse { + + private final TapeDrive tapeDriveResult; + + public PutDriveDumpSpectraS3Response(final TapeDrive tapeDriveResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.tapeDriveResult = tapeDriveResult; + } + + public TapeDrive getTapeDriveResult() { + return this.tapeDriveResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Request.java index 550666b39..bf942b54d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataReplicationRuleType; public class PutDs3DataReplicationRuleSpectraS3Request extends AbstractRequest { @@ -44,9 +43,12 @@ public PutDs3DataReplicationRuleSpectraS3Request(final UUID dataPolicyId, final this.targetId = targetId.toString(); this.type = type; - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("target_id", targetId.toString()); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } @@ -55,9 +57,12 @@ public PutDs3DataReplicationRuleSpectraS3Request(final String dataPolicyId, fina this.targetId = targetId; this.type = type; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } public PutDs3DataReplicationRuleSpectraS3Request withReplicateDeletes(final boolean replicateDeletes) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Response.java index e4ee402b0..3c09ac89d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Request.java index f5f133c5d..b93ba83ca 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import java.util.UUID; @@ -40,9 +39,12 @@ public PutDs3TargetReadPreferenceSpectraS3Request(final String bucketId, final T this.readPreference = readPreference; this.targetId = targetId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", targetId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } @@ -51,9 +53,12 @@ public PutDs3TargetReadPreferenceSpectraS3Request(final String bucketId, final T this.readPreference = readPreference; this.targetId = targetId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Response.java index 6d54ddb3e..6fd4d32ec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutDs3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Request.java index e9e00177f..7a0645151 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.BucketAclPermission; public class PutGlobalBucketAclForGroupSpectraS3Request extends AbstractRequest { @@ -37,8 +36,10 @@ public PutGlobalBucketAclForGroupSpectraS3Request(final UUID groupId, final Buck this.groupId = groupId.toString(); this.permission = permission; - this.getQueryParams().put("group_id", groupId.toString()); - this.getQueryParams().put("permission", permission.toString()); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("permission", permission); + } @@ -46,8 +47,10 @@ public PutGlobalBucketAclForGroupSpectraS3Request(final String groupId, final Bu this.groupId = groupId; this.permission = permission; - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); - this.getQueryParams().put("permission", permission.toString()); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("permission", permission); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Response.java index d04daef64..25a59e955 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Request.java index 8d8d48130..f85ee0bf9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.BucketAclPermission; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutGlobalBucketAclForUserSpectraS3Request extends AbstractRequest { @@ -37,8 +36,10 @@ public PutGlobalBucketAclForUserSpectraS3Request(final BucketAclPermission permi this.permission = permission; this.userId = userId.toString(); - this.getQueryParams().put("permission", permission.toString()); - this.getQueryParams().put("user_id", userId.toString()); + this.updateQueryParam("permission", permission); + + this.updateQueryParam("user_id", userId); + } @@ -46,8 +47,10 @@ public PutGlobalBucketAclForUserSpectraS3Request(final BucketAclPermission permi this.permission = permission; this.userId = userId; - this.getQueryParams().put("permission", permission.toString()); - this.getQueryParams().put("user_id", UrlEscapers.urlFragmentEscaper().escape(userId).replace("+", "%2B")); + this.updateQueryParam("permission", permission); + + this.updateQueryParam("user_id", userId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Response.java index 1422fecee..c9839652f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalBucketAclForUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Request.java index b276214a2..dfe8bc54c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutGlobalDataPolicyAclForGroupSpectraS3Request extends AbstractRequest { @@ -33,14 +32,16 @@ public class PutGlobalDataPolicyAclForGroupSpectraS3Request extends AbstractRequ public PutGlobalDataPolicyAclForGroupSpectraS3Request(final UUID groupId) { this.groupId = groupId.toString(); - this.getQueryParams().put("group_id", groupId.toString()); + this.updateQueryParam("group_id", groupId); + } public PutGlobalDataPolicyAclForGroupSpectraS3Request(final String groupId) { this.groupId = groupId; - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); + this.updateQueryParam("group_id", groupId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Response.java index 402e1fce1..3e839751a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Request.java index d42d4016f..3afe2a6a3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutGlobalDataPolicyAclForUserSpectraS3Request extends AbstractRequest { @@ -33,14 +32,16 @@ public class PutGlobalDataPolicyAclForUserSpectraS3Request extends AbstractReque public PutGlobalDataPolicyAclForUserSpectraS3Request(final UUID userId) { this.userId = userId.toString(); - this.getQueryParams().put("user_id", userId.toString()); + this.updateQueryParam("user_id", userId); + } public PutGlobalDataPolicyAclForUserSpectraS3Request(final String userId) { this.userId = userId; - this.getQueryParams().put("user_id", UrlEscapers.urlFragmentEscaper().escape(userId).replace("+", "%2B")); + this.updateQueryParam("user_id", userId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Response.java index 65398ae7b..651ffd7ea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGlobalDataPolicyAclForUserSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Request.java index 1e736e36f..3df4e18ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutGroupGroupMemberSpectraS3Request extends AbstractRequest { @@ -36,8 +35,10 @@ public PutGroupGroupMemberSpectraS3Request(final UUID groupId, final UUID member this.groupId = groupId.toString(); this.memberGroupId = memberGroupId.toString(); - this.getQueryParams().put("group_id", groupId.toString()); - this.getQueryParams().put("member_group_id", memberGroupId.toString()); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("member_group_id", memberGroupId); + } @@ -45,8 +46,10 @@ public PutGroupGroupMemberSpectraS3Request(final String groupId, final String me this.groupId = groupId; this.memberGroupId = memberGroupId; - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); - this.getQueryParams().put("member_group_id", UrlEscapers.urlFragmentEscaper().escape(memberGroupId).replace("+", "%2B")); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("member_group_id", memberGroupId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Response.java index d36e4404d..ed56c1315 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupGroupMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Request.java index 2e734eb82..a9f9a3f9f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class PutGroupSpectraS3Request extends AbstractRequest { @@ -32,7 +31,8 @@ public class PutGroupSpectraS3Request extends AbstractRequest { public PutGroupSpectraS3Request(final String name) { this.name = name; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("name", name); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Response.java index 9132f9300..9a4524097 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Request.java index e33c7f136..1065a911e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.PoolType; public class PutPoolPartitionSpectraS3Request extends AbstractRequest { @@ -36,8 +35,10 @@ public PutPoolPartitionSpectraS3Request(final String name, final PoolType type) this.name = name; this.type = type; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("name", name); + + this.updateQueryParam("type", type); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Response.java index 51bd87b21..e703e4847 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolPartitionSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Request.java index f417afe6f..752c27ba6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.WritePreferenceLevel; public class PutPoolStorageDomainMemberSpectraS3Request extends AbstractRequest { @@ -39,8 +38,10 @@ public PutPoolStorageDomainMemberSpectraS3Request(final UUID poolPartitionId, fi this.poolPartitionId = poolPartitionId.toString(); this.storageDomainId = storageDomainId.toString(); - this.getQueryParams().put("pool_partition_id", poolPartitionId.toString()); - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); + this.updateQueryParam("pool_partition_id", poolPartitionId); + + this.updateQueryParam("storage_domain_id", storageDomainId); + } @@ -48,8 +49,10 @@ public PutPoolStorageDomainMemberSpectraS3Request(final String poolPartitionId, this.poolPartitionId = poolPartitionId; this.storageDomainId = storageDomainId; - this.getQueryParams().put("pool_partition_id", UrlEscapers.urlFragmentEscaper().escape(poolPartitionId).replace("+", "%2B")); - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); + this.updateQueryParam("pool_partition_id", poolPartitionId); + + this.updateQueryParam("storage_domain_id", storageDomainId); + } public PutPoolStorageDomainMemberSpectraS3Request withWritePreference(final WritePreferenceLevel writePreference) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Response.java index 28d3ac759..151decec6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutPoolStorageDomainMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Request.java index 6378999f3..3a62fc328 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.DataReplicationRuleType; import com.spectralogic.ds3client.models.S3InitialDataPlacementPolicy; @@ -47,9 +46,12 @@ public PutS3DataReplicationRuleSpectraS3Request(final UUID dataPolicyId, final U this.targetId = targetId.toString(); this.type = type; - this.getQueryParams().put("data_policy_id", dataPolicyId.toString()); - this.getQueryParams().put("target_id", targetId.toString()); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } @@ -58,9 +60,12 @@ public PutS3DataReplicationRuleSpectraS3Request(final String dataPolicyId, final this.targetId = targetId; this.type = type; - this.getQueryParams().put("data_policy_id", UrlEscapers.urlFragmentEscaper().escape(dataPolicyId).replace("+", "%2B")); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); - this.getQueryParams().put("type", type.toString()); + this.updateQueryParam("data_policy_id", dataPolicyId); + + this.updateQueryParam("target_id", targetId); + + this.updateQueryParam("type", type); + } public PutS3DataReplicationRuleSpectraS3Request withInitialDataPlacement(final S3InitialDataPlacementPolicy initialDataPlacement) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Response.java index d5eea0b2c..284ed58c8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3DataReplicationRuleSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Request.java index 7640f140c..d7a8de0bf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.util.UUID; public class PutS3TargetBucketNameSpectraS3Request extends AbstractRequest { @@ -39,9 +38,12 @@ public PutS3TargetBucketNameSpectraS3Request(final String bucketId, final String this.name = name; this.targetId = targetId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("target_id", targetId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("name", name); + + this.updateQueryParam("target_id", targetId); + } @@ -50,9 +52,12 @@ public PutS3TargetBucketNameSpectraS3Request(final String bucketId, final String this.name = name; this.targetId = targetId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("name", name); + + this.updateQueryParam("target_id", targetId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Response.java index d3715f991..c660a3366 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetBucketNameSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Request.java index cf5133e30..989c0a70d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -41,7 +40,8 @@ public class PutS3TargetFailureNotificationRegistrationSpectraS3Request extends public PutS3TargetFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { this.notificationEndPoint = notificationEndPoint; - this.getQueryParams().put("notification_end_point", UrlEscapers.urlFragmentEscaper().escape(notificationEndPoint).replace("+", "%2B")); + this.updateQueryParam("notification_end_point", notificationEndPoint); + } public PutS3TargetFailureNotificationRegistrationSpectraS3Request withFormat(final HttpResponseFormatType format) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Response.java index 4f898f602..2f819f91f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Request.java index 417f8a8b6..a07f707ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.TargetReadPreferenceType; import java.util.UUID; @@ -40,9 +39,12 @@ public PutS3TargetReadPreferenceSpectraS3Request(final String bucketId, final Ta this.readPreference = readPreference; this.targetId = targetId.toString(); - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", targetId.toString()); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } @@ -51,9 +53,12 @@ public PutS3TargetReadPreferenceSpectraS3Request(final String bucketId, final Ta this.readPreference = readPreference; this.targetId = targetId; - this.getQueryParams().put("bucket_id", bucketId); - this.getQueryParams().put("read_preference", readPreference.toString()); - this.getQueryParams().put("target_id", UrlEscapers.urlFragmentEscaper().escape(targetId).replace("+", "%2B")); + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("read_preference", readPreference); + + this.updateQueryParam("target_id", targetId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Response.java index 19182c768..12ad09914 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutS3TargetReadPreferenceSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Request.java index 214d05278..2a6af8467 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.lang.Long; import com.spectralogic.ds3client.models.LtfsFileNamingMode; import java.lang.Integer; @@ -61,7 +60,8 @@ public class PutStorageDomainSpectraS3Request extends AbstractRequest { public PutStorageDomainSpectraS3Request(final String name) { this.name = name; - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("name", name); + } public PutStorageDomainSpectraS3Request withAutoEjectMediaFullThreshold(final Long autoEjectMediaFullThreshold) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Response.java index 9fe3e5ff8..b5285075a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutStorageDomainSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Request.java index 3d3c8e018..5b4de1bf1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.TapeDriveType; import java.util.UUID; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.TapeType; public class PutTapeDensityDirectiveSpectraS3Request extends AbstractRequest { @@ -31,30 +29,36 @@ public class PutTapeDensityDirectiveSpectraS3Request extends AbstractRequest { private final String partitionId; - private final TapeType tapeType; + private final String tapeType; // Constructor - public PutTapeDensityDirectiveSpectraS3Request(final TapeDriveType density, final UUID partitionId, final TapeType tapeType) { + public PutTapeDensityDirectiveSpectraS3Request(final TapeDriveType density, final UUID partitionId, final String tapeType) { this.density = density; this.partitionId = partitionId.toString(); this.tapeType = tapeType; - this.getQueryParams().put("density", density.toString()); - this.getQueryParams().put("partition_id", partitionId.toString()); - this.getQueryParams().put("tape_type", tapeType.toString()); + this.updateQueryParam("density", density); + + this.updateQueryParam("partition_id", partitionId); + + this.updateQueryParam("tape_type", tapeType); + } - public PutTapeDensityDirectiveSpectraS3Request(final TapeDriveType density, final String partitionId, final TapeType tapeType) { + public PutTapeDensityDirectiveSpectraS3Request(final TapeDriveType density, final String partitionId, final String tapeType) { this.density = density; this.partitionId = partitionId; this.tapeType = tapeType; - this.getQueryParams().put("density", density.toString()); - this.getQueryParams().put("partition_id", UrlEscapers.urlFragmentEscaper().escape(partitionId).replace("+", "%2B")); - this.getQueryParams().put("tape_type", tapeType.toString()); + this.updateQueryParam("density", density); + + this.updateQueryParam("partition_id", partitionId); + + this.updateQueryParam("tape_type", tapeType); + } @@ -78,7 +82,7 @@ public String getPartitionId() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Response.java index b7385b626..ab33d841c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeDensityDirectiveSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Request.java index 5bc2450b5..0e6563fab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,8 +19,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.TapeType; +import java.lang.Integer; import com.spectralogic.ds3client.models.WritePreferenceLevel; public class PutTapeStorageDomainMemberSpectraS3Request extends AbstractRequest { @@ -31,34 +30,49 @@ public class PutTapeStorageDomainMemberSpectraS3Request extends AbstractRequest private final String tapePartitionId; - private final TapeType tapeType; + private final String tapeType; + + private Integer autoCompactionThreshold; private WritePreferenceLevel writePreference; // Constructor - public PutTapeStorageDomainMemberSpectraS3Request(final UUID storageDomainId, final UUID tapePartitionId, final TapeType tapeType) { + public PutTapeStorageDomainMemberSpectraS3Request(final UUID storageDomainId, final UUID tapePartitionId, final String tapeType) { this.storageDomainId = storageDomainId.toString(); this.tapePartitionId = tapePartitionId.toString(); this.tapeType = tapeType; - this.getQueryParams().put("storage_domain_id", storageDomainId.toString()); - this.getQueryParams().put("tape_partition_id", tapePartitionId.toString()); - this.getQueryParams().put("tape_type", tapeType.toString()); + this.updateQueryParam("storage_domain_id", storageDomainId); + + this.updateQueryParam("tape_partition_id", tapePartitionId); + + this.updateQueryParam("tape_type", tapeType); + } - public PutTapeStorageDomainMemberSpectraS3Request(final String storageDomainId, final String tapePartitionId, final TapeType tapeType) { + public PutTapeStorageDomainMemberSpectraS3Request(final String storageDomainId, final String tapePartitionId, final String tapeType) { this.storageDomainId = storageDomainId; this.tapePartitionId = tapePartitionId; this.tapeType = tapeType; - this.getQueryParams().put("storage_domain_id", UrlEscapers.urlFragmentEscaper().escape(storageDomainId).replace("+", "%2B")); - this.getQueryParams().put("tape_partition_id", UrlEscapers.urlFragmentEscaper().escape(tapePartitionId).replace("+", "%2B")); - this.getQueryParams().put("tape_type", tapeType.toString()); + this.updateQueryParam("storage_domain_id", storageDomainId); + + this.updateQueryParam("tape_partition_id", tapePartitionId); + + this.updateQueryParam("tape_type", tapeType); + } + public PutTapeStorageDomainMemberSpectraS3Request withAutoCompactionThreshold(final Integer autoCompactionThreshold) { + this.autoCompactionThreshold = autoCompactionThreshold; + this.updateQueryParam("auto_compaction_threshold", autoCompactionThreshold); + return this; + } + + public PutTapeStorageDomainMemberSpectraS3Request withWritePreference(final WritePreferenceLevel writePreference) { this.writePreference = writePreference; this.updateQueryParam("write_preference", writePreference); @@ -87,11 +101,16 @@ public String getTapePartitionId() { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } + public Integer getAutoCompactionThreshold() { + return this.autoCompactionThreshold; + } + + public WritePreferenceLevel getWritePreference() { return this.writePreference; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Response.java index 6cd6e7ec9..5b8805774 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutTapeStorageDomainMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Request.java index 855207b92..701a2a4ec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class PutUserGroupMemberSpectraS3Request extends AbstractRequest { @@ -36,8 +35,10 @@ public PutUserGroupMemberSpectraS3Request(final UUID groupId, final UUID memberU this.groupId = groupId.toString(); this.memberUserId = memberUserId.toString(); - this.getQueryParams().put("group_id", groupId.toString()); - this.getQueryParams().put("member_user_id", memberUserId.toString()); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("member_user_id", memberUserId); + } @@ -45,8 +46,10 @@ public PutUserGroupMemberSpectraS3Request(final String groupId, final String mem this.groupId = groupId; this.memberUserId = memberUserId; - this.getQueryParams().put("group_id", UrlEscapers.urlFragmentEscaper().escape(groupId).replace("+", "%2B")); - this.getQueryParams().put("member_user_id", UrlEscapers.urlFragmentEscaper().escape(memberUserId).replace("+", "%2B")); + this.updateQueryParam("group_id", groupId); + + this.updateQueryParam("member_user_id", memberUserId); + } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Response.java index 436441ae1..f65dec7c0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/PutUserGroupMemberSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Request.java index b9c45ab9a..d5144960d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,7 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; +import java.util.UUID; import com.spectralogic.ds3client.models.Priority; public class RawImportAllTapesSpectraS3Request extends AbstractRequest { @@ -27,6 +27,8 @@ public class RawImportAllTapesSpectraS3Request extends AbstractRequest { private final String bucketId; + private String storageDomainId; + private Priority taskPriority; // Constructor @@ -37,9 +39,24 @@ public RawImportAllTapesSpectraS3Request(final String bucketId) { this.getQueryParams().put("operation", "import"); - this.getQueryParams().put("bucket_id", bucketId); + this.updateQueryParam("bucket_id", bucketId); + } + public RawImportAllTapesSpectraS3Request withStorageDomainId(final UUID storageDomainId) { + this.storageDomainId = storageDomainId.toString(); + this.updateQueryParam("storage_domain_id", storageDomainId); + return this; + } + + + public RawImportAllTapesSpectraS3Request withStorageDomainId(final String storageDomainId) { + this.storageDomainId = storageDomainId; + this.updateQueryParam("storage_domain_id", storageDomainId); + return this; + } + + public RawImportAllTapesSpectraS3Request withTaskPriority(final Priority taskPriority) { this.taskPriority = taskPriority; this.updateQueryParam("task_priority", taskPriority); @@ -63,6 +80,11 @@ public String getBucketId() { } + public String getStorageDomainId() { + return this.storageDomainId; + } + + public Priority getTaskPriority() { return this.taskPriority; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Response.java index 63e9001ab..674f9862f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Request.java index b4f8fcd13..265a76568 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,8 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; -import com.spectralogic.ds3client.models.Priority; import java.util.UUID; +import com.spectralogic.ds3client.models.Priority; public class RawImportTapeSpectraS3Request extends AbstractRequest { @@ -30,6 +29,8 @@ public class RawImportTapeSpectraS3Request extends AbstractRequest { private final String bucketId; + private String storageDomainId; + private Priority taskPriority; // Constructor @@ -41,7 +42,8 @@ public RawImportTapeSpectraS3Request(final String bucketId, final UUID tapeId) { this.getQueryParams().put("operation", "import"); - this.getQueryParams().put("bucket_id", bucketId); + this.updateQueryParam("bucket_id", bucketId); + } @@ -51,9 +53,24 @@ public RawImportTapeSpectraS3Request(final String bucketId, final String tapeId) this.getQueryParams().put("operation", "import"); - this.getQueryParams().put("bucket_id", bucketId); + this.updateQueryParam("bucket_id", bucketId); + + } + + public RawImportTapeSpectraS3Request withStorageDomainId(final UUID storageDomainId) { + this.storageDomainId = storageDomainId.toString(); + this.updateQueryParam("storage_domain_id", storageDomainId); + return this; + } + + + public RawImportTapeSpectraS3Request withStorageDomainId(final String storageDomainId) { + this.storageDomainId = storageDomainId; + this.updateQueryParam("storage_domain_id", storageDomainId); + return this; } + public RawImportTapeSpectraS3Request withTaskPriority(final Priority taskPriority) { this.taskPriority = taskPriority; this.updateQueryParam("task_priority", taskPriority); @@ -82,6 +99,11 @@ public String getBucketId() { } + public String getStorageDomainId() { + return this.storageDomainId; + } + + public Priority getTaskPriority() { return this.taskPriority; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Response.java index c15f9a7ce..2b90b63b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RawImportTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Request.java index 14168cb54..13d484068 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class RegenerateUserSecretKeySpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Response.java index dd6ef43c2..caf26edd4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegenerateUserSecretKeySpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Request.java index bcd022d0f..f25370944 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; @@ -52,9 +51,12 @@ public RegisterAzureTargetSpectraS3Request(final String accountKey, final String this.accountName = accountName; this.name = name; - this.getQueryParams().put("account_key", UrlEscapers.urlFragmentEscaper().escape(accountKey).replace("+", "%2B")); - this.getQueryParams().put("account_name", UrlEscapers.urlFragmentEscaper().escape(accountName).replace("+", "%2B")); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("account_key", accountKey); + + this.updateQueryParam("account_name", accountName); + + this.updateQueryParam("name", name); + } public RegisterAzureTargetSpectraS3Request withAutoVerifyFrequencyInDays(final Integer autoVerifyFrequencyInDays) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Response.java index ee4179640..fec0c3ef7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Request.java index 3caadae86..5fdde82ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Ds3TargetAccessControlReplication; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; @@ -60,10 +59,14 @@ public RegisterDs3TargetSpectraS3Request(final String adminAuthId, final String this.dataPathEndPoint = dataPathEndPoint; this.name = name; - this.getQueryParams().put("admin_auth_id", UrlEscapers.urlFragmentEscaper().escape(adminAuthId).replace("+", "%2B")); - this.getQueryParams().put("admin_secret_key", UrlEscapers.urlFragmentEscaper().escape(adminSecretKey).replace("+", "%2B")); - this.getQueryParams().put("data_path_end_point", UrlEscapers.urlFragmentEscaper().escape(dataPathEndPoint).replace("+", "%2B")); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); + this.updateQueryParam("admin_auth_id", adminAuthId); + + this.updateQueryParam("admin_secret_key", adminSecretKey); + + this.updateQueryParam("data_path_end_point", dataPathEndPoint); + + this.updateQueryParam("name", name); + } public RegisterDs3TargetSpectraS3Request withAccessControlReplication(final Ds3TargetAccessControlReplication accessControlReplication) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Response.java index 27af0c77a..a1ca24da3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Request.java index d19844f81..1c30ecac1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,9 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import java.lang.Integer; import com.spectralogic.ds3client.models.TargetReadPreferenceType; +import com.spectralogic.ds3client.models.CloudNamingMode; import com.spectralogic.ds3client.models.S3Region; public class RegisterS3TargetSpectraS3Request extends AbstractRequest { @@ -45,6 +45,8 @@ public class RegisterS3TargetSpectraS3Request extends AbstractRequest { private boolean https; + private CloudNamingMode namingMode; + private int offlineDataStagingWindowInTb; private boolean permitGoingOutOfSync; @@ -61,6 +63,8 @@ public class RegisterS3TargetSpectraS3Request extends AbstractRequest { private S3Region region; + private boolean restrictedAccess; + private int stagedDataExpirationInDays; // Constructor @@ -71,9 +75,12 @@ public RegisterS3TargetSpectraS3Request(final String accessKey, final String nam this.name = name; this.secretKey = secretKey; - this.getQueryParams().put("access_key", UrlEscapers.urlFragmentEscaper().escape(accessKey).replace("+", "%2B")); - this.getQueryParams().put("name", UrlEscapers.urlFragmentEscaper().escape(name).replace("+", "%2B")); - this.getQueryParams().put("secret_key", UrlEscapers.urlFragmentEscaper().escape(secretKey).replace("+", "%2B")); + this.updateQueryParam("access_key", accessKey); + + this.updateQueryParam("name", name); + + this.updateQueryParam("secret_key", secretKey); + } public RegisterS3TargetSpectraS3Request withAutoVerifyFrequencyInDays(final Integer autoVerifyFrequencyInDays) { @@ -118,6 +125,13 @@ public RegisterS3TargetSpectraS3Request withHttps(final boolean https) { } + public RegisterS3TargetSpectraS3Request withNamingMode(final CloudNamingMode namingMode) { + this.namingMode = namingMode; + this.updateQueryParam("naming_mode", namingMode); + return this; + } + + public RegisterS3TargetSpectraS3Request withOfflineDataStagingWindowInTb(final int offlineDataStagingWindowInTb) { this.offlineDataStagingWindowInTb = offlineDataStagingWindowInTb; this.updateQueryParam("offline_data_staging_window_in_tb", offlineDataStagingWindowInTb); @@ -174,6 +188,13 @@ public RegisterS3TargetSpectraS3Request withRegion(final S3Region region) { } + public RegisterS3TargetSpectraS3Request withRestrictedAccess(final boolean restrictedAccess) { + this.restrictedAccess = restrictedAccess; + this.updateQueryParam("restricted_access", restrictedAccess); + return this; + } + + public RegisterS3TargetSpectraS3Request withStagedDataExpirationInDays(final int stagedDataExpirationInDays) { this.stagedDataExpirationInDays = stagedDataExpirationInDays; this.updateQueryParam("staged_data_expiration_in_days", stagedDataExpirationInDays); @@ -237,6 +258,11 @@ public boolean getHttps() { } + public CloudNamingMode getNamingMode() { + return this.namingMode; + } + + public int getOfflineDataStagingWindowInTb() { return this.offlineDataStagingWindowInTb; } @@ -277,6 +303,11 @@ public S3Region getRegion() { } + public boolean getRestrictedAccess() { + return this.restrictedAccess; + } + + public int getStagedDataExpirationInDays() { return this.stagedDataExpirationInDays; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Response.java index fb104e4c7..7a1f5939c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/RegisterS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Request.java index abf15f841..07c012e7c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,9 +21,9 @@ import java.io.InputStream; import java.nio.charset.Charset; import com.spectralogic.ds3client.utils.Guard; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Priority; -import com.google.common.net.UrlEscapers; public class ReplicatePutJobSpectraS3Request extends AbstractRequest { @@ -70,7 +70,7 @@ public InputStream getStream() { if (Guard.isStringNullOrEmpty(requestPayload)) { return null; } - final byte[] stringBytes = requestPayload.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = requestPayload.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Response.java index 8356906e1..d1b632f5b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ReplicatePutJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Request.java index bf7e006c9..1916a0baa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Response.java index c717e84e1..31204fdc8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/ResetInstanceIdentifierSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Request.java new file mode 100644 index 000000000..46f4eedf9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Request.java @@ -0,0 +1,64 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.BulkCommand; +import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.commands.interfaces.BulkRequest; +import com.spectralogic.ds3client.models.Priority; + +public class StageObjectsJobSpectraS3Request extends BulkRequest { + + + + private String name; + + // Constructor + + public StageObjectsJobSpectraS3Request(final String bucketName, final Iterable objects) { + super(bucketName, objects); + + this.getQueryParams().put("operation", "start_bulk_stage"); + + } + + public StageObjectsJobSpectraS3Request withName(final String name) { + this.name = name; + this.updateQueryParam("name", name); + return this; + } + + + @Override + public StageObjectsJobSpectraS3Request withPriority(final Priority priority) { + super.withPriority(priority); + return this; + } + + + + + public String getName() { + return this.name; + } + + + @Override + public BulkCommand getCommand() { + return BulkCommand.GET; + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Response.java new file mode 100644 index 000000000..0298c6d3b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/StageObjectsJobSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class StageObjectsJobSpectraS3Response extends AbstractResponse { + + private final MasterObjectList masterObjectListResult; + + public StageObjectsJobSpectraS3Response(final MasterObjectList masterObjectListResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.masterObjectListResult = masterObjectListResult; + } + + public MasterObjectList getMasterObjectListResult() { + return this.masterObjectListResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Request.java new file mode 100644 index 000000000..6fd6a57f1 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Request.java @@ -0,0 +1,101 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class TestTapeDriveSpectraS3Request extends AbstractRequest { + + // Variables + + private final String tapeDriveId; + + private boolean skipClean; + + private String tapeId; + + // Constructor + + + public TestTapeDriveSpectraS3Request(final UUID tapeDriveId) { + this.tapeDriveId = tapeDriveId.toString(); + + this.getQueryParams().put("operation", "test"); + + } + + + public TestTapeDriveSpectraS3Request(final String tapeDriveId) { + this.tapeDriveId = tapeDriveId; + + this.getQueryParams().put("operation", "test"); + + } + + public TestTapeDriveSpectraS3Request withSkipClean(final boolean skipClean) { + this.skipClean = skipClean; + if (this.skipClean) { + this.getQueryParams().put("skip_clean", null); + } else { + this.getQueryParams().remove("skip_clean"); + } + return this; + } + + + public TestTapeDriveSpectraS3Request withTapeId(final UUID tapeId) { + this.tapeId = tapeId.toString(); + this.updateQueryParam("tape_id", tapeId); + return this; + } + + + public TestTapeDriveSpectraS3Request withTapeId(final String tapeId) { + this.tapeId = tapeId; + this.updateQueryParam("tape_id", tapeId); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/tape_drive/" + tapeDriveId; + } + + public String getTapeDriveId() { + return this.tapeDriveId; + } + + + public boolean getSkipClean() { + return this.skipClean; + } + + + public String getTapeId() { + return this.tapeId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Response.java new file mode 100644 index 000000000..0c334f2eb --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TestTapeDriveSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.TapeDrive; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class TestTapeDriveSpectraS3Response extends AbstractResponse { + + private final TapeDrive tapeDriveResult; + + public TestTapeDriveSpectraS3Response(final TapeDrive tapeDriveResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.tapeDriveResult = tapeDriveResult; + } + + public TapeDrive getTapeDriveResult() { + return this.tapeDriveResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Request.java index e01c9fe88..e24fe5c16 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class TruncateActiveJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Response.java index 452a988e7..71a02771c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateActiveJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Request.java index e34bc8131..04a716d4d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobRequestType; public class TruncateAllActiveJobsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Response.java index f36b4d284..1fb3ee6fc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllActiveJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Request.java index 562e9db27..752fcfbb8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.JobRequestType; public class TruncateAllJobsSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Response.java index 4ae9455e2..7f95d1b21 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateAllJobsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Request.java index d7837cee0..45e188041 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class TruncateJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Response.java index dbfcf9e9e..02816d1ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/TruncateJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Request.java new file mode 100644 index 000000000..5fd5c53d1 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Request.java @@ -0,0 +1,85 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.networking.HttpVerb; +import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; +import java.util.UUID; + +public class UndeleteObjectSpectraS3Request extends AbstractRequest { + + // Variables + + private final String bucketId; + + private final String name; + + private String versionId; + + // Constructor + + + public UndeleteObjectSpectraS3Request(final String bucketId, final String name) { + this.bucketId = bucketId; + this.name = name; + + this.updateQueryParam("bucket_id", bucketId); + + this.updateQueryParam("name", name); + + } + + public UndeleteObjectSpectraS3Request withVersionId(final UUID versionId) { + this.versionId = versionId.toString(); + this.updateQueryParam("version_id", versionId); + return this; + } + + + public UndeleteObjectSpectraS3Request withVersionId(final String versionId) { + this.versionId = versionId; + this.updateQueryParam("version_id", versionId); + return this; + } + + + + @Override + public HttpVerb getVerb() { + return HttpVerb.PUT; + } + + @Override + public String getPath() { + return "/_rest_/object"; + } + + public String getBucketId() { + return this.bucketId; + } + + + public String getName() { + return this.name; + } + + + public String getVersionId() { + return this.versionId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Response.java new file mode 100644 index 000000000..8e54b8f85 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/UndeleteObjectSpectraS3Response.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.commands.spectrads3; + +import com.spectralogic.ds3client.models.S3Object; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.commands.interfaces.AbstractResponse; + +public class UndeleteObjectSpectraS3Response extends AbstractResponse { + + private final S3Object s3ObjectResult; + + public UndeleteObjectSpectraS3Response(final S3Object s3ObjectResult, final String checksum, final ChecksumType.Type checksumType) { + super(checksum, checksumType); + this.s3ObjectResult = s3ObjectResult; + } + + public S3Object getS3ObjectResult() { + return this.s3ObjectResult; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Request.java index 01ed03236..b93392715 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Response.java index 7963bbcc9..9180330a6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllPoolsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Request.java index 8d48ba46b..36120c446 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Response.java index 7a48373da..9c2d6d1b1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAllTapesSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Request.java index 8872aeefe..41ff60651 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class VerifyAzureTargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Response.java index f53bef49e..da6301bb7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyAzureTargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Request.java index 28def3be9..8a8e1ebcd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,8 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.Priority; public class VerifyBulkJobSpectraS3Request extends AbstractRequest { @@ -88,7 +88,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Response.java index 7fcee3d4c..a78ebde09 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyBulkJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Request.java index f9247e64a..bf5ce5898 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class VerifyDs3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Response.java index f02b4897f..43bdbe922 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyDs3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Request.java index 6a1f7f72c..7cf685b7d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,9 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; public class VerifyPhysicalPlacementForObjectsSpectraS3Request extends AbstractRequest { @@ -38,7 +37,7 @@ public class VerifyPhysicalPlacementForObjectsSpectraS3Request extends AbstractR private final List objects; - private String storageDomainId; + private String storageDomain; private long size = 0; // Constructor @@ -52,16 +51,9 @@ public VerifyPhysicalPlacementForObjectsSpectraS3Request(final String bucketName } - public VerifyPhysicalPlacementForObjectsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); - return this; - } - - - public VerifyPhysicalPlacementForObjectsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public VerifyPhysicalPlacementForObjectsSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } @@ -77,7 +69,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -107,8 +99,8 @@ public List getObjects() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Response.java index 1f60dcf14..20d52b7ea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java index 98b0597fb..2bb202512 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,9 +26,8 @@ import java.io.InputStream; import java.util.List; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import java.util.UUID; -import com.google.common.net.UrlEscapers; public class VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request extends AbstractRequest { @@ -38,7 +37,7 @@ public class VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request ex private final List objects; - private String storageDomainId; + private String storageDomain; private long size = 0; // Constructor @@ -53,16 +52,9 @@ public VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request(final St this.getQueryParams().put("full_details", null); } - public VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId.toString(); - this.updateQueryParam("storage_domain_id", storageDomainId); - return this; - } - - - public VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomainId(final String storageDomainId) { - this.storageDomainId = storageDomainId; - this.updateQueryParam("storage_domain_id", storageDomainId); + public VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request withStorageDomain(final String storageDomain) { + this.storageDomain = storageDomain; + this.updateQueryParam("storage_domain", storageDomain); return this; } @@ -78,7 +70,7 @@ public InputStream getStream() { final String xmlOutput = XmlOutput.toXml(objects, false); - final byte[] stringBytes = xmlOutput.getBytes(Charset.forName("UTF-8")); + final byte[] stringBytes = xmlOutput.getBytes(StandardCharsets.UTF_8); this.size = stringBytes.length; return new ByteArrayInputStream(stringBytes); } @@ -108,8 +100,8 @@ public List getObjects() { } - public String getStorageDomainId() { - return this.storageDomainId; + public String getStorageDomain() { + return this.storageDomain; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java index 7680e7cd5..e066b0b57 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Request.java index 093ad109c..7afa83637 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Priority; -import com.google.common.net.UrlEscapers; public class VerifyPoolSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Response.java index 29e1bb325..5d325990b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyPoolSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Request.java index 830dc5e4b..d4f75db83 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class VerifyS3TargetSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Response.java index 3087c073c..c77113e18 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyS3TargetSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Request.java index 4ce553bd4..70853353e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; -import com.google.common.net.UrlEscapers; public class VerifySafeToCreatePutJobSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Response.java index 6ca2c2a50..a22a8ae8f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySafeToCreatePutJobSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Request.java index 030b18f65..b0d76cbaf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Response.java index e0e72d5ba..05c676100 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifySystemHealthSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Request.java index 7d07ad53d..c05dee8d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import com.spectralogic.ds3client.models.Priority; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class VerifyTapeSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Response.java index e1b45a995..4f97f7161 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyTapeSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Request.java index f0c7a57c4..ac26cd5e5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class VerifyUserIsMemberOfGroupSpectraS3Request extends AbstractRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Response.java index 94009b5b4..99aa9614f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/VerifyUserIsMemberOfGroupSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request.java index 239b2eb54..35e84b092 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteDs3TargetFailureNotificationRegistrationSpectraS3Request(final Stri @Override public String getPath() { - return "/_rest_/ds3_target_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/ds3_target_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response.java index e0f75f5f3..8bdbd1f49 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteDs3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Request.java index e84345193..14e9a689d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteJobCompletedNotificationRegistrationSpectraS3Request(final String n @Override public String getPath() { - return "/_rest_/job_completed_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_completed_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Response.java index a1403a859..e1e31b800 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCompletedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Request.java index 10045c576..d1c0a415c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteJobCreatedNotificationRegistrationSpectraS3Request(final String not @Override public String getPath() { - return "/_rest_/job_created_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_created_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Response.java index f27c36d9b..535a56b95 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreatedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Request.java index 9a06fb366..b68da2972 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteJobCreationFailedNotificationRegistrationSpectraS3Request(final Str @Override public String getPath() { - return "/_rest_/job_creation_failed_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_creation_failed_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Response.java index 564ebf469..c9e1b2df8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteJobCreationFailedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Request.java index 35f63f505..a73b6cda5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteObjectCachedNotificationRegistrationSpectraS3Request(final String n @Override public String getPath() { - return "/_rest_/object_cached_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_cached_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Response.java index f61ca277e..c18a53289 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectCachedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Request.java index b92511a09..419a8d7e2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteObjectLostNotificationRegistrationSpectraS3Request(final String not @Override public String getPath() { - return "/_rest_/object_lost_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_lost_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Response.java index 5221f2e1b..1705afe49 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectLostNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Request.java index d75a92e97..9ce011ef1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteObjectPersistedNotificationRegistrationSpectraS3Request(final Strin @Override public String getPath() { - return "/_rest_/object_persisted_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_persisted_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Response.java index fff194657..a08aa5133 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteObjectPersistedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Request.java index 045c4be63..cb74477b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeletePoolFailureNotificationRegistrationSpectraS3Request(final String no @Override public String getPath() { - return "/_rest_/pool_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/pool_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Response.java index 4174721db..bf06599b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeletePoolFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Request.java index 8350fc75c..09aedaa7a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteStorageDomainFailureNotificationRegistrationSpectraS3Request(final @Override public String getPath() { - return "/_rest_/storage_domain_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/storage_domain_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Response.java index b035958e3..aebbe6857 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteStorageDomainFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Request.java index 91a3c30a7..817d89e3d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteSystemFailureNotificationRegistrationSpectraS3Request(final String @Override public String getPath() { - return "/_rest_/system_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/system_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Response.java index 183f5069e..bd64d26ab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteSystemFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Request.java index f98445e3e..bdaee9304 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteTapeFailureNotificationRegistrationSpectraS3Request(final String no @Override public String getPath() { - return "/_rest_/tape_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/tape_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Response.java index 50aa1fb94..721bad389 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapeFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request.java index ad2b4d91f..92a5f7a86 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,7 +43,7 @@ public DeleteTapePartitionFailureNotificationRegistrationSpectraS3Request(final @Override public String getPath() { - return "/_rest_/tape_partition_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/tape_partition_failure_notification_registration/" + this.getNotificationId(); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Response.java index 8a9f74686..2a9b44f3d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/DeleteTapePartitionFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Request.java index 9e80d7101..00710bb38 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetDs3TargetFailureNotificationRegistrationSpectraS3Request(final String @Override public String getPath() { - return "/_rest_/ds3_target_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/ds3_target_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Response.java index 9b7c3cf38..407dbbdc3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Request.java index f1bb46cc2..6d3fb4e93 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetDs3TargetFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Response.java index 53b74ab21..caf56f166 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetDs3TargetFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Request.java index 21a9adbd6..28e226129 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetJobCompletedNotificationRegistrationSpectraS3Request(final String noti @Override public String getPath() { - return "/_rest_/job_completed_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_completed_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Response.java index cbfdc201b..4268657db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Request.java index f2b3d9ced..e6a57a6b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobCompletedNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Response.java index 756b50d9b..4db276b5e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCompletedNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Request.java index 646f0e605..b8b2a92c7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetJobCreatedNotificationRegistrationSpectraS3Request(final String notifi @Override public String getPath() { - return "/_rest_/job_created_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_created_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Response.java index 934a0314f..94927fa8d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Request.java index 5c8bad1a8..d2a9be847 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobCreatedNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Response.java index 278783673..7811c97d7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreatedNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Request.java index 20e7cd585..cc8547b53 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetJobCreationFailedNotificationRegistrationSpectraS3Request(final String @Override public String getPath() { - return "/_rest_/job_creation_failed_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/job_creation_failed_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Response.java index af1b502cb..01797ea3c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Request.java index 6be541650..bde2a6de3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetJobCreationFailedNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Response.java index 850b774eb..05d3e759b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetJobCreationFailedNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Request.java index d8b426309..967c63fec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetObjectCachedNotificationRegistrationSpectraS3Request(final String noti @Override public String getPath() { - return "/_rest_/object_cached_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_cached_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Response.java index 731180a25..691a690f6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Request.java index 02ce173eb..e9d7ebdfa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetObjectCachedNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Response.java index bb7c598df..a0ef3a529 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectCachedNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Request.java index a41e27161..b7e840c5d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetObjectLostNotificationRegistrationSpectraS3Request(final String notifi @Override public String getPath() { - return "/_rest_/object_lost_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_lost_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Response.java index 21312e784..7b1c096b5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Request.java index 85083d677..13d0fcee4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetObjectLostNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Response.java index a032d4cb0..5bb71aede 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectLostNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Request.java index a89ee7b34..1cc004e57 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetObjectPersistedNotificationRegistrationSpectraS3Request(final String n @Override public String getPath() { - return "/_rest_/object_persisted_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/object_persisted_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Response.java index 6772cc4e5..b3f1f6a0a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Request.java index 55c8d1e9b..fabe3e549 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetObjectPersistedNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Response.java index 31ac328f4..aa183ac52 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetObjectPersistedNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Request.java index 17e3d0e4e..2b43e8b08 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetPoolFailureNotificationRegistrationSpectraS3Request(final String notif @Override public String getPath() { - return "/_rest_/pool_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/pool_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Response.java index ea6b89b81..a880d8541 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Request.java index 952fef6ed..1cedf1bb2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetPoolFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Response.java index 116453b38..fcefa44ba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetPoolFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Request.java index be4637f17..a3180e596 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetStorageDomainFailureNotificationRegistrationSpectraS3Request(final Str @Override public String getPath() { - return "/_rest_/storage_domain_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/storage_domain_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Response.java index 9a9933222..e268bfa6b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Request.java index 3e9836221..923319472 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetStorageDomainFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Response.java index cf0d0a603..b5eea2d60 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetStorageDomainFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Request.java index 2289782b3..1e4b67ccf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetSystemFailureNotificationRegistrationSpectraS3Request(final String not @Override public String getPath() { - return "/_rest_/system_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/system_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Response.java index 0ade5dd96..6e4e72c40 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Request.java index a018835c1..fa75e937b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetSystemFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Response.java index 04564a93c..b1c11422e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetSystemFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Request.java index 744f14a38..86605eb80 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetTapeFailureNotificationRegistrationSpectraS3Request(final String notif @Override public String getPath() { - return "/_rest_/tape_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/tape_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Response.java index 4852037ef..e23f371f2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Request.java index 68207df54..e6094566a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetTapeFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Response.java index a48adb0a0..ff1295e9b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapeFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Request.java index 4b0390c3c..7a8bc3e81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public GetTapePartitionFailureNotificationRegistrationSpectraS3Request(final Str @Override public String getPath() { - return "/_rest_/tape_partition_failure_notification_registration/" + this.getNotificationId().toString(); + return "/_rest_/tape_partition_failure_notification_registration/" + this.getNotificationId(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Response.java index 54f1e0b03..5da977780 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Request.java index 077fb3362..f39d1170f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.commands.interfaces.AbstractPaginationRequest; import java.util.UUID; -import com.google.common.net.UrlEscapers; public class GetTapePartitionFailureNotificationRegistrationsSpectraS3Request extends AbstractPaginationRequest { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Response.java index 12e896229..6e6d05b81 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/GetTapePartitionFailureNotificationRegistrationsSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Request.java index 548c7faf3..615d5f36f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutDs3TargetFailureNotificationRegistrationSpectraS3Request extends public PutDs3TargetFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Response.java index 931df29d4..8be3a0d9e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutDs3TargetFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Request.java index b4dcdb438..7e9a0dd41 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import java.util.UUID; import com.spectralogic.ds3client.models.NamingConventionType; @@ -38,7 +37,6 @@ public class PutJobCompletedNotificationRegistrationSpectraS3Request extends Abs public PutJobCompletedNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Response.java index cd589e443..c7c3d69e9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCompletedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Request.java index 5782cc444..9df0be2c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutJobCreatedNotificationRegistrationSpectraS3Request extends Abstr public PutJobCreatedNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Response.java index 569dcee13..75a9e1160 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreatedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Request.java index 08285353d..57e61668f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutJobCreationFailedNotificationRegistrationSpectraS3Request extend public PutJobCreationFailedNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Response.java index 9af036861..c82359c79 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutJobCreationFailedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Request.java index 7bf3a9d94..15e823e6e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import java.util.UUID; import com.spectralogic.ds3client.models.NamingConventionType; @@ -38,7 +37,6 @@ public class PutObjectCachedNotificationRegistrationSpectraS3Request extends Abs public PutObjectCachedNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Response.java index a02d08761..6bbe9cc48 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectCachedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Request.java index bef37e1e2..711e2a4c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutObjectLostNotificationRegistrationSpectraS3Request extends Abstr public PutObjectLostNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Response.java index 7949f5cd7..2703052a0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectLostNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Request.java index d94928346..5a1b60bb6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import java.util.UUID; import com.spectralogic.ds3client.models.NamingConventionType; @@ -38,7 +37,6 @@ public class PutObjectPersistedNotificationRegistrationSpectraS3Request extends public PutObjectPersistedNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Response.java index 585a1db1b..f8f03492c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutObjectPersistedNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Request.java index e9be01db0..13ce56cdc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutPoolFailureNotificationRegistrationSpectraS3Request extends Abst public PutPoolFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Response.java index c32b037ec..f8acc7762 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutPoolFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Request.java index 571a01fd8..a05f719af 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutStorageDomainFailureNotificationRegistrationSpectraS3Request ext public PutStorageDomainFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Response.java index a9e9278f4..7b3054a82 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutStorageDomainFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Request.java index b6e71d63d..3de6ca3ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutSystemFailureNotificationRegistrationSpectraS3Request extends Ab public PutSystemFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Response.java index ce258e9b0..4322b340c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutSystemFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Request.java index 121dbc3c4..1807bea52 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutTapeFailureNotificationRegistrationSpectraS3Request extends Abst public PutTapeFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Response.java index e53601094..55c17c2c5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapeFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Request.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Request.java index cb4d67fee..e743744f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Request.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Request.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ package com.spectralogic.ds3client.commands.spectrads3.notifications; import com.spectralogic.ds3client.commands.interfaces.AbstractCreateNotificationRequest; -import com.google.common.net.UrlEscapers; import com.spectralogic.ds3client.models.HttpResponseFormatType; import com.spectralogic.ds3client.models.NamingConventionType; import com.spectralogic.ds3client.models.RequestType; @@ -35,7 +34,6 @@ public class PutTapePartitionFailureNotificationRegistrationSpectraS3Request ext public PutTapePartitionFailureNotificationRegistrationSpectraS3Request(final String notificationEndPoint) { super(notificationEndPoint); - } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Response.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Response.java index bceeb2f86..61e135637 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Response.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/spectrads3/notifications/PutTapePartitionFailureNotificationRegistrationSpectraS3Response.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/ContentLengthNotMatchException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/ContentLengthNotMatchException.java index 66a14f8a1..950b474b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/ContentLengthNotMatchException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/ContentLengthNotMatchException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -22,7 +22,7 @@ public class ContentLengthNotMatchException extends IOException { private final long contentLength; private final long totalBytes; public ContentLengthNotMatchException(final String fileName, final long contentLength, final long totalBytes) { - super(String.format("The Content length for %s (%d) not match the number of byte read (%d)", fileName, contentLength, totalBytes)); + super(String.format("The Content length for %s (%d) does not match the number of bytes read (%d)", fileName, contentLength, totalBytes)); this.fileName = fileName; this.contentLength = contentLength; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/Ds3NoMoreRetriesException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/Ds3NoMoreRetriesException.java index 745facbb8..1622496ea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/Ds3NoMoreRetriesException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/Ds3NoMoreRetriesException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/FolderNameMissingTrailingForwardSlash.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/FolderNameMissingTrailingForwardSlash.java new file mode 100644 index 000000000..3bba12767 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/FolderNameMissingTrailingForwardSlash.java @@ -0,0 +1,26 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.exceptions; + +/** + * Denotes an invalid folder name. Folder names must end with a forward slash '/'. + */ +public class FolderNameMissingTrailingForwardSlash extends IllegalArgumentException { + + public FolderNameMissingTrailingForwardSlash(final String folderName) { + super("Invalid folder name '" + folderName + "': folder names must end with a forward slash '/'."); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/InvalidCertificate.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/InvalidCertificate.java index 4207a3175..377b66dfb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/InvalidCertificate.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/InvalidCertificate.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/RetryAfterExpectedException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/RetryAfterExpectedException.java index 197b34576..e810de2b0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/RetryAfterExpectedException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/RetryAfterExpectedException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToCommonPrefixesException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToCommonPrefixesException.java new file mode 100644 index 000000000..ab24a7e06 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToCommonPrefixesException.java @@ -0,0 +1,21 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.exceptions; +public class UnableToConvertToCommonPrefixesException extends RuntimeException { + public UnableToConvertToCommonPrefixesException(final String s) { + super(s); + } +} diff --git a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/IntValue.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToContentsException.java similarity index 71% rename from ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/IntValue.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToContentsException.java index 8a79b14ef..a2f932efd 100644 --- a/ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/IntValue.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/exceptions/UnableToConvertToContentsException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -12,17 +12,10 @@ * specific language governing permissions and limitations under the License. * **************************************************************************** */ +package com.spectralogic.ds3client.exceptions; -package com.spectralogic.ds3client; - -public final class IntValue { - private int intValue = 0; - - public int increment() { - return ++intValue; - } - - public int getValue() { - return intValue; +public class UnableToConvertToContentsException extends RuntimeException { + public UnableToConvertToContentsException(final String s) { + super(s); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/AutoCloseableCache.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/AutoCloseableCache.java deleted file mode 100644 index fff3b9ed3..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/AutoCloseableCache.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -class AutoCloseableCache implements AutoCloseable { - private final ValueBuilder valueBuilder; - private final Set closedKeys = new HashSet<>(); - private Map values = new HashMap<>(); - - public interface ValueBuilder { - Value get(final Key key); - } - - public AutoCloseableCache(final ValueBuilder valueBuilder) { - this.valueBuilder = valueBuilder; - } - - public synchronized Value get(final Key key) { - if (this.values == null) { - throw new IllegalStateException("Cache already closed."); - } - if (this.closedKeys.contains(key)) { - throw new IllegalStateException("Cache has already closed the requested key."); - } - Value value = this.values.get(key); - if (value == null) { - value = this.valueBuilder.get(key); - this.values.put(key, value); - } - return value; - } - - public synchronized void close(final Key key) throws Exception { - if (this.values == null) { - throw new IllegalStateException("Cache already closed."); - } - final Value value = this.values.remove(key); - if (value != null) { - value.close(); - } - this.closedKeys.add(key); - } - - @Override - public synchronized void close() throws Exception { - if (this.values != null) { - for (final Value value : this.values.values()) { - value.close(); - } - this.values = null; - } - } -} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumFunction.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumFunction.java index b9abe24c6..7dcae58d0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumFunction.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumFunction.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumListener.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumListener.java index 07c5d134f..45567f856 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumListener.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChecksumListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChunkTransferrer.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChunkTransferrer.java deleted file mode 100644 index d8afd0d95..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ChunkTransferrer.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers; - -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.ListeningExecutorService; -import com.google.common.util.concurrent.MoreExecutors; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.models.BulkObject; -import com.spectralogic.ds3client.helpers.strategy.BlobStrategy; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.Closeable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Executors; - -class ChunkTransferrer implements Closeable { - private final static Logger LOG = LoggerFactory.getLogger(ChunkTransferrer.class); - - private final ItemTransferrer itemTransferrer; - private final JobPartTracker partTracker; - private final ListeningExecutorService executor; - - public interface ItemTransferrer { - void transferItem(Ds3Client client, BulkObject ds3Object) throws IOException; - } - - public ChunkTransferrer( - final ItemTransferrer transferrer, - final JobPartTracker partTracker, - final int maxParallelRequests) { - this.itemTransferrer = transferrer; - this.partTracker = partTracker; - LOG.debug("Starting executor service"); - executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(maxParallelRequests)); - LOG.debug("Executor service started"); - } - - public void transferChunks( - final BlobStrategy blobStrategy) - throws IOException, InterruptedException { - final List> tasks = new ArrayList<>(); - - final Iterable work = blobStrategy.getWork(); - - for (final JobPart jobPart : work) { - final BulkObject blob = jobPart.getBulkObject(); - final ObjectPart part = new ObjectPart(blob.getOffset(), blob.getLength()); - - if (this.partTracker.containsPart(blob.getName(), part)) { - LOG.debug("Adding {} offset {} to executor for processing", blob.getName(), blob.getOffset()); - tasks.add(executor.submit(new Callable() { - @Override - public Object call() throws Exception { - LOG.debug("Processing {} offset {}", blob.getName(), blob.getOffset()); - ChunkTransferrer.this.itemTransferrer.transferItem(jobPart.getClient(), blob); - blobStrategy.blobCompleted(blob); - ChunkTransferrer.this.partTracker.completePart(blob.getName(), part); - return null; - } - })); - } - } - - executeWithExceptionHandling(tasks); - } - - @Override - public void close() throws IOException { - LOG.debug("Shutting down executor"); - executor.shutdown(); - } - - private static void executeWithExceptionHandling(final List> tasks) - throws IOException { - try { - // Block on the asynchronous result. - Futures.allAsList(tasks).get(); - } catch (final InterruptedException e) { - // This is a checked exception, but we don't want to expose that this is implemented with futures. - throw new RuntimeException(e); - } catch (final ExecutionException e) { - // The future throws a wrapper exception, but we want don't want to expose that this was implemented with futures. - final Throwable cause = e.getCause(); - - // Throw each of the advertised thrown exceptions. - if (cause instanceof IOException) { - throw (IOException)cause; - } - - // The rest we don't know about, so we'll just forward them. - if (cause instanceof RuntimeException) { - throw (RuntimeException)cause; - } else { - throw new RuntimeException(cause); - } - } - } -} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/DataTransferredListener.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/DataTransferredListener.java index 90c11f9fd..6de45730c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/DataTransferredListener.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/DataTransferredListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java index c029e1ce1..fa8ff3767 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,6 +20,9 @@ import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.helpers.options.ReadJobOptions; import com.spectralogic.ds3client.helpers.options.WriteJobOptions; +import com.spectralogic.ds3client.helpers.pagination.FileSystemKey; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.CanceledEventObserver; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; import com.spectralogic.ds3client.models.Contents; import com.spectralogic.ds3client.models.bulk.Ds3Object; import com.spectralogic.ds3client.utils.Predicate; @@ -118,6 +121,32 @@ public interface Job { */ void transfer(final ObjectChannelBuilder channelBuilder) throws IOException; + + /** + * Transfers the files in this job intended for use when you supply your own {@link TransferStrategy}. + * See {@link Ds3ClientHelpers#startReadJob(TransferStrategy)} and {@link Ds3ClientHelpers#startWriteJob(TransferStrategy)}. + * @throws IOException + */ + void transfer() throws IOException; + + /** + * Cancels a transfer in progress in the current job. + * @throws IOException + */ + void cancel() throws IOException; + + /** + * Attaches a handler that fires when a job transfer in progress is canceled. + * @param canceledEventObserver An event notification object that carries the job UUID. + * @return An observer instance that can be later used for de-registration. + */ + CanceledEventObserver attachCanceledEventObserver(final CanceledEventObserver canceledEventObserver); + + /** + * Remove an event handler previously registered with a call to {@link #attachCanceledEventObserver(CanceledEventObserver)} + * @param canceledEventObserver An instance of {@link CanceledEventObserver} returned from a call to {@link #attachCanceledEventObserver(CanceledEventObserver)} + */ + void removeCanceledEventObserver(final CanceledEventObserver canceledEventObserver); } /** @@ -171,6 +200,47 @@ public abstract Ds3ClientHelpers.Job startWriteJob(final String bucket, final It public abstract Ds3ClientHelpers.Job startWriteJob(final String bucket, final Iterable objectsToWrite, final WriteJobOptions options) throws IOException; + /** + * Performs a bulk put job creation request and returns a {@link WriteJobImpl}. The reason for using this + * method call is to gain fine-grained control over put job behavior using a transfer strategy. The most + * convenient way to create a transfer strategy is by using the {@link com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder} + * @param transferStrategy A strategy that provides fine-grained control over transfer behavior. + * @return An instance of {@link WriteJobImpl} + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startWriteJob(final TransferStrategy transferStrategy) + throws IOException; + + /** + * Performs a bulk put job creation request and returns an {@link WriteJobImpl} configured to perform a "streamed" + * transfer. "Streamed" means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * See {@link WriteJobImpl} for information on how to write the objects for the job. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startWriteJobUsingStreamedBehavior(final String bucket, final Iterable objectsToWrite) + throws IOException; + + public abstract Ds3ClientHelpers.Job startWriteJobUsingStreamedBehavior(final String bucket, final Iterable objectsToWrite, final WriteJobOptions options) + throws IOException; + + /** + * Performs a bulk put job creation request and returns an {@link WriteJobImpl} configured to perform a "random access" + * transfer. "Random access" means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. + * See {@link WriteJobImpl} for information on how to write the objects for the job. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startWriteJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToWrite) + throws IOException; + + public abstract Ds3ClientHelpers.Job startWriteJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToWrite, final WriteJobOptions options) + throws IOException; + /** * Performs a bulk get job creation request and returns an {@link ReadJobImpl}. * See {@link ReadJobImpl} for information on how to read the objects for the job. @@ -186,18 +256,49 @@ public abstract Ds3ClientHelpers.Job startReadJob(final String bucket, final Ite * * @throws IOException */ - public abstract Ds3ClientHelpers.Job startReadJob( - final String bucket, - final Iterable objectsToRead, - final ReadJobOptions options) + public abstract Ds3ClientHelpers.Job startReadJob(final String bucket, final Iterable objectsToRead, final ReadJobOptions options) throws IOException; /** - * Performs a bulk get job creation request for all of the objects in the given bucket and returns an {@link ReadJobImpl}. + * Performs a bulk get job creation request and returns an {@link ReadJobImpl}. + * The reason for using this + * method call is to gain fine-grained control over get job behavior using a transfer strategy. The most + * convenient way to create a transfer strategy is by using the {@link com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder} + * @param transferStrategy A strategy that provides fine-grained control over transfer behavior. + * @return An instance of {@link ReadJobImpl}. + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startReadJob(final TransferStrategy transferStrategy) + throws IOException; + + /** + * Performs a bulk get job creation request and returns an {@link ReadJobImpl} configured to perform a "streamed" + * transfer. "Streamed" means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * See {@link ReadJobImpl} for information on how to read the objects for the job. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startReadJobUsingStreamedBehavior(final String bucket, final Iterable objectsToRead) + throws IOException; + + public abstract Ds3ClientHelpers.Job startReadJobUsingStreamedBehavior(final String bucket, final Iterable objectsToRead, final ReadJobOptions options) + throws IOException; + + /** + * Performs a bulk get job creation request and returns an {@link ReadJobImpl} configured to perform a "random access" + * transfer. "Random access" means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. + * See {@link ReadJobImpl} for information on how to read the objects for the job. * * @throws IOException */ - public abstract Ds3ClientHelpers.Job startReadAllJob(final String bucket) + public abstract Ds3ClientHelpers.Job startReadJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToRead) + throws IOException; + + public abstract Ds3ClientHelpers.Job startReadJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToRead, final ReadJobOptions options) throws IOException; /** @@ -205,24 +306,90 @@ public abstract Ds3ClientHelpers.Job startReadAllJob(final String bucket) * * @throws IOException */ - public abstract Ds3ClientHelpers.Job startReadAllJob(final String bucket, final ReadJobOptions options) - throws IOException; + public abstract Ds3ClientHelpers.Job startReadAllJob(final String bucket) throws IOException; /** - * Queries job information based on job id and returns a {@link ReadJobImpl} that can resume the job. + * Performs a bulk get job creation request for all of the objects in the given bucket and returns an {@link ReadJobImpl}. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startReadAllJob(final String bucket, final ReadJobOptions options) throws IOException; + + /** + * Performs a bulk get job creation request for all of the objects in the given bucket and returns an {@link ReadJobImpl} + * configured to perform a "streamed" transfer. "Streamed" means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startReadAllJobUsingStreamedBehavior(final String bucket) throws IOException; + public abstract Ds3ClientHelpers.Job startReadAllJobUsingStreamedBehavior(final String bucket, final ReadJobOptions options) throws IOException; + + /** + * Performs a bulk get job creation request for all of the objects in the given bucket and returns an {@link ReadJobImpl} + * configured to perform a "random access" transfer. "Random access" means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. + * + * @throws IOException + */ + public abstract Ds3ClientHelpers.Job startReadAllJobUsingRandomAccessBehavior(final String bucket) throws IOException; + public abstract Ds3ClientHelpers.Job startReadAllJobUsingRandomAccessBehavior(final String bucket, final ReadJobOptions options) throws IOException; + + /** + * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job. + * @throws IOException + * @throws JobRecoveryException + */ + public abstract Ds3ClientHelpers.Job recoverWriteJob(final UUID jobId) throws IOException, JobRecoveryException; + + /** + * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job configured to + * perform a "streamed" transfer. "Streamed" means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * @throws IOException + * @throws JobRecoveryException + */ + public abstract Ds3ClientHelpers.Job recoverWriteJobUsingStreamedBehavior(final UUID jobId) throws IOException, JobRecoveryException; + + /** + * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job configured to + * perform a "random access" transfer. "Random access" means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. * @throws IOException * @throws JobRecoveryException */ - public abstract Ds3ClientHelpers.Job recoverWriteJob(final UUID jobId) - throws IOException, JobRecoveryException; + public abstract Ds3ClientHelpers.Job recoverWriteJobUsingRandomAccessBehavior(final UUID jobId) throws IOException, JobRecoveryException; /** * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job. * @throws IOException * @throws JobRecoveryException */ - public abstract Ds3ClientHelpers.Job recoverReadJob(final UUID jobId) - throws IOException, JobRecoveryException; + public abstract Ds3ClientHelpers.Job recoverReadJob(final UUID jobId) throws IOException, JobRecoveryException; + + /** + * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job configured to + * performed a "streamed" transfer. "Streamed" means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * @throws IOException + * @throws JobRecoveryException + */ + public abstract Ds3ClientHelpers.Job recoverReadJobsingStreamedBehavior(final UUID jobId) throws IOException, JobRecoveryException; + + /** + * Queries job information based on job id and returns a {@link WriteJobImpl} that can resume the job configured to + * perform a "random access" transfer. "Random access" means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. + * @throws IOException + * @throws JobRecoveryException + */ + public abstract Ds3ClientHelpers.Job recoverReadJobUsingRandomAccessBehavior(final UUID jobId) throws IOException, JobRecoveryException; /** * Ensures that a bucket exists. The the bucket does not exist, it will be created. @@ -321,6 +488,52 @@ public abstract Iterable listObjects(final String bucket, final String */ public abstract Iterable listObjectsForDirectory(final Path directory) throws IOException; + + /** + * The '/' character is traditionally used as a path delimiter, these methods provide '/' as a default delimiter. + * An S3 object like foo/bar/baz with the prefix of foo/ and the delimiter of '/' will act similar to a traditional file system + * proving a common prefix for each 'directory' descending from the current folder of the prefix. + * Returns an Iterable of {@link FileSystemKey} + * @param bucket The bucket + * @param keyPrefix Limits the response to keys that begin with the specified prefix + */ + public abstract Iterable remoteListDirectory(final String bucket, final String keyPrefix) throws IOException; + + /** + * Defaults to the path delimiter of '/' + * Returns an Iterable of {@link FileSystemKey} + * @param bucket The bucket + * @param keyPrefix Limits the response to keys that begin with the specified prefix + * @param nextMarker Specifies the key to start with + */ + public abstract Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String nextMarker) throws IOException; + + /** + * Defaults to the path delimiter of '/' + * Returns an Iterable of {@link FileSystemKey} + * @param bucket The bucket + * @param keyPrefix Limits the response to keys that begin with the specified prefix + * @param nextMarker Specifies the key to start with when listing objects + * @param maxKeys Sets the maximum number of keys returned in the response body. + */ + public abstract Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys) throws IOException; + + /** + * Returns an Iterable of {@link FileSystemKey} + * @param bucket The bucket + * @param keyPrefix Limits the response to keys that begin with the specified prefix + * @param delimiter Specifies a path delimiter for the S3 query + * @param nextMarker Specifies the key to start with when listing objects + * @param maxKeys Sets the maximum number of keys returned in the response body. + */ + public abstract Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String delimiter, final String nextMarker, final int maxKeys) throws IOException; + + /** + * + * @param bucket + */ + public abstract void deleteBucket(final String bucket) throws IOException; + /** * Returns an Iterable of {@link Ds3Object} that have a prefix added. */ @@ -336,33 +549,19 @@ public abstract Iterable listObjects(final String bucket, final String * that will be applied before converting. */ @SafeVarargs - public final Iterable toDs3Iterable(final Iterable objects, final Predicate... filters) { + public static Iterable toDs3Iterable(final Iterable objects, final Predicate... filters) { - FluentIterable fluentIterable = FluentIterable.from(objects).filter(new com.google.common.base.Predicate() { - @Override - public boolean apply(@Nullable final Contents input) { - return input != null; - } - }); + FluentIterable fluentIterable = FluentIterable.from(objects).filter(input -> input != null); if (filters != null) { for (final Predicate filter : filters) { - fluentIterable = fluentIterable.filter(new com.google.common.base.Predicate() { - @Override - public boolean apply(@Nullable final Contents input) { - return filter == null || filter.test(input); // do not filter anything if filter is null - } + fluentIterable = fluentIterable.filter(input -> { + return filter == null || filter.test(input); // do not filter anything if filter is null }); } } - return fluentIterable.transform(new Function() { - @Nullable - @Override - public Ds3Object apply(@Nullable final Contents input) { - return new Ds3Object(input.getKey(), input.getSize()); - } - }); + return fluentIterable.transform(new ContentsDs3ObjectFunction()); } /** @@ -393,4 +592,22 @@ public static String stripLeadingPath(final String objectName, final String pref public abstract ObjectStorageSpaceVerificationResult objectsFromBucketWillFitInDirectory(final String bucketName, final Collection objectNames, final Path destinationDirectory); + + /** + * Creates a folder in the specified bucket + */ + public abstract void createFolder(final String bucketName, final String folderName) throws IOException; + + /** + * Returns the client being wrapped + */ + public abstract Ds3Client getClient(); + + private static class ContentsDs3ObjectFunction implements Function { + @Nullable + @Override + public Ds3Object apply(@Nullable final Contents input) { + return new Ds3Object(input.getKey(), input.getSize()); + } + } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpersImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpersImpl.java index 060b7fc2f..a47b54814 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpersImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpersImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,119 +15,131 @@ package com.spectralogic.ds3client.helpers; -import com.google.common.base.Function; -import com.google.common.collect.FluentIterable; +import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Lists; import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.HeadBucketRequest; +import com.spectralogic.ds3client.commands.HeadBucketResponse; +import com.spectralogic.ds3client.commands.PutBucketRequest; +import com.spectralogic.ds3client.commands.PutObjectRequest; +import com.spectralogic.ds3client.commands.spectrads3.*; import com.spectralogic.ds3client.helpers.events.EventRunner; import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; -import com.spectralogic.ds3client.helpers.pagination.GetBucketLoaderFactory; -import com.spectralogic.ds3client.commands.*; -import com.spectralogic.ds3client.commands.spectrads3.*; import com.spectralogic.ds3client.helpers.options.ReadJobOptions; import com.spectralogic.ds3client.helpers.options.WriteJobOptions; +import com.spectralogic.ds3client.helpers.pagination.FileSystemKey; +import com.spectralogic.ds3client.helpers.pagination.GetBucketKeyLoaderFactory; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcherImpl; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; import com.spectralogic.ds3client.helpers.util.PartialObjectHelpers; import com.spectralogic.ds3client.models.*; -import com.spectralogic.ds3client.models.bulk.RequestType; +import com.spectralogic.ds3client.models.bulk.Ds3Object; import com.spectralogic.ds3client.models.common.Range; -import com.spectralogic.ds3client.models.bulk.*; import com.spectralogic.ds3client.networking.FailedRequestException; -import com.spectralogic.ds3client.utils.Guard; +import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import com.spectralogic.ds3client.utils.collections.StreamWrapper; import com.spectralogic.ds3client.utils.collections.LazyIterable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; import java.io.IOException; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; import java.util.Collection; -import java.util.List; import java.util.UUID; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; class Ds3ClientHelpersImpl extends Ds3ClientHelpers { - - public final static int DEFAULT_RETRY_DELAY = -1; - public final static int DEFAULT_RETRY_AFTER = -1; - public final static int DEFAULT_OBJECT_TRANSFER_ATTEMPTS = 5; - private final static Logger LOG = LoggerFactory.getLogger(Ds3ClientHelpersImpl.class); private final static int DEFAULT_LIST_OBJECTS_RETRIES = 5; + public final static String DEFAULT_DELIMITER = null; private final Ds3Client client; - private final int retryAfter; - private final int retryDelay; - private final int objectTransferAttempts; + private final int maxChunkAttempts; + private final int secondsBetweenChunkAttempts; + private final int maxObjectTransferAttempts; private final EventRunner eventRunner; private final FileSystemHelper fileSystemHelper; public Ds3ClientHelpersImpl(final Ds3Client client) { - this(client, DEFAULT_RETRY_AFTER); + this(client, TransferStrategyBuilder.DEFAULT_CHUNK_ATTEMPT_RETRY_ATTEMPTS); } - public Ds3ClientHelpersImpl(final Ds3Client client, final int retryAfter) { - this(client, retryAfter, DEFAULT_OBJECT_TRANSFER_ATTEMPTS); + public Ds3ClientHelpersImpl(final Ds3Client client, final int maxChunkAttempts) { + this(client, maxChunkAttempts, TransferStrategyBuilder.DEFAULT_OBJECT_TRANSFER_ATTEMPTS); } - public Ds3ClientHelpersImpl(final Ds3Client client, final int retryAfter, final int objectTransferAttempts) { - this(client, retryAfter, objectTransferAttempts, DEFAULT_RETRY_DELAY); + public Ds3ClientHelpersImpl(final Ds3Client client, final int maxChunkAttempts, final int maxObjectTransferAttempts) { + this(client, maxChunkAttempts, maxObjectTransferAttempts, TransferStrategyBuilder.DEFAULT_CHUNK_ATTEMPT_RETRY_INTERVAL); } - public Ds3ClientHelpersImpl(final Ds3Client client, final int retryAfter, final int objectTransferAttempts, final int retryDelay) { - this(client, retryAfter, objectTransferAttempts, retryDelay, new SameThreadEventRunner()); + public Ds3ClientHelpersImpl(final Ds3Client client, final int maxChunkAttempts, final int maxObjectTransferAttempts, final int secondsBetweenChunkAttempts) { + this(client, maxChunkAttempts, maxObjectTransferAttempts, secondsBetweenChunkAttempts, new SameThreadEventRunner()); } public Ds3ClientHelpersImpl(final Ds3Client client, - final int retryAfter, - final int objectTransferAttempts, - final int retryDelay, + final int maxChunkAttempts, + final int maxObjectTransferAttempts, + final int secondsBetweenChunkAttempts, final EventRunner eventRunner) { - this(client, retryAfter, objectTransferAttempts, retryDelay, eventRunner, new FileSystemHelperImpl()); + this(client, maxChunkAttempts, maxObjectTransferAttempts, secondsBetweenChunkAttempts, eventRunner, new FileSystemHelperImpl()); } public Ds3ClientHelpersImpl(final Ds3Client client, - final int retryAfter, - final int objectTransferAttempts, - final int retryDelay, + final int maxChunkAttempts, + final int maxObjectTransferAttempts, + final int secondsBetweenChunkAttempts, final EventRunner eventRunner, final FileSystemHelper fileSystemHelper) { this.client = client; - this.retryAfter = retryAfter; - this.objectTransferAttempts = objectTransferAttempts; - this.retryDelay = retryDelay; + this.maxChunkAttempts = maxChunkAttempts; + this.maxObjectTransferAttempts = maxObjectTransferAttempts; + this.secondsBetweenChunkAttempts = secondsBetweenChunkAttempts; this.eventRunner = eventRunner; this.fileSystemHelper = fileSystemHelper; } @Override public Ds3ClientHelpers.Job startWriteJob(final String bucket, final Iterable objectsToWrite) - throws IOException { - return innerStartWriteJob(bucket, objectsToWrite, WriteJobOptions.create()); + throws IOException + { + return startWriteJob(bucket, objectsToWrite, WriteJobOptions.create()); } @Override public Ds3ClientHelpers.Job startWriteJob(final String bucket, - final Iterable objectsToWrite, - final WriteJobOptions options) - throws IOException { + final Iterable objectsToWrite, + final WriteJobOptions options) + throws IOException + { if (options == null) { - return innerStartWriteJob(bucket, objectsToWrite, WriteJobOptions.create()); + return innerStartWriteJob(bucket, objectsToWrite, WriteJobOptions.create(), makeTransferStrategyBuilder()); } - return innerStartWriteJob(bucket, objectsToWrite, options); + + return innerStartWriteJob(bucket, objectsToWrite, options, makeTransferStrategyBuilder()); + } + + private TransferStrategyBuilder makeTransferStrategyBuilder() { + return new TransferStrategyBuilder() + .withDs3Client(client) + .withNumChunkAttemptRetries(maxChunkAttempts) + .withNumTransferRetries(maxObjectTransferAttempts) + .withChunkRetryDelayInSeconds(secondsBetweenChunkAttempts) + .withEventRunner(eventRunner) + .withEventDispatcher(new EventDispatcherImpl(eventRunner)); } private Ds3ClientHelpers.Job innerStartWriteJob(final String bucket, - final Iterable objectsToWrite, - final WriteJobOptions options) - throws IOException { - final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(bucket, Lists.newArrayList(objectsToWrite)) + final Iterable objectsToWrite, + final WriteJobOptions options, + final TransferStrategyBuilder transferStrategyBuilder) + throws IOException + { + final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(bucket, objectsToWrite) .withPriority(options.getPriority()) .withAggregating(options.isAggregating()) .withForce(options.isForce()) @@ -137,62 +149,146 @@ private Ds3ClientHelpers.Job innerStartWriteJob(final String bucket, request.withMaxUploadSize(options.getMaxUploadSize()); } - final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = this.client.putBulkJobSpectraS3( - request); + final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = this.client.putBulkJobSpectraS3(request); + transferStrategyBuilder.withMasterObjectList(putBulkJobSpectraS3Response.getMasterObjectList()) + .withChecksumType(options.getChecksumType()); - return new WriteJobImpl( - this.client, - putBulkJobSpectraS3Response.getMasterObjectList(), - this.retryAfter, - options.getChecksumType(), - this.objectTransferAttempts, - this.retryDelay, - this.eventRunner); + return new WriteJobImpl(transferStrategyBuilder); } @Override - public Ds3ClientHelpers.Job startReadJob(final String bucket, final Iterable objectsToRead) - throws IOException { - return innerStartReadJob(bucket, objectsToRead, ReadJobOptions.create()); + public Ds3ClientHelpers.Job startWriteJob(final TransferStrategy transferStrategy) + throws IOException + { + return new WriteJobImpl(transferStrategy); + } + + @Override + public Ds3ClientHelpers.Job startWriteJobUsingStreamedBehavior(final String bucket, final Iterable objectsToWrite) throws IOException { + return startWriteJobUsingStreamedBehavior(bucket, objectsToWrite, WriteJobOptions.create()); + } + + @Override + public Ds3ClientHelpers.Job startWriteJobUsingStreamedBehavior(final String bucket, + final Iterable objectsToWrite, + final WriteJobOptions options) + throws IOException + { + Preconditions.checkNotNull(options, "options may not be null."); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder(); + transferStrategyBuilder.usingStreamedTransferBehavior(); + + return innerStartWriteJob(bucket, objectsToWrite, options, transferStrategyBuilder); + } + + @Override + public Ds3ClientHelpers.Job startWriteJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToWrite) throws IOException { + return startWriteJobUsingRandomAccessBehavior(bucket, objectsToWrite, WriteJobOptions.create()); + } + + @Override + public Ds3ClientHelpers.Job startWriteJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToWrite, final WriteJobOptions options) throws IOException { + Preconditions.checkNotNull(options, "options may not be null."); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder(); + transferStrategyBuilder.usingRandomAccessTransferBehavior(); + + return innerStartWriteJob(bucket, objectsToWrite, options, transferStrategyBuilder); } @Override - public Ds3ClientHelpers.Job startReadJob(final String bucket, final Iterable objectsToRead, final ReadJobOptions options) + public Ds3ClientHelpers.Job startReadJob(final String bucket, final Iterable objectsToRead) throws IOException { + return startReadJob(bucket, objectsToRead, ReadJobOptions.create()); + } + + @Override + public Ds3ClientHelpers.Job startReadJob(final String bucket, final Iterable objects, final ReadJobOptions options) throws IOException { + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request; + if (options == null) { - return innerStartReadJob(bucket, objectsToRead, ReadJobOptions.create()); + getBulkJobSpectraS3Request = makeGetBulkJobSpectraS3Request(bucket, objects, ReadJobOptions.create()); + } else { + getBulkJobSpectraS3Request = makeGetBulkJobSpectraS3Request(bucket, objects, options); } - return innerStartReadJob(bucket, objectsToRead, options); + + getBulkJobSpectraS3Request.withChunkClientProcessingOrderGuarantee(JobChunkClientProcessingOrderGuarantee.NONE); + + return innerStartReadJob(objects, getBulkJobSpectraS3Request, makeTransferStrategyBuilder()); } - private Ds3ClientHelpers.Job innerStartReadJob(final String bucket, final Iterable objectsToRead, final ReadJobOptions options) - throws IOException { - final List objects = Lists.newArrayList(objectsToRead); - final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = new GetBulkJobSpectraS3Request(bucket, objects) - .withChunkClientProcessingOrderGuarantee(JobChunkClientProcessingOrderGuarantee.NONE) - .withPriority(options.getPriority()); - if (!Guard.isStringNullOrEmpty(options.getName())) { - getBulkJobSpectraS3Request.withName(options.getName()); - } + private static GetBulkJobSpectraS3Request makeGetBulkJobSpectraS3Request(final String bucket, final Iterable objects, final ReadJobOptions options) { + return new GetBulkJobSpectraS3Request(bucket, objects) + .withPriority(options.getPriority()) + .withName(options.getName()); + } + private Ds3ClientHelpers.Job innerStartReadJob(final Iterable objects, + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request, + final TransferStrategyBuilder transferStrategyBuilder) + throws IOException + { final GetBulkJobSpectraS3Response getBulkJobSpectraS3Response = this.client.getBulkJobSpectraS3(getBulkJobSpectraS3Request); final ImmutableMultimap partialRanges = PartialObjectHelpers.getPartialObjectsRanges(objects); - return new ReadJobImpl( - this.client, - getBulkJobSpectraS3Response.getMasterObjectList(), - partialRanges, - this.objectTransferAttempts, - this.retryAfter, - this.retryDelay, - this.eventRunner); + final MasterObjectList masterObjectList = getBulkJobSpectraS3Response.getMasterObjectList(); + + transferStrategyBuilder + .withMasterObjectList(masterObjectList) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), partialRanges)); + + return new ReadJobImpl(transferStrategyBuilder); } @Override - public Ds3ClientHelpers.Job startReadAllJob(final String bucket) - throws IOException { + public Ds3ClientHelpers.Job startReadJob(final TransferStrategy transferStrategy) throws IOException { + return new ReadJobImpl(transferStrategy); + } + + @Override + public Ds3ClientHelpers.Job startReadJobUsingStreamedBehavior(final String bucket, final Iterable objectsToRead) throws IOException { + return startReadJobUsingStreamedBehavior(bucket, objectsToRead, ReadJobOptions.create()); + } + + @Override + public Ds3ClientHelpers.Job startReadJobUsingStreamedBehavior(final String bucket, final Iterable objects, final ReadJobOptions options) throws IOException { + Preconditions.checkNotNull(options, "options may not be null."); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = makeGetBulkJobSpectraS3Request(bucket, objects, options); + + getBulkJobSpectraS3Request.withChunkClientProcessingOrderGuarantee(JobChunkClientProcessingOrderGuarantee.IN_ORDER); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder(); + transferStrategyBuilder.usingStreamedTransferBehavior(); + + return innerStartReadJob(objects, getBulkJobSpectraS3Request, transferStrategyBuilder); + } + + @Override + public Ds3ClientHelpers.Job startReadJobUsingRandomAccessBehavior(final String bucket, final Iterable objectsToRead) throws IOException { + return startReadJobUsingRandomAccessBehavior(bucket, objectsToRead, ReadJobOptions.create()); + } + + @Override + public Ds3ClientHelpers.Job startReadJobUsingRandomAccessBehavior(final String bucket, final Iterable objects, final ReadJobOptions options) throws IOException { + Preconditions.checkNotNull(options, "options may not be null."); + + final GetBulkJobSpectraS3Request getBulkJobSpectraS3Request = makeGetBulkJobSpectraS3Request(bucket, objects, options); + + getBulkJobSpectraS3Request.withChunkClientProcessingOrderGuarantee(JobChunkClientProcessingOrderGuarantee.NONE); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder(); + transferStrategyBuilder.usingRandomAccessTransferBehavior(); + + return innerStartReadJob(objects, getBulkJobSpectraS3Request, transferStrategyBuilder); + } + + @Override + public Ds3ClientHelpers.Job startReadAllJob(final String bucket) throws IOException { return innerStartReadAllJob(bucket, ReadJobOptions.create()); } @@ -205,60 +301,54 @@ public Ds3ClientHelpers.Job startReadAllJob(final String bucket, final ReadJobOp return innerStartReadAllJob(bucket, options); } - private Ds3ClientHelpers.Job innerStartReadAllJob(final String bucket, final ReadJobOptions options) - throws IOException { - final Iterable contentsList = this.listObjects(bucket); + private Ds3ClientHelpers.Job innerStartReadAllJob(final String bucket, final ReadJobOptions options) throws IOException { + return this.startReadJob(bucket, makeBlobList(bucket), options); + } - final Iterable ds3Objects = this.toDs3Iterable(contentsList, FolderNameFilter.filter()); + private Iterable makeBlobList(final String bucket) throws IOException { + final Iterable contentsList = listObjects(bucket); - return this.startReadJob(bucket, ds3Objects, options); + return toDs3Iterable(contentsList, FolderNameFilter.filter()); } - @Override - public Ds3ClientHelpers.Job recoverWriteJob(final UUID jobId) throws IOException, JobRecoveryException { - innerVerifyJobActive(jobId); - final ModifyJobSpectraS3Response jobResponse = this.client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(jobId.toString())); - if (JobRequestType.PUT != jobResponse.getMasterObjectListResult().getRequestType()) { - throw new JobRecoveryTypeException( - RequestType.PUT.toString(), - jobResponse.getMasterObjectListResult().getRequestType().toString()); - } - // TODO Need to allow the user to pass in the checksumming information again - return new WriteJobImpl( - this.client, - jobResponse.getMasterObjectListResult(), - this.retryAfter, - ChecksumType.Type.NONE, - this.objectTransferAttempts, - this.retryDelay, - this.eventRunner); + public Ds3ClientHelpers.Job startReadAllJobUsingStreamedBehavior(final String bucket) throws IOException { + return startReadAllJobUsingStreamedBehavior(bucket, ReadJobOptions.create()); + } + + public Ds3ClientHelpers.Job startReadAllJobUsingStreamedBehavior(final String bucket, final ReadJobOptions options) throws IOException { + Preconditions.checkNotNull(options, "options may not be null."); + + return startReadJobUsingStreamedBehavior(bucket, makeBlobList(bucket), options); + } + + public Ds3ClientHelpers.Job startReadAllJobUsingRandomAccessBehavior(final String bucket) throws IOException { + return startReadAllJobUsingRandomAccessBehavior(bucket, ReadJobOptions.create()); } + public Ds3ClientHelpers.Job startReadAllJobUsingRandomAccessBehavior(final String bucket, final ReadJobOptions options) throws IOException { + Preconditions.checkNotNull(options, "options may not be null."); + + return startReadJobUsingRandomAccessBehavior(bucket, makeBlobList(bucket), options); + } + + // TODO Need to allow the user to pass in the checksumming information again @Override - //TODO add a partial object read recovery method. That method will require the list of partial objects. - public Ds3ClientHelpers.Job recoverReadJob(final UUID jobId) throws IOException, JobRecoveryException { + public Ds3ClientHelpers.Job recoverWriteJob(final UUID jobId) throws IOException, JobRecoveryException { innerVerifyJobActive(jobId); - final ModifyJobSpectraS3Response jobResponse = this.client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(jobId.toString())); - if (JobRequestType.GET != jobResponse.getMasterObjectListResult().getRequestType()){ - throw new JobRecoveryTypeException( - RequestType.GET.toString(), - jobResponse.getMasterObjectListResult().getRequestType().toString() ); - } - return new ReadJobImpl( - this.client, - jobResponse.getMasterObjectListResult(), - ImmutableMultimap.of(), - this.objectTransferAttempts, - this.retryAfter, - this.retryDelay, - this.eventRunner); + + final ModifyJobSpectraS3Response jobResponse = modifyJobSpectraS3Response(jobId, JobRequestType.PUT); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(jobResponse.getMasterObjectListResult()) + .withChecksumType(ChecksumType.Type.NONE); + + return new WriteJobImpl(transferStrategyBuilder); } /** * Verifies that the specified job is active. If the job is not active, then a * JobRecoveryNotActiveException is thrown. - * @throws IOException - * @throws JobRecoveryNotActiveException + * @throws JobRecoveryNotActiveException This is thrown when the job is no longer active when a recovery is attempted */ private void innerVerifyJobActive(final UUID jobId) throws IOException, JobRecoveryNotActiveException { try { @@ -271,6 +361,90 @@ private void innerVerifyJobActive(final UUID jobId) throws IOException, JobRecov } } + private ModifyJobSpectraS3Response modifyJobSpectraS3Response(final UUID jobId, final JobRequestType jobRequestType) throws IOException, JobRecoveryException { + final ModifyJobSpectraS3Response jobResponse = client.modifyJobSpectraS3(new ModifyJobSpectraS3Request(jobId.toString())); + + if (jobRequestType != jobResponse.getMasterObjectListResult().getRequestType()) { + throw new JobRecoveryTypeException(jobRequestType.toString(), jobResponse.getMasterObjectListResult().getRequestType().toString()); + } + + return jobResponse; + } + + public Ds3ClientHelpers.Job recoverWriteJobUsingStreamedBehavior(final UUID jobId) throws IOException, JobRecoveryException { + innerVerifyJobActive(jobId); + + final ModifyJobSpectraS3Response jobResponse = modifyJobSpectraS3Response(jobId, JobRequestType.PUT); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(jobResponse.getMasterObjectListResult()) + .withChecksumType(ChecksumType.Type.NONE) + .usingStreamedTransferBehavior(); + + return new WriteJobImpl(transferStrategyBuilder); + } + + public Ds3ClientHelpers.Job recoverWriteJobUsingRandomAccessBehavior(final UUID jobId) throws IOException, JobRecoveryException { + innerVerifyJobActive(jobId); + + final ModifyJobSpectraS3Response jobResponse = modifyJobSpectraS3Response(jobId, JobRequestType.PUT); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(jobResponse.getMasterObjectListResult()) + .withChecksumType(ChecksumType.Type.NONE) + .usingRandomAccessTransferBehavior(); + + return new WriteJobImpl(transferStrategyBuilder); + } + + @Override + //TODO add a partial object read recovery method. That method will require the list of partial objects. + public Ds3ClientHelpers.Job recoverReadJob(final UUID jobId) throws IOException, JobRecoveryException { + innerVerifyJobActive(jobId); + + final MasterObjectList masterObjectList = masterObjectListForGetJob(jobId); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(masterObjectList) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), ImmutableMultimap.of())); + + return new ReadJobImpl(transferStrategyBuilder); + } + + private MasterObjectList masterObjectListForGetJob(final UUID jobId) throws IOException, JobRecoveryException { + final ModifyJobSpectraS3Response jobResponse = modifyJobSpectraS3Response(jobId, JobRequestType.GET); + + return jobResponse.getMasterObjectListResult(); + } + + @Override + public Ds3ClientHelpers.Job recoverReadJobsingStreamedBehavior(final UUID jobId) throws IOException, JobRecoveryException { + innerVerifyJobActive(jobId); + + final MasterObjectList masterObjectList = masterObjectListForGetJob(jobId); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(masterObjectList) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), ImmutableMultimap.of())) + .usingStreamedTransferBehavior(); + + return new ReadJobImpl(transferStrategyBuilder); + } + + @Override + public Ds3ClientHelpers.Job recoverReadJobUsingRandomAccessBehavior(final UUID jobId) throws IOException, JobRecoveryException { + innerVerifyJobActive(jobId); + + final MasterObjectList masterObjectList = masterObjectListForGetJob(jobId); + + final TransferStrategyBuilder transferStrategyBuilder = makeTransferStrategyBuilder() + .withMasterObjectList(masterObjectList) + .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), ImmutableMultimap.of())) + .usingRandomAccessTransferBehavior(); + + return new ReadJobImpl(transferStrategyBuilder); + } + @Override public void ensureBucketExists(final String bucket) throws IOException { final HeadBucketResponse response = this.client.headBucket(new HeadBucketRequest(bucket)); @@ -319,50 +493,55 @@ public Iterable listObjects(final String bucket, final String keyPrefi @Override public Iterable listObjects(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys) { - return new LazyIterable<>(new GetBucketLoaderFactory(client, bucket, keyPrefix, nextMarker, maxKeys, DEFAULT_LIST_OBJECTS_RETRIES)); + return this.listObjects(bucket, keyPrefix, nextMarker, maxKeys, DEFAULT_LIST_OBJECTS_RETRIES); } @Override public Iterable listObjects(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys, final int retries) { - return new LazyIterable<>(new GetBucketLoaderFactory(client, bucket, keyPrefix, nextMarker, maxKeys, retries)); + return new LazyIterable<>(new GetBucketKeyLoaderFactory<>(client, bucket, keyPrefix, DEFAULT_DELIMITER, nextMarker, maxKeys, retries, GetBucketKeyLoaderFactory.contentsFunction)); } @Override public Iterable listObjectsForDirectory(final Path directory) throws IOException { - final ImmutableList.Builder objects = ImmutableList.builder(); - Files.walkFileTree(directory, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { - objects.add(new Ds3Object(directory.relativize(file).toString().replace("\\", "/"), Files.size(file))); - return FileVisitResult.CONTINUE; - } - }); - return objects.build(); + return FileTreeWalker.INSTANCE.walk(directory); + } + + @Override + public Iterable remoteListDirectory(final String bucket, final String keyPrefix) throws IOException { + return this.remoteListDirectory(bucket, keyPrefix, null); + } + + @Override + public Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String nextMarker) throws IOException { + return this.remoteListDirectory(bucket, keyPrefix, nextMarker,1000); + } + @Override + public Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys) throws IOException { + return remoteListDirectory(bucket,keyPrefix,"/", keyPrefix, maxKeys); + } + + public Iterable remoteListDirectory(final String bucket, final String keyPrefix, final String delimiter, final String nextMarker, final int maxKeys) throws IOException { + return new LazyIterable<>(new GetBucketKeyLoaderFactory<>(client, bucket, keyPrefix, delimiter, nextMarker, maxKeys, DEFAULT_LIST_OBJECTS_RETRIES, GetBucketKeyLoaderFactory.getFileSystemKeysFunction)); } + @Override + public void deleteBucket(final String bucket) throws IOException { + DeleteBucket.INSTANCE.deleteBucket(this, bucket); + } + + @Override public Iterable addPrefixToDs3ObjectsList(final Iterable objectsList, final String prefix) { - final FluentIterable objectIterable = FluentIterable.from(objectsList); + final Stream objectIterable = StreamSupport.stream(objectsList.spliterator(), false); - return objectIterable.transform(new Function() { - @Nullable - @Override - public Ds3Object apply(@Nullable final Ds3Object object) { - return new Ds3Object( prefix + object.getName(), object.getSize()); - } - }); + return StreamWrapper.wrapStream(objectIterable.map(obj -> new Ds3Object(prefix + obj.getName(), obj.getSize()))); } + @Override public Iterable removePrefixFromDs3ObjectsList(final Iterable objectsList, final String prefix) { - final FluentIterable objectIterable = FluentIterable.from(objectsList); + final Stream objectIterable = StreamSupport.stream(objectsList.spliterator(), false); - return objectIterable.transform(new Function() { - @Nullable - @Override - public Ds3Object apply(@Nullable final Ds3Object object) { - return new Ds3Object(stripLeadingPath(object.getName(), prefix), object.getSize()); - } - }); + return StreamWrapper.wrapStream(objectIterable.map(obj -> new Ds3Object(stripLeadingPath(obj.getName(), prefix), obj.getSize()))); } /** @@ -385,4 +564,42 @@ public ObjectStorageSpaceVerificationResult objectsFromBucketWillFitInDirectory( return fileSystemHelper.objectsFromBucketWillFitInDirectory(this, bucketName, objectNames, destinationDirectory); } + + /** + * Creates a folder in the specified bucket. + */ + @Override + public void createFolder(final String bucketName, final String folderName) throws IOException { + final String normalizedFolderName = ensureNameEndsWithSlash(folderName); + + final Ds3Object ds3Object = new Ds3Object(normalizedFolderName, 0); + final PutBulkJobSpectraS3Response jobResponse = client + .putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(bucketName, ImmutableList.of(ds3Object))); + + final PutObjectRequest folderRequest = new PutObjectRequest( + bucketName, + normalizedFolderName, + new ByteArraySeekableByteChannel(0), + jobResponse.getMasterObjectList().getJobId(), + 0, + 0); + + client.putObject(folderRequest); + } + + @Override + public Ds3Client getClient() { + return client; + } + + /** + * Ensures that a folder names ends with a trailing forward slash. This prevents the + * accidental creation of zero-length files when attempting to create a folder. + */ + private static String ensureNameEndsWithSlash(final String folderName) { + if (folderName.endsWith("/")) { + return folderName; + } + return folderName + "/"; + } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ExceptionClassifier.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ExceptionClassifier.java index 00be54730..09f7250db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ExceptionClassifier.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ExceptionClassifier.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -22,7 +22,7 @@ public final class ExceptionClassifier { private ExceptionClassifier() { } public static boolean isRecoverableException(final Throwable t) { - if (t instanceof UnrecoverableIOException || t instanceof FileSystemException || t instanceof SecurityException) { + if (t instanceof UnrecoverableIOException || t instanceof FileSystemException || t instanceof SecurityException || t instanceof NoSuchMethodException) { return false; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectGetter.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectGetter.java index a6973dc46..97b289f89 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectGetter.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectGetter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,7 +15,9 @@ package com.spectralogic.ds3client.helpers; +import com.google.common.util.concurrent.Striped; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder; +import com.spectralogic.ds3client.utils.FileUtils; import java.io.IOException; import java.nio.channels.FileChannel; @@ -23,19 +25,23 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; +import java.util.concurrent.locks.Lock; /** * Writes files to the local file system preserving the path. */ public class FileObjectGetter implements ObjectChannelBuilder { private final Path root; + private final Striped striped; /** * Creates a new FileObjectGetter to retrieve files from a remote DS3 system to the local file system. + * * @param root The {@code root} directory of the local file system for all files being transferred. */ public FileObjectGetter(final Path root) { this.root = root; + this.striped = Striped.lazyWeakLock(10); } @Override @@ -43,13 +49,31 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { final Path objectPath = this.root.resolve(key); final Path parentPath = objectPath.getParent(); if (parentPath != null) { - Files.createDirectories(parentPath); + Files.createDirectories(FileUtils.resolveForSymbolic(parentPath)); + } + + if (!FileUtils.isTransferablePath(objectPath)) { + throw new UnrecoverableIOException(objectPath + " is not a regular file."); + } + + final Lock lock = striped.get(key); + try { + lock.lock(); + if (Files.notExists(objectPath)) { + Files.createDirectories(objectPath.getParent()); + return FileChannel.open( + objectPath, + StandardOpenOption.SPARSE, + StandardOpenOption.WRITE, + StandardOpenOption.CREATE_NEW + ); + } + } finally { + lock.unlock(); } return FileChannel.open( - objectPath, - StandardOpenOption.WRITE, - StandardOpenOption.CREATE, - StandardOpenOption.TRUNCATE_EXISTING + objectPath, + StandardOpenOption.WRITE ); } -} +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectPutter.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectPutter.java index ed5256308..a519d608f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectPutter.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileObjectPutter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -43,6 +43,10 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { final Path path = this.root.resolve(key); + if ( ! FileUtils.isTransferablePath(path)) { + throw new UnrecoverableIOException(path + " is not a regular file."); + } + return FileChannel.open(FileUtils.resolveForSymbolic(path), StandardOpenOption.READ); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelper.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelper.java index 027978e4d..bf353702a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelper.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelper.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelperImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelperImpl.java index e36e55983..e816bfd89 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelperImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FileSystemHelperImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -137,9 +137,9 @@ public ObjectStorageSpaceVerificationResult objectsFromBucketWillFitInDirectory( return new ObjectStorageSpaceVerificationResult(verificationStatus, requiredSpace, availableSpace, ioException); } - private long getRequiredSpaceForObjects(final Ds3ClientHelpers helpers, - final String bucketName, - final Collection objectNames) + private static long getRequiredSpaceForObjects(final Ds3ClientHelpers helpers, + final String bucketName, + final Collection objectNames) throws IOException { long result = 0; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FolderNameFilter.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FolderNameFilter.java index f20832470..d4d896a72 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FolderNameFilter.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/FolderNameFilter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobImpl.java index 0fbe8e685..50e914fcd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,73 +15,56 @@ package com.spectralogic.ds3client.helpers; -import com.google.common.collect.Sets; -import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.Job; -import com.spectralogic.ds3client.helpers.events.EventRunner; -import com.spectralogic.ds3client.helpers.events.FailureEvent; -import com.spectralogic.ds3client.models.BulkObject; -import com.spectralogic.ds3client.models.ChecksumType; -import com.spectralogic.ds3client.models.MasterObjectList; -import com.spectralogic.ds3client.models.Objects; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.CanceledEventObserver; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.List; -import java.util.Set; import java.util.UUID; -import static com.spectralogic.ds3client.helpers.ReadJobImpl.getAllBlobApiBeans; - abstract class JobImpl implements Job { private static final Logger LOG = LoggerFactory.getLogger(JobImpl.class); - protected final Ds3Client client; - protected final MasterObjectList masterObjectList; protected boolean running = false; - protected int maxParallelRequests = 10; - private final int objectTransferAttempts; - private final JobPartTrackerDecorator jobPartTracker; - private final EventRunner eventRunner; - private final Set failureEventListeners; - private final Set waitingForChunksListeners; - private final Set checksumListeners; - public JobImpl(final Ds3Client client, - final MasterObjectList masterObjectList, - final int objectTransferAttempts, - final EventRunner eventRunner) { - this.client = client; - this.masterObjectList = masterObjectList; - this.objectTransferAttempts = objectTransferAttempts; - this.eventRunner = eventRunner; - this.failureEventListeners = Sets.newIdentityHashSet(); - this.waitingForChunksListeners = Sets.newIdentityHashSet(); - this.checksumListeners = Sets.newIdentityHashSet(); - this.jobPartTracker = makeJobPartTracker(getChunks(masterObjectList), eventRunner); + private final TransferStrategyBuilder transferStrategyBuilder; + + public JobImpl() { + this(null); + } + + public JobImpl(final TransferStrategyBuilder transferStrategyBuilder) { + this.transferStrategyBuilder = transferStrategyBuilder; } - + @Override public UUID getJobId() { - if (this.masterObjectList == null) { + try { + return transferStrategyBuilder.masterObjectList().getJobId(); + } catch (final Throwable t) { + LOG.warn("Could not get job id.", t); return null; } - return this.masterObjectList.getJobId(); } @Override public String getBucketName() { - if (this.masterObjectList == null) { + try { + return transferStrategyBuilder.masterObjectList().getBucketName(); + } catch (final Throwable t) { + LOG.warn("Could not get bucket name.", t); return null; } - return this.masterObjectList.getBucketName(); } - + @Override public Job withMaxParallelRequests(final int maxParallelRequests) { - this.maxParallelRequests = maxParallelRequests; + transferStrategyBuilder.withNumConcurrentTransferThreads(maxParallelRequests); return this; } @@ -89,202 +72,94 @@ protected void checkRunning() { if (running) throw new IllegalStateException("You cannot modify a job after calling transfer"); } - protected void transferItem( - final Ds3Client client, - final BulkObject ds3Object, - final ChunkTransferrer.ItemTransferrer itemTransferrer) - throws IOException - { - int objectTransfersAttempted = 0; - - while(true) { - try { - itemTransferrer.transferItem(client, ds3Object); - break; - } catch (final Throwable t) { - if (ExceptionClassifier.isUnrecoverableException(t) || ++objectTransfersAttempted >= objectTransferAttempts) { - throw t; - } - } - } - } - - protected EventRunner getEventRunner() { - return eventRunner; - } - @Override public void attachChecksumListener(final ChecksumListener listener) { checkRunning(); - this.checksumListeners.add(listener); + eventDispatcher().attachChecksumListener(listener); } @Override public void removeChecksumListener(final ChecksumListener listener) { checkRunning(); - this.checksumListeners.remove(listener); + eventDispatcher().removeChecksumListener(listener); } @Override public void attachWaitingForChunksListener(final WaitingForChunksListener listener) { checkRunning(); - this.waitingForChunksListeners.add(listener); + eventDispatcher().attachWaitingForChunksListener(listener); } @Override public void removeWaitingForChunksListener(final WaitingForChunksListener listener) { checkRunning(); - this.waitingForChunksListeners.remove(listener); + eventDispatcher().removeWaitingForChunksListener(listener); } @Override public void attachFailureEventListener(final FailureEventListener listener) { checkRunning(); - this.failureEventListeners.add(listener); + eventDispatcher().attachFailureEventListener(listener); } @Override public void removeFailureEventListener(final FailureEventListener listener) { checkRunning(); - this.failureEventListeners.remove(listener); + eventDispatcher().removeFailureEventListener(listener); } @Override public void attachDataTransferredListener(final DataTransferredListener listener) { checkRunning(); - getJobPartTracker().attachDataTransferredListener(listener); + eventDispatcher().attachDataTransferredListener(listener); } @Override public void removeDataTransferredListener(final DataTransferredListener listener) { checkRunning(); - getJobPartTracker().removeDataTransferredListener(listener); + eventDispatcher().removeDataTransferredListener(listener); } @Override public void attachObjectCompletedListener(final ObjectCompletedListener listener) { checkRunning(); - getJobPartTracker().attachClientObjectCompletedListener(listener); + eventDispatcher().attachObjectCompletedListener(listener); } @Override public void removeObjectCompletedListener(final ObjectCompletedListener listener) { checkRunning(); - getJobPartTracker().removeClientObjectCompletedListener(listener); - } - - protected void emitFailureEvent(final FailureEvent failureEvent) { - for (final FailureEventListener failureEventListener : failureEventListeners) { - eventRunner.emitEvent(new Runnable() { - @Override - public void run() { - failureEventListener.onFailure(failureEvent); - } - }); - } + eventDispatcher().removeObjectCompletedListener(listener); } - protected FailureEvent makeFailureEvent(final FailureEvent.FailureActivity failureActivity, - final Throwable causalException, - final Objects chunk) - { - return FailureEvent.builder() - .doingWhat(failureActivity) - .withCausalException(causalException) - .withObjectNamed(getLabelForChunk(chunk)) - .usingSystemWithEndpoint(client.getConnectionDetails().getEndpoint()) - .build(); + @Override + public CanceledEventObserver attachCanceledEventObserver(final CanceledEventObserver canceledEventObserver) { + checkRunning(); + return eventDispatcher().attachCanceledEventObserver(canceledEventObserver); } - protected String getLabelForChunk(final Objects chunk) { - try { - return chunk.getObjects().get(0).getName(); - } catch (final Throwable t) { - LOG.error("Failed to get label for chunk.", t); - } - - return "unnamed object"; + @Override + public void removeCanceledEventObserver(final CanceledEventObserver canceledEventObserver) { + checkRunning(); + eventDispatcher().removeCanceledEventObserver(canceledEventObserver); } - protected void emitWaitingForChunksEvents(final int retryAfter) { - for (final WaitingForChunksListener waitingForChunksListener : waitingForChunksListeners) { - eventRunner.emitEvent(new Runnable() { - @Override - public void run() { - waitingForChunksListener.waiting(retryAfter); - } - }); - } + @Override + public void transfer(final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) throws IOException { + transferStrategyBuilder.withChannelBuilder(channelBuilder); } - protected void emitChecksumEvents(final BulkObject bulkObject, final ChecksumType.Type type, final String checksum) { - for (final ChecksumListener listener : checksumListeners) { - getEventRunner().emitEvent(new Runnable() { - @Override - public void run() { - listener.value(bulkObject, type, checksum); - } - }); - } + protected TransferStrategyBuilder transferStrategyBuilder() { + return transferStrategyBuilder; } - protected abstract List getChunks(final MasterObjectList masterObjectList); - protected abstract JobPartTrackerDecorator makeJobPartTracker(final List chunks, final EventRunner eventRunner); - - protected JobPartTrackerDecorator getJobPartTracker() { - return jobPartTracker; + protected EventDispatcher eventDispatcher() { + return transferStrategyBuilder.eventDispatcher(); } - protected static class JobPartTrackerDecorator implements JobPartTracker { - private final JobPartTracker clientJobPartTracker; - private final JobPartTracker internalJobPartTracker; - - protected JobPartTrackerDecorator(final List chunks, final EventRunner eventRunner) { - clientJobPartTracker = JobPartTrackerFactory.buildPartTracker(getAllBlobApiBeans(chunks), eventRunner); - internalJobPartTracker = JobPartTrackerFactory.buildPartTracker(getAllBlobApiBeans(chunks), eventRunner); - } - - @Override - public void completePart(final String key, final ObjectPart objectPart) { - // It's important to fire the internal completions -- those we set up to close channels we - // have opened -- before firing client-registered events. The reason is that some clients - // rely upon this ordering to know that channels are closed when their event handlers run. - internalJobPartTracker.completePart(key, objectPart); - clientJobPartTracker.completePart(key, objectPart); - } - - @Override - public boolean containsPart(final String key, final ObjectPart objectPart) { - return internalJobPartTracker.containsPart(key, objectPart) || clientJobPartTracker.containsPart(key, objectPart); - } - - @Override - public JobPartTracker attachDataTransferredListener(final DataTransferredListener listener) { - return clientJobPartTracker.attachDataTransferredListener(listener); - } - - @Override - public JobPartTracker attachObjectCompletedListener(final ObjectCompletedListener listener) { - internalJobPartTracker.attachObjectCompletedListener(listener); - return this; - } - - @Override - public void removeDataTransferredListener(final DataTransferredListener listener) { - clientJobPartTracker.removeDataTransferredListener(listener); - } - - @Override - public void removeObjectCompletedListener(final ObjectCompletedListener listener) { - internalJobPartTracker.removeObjectCompletedListener(listener); - } - - protected void attachClientObjectCompletedListener(final ObjectCompletedListener listener) { - clientJobPartTracker.attachObjectCompletedListener(listener); - } - - protected void removeClientObjectCompletedListener(final ObjectCompletedListener listener) { - clientJobPartTracker.removeObjectCompletedListener(listener); + protected static void cancel(final TransferStrategy transferStrategy) throws IOException { + if (transferStrategy != null) { + transferStrategy.cancel(); } } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPart.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPart.java index 794efb118..e9d62227f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPart.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPart.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,21 +18,31 @@ import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.models.BulkObject; +/** + * A class that associates a blob with the Black Pearl on which it resides. + */ public class JobPart { private final Ds3Client client; - private final BulkObject bulkObject; + private final BulkObject blob; - public JobPart(final Ds3Client client, final BulkObject bulkObject) { + public JobPart(final Ds3Client client, final BulkObject blob) { this.client = client; - this.bulkObject = bulkObject; + this.blob = blob; } public Ds3Client getClient() { return client; } - public BulkObject getBulkObject() { - return bulkObject; + public BulkObject getBlob() { + return blob; } + @Override + public String toString() { + return "JobPart{" + + "client=" + client + + ", blob=" + blob + + '}'; + } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTracker.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTracker.java index 4cc675bbc..6280a29fa 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTracker.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTracker.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory.java index 01247d99e..3d18a1918 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,7 +26,7 @@ import java.util.Collection; import java.util.HashMap; -final class JobPartTrackerFactory { +public final class JobPartTrackerFactory { public static JobPartTracker buildPartTracker(final Iterable objects, final EventRunner eventRunner) { final ArrayListMultimap multimap = ArrayListMultimap.create(); for (final BulkObject bulkObject : Preconditions.checkNotNull(objects)) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerImpl.java index df4a78128..7ce67b7b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobPartTrackerImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryException.java index 877ab6a8d..4f9751703 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryNotActiveException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryNotActiveException.java index 386d055bf..10f87c167 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryNotActiveException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryNotActiveException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryTypeException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryTypeException.java index f897cec38..645a35421 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryTypeException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobRecoveryTypeException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobState.java index 9428fbdaf..7b25ca161 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/JobState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,105 +15,117 @@ package com.spectralogic.ds3client.helpers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMultimap; -import com.spectralogic.ds3client.helpers.AutoCloseableCache.ValueBuilder; -import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder; -import com.spectralogic.ds3client.helpers.channels.RangedSeekableByteChannel; -import com.spectralogic.ds3client.helpers.channels.WindowedChannelFactory; +import com.google.common.collect.Sets; import com.spectralogic.ds3client.models.BulkObject; import com.spectralogic.ds3client.models.Objects; -import com.spectralogic.ds3client.models.common.Range; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import com.spectralogic.ds3client.models.PhysicalPlacement; -import java.io.IOException; -import java.nio.channels.SeekableByteChannel; import java.util.Collection; -import java.util.HashSet; -import java.util.concurrent.atomic.AtomicInteger; +import java.util.Set; +import java.util.UUID; -class JobState implements AutoCloseable { +public class JobState { + private final Set blobs = Sets.newConcurrentHashSet(); - private static final Logger LOG = LoggerFactory.getLogger(JobState.class); + private final int numBlobsInJob; - private final AtomicInteger objectsRemaining; - private final AutoCloseableCache channelCache; - private final JobPartTracker partTracker; + public JobState(final Collection chunksThatContainBlobs) { + int numBlobsInChunks = 0; - public JobState( - final ObjectChannelBuilder channelBuilder, - final Collection filteredChunks, - final JobPartTracker partTracker, - final ImmutableMap> objectRanges) { - this.objectsRemaining = new AtomicInteger(getObjectCount(filteredChunks)); - this.channelCache = buildCache(channelBuilder, objectRanges); - this.partTracker = partTracker.attachObjectCompletedListener(new ObjectCompletedListenerImpl()); - } - - public boolean hasObjects() { - return this.objectsRemaining.get() > 0; - } - - private static int getObjectCount(final Collection chunks) { - final HashSet result = new HashSet<>(); - for (final Objects chunk : chunks) { - for (final BulkObject bulkObject : chunk.getObjects()) { - result.add(bulkObject.getName()); + for (final Objects chunk : chunksThatContainBlobs) { + for (final BulkObject blob : chunk.getObjects()) { + blobs.add(new BlobIdentityDecorator(blob)); + ++numBlobsInChunks; } } - return result.size(); + + numBlobsInJob = numBlobsInChunks; } - private static AutoCloseableCache buildCache( - final ObjectChannelBuilder channelBuilder, - final ImmutableMap> objectRanges) { - return new AutoCloseableCache<>( - new ValueBuilder() { - @Override - public WindowedChannelFactory get(final String key) { - try { - LOG.debug("Opening channel for: {}", key); - return new WindowedChannelFactory(RangedSeekableByteChannel.wrap(channelBuilder.buildChannel(key), objectRanges.get(key), key)); - } catch (final IOException e) { - throw new RuntimeException(e); - } - } - } - ); + public boolean blobTransferredOrFailed(final BulkObject blob) { + return blobs.remove(new BlobIdentityDecorator(blob)); + } + + public boolean contains(final BulkObject blob) { + return blobs.contains(new BlobIdentityDecorator(blob)); } - @Override - public void close() throws Exception { - this.channelCache.close(); + public boolean isEmpty() { + return blobs.isEmpty(); } - public JobPartTracker getPartTracker() { - return partTracker; + public int numBlobsInJob() { + return numBlobsInJob; } - private final class ObjectCompletedListenerImpl implements ObjectCompletedListener { + /** + * This class is used to know whether we have attempted to transfer a blob. In getting the master object list from + * a call to either getBulkJobSpectraS3 or putBulkJobSpectraS3, the resulting blobs will have their inCache property + * marked false. In the master object list returned from a call to either allocateChunk or + * getJobChunksReadyForClientProcessingSpectraS3, the resulting blobs may or may not have the same value for + * their inCache property. Since the BlackPearl may continually send us a blob that will always fail to transfer, + * we check to see if a blob in the master object list we get during a transfer is in the master object list we + * get when initiating a job. If not, we can assume that we have previously tried and failed to transfer that + * blob and skip it. + */ + private static class BlobIdentityDecorator { + private final String bucket; + + private final UUID id; + + private final boolean latest; + + private final long length; + + private final String name; + + private final long offset; + + private final PhysicalPlacement physicalPlacement; + + private final UUID versionId; + + private BlobIdentityDecorator(final BulkObject blob) { + this.bucket = blob.getBucket(); + this.id = blob.getId(); + this.latest = blob.getLatest(); + this.length = blob.getLength(); + this.name = blob.getName(); + this.offset = blob.getOffset(); + this.physicalPlacement = blob.getPhysicalPlacement(); + this.versionId = blob.getVersionId(); + } + @Override - public void objectCompleted(final String name) { - JobState.this.objectsRemaining.decrementAndGet(); - try { - LOG.debug("Closing file: {}", name); - JobState.this.channelCache.close(name); - } catch (final Exception e) { - throw new RuntimeException(e); - } + public boolean equals(final Object o) { + if (this == o) return true; + if (!(o instanceof BlobIdentityDecorator)) return false; + + final BlobIdentityDecorator that = (BlobIdentityDecorator) o; + + if (latest != that.latest) return false; + if (length != that.length) return false; + if (offset != that.offset) return false; + if (versionId != null ? !versionId.equals(that.versionId) : that.versionId != null) return false; + if (bucket != null ? !bucket.equals(that.bucket) : that.bucket != null) return false; + if (id != null ? !id.equals(that.id) : that.id != null) return false; + if (name != null ? !name.equals(that.name) : that.name != null) return false; + return physicalPlacement != null ? physicalPlacement.equals(that.physicalPlacement) : that.physicalPlacement == null; } - } - public SeekableByteChannel getChannel(final String name, final long offset, final long length) { - return this.channelCache.get(name).get(offset, length); - } + @Override + public int hashCode() { + return java.util.Objects.hash(bucket, id, latest, length, name, offset, physicalPlacement, versionId); + } - @Override - public String toString() { - return "JobState{" + - "objectsRemaining=" + objectsRemaining + - ", partTracker=" + partTracker + - '}'; + @Override + public String toString() { + return "BlobIdentityDecorator{" + + "bucket='" + bucket + '\'' + + ", length=" + length + + ", name='" + name + '\'' + + ", offset=" + offset + + '}'; + } } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectChannelBuilderLogger.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectChannelBuilderLogger.java index 2d7e49a71..9f8e7a32d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectChannelBuilderLogger.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectChannelBuilderLogger.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectCompletedListener.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectCompletedListener.java index 2984c010f..426b6ca3e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectCompletedListener.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectCompletedListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPart.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPart.java index 6ae3fa771..4b0376d15 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPart.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPart.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartComparator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartComparator.java index 2e1a978da..c737eade9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartComparator.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartComparator.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTracker.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTracker.java index deb09490d..3ba543720 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTracker.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTracker.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl.java index a5f585898..ebea3d373 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -100,23 +100,43 @@ private synchronized void validateParts() { private void onDataTransferred(final long size) { for (final DataTransferredListener listener : this.dataTransferredListeners) { - eventRunner.emitEvent(new Runnable() { - @Override - public void run() { - listener.dataTransferred(size); - } - }); + eventRunner.emitEvent(new DataTransferredRunnable(listener, size)); } } private void onObjectCompleted() { for (final ObjectCompletedListener listener : this.objectCompletedListeners) { - eventRunner.emitEvent(new Runnable() { - @Override - public void run() { - listener.objectCompleted(name); - } - }); + eventRunner.emitEvent(new ObjectCompletedRunnable(listener, name)); + } + } + + private static class ObjectCompletedRunnable implements Runnable { + private final ObjectCompletedListener listener; + private final String name; + + public ObjectCompletedRunnable(final ObjectCompletedListener listener, final String name) { + this.listener = listener; + this.name = name; + } + + @Override + public void run() { + listener.objectCompleted(name); + } + } + + private static class DataTransferredRunnable implements Runnable { + private final DataTransferredListener listener; + private final long size; + + public DataTransferredRunnable(final DataTransferredListener listener, final long size) { + this.listener = listener; + this.size = size; + } + + @Override + public void run() { + listener.dataTransferred(size); } } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectStorageSpaceVerificationResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectStorageSpaceVerificationResult.java index cc1f02491..a55cb6a97 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectStorageSpaceVerificationResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ObjectStorageSpaceVerificationResult.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ReadJobImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ReadJobImpl.java index 940d14290..1c7b5e208 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ReadJobImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/ReadJobImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,71 +15,35 @@ package com.spectralogic.ds3client.helpers; -import com.google.common.collect.*; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.commands.GetObjectRequest; -import com.spectralogic.ds3client.commands.GetObjectResponse; -import com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException; -import com.spectralogic.ds3client.helpers.ChunkTransferrer.ItemTransferrer; +import com.google.common.base.Preconditions; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder; -import com.spectralogic.ds3client.helpers.events.EventRunner; -import com.spectralogic.ds3client.helpers.events.FailureEvent; -import com.spectralogic.ds3client.helpers.strategy.BlobStrategy; -import com.spectralogic.ds3client.helpers.strategy.GetStreamerStrategy; -import com.spectralogic.ds3client.helpers.util.PartialObjectHelpers; -import com.spectralogic.ds3client.models.*; -import com.spectralogic.ds3client.models.common.Range; -import com.spectralogic.ds3client.networking.Metadata; -import com.spectralogic.ds3client.utils.Guard; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.MetaDataReceivedObserver; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; import java.io.IOException; -import java.util.List; -import java.util.Set; class ReadJobImpl extends JobImpl { + private TransferStrategy transferStrategy; - private final ImmutableMap> blobToRanges; - private final Set metadataListeners; - - private final int retryAfter; // Negative retryAfter value represent infinity retries - private final int retryDelay; // Negative value represents default - - public ReadJobImpl( - final Ds3Client client, - final MasterObjectList masterObjectList, - final ImmutableMultimap objectRanges, - final int objectTransferAttempts, - final int retryAfter, - final int retryDelay, - final EventRunner eventRunner - ) { - super(client, masterObjectList, objectTransferAttempts, eventRunner); - - this.blobToRanges = PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(), objectRanges); - this.metadataListeners = Sets.newIdentityHashSet(); - - this.retryAfter = retryAfter; - this.retryDelay = retryDelay; + public ReadJobImpl(final TransferStrategy transferStrategy) { + this.transferStrategy = transferStrategy; } - protected static ImmutableList getAllBlobApiBeans(final List jobWithChunksApiBeans) { - final ImmutableList.Builder builder = ImmutableList.builder(); - for (final Objects objects : jobWithChunksApiBeans) { - builder.addAll(objects.getObjects()); - } - return builder.build(); + public ReadJobImpl(final TransferStrategyBuilder transferStrategyBuilder) { + super(transferStrategyBuilder); } @Override public void attachMetadataReceivedListener(final MetadataReceivedListener listener) { checkRunning(); - this.metadataListeners.add(listener); + eventDispatcher().attachMetadataReceivedEventObserver(new MetaDataReceivedObserver(listener)); } @Override public void removeMetadataReceivedListener(final MetadataReceivedListener listener) { checkRunning(); - this.metadataListeners.remove(listener); + eventDispatcher().removeMetadataReceivedEventObserver(new MetaDataReceivedObserver(listener)); } @Override @@ -93,216 +57,29 @@ public Ds3ClientHelpers.Job withChecksum(final ChecksumFunction checksumFunction } @Override - public void transfer(final ObjectChannelBuilder channelBuilder) - throws IOException { - try { - running = true; - - final BlobStrategy strategy = new GetStreamerStrategy( - client, - this.masterObjectList, - retryAfter, - retryDelay, - new GetStreamerStrategy.ChunkEventHandler() { - @Override - public void emitWaitingForChunksEvents(final int secondsToDelay) { - ReadJobImpl.super.emitWaitingForChunksEvents(secondsToDelay); - } - }); - - try (final JobState jobState = new JobState( - channelBuilder, - this.masterObjectList.getObjects(), - getJobPartTracker(), blobToRanges)) { - try (final ChunkTransferrer chunkTransferrer = new ChunkTransferrer( - new GetObjectTransferrerRetryDecorator(jobState), - jobState.getPartTracker(), - this.maxParallelRequests - )) { - while (jobState.hasObjects()) { - chunkTransferrer.transferChunks(strategy); - } - } - } catch (final RuntimeException | IOException e) { - throw e; - } catch (final Exception e) { - throw new RuntimeException(e); - } - } catch (final Throwable t) { - emitFailureEvent(makeFailureEvent(FailureEvent.FailureActivity.GettingObject, t, masterObjectList.getObjects().get(0))); - throw t; + public void transfer(final ObjectChannelBuilder channelBuilder) throws IOException { + if (transferStrategy != null) { + transfer(); + return; } - } - @Override - protected List getChunks(final MasterObjectList masterObjectList) { - return masterObjectList.getObjects(); - } + super.transfer(channelBuilder); - @Override - protected JobPartTrackerDecorator makeJobPartTracker(final List chunks, final EventRunner eventRunner) { - return new JobPartTrackerDecorator(chunks, eventRunner); - } - - private final class GetObjectTransferrerRetryDecorator implements ItemTransferrer { - private final ItemTransferrer getObjectTransferrer; - - private GetObjectTransferrerRetryDecorator(final JobState jobState) { - getObjectTransferrer = new GetObjectTransferrerNetworkFailureDecorator(jobState); - } + transferStrategy = transferStrategyBuilder().makeGetTransferStrategy(); - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { - ReadJobImpl.this.transferItem(client, ds3Object, getObjectTransferrer); - } + transfer(); } - private final class GetObjectTransferrerNetworkFailureDecorator implements ItemTransferrer { - private final JobState jobState; - private Long numBytesToTransfer; - private ImmutableCollection ranges; - private Long destinationChannelOffset = 0L; - private ItemTransferrer itemTransferrer; - - private GetObjectTransferrerNetworkFailureDecorator(final JobState jobState) { - this.jobState = jobState; - itemTransferrer = new GetObjectTransferrer(jobState); - } - - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { - try { - itemTransferrer.transferItem(client, ds3Object); - } catch (final ContentLengthNotMatchException contentLengthNotMatchException) { - makeNewItemTransferrer(ds3Object, contentLengthNotMatchException.getTotalBytes()); - - emitContentLengthMismatchFailureEvent(ds3Object, contentLengthNotMatchException); - - throw new RecoverableIOException(contentLengthNotMatchException); - } - } - - private void makeNewItemTransferrer(final BulkObject ds3Object, final long numBytesTransferred) { - initializeRangesAndTransferSize(ds3Object); - updateRanges(numBytesTransferred); - destinationChannelOffset += numBytesTransferred; - - itemTransferrer = new GetPartialObjectTransferrer(jobState, ranges, destinationChannelOffset); - } - - private void initializeRangesAndTransferSize(final BulkObject ds3Object) { - if (ranges == null) { - ranges = getRangesForBlob(blobToRanges, ds3Object); - } - - if (ranges == null) { - final long numBytesTransferred = 0; - ranges = RangeHelper.replaceRange(ranges, numBytesTransferred, ds3Object.getLength()); - } - - if (numBytesToTransfer == null) { - numBytesToTransfer = RangeHelper.transferSizeForRanges(ranges); - } - } - - private void updateRanges(final long numBytesTransferred) { - ranges = RangeHelper.replaceRange(ranges, numBytesTransferred, numBytesToTransfer); - } - - private void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final Throwable t) { - final FailureEvent failureEvent = FailureEvent.builder() - .doingWhat(FailureEvent.FailureActivity.GettingObject) - .usingSystemWithEndpoint(client.getConnectionDetails().getEndpoint()) - .withCausalException(t) - .withObjectNamed(ds3Object.getName()) - .build(); - emitFailureEvent(failureEvent); - } - } - - private final class GetPartialObjectTransferrer implements ItemTransferrer { - private final JobState jobState; - private final ImmutableCollection ranges; - private final long destinationChannelOffset; - - private GetPartialObjectTransferrer(final JobState jobState, - final ImmutableCollection ranges, - final long destinationChannelOffset) - { - this.jobState = jobState; - this.ranges = ranges; - this.destinationChannelOffset = destinationChannelOffset; - } - - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { - final GetObjectRequest getObjectRequest = new GetObjectRequest( - ReadJobImpl.this.masterObjectList.getBucketName(), - ds3Object.getName(), - jobState.getChannel(ds3Object.getName(), destinationChannelOffset, RangeHelper.transferSizeForRanges(ranges)), - ReadJobImpl.this.getJobId().toString(), - ds3Object.getOffset() - ); - - getObjectRequest.withByteRanges(ranges); - - final GetObjectResponse response = client.getObject(getObjectRequest); - final Metadata metadata = response.getMetadata(); - - emitChecksumEvents(ds3Object, response.getChecksumType(), response.getChecksum()); - sendMetadataEvents(ds3Object.getName(), metadata); - } - } - - private final class GetObjectTransferrer implements ItemTransferrer { - private final JobState jobState; - - private GetObjectTransferrer(final JobState jobState) { - this.jobState = jobState; - } - - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) - throws IOException { - - final ImmutableCollection ranges = getRangesForBlob(blobToRanges, ds3Object); - - final GetObjectRequest request = new GetObjectRequest( - ReadJobImpl.this.masterObjectList.getBucketName(), - ds3Object.getName(), - jobState.getChannel(ds3Object.getName(), ds3Object.getOffset(), ds3Object.getLength()), - ReadJobImpl.this.getJobId().toString(), - ds3Object.getOffset() - ); - - if (Guard.isNotNullAndNotEmpty(ranges)) { - request.withByteRanges(ranges); - } - - final GetObjectResponse response = client.getObject(request); - final Metadata metadata = response.getMetadata(); - - emitChecksumEvents(ds3Object, response.getChecksumType(), response.getChecksum()); - sendMetadataEvents(ds3Object.getName(), metadata); - } - } + @Override + public void transfer() throws IOException { + Preconditions.checkNotNull(transferStrategy, "transferStrategy may not be null."); - private void sendMetadataEvents(final String objName , final Metadata metadata) { - for (final MetadataReceivedListener listener : this.metadataListeners) { - getEventRunner().emitEvent(new Runnable() { - @Override - public void run() { - listener.metadataReceived(objName, metadata); - } - }); - } + running = true; + transferStrategy.transfer(); } - private static ImmutableCollection getRangesForBlob( - final ImmutableMap> blobToRanges, - final BulkObject ds3Object) { - final ImmutableMultimap ranges = blobToRanges.get(ds3Object.getName()); - if (ranges == null) return null; - return ranges.get(ds3Object); + @Override + public void cancel() throws IOException { + cancel(transferStrategy); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RecoverableIOException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RecoverableIOException.java index 7cabee522..126624ce4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RecoverableIOException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RecoverableIOException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/TruncateNotAllowedException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/TruncateNotAllowedException.java index fe10d2491..2f601079b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/TruncateNotAllowedException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/TruncateNotAllowedException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/UnrecoverableIOException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/UnrecoverableIOException.java index fec5a69b2..4b3ad5cdd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/UnrecoverableIOException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/UnrecoverableIOException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WaitingForChunksListener.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WaitingForChunksListener.java index 46b73111b..6a151c5ba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WaitingForChunksListener.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WaitingForChunksListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WriteJobImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WriteJobImpl.java index 287be1d8d..f98c92e3b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WriteJobImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/WriteJobImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,58 +15,24 @@ package com.spectralogic.ds3client.helpers; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMultimap; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.commands.PutObjectRequest; -import com.spectralogic.ds3client.helpers.ChunkTransferrer.ItemTransferrer; +import com.google.common.base.Preconditions; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder; -import com.spectralogic.ds3client.helpers.events.EventRunner; -import com.spectralogic.ds3client.helpers.events.FailureEvent; -import com.spectralogic.ds3client.helpers.strategy.BlobStrategy; -import com.spectralogic.ds3client.helpers.strategy.PutStreamerStrategy; -import com.spectralogic.ds3client.models.*; -import com.spectralogic.ds3client.models.Objects; -import com.spectralogic.ds3client.models.common.Range; -import com.spectralogic.ds3client.utils.Guard; -import com.spectralogic.ds3client.utils.SeekableByteChannelInputStream; -import com.spectralogic.ds3client.utils.hashing.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; import java.io.IOException; -import java.io.InputStream; -import java.nio.channels.SeekableByteChannel; -import java.util.*; - -import static com.spectralogic.ds3client.helpers.strategy.StrategyUtils.filterChunks; - -class WriteJobImpl extends JobImpl { - static private final Logger LOG = LoggerFactory.getLogger(WriteJobImpl.class); - - private final List filteredChunks; - private final ChecksumType.Type checksumType; - - private final int retryAfter; // Negative retryAfter value represent infinity retries - private final int retryDelay; //Negative value means use default +public class WriteJobImpl extends JobImpl { private MetadataAccess metadataAccess = null; private ChecksumFunction checksumFunction = null; + private TransferStrategy transferStrategy; - public WriteJobImpl( - final Ds3Client client, - final MasterObjectList masterObjectList, - final int retryAfter, - final ChecksumType.Type type, - final int objectTransferAttempts, - final int retryDelay, - final EventRunner eventRunner) { - super(client, masterObjectList, objectTransferAttempts, eventRunner); - this.filteredChunks = getChunks(masterObjectList); - this.retryAfter = retryAfter; - this.retryDelay = retryDelay; + public WriteJobImpl(final TransferStrategy transferStrategy) { + this.transferStrategy = transferStrategy; + } - this.checksumType = type; + public WriteJobImpl(final TransferStrategyBuilder transferStrategyBuilder) { + super(transferStrategyBuilder); } @Override @@ -93,180 +59,32 @@ public Ds3ClientHelpers.Job withChecksum(final ChecksumFunction checksumFunction } @Override - public void transfer(final ObjectChannelBuilder channelBuilder) - throws IOException { - try { - running = true; - LOG.debug("Starting job transfer"); - if (this.masterObjectList == null || this.masterObjectList.getObjects() == null) { - LOG.info("There is nothing to transfer for job" - + (this.getJobId() == null ? "" : " " + this.getJobId().toString())); - return; - } + public void transfer(final ObjectChannelBuilder channelBuilder) throws IOException { + if (transferStrategy != null) { + transfer(); + return; + } - final BlobStrategy blobStrategy = new PutStreamerStrategy(client, - this.masterObjectList, - retryAfter, - retryDelay, - new BlobStrategy.ChunkEventHandler() { - @Override - public void emitWaitingForChunksEvents(final int secondsToDelay) { - WriteJobImpl.super.emitWaitingForChunksEvents(secondsToDelay); - } - }); + super.transfer(channelBuilder); - try (final JobState jobState = new JobState( - channelBuilder, - filteredChunks, - getJobPartTracker(), - ImmutableMap.>of())) { - try (final ChunkTransferrer chunkTransferrer = new ChunkTransferrer( - new PutObjectTransferrerRetryDecorator(jobState), - jobState.getPartTracker(), - this.maxParallelRequests - )) { - while (jobState.hasObjects()) { - chunkTransferrer.transferChunks(blobStrategy); - } - } + transferStrategyBuilder().withChecksumFunction(checksumFunction); + transferStrategyBuilder().withMetadataAccess(metadataAccess); - } catch (final IOException | RuntimeException e) { - throw e; - } catch (final Exception e) { - throw new RuntimeException(e); - } - } catch (final Throwable t) { - emitFailureEvent(makeFailureEvent(FailureEvent.FailureActivity.PuttingObject, t, masterObjectList.getObjects().get(0))); - throw t; - } + transferStrategy = transferStrategyBuilder().makePutTransferStrategy(); + transfer(); } @Override - protected List getChunks(final MasterObjectList masterObjectList) { - if (masterObjectList == null || masterObjectList.getObjects() == null) { - LOG.info("Job has no data to transfer"); - return null; - } + public void transfer() throws IOException { + Preconditions.checkNotNull(transferStrategy, "transferStrategy may not be null."); - LOG.info("Ready to start transfer for job {} with {} chunks", masterObjectList.getJobId().toString(), masterObjectList.getObjects().size()); - return filterChunks(masterObjectList.getObjects()); + running = true; + transferStrategy.transfer(); } @Override - protected JobPartTrackerDecorator makeJobPartTracker(final List chunks, final EventRunner eventRunner) { - return chunks == null ? null : new JobPartTrackerDecorator(chunks, eventRunner); - } - - private final class PutObjectTransferrerRetryDecorator implements ItemTransferrer { - private final PutObjectTransferrer putObjectTransferrer; - - private PutObjectTransferrerRetryDecorator(final JobState jobState) { - putObjectTransferrer = new PutObjectTransferrer(jobState); - } - - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { - WriteJobImpl.this.transferItem(client, ds3Object, putObjectTransferrer); - } - } - - private final class PutObjectTransferrer implements ItemTransferrer { - private final JobState jobState; - - private PutObjectTransferrer(final JobState jobState) { - this.jobState = jobState; - } - - @Override - public void transferItem(final Ds3Client client, final BulkObject ds3Object) - throws IOException { - client.putObject(createRequest(ds3Object)); - } - - private PutObjectRequest createRequest(final BulkObject ds3Object) throws IOException { - final SeekableByteChannel channel = jobState.getChannel(ds3Object.getName(), ds3Object.getOffset(), ds3Object.getLength()); - - final PutObjectRequest request = new PutObjectRequest( - WriteJobImpl.this.masterObjectList.getBucketName(), - ds3Object.getName(), - jobState.getChannel(ds3Object.getName(), ds3Object.getOffset(), ds3Object.getLength()), - WriteJobImpl.this.getJobId().toString(), - ds3Object.getOffset(), - ds3Object.getLength() - ); - - if (ds3Object.getOffset() == 0 && metadataAccess != null) { - final Map metadata = metadataAccess.getMetadataValue(ds3Object.getName()); - if (Guard.isMapNullOrEmpty(metadata)) return request; - final ImmutableMap immutableMetadata = ImmutableMap.copyOf(metadata); - for (final Map.Entry value : immutableMetadata.entrySet()) { - request.withMetaData(value.getKey(), value.getValue()); - } - } - - final String checksum = calculateChecksum(ds3Object, channel); - if (checksum != null) { - request.withChecksum(ChecksumType.value(checksum), WriteJobImpl.this.checksumType); - emitChecksumEvents(ds3Object, WriteJobImpl.this.checksumType, checksum); - } - - return request; - } - - private String calculateChecksum(final BulkObject ds3Object, final SeekableByteChannel channel) throws IOException { - if (WriteJobImpl.this.checksumType != ChecksumType.Type.NONE) { - if (WriteJobImpl.this.checksumFunction == null) { - LOG.info("Calculating {} checksum for blob: {}", WriteJobImpl.this.checksumType.toString(), ds3Object.toString()); - final SeekableByteChannelInputStream dataStream = new SeekableByteChannelInputStream(channel); - final Hasher hasher = getHasher(WriteJobImpl.this.checksumType); - final String checksum = hashInputStream(hasher, dataStream); - LOG.info("Computed checksum for blob: {}", checksum); - return checksum; - } else { - LOG.info("Getting checksum from user supplied callback for blob: {}", ds3Object.toString()); - final String checksum = WriteJobImpl.this.checksumFunction.compute(ds3Object, channel); - LOG.info("User supplied checksum is: {}", checksum); - return checksum; - } - } - return null; - } - - private static final int READ_BUFFER_SIZE = 10 * 1024 * 1024; - - private String hashInputStream(final Hasher digest, final InputStream stream) throws IOException { - final byte[] buffer = new byte[READ_BUFFER_SIZE]; - int bytesRead; - - while (true) { - bytesRead = stream.read(buffer); - - if (bytesRead < 0) { - break; - } - - digest.update(buffer, 0, bytesRead); - } - - return digest.digest(); - } - - private Hasher getHasher(final ChecksumType.Type checksumType) { - switch (checksumType) { - case MD5: - return new MD5Hasher(); - case SHA_256: - return new SHA256Hasher(); - case SHA_512: - return new SHA512Hasher(); - case CRC_32: - return new CRC32Hasher(); - case CRC_32C: - return new CRC32CHasher(); - default: - throw new RuntimeException("Unknown checksum type " + checksumType.toString()); - } - } + public void cancel() throws IOException { + cancel(transferStrategy); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/IoLoggingChannelBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/IoLoggingChannelBuilder.java index b032abe62..6559be0ef 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/IoLoggingChannelBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/IoLoggingChannelBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder.java index 84de84953..ccb900ae9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder.java index 2c196ea40..8ef139ba6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixAdderObjectChannelBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixAdderObjectChannelBuilder.java index c8f7a2997..5d79197e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixAdderObjectChannelBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixAdderObjectChannelBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixRemoverObjectChannelBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixRemoverObjectChannelBuilder.java index 382862dc1..2114c0cb4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixRemoverObjectChannelBuilder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/PrefixRemoverObjectChannelBuilder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ReadOnlySeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ReadOnlySeekableByteChannel.java index a50e1df50..cc6d1fcb7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ReadOnlySeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/ReadOnlySeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,8 +25,8 @@ public class ReadOnlySeekableByteChannel implements SeekableByteChannel { private final ReadableByteChannel channel; - private int size = 0; - private int position = 0; + private long size = 0; + private long position = 0; public ReadOnlySeekableByteChannel(final ReadableByteChannel channel) { this.channel = channel; @@ -40,7 +40,7 @@ public ReadableByteChannel getChannel() { public int read(final ByteBuffer dst) throws IOException { size = channel.read(dst); position += size; - return size; + return Long.valueOf(size).intValue(); } @Override @@ -55,6 +55,9 @@ public long position() throws IOException { @Override public SeekableByteChannel position(final long newPosition) throws IOException { + if (position == 0 || newPosition == 0) { + this.position = newPosition; + } if (newPosition == this.position) { return this; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/WriteOnlySeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/WriteOnlySeekableByteChannel.java index 3aaeceda0..3bb85b305 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/WriteOnlySeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channelbuilders/WriteOnlySeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -68,7 +68,7 @@ public long size() throws IOException { @Override public SeekableByteChannel truncate(final long size) throws IOException { - throw new NotImplementedException(); + return this; } @Override diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/BlobComparator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/BlobComparator.java index a6833ff77..106fd7b1d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/BlobComparator.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/BlobComparator.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel.java index 24f303646..68f24bd43 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory.java index 7455b2203..c75a4a997 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel.java index afe4600fb..8e3ec5b22 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/ConcurrentEventRunner.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/ConcurrentEventRunner.java index 37dd60a20..edbde6d9e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/ConcurrentEventRunner.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/ConcurrentEventRunner.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/EventRunner.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/EventRunner.java index 2a0f0003a..c6a94fac7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/EventRunner.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/EventRunner.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/MetadataEvent.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/MetadataEvent.java new file mode 100644 index 000000000..c97a340cd --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/MetadataEvent.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.events; + +import com.spectralogic.ds3client.networking.Metadata; + +public class MetadataEvent { + private final String objectName; + private final Metadata metadata; + + public MetadataEvent(final String objectName, final Metadata metadata) { + this.objectName = objectName; + this.metadata = metadata; + } + + public String getObjectName() { + return objectName; + } + + public Metadata getMetadata() { + return metadata; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/SameThreadEventRunner.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/SameThreadEventRunner.java index 003d028fa..296a9d0e5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/SameThreadEventRunner.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/events/SameThreadEventRunner.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/ReadJobOptions.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/ReadJobOptions.java index acaeeba97..244134de1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/ReadJobOptions.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/ReadJobOptions.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/WriteJobOptions.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/WriteJobOptions.java index 2c5080fe7..cad30f35c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/WriteJobOptions.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/options/WriteJobOptions.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/package-info.java index bbbab5441..8f0d92711 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/FileSystemKey.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/FileSystemKey.java new file mode 100644 index 000000000..a2d21b9ec --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/FileSystemKey.java @@ -0,0 +1,96 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.pagination; + +import com.spectralogic.ds3client.exceptions.UnableToConvertToCommonPrefixesException; +import com.spectralogic.ds3client.exceptions.UnableToConvertToContentsException; +import com.spectralogic.ds3client.models.Contents; +import com.spectralogic.ds3client.models.User; +import com.spectralogic.ds3client.models.common.CommonPrefixes; + +import java.util.Date; + +public class FileSystemKey { + private final String prefix; + private final String eTag; + private final String key; + private final Date lastModified; + private final User owner; + private final Long size; + private final String storageClass; + + private FileSystemKey(final String prefixString) { + prefix = prefixString; + eTag = null; + key = null; + lastModified = null; + owner = null; + size = null; + storageClass = null; + } + + public FileSystemKey(final CommonPrefixes commonPrefixes) { + this(commonPrefixes.getPrefix()); + } + + private FileSystemKey(final String eTag, final String key, final Date lastModified, final User owner, final long size, final String storageClass) { + this.prefix = null; + this.eTag = eTag; + this.key = key; + this.lastModified = lastModified; + this.owner = owner; + this.size = size; + this.storageClass = storageClass; + } + + public FileSystemKey(final Contents contents) { + this(contents.getETag(), contents.getKey(), contents.getLastModified(), contents.getOwner(), contents.getSize(), contents.getStorageClass()); + } + + public boolean isPrefix() { + return prefix != null; + } + + public boolean isContents() { + return prefix == null; + } + + public CommonPrefixes toCommonPrefixes() throws RuntimeException{ + if (isContents()) { + throw new UnableToConvertToCommonPrefixesException("Could not create a CommonPrefix"); + } + final CommonPrefixes commonPrefixes = new CommonPrefixes(); + commonPrefixes.setPrefix(prefix); + return commonPrefixes; + } + + public Contents toContents() throws RuntimeException { + if (isPrefix()) { + throw new UnableToConvertToContentsException("Could not create a Contents"); + } + final Contents contents = new Contents(); + contents.setETag(eTag); + contents.setKey(key); + contents.setLastModified(lastModified); + contents.setOwner(owner); + contents.setSize(size); + contents.setStorageClass(storageClass); + return contents; + } + + public String getName() { + return isPrefix() ? prefix : key; + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoader.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoader.java similarity index 51% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoader.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoader.java index 43b8cdf0d..f237c413a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoader.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoader.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -12,15 +12,15 @@ * specific language governing permissions and limitations under the License. * **************************************************************************** */ - package com.spectralogic.ds3client.helpers.pagination; +import com.google.common.base.Function; import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.commands.GetBucketRequest; import com.spectralogic.ds3client.commands.GetBucketResponse; -import com.spectralogic.ds3client.models.Contents; import com.spectralogic.ds3client.models.ListBucketResult; import com.spectralogic.ds3client.networking.FailedRequestException; +import com.spectralogic.ds3client.networking.FailedToGetBucketException; import com.spectralogic.ds3client.networking.TooManyRetriesException; import com.spectralogic.ds3client.utils.Guard; import com.spectralogic.ds3client.utils.collections.LazyIterable; @@ -29,69 +29,66 @@ import java.util.Collections; import java.util.List; -public class GetBucketLoader implements LazyIterable.LazyLoader { +public class GetBucketKeyLoader implements LazyIterable.LazyLoader { private static final int DEFAULT_MAX_KEYS = 1000; - + private final List emptyList = Collections.emptyList(); private final Ds3Client client; private final String bucket; private final String prefix; + private final String delimiter; private final int maxKeys; private final int retryCount; - + private final Function> function; private String nextMarker; private boolean truncated; private boolean endOfInput = false; - public GetBucketLoader(final Ds3Client client, final String bucket, final String prefix, final String nextMarker, final int maxKeys, final int retryCount) { + GetBucketKeyLoader(final Ds3Client client, final String bucket, final String prefix, final String delimiter, final String nextMarker, final int maxKeys, final int retryCount, final Function> function) { this.client = client; this.bucket = bucket; this.prefix = prefix; - this.maxKeys = maxKeys; + this.delimiter = delimiter; + this.nextMarker = nextMarker; + this.maxKeys = Math.min(maxKeys, DEFAULT_MAX_KEYS); this.retryCount = retryCount; - this.nextMarker = nextMarker; this.truncated = nextMarker != null; + this.function = function; + } + + private GetBucketRequest prepRequest() { + final GetBucketRequest request = new GetBucketRequest(bucket); + if (prefix != null) { request.withPrefix(prefix); } + if (truncated) { request.withMarker(nextMarker); } + if (delimiter != null) { request.withDelimiter(delimiter); } + request.withMaxKeys(maxKeys); + return request; } @Override - public List getNextValues() { - if (endOfInput) { - return Collections.emptyList(); - } + public Iterable getNextValues() { + if (endOfInput) { return emptyList; } int retryAttempt = 0; - while(true) { - final GetBucketRequest request = new GetBucketRequest(bucket); - request.withMaxKeys(Math.min(maxKeys, DEFAULT_MAX_KEYS)); - if (prefix != null) { - request.withPrefix(prefix); - } - if (truncated) { - request.withMarker(nextMarker); - } - + while (retryCount > retryAttempt) { + final GetBucketRequest request = prepRequest(); + final ListBucketResult result; final GetBucketResponse response; try { response = this.client.getBucket(request); - final ListBucketResult result = response.getListBucketResult(); - - truncated = result.getTruncated(); - this.nextMarker = result.getNextMarker(); - - if (Guard.isStringNullOrEmpty(nextMarker) && !truncated) { - endOfInput = true; - } - - return result.getObjects(); } catch (final FailedRequestException e) { - throw new RuntimeException("Failed to get the list of objects due to a failed request", e); + throw new FailedToGetBucketException("Failed to get the list of objects due to a failed request", e); } catch (final IOException e) { - if (retryAttempt >= retryCount) { - //TODO need a proxied test to validate this retry logic - throw new TooManyRetriesException("Failed to get the next set of objects from the getBucket request after " + retryCount + " retries", e); - } retryAttempt++; + continue; } + result = response.getListBucketResult(); + this.truncated = result.getTruncated(); + this.nextMarker = result.getNextMarker(); + if (Guard.isStringNullOrEmpty(nextMarker) && !truncated) { + endOfInput = true; + } + return function.apply(result); } - + throw new TooManyRetriesException("Failed to get the next set of objects from the getBucketKey request after " + retryCount + " retries"); } -} +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoaderFactory.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoaderFactory.java new file mode 100644 index 000000000..f90681553 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketKeyLoaderFactory.java @@ -0,0 +1,87 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.pagination; + +import com.google.common.base.Function; +import com.google.common.collect.FluentIterable; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.models.Contents; +import com.spectralogic.ds3client.models.ListBucketResult; +import com.spectralogic.ds3client.models.common.CommonPrefixes; +import com.spectralogic.ds3client.utils.collections.LazyIterable; +import javax.annotation.Nullable; + +public class GetBucketKeyLoaderFactory implements LazyIterable.LazyLoaderFactory { + + public static final Function> contentsFunction = new Function>() { + @Override + public Iterable apply(@Nullable final ListBucketResult input) { + return input.getObjects(); + } + }; + + public static final Function> getFileSystemKeysFunction = new Function>() { + @Nullable + @Override + public Iterable apply(@Nullable final ListBucketResult result) { + final FluentIterable contentIterable = FluentIterable.from(result.getObjects()) + .transform(new ContentsFileSystemKeyFunction()); + return FluentIterable.from(result.getCommonPrefixes()) + .transform(new CommonPrefixesFileSystemKeyFunction()) + .append(contentIterable); + } + }; + + private final Ds3Client client; + private final String bucket; + private final String keyPrefix; + private final String nextMarker; + private final String delimiter; + private final int maxKeys; + private final int defaultListObjectsRetries; + private final Function> function; + + + public GetBucketKeyLoaderFactory(final Ds3Client client, final String bucket, final String keyPrefix, final String delimiter, final String nextMarker, final int maxKeys, final int defaultListObjectsRetries, final Function> function) { + this.client = client; + this.bucket = bucket; + this.keyPrefix = keyPrefix; + this.delimiter = delimiter; + this.nextMarker = nextMarker; + this.maxKeys = maxKeys; + this.defaultListObjectsRetries = defaultListObjectsRetries; + this.function = function; + } + + @Override + public LazyIterable.LazyLoader create() { + return new GetBucketKeyLoader<>(client, bucket, keyPrefix, delimiter, nextMarker, maxKeys, defaultListObjectsRetries, function); + } + + private static class ContentsFileSystemKeyFunction implements Function { + @Override + public FileSystemKey apply(@Nullable final Contents input) { + return new FileSystemKey(input); + } + } + + private static class CommonPrefixesFileSystemKeyFunction implements Function { + @Override + public FileSystemKey apply(@Nullable final CommonPrefixes input) { + return new FileSystemKey(input); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoaderFactory.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoaderFactory.java index b7bf51cc5..5899b6e8f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoaderFactory.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetBucketLoaderFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,27 +19,32 @@ import com.spectralogic.ds3client.models.Contents; import com.spectralogic.ds3client.utils.collections.LazyIterable; -public class GetBucketLoaderFactory implements LazyIterable.LazyLoaderFactory { - - private final Ds3Client client; - private final String bucket; - private final String keyPrefix; - private final String nextMarker; - private final int maxKeys; - private final int defaultListObjectsRetries; +/** + * This class is a child of {@link GetBucketKeyLoaderFactory} + * that provides a sane default for mapping {@link com.spectralogic.ds3client.models.ListBucketResult} + * "/" will be used for the delimiter, and {@link com.spectralogic.ds3client.models.ListBucketResult} will be mapped to + * a {@link com.spectralogic.ds3client.utils.collections.LazyIterable.LazyLoader} of {@link Contents} which was the old behavior. + */ +public class GetBucketLoaderFactory extends GetBucketKeyLoaderFactory { + /** + * + * @param client + * @param bucket + * @param keyPrefix + * @param nextMarker + * @param maxKeys + * @param defaultListObjectsRetries + */ public GetBucketLoaderFactory(final Ds3Client client, final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys, final int defaultListObjectsRetries) { - - this.client = client; - this.bucket = bucket; - this.keyPrefix = keyPrefix; - this.nextMarker = nextMarker; - this.maxKeys = maxKeys; - this.defaultListObjectsRetries = defaultListObjectsRetries; + super(client, bucket, keyPrefix, "/" , nextMarker, maxKeys, defaultListObjectsRetries, contentsFunction); } + /** + * @return a {@link com.spectralogic.ds3client.utils.collections.LazyIterable.LazyLoader} of {@link Contents} + */ @Override public LazyIterable.LazyLoader create() { - return new GetBucketLoader(client, bucket, keyPrefix, nextMarker, maxKeys, defaultListObjectsRetries); + return super.create(); } -} +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoader.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoader.java index 0ea2b7701..1435498c3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoader.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoader.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -28,9 +28,9 @@ public class GetObjectsFullDetailsLoader implements LazyIterable.LazyLoader paginator; - public GetObjectsFullDetailsLoader(final Ds3Client client, final String bucket, final String folder, final boolean includePhysicalDetails, final int pageLength, final int retryCount) { + public GetObjectsFullDetailsLoader(final Ds3Client client, final String bucket, final boolean includePhysicalDetails, final int pageLength, final int retryCount) { paginator = new SpectraS3PaginationLoader<>( - new GetObjectsFullDetailsPaginatingCommand(client, bucket, folder, includePhysicalDetails), + new GetObjectsFullDetailsPaginatingCommand(client, bucket, includePhysicalDetails), pageLength, retryCount); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoaderFactory.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoaderFactory.java index 3371e72e1..f879a88bb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoaderFactory.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/GetObjectsFullDetailsLoaderFactory.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,15 +25,13 @@ public class GetObjectsFullDetailsLoaderFactory implements LazyIterable.LazyLoaderFactory { private final Ds3Client client; private final String bucket; - private final String folder; private final int pageLength; private final int retryCount; private final boolean includePhysicalDetails; - public GetObjectsFullDetailsLoaderFactory(final Ds3Client client, final String bucket, final String folder, final int pageLength, final int retryCount, final boolean includePhysicalDetails) { + public GetObjectsFullDetailsLoaderFactory(final Ds3Client client, final String bucket, final int pageLength, final int retryCount, final boolean includePhysicalDetails) { this.client = client; this.bucket = bucket; - this.folder = folder; this.pageLength = pageLength; this.includePhysicalDetails = includePhysicalDetails; this.retryCount = retryCount; @@ -41,6 +39,6 @@ public GetObjectsFullDetailsLoaderFactory(final Ds3Client client, final String b @Override public LazyIterable.LazyLoader create() { - return new GetObjectsFullDetailsLoader(client, bucket, folder, includePhysicalDetails, pageLength, retryCount); + return new GetObjectsFullDetailsLoader(client, bucket, includePhysicalDetails, pageLength, retryCount); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/PaginatingCommand.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/PaginatingCommand.java index 56b6d1f26..089c6c8f8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/PaginatingCommand.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/PaginatingCommand.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader.java index df99b484b..9b205cfcb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/commands/GetObjectsFullDetailsPaginatingCommand.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/commands/GetObjectsFullDetailsPaginatingCommand.java index bb594e06e..902c68b62 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/commands/GetObjectsFullDetailsPaginatingCommand.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/commands/GetObjectsFullDetailsPaginatingCommand.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.spectralogic.ds3client.commands.spectrads3.GetObjectsWithFullDetailsSpectraS3Response; import com.spectralogic.ds3client.helpers.pagination.PaginatingCommand; import com.spectralogic.ds3client.models.DetailedS3Object; -import com.spectralogic.ds3client.utils.Guard; import java.io.IOException; import java.util.List; @@ -28,24 +27,17 @@ public class GetObjectsFullDetailsPaginatingCommand implements PaginatingCommand { private final Ds3Client client; private final String bucket; - private final String folder; private final boolean includePhysicalDetails; - public GetObjectsFullDetailsPaginatingCommand(final Ds3Client client, final String bucket, final String folder, final boolean includePhysicalDetails) { + public GetObjectsFullDetailsPaginatingCommand(final Ds3Client client, final String bucket, final boolean includePhysicalDetails) { this.client = client; this.bucket = bucket; - this.folder = folder; this.includePhysicalDetails = includePhysicalDetails; } @Override public GetObjectsWithFullDetailsSpectraS3Request createRequest() { - final GetObjectsWithFullDetailsSpectraS3Request getObjectsWithFullDetailsSpectraS3Request = new GetObjectsWithFullDetailsSpectraS3Request().withBucketId(bucket).withIncludePhysicalPlacement(includePhysicalDetails); - if (Guard.isStringNullOrEmpty(folder)) { - return getObjectsWithFullDetailsSpectraS3Request; - } else { - return getObjectsWithFullDetailsSpectraS3Request.withFolder(folder); - } + return new GetObjectsWithFullDetailsSpectraS3Request().withBucketId(bucket).withIncludePhysicalPlacement(includePhysicalDetails); } @Override diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/package-info.java index 48cc21db2..18f3ffc1b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/pagination/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/BlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/BlobStrategy.java deleted file mode 100644 index b20baefc2..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/BlobStrategy.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers.strategy; - -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.helpers.JobPart; -import com.spectralogic.ds3client.models.BulkObject; -import com.spectralogic.ds3client.models.MasterObjectList; - -import java.io.IOException; - -public abstract class BlobStrategy { - - private final Ds3Client client; - private final MasterObjectList masterObjectList; - private final int retryAfter; - private final int retryDelay; - private final BlobStrategy.ChunkEventHandler chunkEventHandler; - - public BlobStrategy(final Ds3Client client, final MasterObjectList masterObjectList, final int retryAfter, final int retryDelay, final BlobStrategy.ChunkEventHandler chunkEventHandler) { - this.client = client; - this.masterObjectList = masterObjectList; - this.retryAfter = retryAfter; - this.retryDelay = retryDelay; - this.chunkEventHandler = chunkEventHandler; - } - - public abstract Iterable getWork() throws IOException, InterruptedException; - public abstract void blobCompleted(final BulkObject bulkObject); - - public Ds3Client getClient() { - return client; - } - - public int getRetryAfter() { - return retryAfter; - } - - public int getRetryDelay() { - return retryDelay; - } - - public BlobStrategy.ChunkEventHandler getChunkEventHandler() { - return chunkEventHandler; - } - - public MasterObjectList getMasterObjectList() { - return masterObjectList; - } - - protected int computeDelay(final int retryAfterSeconds) { - final int retryDelay = getRetryDelay(); - if (retryDelay == -1) { - return retryAfterSeconds; - } else { - return retryDelay; - } - } - - public interface ChunkEventHandler { - void emitWaitingForChunksEvents(final int secondsToDelay); - } -} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/GetStreamerStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/GetStreamerStrategy.java deleted file mode 100644 index 79141c35b..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/GetStreamerStrategy.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers.strategy; - -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import com.google.common.collect.FluentIterable; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; -import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; -import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; -import com.spectralogic.ds3client.helpers.JobPart; -import com.spectralogic.ds3client.models.BulkObject; -import com.spectralogic.ds3client.models.JobNode; -import com.spectralogic.ds3client.models.MasterObjectList; -import com.spectralogic.ds3client.models.Objects; - -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; - -public class GetStreamerStrategy extends BlobStrategy { - - private final Set processedChunks; - - private final Object lock = new Object(); - private final Set activeBlobs = new HashSet<>(); - private ImmutableList outstandingJobParts; - - public GetStreamerStrategy(final Ds3Client client, final MasterObjectList masterObjectList, final int retryAfter, final int retryDelay, final BlobStrategy.ChunkEventHandler chunkEventHandler) { - super(client, masterObjectList, retryAfter, retryDelay, chunkEventHandler); - this.processedChunks = new HashSet<>(); - } - - @Override - public Iterable getWork() throws IOException, InterruptedException { - - final MasterObjectList available = getAvailable(); - - final ImmutableMap jobNodes = StrategyUtils.buildNodeMap(available.getNodes()); - - // filter any chunks that have been processed - final FluentIterable chunks = FluentIterable.from(available.getObjects()); - - final ImmutableList.Builder filteredPartsBuilder = ImmutableList.builder(); - - final FluentIterable jobParts = chunks.filter(new Predicate() { - @Override - public boolean apply(@Nullable final Objects input) { - return !processedChunks.contains(input.getChunkId()); - } - }).transformAndConcat(new Function>() { - @Nullable - @Override - public Iterable apply(@Nullable final Objects objects) { - return FluentIterable.from(objects.getObjects()).transform(new Function() { - @Nullable - @Override - public JobPart apply(@Nullable final BulkObject blob) { - return new JobPart(getClient(), blob); - - // TODO: When we get to the point where BP enables clustering, we'll want to be able to get the - // client connection info correct for the server on which a chunk resides. StrategyUtils.getClient - // appears to work to support the clustering scenario, but we don't need it right now, and holding - // connection info in a collection potentially exposes lifetime management issues that we haven't - // fully explored. - // return new JobPart(StrategyUtils.getClient(jobNodes, objects.getNodeId(), getClient()), blob); - } - }); - } - }); - - final FluentIterable nextWorkParts = FluentIterable.from( - getNextIterable(jobParts) - ).filter(new Predicate() { - @Override - public boolean apply(@Nullable final JobPart input) { - final String blobName = input.getBulkObject().getName(); - synchronized (lock) { - if (activeBlobs.contains(blobName)) { - filteredPartsBuilder.add(input); - return false; - } else { - activeBlobs.add(blobName); - } - } - return true; - } - }); - - outstandingJobParts = filteredPartsBuilder.build(); - - return nextWorkParts; - } - - private Iterable getNextIterable(final FluentIterable jobParts) { - if (outstandingJobParts == null) { - return jobParts; - } - return Iterables.concat(outstandingJobParts, jobParts); - } - - @Override - public void blobCompleted(final BulkObject bulkObject) { - synchronized (lock) { - activeBlobs.remove(bulkObject.getName()); - } - } - - private MasterObjectList getAvailable() throws IOException, InterruptedException { - int retryAfterLeft = getRetryAfter(); - do { - final GetJobChunksReadyForClientProcessingSpectraS3Response availableJobChunks = - getClient().getJobChunksReadyForClientProcessingSpectraS3(new GetJobChunksReadyForClientProcessingSpectraS3Request(getMasterObjectList().getJobId().toString())); - switch (availableJobChunks.getStatus()) { - case AVAILABLE: { - return availableJobChunks.getMasterObjectListResult(); - } - case RETRYLATER: { - if (retryAfterLeft == 0) { - throw new Ds3NoMoreRetriesException(getRetryAfter()); - } - retryAfterLeft--; - final int secondsToDelay = computeDelay(availableJobChunks.getRetryAfterSeconds()); - getChunkEventHandler().emitWaitingForChunksEvents(secondsToDelay); - Thread.sleep(secondsToDelay * 1000); - continue; - } - default: - assert false : "This line of code should be impossible to hit."; - } - } while(true); - } - -} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/PutStreamerStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/PutStreamerStrategy.java deleted file mode 100644 index 4a349b098..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/PutStreamerStrategy.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers.strategy; - -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.collect.FluentIterable; -import com.google.common.collect.ImmutableMap; -import com.spectralogic.ds3client.Ds3Client; -import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Request; -import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Response; -import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; -import com.spectralogic.ds3client.helpers.JobPart; -import com.spectralogic.ds3client.models.BulkObject; -import com.spectralogic.ds3client.models.JobNode; -import com.spectralogic.ds3client.models.MasterObjectList; -import com.spectralogic.ds3client.models.Objects; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.annotation.Nullable; -import java.io.IOException; -import java.util.Iterator; -import java.util.UUID; - -import static com.spectralogic.ds3client.helpers.strategy.StrategyUtils.buildNodeMap; -import static com.spectralogic.ds3client.helpers.strategy.StrategyUtils.filterChunks; - -public class PutStreamerStrategy extends BlobStrategy { - - private final static Logger LOG = LoggerFactory.getLogger(PutStreamerStrategy.class); - - private final ImmutableMap uuidJobNodeImmutableMap; - private final Iterator filteredChunkIterator; - - private int retryAfterLeft; - - - - public PutStreamerStrategy(final Ds3Client client, final MasterObjectList masterObjectList, final int retryAfter, final int retryDelay, final ChunkEventHandler chunkEventHandler) { - super(client, masterObjectList, retryAfter, retryDelay, chunkEventHandler); - this.filteredChunkIterator = filterChunks(masterObjectList.getObjects()).iterator(); - this.uuidJobNodeImmutableMap = buildNodeMap(masterObjectList.getNodes()); - } - - @Override - public Iterable getWork() throws IOException, InterruptedException { - final Objects nextChunk = allocateChunk(filteredChunkIterator.next()); - - LOG.debug("Allocating chunk: {}", nextChunk.getChunkId().toString()); - return FluentIterable.from(nextChunk.getObjects()).filter(new Predicate() { - @Override - public boolean apply(@Nullable final BulkObject input) { - return !input.getInCache(); - } - }).transform(new Function() { - @Nullable - @Override - public JobPart apply(@Nullable final BulkObject blob) { - return new JobPart(getClient(), blob); - - // TODO: When we get to the point where BP enables clustering, we'll want to be able to get the - // client connection info correct for the server on which a chunk resides. StrategyUtils.getClient - // appears to work to support the clustering scenario, but we don't need it right now, and holding - // connection info in a collection potentially exposes lifetime management issues that we haven't - // fully explored. - // return new JobPart(StrategyUtils.getClient(uuidJobNodeImmutableMap,nextChunk.getNodeId(), getClient()), input); - } - }); - } - - @Override - public void blobCompleted(final BulkObject bulkObject) { - - } - - private Objects allocateChunk(final Objects filtered) throws IOException { - Objects chunk = null; - while (chunk == null) { - chunk = tryAllocateChunk(filtered); - } - return chunk; - } - - private Objects tryAllocateChunk(final Objects filtered) throws IOException { - final AllocateJobChunkSpectraS3Response response = - getClient().allocateJobChunkSpectraS3(new AllocateJobChunkSpectraS3Request(filtered.getChunkId().toString())); - - LOG.info("AllocatedJobChunkResponse status: {}", response.getStatus().toString()); - switch (response.getStatus()) { - case ALLOCATED: - retryAfterLeft = getRetryAfter(); // Reset the number of retries to the initial value - return response.getObjectsResult(); - case RETRYLATER: - try { - if (getRetryAfter() != -1 && retryAfterLeft == 0) { - throw new Ds3NoMoreRetriesException(getRetryAfter()); - } - retryAfterLeft--; - - final int retryDelay = computeDelay(response.getRetryAfterSeconds()); - getChunkEventHandler().emitWaitingForChunksEvents(retryDelay); - - LOG.debug("Will retry allocate chunk call after {} seconds", retryDelay); - Thread.sleep(retryDelay * 1000); - return null; - } catch (final InterruptedException e) { - throw new RuntimeException(e); - } - default: - assert false : "This line of code should be impossible to hit."; return null; - } - } -} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/StrategyUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/StrategyUtils.java index 96f36d150..746662441 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/StrategyUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/StrategyUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,12 +15,14 @@ package com.spectralogic.ds3client.helpers.strategy; +import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.spectralogic.ds3client.Ds3Client; +import com.google.common.collect.ImmutableMultimap; import com.spectralogic.ds3client.models.BulkObject; import com.spectralogic.ds3client.models.JobNode; import com.spectralogic.ds3client.models.Objects; +import com.spectralogic.ds3client.models.common.Range; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,13 +70,13 @@ public static ImmutableMap buildNodeMap(final Iterable n /** * Filters out chunks that have already been completed. We will get the same chunk name back from the server, but it * will not have any objects in it, so we remove that from the list of objects that are returned. - * @param objectsList The list to be filtered + * @param chunks The list to be filtered * @return The filtered list */ - public static ImmutableList filterChunks(final Iterable objectsList) { + public static ImmutableList filterChunks(final Iterable chunks) { final ImmutableList.Builder builder = ImmutableList.builder(); - for (final Objects objects : objectsList) { - final Objects filteredChunk = filterChunk(objects); + for (final Objects chunk : chunks) { + final Objects filteredChunk = filterChunk(chunk); if (filteredChunk.getObjects().size() > 0) { builder.add(filteredChunk); } @@ -82,24 +84,33 @@ public static ImmutableList filterChunks(final Iterable object return builder.build(); } - private static Objects filterChunk(final Objects objects) { - final Objects newObjects = new Objects(); - newObjects.setChunkId(objects.getChunkId()); - newObjects.setChunkNumber(objects.getChunkNumber()); - newObjects.setNodeId(objects.getNodeId()); - newObjects.setObjects(filterObjects(objects.getObjects())); - return newObjects; + private static Objects filterChunk(final Objects chunk) { + final Objects newChunk = new Objects(); + newChunk.setChunkId(chunk.getChunkId()); + newChunk.setChunkNumber(chunk.getChunkNumber()); + newChunk.setNodeId(chunk.getNodeId()); + newChunk.setObjects(filterObjects(chunk.getObjects())); + return newChunk; } - private static ImmutableList filterObjects(final List list) { + private static ImmutableList filterObjects(final List blobs) { final ImmutableList.Builder builder = ImmutableList.builder(); - for (final BulkObject obj : list) { - if (!obj.getInCache()) { - builder.add(obj); + for (final BulkObject blob : blobs) { + if (!blob.getInCache()) { + builder.add(blob); } } return builder.build(); } + public static ImmutableCollection getRangesForBlob(final ImmutableMap> rangesForBlobs, + final BulkObject blob) { + final ImmutableMultimap rangesForBlob = rangesForBlobs.get(blob.getName()); + if (rangesForBlob != null) { + return rangesForBlob.get(blob); + } + + return null; + } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/AbstractBlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/AbstractBlobStrategy.java new file mode 100644 index 000000000..7fbb883ff --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/AbstractBlobStrategy.java @@ -0,0 +1,78 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.BlobTransferredEventObserver; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.UpdateStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; + +public abstract class AbstractBlobStrategy implements BlobStrategy { + + private final Ds3Client client; + private final MasterObjectList masterObjectList; + private final EventDispatcher eventDispatcher; + private final ChunkAttemptRetryBehavior retryBehavior; + private final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior; + + public AbstractBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior) + { + this.client = client; + this.masterObjectList = masterObjectList; + this.eventDispatcher = eventDispatcher; + this.retryBehavior = retryBehavior; + this.chunkAttemptRetryDelayBehavior = chunkAttemptRetryDelayBehavior; + + eventDispatcher.attachBlobTransferredEventObserver(new BlobTransferredEventObserver(new UpdateStrategy() { + @Override + public void update(final BulkObject eventData) { + blobCompleted(eventData); + } + })); + } + + /** + * Emit an event when a blob is transferred. + * @param bulkObject The transferred blob. + */ + public abstract void blobCompleted(final BulkObject bulkObject); + + public Ds3Client client() { + return client; + } + + public EventDispatcher eventDispatcher() { + return eventDispatcher; + } + + public MasterObjectList masterObjectList() { + return masterObjectList; + } + + public ChunkAttemptRetryBehavior retryBehavior() { + return retryBehavior; + } + + public ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior() { + return chunkAttemptRetryDelayBehavior; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlackPearlChunkAttemptRetryDelayBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlackPearlChunkAttemptRetryDelayBehavior.java new file mode 100644 index 000000000..1481ef3f8 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlackPearlChunkAttemptRetryDelayBehavior.java @@ -0,0 +1,58 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * An implementation of {@link ChunkAttemptRetryDelayBehavior} that uses the delay a Black Pearl returns + * in its payload when a chunk operation does not complete. + */ +public class BlackPearlChunkAttemptRetryDelayBehavior implements ChunkAttemptRetryDelayBehavior { + private static final Logger LOG = LoggerFactory.getLogger(BlackPearlChunkAttemptRetryDelayBehavior.class); + + private final EventDispatcher eventDispatcher; + + /** + * @param eventDispatcher An instance of {@link EventDispatcher} used to send {@link com.spectralogic.ds3client.helpers.WaitingForChunksListener} + * events. + */ + public BlackPearlChunkAttemptRetryDelayBehavior(final EventDispatcher eventDispatcher) { + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null."); + + this.eventDispatcher = eventDispatcher; + } + + /** + * Delay for the amount of time a Black Pearl specifies in the payload it returns when a chunk operation does + * not complete. + * @param delayIntervalInSeconds The delay in seconds, between chunk operation retry attempts, that comes from a Black Pearl payload returned + * when a chunk operation does not complete. + * @throws InterruptedException + */ + @Override + public void delay(final int delayIntervalInSeconds) throws InterruptedException { + LOG.debug("Will retry allocate chunk call after {} seconds", delayIntervalInSeconds); + + eventDispatcher.emitWaitingForChunksEvents(delayIntervalInSeconds); + + Thread.sleep(delayIntervalInSeconds * 1000); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategy.java new file mode 100644 index 000000000..ded60b5bb --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategy.java @@ -0,0 +1,35 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; + +import java.io.IOException; + +/** + * An interface whose concrete implementation is used in chunk retrieval or allocation. When using streamed behavior, + * {@link TransferStrategyBuilder#usingStreamedTransferBehavior()}, blobs are retrieved sequentially, from the beginning + * of an object's range. + */ +public interface BlobStrategy { + /** + * @return An iterable listing the blobs and the client(s) those blobs reside on when doing a put or get. + * @throws IOException + * @throws InterruptedException + */ + Iterable getWork() throws IOException, InterruptedException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategyMaker.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategyMaker.java new file mode 100644 index 000000000..99aa87029 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/BlobStrategyMaker.java @@ -0,0 +1,30 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.models.MasterObjectList; + +/** + * An interface used as an intermediate when building a {@link com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy} + * instance as part of getting a transfer strategy from a {@link com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder}. + */ +public interface BlobStrategyMaker { + BlobStrategy makeBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher); +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryBehavior.java new file mode 100644 index 000000000..40b3906c8 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryBehavior.java @@ -0,0 +1,35 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import java.io.IOException; + +/** + * An interface whose concrete subclasses determine the retry behavior when a chunk + * operation does not complete. + */ +public interface ChunkAttemptRetryBehavior { + /** + * Perform a retry. + * @throws IOException + */ + void invoke() throws IOException; + + /** + * A chunk operation succeeded; reset the retry logic. + */ + void reset(); +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryDelayBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryDelayBehavior.java new file mode 100644 index 000000000..409c4ea1b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ChunkAttemptRetryDelayBehavior.java @@ -0,0 +1,29 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +/** + * An interface whose concrete subclasses determine the delay between retries when a + * chunk operation does not complete. + */ +public interface ChunkAttemptRetryDelayBehavior { + /** + * @param delayIntervalInSeconds The delay in seconds, between chunk operation retry attempts, that comes from a Black Pearl payload returned + * when a chunk operation does not complete. + * @throws InterruptedException + */ + void delay(final int delayIntervalInSeconds) throws InterruptedException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ClientDefinedChunkAttemptRetryDelayBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ClientDefinedChunkAttemptRetryDelayBehavior.java new file mode 100644 index 000000000..c1f53273d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ClientDefinedChunkAttemptRetryDelayBehavior.java @@ -0,0 +1,66 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * An implementation of {@link ChunkAttemptRetryDelayBehavior} that uses the delay a client specifies, + * as opposed to using the delay a Black Pearl returns in its payload when a chunk operation does not complete. + */ +public class ClientDefinedChunkAttemptRetryDelayBehavior implements ChunkAttemptRetryDelayBehavior { + private static final Logger LOG = LoggerFactory.getLogger(ClientDefinedChunkAttemptRetryDelayBehavior.class); + + private final int clientDefinedDelayInSeconds; + private final EventDispatcher eventDispatcher; + + /** + * @param clientDefinedDelayInSeconds A user-specified delay in seconds between retry attempts when a chunk + * operation does not complete. + * @param eventDispatcher + */ + public ClientDefinedChunkAttemptRetryDelayBehavior(final int clientDefinedDelayInSeconds, + final EventDispatcher eventDispatcher) + { + Preconditions.checkState(clientDefinedDelayInSeconds >= 0, "clientDefinedDelayInSeconds must be >= 0"); + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null"); + + this.clientDefinedDelayInSeconds = clientDefinedDelayInSeconds; + this.eventDispatcher = eventDispatcher; + } + + /** + * @param delayIntervalInSeconds The delay in seconds, between chunk operation retry attempts, that comes from a Black Pearl payload returned + * when a chunk operation does not complete. This {@link ChunkAttemptRetryDelayBehavior} + * subclass will use the {@code clientDefinedDelayInSeconds} as the delay, and not the + * delay the Black Pearl specifies. + * @throws InterruptedException + */ + @Override + public void delay(final int delayIntervalInSeconds) throws InterruptedException { + LOG.debug("Will retry allocate chunk call after {} seconds", clientDefinedDelayInSeconds); + + // Even though the BP is telling us how long to wait before trying to allocate a chunk again, + // we'll use the delay time the client has specified. + eventDispatcher.emitWaitingForChunksEvents(clientDefinedDelayInSeconds); + + Thread.sleep(clientDefinedDelayInSeconds * 1000); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ContinueForeverChunkAttemptsRetryBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ContinueForeverChunkAttemptsRetryBehavior.java new file mode 100644 index 000000000..fb2a5135c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/ContinueForeverChunkAttemptsRetryBehavior.java @@ -0,0 +1,34 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import java.io.IOException; + +/** + * An implementation of {@link ChunkAttemptRetryBehavior} that will continue to retry an uncompleted + * chunk operation until that operation succeeds. + */ +public class ContinueForeverChunkAttemptsRetryBehavior implements ChunkAttemptRetryBehavior { + @Override + public void invoke() throws IOException { + // intentionally not implemented + } + + @Override + public void reset() { + // intentionally not implemented + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/GetSequentialBlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/GetSequentialBlobStrategy.java new file mode 100644 index 000000000..3b5b82c7b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/GetSequentialBlobStrategy.java @@ -0,0 +1,99 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.base.Function; +import com.google.common.collect.FluentIterable; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; + +import javax.annotation.Nullable; +import java.io.IOException; + +/** + * A subclass of {@link BlobStrategy} used in get transfers. + */ +public class GetSequentialBlobStrategy extends AbstractBlobStrategy { + public GetSequentialBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior) + { + super(client, masterObjectList, eventDispatcher, retryBehavior, chunkAttemptRetryDelayBehavior); + } + + @Override + public synchronized Iterable getWork() throws IOException, InterruptedException { + // get chunks that have blobs ready for transfer from black pearl + final MasterObjectList masterObjectListWithAvailableChunks = masterObjectListWithAvailableChunks(); + + final FluentIterable chunks = FluentIterable.from(masterObjectListWithAvailableChunks.getObjects()); + + return chunks.transformAndConcat(new Function>() { + @Nullable + @Override + public Iterable apply(@Nullable final Objects chunk) { + return FluentIterable.from(chunk.getObjects()) + .transform(new Function() { + @Nullable + @Override + public JobPart apply(@Nullable final BulkObject blob) { + return new JobPart(client(), blob); + } + }); + } + }); + } + + private MasterObjectList masterObjectListWithAvailableChunks() throws IOException, InterruptedException { + do { + final GetJobChunksReadyForClientProcessingSpectraS3Response availableJobChunks = + client().getJobChunksReadyForClientProcessingSpectraS3(new GetJobChunksReadyForClientProcessingSpectraS3Request(masterObjectList().getJobId().toString())); + + switch (availableJobChunks.getStatus()) { + case AVAILABLE: { + retryBehavior().reset(); + return availableJobChunks.getMasterObjectListResult(); + } + case RETRYLATER: { + retryBehavior().invoke(); + + chunkAttemptRetryDelayBehavior().delay(availableJobChunks.getRetryAfterSeconds()); + + continue; + } + default: + assert false : "This line of code should be impossible to hit."; + } + } while(true); + } + + /** + * Emit an event when a blob is transferred. + * @param bulkObject The transferred blob. + */ + @Override + public void blobCompleted(final BulkObject bulkObject) { + // Intentionally not implemented + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/MaxChunkAttemptsRetryBehavior.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/MaxChunkAttemptsRetryBehavior.java new file mode 100644 index 000000000..ff69856d6 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/MaxChunkAttemptsRetryBehavior.java @@ -0,0 +1,46 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * A subclass of {@link ChunkAttemptRetryBehavior} that will retry an uncompleted + * chunk operation at most {@code maxAttempts} before giving up. + */ +public class MaxChunkAttemptsRetryBehavior implements ChunkAttemptRetryBehavior { + private final int maxAttempts; + private final AtomicInteger currentAttempt = new AtomicInteger(0); + + public MaxChunkAttemptsRetryBehavior(final int maxAttempts) { + this.maxAttempts = maxAttempts; + } + + @Override + public void invoke() throws IOException { + if (currentAttempt.incrementAndGet() > maxAttempts) { + throw new Ds3NoMoreRetriesException(maxAttempts); + } + } + + @Override + public void reset() { + currentAttempt.set(0); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy.java new file mode 100644 index 000000000..4ce14c93c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy.java @@ -0,0 +1,97 @@ +package com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.base.Function; +import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; +import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + +public class PutBlobStrategy extends AbstractBlobStrategy { + private final boolean streamingStrategyEnabled; + + private final JobState jobState; + + public PutBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior, + final JobState jobState, + final boolean streamingStrategy) + { + super(client, masterObjectList, eventDispatcher, retryBehavior, chunkAttemptRetryDelayBehavior); + this.jobState = jobState; + this.streamingStrategyEnabled = streamingStrategy; + } + @Override + public void blobCompleted(BulkObject bulkObject) { + // Intentionally not implemented + } + + @Override + public Iterable getWork() throws IOException, InterruptedException { + do { + final GetJobChunksReadyForClientProcessingSpectraS3Response response = client().getJobChunksReadyForClientProcessingSpectraS3( + new GetJobChunksReadyForClientProcessingSpectraS3Request(this.masterObjectList().getJobId())); + + if (response.getStatus() == GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE) { + final Set objectIds = new HashSet<>(); + final ImmutableList work = FluentIterable.from(response.getMasterObjectListResult().getObjects()) + .transformAndConcat(new Function>() { + @Nullable + @Override + public Iterable apply(@Nullable final Objects chunk) { + return FluentIterable.from(chunk.getObjects()) + .filter(input -> { + if (input.getInCache()) { + jobState.blobTransferredOrFailed(input); + return false; + } + if (!jobState.contains(input)) { + return false; + } + if (streamingStrategyEnabled) { + return objectIds.add(input.getId()); + } + return true; + }) + .transform(new Function() { + @Nullable + @Override + public JobPart apply(@Nullable final BulkObject blob) { + return new JobPart(client(), blob); + } + }); + } + }).toList(); + if (!work.isEmpty()) { + retryBehavior().reset(); + return work; + } + + if (jobState.isEmpty()) { + retryBehavior().reset(); + return Collections.emptyList(); + } + } + + retryBehavior().invoke(); + chunkAttemptRetryDelayBehavior().delay(response.getRetryAfterSeconds() > 0 ? response.getRetryAfterSeconds() : 1); + } while (true); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutSequentialBlobStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutSequentialBlobStrategy.java new file mode 100644 index 000000000..d0db6a116 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutSequentialBlobStrategy.java @@ -0,0 +1,116 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.base.Function; +import com.google.common.collect.FluentIterable; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Response; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.Iterator; + +import static com.spectralogic.ds3client.helpers.strategy.StrategyUtils.filterChunks; + +/** + * A subclass of {@link BlobStrategy} used in put transfers. + * @deprecated Use {@link PutBlobStrategy} instead + */ +@Deprecated +public class PutSequentialBlobStrategy extends AbstractBlobStrategy { + private final static Logger LOG = LoggerFactory.getLogger(PutSequentialBlobStrategy.class); + + private final Iterator chunksThatContainBlobs; + + public PutSequentialBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher, + final ChunkAttemptRetryBehavior retryBehavior, + final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior) + { + super(client, masterObjectList, eventDispatcher, retryBehavior, chunkAttemptRetryDelayBehavior); + this.chunksThatContainBlobs = filterChunks(masterObjectList.getObjects()).iterator(); + } + + @Override + public Iterable getWork() throws IOException, InterruptedException { + final Objects nextChunk = allocateChunk(chunksThatContainBlobs.next()); + + return FluentIterable.from(nextChunk.getObjects()) + .filter(input -> !input.getInCache()) + .transform(new Function() { + @Nullable + @Override + public JobPart apply(@Nullable final BulkObject blob) { + return new JobPart(client(), blob); + + // TODO: When we get to the point where BP enables clustering, we'll want to be able to get the + // client connection info correct for the server on which a chunk resides. StrategyUtils.getClient + // appears to work to support the clustering scenario, but we don't need it right now, and holding + // connection info in a collection potentially exposes lifetime management issues that we haven't + // fully explored. + // return new JobPart(StrategyUtils.getClient(uuidJobNodeImmutableMap,nextChunk.getNodeId(), getClient()), input); + } + }); + } + + private Objects allocateChunk(final Objects filtered) throws IOException { + Objects chunk = null; + while (chunk == null) { + chunk = tryAllocateChunk(filtered); + } + return chunk; + } + + private Objects tryAllocateChunk(final Objects filtered) throws IOException { + final AllocateJobChunkSpectraS3Response response = + client().allocateJobChunkSpectraS3(new AllocateJobChunkSpectraS3Request(filtered.getChunkId().toString())); + + LOG.info("AllocatedJobChunkResponse status: {}", response.getStatus().toString()); + + switch (response.getStatus()) { + case ALLOCATED: + retryBehavior().reset(); + return response.getObjectsResult(); + case RETRYLATER: + retryBehavior().invoke(); + + try { + chunkAttemptRetryDelayBehavior().delay(response.getRetryAfterSeconds()); + } catch (final InterruptedException e) { + throw new RuntimeException(e); + } + + return null; + default: + assert false : "This line of code should be impossible to hit."; return null; + } + } + + @Override + public void blobCompleted(final BulkObject bulkObject) { + // Intentionally not implemented + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelPreparable.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelPreparable.java new file mode 100644 index 000000000..0bb7224cf --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelPreparable.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; + +import java.io.IOException; + +/** + * When initiating data movement in a put or get, the source or destination channel my need some sort of + * preparation. For instance, when initiating a get, the destination channel may need to be truncated + * prior to moving data. + */ +public interface ChannelPreparable { + /** + * Prepare a channel prior to moving data. + * @param channelName The channel's identifier. + * @param channelBuilder The instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder} + * used to create a channel. + * @throws IOException + */ + void prepareChannel(final String channelName, final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) throws IOException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelStrategy.java new file mode 100644 index 000000000..6fac0a50f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/ChannelStrategy.java @@ -0,0 +1,46 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.models.BulkObject; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + +/** + * An interface whose concrete subclasses specify the behavior used to read or write a channel. + */ +public interface ChannelStrategy { + /** + * For a blob to be transferred, create a channel that will be the source for or destination + * of that transferred blob. + * @param blob The blob to be transferred. + * @return A {@link SeekableByteChannel} that will be the source for or destination + * of that transferred blob. + * @throws IOException + */ + SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException; + + /** + * When a blob has been transferred, release the source or destination channel associated with that + * blob. + * @param seekableByteChannel A {@link SeekableByteChannel} that had been allocated as the source for or destination + * of a blob transfer. + * @param blob The blob {@code seekableByteChannel} was allocated to source or sink {@code blob}'s data. + * @throws IOException + */ + void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/NullChannelPreparable.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/NullChannelPreparable.java new file mode 100644 index 000000000..4a50b4c4f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/NullChannelPreparable.java @@ -0,0 +1,40 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; + +import java.io.IOException; + +/** + * When initiating data movement in a put or get, the source or destination channel my need some sort of + * preparation. For instance, when initiating a get, the destination channel may need to be truncated + * prior to moving data. Use an instance of this class when the channel needs no preparation. Essentially, + * this class exists to provide a uniform way to create channels. + */ +public class NullChannelPreparable implements ChannelPreparable { + /** + * Prepare a channel prior to moving data. + * @param channelName The channel's identifier. + * @param channelBuilder The instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder} + * used to create a channel. + * @throws IOException + */ + @Override + public void prepareChannel(final String channelName, final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) throws IOException { + // Intentionally not implemented + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/RandomAccessChannelStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/RandomAccessChannelStrategy.java new file mode 100644 index 000000000..f268c0e60 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/RandomAccessChannelStrategy.java @@ -0,0 +1,139 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.channels.RangedSeekableByteChannel; +import com.spectralogic.ds3client.helpers.channels.WindowedSeekableByteChannel; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.utils.Guard; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * A subclass of {@link ChannelStrategy} that creates a channel per blob positioned at the offset + * correct for the current blob offset. + */ +public class RandomAccessChannelStrategy implements ChannelStrategy { + private final Object lock = new Object(); + + private final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder; + private final ImmutableMap> rangesForBlobs; + private final ChannelPreparable channelPreparer; + private final Map blobChannelMap; + + /** + * @param objectChannelBuilder An instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder}; + * usually an instance of {@link com.spectralogic.ds3client.helpers.FileObjectPutter} + * or {@link com.spectralogic.ds3client.helpers.FileObjectGetter}. + * @param rangesForBlobs A map that associates a blob's name with the {@link Range}(s) transfered as part of a get. This + * parameter may be null. + * @param channelPreparer An instance of {@link ChannelPreparable} used to prepare a channel prior to moving data, most likely + * either {@link TruncatingChannelPreparable} or {@link NullChannelPreparable}. + */ + public RandomAccessChannelStrategy(final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder, + final ImmutableMap> rangesForBlobs, + final ChannelPreparable channelPreparer) + { + Preconditions.checkNotNull(objectChannelBuilder, "objectChannelBuilder may not be null."); + Preconditions.checkNotNull(channelPreparer, "channelPreparer may not be null."); + + this.objectChannelBuilder = objectChannelBuilder; + this.rangesForBlobs = rangesForBlobs; + this.channelPreparer = channelPreparer; + blobChannelMap = new HashMap<>(); + } + + /** + * For a blob to be transferred, create a channel that will be the source for or destination + * of that transferred blob. + * @param blob The blob to be transferred. + * @return A {@link SeekableByteChannel} that will be the source for or destination + * of that transferred blob. + * @throws IOException + */ + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + synchronized (lock) { + channelPreparer.prepareChannel(blob.getName(), objectChannelBuilder); + + SeekableByteChannel seekableByteChannel = blobChannelMap.get(blob); + + if (seekableByteChannel == null) { + seekableByteChannel = new RangedSeekableByteChannel(objectChannelBuilder.buildChannel(blob.getName()), + getRangesForABlob(blob), + blob.getName()); + blobChannelMap.put(blob, seekableByteChannel); + } + + return new WindowedSeekableByteChannel(seekableByteChannel, lock, blob.getOffset(), blob.getLength()); + } + } + + private ImmutableMultimap getRangesForABlob(final BulkObject blob) { + if (Guard.isMapNullOrEmpty(rangesForBlobs)) { + return ImmutableMultimap.of(); + } + + final ImmutableMultimap rangesForABlob = rangesForBlobs.get(blob.getName()); + + if (Guard.isMultiMapNullOrEmpty(rangesForABlob)) { + return ImmutableMultimap.of(); + } + + return rangesForABlob; + } + + /** + * When a blob has been transferred, release the source or destination channel associated with that + * blob. + * @param seekableByteChannel A {@link SeekableByteChannel} that had been allocated as the source for or destination + * of a blob transfer. + * @param blob The blob {@code seekableByteChannel} was allocated to source or sink {@code blob}'s data. + * @throws IOException + */ + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + synchronized (lock) { + final SeekableByteChannel cachedChannel = blobChannelMap.remove(blob); + + Throwable closingCachedChannelException = null; + + try { + cachedChannel.close(); + } catch (final Throwable t) { + closingCachedChannelException = t; + } + + try { + seekableByteChannel.close(); + } catch (final Throwable t) { + throw new IOException(t); + } + + if (closingCachedChannelException != null) { + throw new IOException(closingCachedChannelException); + } + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SeekableByteChannelDecorator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SeekableByteChannelDecorator.java new file mode 100644 index 000000000..ac346246c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SeekableByteChannelDecorator.java @@ -0,0 +1,168 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.google.common.base.Preconditions; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.SeekableByteChannel; + +/** + * An instance of {@link SeekableByteChannel} used to decorate another SeekableByteChannel in the + * situation where we re-use the same channel for more than 1 blob. This subclass prevents closing + * a channel when there are other blobs still referencing the shared channel. + * + * This class positions the content of a blob within the bounds of a channel that may be capable + * of containing more than one blob. + */ +class SeekableByteChannelDecorator implements SeekableByteChannel { + private final Object lock = new Object(); + + private final SeekableByteChannel seekableByteChannel; + private final long blobOffset; + private final long blobLength; + private long nextAvailableByteOffset = 0; + + SeekableByteChannelDecorator(final SeekableByteChannel seekableByteChannel, final long blobOffset, final long blobLength) throws IOException { + Preconditions.checkNotNull(seekableByteChannel, "seekableByteChannel may not be null."); + Preconditions.checkArgument(blobOffset >= 0, "blobOffset must be >= 0."); + Preconditions.checkArgument(blobLength >= 0, "blobLength must be >= 0."); + this.seekableByteChannel = seekableByteChannel; + this.blobOffset = blobOffset; + this.blobLength = blobLength; + + seekableByteChannel.position(blobOffset); + } + + public SeekableByteChannel wrappedSeekableByteChannel() { + return seekableByteChannel; + } + + + @Override + public int read(final ByteBuffer dst) throws IOException { + synchronized (lock) { + final long remainingInWindow = blobLength - nextAvailableByteOffset; + final long numBytesWeCanRead = Math.min(dst.remaining(), remainingInWindow); + + if (numBytesWeCanRead <= 0) { + return 0; + } + + final int numBytesRead; + + if (numBytesWeCanRead != dst.remaining()) { + final ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[(int) numBytesWeCanRead]); + numBytesRead = seekableByteChannel.read(byteBuffer); + byteBuffer.flip(); + dst.put(byteBuffer); + } else { + numBytesRead = seekableByteChannel.read(dst); + } + + nextAvailableByteOffset += numBytesRead; + + return numBytesRead; + } + } + + @Override + public int write(final ByteBuffer src) throws IOException { + synchronized (lock) { + final long remainingInWindow = blobLength - nextAvailableByteOffset; + final long numBytesWeCanWrite = Math.min(src.remaining(), remainingInWindow); + + if (numBytesWeCanWrite <= 0) { + return 0; + } + + final int numBytesWritten; + + if (numBytesWeCanWrite != src.remaining()) { + final ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[(int) numBytesWeCanWrite]); + byteBuffer.put(src); + byteBuffer.flip(); + numBytesWritten = seekableByteChannel.write(byteBuffer); + } else { + numBytesWritten = seekableByteChannel.write(src); + } + + nextAvailableByteOffset += numBytesWritten; + + return numBytesWritten; + } + } + + @Override + public long position() throws IOException { + synchronized (lock) { + return seekableByteChannel.position(); + } + } + + @Override + public SeekableByteChannel position(final long newPosition) throws IOException { + synchronized (lock) { + final long greatestPossiblePosition = blobLength - 1; + nextAvailableByteOffset = Math.min(newPosition, greatestPossiblePosition); + seekableByteChannel.position(blobOffset + nextAvailableByteOffset); + + return this; + } + } + + @Override + public long size() throws IOException { + synchronized (lock) { + return seekableByteChannel.size(); + } + } + + @Override + public SeekableByteChannel truncate(final long size) throws IOException { + synchronized (lock) { + return seekableByteChannel.truncate(size); + } + } + + @Override + public boolean isOpen() { + synchronized (lock) { + return seekableByteChannel.isOpen(); + } + } + + @Override + public void close() throws IOException { + // Intentionally not implemented + } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (!(o instanceof SeekableByteChannelDecorator)) return false; + + final SeekableByteChannelDecorator that = (SeekableByteChannelDecorator) o; + + return seekableByteChannel.equals(that.seekableByteChannel); + } + + @Override + public int hashCode() { + return seekableByteChannel.hashCode(); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialChannelStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialChannelStrategy.java new file mode 100644 index 000000000..9b4950431 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialChannelStrategy.java @@ -0,0 +1,132 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.SetMultimap; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.channelbuilders.ReadOnlySeekableByteChannel; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; +import java.util.HashMap; +import java.util.Map; + +/** + * A subclass of {@link ChannelStrategy} used to provide "streamed" access to a channel, + * where streamed means that the channel will be accessed in sequentially increasing offsets. + * This class acts as an aggregator that references 1 underlying channel for any number of blobs that + * reference the channel. + */ +public class SequentialChannelStrategy implements ChannelStrategy { + private final Object lock = new Object(); + + private final SetMultimap blobNameOffsetMap = HashMultimap.create(); + private final Map blobNameChannelMap = new HashMap<>(); + + private final ChannelStrategy channelStrategyDelegate; + private final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder; + private final ChannelPreparable channelPreparer; + private final MasterObjectList masterObjectList; + + /** + * @param channelStrategy The instance of {@link ChannelStrategy} that holds the 1 channel reference a blob needs + * to transfer data. + * @param objectChannelBuilder An instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder}; + * usually an instance of {@link com.spectralogic.ds3client.helpers.FileObjectPutter} + * or {@link com.spectralogic.ds3client.helpers.FileObjectGetter}. + * @param channelPreparer An instance of {@link ChannelPreparable} used to prepare a channel prior to moving data, most likely + * either {@link TruncatingChannelPreparable} or {@link NullChannelPreparable}. + */ + public SequentialChannelStrategy(final ChannelStrategy channelStrategy, + final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder, + final ChannelPreparable channelPreparer, + final MasterObjectList masterObjectList) + { + channelStrategyDelegate = channelStrategy; + this.objectChannelBuilder = objectChannelBuilder; + this.channelPreparer = channelPreparer; + this.masterObjectList = masterObjectList; + } + + /** + * For a blob to be transferred, create a channel that will be the source for or destination + * of that transferred blob. + * @param blob The blob to be transferred. + * @return A {@link SeekableByteChannel} that will be the source for or destination + * of that transferred blob. + * @throws IOException + */ + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + synchronized (lock) { + final String blobName = blob.getName(); + + blobNameOffsetMap.put(blobName, blob.getOffset()); + + final SeekableByteChannel seekableByteChannel = blobNameChannelMap.get(blobName); + + if (seekableByteChannel != null) { + return seekableByteChannel; + } + + return makeNewChannel(blob); + } + } + + private SeekableByteChannel makeNewChannel(final BulkObject blob) throws IOException { + channelPreparer.prepareChannel(blob.getName(), objectChannelBuilder); + + final SeekableByteChannel seekableByteChannel = channelStrategyDelegate.acquireChannelForBlob(blob); + final SeekableByteChannelDecorator seekableByteChannelDecorator = new SeekableByteChannelDecorator(seekableByteChannel, blob.getOffset(), blob.getLength()); + + blobNameChannelMap.put(blob.getName(), seekableByteChannelDecorator); + return seekableByteChannelDecorator; + } + + /** + * When a blob has been transferred, release the source or destination channel associated with that + * blob. + * @param seekableByteChannel A {@link SeekableByteChannel} that had been allocated as the source for or destination + * of a blob transfer. + * @param blob The blob {@code seekableByteChannel} was allocated to source or sink {@code blob}'s data. + * @throws IOException + */ + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + synchronized (lock) { + final String blobName = blob.getName(); + + blobNameOffsetMap.remove(blobName, blob.getOffset()); + + final Long maximumOffset = masterObjectList.getObjects().stream() + .flatMap(objects -> objects.getObjects().stream()) + .filter(bulkObject -> bulkObject.getName().equals(blobName)) + .map(bulkObject -> bulkObject.getOffset()) + .max(Long::compareTo).orElseGet(() -> blob.getOffset()); + + final boolean isReadOnly = ((SeekableByteChannelDecorator) seekableByteChannel).wrappedSeekableByteChannel() instanceof ReadOnlySeekableByteChannel; + + if (blobNameOffsetMap.get(blobName).size() == 0 && (blob.getOffset() == maximumOffset || !(isReadOnly))) { + blobNameChannelMap.remove(blobName); + channelStrategyDelegate.releaseChannelForBlob(((SeekableByteChannelDecorator)seekableByteChannel).wrappedSeekableByteChannel(), blob); + } + + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileReaderChannelStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileReaderChannelStrategy.java new file mode 100644 index 000000000..2f7270fdc --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileReaderChannelStrategy.java @@ -0,0 +1,68 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.models.BulkObject; +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + +/** + * A subclass of {@link ChannelStrategy} that holds the instance of a channel a blob will during + * a put operation. + */ +public class SequentialFileReaderChannelStrategy implements ChannelStrategy { + private final Object lock = new Object(); + private final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder; + + /** + * @param objectChannelBuilder An instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder}; + * usually an instance of {@link com.spectralogic.ds3client.helpers.FileObjectPutter}. + */ + public SequentialFileReaderChannelStrategy(final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder) { + this.objectChannelBuilder = objectChannelBuilder; + } + + /** + * For a blob to be transferred, create a channel that will be the source for or destination + * of that transferred blob. + * @param blob The blob to be transferred. + * @return A {@link SeekableByteChannel} that will be the source for or destination + * of that transferred blob. + * @throws IOException + */ + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + synchronized (lock) { + return objectChannelBuilder.buildChannel(blob.getName()); + } + } + + /** + * When a blob has been transferred, release the source or destination channel associated with that + * blob. + * @param seekableByteChannel A {@link SeekableByteChannel} that had been allocated as the source for or destination + * of a blob transfer. + * @param blob The blob {@code seekableByteChannel} was allocated to source or sink {@code blob}'s data. + * @throws IOException + */ + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + synchronized (lock) { + seekableByteChannel.close(); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileWriterChannelStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileWriterChannelStrategy.java new file mode 100644 index 000000000..998fd6c71 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/SequentialFileWriterChannelStrategy.java @@ -0,0 +1,69 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.models.BulkObject; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + +/** + * A subclass of {@link ChannelStrategy} that holds the instance of a channel a blob will during + * a get operation. + */ +public class SequentialFileWriterChannelStrategy implements ChannelStrategy { + private final Object lock = new Object(); + private final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder; + + /** + * @param objectChannelBuilder An instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder}; + * usually an instance of {@link com.spectralogic.ds3client.helpers.FileObjectGetter}. + */ + public SequentialFileWriterChannelStrategy(final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder) { + this.objectChannelBuilder = objectChannelBuilder; + } + + /** + * For a blob to be transferred, create a channel that will be the source for or destination + * of that transferred blob. + * @param blob The blob to be transferred. + * @return A {@link SeekableByteChannel} that will be the source for or destination + * of that transferred blob. + * @throws IOException + */ + @Override + public SeekableByteChannel acquireChannelForBlob(final BulkObject blob) throws IOException { + synchronized (lock) { + return objectChannelBuilder.buildChannel(blob.getName()); + } + } + + /** + * When a blob has been transferred, release the source or destination channel associated with that + * blob. + * @param seekableByteChannel A {@link SeekableByteChannel} that had been allocated as the source for or destination + * of a blob transfer. + * @param blob The blob {@code seekableByteChannel} was allocated to source or sink {@code blob}'s data. + * @throws IOException + */ + @Override + public void releaseChannelForBlob(final SeekableByteChannel seekableByteChannel, final BulkObject blob) throws IOException { + synchronized (lock) { + seekableByteChannel.close(); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/TruncatingChannelPreparable.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/TruncatingChannelPreparable.java new file mode 100644 index 000000000..f806608ec --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/channelstrategy/TruncatingChannelPreparable.java @@ -0,0 +1,46 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.channelstrategy; + +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; + +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * When initiating data movement in a put or get, the source or destination channel my need some sort of + * preparation. For instance, when initiating a get, the destination channel may need to be truncated + * prior to moving data. + */ +public class TruncatingChannelPreparable implements ChannelPreparable { + private final Set channelNames = new HashSet<>(); + + /** + * Prepare a channel prior to moving data. This will truncate a chennal prior to opening it the + * first time. + * @param channelName The channel's identifier. + * @param channelBuilder The instance of {@link com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder} + * used to create a channel. + * @throws IOException + */ + @Override + public void prepareChannel(final String channelName, final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) throws IOException { + if (channelNames.add(channelName)) { + channelBuilder.buildChannel(channelName).truncate(0).close(); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractObserver.java new file mode 100644 index 000000000..a02b3ab87 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractObserver.java @@ -0,0 +1,36 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; + +/** + * An observer implementation that provides a default update method. + * @param The context data to send with an update. + */ +public abstract class AbstractObserver implements UpdateStrategy { + private final UpdateStrategy updateStrategy; + + public AbstractObserver(final UpdateStrategy updateStrategy) { + Preconditions.checkNotNull(updateStrategy, "updateStrategy may not be null."); + this.updateStrategy = updateStrategy; + } + + @Override + public void update(final T eventData) { + updateStrategy.update(eventData); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractTransferStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractTransferStrategy.java new file mode 100644 index 000000000..249a752bd --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/AbstractTransferStrategy.java @@ -0,0 +1,265 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.collect.FluentIterable; +import com.google.common.collect.Iterables; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.CancelJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.PutBulkJobSpectraS3Request; +import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.BlobStrategy; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; + +import java.io.IOException; +import java.util.NoSuchElementException; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BooleanSupplier; + +import com.spectralogic.ds3client.networking.FailedRequestException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * An implementation of {@link TransferStrategy} that provides a default implementation {@code transfer} + * implementation. + */ +abstract class AbstractTransferStrategy implements TransferStrategy { + private static final Logger LOG = LoggerFactory.getLogger(AbstractTransferStrategy.class); + + private final BlobStrategy blobStrategy; + private final JobState jobState; + private final ExecutorService executorService; + private final EventDispatcher eventDispatcher; + private final MasterObjectList masterObjectList; + private final Ds3Client ds3Client; + private final FailureEvent.FailureActivity failureActivity; + + private final AtomicReference cachedException = new AtomicReference<>(); + private volatile boolean canceled = false; + + private TransferMethod transferMethod; + + /** + * @param blobStrategy Most likely one of {@link com.spectralogic.ds3client.helpers.strategy.blobstrategy.PutSequentialBlobStrategy} + * or {@link com.spectralogic.ds3client.helpers.strategy.blobstrategy.GetSequentialBlobStrategy}. + * @param jobState An instance of {@link JobState} that keeps track of the blobs we need to process. + * @param executorService An instance of {@link java.util.concurrent.Executor} used to run transfers. Streamed behavior + * uses a single-threaded executor, and random access uses a multi-threaded executor. + * @param eventDispatcher An instance of {@link EventDispatcher} used to emit events as transfers proceed. + * @param masterObjectList The {@link MasterObjectList} returned primarily retrieved from a call to {@link Ds3Client#putBulkJobSpectraS3(PutBulkJobSpectraS3Request)} + * or {@link Ds3Client#getBulkJobSpectraS3(GetBulkJobSpectraS3Request)}, used primarily + * to add contextual information to events. + * @param failureActivity Either {@link com.spectralogic.ds3client.helpers.events.FailureEvent.FailureActivity#PuttingObject} or + * {@link com.spectralogic.ds3client.helpers.events.FailureEvent.FailureActivity#PuttingObject}, used + * to add contextual information to events. + */ + public AbstractTransferStrategy(final BlobStrategy blobStrategy, + final JobState jobState, + final ExecutorService executorService, + final EventDispatcher eventDispatcher, + final MasterObjectList masterObjectList, + final Ds3Client ds3Client, + final FailureEvent.FailureActivity failureActivity) + { + this.blobStrategy = blobStrategy; + this.jobState = jobState; + this.executorService = executorService; + this.eventDispatcher = eventDispatcher; + this.masterObjectList = masterObjectList; + this.ds3Client = ds3Client; + this.failureActivity = failureActivity; + } + + /** + * Provide a delegate that moves each blob. + * @param transferMethod An instance of {@link TransferMethod} that moves data for a given blob. + * @return The instance of this class, with the intent that you can string together the transfer method composition + * and a call to {@code transfer}. + */ + public AbstractTransferStrategy withTransferMethod(final TransferMethod transferMethod) { + this.transferMethod = transferMethod; + return this; + } + + /** + * Perform data movement according to the properties you specify in {@link TransferStrategyBuilder}. + * @throws IOException + */ + @Override + public void transfer() throws IOException { + cachedException.set(null); + // Keep going, unless we've been canceled + + try { + transferAllJobBlobs(); + } finally { + close(); + } + + if (cachedException.get() != null) { + throw cachedException.get(); + } + } + + private void transferAllJobBlobs() throws IOException { + final BooleanSupplier cancellationCheck = () -> !canceled; + final AtomicInteger numBlobsRemaining = new AtomicInteger(jobState.numBlobsInJob()); + + while (!Thread.currentThread().isInterrupted() && cancellationCheck.getAsBoolean() && numBlobsRemaining.get() > 0) { + try { + final Iterable jobParts = jobPartsNotAlreadyTransferred(cancellationCheck); + + final int numJobParts = Iterables.size(jobParts); + + if (numJobParts <= 0) { + break; + } + + final CountDownLatch jobPartsCompleteLatch = new CountDownLatch(numJobParts); + transferJobParts(jobParts, jobPartsCompleteLatch, numBlobsRemaining, cancellationCheck); + jobPartsCompleteLatch.await(); + } catch (final Ds3NoMoreRetriesException | FailedRequestException e) { + emitFailureEvent(makeFailureEvent(failureActivity, e, firstChunk())); + throw e; + } catch (final InterruptedException | NoSuchElementException e) { + LOG.warn("Thread was interrupted"); + Thread.currentThread().interrupt(); + } catch (final Throwable t) { + emitFailureAndSetCachedException(t); + } + } + } + + + private Iterable jobPartsNotAlreadyTransferred(final BooleanSupplier cancellationCheck) throws IOException, InterruptedException { + // If we've been canceled, bail + if ( ! cancellationCheck.getAsBoolean()) { + return FluentIterable.of(); + } + + return FluentIterable + .from(blobStrategy.getWork()) + .filter(jobPart -> jobState.contains(jobPart.getBlob()) && cancellationCheck.getAsBoolean()); + } + + private void emitFailureAndSetCachedException(final Throwable t) { + emitFailureEvent(makeFailureEvent(failureActivity, t, firstChunk())); + maybeSetCachedException(t); + } + + private synchronized void maybeSetCachedException(final Throwable t) { + if (cachedException.get() == null) { + if (t instanceof IOException) { + cachedException.set((IOException)t); + } else { + cachedException.set(new IOException(t)); + } + } + } + + private void transferJobParts(final Iterable jobParts, + final CountDownLatch jobPartsCompleteLatch, + final AtomicInteger numBlobsTransferred, + final BooleanSupplier cancellationCheck) { + for (final JobPart jobPart : jobParts) { + if (executorService.isShutdown()) { + LOG.debug("Executor service is shut down, decrementing countdown latch"); + jobPartsCompleteLatch.countDown(); + } else { + executorService.execute(() -> { + try { + if (cancellationCheck.getAsBoolean()) { + transferMethod.transferJobPart(jobPart); + } + } catch (final RuntimeException e) { + emitFailureAndSetCachedException(e); + throw e; + } catch (final Exception e) { + emitFailureAndSetCachedException(e); + throw new RuntimeException(e); + } finally { + jobState.blobTransferredOrFailed(jobPart.getBlob()); + numBlobsTransferred.decrementAndGet(); + jobPartsCompleteLatch.countDown(); + } + }); + } + } + } + + private void emitFailureEvent(final FailureEvent failureEvent) { + eventDispatcher.emitFailureEvent(failureEvent); + } + + private FailureEvent makeFailureEvent(final FailureEvent.FailureActivity failureActivity, + final Throwable causalException, + final Objects chunk) + { + return new FailureEvent.Builder() + .doingWhat(failureActivity) + .withCausalException(causalException) + .withObjectNamed(labelForChunk(chunk)) + .usingSystemWithEndpoint(masterObjectList.getNodes().get(0).getEndPoint()) + .build(); + } + + private static String labelForChunk(final Objects chunk) { + try { + return chunk.getObjects().get(0).getName(); + } catch (final Throwable t) { + LOG.error("Failed to get label for chunk.", t); + } + + return "unnamed object"; + } + + private Objects firstChunk() { + return masterObjectList.getObjects().get(0); + } + + @Override + public void close() { + canceled = true; + executorService.shutdown(); + try { + if(!executorService.awaitTermination(10, TimeUnit.SECONDS)) { + executorService.shutdownNow(); + } + } catch (final InterruptedException e) { + executorService.shutdownNow(); + } + } + + @Override + public void cancel() throws IOException { + close(); + final UUID jobId = masterObjectList.getJobId(); + ds3Client.cancelJobSpectraS3(new CancelJobSpectraS3Request(jobId)); + eventDispatcher.emitCanceledEvent(jobId); + } + +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/BlobTransferredEventObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/BlobTransferredEventObserver.java new file mode 100644 index 000000000..0b6835b4d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/BlobTransferredEventObserver.java @@ -0,0 +1,31 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.models.BulkObject; + +/** + * This class provides the ability to emit an event when a blob transfer has completed. + */ +public class BlobTransferredEventObserver extends AbstractObserver { + /** + * @param updateStrategy The interface whose implementation determines how to handle emitting an event + * when a blob transfer completes. + */ + public BlobTransferredEventObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/CanceledEventObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/CanceledEventObserver.java new file mode 100644 index 000000000..75fd55d1e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/CanceledEventObserver.java @@ -0,0 +1,25 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import java.util.UUID; + +public class CanceledEventObserver extends AbstractObserver { + public CanceledEventObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } +} + diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumEvent.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumEvent.java new file mode 100644 index 000000000..39cadcb64 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumEvent.java @@ -0,0 +1,46 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; + +/** + * The event emitted when we have computed the checksum for a blob to be transferred to a Black Pearl. + */ +public class ChecksumEvent { + private final BulkObject blob; + private final ChecksumType.Type checksumType; + private final String checksum; + + public ChecksumEvent(final BulkObject blob, final ChecksumType.Type checksumType, final String checksum) { + this.blob = blob; + this.checksumType = checksumType; + this.checksum = checksum; + } + + public BulkObject getBlob() { + return blob; + } + + public ChecksumType.Type getChecksumType() { + return checksumType; + } + + public String getChecksum() { + return checksum; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumObserver.java new file mode 100644 index 000000000..08f5b443e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ChecksumObserver.java @@ -0,0 +1,56 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.ChecksumListener; + +/** + * This class provides the ability to emit an event when we have computed the checksum value for a blob to be + * transferred to a Black Pearl. + */ +public class ChecksumObserver extends AbstractObserver { + + /** + * @param checksumListener An instance of {@link ChecksumListener} wrapped in an event updater. + */ + public ChecksumObserver(final ChecksumListener checksumListener) { + super(new ChecksumEventUpdateStrategy(checksumListener)); + + Preconditions.checkNotNull(checksumListener, "checksumListener may not be null."); + } + + /** + * @param updateStrategy The interface whose implementation determines how to handle emitting an event + * when we compute the checksum for a blob. + */ + public ChecksumObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + private static class ChecksumEventUpdateStrategy implements UpdateStrategy { + private final ChecksumListener checksumListener; + + public ChecksumEventUpdateStrategy(final ChecksumListener checksumListener) { + this.checksumListener = checksumListener; + } + + @Override + public void update(final ChecksumEvent eventData) { + checksumListener.value(eventData.getBlob(), eventData.getChecksumType(), eventData.getChecksum()); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ContinueForeverTransferRetryDecorator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ContinueForeverTransferRetryDecorator.java new file mode 100644 index 000000000..d3fb5518b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ContinueForeverTransferRetryDecorator.java @@ -0,0 +1,61 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.ExceptionClassifier; +import com.spectralogic.ds3client.helpers.JobPart; + +import java.io.IOException; + +/** + * A {@link TransferRetryDecorator} that will continue to retry a blob transfer, until the transfer either + * succeeds or experiences an unrecoverable exception. + */ +public class ContinueForeverTransferRetryDecorator implements TransferRetryDecorator { + private TransferMethod transferMethodDelegate; + + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + while(true) { + try { + transferMethodDelegate.transferJobPart(jobPart); + break; + } catch (final Throwable t) { + if (ExceptionClassifier.isUnrecoverableException(t)) { + throw t; + } + } + } + } + + /** + * @param transferMethod An instance of {@link TransferMethod} used as a delegate when attempting a transfer. + * @return An instance of this class, with the intent to be able to chain a call to + * {@code transferJobPart}. + */ + @Override + public TransferMethod wrap(final TransferMethod transferMethod) { + Preconditions.checkNotNull(transferMethod, "transferMethod may not be null."); + transferMethodDelegate = transferMethod; + return this; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/DataTransferredObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/DataTransferredObserver.java new file mode 100644 index 000000000..7a271a47b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/DataTransferredObserver.java @@ -0,0 +1,44 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.DataTransferredListener; + +public class DataTransferredObserver extends AbstractObserver { + public DataTransferredObserver(final DataTransferredListener dataTransferredListener) { + super(new LongUpdateStrategy(dataTransferredListener)); + + Preconditions.checkNotNull(dataTransferredListener, "dataTransferredListener may not be null."); + } + + public DataTransferredObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + private static class LongUpdateStrategy implements UpdateStrategy { + private final DataTransferredListener dataTransferredListener; + + public LongUpdateStrategy(final DataTransferredListener dataTransferredListener) { + this.dataTransferredListener = dataTransferredListener; + } + + @Override + public void update(final Long eventData) { + dataTransferredListener.dataTransferred(eventData); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcher.java new file mode 100644 index 000000000..010ab4383 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcher.java @@ -0,0 +1,144 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.helpers.ChecksumListener; +import com.spectralogic.ds3client.helpers.DataTransferredListener; +import com.spectralogic.ds3client.helpers.FailureEventListener; +import com.spectralogic.ds3client.helpers.MetadataReceivedListener; +import com.spectralogic.ds3client.helpers.ObjectCompletedListener; +import com.spectralogic.ds3client.helpers.WaitingForChunksListener; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.networking.Metadata; + +import java.util.UUID; + +/** + * An interface to provide the ability to register for and emit events. In prior versions of this SDK, + * clients needed to hold an instance of a listener implementation to later unregister its receipt of events. + * This interface allows for just keeping a reference to an observer to unregister. + */ +public interface EventDispatcher { + /** + * Attaches an event handler that is invoked when a blob is successfully + * transferred to Spectra S3. + */ + DataTransferredObserver attachDataTransferredObserver(final DataTransferredObserver dataTransferredObserver); + void removeDataTransferredObserver(final DataTransferredObserver dataTransferredObserver); + + /** + * Attaches an event handler that is invoked when a full object is + * successfully transferred to Spectra S3. + */ + ObjectCompletedObserver attachObjectCompletedObserver(final ObjectCompletedObserver objectCompletedObserver); + void removeObjectCompletedObserver(final ObjectCompletedObserver objectCompletedObserver); + + /** + * Attaches an event handler that is invoked when an object checksum is received. + */ + ChecksumObserver attachChecksumObserver(final ChecksumObserver checksumObserver); + void removeChecksumObserver(final ChecksumObserver checksumObserver); + + /** + * Attaches an event handler that will be invoked only when there are no chunks available + * for processing. + */ + WaitingForChunksObserver attachWaitingForChunksObserver(final WaitingForChunksObserver waitingForChunksObserver); + void removeWaitingForChunksObserver(final WaitingForChunksObserver waitingForChunksObserver); + + /** + * Attaches an event handler when an object transfer fails + */ + FailureEventObserver attachFailureEventObserver(final FailureEventObserver failureEventObserver); + void removeFailureEventObserver(final FailureEventObserver failureEventObserver); + + /** + * Attaches an event handler invoked when we receive metadata from an object get. + */ + MetaDataReceivedObserver attachMetadataReceivedEventObserver(final MetaDataReceivedObserver metaDataReceivedObserver); + void removeMetadataReceivedEventObserver(final MetaDataReceivedObserver metaDataReceivedObserver); + + /** + * Attaches an event invoked when a blob transfer completes. The primary use for this event is to remove + * a blob from the list of those to transfer when a blob transfer completes. + */ + BlobTransferredEventObserver attachBlobTransferredEventObserver(final BlobTransferredEventObserver blobTransferredEventObserver); + void removeBlobTransferredEventObserver(final BlobTransferredEventObserver blobTransferredEventObserver); + + /** + * Attaches an event handler that is invoked when a blob is successfully + * transferred to Spectra S3. + */ + void attachDataTransferredListener(final DataTransferredListener listener); + void removeDataTransferredListener(final DataTransferredListener listener); + + /** + * Attaches an event handler that is invoked when a full object is + * successfully transferred to Spectra S3. + */ + void attachObjectCompletedListener(final ObjectCompletedListener listener); + void removeObjectCompletedListener(final ObjectCompletedListener listener); + + /** + * Attaches an event handler that is invoked when metadata is received for + * an object. + */ + void attachMetadataReceivedListener(final MetadataReceivedListener listener); + void removeMetadataReceivedListener(final MetadataReceivedListener listener); + + /** + * Attaches an event handler that is invoked when an object checksum is received. + */ + void attachChecksumListener(final ChecksumListener listener); + void removeChecksumListener(final ChecksumListener listener); + + /** + * Attaches an event handler that will be invoked only when there are no chunks available + * for processing. + */ + void attachWaitingForChunksListener(final WaitingForChunksListener listener); + void removeWaitingForChunksListener(final WaitingForChunksListener listener); + + /** + * Attaches an event handler when an object transfer fails + */ + void attachFailureEventListener(final FailureEventListener listener); + void removeFailureEventListener(final FailureEventListener listener); + + CanceledEventObserver attachCanceledEventObserver(final CanceledEventObserver canceledEventObserver); + void removeCanceledEventObserver(final CanceledEventObserver canceledEventObserver); + + void emitFailureEvent(final FailureEvent failureEvent); + void emitWaitingForChunksEvents(final int secondsToDelay); + void emitChecksumEvent(final BulkObject blob, final ChecksumType.Type type, final String checksum); + void emitDataTransferredEvent(final BulkObject blob); + void emitObjectCompletedEvent(final BulkObject blob); + void emitObjectCompletedEvent(final String blobName); + void emitMetaDataReceivedEvent(final String objectName, final Metadata metadata); + void emitBlobTransferredEvent(final BulkObject blob); + void emitCanceledEvent(final UUID jobId); + + /** + * Emit an event when a get transfers less content than was intended. This event is triggered by catching + * a {@link com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException}. + * @param ds3Object The blob whose content was only partially transferred. + * @param endpoint The host name or IP address of the Black Pearl involved in a transfer that only partially completed. + * @param t The {@link com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException}. + */ + void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final String endpoint, final Throwable t); +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcherImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcherImpl.java new file mode 100644 index 000000000..aec3e801d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/EventDispatcherImpl.java @@ -0,0 +1,333 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.spectralogic.ds3client.helpers.ChecksumListener; +import com.spectralogic.ds3client.helpers.DataTransferredListener; +import com.spectralogic.ds3client.helpers.FailureEventListener; +import com.spectralogic.ds3client.helpers.MetadataReceivedListener; +import com.spectralogic.ds3client.helpers.ObjectCompletedListener; +import com.spectralogic.ds3client.helpers.WaitingForChunksListener; +import com.spectralogic.ds3client.helpers.events.EventRunner; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.events.MetadataEvent; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.networking.Metadata; + +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class EventDispatcherImpl implements EventDispatcher { + private final EventRunner eventRunner; + + private final Set dataTransferredObservers = Sets.newIdentityHashSet(); + private final Set objectCompletedObservers = Sets.newIdentityHashSet(); + private final Set checksumObservers = Sets.newIdentityHashSet(); + private final Set waitingForChunksObservers = Sets.newIdentityHashSet(); + private final Set failureEventObservers = Sets.newIdentityHashSet(); + private final Set metaDataReceivedObservers = Sets.newConcurrentHashSet(); + private final Set blobTransferredEventObservers = Sets.newIdentityHashSet(); + private final Set canceledEventObservers = Sets.newIdentityHashSet(); + + private final Map dataTransferredListeners = Maps.newConcurrentMap(); + private final Map objectCompletedListeners = Maps.newIdentityHashMap(); + private final Map metadataReceivedListeners = Maps.newIdentityHashMap(); + private final Map checksumListeners = Maps.newIdentityHashMap(); + private final Map waitingForChunksListeners = Maps.newIdentityHashMap(); + private final Map failureEventListeners = Maps.newIdentityHashMap(); + + public EventDispatcherImpl(final EventRunner eventRunner) { + Preconditions.checkNotNull(eventRunner, "eventRunner must not be null."); + this.eventRunner = eventRunner; + } + + @Override + public DataTransferredObserver attachDataTransferredObserver(final DataTransferredObserver dataTransferredObserver) { + dataTransferredObservers.add(dataTransferredObserver); + return dataTransferredObserver; + } + + @Override + public void removeDataTransferredObserver(final DataTransferredObserver dataTransferredObserver) { + dataTransferredObservers.remove(dataTransferredObserver); + } + + @Override + public ObjectCompletedObserver attachObjectCompletedObserver(final ObjectCompletedObserver objectCompletedObserver) { + objectCompletedObservers.add(objectCompletedObserver); + return objectCompletedObserver; + } + + @Override + public void removeObjectCompletedObserver(final ObjectCompletedObserver objectCompletedObserver) { + objectCompletedObservers.remove(objectCompletedObserver); + } + + @Override + public ChecksumObserver attachChecksumObserver(final ChecksumObserver checksumObserver) { + checksumObservers.add(checksumObserver); + return checksumObserver; + } + + @Override + public void removeChecksumObserver(final ChecksumObserver checksumObserver) { + checksumObservers.remove(checksumObserver); + } + + @Override + public WaitingForChunksObserver attachWaitingForChunksObserver(final WaitingForChunksObserver waitingForChunksObserver) { + waitingForChunksObservers.add(waitingForChunksObserver); + return waitingForChunksObserver; + } + + @Override + public void removeWaitingForChunksObserver(final WaitingForChunksObserver waitingForChunksObserver) { + waitingForChunksObservers.remove(waitingForChunksObserver); + } + + @Override + public FailureEventObserver attachFailureEventObserver(final FailureEventObserver failureEventObserver) { + failureEventObservers.add(failureEventObserver); + return failureEventObserver; + } + + @Override + public void removeFailureEventObserver(final FailureEventObserver failureEventObserver) { + failureEventObservers.remove(failureEventObserver); + } + + @Override + public MetaDataReceivedObserver attachMetadataReceivedEventObserver(final MetaDataReceivedObserver metaDataReceivedObserver) { + metaDataReceivedObservers.add(metaDataReceivedObserver); + return metaDataReceivedObserver; + } + + @Override + public void removeMetadataReceivedEventObserver(final MetaDataReceivedObserver metaDataReceivedObserver) { + metaDataReceivedObservers.remove(metaDataReceivedObserver); + } + + @Override + public BlobTransferredEventObserver attachBlobTransferredEventObserver(final BlobTransferredEventObserver blobTransferredEventObserver) { + blobTransferredEventObservers.add(blobTransferredEventObserver); + return blobTransferredEventObserver; + } + + @Override + public void removeBlobTransferredEventObserver(final BlobTransferredEventObserver blobTransferredEventObserver) { + blobTransferredEventObservers.remove(blobTransferredEventObserver); + } + + + @Override + public void attachDataTransferredListener(final DataTransferredListener listener) { + DataTransferredObserver dataTransferredObserver = dataTransferredListeners.get(listener); + + if (dataTransferredObserver == null) { + dataTransferredObserver = attachDataTransferredObserver(new DataTransferredObserver(listener)); + dataTransferredListeners.put(listener, dataTransferredObserver); + } + } + + @Override + public void removeDataTransferredListener(final DataTransferredListener listener) { + final DataTransferredObserver dataTransferredObserver = dataTransferredListeners.get(listener); + + if (dataTransferredObserver != null) { + removeDataTransferredObserver(dataTransferredObserver); + dataTransferredListeners.remove(listener); + } + } + + @Override + public void attachObjectCompletedListener(final ObjectCompletedListener listener) { + ObjectCompletedObserver objectCompletedObserver = objectCompletedListeners.get(listener); + + if (objectCompletedObserver == null) { + objectCompletedObserver = attachObjectCompletedObserver(new ObjectCompletedObserver(listener)); + objectCompletedListeners.put(listener, objectCompletedObserver); + } + } + + @Override + public void removeObjectCompletedListener(final ObjectCompletedListener listener) { + final ObjectCompletedObserver objectCompletedObserver = objectCompletedListeners.get(listener); + + if (objectCompletedObserver != null) { + removeObjectCompletedObserver(objectCompletedObserver); + objectCompletedListeners.remove(listener); + } + } + + @Override + public void attachMetadataReceivedListener(final MetadataReceivedListener listener) { + MetaDataReceivedObserver metaDataReceivedObserver = metadataReceivedListeners.get(listener); + + if (metaDataReceivedObserver == null) { + metaDataReceivedObserver = attachMetadataReceivedEventObserver(new MetaDataReceivedObserver(listener)); + metadataReceivedListeners.put(listener, metaDataReceivedObserver); + } + } + + @Override + public void removeMetadataReceivedListener(final MetadataReceivedListener listener) { + final MetaDataReceivedObserver metaDataReceivedObserver = metadataReceivedListeners.get(listener); + + if (metaDataReceivedObserver != null) { + removeMetadataReceivedEventObserver(metaDataReceivedObserver); + metadataReceivedListeners.remove(listener); + } + } + + @Override + public void attachChecksumListener(final ChecksumListener listener) { + ChecksumObserver checksumObserver = checksumListeners.get(listener); + + if (checksumObserver == null) { + checksumObserver = attachChecksumObserver(new ChecksumObserver(listener)); + checksumListeners.put(listener, checksumObserver); + } + } + + @Override + public void removeChecksumListener(final ChecksumListener listener) { + final ChecksumObserver checksumObserver = checksumListeners.get(listener); + + if (checksumObserver != null) { + removeChecksumObserver(checksumObserver); + checksumListeners.remove(listener); + } + } + + @Override + public void attachWaitingForChunksListener(final WaitingForChunksListener listener) { + WaitingForChunksObserver waitingForChunksObserver = waitingForChunksListeners.get(listener); + + if (waitingForChunksObserver == null) { + waitingForChunksObserver = attachWaitingForChunksObserver(new WaitingForChunksObserver(listener)); + waitingForChunksListeners.put(listener, waitingForChunksObserver); + } + } + + @Override + public void removeWaitingForChunksListener(final WaitingForChunksListener listener) { + final WaitingForChunksObserver waitingForChunksObserver = waitingForChunksListeners.get(listener); + + if (waitingForChunksObserver != null) { + removeWaitingForChunksObserver(waitingForChunksObserver); + waitingForChunksListeners.remove(listener); + } + } + + @Override + public void attachFailureEventListener(final FailureEventListener listener) { + FailureEventObserver failureEventObserver = failureEventListeners.get(listener); + + if (failureEventObserver == null) { + failureEventObserver = attachFailureEventObserver(new FailureEventObserver(listener)); + failureEventListeners.put(listener, failureEventObserver); + } + } + + @Override + public void removeFailureEventListener(final FailureEventListener listener) { + final FailureEventObserver failureEventObserver = failureEventListeners.get(listener); + + if (failureEventObserver != null) { + removeFailureEventObserver(failureEventObserver); + failureEventListeners.remove(listener); + } + } + + @Override + public CanceledEventObserver attachCanceledEventObserver(final CanceledEventObserver canceledEventObserver) { + canceledEventObservers.add(canceledEventObserver); + return canceledEventObserver; + } + + @Override + public void removeCanceledEventObserver(final CanceledEventObserver canceledEventObserver) { + canceledEventObservers.remove(canceledEventObserver); + } + + @Override + public void emitFailureEvent(final FailureEvent failureEvent) { + emitEvents(failureEventObservers, failureEvent); + } + + @SuppressWarnings("unchecked") + private void emitEvents(final Set eventObservers, final T eventData) { + for (final Object eventObserver : eventObservers) { + eventRunner.emitEvent(() -> ((Observer)eventObserver).update(eventData)); + } + } + + @Override + public void emitWaitingForChunksEvents(final int secondsToDelay) { + emitEvents(waitingForChunksObservers, secondsToDelay); + } + + @Override + public void emitChecksumEvent(final BulkObject blob, final ChecksumType.Type type, final String checksum) { + emitEvents(checksumObservers, new ChecksumEvent(blob, type, checksum)); + } + + @Override + public void emitDataTransferredEvent(final BulkObject blob) { + emitEvents(dataTransferredObservers, blob.getLength()); + } + + @Override + public void emitObjectCompletedEvent(final BulkObject blob) { + emitObjectCompletedEvent(blob.getName()); + } + + @Override + public void emitObjectCompletedEvent(final String blobName) { + emitEvents(objectCompletedObservers, blobName); + } + + @Override + public void emitMetaDataReceivedEvent(final String objectName, final Metadata metadata) { + emitEvents(metaDataReceivedObservers, new MetadataEvent(objectName, metadata)); + } + + @Override + public void emitBlobTransferredEvent(final BulkObject blob) { + emitEvents(blobTransferredEventObservers, blob); + } + + @Override + public void emitCanceledEvent(final UUID jobId) { + emitEvents(canceledEventObservers, jobId); + } + + @Override + public void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final String endpoint, final Throwable t) { + final FailureEvent failureEvent = FailureEvent.builder() + .doingWhat(FailureEvent.FailureActivity.GettingObject) + .usingSystemWithEndpoint(endpoint) + .withCausalException(t) + .withObjectNamed(ds3Object.getName()) + .build(); + emitFailureEvent(failureEvent); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/FailureEventObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/FailureEventObserver.java new file mode 100644 index 000000000..1b274f776 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/FailureEventObserver.java @@ -0,0 +1,56 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.FailureEventListener; +import com.spectralogic.ds3client.helpers.events.FailureEvent; + +/** + * This class provides the ability to emit an event when we have encountered an exception + * during a blob transfer. + */ +public class FailureEventObserver extends AbstractObserver { + /** + * @param failureEventListener An instance of {@link FailureEventListener} wrapped in an event updater. + */ + public FailureEventObserver(final FailureEventListener failureEventListener) { + super(new FailureEventUpdateStrategy(failureEventListener)); + + Preconditions.checkNotNull(failureEventListener, "failureEventListener may not be null."); + } + + /** + * @param updateStrategy An interface whose implementation determines how to handle a failure + * event. + */ + public FailureEventObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + private static class FailureEventUpdateStrategy implements UpdateStrategy { + private final FailureEventListener failureEventListener; + + public FailureEventUpdateStrategy(final FailureEventListener failureEventListener) { + this.failureEventListener = failureEventListener; + } + + @Override + public void update(final FailureEvent eventData) { + failureEventListener.onFailure(eventData); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobNetworkFailureRetryDecorator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobNetworkFailureRetryDecorator.java new file mode 100644 index 000000000..9b2d7dde9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobNetworkFailureRetryDecorator.java @@ -0,0 +1,200 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.RecoverableIOException; +import com.spectralogic.ds3client.helpers.strategy.StrategyUtils; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.utils.Guard; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * An implementation of {@link TransferMethod} that wraps another instance of TransferMethod to provide the + * ability to resume a get operation that transfers less data than is needed for a blob transfer to complete. + */ +public class GetJobNetworkFailureRetryDecorator implements TransferMethod { + private final ChannelStrategy channelStrategy; + private final String bucketName; + private final String jobId; + private final EventDispatcher eventDispatcher; + private final ImmutableMap> rangesForBlobs; + + private final Map transferMethodMap = new HashMap<>(); + + public GetJobNetworkFailureRetryDecorator(final ChannelStrategy channelStrategy, + final String bucketName, + final String jobId, + final EventDispatcher eventDispatcher, + final ImmutableMap> rangesForBlobs) + { + this.channelStrategy = channelStrategy; + this.bucketName = bucketName; + this.jobId = jobId; + this.eventDispatcher = eventDispatcher; + this.rangesForBlobs = rangesForBlobs; + } + + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + try { + getOrMakeTransferMethod(jobPart).transferJobPart(jobPart); + } catch (final ContentLengthNotMatchException contentLengthNotMatchException) { + makeTransferMethodForPartialRetry(jobPart, contentLengthNotMatchException.getTotalBytes()); + throw new RecoverableIOException(contentLengthNotMatchException); + } + } + + private synchronized TransferMethod getOrMakeTransferMethod(final JobPart jobPart) { + TransferState transferState = transferMethodMap.get(jobPart); + + if (transferState != null) { + return transferState.getTransferMethod(); + } + + transferState = makeInitialTransferState(); + + transferMethodMap.put(jobPart, transferState); + + return transferState.getTransferMethod(); + } + + private TransferState makeInitialTransferState() { + final ImmutableCollection ranges = null; + final Long numBytesToTransfer = null; + final long destinationChannelOffset = 0L; + + return new TransferState( + ranges, + numBytesToTransfer, + destinationChannelOffset, + new GetJobTransferMethod(channelStrategy, bucketName, jobId, eventDispatcher, rangesForBlobs) + ); + } + + private synchronized void makeTransferMethodForPartialRetry(final JobPart jobPart, final long numBytesTransferred) { + final TransferState existingTransferState = transferMethodMap.get(jobPart); + + ImmutableCollection ranges = initializeRanges(jobPart.getBlob(), existingTransferState); + final Long numBytesToTransfer = initializeNumBytesToTransfer(existingTransferState, ranges); + ranges = updateRanges(ranges, numBytesTransferred, numBytesToTransfer); + final long destinationChannelOffset = existingTransferState.getDestinationChannelOffset() + numBytesTransferred; + + final TransferState newTransferState = new TransferState( + ranges, + numBytesToTransfer, + destinationChannelOffset, + new GetJobPartialBlobTransferMethod(channelStrategy, + bucketName, + jobId, + eventDispatcher, + ranges, + destinationChannelOffset) + ); + + transferMethodMap.put(jobPart, newTransferState); + } + + private ImmutableCollection initializeRanges(final BulkObject blob, final TransferState existingTransferState) { + ImmutableCollection ranges = existingTransferState.getRanges(); + + if (ranges == null) { + ranges = StrategyUtils.getRangesForBlob(rangesForBlobs, blob); + } + + if (ranges == null) { + final long numBytesTransferred = 0; + ranges = adjustRangesForBlobOffset(updateRanges(ranges, numBytesTransferred, blob.getLength()), blob); + } + + return ranges; + } + + private static ImmutableCollection adjustRangesForBlobOffset(final ImmutableCollection ranges, final BulkObject blob) { + if (Guard.isNullOrEmpty(ranges) || ranges.size() > 1) { + return ranges; + } + + final Range firstRange = ranges.iterator().next(); + + final long blobOffset = blob.getOffset(); + + return ImmutableList.of(new Range(firstRange.getStart() + blobOffset, firstRange.getEnd() + blobOffset)); + } + + private static ImmutableCollection updateRanges(final ImmutableCollection ranges, + final long numBytesTransferred, + final Long numBytesToTransfer) + { + return RangeHelper.replaceRange(ranges, numBytesTransferred, numBytesToTransfer); + } + + private static Long initializeNumBytesToTransfer(final TransferState existingTransferState, + final ImmutableCollection ranges) + { + Long numBytesToTransfer = existingTransferState.getNumBytesToTransfer(); + + if (numBytesToTransfer == null) { + numBytesToTransfer = RangeHelper.transferSizeForRanges(ranges); + } + + return numBytesToTransfer; + } + + private static class TransferState { + private final ImmutableCollection ranges; + private final Long numBytesToTransfer; + private final Long destinationChannelOffset; + private final TransferMethod transferMethod; + + private TransferState(final ImmutableCollection ranges, + final Long numBytesToTransfer, + final Long destinationChannelOffset, + final TransferMethod transferMethod) + { + this.ranges = ranges; + this.numBytesToTransfer = numBytesToTransfer; + this.destinationChannelOffset = destinationChannelOffset; + this.transferMethod = transferMethod; + } + + public ImmutableCollection getRanges() { + return ranges; + } + + public Long getNumBytesToTransfer() { + return numBytesToTransfer; + } + + public Long getDestinationChannelOffset() { + return destinationChannelOffset; + } + + public TransferMethod getTransferMethod() { + return transferMethod; + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobPartialBlobTransferMethod.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobPartialBlobTransferMethod.java new file mode 100644 index 000000000..3eedab248 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobPartialBlobTransferMethod.java @@ -0,0 +1,102 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableCollection; +import com.spectralogic.ds3client.commands.GetObjectRequest; +import com.spectralogic.ds3client.commands.GetObjectResponse; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.common.Range; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + +/** + * When a blob transfer retrieves less data than is needed to compete the transfer, the {@link GetJobNetworkFailureRetryDecorator} + * that recognizes that situation will create an instance of this class. This class aggregates the data needed to + * transfer the remainder of blob data. + */ +public class GetJobPartialBlobTransferMethod implements TransferMethod { + private final ChannelStrategy channelStrategy; + private final String bucketName; + private final String jobId; + private final EventDispatcher eventDispatcher; + private final ImmutableCollection blobRanges; + private final long destinationChannelOffset; + + public GetJobPartialBlobTransferMethod(final ChannelStrategy channelStrategy, + final String bucketName, + final String jobId, + final EventDispatcher eventDispatcher, + final ImmutableCollection blobRanges, + final long destinationChannelOffset) + { + Preconditions.checkNotNull(blobRanges, "blobRanges may not be null."); + Preconditions.checkState(destinationChannelOffset >= 0, "destinationChannelOffset must be >= 0."); + + this.channelStrategy = channelStrategy; + this.bucketName = bucketName; + this.jobId = jobId; + this.eventDispatcher = eventDispatcher; + this.blobRanges = blobRanges; + this.destinationChannelOffset = destinationChannelOffset; + } + + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + final BulkObject blob = jobPart.getBlob(); + + final SeekableByteChannel seekableByteChannel = channelStrategy.acquireChannelForBlob(blob); + + seekableByteChannel.position(destinationChannelOffset); + + try { + final GetObjectResponse getObjectResponse = jobPart.getClient().getObject(makeGetObjectRequest(seekableByteChannel, blob)); + + eventDispatcher.emitChecksumEvent(blob, getObjectResponse.getChecksumType(), getObjectResponse.getChecksum()); + eventDispatcher.emitMetaDataReceivedEvent(blob.getName(), getObjectResponse.getMetadata()); + + eventDispatcher.emitBlobTransferredEvent(blob); + eventDispatcher.emitDataTransferredEvent(blob); + } finally { + channelStrategy.releaseChannelForBlob(seekableByteChannel, blob); + } + } + + private GetObjectRequest makeGetObjectRequest(final SeekableByteChannel seekableByteChannel, final BulkObject blob) { + final GetObjectRequest getObjectRequest = new GetObjectRequest( + bucketName, + blob.getName(), + seekableByteChannel, + jobId, + blob.getOffset()); + + if (blob.getVersionId() != null) { + getObjectRequest.withVersionId(blob.getVersionId()); + } + getObjectRequest.withByteRanges(blobRanges); + + return getObjectRequest; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobTransferMethod.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobTransferMethod.java new file mode 100644 index 000000000..2c383a8fc --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/GetJobTransferMethod.java @@ -0,0 +1,101 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.spectralogic.ds3client.commands.GetObjectRequest; +import com.spectralogic.ds3client.commands.GetObjectResponse; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.strategy.StrategyUtils; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.common.Range; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + +/** + * The HTTP GET implementation class that retrieves a blob from a Black Pearl. + */ +public class GetJobTransferMethod implements TransferMethod { + private final ChannelStrategy channelStrategy; + private final String bucketName; + private final String jobId; + private final EventDispatcher eventDispatcher; + + // This is a map of blob name to ranges for a blob of that name. + private final ImmutableMap> rangesForBlobs; + + public GetJobTransferMethod(final ChannelStrategy channelStrategy, + final String bucketName, + final String jobId, + final EventDispatcher eventDispatcher, + final ImmutableMap> rangesForBlobs) + { + this.channelStrategy = channelStrategy; + this.bucketName = bucketName; + this.jobId = jobId; + this.eventDispatcher = eventDispatcher; + this.rangesForBlobs = rangesForBlobs; + } + + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + final SeekableByteChannel seekableByteChannel = channelStrategy.acquireChannelForBlob(jobPart.getBlob()); + + final GetObjectResponse getObjectResponse = jobPart.getClient().getObject(makeGetObjectRequest(seekableByteChannel, jobPart)); + + final BulkObject blob = jobPart.getBlob(); + + channelStrategy.releaseChannelForBlob(seekableByteChannel, blob); + + eventDispatcher.emitChecksumEvent(blob, getObjectResponse.getChecksumType(), getObjectResponse.getChecksum()); + eventDispatcher.emitMetaDataReceivedEvent(blob.getName(), getObjectResponse.getMetadata()); + + eventDispatcher.emitBlobTransferredEvent(blob); + eventDispatcher.emitDataTransferredEvent(blob); + } + + private GetObjectRequest makeGetObjectRequest(final SeekableByteChannel seekableByteChannel, final JobPart jobPart) { + final BulkObject blob = jobPart.getBlob(); + + final GetObjectRequest getObjectRequest = new GetObjectRequest( + bucketName, + blob.getName(), + seekableByteChannel, + jobId, + blob.getOffset()); + + if (jobPart.getBlob().getVersionId() != null) { + getObjectRequest.withVersionId(jobPart.getBlob().getVersionId()); + } + + final ImmutableCollection rangesForBlob = StrategyUtils.getRangesForBlob(rangesForBlobs, blob); + + if (rangesForBlob != null) { + getObjectRequest.withByteRanges(rangesForBlob); + } + + return getObjectRequest; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MaxNumObjectTransferAttemptsDecorator.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MaxNumObjectTransferAttemptsDecorator.java new file mode 100644 index 000000000..534f53831 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MaxNumObjectTransferAttemptsDecorator.java @@ -0,0 +1,68 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.ExceptionClassifier; +import com.spectralogic.ds3client.helpers.JobPart; + +import java.io.IOException; + +/** + * A {@link TransferRetryDecorator} that will continue to retry a blob transfer at most {@code maxNumObjectTransferAttempts} + * times, until the transfer either succeeds or experiences an unrecoverable exception. + */ +public class MaxNumObjectTransferAttemptsDecorator implements TransferRetryDecorator { + private final int maxNumObjectTransferAttempts; + private TransferMethod transferMethodDelegate; + + public MaxNumObjectTransferAttemptsDecorator(final int maxNumObjectTransferAttempts) { + this.maxNumObjectTransferAttempts = maxNumObjectTransferAttempts; + } + + /** + * @param transferMethod An instance of {@link TransferMethod} used as a delegate when attempting a transfer. + * @return An instance of this class, with the intent to be able to chain a call to + * {@code transferJobPart}. + */ + @Override + public TransferMethod wrap(final TransferMethod transferMethod) { + Preconditions.checkNotNull(transferMethod, "transferMethod may not be null."); + transferMethodDelegate = transferMethod; + return this; + } + + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + int objectTransfersAttempted = 0; + + while(true) { + try { + transferMethodDelegate.transferJobPart(jobPart); + break; + } catch (final Throwable t) { + if (ExceptionClassifier.isUnrecoverableException(t) || ++objectTransfersAttempted >= maxNumObjectTransferAttempts) { + throw t; + } + } + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MetaDataReceivedObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MetaDataReceivedObserver.java new file mode 100644 index 000000000..96f759789 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MetaDataReceivedObserver.java @@ -0,0 +1,79 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.MetadataReceivedListener; +import com.spectralogic.ds3client.helpers.events.MetadataEvent; + +/** + * This class provides the ability to emit an event when we receive metadata during a get operation. + */ +public class MetaDataReceivedObserver extends AbstractObserver { + private MetadataReceivedListener metadataReceivedListener; + + /** + * @param metadataReceivedListener An instance of {@link MetadataReceivedListener} wrapped in an event + * updater. + */ + public MetaDataReceivedObserver(final MetadataReceivedListener metadataReceivedListener) { + super(new MetadataEventUpdateStrategy(metadataReceivedListener)); + + Preconditions.checkNotNull(metadataReceivedListener, "metadataReceivedListener may not be null."); + + this.metadataReceivedListener = metadataReceivedListener; + } + + /** + * @param updateStrategy An {@link UpdateStrategy} whose implementation determines how to emit a metadata + * event. + */ + public MetaDataReceivedObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + @Override + public boolean equals(final Object o) { + if (this == o) return true; + if (!(o instanceof MetaDataReceivedObserver)) return false; + if (!super.equals(o)) return false; + + final MetaDataReceivedObserver that = (MetaDataReceivedObserver) o; + + return metadataReceivedListener != null ? metadataReceivedListener.equals(that.metadataReceivedListener) : that.metadataReceivedListener == null; + + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + (metadataReceivedListener != null ? metadataReceivedListener.hashCode() : 0); + return result; + } + + private static class MetadataEventUpdateStrategy implements UpdateStrategy { + private final MetadataReceivedListener metadataReceivedListener; + + public MetadataEventUpdateStrategy(final MetadataReceivedListener metadataReceivedListener) { + this.metadataReceivedListener = metadataReceivedListener; + } + + @Override + public void update(final MetadataEvent eventData) { + metadataReceivedListener.metadataReceived(eventData.getObjectName(), eventData.getMetadata()); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MultiThreadedTransferStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MultiThreadedTransferStrategy.java new file mode 100644 index 000000000..b9eb20352 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/MultiThreadedTransferStrategy.java @@ -0,0 +1,46 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.BlobStrategy; +import com.spectralogic.ds3client.models.MasterObjectList; + +import java.util.concurrent.Executors; + +/** + * An implementation of {@link TransferStrategy} that runs transfers in a multi-threaded executor. + */ +public class MultiThreadedTransferStrategy extends AbstractTransferStrategy { + public MultiThreadedTransferStrategy(final BlobStrategy blobStrategy, + final JobState jobState, + final int numConcurrentTransferThreads, + final EventDispatcher eventDispatcher, + final MasterObjectList masterObjectList, + final Ds3Client ds3Client, + final FailureEvent.FailureActivity failureActivity) + { + super(blobStrategy, + jobState, + Executors.newFixedThreadPool(numConcurrentTransferThreads), + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ObjectCompletedObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ObjectCompletedObserver.java new file mode 100644 index 000000000..bbfbef085 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/ObjectCompletedObserver.java @@ -0,0 +1,55 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.ObjectCompletedListener; + +/** + * An {@link Observer} that enables sending event when a DS3 object transfer completes. + */ +public class ObjectCompletedObserver extends AbstractObserver { + /** + * @param objectCompletedListener An {@link ObjectCompletedListener} wrapped in an event + * updater. + */ + public ObjectCompletedObserver(final ObjectCompletedListener objectCompletedListener) { + super(new StringUpdateStrategy(objectCompletedListener)); + + Preconditions.checkNotNull(objectCompletedListener, "objectCompletedListener may not be null"); + } + + /** + * @param updateStrategy An {@link UpdateStrategy} whose implementation determines how to handle a DS3 object transfer + * completion. + */ + public ObjectCompletedObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + private static class StringUpdateStrategy implements UpdateStrategy { + private final ObjectCompletedListener objectCompletedListener; + + public StringUpdateStrategy(final ObjectCompletedListener objectCompletedListener) { + this.objectCompletedListener = objectCompletedListener; + } + + @Override + public void update(final String eventData) { + objectCompletedListener.objectCompleted(eventData); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/Observer.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/Observer.java new file mode 100644 index 000000000..abaf599bf --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/Observer.java @@ -0,0 +1,24 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +/** + * An interface to allow for sending events. + * @param The context data to send with an event. + */ +public interface Observer { + void update(final T eventData); +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/PutJobTransferMethod.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/PutJobTransferMethod.java new file mode 100644 index 000000000..e9882791c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/PutJobTransferMethod.java @@ -0,0 +1,133 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.collect.ImmutableMap; +import com.spectralogic.ds3client.commands.PutObjectRequest; +import com.spectralogic.ds3client.helpers.ChecksumFunction; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.MetadataAccess; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; + +import java.io.IOException; +import java.nio.channels.ByteChannel; +import java.nio.channels.SeekableByteChannel; +import java.util.Map; + +import com.spectralogic.ds3client.utils.Guard; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The HTTP PUT implementation class that retrieves a blob from a Black Pearl. + */ +public class PutJobTransferMethod implements TransferMethod { + private static final Logger LOG = LoggerFactory.getLogger(PutJobTransferMethod.class); + + private final ChannelStrategy channelStrategy; + private final String bucketName; + private final String jobId; + private final EventDispatcher eventDispatcher; + private final ChecksumFunction checksumFunction; + private final ChecksumType.Type checksumType; + private final MetadataAccess metadataAccess; + + public PutJobTransferMethod(final ChannelStrategy channelStrategy, + final String bucketName, + final String jobId, + final EventDispatcher eventDispatcher, + final ChecksumFunction checksumFunction, + final ChecksumType.Type checksumType, + final MetadataAccess metadataAccess) + { + this.channelStrategy = channelStrategy; + this.bucketName = bucketName; + this.jobId = jobId; + this.eventDispatcher = eventDispatcher; + this.checksumFunction = checksumFunction; + this.checksumType = checksumType; + this.metadataAccess = metadataAccess; + } + + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + @Override + public void transferJobPart(final JobPart jobPart) throws IOException { + final BulkObject blob = jobPart.getBlob(); + + final SeekableByteChannel seekableByteChannel = channelStrategy.acquireChannelForBlob(blob); + + jobPart.getClient().putObject(makePutObjectRequest(seekableByteChannel, jobPart)); + + channelStrategy.releaseChannelForBlob(seekableByteChannel, blob); + + eventDispatcher.emitBlobTransferredEvent(blob); + eventDispatcher.emitDataTransferredEvent(blob); + } + + private PutObjectRequest makePutObjectRequest(final SeekableByteChannel seekableByteChannel, final JobPart jobPart) { + final BulkObject blob = jobPart.getBlob(); + + final PutObjectRequest putObjectRequest = new PutObjectRequest( + bucketName, + blob.getName(), + seekableByteChannel, + jobId, + blob.getOffset(), + blob.getLength()); + + addCheckSum(blob, putObjectRequest); + addMetadata(blob, putObjectRequest); + + return putObjectRequest; + } + + private void addCheckSum(final BulkObject blob, final PutObjectRequest putObjectRequest) { + if (checksumFunction != null) { + final String checksum; + + try { + final ByteChannel byteChannel = channelStrategy.acquireChannelForBlob(blob); + checksum = checksumFunction.compute(blob, byteChannel); + + if (checksum != null) { + putObjectRequest.withChecksum(ChecksumType.value(checksum), checksumType); + eventDispatcher.emitChecksumEvent(blob, checksumType, checksum); + } + } catch (final IOException e) { + // TODO Emit a failure event here + LOG.info("Failure creating channel to calculate checksum.", e); + } + } + } + + private void addMetadata(final BulkObject blob, final PutObjectRequest putObjectRequest) { + if (metadataAccess != null) { + final Map metadata = metadataAccess.getMetadataValue(blob.getName()); + if ( ! Guard.isMapNullOrEmpty(metadata)) { + final ImmutableMap immutableMetadata = ImmutableMap.copyOf(metadata); + for (final Map.Entry value : immutableMetadata.entrySet()) { + putObjectRequest.withMetaData(value.getKey(), value.getValue()); + } + } + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RangeHelper.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelper.java similarity index 83% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RangeHelper.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelper.java index 915a2576e..b4d62c203 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/RangeHelper.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelper.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -13,7 +13,7 @@ * **************************************************************************** */ -package com.spectralogic.ds3client.helpers; +package com.spectralogic.ds3client.helpers.strategy.transferstrategy; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableCollection; @@ -22,10 +22,14 @@ import com.spectralogic.ds3client.models.common.Range; import com.spectralogic.ds3client.utils.Guard; +/** + * A class used in calculating the remaining data offset(s) and length(s) when we transfer less than an entire + * blob during a get. + */ final class RangeHelper { private RangeHelper() {} - static ImmutableCollection replaceRange(final ImmutableCollection existingRanges, + protected static ImmutableCollection replaceRange(final ImmutableCollection existingRanges, final long numBytesTransferred, final long intendedNumBytesToTransfer) { @@ -62,13 +66,13 @@ static ImmutableCollection replaceRange(final ImmutableCollection return newRangesbuilder.build(); } - static void addRemainingRanges(final UnmodifiableIterator existingRangesIterator, final ImmutableList.Builder newRangesbuilder) { + private static void addRemainingRanges(final UnmodifiableIterator existingRangesIterator, final ImmutableList.Builder newRangesbuilder) { while (existingRangesIterator.hasNext()) { newRangesbuilder.add(existingRangesIterator.next()); } } - static long transferSizeForRanges(final ImmutableCollection existingRanges) { + protected static long transferSizeForRanges(final ImmutableCollection existingRanges) { long result = 0; if (Guard.isNullOrEmpty(existingRanges)) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java new file mode 100644 index 000000000..11864ba8e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/SingleThreadedTransferStrategy.java @@ -0,0 +1,45 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.BlobStrategy; +import com.spectralogic.ds3client.models.MasterObjectList; + +import java.util.concurrent.Executors; + +/** + * An implementation of {@link TransferStrategy} that runs transfers in a single-threaded executor. + */ +public class SingleThreadedTransferStrategy extends AbstractTransferStrategy { + public SingleThreadedTransferStrategy(final BlobStrategy blobStrategy, + final JobState jobState, + final EventDispatcher eventDispatcher, + final MasterObjectList masterObjectList, + final Ds3Client ds3Client, + final FailureEvent.FailureActivity failureActivity) + { + super(blobStrategy, + jobState, + Executors.newSingleThreadExecutor(), + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethod.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethod.java new file mode 100644 index 000000000..3d301efe9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethod.java @@ -0,0 +1,32 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.spectralogic.ds3client.helpers.JobPart; + +import java.io.IOException; + +/** + * Define the contract used to put or get a blob. + */ +public interface TransferMethod { + /** + * @param jobPart An instance of {@link JobPart}, which tells us which Black Pearl is the source + * or destination for a blob transfer. + * @throws IOException + */ + void transferJobPart(final JobPart jobPart) throws IOException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethodMaker.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethodMaker.java new file mode 100644 index 000000000..f00e1c0d2 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferMethodMaker.java @@ -0,0 +1,24 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +/** + * An interface whose implementation determines the specific {@link TransferMethod} subclass to create + * when building a {@link TransferStrategy} in {@link TransferStrategyBuilder}. + */ +interface TransferMethodMaker { + TransferMethod makeTransferMethod(); +} diff --git a/ds3-sdk-integration/build.gradle b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferRetryDecorator.java similarity index 70% rename from ds3-sdk-integration/build.gradle rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferRetryDecorator.java index 56fcfed45..5d89b6701 100644 --- a/ds3-sdk-integration/build.gradle +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferRetryDecorator.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -13,10 +13,8 @@ * **************************************************************************** */ -dependencies { - compile 'commons-codec:commons-codec:1.10' - compile 'junit:junit:4.12' - testCompile 'org.hamcrest:hamcrest-library:1.3' - testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' -} +package com.spectralogic.ds3client.helpers.strategy.transferstrategy; +public interface TransferRetryDecorator extends TransferMethod { + TransferMethod wrap(final TransferMethod transferMethod); +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy.java new file mode 100644 index 000000000..0c9d8552c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy.java @@ -0,0 +1,37 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import java.io.Closeable; +import java.io.IOException; + +/** + * Define the contract for concrete classes that implement data movement. + */ +public interface TransferStrategy extends Closeable { + /** + * Perform data movement according to the properties you specify in {@link TransferStrategyBuilder}. + * @throws IOException + */ + void transfer() throws IOException; + + /** + * Cancel a transfer in progress. This is a cooperative activity, meaning that transfers + * in progress are allowed to complete and are not forcefully canceled. + * @throws IOException + */ + void cancel() throws IOException; +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java new file mode 100644 index 000000000..62fbd9656 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategyBuilder.java @@ -0,0 +1,912 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Iterables; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.Ds3ClientBuilder; +import com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.PutBulkJobSpectraS3Request; +import com.spectralogic.ds3client.helpers.ChecksumFunction; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.JobPartTracker; +import com.spectralogic.ds3client.helpers.JobPartTrackerFactory; +import com.spectralogic.ds3client.helpers.MetadataAccess; +import com.spectralogic.ds3client.helpers.ObjectCompletedListener; +import com.spectralogic.ds3client.helpers.ObjectPart; +import com.spectralogic.ds3client.helpers.events.EventRunner; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; +import com.spectralogic.ds3client.helpers.strategy.StrategyUtils; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.*; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.ChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.NullChannelPreparable; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.RandomAccessChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.SequentialChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.SequentialFileReaderChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.SequentialFileWriterChannelStrategy; +import com.spectralogic.ds3client.helpers.strategy.channelstrategy.TruncatingChannelPreparable; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; +import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.utils.Guard; +import com.spectralogic.ds3client.utils.SeekableByteChannelInputStream; +import com.spectralogic.ds3client.utils.hashing.ChecksumUtils; +import com.spectralogic.ds3client.utils.hashing.Hasher; +import com.spectralogic.ds3client.helpers.JobState; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.channels.ByteChannel; +import java.util.ArrayList; +import java.util.List; + +/** + * This class allows for building configurable behavior when putting objects to or getting objects + * from a Black Pearl. The intent is to provide the ability for transfers to be "streamed" or "random access". + * Streaming, as used in a transfer strategy, means that channels and blobs are read or written sequentially. + * You would use a streaming strategy when it is important that the source or destination channel is read or + * written in a predictable, sequential order while a transfer is in progress. + * Random access means that channels and blobs are read and written in no particular order. You would use + * a random access strategy when it is not important that a source or destination channel is read or written + * in a predictable order while a transfer is in progress. Once a transfer is complete, the destination channel + * and Black Pearl objects are ordered as was the original archived object. + * + * You specify that you want streamed behavior by calling {@link TransferStrategyBuilder#usingStreamedTransferBehavior()} + * and random access behavior by calling {@link TransferStrategyBuilder#usingRandomAccessTransferBehavior()}. If you + * specify neither, the transfer strategy used will behave as this SDK behaved before introducing the ability + * to specify transfer behavior. + * + * The 2 methods to call to get an instance of a {@link TransferStrategy}, which is the interface that performs data + * movement, are {@link TransferStrategyBuilder#makePutTransferStrategy()} and + * {@link TransferStrategyBuilder#makeGetTransferStrategy()}. Once you have a TransferStrategy + * interface instance, calling {@link TransferStrategy#transfer()} on the TransferStrategy interface initiates + * data movement. + * + * If using a {@link TransferStrategy} directly, as opposed to going through a {@link Ds3ClientHelpers.Job}, the minimum + * needed as configuration items in a put transfer strategy builder are: + *
    + *
  • {@link TransferStrategyBuilder#withDs3Client(Ds3Client)}
  • + *
  • {@link TransferStrategyBuilder#withMasterObjectList(MasterObjectList)}
  • + *
  • {@link TransferStrategyBuilder#withChannelBuilder(Ds3ClientHelpers.ObjectChannelBuilder)}
  • + *
+ * + * When doing a get using a transfer strategy directly, you also need to specify: + *
    + *
  • {@link TransferStrategyBuilder#withRangesForBlobs(ImmutableMap)}
  • + *
+ */ +public final class TransferStrategyBuilder { + private static final Logger LOG = LoggerFactory.getLogger(TransferStrategyBuilder.class); + + private static final int DEFAULT_MAX_CONCURRENT_TRANSFER_THREADS = 10; + public static final int DEFAULT_CHUNK_ATTEMPT_RETRY_INTERVAL = -1; + public static final int DEFAULT_CHUNK_ATTEMPT_RETRY_ATTEMPTS = -1; + public static final int DEFAULT_OBJECT_TRANSFER_ATTEMPTS = 5; + + private BlobStrategy blobStrategy; + private ChannelStrategy channelStrategy; + private String bucketName; + private String jobId; + private TransferRetryDecorator transferRetryDecorator = new MaxNumObjectTransferAttemptsDecorator(DEFAULT_OBJECT_TRANSFER_ATTEMPTS); + private ChecksumFunction checksumFunction; + private ChecksumType.Type checksumType = ChecksumType.Type.NONE; + private EventRunner eventRunner = new SameThreadEventRunner(); + private EventDispatcher eventDispatcher = new EventDispatcherImpl(eventRunner); + private JobPartTracker jobPartTracker; + private JobState jobState; + private int numTransferRetries = DEFAULT_OBJECT_TRANSFER_ATTEMPTS; + private int numConcurrentTransferThreads = DEFAULT_MAX_CONCURRENT_TRANSFER_THREADS; + private int numChunkAttemptRetries = DEFAULT_CHUNK_ATTEMPT_RETRY_ATTEMPTS; + private int chunkRetryDelayInSeconds = DEFAULT_CHUNK_ATTEMPT_RETRY_INTERVAL; + private Ds3Client ds3Client; + private MasterObjectList masterObjectList; + private Ds3ClientHelpers.ObjectChannelBuilder channelBuilder; + private ImmutableMap> rangesForBlobs; + private MetadataAccess metadataAccess; + private ChunkAttemptRetryBehavior chunkAttemptRetryBehavior; + private ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior; + private TransferBehaviorType transferBehaviorType = TransferBehaviorType.OriginalSdkTransferBehavior; + private FailureEvent.FailureActivity failureActivity = FailureEvent.FailureActivity.PuttingObject; + + /** + * Use an instance of {@link BlobStrategy} you wish to create or retrieve blobs from a Black Pearl. There are + * 2 primary implementations: {@link PutBlobStrategy}; and {@link GetSequentialBlobStrategy}. Blob + * retrieval order is specified in the + * {@link com.spectralogic.ds3client.commands.spectrads3.GetBulkJobSpectraS3Request#withChunkClientProcessingOrderGuarantee(com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee)} + * HTTP request. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish, + * for example: + *
+     *     final PutBulkJobSpectraS3Request request = new PutBulkJobSpectraS3Request(BUCKET_NAME, Lists.newArrayList(objectsToWrite));
+     *     final PutBulkJobSpectraS3Response putBulkJobSpectraS3Response = client.putBulkJobSpectraS3(request);
+     *
+     *     final MasterObjectList masterObjectList = putBulkJobSpectraS3Response.getResult();
+     *
+     *     final EventDispatcher eventDispatcher = new EventDispatcherImpl(new SameThreadEventRunner());
+     *
+     *     final AtomicInteger numChunkAllocationAttempts = new AtomicInteger(0);
+     *
+     *     final BlobStrategy blobStrategy = new UserSuppliedPutBlobStrategy(client,
+     *                                                                       masterObjectList,
+     *                                                                       eventDispatcher,
+     *                                                                       new MaxChunkAttemptsRetryBehavior(5),
+     *                                                                       new ClientDefinedChunkAttemptRetryDelayBehavior(1, eventDispatcher,
+     *                                                                           new Monitorable() {
+     *                                                                               @Override
+     *                                                                                   public void monitor() {
+     *                                                                                       numChunkAllocationAttempts.incrementAndGet();
+     *                                                                                   }
+     *                                                                           });
+     *
+     *     final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder()
+     *         .withDs3Client(Ds3ClientBuilder.fromEnv().withHttps(false).build())
+     *         .withMasterObjectList(masterObjectList)
+     *         .withChannelBuilder(new FileObjectPutter(dirPath))
+     *         .withBlobStrategy(blobStrategy);
+     *
+     *     final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy();
+     *     transferStrategy.transfer();
+     * 
+ */ + public TransferStrategyBuilder withBlobStrategy(final BlobStrategy blobStrategy) { + this.blobStrategy = blobStrategy; + return this; + } + + /** + * Use an instance of {@link ChannelStrategy} you wish to manage the source or destination of a transfer. + * The 2 primary channel strategies are {@link RandomAccessChannelStrategy} and {@link SequentialChannelStrategy}. + * A channel strategy normally has a {@link Ds3ClientHelpers.ObjectChannelBuilder} that allocates the + * source or destination. Random access behavior creates a channel per blob; streamed access creates a single + * channel to reference all blobs associated with a DS3 object. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChannelStrategy(final ChannelStrategy channelStrategy) { + this.channelStrategy = channelStrategy; + return this; + } + + /** + * The {@link Ds3ClientHelpers.ObjectChannelBuilder} you wish to use to allocate source or destination + * channels. This is used in a {@link ChannelStrategy} to manage streamed or random access behavior. + * This is the same interface used in {@link Ds3ClientHelpers.Job#transfer(Ds3ClientHelpers.ObjectChannelBuilder)}. + * The 2 primary implementations of this interface are {@link com.spectralogic.ds3client.helpers.FileObjectGetter} + * and {@link com.spectralogic.ds3client.helpers.FileObjectPutter}. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChannelBuilder(final Ds3ClientHelpers.ObjectChannelBuilder channelBuilder) { + this.channelBuilder = channelBuilder; + return this; + } + + /** + * The {@link TransferRetryDecorator} to use when retrying a failed transfer attempt. If not specified directly, + * the builder will create a retry decorator based on the value specified in + * {@link TransferStrategyBuilder#withNumTransferRetries(int)}. The 2 primary transfer retry decorators + * are {@link MaxNumObjectTransferAttemptsDecorator} and {@link ContinueForeverTransferRetryDecorator} + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withTransferRetryDecorator(final TransferRetryDecorator transferRetryDecorator) { + this.transferRetryDecorator = transferRetryDecorator; + return this; + } + + /** + * The transfer function to use when putting an object to a Black Pearl when the value in + * {@link TransferStrategyBuilder#withChecksumType(ChecksumType.Type)} is not + * {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE}. This builder will make a checksum function of the correct type + * if you specify a checksum type other than {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE} but do not specify a + * checksum function. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChecksumFunction(final ChecksumFunction checksumFunction) { + this.checksumFunction = checksumFunction; + return this; + } + + /** + * The {@link com.spectralogic.ds3client.models.ChecksumType.Type#NONE} you would like to compute and include in the payload sent to a + * Black Pearl when putting an object. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChecksumType(final ChecksumType.Type checksumType) { + this.checksumType = checksumType; + return this; + } + + /** + * The {@link EventDispatcher} you would like to use when registering as an event observer and emitting + * events. The primary event dispatcher, {@link EventDispatcherImpl}, uses an {@link EventRunner} to deliver events. + * You specify the event runner behavior you want by calling {@link TransferStrategyBuilder#withEventRunner(EventRunner)}. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withEventDispatcher(final EventDispatcher eventDispatcher) { + this.eventDispatcher = eventDispatcher; + return this; + } + + /** + * {@link Ds3ClientHelpers.Job} uses the event dispatcher configured into this builder to emit events + * during a transfer. + */ + public EventDispatcher eventDispatcher() { + return eventDispatcher; + } + + /** + * When not directly specifying a {@link TransferRetryDecorator}, this property is used to make a transfer + * retry decorator instance. Doing so uses the behavior this SDK used prior to introducing transfer behavior + * configuration: a value less than 0 causes a failed transfer to be retried indefinitely; a value greater than 0 + * causes a failed transfer to be retried no more than the value specified before giving up. If you do not + * specify a value, this builder will use the same value as used in this SDK prior to introducing transfer behavior. + * @param numRetries + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withNumTransferRetries(final int numRetries) { + this.numTransferRetries = numRetries; + return this; + } + + /** + * The number of threads used to transfer blobs. Random access behavior uses the number of threads you + * specify in this property. Streamed behavior uses a single thread when transferring blobs. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withNumConcurrentTransferThreads(final int numConcurrentTransferThreads) { + this.numConcurrentTransferThreads = numConcurrentTransferThreads; + return this; + } + + /** + * When not directly using {@link TransferStrategyBuilder#withChunkAttemptRetryBehavior(ChunkAttemptRetryBehavior)}, + * this property is used to make a {@link ChunkAttemptRetryBehavior} instance. Doing so uses the behavior this SDK used prior to introducing transfer behavior + * configuration: a value less than 0 causes a failed chunk operation to be retried indefinitely; a value greater than 0 + * causes a failed chunk operation to be retried no more than the value specified before giving up. If you do not + * specify a value, this builder will use the same value as used in this SDK prior to introducing transfer behavior. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withNumChunkAttemptRetries(final int numChunkAttemptRetries) { + this.numChunkAttemptRetries = numChunkAttemptRetries; + return this; + } + + /** + * When not directly using {@link TransferStrategyBuilder#withChunkAttemptRetryDelayBehavior(ChunkAttemptRetryDelayBehavior)}, + * this property is used to create a {@link ChunkAttemptRetryDelayBehavior} instance. Doing so uses the behavior this SDK used prior to introducing transfer behavior + * configuration: a value less than 0 causes a failed chunk operation to use the retry delay value a Black Pearl returns + * as part of the chunk operation failure response; a value greater than 0 + * causes a failed chunk operation to the value specified in the {@code retryDelayInSeconds} parameter. If you do not + * specify a value, this builder will use the same value as used in this SDK prior to introducing transfer behavior. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChunkRetryDelayInSeconds(final int retryDelayInSeconds) { + this.chunkRetryDelayInSeconds = retryDelayInSeconds; + return this; + } + + /** + * The {@link Ds3Client} instance representing the Black Pearl you want to work with. The primary way to + * get a client instance is to call {@link Ds3ClientBuilder#fromEnv()}. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withDs3Client(final Ds3Client ds3Client) { + this.ds3Client = ds3Client; + return this; + } + + /** + * The {@link MasterObjectList} returned primarily retrieved from a call to {@link Ds3Client#putBulkJobSpectraS3(PutBulkJobSpectraS3Request)} + * or {@link Ds3Client#getBulkJobSpectraS3(GetBulkJobSpectraS3Request)}. The master object list is used in + * creating the ability to work with a blob strategy. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withMasterObjectList(final MasterObjectList masterObjectList) { + this.masterObjectList = masterObjectList; + jobId = masterObjectList.getJobId().toString(); + bucketName = masterObjectList.getBucketName(); + return this; + } + + public MasterObjectList masterObjectList() { + return masterObjectList; + } + + /** + * When getting portions of objects from a Black Pearl, object ranges are the mechanism used to tell the Black Pearl + * which portions of obejcts to get. + * @param rangesForBlobs When retrieving whole objects, you supply an empty range, e.g.: + *
+     *                       {@code
+     *                       final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder()
+     *                           .withDs3Client(client)
+     *                           .withMasterObjectList(masterObjectList)
+     *                           .withChannelBuilder(new FileObjectGetter(tempDirectory))
+     *                           .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(),
+     *                               PartialObjectHelpers.getPartialObjectsRanges(objects)));
+     *                       }
+     *                       
+ * + * When retrieving partial objects, you can build a list by doing something like: + *
+     *                       {@code
+     *                       final List filesToGet = new ArrayList<>();
+     *                       final int offsetIntoFirstRange = 10;
+     *                       filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(200000, 100000)));
+     *                       filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(100000, 100000)));
+     *                       filesToGet.add(new PartialDs3Object(FILE_NAME, Range.byLength(offsetIntoFirstRange, 100000)));
+     *
+     *                       final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder()
+     *                           .withDs3Client(client)
+     *                           .withMasterObjectList(masterObjectList)
+     *                           .withChannelBuilder(new FileObjectGetter(tempDirectory))
+     *                           .withRangesForBlobs(PartialObjectHelpers.mapRangesToBlob(masterObjectList.getObjects(),
+     *                               PartialObjectHelpers.getPartialObjectsRanges(filesToGet)));
+     *                       }
+     *                       
+ * + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withRangesForBlobs(final ImmutableMap> rangesForBlobs) { + this.rangesForBlobs = rangesForBlobs; + return this; + } + + /** + * Supply an instance of {@link MetadataAccess} to record metadata as part pf a put transfer. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withMetadataAccess(final MetadataAccess metadataAccess) { + this.metadataAccess = metadataAccess; + return this; + } + + /** + * Supply an instance of {@link ChunkAttemptRetryBehavior} when you need to have specialized control over retrying + * a failed chunk operation. The 2 primary implementations for this are {@link MaxChunkAttemptsRetryBehavior} + * and {@link ContinueForeverChunkAttemptsRetryBehavior}. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChunkAttemptRetryBehavior(final ChunkAttemptRetryBehavior chunkAttemptRetryBehavior) { + this.chunkAttemptRetryBehavior = chunkAttemptRetryBehavior; + return this; + } + + /** + * Supply an instance of {@link ChunkAttemptRetryDelayBehavior} when you need to have specialized control over the length + * of time to delay between retrying a filed chunk operation. The 2 primary implementations are {@link ClientDefinedChunkAttemptRetryDelayBehavior}, + * which will always use the delay interval a client specifies, and {@link BlackPearlChunkAttemptRetryDelayBehavior}, + * which will use the retry delay a Black Pearl returns in its payload when a chunk operation cannot be completed. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withChunkAttemptRetryDelayBehavior(final ChunkAttemptRetryDelayBehavior chunkAttemptRetryDelayBehavior) { + this.chunkAttemptRetryDelayBehavior = chunkAttemptRetryDelayBehavior; + return this; + } + + /** + * Specify an {@link EventRunner} to use when dispatching events. The primary reason for specifying this is to determine + * which threading model is used to deliver events. If it is important that events are delivered on the same thread, + * meaning that the deleivery order is deterministic, use {@link SameThreadEventRunner}, which is the event runner instance this SDK uses. + * You may specify the {@link com.spectralogic.ds3client.helpers.events.ConcurrentEventRunner} if you want events + * delivered on separate threads. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder withEventRunner(final EventRunner eventRunner) { + this.eventRunner = eventRunner; + return this; + } + + /** + * Setting this property causes this SDK to read and write channels from beginning to end sequentially and causes + * blob retrieval to be in order. Transfers happen on a single-threaded executor. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder usingStreamedTransferBehavior() { + transferBehaviorType = TransferBehaviorType.StreamingTransferBehavior; + return this; + } + + /** + * Setting this property causes this SDK to read and write channels in no particular order and + * specifies no order in retrieving blobs. Transfers happen in a multi-threaded executor. + * @return The instance of this builder, with the intent that you can string together the behaviors you wish. + */ + public TransferStrategyBuilder usingRandomAccessTransferBehavior() { + transferBehaviorType = TransferBehaviorType.RandomAccessTransferBehavior; + return this; + } + + /** + * Get an instance of {@link TransferStrategy} configured with this builders current settings. Once you + * have an instance, you initiate a put by calling {@link TransferStrategy#transfer()}. + * @return Once you have an instance, you initiate a get by calling {@link TransferStrategy#transfer()}. + */ + public TransferStrategy makePutTransferStrategy() { + failureActivity = FailureEvent.FailureActivity.PuttingObject; + + switch (transferBehaviorType) { + case StreamingTransferBehavior: + return makeStreamingPutTransferStrategy(); + + case RandomAccessTransferBehavior: + return makeRandomAccessPutTransferStrategy(); + + case OriginalSdkTransferBehavior: + default: + return makeOriginalSdkSemanticsPutTransferStrategy(); + } + } + + private TransferStrategy makeStreamingPutTransferStrategy() { + maybeMakeStreamedPutChannelStrategy(); + getOrMakeTransferRetryDecorator(); + + return makeTransferStrategy( + (client, masterObjectList, eventDispatcher) -> new PutBlobStrategy(ds3Client, + masterObjectList, + eventDispatcher, + getOrMakeChunkAttemptRetryBehavior(), + getOrMakeChunkAllocationRetryDelayBehavior(), + getOrMakeJobStateForPutJob(), + true + ), + this::makePutTransferMethod); + } + + private void maybeMakeStreamedPutChannelStrategy() { + if (channelStrategy == null) { + Preconditions.checkNotNull(channelBuilder, "channelBuilder my not be null"); + + channelStrategy = new SequentialChannelStrategy(new SequentialFileReaderChannelStrategy(channelBuilder), + channelBuilder, new NullChannelPreparable(), masterObjectList); + } + } + + private TransferRetryDecorator getOrMakeTransferRetryDecorator() { + if (transferRetryDecorator != null) { + return transferRetryDecorator; + } + + if (numTransferRetries > 0) { + transferRetryDecorator = new MaxNumObjectTransferAttemptsDecorator(numTransferRetries); + } else { + transferRetryDecorator = new ContinueForeverTransferRetryDecorator(); + } + + return transferRetryDecorator; + } + + private TransferStrategy makeTransferStrategy(final BlobStrategyMaker blobStrategyMaker, + final TransferMethodMaker transferMethodMaker) + { + Preconditions.checkNotNull(ds3Client, "ds3Client may not be null."); + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null."); + Preconditions.checkNotNull(masterObjectList, "masterObjectList may not be null."); + Preconditions.checkNotNull(blobStrategyMaker, "blobStrategyMaker may not be null."); + Preconditions.checkNotNull(transferMethodMaker, "transferMethodMaker may not be null."); + Preconditions.checkNotNull(channelStrategy, "channelStrategy may not be null"); + Preconditions.checkNotNull(transferRetryDecorator, "transferRetryDecorator may not be null"); + Guard.throwOnNullOrEmptyString(bucketName, "bucketName may not be null or empty."); + Guard.throwOnNullOrEmptyString(jobId, "jobId may not be null or empty."); + + maybeMakeBlobStrategy(blobStrategyMaker); + + eventDispatcher.attachBlobTransferredEventObserver(new BlobTransferredEventObserver(new UpdateStrategy() { + @Override + public void update(final BulkObject eventData) { + jobPartTracker.completePart(eventData.getName(), new ObjectPart(eventData.getOffset(), eventData.getLength())); + } + })); + + return makeTransferStrategy(transferMethodMaker.makeTransferMethod()); + } + + private void maybeMakeBlobStrategy(final BlobStrategyMaker blobStrategyMaker) { + if (blobStrategy == null) { + blobStrategy = blobStrategyMaker.makeBlobStrategy(ds3Client, masterObjectList, eventDispatcher); + } + } + + private TransferStrategy makeTransferStrategy(final TransferMethod transferMethod) { + switch (transferBehaviorType) { + case StreamingTransferBehavior: + return new SingleThreadedTransferStrategy(blobStrategy, + jobState, + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity) + .withTransferMethod(transferMethod); + + case RandomAccessTransferBehavior: + return new MultiThreadedTransferStrategy(blobStrategy, + jobState, + numConcurrentTransferThreads, + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity) + .withTransferMethod(transferMethod); + + case OriginalSdkTransferBehavior: + default: + return makeOriginalSdkSemanticsTransferStrategy(transferMethod); + } + } + + private ChunkAttemptRetryBehavior getOrMakeChunkAttemptRetryBehavior() { + if (chunkAttemptRetryBehavior != null) { + return chunkAttemptRetryBehavior; + } + + if (numChunkAttemptRetries > 0) { + chunkAttemptRetryBehavior = new MaxChunkAttemptsRetryBehavior(numChunkAttemptRetries); + } else { + chunkAttemptRetryBehavior = new ContinueForeverChunkAttemptsRetryBehavior(); + } + + return chunkAttemptRetryBehavior; + } + + private ChunkAttemptRetryDelayBehavior getOrMakeChunkAllocationRetryDelayBehavior() { + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null."); + + if (chunkAttemptRetryDelayBehavior != null) { + return chunkAttemptRetryDelayBehavior; + } + + if (chunkRetryDelayInSeconds > 0) { + chunkAttemptRetryDelayBehavior = new ClientDefinedChunkAttemptRetryDelayBehavior(chunkRetryDelayInSeconds, eventDispatcher); + } else { + chunkAttemptRetryDelayBehavior = new BlackPearlChunkAttemptRetryDelayBehavior(eventDispatcher); + } + + return chunkAttemptRetryDelayBehavior; + } + + private TransferStrategy makeOriginalSdkSemanticsPutTransferStrategy() { + maybeMakeRandomAccessPutChannelStrategy(); + getOrMakeTransferRetryDecorator(); + + return makeTransferStrategy( + new BlobStrategyMaker() { + @Override + public BlobStrategy makeBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher) + { + return new PutBlobStrategy(ds3Client, + masterObjectList, + eventDispatcher, + getOrMakeChunkAttemptRetryBehavior(), + getOrMakeChunkAllocationRetryDelayBehavior(), + getOrMakeJobStateForPutJob(), + false); + } + }, + new TransferMethodMaker() { + @Override + public TransferMethod makeTransferMethod() { + return makePutTransferMethod(); + } + }); + } + + private void maybeMakeRandomAccessPutChannelStrategy() { + if (channelStrategy == null) { + Preconditions.checkNotNull(channelBuilder, "channelBuilder my not be null"); + channelStrategy = new RandomAccessChannelStrategy(channelBuilder, rangesForBlobs, new NullChannelPreparable()); + } + } + + private TransferMethod makePutTransferMethod() { + getOrMakeJobStateForPutJob(); + + if (checksumType != ChecksumType.Type.NONE) { + maybeAddChecksumFunction(); + } + + final TransferMethod transferMethod = new PutJobTransferMethod(channelStrategy, + bucketName, jobId, eventDispatcher, checksumFunction, checksumType, metadataAccess); + + if (transferRetryDecorator != null) { + return transferRetryDecorator.wrap(transferMethod); + } + + return transferMethod; + } + + private JobState getOrMakeJobStateForPutJob() { + if (jobState != null) { + return jobState; + } + + Preconditions.checkNotNull(masterObjectList, "masterObjectList may not be null."); + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null."); + Preconditions.checkNotNull(eventRunner, "eventRunner may not be null."); + + List chunks = masterObjectList.getObjects(); + + if (chunks == null) { + chunks = new ArrayList<>(); + } + + final List chunksNotYetCompleted = StrategyUtils.filterChunks(chunks); + + getOrMakeJobPartTrackerForPutJob(chunksNotYetCompleted); + + jobState = new JobState(chunksNotYetCompleted); + + return jobState; + } + + private void maybeAddChecksumFunction() { + if (checksumFunction == null) { + makeDefaultChecksumFunction(); + } + } + + private TransferStrategy makeOriginalSdkSemanticsTransferStrategy(final TransferMethod transferMethod) { + if (numConcurrentTransferThreads > 1) { + return new MultiThreadedTransferStrategy(blobStrategy, + jobState, + numConcurrentTransferThreads, + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity) + .withTransferMethod(transferMethod); + } else { + return new SingleThreadedTransferStrategy(blobStrategy, + jobState, + eventDispatcher, + masterObjectList, + ds3Client, + failureActivity) + .withTransferMethod(transferMethod); + } + } + + private JobPartTracker getOrMakeJobPartTrackerForPutJob(final List chunksNotYetCompleted) { + if (jobPartTracker != null) { + return jobPartTracker; + } + + final JobPartTracker result = JobPartTrackerFactory.buildPartTracker(Iterables.concat(getBlobs(chunksNotYetCompleted)), eventRunner); + + result.attachObjectCompletedListener(new ObjectCompletedListener() { + @Override + public void objectCompleted(final String name) { + eventDispatcher.emitObjectCompletedEvent(name); + } + }); + + jobPartTracker = result; + + return jobPartTracker; + } + + private static ImmutableList getBlobs(final List chunks) { + final ImmutableList.Builder builder = ImmutableList.builder(); + for (final Objects objects : chunks) { + builder.addAll(objects.getObjects()); + } + return builder.build(); + } + + private void makeDefaultChecksumFunction() { + + checksumFunction = new ChecksumFunction() { + @Override + public String compute(final BulkObject obj, final ByteChannel channel) { + String checksum = null; + + try + { + final InputStream dataStream = new SeekableByteChannelInputStream(channelStrategy.acquireChannelForBlob(obj)); + + dataStream.mark(Integer.MAX_VALUE); + + final Hasher hasher = ChecksumUtils.getHasher(checksumType); + + checksum = ChecksumUtils.hashInputStream(hasher, dataStream); + + LOG.info("Computed checksum for blob: {}", checksum); + + dataStream.reset(); + } catch (final IOException e) { + eventDispatcher.emitFailureEvent(FailureEvent.builder() + .withObjectNamed(obj.getName()) + .withCausalException(e) + .usingSystemWithEndpoint(ds3Client.getConnectionDetails().getEndpoint()) + .doingWhat(FailureEvent.FailureActivity.ComputingChecksum) + .build()); + LOG.error("Error computing checksum.", e); + } + + return checksum; + } + }; + } + + private TransferStrategy makeRandomAccessPutTransferStrategy() { + maybeMakeRandomAccessPutChannelStrategy(); + getOrMakeTransferRetryDecorator(); + + return makeTransferStrategy( + new BlobStrategyMaker() { + @Override + public BlobStrategy makeBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher) + { + return new PutBlobStrategy(ds3Client, + masterObjectList, + eventDispatcher, + getOrMakeChunkAttemptRetryBehavior(), + getOrMakeChunkAllocationRetryDelayBehavior(), + getOrMakeJobStateForPutJob(), + false + ); + } + }, + new TransferMethodMaker() { + @Override + public TransferMethod makeTransferMethod() { + return makePutTransferMethod(); + } + }); + } + + /** + * Get an instance of {@link TransferStrategy} configured with this builders current settings. + * @return Once you have an instance, you initiate a get by calling {@link TransferStrategy#transfer()}. + */ + public TransferStrategy makeGetTransferStrategy() { + failureActivity = FailureEvent.FailureActivity.GettingObject; + + switch (transferBehaviorType) { + case StreamingTransferBehavior: + return makeStreamingGetTransferStrategy(); + + case RandomAccessTransferBehavior: + case OriginalSdkTransferBehavior: + default: + return makeOriginalSdkSemanticsGetTransferStrategy(); + } + } + + private TransferStrategy makeStreamingGetTransferStrategy() { + maybeMakeSequentialGetChannelStrategy(); + getOrMakeTransferRetryDecorator(); + + return makeTransferStrategy( + (client, masterObjectList, eventDispatcher) -> new GetSequentialBlobStrategy(ds3Client, + masterObjectList, + eventDispatcher, + getOrMakeChunkAttemptRetryBehavior(), + getOrMakeChunkAllocationRetryDelayBehavior()), + this::makeGetTransferMethod); + } + + private void maybeMakeSequentialGetChannelStrategy() { + if (channelStrategy == null) { + Preconditions.checkNotNull(channelBuilder, "channelBuilder my not be null"); + + channelStrategy = new SequentialChannelStrategy(new SequentialFileWriterChannelStrategy(channelBuilder), + channelBuilder, new TruncatingChannelPreparable(), masterObjectList); + } + } + + private TransferMethod makeGetTransferMethod() { + getOrMakeJobStateForGetJob(); + + final TransferMethod transferMethod = new GetJobNetworkFailureRetryDecorator(channelStrategy, + bucketName, jobId, eventDispatcher, rangesForBlobs); + + if (transferRetryDecorator != null) { + return transferRetryDecorator.wrap(transferMethod); + } + + return transferMethod; + } + + private JobState getOrMakeJobStateForGetJob() { + if (jobState != null) { + return jobState; + } + + Preconditions.checkNotNull(masterObjectList, "masterObjectList may not be null."); + Preconditions.checkNotNull(eventDispatcher, "eventDispatcher may not be null."); + Preconditions.checkNotNull(eventRunner, "eventRunner may not be null."); + + final List chunks = masterObjectList.getObjects(); + + getOrMakeJobPartTrackerForGetJob(chunks); + + jobState = new JobState(chunks); + + return jobState; + } + + private JobPartTracker getOrMakeJobPartTrackerForGetJob(final List chunks) { + if (jobPartTracker != null) { + return jobPartTracker; + } + + final JobPartTracker result = JobPartTrackerFactory.buildPartTracker(getBlobs(chunks), eventRunner); + + result.attachObjectCompletedListener(new ObjectCompletedListener() { + @Override + public void objectCompleted(final String name) { + eventDispatcher.emitObjectCompletedEvent(name); + } + }); + + jobPartTracker = result; + + return jobPartTracker; + } + + private TransferStrategy makeOriginalSdkSemanticsGetTransferStrategy() { + maybeMakeRandomAccessGetChannelStrategy(); + getOrMakeTransferRetryDecorator(); + + return makeTransferStrategy( + new BlobStrategyMaker() { + @Override + public BlobStrategy makeBlobStrategy(final Ds3Client client, + final MasterObjectList masterObjectList, + final EventDispatcher eventDispatcher) { + return new GetSequentialBlobStrategy(ds3Client, + masterObjectList, + eventDispatcher, + getOrMakeChunkAttemptRetryBehavior(), + getOrMakeChunkAllocationRetryDelayBehavior()); + } + }, + new TransferMethodMaker() { + @Override + public TransferMethod makeTransferMethod() { + return makeGetTransferMethod(); + } + }); + } + + private void maybeMakeRandomAccessGetChannelStrategy() { + if (channelStrategy == null) { + Preconditions.checkNotNull(channelBuilder, "channelBuilder my not be null"); + + channelStrategy = new RandomAccessChannelStrategy(channelBuilder, rangesForBlobs, new TruncatingChannelPreparable()); + } + } + + private enum TransferBehaviorType { + OriginalSdkTransferBehavior, + StreamingTransferBehavior, + RandomAccessTransferBehavior + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/UpdateStrategy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/UpdateStrategy.java new file mode 100644 index 000000000..31f754ce0 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/UpdateStrategy.java @@ -0,0 +1,23 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +/** + * This is a marker interface intended to allow for building different ways of emitting events. + * @param The context supplied to an observer registered to receive events. + */ +public interface UpdateStrategy extends Observer { +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java new file mode 100644 index 000000000..455bdd9cd --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/WaitingForChunksObserver.java @@ -0,0 +1,49 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.base.Preconditions; +import com.spectralogic.ds3client.helpers.WaitingForChunksListener; + +/** + * This class emits an event when chunks we are creating or retrieving from a Black Pearl + * are not yet available. The event reports the number of seconds we will wait before + * trying again. + */ +public class WaitingForChunksObserver extends AbstractObserver { + public WaitingForChunksObserver(final WaitingForChunksListener waitingForChunksListener) { + super(new IntegerUpdateStrategy(waitingForChunksListener)); + + Preconditions.checkNotNull(waitingForChunksListener, "waitingForChunksListener may not be null."); + } + + public WaitingForChunksObserver(final UpdateStrategy updateStrategy) { + super(updateStrategy); + } + + private static class IntegerUpdateStrategy implements UpdateStrategy { + private final WaitingForChunksListener waitingForChunksListener; + + public IntegerUpdateStrategy(final WaitingForChunksListener waitingForChunksListener) { + this.waitingForChunksListener = waitingForChunksListener; + } + + @Override + public void update(final Integer eventData) { + waitingForChunksListener.waiting(eventData); + } + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers.java index d81883b4c..b3b9b5082 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -32,7 +32,7 @@ private PartialObjectHelpers() { //pass } - public static ImmutableMultimap getPartialObjectsRanges(final List objects) { + public static ImmutableMultimap getPartialObjectsRanges(final Iterable objects) { final ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); for (final Ds3Object obj : objects) { @@ -78,10 +78,9 @@ static ImmutableList dedupRanges(final ImmutableList rangesForBlob Range currentRange = null; Range nextRange; - final UnmodifiableIterator rangeIterator = sortedRanges.iterator(); - while (rangeIterator.hasNext()) { - nextRange = rangeIterator.next(); + for (final Range sortedRange : sortedRanges) { + nextRange = sortedRange; if (currentRange == null) { // This will only be called on the first iteration of the loop currentRange = nextRange; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AbmConfigApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AbmConfigApiBean.java new file mode 100644 index 000000000..5d9e46f67 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AbmConfigApiBean.java @@ -0,0 +1,112 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class AbmConfigApiBean { + + // Variables + @JsonProperty("DataPolicies") + @JacksonXmlElementWrapper(useWrapping = true) + private List dataPolicies = new ArrayList<>(); + + @JsonProperty("Message") + private String message; + + @JsonProperty("PoolPartitions") + @JacksonXmlElementWrapper(useWrapping = true) + private List poolPartitions = new ArrayList<>(); + + @JsonProperty("StorageDomains") + @JacksonXmlElementWrapper(useWrapping = true) + private List storageDomains = new ArrayList<>(); + + @JsonProperty("TapePartitions") + @JacksonXmlElementWrapper(useWrapping = true) + private List tapePartitions = new ArrayList<>(); + + @JsonProperty("Targets") + @JacksonXmlElementWrapper(useWrapping = true) + private List targets = new ArrayList<>(); + + // Constructor + public AbmConfigApiBean() { + //pass + } + + // Getters and Setters + + public List getDataPolicies() { + return this.dataPolicies; + } + + public void setDataPolicies(final List dataPolicies) { + this.dataPolicies = dataPolicies; + } + + + public String getMessage() { + return this.message; + } + + public void setMessage(final String message) { + this.message = message; + } + + + public List getPoolPartitions() { + return this.poolPartitions; + } + + public void setPoolPartitions(final List poolPartitions) { + this.poolPartitions = poolPartitions; + } + + + public List getStorageDomains() { + return this.storageDomains; + } + + public void setStorageDomains(final List storageDomains) { + this.storageDomains = storageDomains; + } + + + public List getTapePartitions() { + return this.tapePartitions; + } + + public void setTapePartitions(final List tapePartitions) { + this.tapePartitions = tapePartitions; + } + + + public List getTargets() { + return this.targets; + } + + public void setTargets(final List targets) { + this.targets = targets; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJob.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJob.java index 0040298c8..d731fd5fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJob.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJob.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class ActiveJob { @@ -44,6 +43,9 @@ public class ActiveJob { @JsonProperty("CreatedAt") private Date createdAt; + @JsonProperty("DeadJobCleanupAllowed") + private boolean deadJobCleanupAllowed; + @JsonProperty("ErrorMessage") private String errorMessage; @@ -53,6 +55,9 @@ public class ActiveJob { @JsonProperty("ImplicitJobIdResolution") private boolean implicitJobIdResolution; + @JsonProperty("Restore") + private IomType iomType; + @JsonProperty("MinimizeSpanningAcrossMedia") private boolean minimizeSpanningAcrossMedia; @@ -68,6 +73,9 @@ public class ActiveJob { @JsonProperty("Priority") private Priority priority; + @JsonProperty("Protected") + private boolean protectedFlag; + @JsonProperty("Rechunked") private Date rechunked; @@ -150,6 +158,15 @@ public void setCreatedAt(final Date createdAt) { } + public boolean getDeadJobCleanupAllowed() { + return this.deadJobCleanupAllowed; + } + + public void setDeadJobCleanupAllowed(final boolean deadJobCleanupAllowed) { + this.deadJobCleanupAllowed = deadJobCleanupAllowed; + } + + public String getErrorMessage() { return this.errorMessage; } @@ -177,6 +194,15 @@ public void setImplicitJobIdResolution(final boolean implicitJobIdResolution) { } + public IomType getIomType() { + return this.iomType; + } + + public void setIomType(final IomType iomType) { + this.iomType = iomType; + } + + public boolean getMinimizeSpanningAcrossMedia() { return this.minimizeSpanningAcrossMedia; } @@ -222,6 +248,15 @@ public void setPriority(final Priority priority) { } + public boolean getProtected() { + return this.protectedFlag; + } + + public void setProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + } + + public Date getRechunked() { return this.rechunked; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJobList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJobList.java index 732d6de78..7bc8a6757 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJobList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ActiveJobList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AutoInspectMode.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AutoInspectMode.java index cf77551fd..d9151249a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AutoInspectMode.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AutoInspectMode.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRule.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRule.java index 4639845af..622e10327 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRule.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRule.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRuleList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRuleList.java index 8c44877b6..c7f148721 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRuleList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureDataReplicationRuleList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTarget.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTarget.java index f9069a666..7c4783d24 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTarget.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTarget.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -import java.lang.Integer; import java.util.UUID; import java.util.Date; @@ -57,6 +55,9 @@ public class AzureTarget { @JsonProperty("Name") private String name; + @JsonProperty("NamingMode") + private CloudNamingMode namingMode; + @JsonProperty("PermitGoingOutOfSync") private boolean permitGoingOutOfSync; @@ -163,6 +164,15 @@ public void setName(final String name) { } + public CloudNamingMode getNamingMode() { + return this.namingMode; + } + + public void setNamingMode(final CloudNamingMode namingMode) { + this.namingMode = namingMode; + } + + public boolean getPermitGoingOutOfSync() { return this.permitGoingOutOfSync; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketName.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketName.java index 8ab1de76f..9adf90c55 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketName.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketName.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class AzureTargetBucketName { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketNameList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketNameList.java index c2635c9e9..e251b5ead 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketNameList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetBucketNameList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailure.java index 7bd738b55..80d11d3f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureList.java index bb270428d..5f90f43a5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistration.java index 6b1b93558..5dfacdb20 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class AzureTargetFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistrationList.java index 991c9be88..97a65f8a5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetList.java index 2ac82b9a4..f98bf3abd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreference.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreference.java index e72b05ba5..1c7e42a46 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreference.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreference.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreferenceList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreferenceList.java index bca7220dd..5bba65175 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreferenceList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/AzureTargetReadPreferenceList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Blob.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Blob.java index 722dd01ed..6bf7e97be 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Blob.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Blob.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskInformation.java index 0b261ff0c..f6b90771e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,8 +19,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; @JacksonXmlRootElement(namespace = "Data") public class BlobStoreTaskInformation { @@ -38,9 +40,19 @@ public class BlobStoreTaskInformation { @JsonProperty("DriveId") private UUID driveId; + @JsonProperty("DurationInProgress") + private Duration durationInProgress; + + @JsonProperty("DurationScheduled") + private Duration durationScheduled; + @JsonProperty("Id") private long id; + @JsonProperty("JobIds") + @JacksonXmlElementWrapper(useWrapping = true) + private List jobIds = new ArrayList<>(); + @JsonProperty("Name") private String name; @@ -105,6 +117,24 @@ public void setDriveId(final UUID driveId) { } + public Duration getDurationInProgress() { + return this.durationInProgress; + } + + public void setDurationInProgress(final Duration durationInProgress) { + this.durationInProgress = durationInProgress; + } + + + public Duration getDurationScheduled() { + return this.durationScheduled; + } + + public void setDurationScheduled(final Duration durationScheduled) { + this.durationScheduled = durationScheduled; + } + + public long getId() { return this.id; } @@ -114,6 +144,15 @@ public void setId(final long id) { } + public List getJobIds() { + return this.jobIds; + } + + public void setJobIds(final List jobIds) { + this.jobIds = jobIds; + } + + public String getName() { return this.name; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskState.java index baca9f2a5..4d9bff87a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTaskState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTasksInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTasksInformation.java index 178e0d19b..8fa7c1e53 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTasksInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BlobStoreTasksInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Bucket.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Bucket.java index 24b00336c..8f9667bd6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Bucket.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Bucket.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,8 +21,6 @@ import java.util.Date; import java.util.UUID; import java.lang.Boolean; -import java.lang.Long; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class Bucket { @@ -49,6 +47,9 @@ public class Bucket { @JsonProperty("Name") private String name; + @JsonProperty("Protected") + private boolean protectedFlag; + @JsonProperty("UserId") private UUID userId; @@ -122,6 +123,15 @@ public void setName(final String name) { } + public boolean getProtected() { + return this.protectedFlag; + } + + public void setProtected(final boolean protectedFlag) { + this.protectedFlag = protectedFlag; + } + + public UUID getUserId() { return this.userId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAcl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAcl.java index 5f4af6b32..387265182 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAcl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAcl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclList.java index e9793fe9a..7d007540b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclPermission.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclPermission.java index 185175856..a89ed65e5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclPermission.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketAclPermission.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistration.java new file mode 100644 index 000000000..a9a1e1e07 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistration.java @@ -0,0 +1,190 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import java.util.Date; + +@JacksonXmlRootElement(namespace = "Data") +public class BucketChangesNotificationRegistration { + + // Variables + @JsonProperty("BucketId") + private UUID bucketId; + + @JsonProperty("CreationDate") + private Date creationDate; + + @JsonProperty("Format") + private HttpResponseFormatType format; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("LastFailure") + private String lastFailure; + + @JsonProperty("LastHttpResponseCode") + private Integer lastHttpResponseCode; + + @JsonProperty("LastNotification") + private Date lastNotification; + + @JsonProperty("LastSequenceNumber") + private Long lastSequenceNumber; + + @JsonProperty("NamingConvention") + private NamingConventionType namingConvention; + + @JsonProperty("NotificationEndPoint") + private String notificationEndPoint; + + @JsonProperty("NotificationHttpMethod") + private RequestType notificationHttpMethod; + + @JsonProperty("NumberOfFailuresSinceLastSuccess") + private int numberOfFailuresSinceLastSuccess; + + @JsonProperty("UserId") + private UUID userId; + + // Constructor + public BucketChangesNotificationRegistration() { + //pass + } + + // Getters and Setters + + public UUID getBucketId() { + return this.bucketId; + } + + public void setBucketId(final UUID bucketId) { + this.bucketId = bucketId; + } + + + public Date getCreationDate() { + return this.creationDate; + } + + public void setCreationDate(final Date creationDate) { + this.creationDate = creationDate; + } + + + public HttpResponseFormatType getFormat() { + return this.format; + } + + public void setFormat(final HttpResponseFormatType format) { + this.format = format; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public String getLastFailure() { + return this.lastFailure; + } + + public void setLastFailure(final String lastFailure) { + this.lastFailure = lastFailure; + } + + + public Integer getLastHttpResponseCode() { + return this.lastHttpResponseCode; + } + + public void setLastHttpResponseCode(final Integer lastHttpResponseCode) { + this.lastHttpResponseCode = lastHttpResponseCode; + } + + + public Date getLastNotification() { + return this.lastNotification; + } + + public void setLastNotification(final Date lastNotification) { + this.lastNotification = lastNotification; + } + + + public Long getLastSequenceNumber() { + return this.lastSequenceNumber; + } + + public void setLastSequenceNumber(final Long lastSequenceNumber) { + this.lastSequenceNumber = lastSequenceNumber; + } + + + public NamingConventionType getNamingConvention() { + return this.namingConvention; + } + + public void setNamingConvention(final NamingConventionType namingConvention) { + this.namingConvention = namingConvention; + } + + + public String getNotificationEndPoint() { + return this.notificationEndPoint; + } + + public void setNotificationEndPoint(final String notificationEndPoint) { + this.notificationEndPoint = notificationEndPoint; + } + + + public RequestType getNotificationHttpMethod() { + return this.notificationHttpMethod; + } + + public void setNotificationHttpMethod(final RequestType notificationHttpMethod) { + this.notificationHttpMethod = notificationHttpMethod; + } + + + public int getNumberOfFailuresSinceLastSuccess() { + return this.numberOfFailuresSinceLastSuccess; + } + + public void setNumberOfFailuresSinceLastSuccess(final int numberOfFailuresSinceLastSuccess) { + this.numberOfFailuresSinceLastSuccess = numberOfFailuresSinceLastSuccess; + } + + + public UUID getUserId() { + return this.userId; + } + + public void setUserId(final UUID userId) { + this.userId = userId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistrationList.java new file mode 100644 index 000000000..681d7fcb3 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketChangesNotificationRegistrationList.java @@ -0,0 +1,48 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class BucketChangesNotificationRegistrationList { + + // Variables + @JsonProperty("BucketChangesNotificationRegistration") + @JacksonXmlElementWrapper(useWrapping = false) + private List bucketChangesNotificationRegistrations = new ArrayList<>(); + + // Constructor + public BucketChangesNotificationRegistrationList() { + //pass + } + + // Getters and Setters + + public List getBucketChangesNotificationRegistrations() { + return this.bucketChangesNotificationRegistrations; + } + + public void setBucketChangesNotificationRegistrations(final List bucketChangesNotificationRegistrations) { + this.bucketChangesNotificationRegistrations = bucketChangesNotificationRegistrations; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketDetails.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketDetails.java index 00d731b6c..e6deab1b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketDetails.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketDetails.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class BucketDetails { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEvent.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEvent.java new file mode 100644 index 000000000..788a1e04f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEvent.java @@ -0,0 +1,118 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import java.util.Date; + +@JacksonXmlRootElement(namespace = "Data") +public class BucketHistoryEvent { + + // Variables + @JsonProperty("BucketId") + private UUID bucketId; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("ObjectCreationDate") + private Date objectCreationDate; + + @JsonProperty("ObjectName") + private String objectName; + + @JsonProperty("SequenceNumber") + private Long sequenceNumber; + + @JsonProperty("Type") + private BucketHistoryEventType type; + + @JsonProperty("VersionId") + private UUID versionId; + + // Constructor + public BucketHistoryEvent() { + //pass + } + + // Getters and Setters + + public UUID getBucketId() { + return this.bucketId; + } + + public void setBucketId(final UUID bucketId) { + this.bucketId = bucketId; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public Date getObjectCreationDate() { + return this.objectCreationDate; + } + + public void setObjectCreationDate(final Date objectCreationDate) { + this.objectCreationDate = objectCreationDate; + } + + + public String getObjectName() { + return this.objectName; + } + + public void setObjectName(final String objectName) { + this.objectName = objectName; + } + + + public Long getSequenceNumber() { + return this.sequenceNumber; + } + + public void setSequenceNumber(final Long sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public BucketHistoryEventType getType() { + return this.type; + } + + public void setType(final BucketHistoryEventType type) { + this.type = type; + } + + + public UUID getVersionId() { + return this.versionId; + } + + public void setVersionId(final UUID versionId) { + this.versionId = versionId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventList.java new file mode 100644 index 000000000..222a0b295 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventList.java @@ -0,0 +1,48 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class BucketHistoryEventList { + + // Variables + @JsonProperty("BucketHistoryEvent") + @JacksonXmlElementWrapper(useWrapping = false) + private List bucketHistoryEvents = new ArrayList<>(); + + // Constructor + public BucketHistoryEventList() { + //pass + } + + // Getters and Setters + + public List getBucketHistoryEvents() { + return this.bucketHistoryEvents; + } + + public void setBucketHistoryEvents(final List bucketHistoryEvents) { + this.bucketHistoryEvents = bucketHistoryEvents; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportConflictResolutionMode.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventType.java similarity index 82% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportConflictResolutionMode.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventType.java index bcd4bc4db..796337dc5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportConflictResolutionMode.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketHistoryEventType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,8 +16,9 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.models; -public enum ImportConflictResolutionMode { - CANCEL, - ACCEPT_MOST_RECENT, - ACCEPT_EXISTING +public enum BucketHistoryEventType { + DELETE, + MARK_LATEST, + UNMARK_LATEST, + CREATE } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketList.java index bc12fb5a4..6b39df96b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BucketList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BuildInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BuildInformation.java index e2bace3b9..2454c40ab 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BuildInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BuildInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class BuildInformation { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java index 17d77e3bf..8c05fefcb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObject.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.UUID; import java.lang.Boolean; @@ -51,8 +50,8 @@ public class BulkObject { @JsonProperty("PhysicalPlacement") private PhysicalPlacement physicalPlacement; - @JacksonXmlProperty(isAttribute = true, localName = "Version") - private long version; + @JacksonXmlProperty(isAttribute = true, localName = "VersionId") + private UUID versionId; // Constructor public BulkObject() { @@ -133,18 +132,18 @@ public void setPhysicalPlacement(final PhysicalPlacement physicalPlacement) { } - public long getVersion() { - return this.version; + public UUID getVersionId() { + return this.versionId; } - public void setVersion(final long version) { - this.version = version; + public void setVersionId(final UUID versionId) { + this.versionId = versionId; } @Override public int hashCode() { - return java.util.Objects.hash(id, inCache, latest, length, name, offset, physicalPlacement, version); + return java.util.Objects.hash(id, inCache, latest, length, name, offset, physicalPlacement, versionId); } @Override @@ -162,14 +161,14 @@ && nullableEquals(this.getInCache(), bulkObject.getInCache()) && nullableEquals(this.getName(), bulkObject.getName()) && this.getOffset() == bulkObject.getOffset() && this.getPhysicalPlacement() == bulkObject.getPhysicalPlacement() - && this.getVersion() == bulkObject.getVersion(); + && nullableEquals(this.getVersionId(), bulkObject.getVersionId()); } /** * Tests if two objects are equal, and handles the case if either or both objects are null */ protected static boolean nullableEquals(final Object obj1, final Object obj2) { - return obj1 == null && obj2 == null || obj1 != null && obj2 != null && obj1.equals(obj2); + return obj1 == null && obj2 == null || obj1 != null && obj1.equals(obj2); } @Override diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObjectList.java index b1780261c..9cc175aec 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObjectList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/BulkObjectList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryInformation.java index 03cdc597a..9c7640abf 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryState.java index b428b5284..50481e289 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheEntryState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,5 +18,6 @@ public enum CacheEntryState { ALLOCATED, - IN_CACHE + IN_CACHE, + PENDING_DELETE } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java index 5658acc11..525c2f924 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystem.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.Long; -import java.lang.Double; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class CacheFilesystem { @@ -36,6 +33,9 @@ public class CacheFilesystem { @JsonProperty("BurstThreshold") private double burstThreshold; + @JsonProperty("CacheSafetyEnabled") + private boolean cacheSafetyEnabled; + @JsonProperty("Id") private UUID id; @@ -45,6 +45,9 @@ public class CacheFilesystem { @JsonProperty("MaxPercentUtilizationOfFilesystem") private Double maxPercentUtilizationOfFilesystem; + @JsonProperty("NeedsReconcile") + private boolean needsReconcile; + @JsonProperty("NodeId") private UUID nodeId; @@ -85,6 +88,15 @@ public void setBurstThreshold(final double burstThreshold) { } + public boolean getCacheSafetyEnabled() { + return this.cacheSafetyEnabled; + } + + public void setCacheSafetyEnabled(final boolean cacheSafetyEnabled) { + this.cacheSafetyEnabled = cacheSafetyEnabled; + } + + public UUID getId() { return this.id; } @@ -112,6 +124,15 @@ public void setMaxPercentUtilizationOfFilesystem(final Double maxPercentUtilizat } + public boolean getNeedsReconcile() { + return this.needsReconcile; + } + + public void setNeedsReconcile(final boolean needsReconcile) { + this.needsReconcile = needsReconcile; + } + + public UUID getNodeId() { return this.nodeId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemInformation.java index d58ba2ef4..f1f34b52c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,7 +21,6 @@ import java.util.List; import java.util.ArrayList; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class CacheFilesystemInformation { @@ -37,6 +36,9 @@ public class CacheFilesystemInformation { @JacksonXmlElementWrapper(useWrapping = false) private List entries = new ArrayList<>(); + @JsonProperty("JobLockedCacheInBytes") + private long jobLockedCacheInBytes; + @JsonProperty("Summary") private String summary; @@ -83,6 +85,15 @@ public void setEntries(final List entries) { } + public long getJobLockedCacheInBytes() { + return this.jobLockedCacheInBytes; + } + + public void setJobLockedCacheInBytes(final long jobLockedCacheInBytes) { + this.jobLockedCacheInBytes = jobLockedCacheInBytes; + } + + public String getSummary() { return this.summary; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemList.java index 42f0f5809..1b8f467ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheFilesystemList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheInformation.java index 9c3ec743e..b74981a6f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRule.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRule.java new file mode 100644 index 000000000..c38095b6d --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRule.java @@ -0,0 +1,105 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; + +@JacksonXmlRootElement(namespace = "Data") +public class CacheThrottleRule { + + // Variables + @JsonProperty("BucketId") + private UUID bucketId; + + @JsonProperty("BurstThreshold") + private Double burstThreshold; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("MaxCachePercent") + private double maxCachePercent; + + @JsonProperty("Priority") + private Priority priority; + + @JsonProperty("RequestType") + private JobRequestType requestType; + + // Constructor + public CacheThrottleRule() { + //pass + } + + // Getters and Setters + + public UUID getBucketId() { + return this.bucketId; + } + + public void setBucketId(final UUID bucketId) { + this.bucketId = bucketId; + } + + + public Double getBurstThreshold() { + return this.burstThreshold; + } + + public void setBurstThreshold(final Double burstThreshold) { + this.burstThreshold = burstThreshold; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public double getMaxCachePercent() { + return this.maxCachePercent; + } + + public void setMaxCachePercent(final double maxCachePercent) { + this.maxCachePercent = maxCachePercent; + } + + + public Priority getPriority() { + return this.priority; + } + + public void setPriority(final Priority priority) { + this.priority = priority; + } + + + public JobRequestType getRequestType() { + return this.requestType; + } + + public void setRequestType(final JobRequestType requestType) { + this.requestType = requestType; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRuleList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRuleList.java new file mode 100644 index 000000000..9d8152628 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CacheThrottleRuleList.java @@ -0,0 +1,48 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class CacheThrottleRuleList { + + // Variables + @JsonProperty("CacheThrottleRule") + @JacksonXmlElementWrapper(useWrapping = false) + private List cacheThrottleRules = new ArrayList<>(); + + // Constructor + public CacheThrottleRuleList() { + //pass + } + + // Getters and Setters + + public List getCacheThrottleRules() { + return this.cacheThrottleRules; + } + + public void setCacheThrottleRules(final List cacheThrottleRules) { + this.cacheThrottleRules = cacheThrottleRules; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJob.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJob.java index eb3735415..d5df6376c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJob.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJob.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class CanceledJob { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJobList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJobList.java index c97ace764..84cda2469 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJobList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CanceledJobList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CapacitySummaryContainer.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CapacitySummaryContainer.java index eda4f1273..a9397ae09 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CapacitySummaryContainer.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CapacitySummaryContainer.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java index 2d5abb058..4e2ef702d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ChecksumType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,7 @@ import org.apache.commons.codec.binary.Base64; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; public abstract class ChecksumType { @@ -85,7 +86,7 @@ public Value(final String hash) { @Override public T match(final MatchHandler handler) throws E { - return handler.value(this.hash.getBytes(Charset.forName("UTF-8"))); + return handler.value(this.hash.getBytes(StandardCharsets.UTF_8)); } } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CloudNamingMode.java similarity index 75% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeType.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CloudNamingMode.java index 3df1166ef..719b10692 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CloudNamingMode.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,18 +16,7 @@ // This code is auto-generated, do not modify package com.spectralogic.ds3client.models; -public enum TapeType { - LTO5, - LTO6, - LTO7, - LTO_CLEANING_TAPE, - TS_JC, - TS_JY, - TS_JK, - TS_JD, - TS_JZ, - TS_JL, - TS_CLEANING_TAPE, - UNKNOWN, - FORBIDDEN +public enum CloudNamingMode { + BLACK_PEARL, + AWS_S3 } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompleteMultipartUploadResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompleteMultipartUploadResult.java deleted file mode 100644 index a9ca5e847..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompleteMultipartUploadResult.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.models; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; - -@JacksonXmlRootElement(namespace = "CompleteMultipartUploadResult") -public class CompleteMultipartUploadResult { - - // Variables - @JsonProperty("Bucket") - private String bucket; - - @JsonProperty("ETag") - private String eTag; - - @JsonProperty("Key") - private String key; - - @JsonProperty("Location") - private String location; - - // Constructor - public CompleteMultipartUploadResult() { - //pass - } - - // Getters and Setters - - public String getBucket() { - return this.bucket; - } - - public void setBucket(final String bucket) { - this.bucket = bucket; - } - - - public String getETag() { - return this.eTag; - } - - public void setETag(final String eTag) { - this.eTag = eTag; - } - - - public String getKey() { - return this.key; - } - - public void setKey(final String key) { - this.key = key; - } - - - public String getLocation() { - return this.location; - } - - public void setLocation(final String location) { - this.location = location; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJob.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJob.java index 6ba3e045a..8d9a19898 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJob.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJob.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class CompletedJob { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJobList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJobList.java index c9da0afd0..d8e154d6f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJobList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/CompletedJobList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Contents.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Contents.java index 20cdd84be..634e27097 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Contents.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Contents.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; +import java.lang.Boolean; import java.util.Date; +import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") public class Contents { @@ -28,6 +29,9 @@ public class Contents { @JsonProperty("ETag") private String eTag; + @JsonProperty("IsLatest") + private Boolean isLatest; + @JsonProperty("Key") private String key; @@ -43,6 +47,9 @@ public class Contents { @JsonProperty("StorageClass") private String storageClass; + @JsonProperty("VersionId") + private UUID versionId; + // Constructor public Contents() { //pass @@ -59,6 +66,15 @@ public void setETag(final String eTag) { } + public Boolean getIsLatest() { + return this.isLatest; + } + + public void setIsLatest(final Boolean isLatest) { + this.isLatest = isLatest; + } + + public String getKey() { return this.key; } @@ -103,4 +119,13 @@ public void setStorageClass(final String storageClass) { this.storageClass = storageClass; } + + public UUID getVersionId() { + return this.versionId; + } + + public void setVersionId(final UUID versionId) { + this.versionId = versionId; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataIsolationLevel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataIsolationLevel.java index 51f927537..330ddef49 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataIsolationLevel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataIsolationLevel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPathBackend.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPathBackend.java index 4af0ee42b..bc50ee382 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPathBackend.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPathBackend.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Integer; import java.util.UUID; import java.util.Date; @@ -29,14 +28,20 @@ public class DataPathBackend { @JsonProperty("Activated") private boolean activated; + @JsonProperty("AllowNewJobRequests") + private boolean allowNewJobRequests; + + @JsonProperty("AlwaysRollback") + private boolean alwaysRollback; + @JsonProperty("AutoActivateTimeoutInMins") private Integer autoActivateTimeoutInMins; @JsonProperty("AutoInspect") private AutoInspectMode autoInspect; - @JsonProperty("DefaultImportConflictResolutionMode") - private ImportConflictResolutionMode defaultImportConflictResolutionMode; + @JsonProperty("CacheAvailableRetryAfterInSeconds") + private int cacheAvailableRetryAfterInSeconds; @JsonProperty("DefaultVerifyDataAfterImport") private Priority defaultVerifyDataAfterImport; @@ -50,12 +55,27 @@ public class DataPathBackend { @JsonProperty("InstanceId") private UUID instanceId; + @JsonProperty("IomCacheLimitationPercent") + private double iomCacheLimitationPercent; + + @JsonProperty("IomEnabled") + private boolean iomEnabled; + @JsonProperty("LastHeartbeat") private Date lastHeartbeat; + @JsonProperty("MaxAggregatedBlobsPerChunk") + private int maxAggregatedBlobsPerChunk; + + @JsonProperty("MaxNumberOfConcurrentJobs") + private int maxNumberOfConcurrentJobs; + @JsonProperty("PartiallyVerifyLastPercentOfTapes") private Integer partiallyVerifyLastPercentOfTapes; + @JsonProperty("PoolSafetyEnabled") + private boolean poolSafetyEnabled; + @JsonProperty("UnavailableMediaPolicy") private UnavailableMediaUsagePolicy unavailableMediaPolicy; @@ -65,6 +85,9 @@ public class DataPathBackend { @JsonProperty("UnavailableTapePartitionMaxJobRetryInMins") private int unavailableTapePartitionMaxJobRetryInMins; + @JsonProperty("VerifyCheckpointBeforeRead") + private boolean verifyCheckpointBeforeRead; + // Constructor public DataPathBackend() { //pass @@ -81,6 +104,24 @@ public void setActivated(final boolean activated) { } + public boolean getAllowNewJobRequests() { + return this.allowNewJobRequests; + } + + public void setAllowNewJobRequests(final boolean allowNewJobRequests) { + this.allowNewJobRequests = allowNewJobRequests; + } + + + public boolean getAlwaysRollback() { + return this.alwaysRollback; + } + + public void setAlwaysRollback(final boolean alwaysRollback) { + this.alwaysRollback = alwaysRollback; + } + + public Integer getAutoActivateTimeoutInMins() { return this.autoActivateTimeoutInMins; } @@ -99,12 +140,12 @@ public void setAutoInspect(final AutoInspectMode autoInspect) { } - public ImportConflictResolutionMode getDefaultImportConflictResolutionMode() { - return this.defaultImportConflictResolutionMode; + public int getCacheAvailableRetryAfterInSeconds() { + return this.cacheAvailableRetryAfterInSeconds; } - public void setDefaultImportConflictResolutionMode(final ImportConflictResolutionMode defaultImportConflictResolutionMode) { - this.defaultImportConflictResolutionMode = defaultImportConflictResolutionMode; + public void setCacheAvailableRetryAfterInSeconds(final int cacheAvailableRetryAfterInSeconds) { + this.cacheAvailableRetryAfterInSeconds = cacheAvailableRetryAfterInSeconds; } @@ -144,6 +185,24 @@ public void setInstanceId(final UUID instanceId) { } + public double getIomCacheLimitationPercent() { + return this.iomCacheLimitationPercent; + } + + public void setIomCacheLimitationPercent(final double iomCacheLimitationPercent) { + this.iomCacheLimitationPercent = iomCacheLimitationPercent; + } + + + public boolean getIomEnabled() { + return this.iomEnabled; + } + + public void setIomEnabled(final boolean iomEnabled) { + this.iomEnabled = iomEnabled; + } + + public Date getLastHeartbeat() { return this.lastHeartbeat; } @@ -153,6 +212,24 @@ public void setLastHeartbeat(final Date lastHeartbeat) { } + public int getMaxAggregatedBlobsPerChunk() { + return this.maxAggregatedBlobsPerChunk; + } + + public void setMaxAggregatedBlobsPerChunk(final int maxAggregatedBlobsPerChunk) { + this.maxAggregatedBlobsPerChunk = maxAggregatedBlobsPerChunk; + } + + + public int getMaxNumberOfConcurrentJobs() { + return this.maxNumberOfConcurrentJobs; + } + + public void setMaxNumberOfConcurrentJobs(final int maxNumberOfConcurrentJobs) { + this.maxNumberOfConcurrentJobs = maxNumberOfConcurrentJobs; + } + + public Integer getPartiallyVerifyLastPercentOfTapes() { return this.partiallyVerifyLastPercentOfTapes; } @@ -162,6 +239,15 @@ public void setPartiallyVerifyLastPercentOfTapes(final Integer partiallyVerifyLa } + public boolean getPoolSafetyEnabled() { + return this.poolSafetyEnabled; + } + + public void setPoolSafetyEnabled(final boolean poolSafetyEnabled) { + this.poolSafetyEnabled = poolSafetyEnabled; + } + + public UnavailableMediaUsagePolicy getUnavailableMediaPolicy() { return this.unavailableMediaPolicy; } @@ -188,4 +274,13 @@ public void setUnavailableTapePartitionMaxJobRetryInMins(final int unavailableTa this.unavailableTapePartitionMaxJobRetryInMins = unavailableTapePartitionMaxJobRetryInMins; } + + public boolean getVerifyCheckpointBeforeRead() { + return this.verifyCheckpointBeforeRead; + } + + public void setVerifyCheckpointBeforeRead(final boolean verifyCheckpointBeforeRead) { + this.verifyCheckpointBeforeRead = verifyCheckpointBeforeRead; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRule.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRule.java index 637c85794..4d8a1e79c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRule.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRule.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class DataPersistenceRule { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleApiBean.java new file mode 100644 index 000000000..c04040f7c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleApiBean.java @@ -0,0 +1,118 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class DataPersistenceRuleApiBean { + + // Variables + @JsonProperty("Id") + private UUID id; + + @JsonProperty("IsolationLevel") + private DataIsolationLevel isolationLevel; + + @JsonProperty("MinimumDaysToRetain") + private Integer minimumDaysToRetain; + + @JsonProperty("State") + private DataPlacementRuleState state; + + @JsonProperty("StorageDomainId") + private UUID storageDomainId; + + @JacksonXmlProperty(isAttribute = true, localName = "StorageDomainName") + private String storageDomainName; + + @JsonProperty("Type") + private DataPersistenceRuleType type; + + // Constructor + public DataPersistenceRuleApiBean() { + //pass + } + + // Getters and Setters + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public DataIsolationLevel getIsolationLevel() { + return this.isolationLevel; + } + + public void setIsolationLevel(final DataIsolationLevel isolationLevel) { + this.isolationLevel = isolationLevel; + } + + + public Integer getMinimumDaysToRetain() { + return this.minimumDaysToRetain; + } + + public void setMinimumDaysToRetain(final Integer minimumDaysToRetain) { + this.minimumDaysToRetain = minimumDaysToRetain; + } + + + public DataPlacementRuleState getState() { + return this.state; + } + + public void setState(final DataPlacementRuleState state) { + this.state = state; + } + + + public UUID getStorageDomainId() { + return this.storageDomainId; + } + + public void setStorageDomainId(final UUID storageDomainId) { + this.storageDomainId = storageDomainId; + } + + + public String getStorageDomainName() { + return this.storageDomainName; + } + + public void setStorageDomainName(final String storageDomainName) { + this.storageDomainName = storageDomainName; + } + + + public DataPersistenceRuleType getType() { + return this.type; + } + + public void setType(final DataPersistenceRuleType type) { + this.type = type; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleList.java index ec9df25e9..52dd630b7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleType.java index 45e867ea8..9b045fec3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPersistenceRuleType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPlacementRuleState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPlacementRuleState.java index 88e0e33da..48ca8cb3e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPlacementRuleState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPlacementRuleState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicy.java index 2ede6aa7d..6076351ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicy.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicy.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.Long; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class DataPolicy { @@ -33,9 +31,6 @@ public class DataPolicy { @JsonProperty("AlwaysMinimizeSpanningAcrossMedia") private boolean alwaysMinimizeSpanningAcrossMedia; - @JsonProperty("AlwaysReplicateDeletes") - private boolean alwaysReplicateDeletes; - @JsonProperty("BlobbingEnabled") private boolean blobbingEnabled; @@ -66,8 +61,8 @@ public class DataPolicy { @JsonProperty("Id") private UUID id; - @JsonProperty("LtfsObjectNamingAllowed") - private boolean ltfsObjectNamingAllowed; + @JsonProperty("MaxVersionsToKeep") + private int maxVersionsToKeep; @JsonProperty("Name") private String name; @@ -103,15 +98,6 @@ public void setAlwaysMinimizeSpanningAcrossMedia(final boolean alwaysMinimizeSpa } - public boolean getAlwaysReplicateDeletes() { - return this.alwaysReplicateDeletes; - } - - public void setAlwaysReplicateDeletes(final boolean alwaysReplicateDeletes) { - this.alwaysReplicateDeletes = alwaysReplicateDeletes; - } - - public boolean getBlobbingEnabled() { return this.blobbingEnabled; } @@ -202,12 +188,12 @@ public void setId(final UUID id) { } - public boolean getLtfsObjectNamingAllowed() { - return this.ltfsObjectNamingAllowed; + public int getMaxVersionsToKeep() { + return this.maxVersionsToKeep; } - public void setLtfsObjectNamingAllowed(final boolean ltfsObjectNamingAllowed) { - this.ltfsObjectNamingAllowed = ltfsObjectNamingAllowed; + public void setMaxVersionsToKeep(final int maxVersionsToKeep) { + this.maxVersionsToKeep = maxVersionsToKeep; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAcl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAcl.java index ba4286fe4..697b9ea10 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAcl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAcl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAclList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAclList.java index c97d81132..68d7f936c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAclList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyAclList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyApiBean.java new file mode 100644 index 000000000..0f9062d6c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyApiBean.java @@ -0,0 +1,269 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import java.util.Date; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class DataPolicyApiBean { + + // Variables + @JsonProperty("AlwaysForcePutJobCreation") + private boolean alwaysForcePutJobCreation; + + @JsonProperty("AlwaysMinimizeSpanningAcrossMedia") + private boolean alwaysMinimizeSpanningAcrossMedia; + + @JsonProperty("BlobbingEnabled") + private boolean blobbingEnabled; + + @JsonProperty("Buckets") + @JacksonXmlElementWrapper(useWrapping = true) + private List buckets = new ArrayList<>(); + + @JsonProperty("ChecksumType") + private ChecksumType.Type checksumType; + + @JsonProperty("CreationDate") + private Date creationDate; + + @JsonProperty("DataPersistenceRules") + @JacksonXmlElementWrapper(useWrapping = true) + private List dataPersistenceRules = new ArrayList<>(); + + @JsonProperty("DataReplicationRules") + @JacksonXmlElementWrapper(useWrapping = true) + private List dataReplicationRules = new ArrayList<>(); + + @JsonProperty("DefaultBlobSize") + private Long defaultBlobSize; + + @JsonProperty("DefaultGetJobPriority") + private Priority defaultGetJobPriority; + + @JsonProperty("DefaultPutJobPriority") + private Priority defaultPutJobPriority; + + @JsonProperty("DefaultVerifyAfterWrite") + private boolean defaultVerifyAfterWrite; + + @JsonProperty("DefaultVerifyJobPriority") + private Priority defaultVerifyJobPriority; + + @JsonProperty("EndToEndCrcRequired") + private boolean endToEndCrcRequired; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("MaxVersionsToKeep") + private int maxVersionsToKeep; + + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; + + @JsonProperty("RebuildPriority") + private Priority rebuildPriority; + + @JsonProperty("Versioning") + private VersioningLevel versioning; + + // Constructor + public DataPolicyApiBean() { + //pass + } + + // Getters and Setters + + public boolean getAlwaysForcePutJobCreation() { + return this.alwaysForcePutJobCreation; + } + + public void setAlwaysForcePutJobCreation(final boolean alwaysForcePutJobCreation) { + this.alwaysForcePutJobCreation = alwaysForcePutJobCreation; + } + + + public boolean getAlwaysMinimizeSpanningAcrossMedia() { + return this.alwaysMinimizeSpanningAcrossMedia; + } + + public void setAlwaysMinimizeSpanningAcrossMedia(final boolean alwaysMinimizeSpanningAcrossMedia) { + this.alwaysMinimizeSpanningAcrossMedia = alwaysMinimizeSpanningAcrossMedia; + } + + + public boolean getBlobbingEnabled() { + return this.blobbingEnabled; + } + + public void setBlobbingEnabled(final boolean blobbingEnabled) { + this.blobbingEnabled = blobbingEnabled; + } + + + public List getBuckets() { + return this.buckets; + } + + public void setBuckets(final List buckets) { + this.buckets = buckets; + } + + + public ChecksumType.Type getChecksumType() { + return this.checksumType; + } + + public void setChecksumType(final ChecksumType.Type checksumType) { + this.checksumType = checksumType; + } + + + public Date getCreationDate() { + return this.creationDate; + } + + public void setCreationDate(final Date creationDate) { + this.creationDate = creationDate; + } + + + public List getDataPersistenceRules() { + return this.dataPersistenceRules; + } + + public void setDataPersistenceRules(final List dataPersistenceRules) { + this.dataPersistenceRules = dataPersistenceRules; + } + + + public List getDataReplicationRules() { + return this.dataReplicationRules; + } + + public void setDataReplicationRules(final List dataReplicationRules) { + this.dataReplicationRules = dataReplicationRules; + } + + + public Long getDefaultBlobSize() { + return this.defaultBlobSize; + } + + public void setDefaultBlobSize(final Long defaultBlobSize) { + this.defaultBlobSize = defaultBlobSize; + } + + + public Priority getDefaultGetJobPriority() { + return this.defaultGetJobPriority; + } + + public void setDefaultGetJobPriority(final Priority defaultGetJobPriority) { + this.defaultGetJobPriority = defaultGetJobPriority; + } + + + public Priority getDefaultPutJobPriority() { + return this.defaultPutJobPriority; + } + + public void setDefaultPutJobPriority(final Priority defaultPutJobPriority) { + this.defaultPutJobPriority = defaultPutJobPriority; + } + + + public boolean getDefaultVerifyAfterWrite() { + return this.defaultVerifyAfterWrite; + } + + public void setDefaultVerifyAfterWrite(final boolean defaultVerifyAfterWrite) { + this.defaultVerifyAfterWrite = defaultVerifyAfterWrite; + } + + + public Priority getDefaultVerifyJobPriority() { + return this.defaultVerifyJobPriority; + } + + public void setDefaultVerifyJobPriority(final Priority defaultVerifyJobPriority) { + this.defaultVerifyJobPriority = defaultVerifyJobPriority; + } + + + public boolean getEndToEndCrcRequired() { + return this.endToEndCrcRequired; + } + + public void setEndToEndCrcRequired(final boolean endToEndCrcRequired) { + this.endToEndCrcRequired = endToEndCrcRequired; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public int getMaxVersionsToKeep() { + return this.maxVersionsToKeep; + } + + public void setMaxVersionsToKeep(final int maxVersionsToKeep) { + this.maxVersionsToKeep = maxVersionsToKeep; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + + public Priority getRebuildPriority() { + return this.rebuildPriority; + } + + public void setRebuildPriority(final Priority rebuildPriority) { + this.rebuildPriority = rebuildPriority; + } + + + public VersioningLevel getVersioning() { + return this.versioning; + } + + public void setVersioning(final VersioningLevel versioning) { + this.versioning = versioning; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyList.java index c3aabbdf2..4e3b3b801 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataPolicyList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleApiBean.java new file mode 100644 index 000000000..dfcf4e46f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleApiBean.java @@ -0,0 +1,106 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class DataReplicationRuleApiBean { + + // Variables + @JsonProperty("Id") + private UUID id; + + @JsonProperty("ReplicateDeletes") + private boolean replicateDeletes; + + @JsonProperty("State") + private DataPlacementRuleState state; + + @JsonProperty("TargetId") + private UUID targetId; + + @JacksonXmlProperty(isAttribute = true, localName = "TargetName") + private String targetName; + + @JsonProperty("Type") + private DataReplicationRuleType type; + + // Constructor + public DataReplicationRuleApiBean() { + //pass + } + + // Getters and Setters + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public boolean getReplicateDeletes() { + return this.replicateDeletes; + } + + public void setReplicateDeletes(final boolean replicateDeletes) { + this.replicateDeletes = replicateDeletes; + } + + + public DataPlacementRuleState getState() { + return this.state; + } + + public void setState(final DataPlacementRuleState state) { + this.state = state; + } + + + public UUID getTargetId() { + return this.targetId; + } + + public void setTargetId(final UUID targetId) { + this.targetId = targetId; + } + + + public String getTargetName() { + return this.targetName; + } + + public void setTargetName(final String targetName) { + this.targetName = targetName; + } + + + public DataReplicationRuleType getType() { + return this.type; + } + + public void setType(final DataReplicationRuleType type) { + this.type = type; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleType.java index 804800e68..0291e676c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DataReplicationRuleType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DatabasePhysicalSpaceState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DatabasePhysicalSpaceState.java index 9afefbc28..dd52a6f79 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DatabasePhysicalSpaceState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DatabasePhysicalSpaceState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlob.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlob.java index 0f0b410c3..27de12b05 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlob.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlob.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlobList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlobList.java index c4365ad21..0eb27f0e4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlobList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DegradedBlobList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteObjectError.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteObjectError.java index c9baec5c0..4ac4c6bd3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteObjectError.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteObjectError.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; +import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") public class DeleteObjectError { @@ -33,6 +33,9 @@ public class DeleteObjectError { @JsonProperty("Message") private String message; + @JsonProperty("VersionId") + private UUID versionId; + // Constructor public DeleteObjectError() { //pass @@ -66,4 +69,13 @@ public void setMessage(final String message) { this.message = message; } + + public UUID getVersionId() { + return this.versionId; + } + + public void setVersionId(final UUID versionId) { + this.versionId = versionId; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteResult.java index 1c36576c2..db30a630e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DeleteResult.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DestinationSummary.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DestinationSummary.java new file mode 100644 index 000000000..0b51834f9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DestinationSummary.java @@ -0,0 +1,86 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import java.util.UUID; + +@JacksonXmlRootElement(namespace = "Data") +public class DestinationSummary { + + // Variables + @JsonProperty("CompletedChunks") + @JacksonXmlElementWrapper(useWrapping = true) + private List completedChunks = new ArrayList<>(); + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("IncompleteChunks") + @JacksonXmlElementWrapper(useWrapping = true) + private List incompleteChunks = new ArrayList<>(); + + @JsonProperty("Name") + private String name; + + // Constructor + public DestinationSummary() { + //pass + } + + // Getters and Setters + + public List getCompletedChunks() { + return this.completedChunks; + } + + public void setCompletedChunks(final List completedChunks) { + this.completedChunks = completedChunks; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public List getIncompleteChunks() { + return this.incompleteChunks; + } + + public void setIncompleteChunks(final List incompleteChunks) { + this.incompleteChunks = incompleteChunks; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3Object.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3Object.java index 87d0706d0..7c04094d2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3Object.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3Object.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,10 +18,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Integer; import java.util.UUID; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Object") public class DetailedS3Object { @@ -69,9 +67,6 @@ public class DetailedS3Object { @JsonProperty("Type") private S3ObjectType type; - @JsonProperty("Version") - private long version; - // Constructor public DetailedS3Object() { //pass @@ -204,13 +199,4 @@ public void setType(final S3ObjectType type) { this.type = type; } - - public long getVersion() { - return this.version; - } - - public void setVersion(final long version) { - this.version = version; - } - } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3ObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3ObjectList.java index 3c07f9e07..a440fd0bb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3ObjectList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedS3ObjectList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailure.java index 1e33d6a32..539709c58 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailureList.java index 4da30f76e..6411d85fd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapeFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapePartition.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapePartition.java index cdecdac6d..de06b695b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapePartition.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/DetailedTapePartition.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,13 +21,24 @@ import java.util.List; import java.util.ArrayList; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") public class DetailedTapePartition { // Variables + @JsonProperty("AutoCompactionEnabled") + private boolean autoCompactionEnabled; + + @JsonProperty("AutoQuiesceEnabled") + private boolean autoQuiesceEnabled; + + @JsonProperty("AvailableStorageCapacity") + private long availableStorageCapacity; + + @JsonProperty("DriveIdleTimeoutInMinutes") + private Integer driveIdleTimeoutInMinutes; + @JsonProperty("DriveType") private TapeDriveType driveType; @@ -47,6 +58,12 @@ public class DetailedTapePartition { @JsonProperty("LibraryId") private UUID libraryId; + @JsonProperty("MinimumReadReservedDrives") + private int minimumReadReservedDrives; + + @JsonProperty("MinimumWriteReservedDrives") + private int minimumWriteReservedDrives; + @JsonProperty("Name") private String name; @@ -59,9 +76,26 @@ public class DetailedTapePartition { @JsonProperty("State") private TapePartitionState state; + @JsonProperty("TapeCount") + private int tapeCount; + + @JsonProperty("TapeStateSummaries") + @JacksonXmlElementWrapper(useWrapping = true) + private List tapeStateSummaries = new ArrayList<>(); + + @JsonProperty("TapeTypeSummaries") + @JacksonXmlElementWrapper(useWrapping = true) + private List tapeTypeSummaries = new ArrayList<>(); + @JsonProperty("TapeTypes") @JacksonXmlElementWrapper(useWrapping = false) - private List tapeTypes = new ArrayList<>(); + private List tapeTypes = new ArrayList<>(); + + @JsonProperty("TotalStorageCapacity") + private long totalStorageCapacity; + + @JsonProperty("UsedStorageCapacity") + private long usedStorageCapacity; // Constructor public DetailedTapePartition() { @@ -70,6 +104,42 @@ public DetailedTapePartition() { // Getters and Setters + public boolean getAutoCompactionEnabled() { + return this.autoCompactionEnabled; + } + + public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) { + this.autoCompactionEnabled = autoCompactionEnabled; + } + + + public boolean getAutoQuiesceEnabled() { + return this.autoQuiesceEnabled; + } + + public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) { + this.autoQuiesceEnabled = autoQuiesceEnabled; + } + + + public long getAvailableStorageCapacity() { + return this.availableStorageCapacity; + } + + public void setAvailableStorageCapacity(final long availableStorageCapacity) { + this.availableStorageCapacity = availableStorageCapacity; + } + + + public Integer getDriveIdleTimeoutInMinutes() { + return this.driveIdleTimeoutInMinutes; + } + + public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) { + this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes; + } + + public TapeDriveType getDriveType() { return this.driveType; } @@ -124,6 +194,24 @@ public void setLibraryId(final UUID libraryId) { } + public int getMinimumReadReservedDrives() { + return this.minimumReadReservedDrives; + } + + public void setMinimumReadReservedDrives(final int minimumReadReservedDrives) { + this.minimumReadReservedDrives = minimumReadReservedDrives; + } + + + public int getMinimumWriteReservedDrives() { + return this.minimumWriteReservedDrives; + } + + public void setMinimumWriteReservedDrives(final int minimumWriteReservedDrives) { + this.minimumWriteReservedDrives = minimumWriteReservedDrives; + } + + public String getName() { return this.name; } @@ -160,12 +248,57 @@ public void setState(final TapePartitionState state) { } - public List getTapeTypes() { + public int getTapeCount() { + return this.tapeCount; + } + + public void setTapeCount(final int tapeCount) { + this.tapeCount = tapeCount; + } + + + public List getTapeStateSummaries() { + return this.tapeStateSummaries; + } + + public void setTapeStateSummaries(final List tapeStateSummaries) { + this.tapeStateSummaries = tapeStateSummaries; + } + + + public List getTapeTypeSummaries() { + return this.tapeTypeSummaries; + } + + public void setTapeTypeSummaries(final List tapeTypeSummaries) { + this.tapeTypeSummaries = tapeTypeSummaries; + } + + + public List getTapeTypes() { return this.tapeTypes; } - public void setTapeTypes(final List tapeTypes) { + public void setTapeTypes(final List tapeTypes) { this.tapeTypes = tapeTypes; } + + public long getTotalStorageCapacity() { + return this.totalStorageCapacity; + } + + public void setTotalStorageCapacity(final long totalStorageCapacity) { + this.totalStorageCapacity = totalStorageCapacity; + } + + + public long getUsedStorageCapacity() { + return this.usedStorageCapacity; + } + + public void setUsedStorageCapacity(final long usedStorageCapacity) { + this.usedStorageCapacity = usedStorageCapacity; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRule.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRule.java index f28feaf64..61431aff4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRule.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRule.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class Ds3DataReplicationRule { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRuleList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRuleList.java index d397158e2..743f55931 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRuleList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3DataReplicationRuleList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3Target.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3Target.java index 8a95adaae..095d5361e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3Target.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3Target.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -import java.lang.Integer; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetAccessControlReplication.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetAccessControlReplication.java index 8ac3123b6..f038f08e6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetAccessControlReplication.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetAccessControlReplication.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailure.java index 86fb07d63..b643686ad 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureList.java index d45342360..e34a3181d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistration.java index 2bebff42d..5594d5dc9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class Ds3TargetFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistrationList.java index 2207e4862..303eacd38 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetList.java index c05bdbdfc..e1ba56735 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreference.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreference.java index 29d453796..08a55e32f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreference.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreference.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreferenceList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreferenceList.java index 9ee24a8c9..8a678687f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreferenceList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Ds3TargetReadPreferenceList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Duration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Duration.java new file mode 100644 index 000000000..a05b70b9f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Duration.java @@ -0,0 +1,92 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +@JacksonXmlRootElement(namespace = "Data") +public class Duration { + + // Variables + @JsonProperty("ElapsedHours") + private int elapsedHours; + + @JsonProperty("ElapsedMillis") + private long elapsedMillis; + + @JsonProperty("ElapsedMinutes") + private int elapsedMinutes; + + @JsonProperty("ElapsedNanos") + private long elapsedNanos; + + @JsonProperty("ElapsedSeconds") + private int elapsedSeconds; + + // Constructor + public Duration() { + //pass + } + + // Getters and Setters + + public int getElapsedHours() { + return this.elapsedHours; + } + + public void setElapsedHours(final int elapsedHours) { + this.elapsedHours = elapsedHours; + } + + + public long getElapsedMillis() { + return this.elapsedMillis; + } + + public void setElapsedMillis(final long elapsedMillis) { + this.elapsedMillis = elapsedMillis; + } + + + public int getElapsedMinutes() { + return this.elapsedMinutes; + } + + public void setElapsedMinutes(final int elapsedMinutes) { + this.elapsedMinutes = elapsedMinutes; + } + + + public long getElapsedNanos() { + return this.elapsedNanos; + } + + public void setElapsedNanos(final long elapsedNanos) { + this.elapsedNanos = elapsedNanos; + } + + + public int getElapsedSeconds() { + return this.elapsedSeconds; + } + + public void setElapsedSeconds(final int elapsedSeconds) { + this.elapsedSeconds = elapsedSeconds; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Error.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Error.java index 45a6727b2..60953e29d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Error.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Error.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,11 +19,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; +import java.io.Serializable; @JacksonXmlRootElement(namespace = "Error") @JsonIgnoreProperties(ignoreUnknown = true) -public class Error { +public class Error implements Serializable { // Variables @JsonProperty("Code") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKey.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKey.java index 9c52da106..a501e9a39 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKey.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKey.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Long; -import java.lang.String; import java.util.Date; import java.util.UUID; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyList.java index a452d5934..e146f350c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyType.java index a9a609134..585211355 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/FeatureKeyType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Group.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Group.java index f36f19008..c238cf60d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Group.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Group.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class Group { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupList.java index 4da3091e9..701a3a38b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMember.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMember.java index dd457b392..e1b9c60c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMember.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMember.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMemberList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMemberList.java index 576f86a31..fe3f69fb2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMemberList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/GroupMemberList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HealthVerificationResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HealthVerificationResult.java index 8607a0f21..3edb61a9f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HealthVerificationResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HealthVerificationResult.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HttpResponseFormatType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HttpResponseFormatType.java index 13bfb9fbe..9e8b48347 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HttpResponseFormatType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HttpResponseFormatType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUploadPart.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HumanReadableBucketApiBean.java similarity index 57% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUploadPart.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HumanReadableBucketApiBean.java index f0ed0052f..3b7e08f73 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUploadPart.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/HumanReadableBucketApiBean.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,53 +18,41 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.Date; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; @JacksonXmlRootElement(namespace = "Data") -public class MultiPartUploadPart { +public class HumanReadableBucketApiBean { // Variables - @JsonProperty("ETag") - private String eTag; + @JsonProperty("CreationDate") + private Date creationDate; - @JsonProperty("LastModified") - private Date lastModified; - - @JsonProperty("PartNumber") - private int partNumber; + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; // Constructor - public MultiPartUploadPart() { + public HumanReadableBucketApiBean() { //pass } // Getters and Setters - public String getETag() { - return this.eTag; - } - - public void setETag(final String eTag) { - this.eTag = eTag; - } - - - public Date getLastModified() { - return this.lastModified; + public Date getCreationDate() { + return this.creationDate; } - public void setLastModified(final Date lastModified) { - this.lastModified = lastModified; + public void setCreationDate(final Date creationDate) { + this.creationDate = creationDate; } - public int getPartNumber() { - return this.partNumber; + public String getName() { + return this.name; } - public void setPartNumber(final int partNumber) { - this.partNumber = partNumber; + public void setName(final String name) { + this.name = name; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportExportConfiguration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportExportConfiguration.java index 3537ff51d..e9e190cb0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportExportConfiguration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ImportExportConfiguration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/IomType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/IomType.java new file mode 100644 index 000000000..65bdd7a26 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/IomType.java @@ -0,0 +1,23 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +public enum IomType { + NO, + YES, + PERMANENT_ONLY +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Job.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Job.java index 16ba8ffe3..c2ebd4747 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Job.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Job.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import java.lang.String; +import java.lang.Boolean; import java.util.UUID; import java.util.List; import java.util.ArrayList; @@ -46,7 +46,7 @@ public class Job { private long completedSizeInBytes; @JacksonXmlProperty(isAttribute = true, localName = "EntirelyInCache") - private boolean entirelyInCache; + private Boolean entirelyInCache; @JacksonXmlProperty(isAttribute = true, localName = "JobId") private UUID jobId; @@ -134,11 +134,11 @@ public void setCompletedSizeInBytes(final long completedSizeInBytes) { } - public boolean getEntirelyInCache() { + public Boolean getEntirelyInCache() { return this.entirelyInCache; } - public void setEntirelyInCache(final boolean entirelyInCache) { + public void setEntirelyInCache(final Boolean entirelyInCache) { this.entirelyInCache = entirelyInCache; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunk.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunk.java index db79330c2..ae2f71eef 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunk.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunk.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkBlobStoreState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkBlobStoreState.java index f75177856..47ff72ff8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkBlobStoreState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkBlobStoreState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkClientProcessingOrderGuarantee.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkClientProcessingOrderGuarantee.java index f4727d77b..d40e63eb9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkClientProcessingOrderGuarantee.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobChunkClientProcessingOrderGuarantee.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistration.java index 8e5277f2d..e55ac8641 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class JobCompletedNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistrationList.java index 89ea37e83..063e72c44 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCompletedNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistration.java index 17386fcf3..480921105 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class JobCreatedNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistrationList.java index a157c0e85..9be21104d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreatedNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java new file mode 100644 index 000000000..1a98ea59a --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailed.java @@ -0,0 +1,106 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.Date; +import java.util.UUID; + +@JacksonXmlRootElement(namespace = "Data") +public class JobCreationFailed { + + // Variables + @JsonProperty("Date") + private Date date; + + @JsonProperty("ErrorMessage") + private String errorMessage; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("TapeBarCodes") + private String tapeBarCodes; + + @JsonProperty("Type") + private JobCreationFailedType type; + + @JsonProperty("UserName") + private String userName; + + // Constructor + public JobCreationFailed() { + //pass + } + + // Getters and Setters + + public Date getDate() { + return this.date; + } + + public void setDate(final Date date) { + this.date = date; + } + + + public String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(final String errorMessage) { + this.errorMessage = errorMessage; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public String getTapeBarCodes() { + return this.tapeBarCodes; + } + + public void setTapeBarCodes(final String tapeBarCodes) { + this.tapeBarCodes = tapeBarCodes; + } + + + public JobCreationFailedType getType() { + return this.type; + } + + public void setType(final JobCreationFailedType type) { + this.type = type; + } + + + public String getUserName() { + return this.userName; + } + + public void setUserName(final String userName) { + this.userName = userName; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java new file mode 100644 index 000000000..36e50009e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedList.java @@ -0,0 +1,48 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class JobCreationFailedList { + + // Variables + @JsonProperty("JobCreationFailed") + @JacksonXmlElementWrapper(useWrapping = false) + private List jobCreationFaileds = new ArrayList<>(); + + // Constructor + public JobCreationFailedList() { + //pass + } + + // Getters and Setters + + public List getJobCreationFaileds() { + return this.jobCreationFaileds; + } + + public void setJobCreationFaileds(final List jobCreationFaileds) { + this.jobCreationFaileds = jobCreationFaileds; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistration.java index 613eac38f..010f5221a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class JobCreationFailedNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistrationList.java index 4dfe528e3..923544bc4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java new file mode 100644 index 000000000..4afc868b2 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobCreationFailedType.java @@ -0,0 +1,22 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +public enum JobCreationFailedType { + DATA_UNAVAILABLE, + TAPES_MUST_BE_ONLINED +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntry.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntry.java new file mode 100644 index 000000000..b07a3a138 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntry.java @@ -0,0 +1,189 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; + +@JacksonXmlRootElement(namespace = "Data") +public class JobEntry { + + // Variables + @JsonProperty("BlobId") + private UUID blobId; + + @JsonProperty("BlobStoreState") + private JobChunkBlobStoreState blobStoreState; + + @JsonProperty("ChunkId") + private UUID chunkId; + + @JsonProperty("ChunkNumber") + private int chunkNumber; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("JobId") + private UUID jobId; + + @JsonProperty("NodeId") + private UUID nodeId; + + @JsonProperty("PendingTargetCommit") + private boolean pendingTargetCommit; + + @JsonProperty("ReadFromAzureTargetId") + private UUID readFromAzureTargetId; + + @JsonProperty("ReadFromDs3TargetId") + private UUID readFromDs3TargetId; + + @JsonProperty("ReadFromPoolId") + private UUID readFromPoolId; + + @JsonProperty("ReadFromS3TargetId") + private UUID readFromS3TargetId; + + @JsonProperty("ReadFromTapeId") + private UUID readFromTapeId; + + // Constructor + public JobEntry() { + //pass + } + + // Getters and Setters + + public UUID getBlobId() { + return this.blobId; + } + + public void setBlobId(final UUID blobId) { + this.blobId = blobId; + } + + + public JobChunkBlobStoreState getBlobStoreState() { + return this.blobStoreState; + } + + public void setBlobStoreState(final JobChunkBlobStoreState blobStoreState) { + this.blobStoreState = blobStoreState; + } + + + public UUID getChunkId() { + return this.chunkId; + } + + public void setChunkId(final UUID chunkId) { + this.chunkId = chunkId; + } + + + public int getChunkNumber() { + return this.chunkNumber; + } + + public void setChunkNumber(final int chunkNumber) { + this.chunkNumber = chunkNumber; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public UUID getJobId() { + return this.jobId; + } + + public void setJobId(final UUID jobId) { + this.jobId = jobId; + } + + + public UUID getNodeId() { + return this.nodeId; + } + + public void setNodeId(final UUID nodeId) { + this.nodeId = nodeId; + } + + + public boolean getPendingTargetCommit() { + return this.pendingTargetCommit; + } + + public void setPendingTargetCommit(final boolean pendingTargetCommit) { + this.pendingTargetCommit = pendingTargetCommit; + } + + + public UUID getReadFromAzureTargetId() { + return this.readFromAzureTargetId; + } + + public void setReadFromAzureTargetId(final UUID readFromAzureTargetId) { + this.readFromAzureTargetId = readFromAzureTargetId; + } + + + public UUID getReadFromDs3TargetId() { + return this.readFromDs3TargetId; + } + + public void setReadFromDs3TargetId(final UUID readFromDs3TargetId) { + this.readFromDs3TargetId = readFromDs3TargetId; + } + + + public UUID getReadFromPoolId() { + return this.readFromPoolId; + } + + public void setReadFromPoolId(final UUID readFromPoolId) { + this.readFromPoolId = readFromPoolId; + } + + + public UUID getReadFromS3TargetId() { + return this.readFromS3TargetId; + } + + public void setReadFromS3TargetId(final UUID readFromS3TargetId) { + this.readFromS3TargetId = readFromS3TargetId; + } + + + public UUID getReadFromTapeId() { + return this.readFromTapeId; + } + + public void setReadFromTapeId(final UUID readFromTapeId) { + this.readFromTapeId = readFromTapeId; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntryList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntryList.java new file mode 100644 index 000000000..0d9167c9b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobEntryList.java @@ -0,0 +1,48 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class JobEntryList { + + // Variables + @JsonProperty("JobEntry") + @JacksonXmlElementWrapper(useWrapping = false) + private List jobEntries = new ArrayList<>(); + + // Constructor + public JobEntryList() { + //pass + } + + // Getters and Setters + + public List getJobEntries() { + return this.jobEntries; + } + + public void setJobEntries(final List jobEntries) { + this.jobEntries = jobEntries; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobList.java index e873c19d7..8b4b0daef 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobNode.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobNode.java index 6e21b0c76..db3d44fb1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobNode.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobNode.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,9 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import java.lang.Integer; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobRequestType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobRequestType.java index b8a479c72..f0ba99063 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobRequestType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobRequestType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobStatus.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobStatus.java index 80a17fcb5..964f7eb50 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobStatus.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobStatus.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobSummaryApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobSummaryApiBean.java new file mode 100644 index 000000000..2ea1ffd08 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/JobSummaryApiBean.java @@ -0,0 +1,269 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import java.lang.Boolean; +import java.util.UUID; +import java.util.Date; + +@JacksonXmlRootElement(namespace = "JobSummary") +public class JobSummaryApiBean { + + // Variables + @JacksonXmlProperty(isAttribute = true, localName = "Aggregating") + private boolean aggregating; + + @JacksonXmlProperty(isAttribute = true, localName = "BucketName") + private String bucketName; + + @JacksonXmlProperty(isAttribute = true, localName = "CachedSizeInBytes") + private long cachedSizeInBytes; + + @JacksonXmlProperty(isAttribute = true, localName = "ChunkClientProcessingOrderGuarantee") + private JobChunkClientProcessingOrderGuarantee chunkClientProcessingOrderGuarantee; + + @JacksonXmlProperty(isAttribute = true, localName = "CompletedSizeInBytes") + private long completedSizeInBytes; + + @JsonProperty("DestinationSummaries") + @JacksonXmlElementWrapper(useWrapping = true) + private List destinationSummaries = new ArrayList<>(); + + @JacksonXmlProperty(isAttribute = true, localName = "EntirelyInCache") + private Boolean entirelyInCache; + + @JacksonXmlProperty(isAttribute = true, localName = "JobId") + private UUID jobId; + + @JacksonXmlProperty(isAttribute = true, localName = "Naked") + private boolean naked; + + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; + + @JsonProperty("Nodes") + @JacksonXmlElementWrapper(useWrapping = true) + private List nodes = new ArrayList<>(); + + @JacksonXmlProperty(isAttribute = true, localName = "OriginalSizeInBytes") + private long originalSizeInBytes; + + @JacksonXmlProperty(isAttribute = true, localName = "Priority") + private Priority priority; + + @JacksonXmlProperty(isAttribute = true, localName = "RequestType") + private JobRequestType requestType; + + @JacksonXmlProperty(isAttribute = true, localName = "StartDate") + private Date startDate; + + @JacksonXmlProperty(isAttribute = true, localName = "Status") + private JobStatus status; + + @JsonProperty("Summary") + private String summary; + + @JacksonXmlProperty(isAttribute = true, localName = "UserId") + private UUID userId; + + @JacksonXmlProperty(isAttribute = true, localName = "UserName") + private String userName; + + // Constructor + public JobSummaryApiBean() { + //pass + } + + // Getters and Setters + + public boolean getAggregating() { + return this.aggregating; + } + + public void setAggregating(final boolean aggregating) { + this.aggregating = aggregating; + } + + + public String getBucketName() { + return this.bucketName; + } + + public void setBucketName(final String bucketName) { + this.bucketName = bucketName; + } + + + public long getCachedSizeInBytes() { + return this.cachedSizeInBytes; + } + + public void setCachedSizeInBytes(final long cachedSizeInBytes) { + this.cachedSizeInBytes = cachedSizeInBytes; + } + + + public JobChunkClientProcessingOrderGuarantee getChunkClientProcessingOrderGuarantee() { + return this.chunkClientProcessingOrderGuarantee; + } + + public void setChunkClientProcessingOrderGuarantee(final JobChunkClientProcessingOrderGuarantee chunkClientProcessingOrderGuarantee) { + this.chunkClientProcessingOrderGuarantee = chunkClientProcessingOrderGuarantee; + } + + + public long getCompletedSizeInBytes() { + return this.completedSizeInBytes; + } + + public void setCompletedSizeInBytes(final long completedSizeInBytes) { + this.completedSizeInBytes = completedSizeInBytes; + } + + + public List getDestinationSummaries() { + return this.destinationSummaries; + } + + public void setDestinationSummaries(final List destinationSummaries) { + this.destinationSummaries = destinationSummaries; + } + + + public Boolean getEntirelyInCache() { + return this.entirelyInCache; + } + + public void setEntirelyInCache(final Boolean entirelyInCache) { + this.entirelyInCache = entirelyInCache; + } + + + public UUID getJobId() { + return this.jobId; + } + + public void setJobId(final UUID jobId) { + this.jobId = jobId; + } + + + public boolean getNaked() { + return this.naked; + } + + public void setNaked(final boolean naked) { + this.naked = naked; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + + public List getNodes() { + return this.nodes; + } + + public void setNodes(final List nodes) { + this.nodes = nodes; + } + + + public long getOriginalSizeInBytes() { + return this.originalSizeInBytes; + } + + public void setOriginalSizeInBytes(final long originalSizeInBytes) { + this.originalSizeInBytes = originalSizeInBytes; + } + + + public Priority getPriority() { + return this.priority; + } + + public void setPriority(final Priority priority) { + this.priority = priority; + } + + + public JobRequestType getRequestType() { + return this.requestType; + } + + public void setRequestType(final JobRequestType requestType) { + this.requestType = requestType; + } + + + public Date getStartDate() { + return this.startDate; + } + + public void setStartDate(final Date startDate) { + this.startDate = startDate; + } + + + public JobStatus getStatus() { + return this.status; + } + + public void setStatus(final JobStatus status) { + this.status = status; + } + + + public String getSummary() { + return this.summary; + } + + public void setSummary(final String summary) { + this.summary = summary; + } + + + public UUID getUserId() { + return this.userId; + } + + public void setUserId(final UUID userId) { + this.userId = userId; + } + + + public String getUserName() { + return this.userName; + } + + public void setUserName(final String userName) { + this.userName = userName; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListAllMyBucketsResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListAllMyBucketsResult.java index 893fae37b..7f15834e5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListAllMyBucketsResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListAllMyBucketsResult.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListBucketResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListBucketResult.java index d74203176..4fcb8a3e4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListBucketResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListBucketResult.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,11 +18,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; +import java.util.Date; import java.util.List; import java.util.ArrayList; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import java.util.Date; import com.spectralogic.ds3client.models.common.CommonPrefixes; @JacksonXmlRootElement(namespace = "ListBucketResult") @@ -61,6 +60,10 @@ public class ListBucketResult { @JsonProperty("IsTruncated") private boolean truncated; + @JsonProperty("Version") + @JacksonXmlElementWrapper(useWrapping = false) + private List versionedObjects = new ArrayList<>(); + // Constructor public ListBucketResult() { //pass @@ -157,4 +160,13 @@ public void setTruncated(final boolean truncated) { this.truncated = truncated; } + + public List getVersionedObjects() { + return this.versionedObjects; + } + + public void setVersionedObjects(final List versionedObjects) { + this.versionedObjects = versionedObjects; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListMultiPartUploadsResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListMultiPartUploadsResult.java deleted file mode 100644 index 2dcd4a937..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListMultiPartUploadsResult.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.models; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -import java.util.List; -import java.util.ArrayList; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.spectralogic.ds3client.models.common.CommonPrefixes; - -@JacksonXmlRootElement(namespace = "ListMultipartUploadsResult") -public class ListMultiPartUploadsResult { - - // Variables - @JsonProperty("Bucket") - private String bucket; - - @JsonProperty("CommonPrefixes") - @JacksonXmlElementWrapper(useWrapping = false) - private List commonPrefixes = new ArrayList<>(); - - @JsonProperty("Delimiter") - private String delimiter; - - @JsonProperty("KeyMarker") - private String keyMarker; - - @JsonProperty("MaxUploads") - private int maxUploads; - - @JsonProperty("NextKeyMarker") - private String nextKeyMarker; - - @JsonProperty("NextUploadIdMarker") - private String nextUploadIdMarker; - - @JsonProperty("Prefix") - private String prefix; - - @JsonProperty("IsTruncated") - private boolean truncated; - - @JsonProperty("UploadIdMarker") - private String uploadIdMarker; - - @JsonProperty("Upload") - @JacksonXmlElementWrapper(useWrapping = false) - private List uploads = new ArrayList<>(); - - // Constructor - public ListMultiPartUploadsResult() { - //pass - } - - // Getters and Setters - - public String getBucket() { - return this.bucket; - } - - public void setBucket(final String bucket) { - this.bucket = bucket; - } - - - public List getCommonPrefixes() { - return this.commonPrefixes; - } - - public void setCommonPrefixes(final List commonPrefixes) { - this.commonPrefixes = commonPrefixes; - } - - - public String getDelimiter() { - return this.delimiter; - } - - public void setDelimiter(final String delimiter) { - this.delimiter = delimiter; - } - - - public String getKeyMarker() { - return this.keyMarker; - } - - public void setKeyMarker(final String keyMarker) { - this.keyMarker = keyMarker; - } - - - public int getMaxUploads() { - return this.maxUploads; - } - - public void setMaxUploads(final int maxUploads) { - this.maxUploads = maxUploads; - } - - - public String getNextKeyMarker() { - return this.nextKeyMarker; - } - - public void setNextKeyMarker(final String nextKeyMarker) { - this.nextKeyMarker = nextKeyMarker; - } - - - public String getNextUploadIdMarker() { - return this.nextUploadIdMarker; - } - - public void setNextUploadIdMarker(final String nextUploadIdMarker) { - this.nextUploadIdMarker = nextUploadIdMarker; - } - - - public String getPrefix() { - return this.prefix; - } - - public void setPrefix(final String prefix) { - this.prefix = prefix; - } - - - public boolean getTruncated() { - return this.truncated; - } - - public void setTruncated(final boolean truncated) { - this.truncated = truncated; - } - - - public String getUploadIdMarker() { - return this.uploadIdMarker; - } - - public void setUploadIdMarker(final String uploadIdMarker) { - this.uploadIdMarker = uploadIdMarker; - } - - - public List getUploads() { - return this.uploads; - } - - public void setUploads(final List uploads) { - this.uploads = uploads; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListPartsResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListPartsResult.java deleted file mode 100644 index 481bc03f3..000000000 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ListPartsResult.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -// This code is auto-generated, do not modify -package com.spectralogic.ds3client.models; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -import java.lang.Integer; -import java.util.List; -import java.util.ArrayList; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import java.util.UUID; - -@JacksonXmlRootElement(namespace = "ListPartsResult") -public class ListPartsResult { - - // Variables - @JsonProperty("Bucket") - private String bucket; - - @JsonProperty("Key") - private String key; - - @JsonProperty("MaxParts") - private int maxParts; - - @JsonProperty("NextPartNumberMarker") - private int nextPartNumberMarker; - - @JsonProperty("Owner") - private User owner; - - @JsonProperty("PartNumberMarker") - private Integer partNumberMarker; - - @JsonProperty("Part") - @JacksonXmlElementWrapper(useWrapping = false) - private List parts = new ArrayList<>(); - - @JsonProperty("IsTruncated") - private boolean truncated; - - @JsonProperty("UploadId") - private UUID uploadId; - - // Constructor - public ListPartsResult() { - //pass - } - - // Getters and Setters - - public String getBucket() { - return this.bucket; - } - - public void setBucket(final String bucket) { - this.bucket = bucket; - } - - - public String getKey() { - return this.key; - } - - public void setKey(final String key) { - this.key = key; - } - - - public int getMaxParts() { - return this.maxParts; - } - - public void setMaxParts(final int maxParts) { - this.maxParts = maxParts; - } - - - public int getNextPartNumberMarker() { - return this.nextPartNumberMarker; - } - - public void setNextPartNumberMarker(final int nextPartNumberMarker) { - this.nextPartNumberMarker = nextPartNumberMarker; - } - - - public User getOwner() { - return this.owner; - } - - public void setOwner(final User owner) { - this.owner = owner; - } - - - public Integer getPartNumberMarker() { - return this.partNumberMarker; - } - - public void setPartNumberMarker(final Integer partNumberMarker) { - this.partNumberMarker = partNumberMarker; - } - - - public List getParts() { - return this.parts; - } - - public void setParts(final List parts) { - this.parts = parts; - } - - - public boolean getTruncated() { - return this.truncated; - } - - public void setTruncated(final boolean truncated) { - this.truncated = truncated; - } - - - public UUID getUploadId() { - return this.uploadId; - } - - public void setUploadId(final UUID uploadId) { - this.uploadId = uploadId; - } - -} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/LtfsFileNamingMode.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/LtfsFileNamingMode.java index 3e1fd6860..e324aa39d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/LtfsFileNamingMode.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/LtfsFileNamingMode.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MasterObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MasterObjectList.java index 42c2bde32..6fd3e4d48 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MasterObjectList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MasterObjectList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import java.lang.String; +import java.lang.Boolean; import java.util.UUID; import java.util.List; import java.util.ArrayList; @@ -46,7 +46,7 @@ public class MasterObjectList { private long completedSizeInBytes; @JacksonXmlProperty(isAttribute = true, localName = "EntirelyInCache") - private boolean entirelyInCache; + private Boolean entirelyInCache; @JacksonXmlProperty(isAttribute = true, localName = "JobId") private UUID jobId; @@ -138,11 +138,11 @@ public void setCompletedSizeInBytes(final long completedSizeInBytes) { } - public boolean getEntirelyInCache() { + public Boolean getEntirelyInCache() { return this.entirelyInCache; } - public void setEntirelyInCache(final boolean entirelyInCache) { + public void setEntirelyInCache(final Boolean entirelyInCache) { this.entirelyInCache = entirelyInCache; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartition.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartition.java index ad8f7a470..64cec4f7d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartition.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartition.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,13 +21,24 @@ import java.util.List; import java.util.ArrayList; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "TapePartition") public class NamedDetailedTapePartition { // Variables + @JsonProperty("AutoCompactionEnabled") + private boolean autoCompactionEnabled; + + @JsonProperty("AutoQuiesceEnabled") + private boolean autoQuiesceEnabled; + + @JsonProperty("AvailableStorageCapacity") + private long availableStorageCapacity; + + @JsonProperty("DriveIdleTimeoutInMinutes") + private Integer driveIdleTimeoutInMinutes; + @JsonProperty("DriveType") private TapeDriveType driveType; @@ -47,6 +58,12 @@ public class NamedDetailedTapePartition { @JsonProperty("LibraryId") private UUID libraryId; + @JsonProperty("MinimumReadReservedDrives") + private int minimumReadReservedDrives; + + @JsonProperty("MinimumWriteReservedDrives") + private int minimumWriteReservedDrives; + @JsonProperty("Name") private String name; @@ -59,9 +76,26 @@ public class NamedDetailedTapePartition { @JsonProperty("State") private TapePartitionState state; + @JsonProperty("TapeCount") + private int tapeCount; + + @JsonProperty("TapeStateSummaries") + @JacksonXmlElementWrapper(useWrapping = true) + private List tapeStateSummaries = new ArrayList<>(); + + @JsonProperty("TapeTypeSummaries") + @JacksonXmlElementWrapper(useWrapping = true) + private List tapeTypeSummaries = new ArrayList<>(); + @JsonProperty("TapeTypes") @JacksonXmlElementWrapper(useWrapping = false) - private List tapeTypes = new ArrayList<>(); + private List tapeTypes = new ArrayList<>(); + + @JsonProperty("TotalStorageCapacity") + private long totalStorageCapacity; + + @JsonProperty("UsedStorageCapacity") + private long usedStorageCapacity; // Constructor public NamedDetailedTapePartition() { @@ -70,6 +104,42 @@ public NamedDetailedTapePartition() { // Getters and Setters + public boolean getAutoCompactionEnabled() { + return this.autoCompactionEnabled; + } + + public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) { + this.autoCompactionEnabled = autoCompactionEnabled; + } + + + public boolean getAutoQuiesceEnabled() { + return this.autoQuiesceEnabled; + } + + public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) { + this.autoQuiesceEnabled = autoQuiesceEnabled; + } + + + public long getAvailableStorageCapacity() { + return this.availableStorageCapacity; + } + + public void setAvailableStorageCapacity(final long availableStorageCapacity) { + this.availableStorageCapacity = availableStorageCapacity; + } + + + public Integer getDriveIdleTimeoutInMinutes() { + return this.driveIdleTimeoutInMinutes; + } + + public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) { + this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes; + } + + public TapeDriveType getDriveType() { return this.driveType; } @@ -124,6 +194,24 @@ public void setLibraryId(final UUID libraryId) { } + public int getMinimumReadReservedDrives() { + return this.minimumReadReservedDrives; + } + + public void setMinimumReadReservedDrives(final int minimumReadReservedDrives) { + this.minimumReadReservedDrives = minimumReadReservedDrives; + } + + + public int getMinimumWriteReservedDrives() { + return this.minimumWriteReservedDrives; + } + + public void setMinimumWriteReservedDrives(final int minimumWriteReservedDrives) { + this.minimumWriteReservedDrives = minimumWriteReservedDrives; + } + + public String getName() { return this.name; } @@ -160,12 +248,57 @@ public void setState(final TapePartitionState state) { } - public List getTapeTypes() { + public int getTapeCount() { + return this.tapeCount; + } + + public void setTapeCount(final int tapeCount) { + this.tapeCount = tapeCount; + } + + + public List getTapeStateSummaries() { + return this.tapeStateSummaries; + } + + public void setTapeStateSummaries(final List tapeStateSummaries) { + this.tapeStateSummaries = tapeStateSummaries; + } + + + public List getTapeTypeSummaries() { + return this.tapeTypeSummaries; + } + + public void setTapeTypeSummaries(final List tapeTypeSummaries) { + this.tapeTypeSummaries = tapeTypeSummaries; + } + + + public List getTapeTypes() { return this.tapeTypes; } - public void setTapeTypes(final List tapeTypes) { + public void setTapeTypes(final List tapeTypes) { this.tapeTypes = tapeTypes; } + + public long getTotalStorageCapacity() { + return this.totalStorageCapacity; + } + + public void setTotalStorageCapacity(final long totalStorageCapacity) { + this.totalStorageCapacity = totalStorageCapacity; + } + + + public long getUsedStorageCapacity() { + return this.usedStorageCapacity; + } + + public void setUsedStorageCapacity(final long usedStorageCapacity) { + this.usedStorageCapacity = usedStorageCapacity; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartitionList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartitionList.java index 16e6bef5d..2105a4221 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartitionList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamedDetailedTapePartitionList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamingConventionType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamingConventionType.java index b3cc9f6a9..2b788789a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamingConventionType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NamingConventionType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Node.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Node.java index 9320b4b67..b0d8e37b0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Node.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Node.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Integer; -import java.lang.String; import java.util.UUID; import java.util.Date; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NodeList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NodeList.java index b3447cdc1..22acae571 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NodeList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/NodeList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Objects.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Objects.java index c13930b02..4dbe35b53 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Objects.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Objects.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PhysicalPlacement.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PhysicalPlacement.java index ada4a286b..a9bddda03 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PhysicalPlacement.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PhysicalPlacement.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Pool.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Pool.java index fe7a29b60..57d3ad5df 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Pool.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Pool.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; import java.util.Date; @JacksonXmlRootElement(namespace = "Data") @@ -74,8 +73,8 @@ public class Pool { @JsonProperty("State") private PoolState state; - @JsonProperty("StorageDomainId") - private UUID storageDomainId; + @JsonProperty("StorageDomainMemberId") + private UUID storageDomainMemberId; @JsonProperty("TotalCapacity") private long totalCapacity; @@ -237,12 +236,12 @@ public void setState(final PoolState state) { } - public UUID getStorageDomainId() { - return this.storageDomainId; + public UUID getStorageDomainMemberId() { + return this.storageDomainMemberId; } - public void setStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId; + public void setStorageDomainMemberId(final UUID storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailure.java index 31e05bc8d..fbc80fcba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureList.java index 8d9e3d607..8e56c5f87 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistration.java index b7b9a3d4c..211d624f8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class PoolFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistrationList.java index 553a0e6bc..90b58c7ba 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureType.java index 5f7a87d81..581a113c5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -22,6 +22,7 @@ public enum PoolFailureType { DATA_CHECKPOINT_MISSING, FORMAT_FAILED, IMPORT_FAILED, + IMPORT_INCOMPLETE, IMPORT_FAILED_DUE_TO_TAKE_OWNERSHIP_FAILURE, IMPORT_FAILED_DUE_TO_DATA_INTEGRITY, INSPECT_FAILED, diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolHealth.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolHealth.java index bb862732b..e380b0462 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolHealth.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolHealth.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolList.java index e07a27620..ea10a2e47 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartition.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartition.java index 26537b4f0..b5d43a581 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartition.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartition.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class PoolPartition { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUpload.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionApiBean.java similarity index 53% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUpload.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionApiBean.java index 78d94c508..cb1147dc6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/MultiPartUpload.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionApiBean.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,66 +18,65 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.util.Date; -import java.lang.String; import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; @JacksonXmlRootElement(namespace = "Data") -public class MultiPartUpload { +public class PoolPartitionApiBean { // Variables - @JsonProperty("Initiated") - private Date initiated; + @JsonProperty("Id") + private UUID id; - @JsonProperty("Key") - private String key; + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; - @JsonProperty("Owner") - private User owner; + @JsonProperty("PoolCount") + private int poolCount; - @JsonProperty("UploadId") - private UUID uploadId; + @JsonProperty("Type") + private PoolType type; // Constructor - public MultiPartUpload() { + public PoolPartitionApiBean() { //pass } // Getters and Setters - public Date getInitiated() { - return this.initiated; + public UUID getId() { + return this.id; } - public void setInitiated(final Date initiated) { - this.initiated = initiated; + public void setId(final UUID id) { + this.id = id; } - public String getKey() { - return this.key; + public String getName() { + return this.name; } - public void setKey(final String key) { - this.key = key; + public void setName(final String name) { + this.name = name; } - public User getOwner() { - return this.owner; + public int getPoolCount() { + return this.poolCount; } - public void setOwner(final User owner) { - this.owner = owner; + public void setPoolCount(final int poolCount) { + this.poolCount = poolCount; } - public UUID getUploadId() { - return this.uploadId; + public PoolType getType() { + return this.type; } - public void setUploadId(final UUID uploadId) { - this.uploadId = uploadId; + public void setType(final PoolType type) { + this.type = type; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionList.java index 2d43a0ba5..9abd7cce5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolPartitionList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolState.java index 766bfa2b9..c13527861 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolType.java index 968c967f2..bbe306771 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/PoolType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Priority.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Priority.java index feaaf6684..ced11b836 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Priority.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Priority.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Quiesced.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Quiesced.java index 076ff1cdd..7299a856c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Quiesced.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Quiesced.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RequestType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RequestType.java index cb8e8552e..a7d3eb31f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RequestType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RequestType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ReservedTaskType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ReservedTaskType.java new file mode 100644 index 000000000..2e1779fd1 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/ReservedTaskType.java @@ -0,0 +1,24 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +public enum ReservedTaskType { + ANY, + MAINTENANCE, + READ, + WRITE +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RestOperationType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RestOperationType.java index 9f951979b..2ac1efca8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RestOperationType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/RestOperationType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -22,21 +22,26 @@ public enum RestOperationType { CANCEL_FORMAT, CANCEL_IMPORT, CANCEL_ONLINE, + CANCEL_TEST, CANCEL_VERIFY, CLEAN, COMPACT, DEALLOCATE, + DUMP, EJECT, FORMAT, GET_PHYSICAL_PLACEMENT, IMPORT, INSPECT, + MARK_FOR_COMPACTION, ONLINE, PAIR_BACK, REGENERATE_SECRET_KEY, START_BULK_GET, START_BULK_PUT, + START_BULK_STAGE, START_BULK_VERIFY, + TEST, VERIFY, VERIFY_SAFE_TO_START_BULK_PUT, VERIFY_PHYSICAL_PLACEMENT diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRule.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRule.java index 5198a07da..33b1cc27b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRule.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRule.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRuleList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRuleList.java index febd57477..dbb81c8fb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRuleList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3DataReplicationRuleList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3InitialDataPlacementPolicy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3InitialDataPlacementPolicy.java index f704acf0c..2b41f850a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3InitialDataPlacementPolicy.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3InitialDataPlacementPolicy.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,5 +20,6 @@ public enum S3InitialDataPlacementPolicy { STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, - GLACIER + GLACIER, + DEEP_ARCHIVE } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Object.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Object.java index 6de63d90b..9af2f63a9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Object.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Object.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,7 +21,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; import java.util.Date; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class S3Object { @@ -45,9 +44,6 @@ public class S3Object { @JsonProperty("Type") private S3ObjectType type; - @JsonProperty("Version") - private long version; - // Constructor public S3Object() { //pass @@ -109,18 +105,9 @@ public void setType(final S3ObjectType type) { } - public long getVersion() { - return this.version; - } - - public void setVersion(final long version) { - this.version = version; - } - - @Override public int hashCode() { - return Objects.hash(bucketId, name, id, latest, creationDate, type, version); + return Objects.hash(bucketId, name, id, latest, creationDate, type); } @Override @@ -136,7 +123,6 @@ public boolean equals(final Object obj) { && this.id.equals(s3obj.getId()) && this.latest == s3obj.getLatest() && this.name.equals(s3obj.getName()) - && this.type == s3obj.getType() - && this.version == s3obj.getVersion(); + && this.type == s3obj.getType(); } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistration.java index f94ca3adc..dd1017fd1 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class S3ObjectCachedNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistrationList.java index ff91c5cbf..5e03d6317 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectCachedNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectList.java index 7ad03981e..c48c0e9a2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistration.java index b3beee4c5..f7495f094 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class S3ObjectLostNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistrationList.java index 76305bb18..b8525d214 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectLostNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistration.java index 6894c1066..85a985036 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class S3ObjectPersistedNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistrationList.java index 96837d2a4..06c892453 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectPersistedNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectToDelete.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectToDelete.java index b4621e603..cf2e30b06 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectToDelete.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectToDelete.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; +import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") public class S3ObjectToDelete { @@ -27,6 +27,9 @@ public class S3ObjectToDelete { @JsonProperty("Key") private String key; + @JsonProperty("VersionId") + private UUID versionId; + // Constructor public S3ObjectToDelete() { //pass @@ -42,4 +45,13 @@ public void setKey(final String key) { this.key = key; } + + public UUID getVersionId() { + return this.versionId; + } + + public void setVersionId(final UUID versionId) { + this.versionId = versionId; + } + } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectType.java index 077ec222d..9c34f434e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3ObjectType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Region.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Region.java index 7c5c9d0f3..68d90c245 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Region.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Region.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,9 +19,11 @@ public enum S3Region { GOV_CLOUD, US_EAST_1, + US_EAST_2, US_WEST_1, US_WEST_2, EU_WEST_1, + EU_WEST_2, EU_CENTRAL_1, AP_SOUTH_1, AP_SOUTHEAST_1, @@ -29,5 +31,6 @@ public enum S3Region { AP_NORTHEAST_1, AP_NORTHEAST_2, SA_EAST_1, - CN_NORTH_1 + CN_NORTH_1, + CA_CENTRAL_1 } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Target.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Target.java index c2519b706..e6500bc5f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Target.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3Target.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -import java.lang.Integer; import java.util.UUID; import java.util.Date; @@ -57,6 +55,9 @@ public class S3Target { @JsonProperty("Name") private String name; + @JsonProperty("NamingMode") + private CloudNamingMode namingMode; + @JsonProperty("OfflineDataStagingWindowInTb") private int offlineDataStagingWindowInTb; @@ -84,6 +85,9 @@ public class S3Target { @JsonProperty("Region") private S3Region region; + @JsonProperty("RestrictedAccess") + private boolean restrictedAccess; + @JsonProperty("SecretKey") private String secretKey; @@ -190,6 +194,15 @@ public void setName(final String name) { } + public CloudNamingMode getNamingMode() { + return this.namingMode; + } + + public void setNamingMode(final CloudNamingMode namingMode) { + this.namingMode = namingMode; + } + + public int getOfflineDataStagingWindowInTb() { return this.offlineDataStagingWindowInTb; } @@ -271,6 +284,15 @@ public void setRegion(final S3Region region) { } + public boolean getRestrictedAccess() { + return this.restrictedAccess; + } + + public void setRestrictedAccess(final boolean restrictedAccess) { + this.restrictedAccess = restrictedAccess; + } + + public String getSecretKey() { return this.secretKey; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketName.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketName.java index 97e633c49..46e260a93 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketName.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketName.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class S3TargetBucketName { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketNameList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketNameList.java index f66ead64c..ce6f648cd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketNameList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetBucketNameList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailure.java index 7d3601597..a708e31b9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureList.java index 2a0b2fa1f..4828b0446 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistration.java index 27ffaac6d..e329bfb1d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class S3TargetFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistrationList.java index 6cf16bbdd..7d01d042e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetList.java index e3206f9f8..b86fc303b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreference.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreference.java index 9564be357..34b921b07 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreference.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreference.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreferenceList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreferenceList.java index 25e5b0cbb..a7cf1acbe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreferenceList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/S3TargetReadPreferenceList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUser.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUser.java index eb238b089..85d37d02b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUser.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUser.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") @@ -34,6 +33,9 @@ public class SpectraUser { @JsonProperty("Id") private UUID id; + @JsonProperty("MaxBuckets") + private int maxBuckets; + @JsonProperty("Name") private String name; @@ -74,6 +76,15 @@ public void setId(final UUID id) { } + public int getMaxBuckets() { + return this.maxBuckets; + } + + public void setMaxBuckets(final int maxBuckets) { + this.maxBuckets = maxBuckets; + } + + public String getName() { return this.name; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUserList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUserList.java index 9b63e45aa..f1890c076 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUserList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SpectraUserList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomain.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomain.java index c11ac5384..bb27a816e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomain.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomain.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,10 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Long; -import java.lang.String; import java.util.UUID; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class StorageDomain { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainApiBean.java new file mode 100644 index 000000000..66094a4ee --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainApiBean.java @@ -0,0 +1,218 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "Data") +public class StorageDomainApiBean { + + // Variables + @JsonProperty("AutoEjectMediaFullThreshold") + private Long autoEjectMediaFullThreshold; + + @JsonProperty("AutoEjectUponCron") + private String autoEjectUponCron; + + @JsonProperty("AutoEjectUponJobCancellation") + private boolean autoEjectUponJobCancellation; + + @JsonProperty("AutoEjectUponJobCompletion") + private boolean autoEjectUponJobCompletion; + + @JsonProperty("AutoEjectUponMediaFull") + private boolean autoEjectUponMediaFull; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("LtfsFileNaming") + private LtfsFileNamingMode ltfsFileNaming; + + @JsonProperty("MaxTapeFragmentationPercent") + private int maxTapeFragmentationPercent; + + @JsonProperty("MaximumAutoVerificationFrequencyInDays") + private Integer maximumAutoVerificationFrequencyInDays; + + @JsonProperty("MediaEjectionAllowed") + private boolean mediaEjectionAllowed; + + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; + + @JsonProperty("SecureMediaAllocation") + private boolean secureMediaAllocation; + + @JsonProperty("StorageDomainMembers") + @JacksonXmlElementWrapper(useWrapping = true) + private List storageDomainMembers = new ArrayList<>(); + + @JsonProperty("VerifyPriorToAutoEject") + private Priority verifyPriorToAutoEject; + + @JsonProperty("WriteOptimization") + private WriteOptimization writeOptimization; + + // Constructor + public StorageDomainApiBean() { + //pass + } + + // Getters and Setters + + public Long getAutoEjectMediaFullThreshold() { + return this.autoEjectMediaFullThreshold; + } + + public void setAutoEjectMediaFullThreshold(final Long autoEjectMediaFullThreshold) { + this.autoEjectMediaFullThreshold = autoEjectMediaFullThreshold; + } + + + public String getAutoEjectUponCron() { + return this.autoEjectUponCron; + } + + public void setAutoEjectUponCron(final String autoEjectUponCron) { + this.autoEjectUponCron = autoEjectUponCron; + } + + + public boolean getAutoEjectUponJobCancellation() { + return this.autoEjectUponJobCancellation; + } + + public void setAutoEjectUponJobCancellation(final boolean autoEjectUponJobCancellation) { + this.autoEjectUponJobCancellation = autoEjectUponJobCancellation; + } + + + public boolean getAutoEjectUponJobCompletion() { + return this.autoEjectUponJobCompletion; + } + + public void setAutoEjectUponJobCompletion(final boolean autoEjectUponJobCompletion) { + this.autoEjectUponJobCompletion = autoEjectUponJobCompletion; + } + + + public boolean getAutoEjectUponMediaFull() { + return this.autoEjectUponMediaFull; + } + + public void setAutoEjectUponMediaFull(final boolean autoEjectUponMediaFull) { + this.autoEjectUponMediaFull = autoEjectUponMediaFull; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public LtfsFileNamingMode getLtfsFileNaming() { + return this.ltfsFileNaming; + } + + public void setLtfsFileNaming(final LtfsFileNamingMode ltfsFileNaming) { + this.ltfsFileNaming = ltfsFileNaming; + } + + + public int getMaxTapeFragmentationPercent() { + return this.maxTapeFragmentationPercent; + } + + public void setMaxTapeFragmentationPercent(final int maxTapeFragmentationPercent) { + this.maxTapeFragmentationPercent = maxTapeFragmentationPercent; + } + + + public Integer getMaximumAutoVerificationFrequencyInDays() { + return this.maximumAutoVerificationFrequencyInDays; + } + + public void setMaximumAutoVerificationFrequencyInDays(final Integer maximumAutoVerificationFrequencyInDays) { + this.maximumAutoVerificationFrequencyInDays = maximumAutoVerificationFrequencyInDays; + } + + + public boolean getMediaEjectionAllowed() { + return this.mediaEjectionAllowed; + } + + public void setMediaEjectionAllowed(final boolean mediaEjectionAllowed) { + this.mediaEjectionAllowed = mediaEjectionAllowed; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + + public boolean getSecureMediaAllocation() { + return this.secureMediaAllocation; + } + + public void setSecureMediaAllocation(final boolean secureMediaAllocation) { + this.secureMediaAllocation = secureMediaAllocation; + } + + + public List getStorageDomainMembers() { + return this.storageDomainMembers; + } + + public void setStorageDomainMembers(final List storageDomainMembers) { + this.storageDomainMembers = storageDomainMembers; + } + + + public Priority getVerifyPriorToAutoEject() { + return this.verifyPriorToAutoEject; + } + + public void setVerifyPriorToAutoEject(final Priority verifyPriorToAutoEject) { + this.verifyPriorToAutoEject = verifyPriorToAutoEject; + } + + + public WriteOptimization getWriteOptimization() { + return this.writeOptimization; + } + + public void setWriteOptimization(final WriteOptimization writeOptimization) { + this.writeOptimization = writeOptimization; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainCapacitySummary.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainCapacitySummary.java index 8e5772175..ed20b1d5f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainCapacitySummary.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainCapacitySummary.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailure.java index c8ccabf56..de6811581 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureList.java index bc114d935..9a707f69d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistration.java index c4819a161..93b4388ce 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class StorageDomainFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistrationList.java index 2d3857d80..6f92bd7f2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureType.java index 7254027e2..a7c816373 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainList.java index d9c3f01d1..9a7df1597 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMember.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMember.java index 432233560..b4021f2d4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMember.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMember.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -24,6 +24,9 @@ public class StorageDomainMember { // Variables + @JsonProperty("AutoCompactionThreshold") + private Integer autoCompactionThreshold; + @JsonProperty("Id") private UUID id; @@ -40,7 +43,7 @@ public class StorageDomainMember { private UUID tapePartitionId; @JsonProperty("TapeType") - private TapeType tapeType; + private String tapeType; @JsonProperty("WritePreference") private WritePreferenceLevel writePreference; @@ -52,6 +55,15 @@ public StorageDomainMember() { // Getters and Setters + public Integer getAutoCompactionThreshold() { + return this.autoCompactionThreshold; + } + + public void setAutoCompactionThreshold(final Integer autoCompactionThreshold) { + this.autoCompactionThreshold = autoCompactionThreshold; + } + + public UUID getId() { return this.id; } @@ -97,11 +109,11 @@ public void setTapePartitionId(final UUID tapePartitionId) { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } - public void setTapeType(final TapeType tapeType) { + public void setTapeType(final String tapeType) { this.tapeType = tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberApiBean.java new file mode 100644 index 000000000..0cbe14a0c --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberApiBean.java @@ -0,0 +1,130 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class StorageDomainMemberApiBean { + + // Variables + @JsonProperty("AutoCompactionThreshold") + private Integer autoCompactionThreshold; + + @JsonProperty("Id") + private UUID id; + + @JacksonXmlProperty(isAttribute = true, localName = "PartitionName") + private String partitionName; + + @JsonProperty("PoolPartitionId") + private UUID poolPartitionId; + + @JsonProperty("State") + private StorageDomainMemberState state; + + @JsonProperty("TapePartitionId") + private UUID tapePartitionId; + + @JacksonXmlProperty(isAttribute = true, localName = "TapeType") + private String tapeType; + + @JsonProperty("WritePreference") + private WritePreferenceLevel writePreference; + + // Constructor + public StorageDomainMemberApiBean() { + //pass + } + + // Getters and Setters + + public Integer getAutoCompactionThreshold() { + return this.autoCompactionThreshold; + } + + public void setAutoCompactionThreshold(final Integer autoCompactionThreshold) { + this.autoCompactionThreshold = autoCompactionThreshold; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public String getPartitionName() { + return this.partitionName; + } + + public void setPartitionName(final String partitionName) { + this.partitionName = partitionName; + } + + + public UUID getPoolPartitionId() { + return this.poolPartitionId; + } + + public void setPoolPartitionId(final UUID poolPartitionId) { + this.poolPartitionId = poolPartitionId; + } + + + public StorageDomainMemberState getState() { + return this.state; + } + + public void setState(final StorageDomainMemberState state) { + this.state = state; + } + + + public UUID getTapePartitionId() { + return this.tapePartitionId; + } + + public void setTapePartitionId(final UUID tapePartitionId) { + this.tapePartitionId = tapePartitionId; + } + + + public String getTapeType() { + return this.tapeType; + } + + public void setTapeType(final String tapeType) { + this.tapeType = tapeType; + } + + + public WritePreferenceLevel getWritePreference() { + return this.writePreference; + } + + public void setWritePreference(final WritePreferenceLevel writePreference) { + this.writePreference = writePreference; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberList.java index 48eabbdd1..010738647 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberState.java index d17549370..88da39c5f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/StorageDomainMemberState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTarget.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTarget.java index def8f9389..765faffda 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTarget.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTarget.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTargetList.java index c28d4004a..ccb8aeaae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobAzureTargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3Target.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3Target.java index ea721d1c5..aba2a8d4b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3Target.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3Target.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3TargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3TargetList.java index 9996d1ead..02b6a4d7c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3TargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobDs3TargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPool.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPool.java index 4a304e644..50fc2c9fe 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPool.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPool.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPoolList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPoolList.java index 5d976d052..a39f24cac 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPoolList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobPoolList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3Target.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3Target.java index 79b3e14d6..dafe99717 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3Target.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3Target.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3TargetList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3TargetList.java index 2d4af175f..ae3d3c727 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3TargetList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobS3TargetList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTape.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTape.java index 1f628d2ba..073a2121d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTape.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTape.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTapeList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTapeList.java index 641d66941..f6c7d2f82 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTapeList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SuspectBlobTapeList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailure.java index 569b5cb3c..8f615b1b8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureList.java index 32f7c51ac..e222aaea2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistration.java index 7a5d02f58..d0d6898fb 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class SystemFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistrationList.java index 8fb3aae7b..3e375adb4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureType.java index 3b267164f..f0f793d20 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemInformation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemInformation.java index f516a01a6..b3114e8bc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemInformation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/SystemInformation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Tape.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Tape.java index 7c74e8f93..e3380667a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Tape.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/Tape.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,8 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.Long; -import java.lang.String; import java.util.UUID; import java.util.Date; @@ -27,6 +25,9 @@ public class Tape { // Variables + @JsonProperty("AllowRollback") + private boolean allowRollback; + @JsonProperty("AssignedToStorageDomain") private boolean assignedToStorageDomain; @@ -39,6 +40,9 @@ public class Tape { @JsonProperty("BucketId") private UUID bucketId; + @JsonProperty("CharacterizationVer") + private String characterizationVer; + @JsonProperty("DescriptionForIdentification") private String descriptionForIdentification; @@ -81,14 +85,17 @@ public class Tape { @JsonProperty("PreviousState") private TapeState previousState; + @JsonProperty("Role") + private TapeRole role; + @JsonProperty("SerialNumber") private String serialNumber; @JsonProperty("State") private TapeState state; - @JsonProperty("StorageDomainId") - private UUID storageDomainId; + @JsonProperty("StorageDomainMemberId") + private UUID storageDomainMemberId; @JsonProperty("TakeOwnershipPending") private boolean takeOwnershipPending; @@ -97,7 +104,7 @@ public class Tape { private Long totalRawCapacity; @JsonProperty("Type") - private TapeType type; + private String type; @JsonProperty("VerifyPending") private Priority verifyPending; @@ -112,6 +119,15 @@ public Tape() { // Getters and Setters + public boolean getAllowRollback() { + return this.allowRollback; + } + + public void setAllowRollback(final boolean allowRollback) { + this.allowRollback = allowRollback; + } + + public boolean getAssignedToStorageDomain() { return this.assignedToStorageDomain; } @@ -148,6 +164,15 @@ public void setBucketId(final UUID bucketId) { } + public String getCharacterizationVer() { + return this.characterizationVer; + } + + public void setCharacterizationVer(final String characterizationVer) { + this.characterizationVer = characterizationVer; + } + + public String getDescriptionForIdentification() { return this.descriptionForIdentification; } @@ -274,6 +299,15 @@ public void setPreviousState(final TapeState previousState) { } + public TapeRole getRole() { + return this.role; + } + + public void setRole(final TapeRole role) { + this.role = role; + } + + public String getSerialNumber() { return this.serialNumber; } @@ -292,12 +326,12 @@ public void setState(final TapeState state) { } - public UUID getStorageDomainId() { - return this.storageDomainId; + public UUID getStorageDomainMemberId() { + return this.storageDomainMemberId; } - public void setStorageDomainId(final UUID storageDomainId) { - this.storageDomainId = storageDomainId; + public void setStorageDomainMemberId(final UUID storageDomainMemberId) { + this.storageDomainMemberId = storageDomainMemberId; } @@ -319,11 +353,11 @@ public void setTotalRawCapacity(final Long totalRawCapacity) { } - public TapeType getType() { + public String getType() { return this.type; } - public void setType(final TapeType type) { + public void setType(final String type) { this.type = type; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirective.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirective.java index 5c74edf4d..d92da4805 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirective.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirective.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -34,7 +34,7 @@ public class TapeDensityDirective { private UUID partitionId; @JsonProperty("TapeType") - private TapeType tapeType; + private String tapeType; // Constructor public TapeDensityDirective() { @@ -70,11 +70,11 @@ public void setPartitionId(final UUID partitionId) { } - public TapeType getTapeType() { + public String getTapeType() { return this.tapeType; } - public void setTapeType(final TapeType tapeType) { + public void setTapeType(final String tapeType) { this.tapeType = tapeType; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirectiveList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirectiveList.java index 4f4b135e9..d9c45d80e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirectiveList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDensityDirectiveList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDrive.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDrive.java index 507acd7db..539e48dda 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDrive.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDrive.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; import java.util.Date; @@ -26,6 +25,12 @@ public class TapeDrive { // Variables + @JsonProperty("CharacterizationVer") + private String characterizationVer; + + @JsonProperty("CleaningRequired") + private boolean cleaningRequired; + @JsonProperty("ErrorMessage") private String errorMessage; @@ -38,9 +43,24 @@ public class TapeDrive { @JsonProperty("LastCleaned") private Date lastCleaned; + @JsonProperty("MaxFailedTapes") + private Integer maxFailedTapes; + + @JsonProperty("MfgSerialNumber") + private String mfgSerialNumber; + + @JsonProperty("MinimumTaskPriority") + private Priority minimumTaskPriority; + @JsonProperty("PartitionId") private UUID partitionId; + @JsonProperty("Quiesced") + private Quiesced quiesced; + + @JsonProperty("ReservedTaskType") + private ReservedTaskType reservedTaskType; + @JsonProperty("SerialNumber") private String serialNumber; @@ -60,6 +80,24 @@ public TapeDrive() { // Getters and Setters + public String getCharacterizationVer() { + return this.characterizationVer; + } + + public void setCharacterizationVer(final String characterizationVer) { + this.characterizationVer = characterizationVer; + } + + + public boolean getCleaningRequired() { + return this.cleaningRequired; + } + + public void setCleaningRequired(final boolean cleaningRequired) { + this.cleaningRequired = cleaningRequired; + } + + public String getErrorMessage() { return this.errorMessage; } @@ -96,6 +134,33 @@ public void setLastCleaned(final Date lastCleaned) { } + public Integer getMaxFailedTapes() { + return this.maxFailedTapes; + } + + public void setMaxFailedTapes(final Integer maxFailedTapes) { + this.maxFailedTapes = maxFailedTapes; + } + + + public String getMfgSerialNumber() { + return this.mfgSerialNumber; + } + + public void setMfgSerialNumber(final String mfgSerialNumber) { + this.mfgSerialNumber = mfgSerialNumber; + } + + + public Priority getMinimumTaskPriority() { + return this.minimumTaskPriority; + } + + public void setMinimumTaskPriority(final Priority minimumTaskPriority) { + this.minimumTaskPriority = minimumTaskPriority; + } + + public UUID getPartitionId() { return this.partitionId; } @@ -105,6 +170,24 @@ public void setPartitionId(final UUID partitionId) { } + public Quiesced getQuiesced() { + return this.quiesced; + } + + public void setQuiesced(final Quiesced quiesced) { + this.quiesced = quiesced; + } + + + public ReservedTaskType getReservedTaskType() { + return this.reservedTaskType; + } + + public void setReservedTaskType(final ReservedTaskType reservedTaskType) { + this.reservedTaskType = reservedTaskType; + } + + public String getSerialNumber() { return this.serialNumber; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveList.java index 2c4f59629..801a1d70a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveState.java index 5527753c3..fa6452c75 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java index 47d182b85..9f708883d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeDriveType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,6 +21,12 @@ public enum TapeDriveType { LTO5, LTO6, LTO7, + LTO8, + LTO9, + LTO10, TS1140, - TS1150 + TS1150, + TS1155, + TS1160, + TS1170 } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailure.java index d1190ffcb..9bb31baa7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class TapeFailure { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureList.java index 9532f4a17..0f3292d78 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistration.java index 4a8b5f95e..f67404497 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class TapeFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistrationList.java index a87982b0a..7be871434 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureType.java index 69459c360..9f5eb7371 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,21 +20,35 @@ public enum TapeFailureType { BAR_CODE_CHANGED, BAR_CODE_DUPLICATE, BLOB_READ_FAILED, + CLEANING_TAPE_EXPIRED, DATA_CHECKPOINT_FAILURE, DATA_CHECKPOINT_FAILURE_DUE_TO_READ_ONLY, DATA_CHECKPOINT_MISSING, DELAYED_OWNERSHIP_FAILURE, DRIVE_CLEAN_FAILED, DRIVE_CLEANED, + DRIVE_TEST_FAILED, + DRIVE_TEST_FAILED_ALL_WRITES_TOO_SLOW, + DRIVE_TEST_FAILED_FORWARD_WRITES_TOO_SLOW, + DRIVE_TEST_FAILED_REVERSE_WRITES_TOO_SLOW, + DRIVE_TEST_SUCCEEDED, + ENCRYPTION_ERROR, FORMAT_FAILED, GET_TAPE_INFORMATION_FAILED, + HARDWARE_ERROR, IMPORT_FAILED, + IMPORT_INCOMPLETE, IMPORT_FAILED_DUE_TO_TAKE_OWNERSHIP_FAILURE, IMPORT_FAILED_DUE_TO_DATA_INTEGRITY, + INCOMPATIBLE, INSPECT_FAILED, + MOVE_FAILED, + QUIESCING_DRIVE, READ_FAILED, REIMPORT_REQUIRED, SERIAL_NUMBER_MISMATCH, + SINGLE_PARTITION, VERIFY_FAILED, - WRITE_FAILED + WRITE_FAILED, + WRITE_SOURCE_FAILED } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibrary.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibrary.java index 65a72e6f3..f1228a635 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibrary.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibrary.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.UUID; -import java.lang.String; @JacksonXmlRootElement(namespace = "Data") public class TapeLibrary { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibraryList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibraryList.java index 7b773985a..edd638515 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibraryList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeLibraryList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeList.java index cd7937900..fd29567ea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartition.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartition.java index c86173810..85fd00107 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartition.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartition.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,13 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") public class TapePartition { // Variables + @JsonProperty("AutoCompactionEnabled") + private boolean autoCompactionEnabled; + + @JsonProperty("AutoQuiesceEnabled") + private boolean autoQuiesceEnabled; + + @JsonProperty("DriveIdleTimeoutInMinutes") + private Integer driveIdleTimeoutInMinutes; + @JsonProperty("DriveType") private TapeDriveType driveType; @@ -40,6 +48,12 @@ public class TapePartition { @JsonProperty("LibraryId") private UUID libraryId; + @JsonProperty("MinimumReadReservedDrives") + private int minimumReadReservedDrives; + + @JsonProperty("MinimumWriteReservedDrives") + private int minimumWriteReservedDrives; + @JsonProperty("Name") private String name; @@ -59,6 +73,33 @@ public TapePartition() { // Getters and Setters + public boolean getAutoCompactionEnabled() { + return this.autoCompactionEnabled; + } + + public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) { + this.autoCompactionEnabled = autoCompactionEnabled; + } + + + public boolean getAutoQuiesceEnabled() { + return this.autoQuiesceEnabled; + } + + public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) { + this.autoQuiesceEnabled = autoQuiesceEnabled; + } + + + public Integer getDriveIdleTimeoutInMinutes() { + return this.driveIdleTimeoutInMinutes; + } + + public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) { + this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes; + } + + public TapeDriveType getDriveType() { return this.driveType; } @@ -104,6 +145,24 @@ public void setLibraryId(final UUID libraryId) { } + public int getMinimumReadReservedDrives() { + return this.minimumReadReservedDrives; + } + + public void setMinimumReadReservedDrives(final int minimumReadReservedDrives) { + this.minimumReadReservedDrives = minimumReadReservedDrives; + } + + + public int getMinimumWriteReservedDrives() { + return this.minimumWriteReservedDrives; + } + + public void setMinimumWriteReservedDrives(final int minimumWriteReservedDrives) { + this.minimumWriteReservedDrives = minimumWriteReservedDrives; + } + + public String getName() { return this.name; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionApiBean.java new file mode 100644 index 000000000..44458c11f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionApiBean.java @@ -0,0 +1,226 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class TapePartitionApiBean { + + // Variables + @JsonProperty("AutoCompactionEnabled") + private boolean autoCompactionEnabled; + + @JsonProperty("AutoQuiesceEnabled") + private boolean autoQuiesceEnabled; + + @JsonProperty("DriveCount") + private int driveCount; + + @JsonProperty("DriveIdleTimeoutInMinutes") + private Integer driveIdleTimeoutInMinutes; + + @JsonProperty("DriveType") + private TapeDriveType driveType; + + @JsonProperty("ErrorMessage") + private String errorMessage; + + @JsonProperty("Id") + private UUID id; + + @JsonProperty("ImportExportConfiguration") + private ImportExportConfiguration importExportConfiguration; + + @JsonProperty("LibraryId") + private UUID libraryId; + + @JsonProperty("MinimumReadReservedDrives") + private int minimumReadReservedDrives; + + @JsonProperty("MinimumWriteReservedDrives") + private int minimumWriteReservedDrives; + + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; + + @JsonProperty("Quiesced") + private Quiesced quiesced; + + @JsonProperty("SerialNumber") + private String serialNumber; + + @JsonProperty("State") + private TapePartitionState state; + + @JsonProperty("TapeCount") + private int tapeCount; + + // Constructor + public TapePartitionApiBean() { + //pass + } + + // Getters and Setters + + public boolean getAutoCompactionEnabled() { + return this.autoCompactionEnabled; + } + + public void setAutoCompactionEnabled(final boolean autoCompactionEnabled) { + this.autoCompactionEnabled = autoCompactionEnabled; + } + + + public boolean getAutoQuiesceEnabled() { + return this.autoQuiesceEnabled; + } + + public void setAutoQuiesceEnabled(final boolean autoQuiesceEnabled) { + this.autoQuiesceEnabled = autoQuiesceEnabled; + } + + + public int getDriveCount() { + return this.driveCount; + } + + public void setDriveCount(final int driveCount) { + this.driveCount = driveCount; + } + + + public Integer getDriveIdleTimeoutInMinutes() { + return this.driveIdleTimeoutInMinutes; + } + + public void setDriveIdleTimeoutInMinutes(final Integer driveIdleTimeoutInMinutes) { + this.driveIdleTimeoutInMinutes = driveIdleTimeoutInMinutes; + } + + + public TapeDriveType getDriveType() { + return this.driveType; + } + + public void setDriveType(final TapeDriveType driveType) { + this.driveType = driveType; + } + + + public String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(final String errorMessage) { + this.errorMessage = errorMessage; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public ImportExportConfiguration getImportExportConfiguration() { + return this.importExportConfiguration; + } + + public void setImportExportConfiguration(final ImportExportConfiguration importExportConfiguration) { + this.importExportConfiguration = importExportConfiguration; + } + + + public UUID getLibraryId() { + return this.libraryId; + } + + public void setLibraryId(final UUID libraryId) { + this.libraryId = libraryId; + } + + + public int getMinimumReadReservedDrives() { + return this.minimumReadReservedDrives; + } + + public void setMinimumReadReservedDrives(final int minimumReadReservedDrives) { + this.minimumReadReservedDrives = minimumReadReservedDrives; + } + + + public int getMinimumWriteReservedDrives() { + return this.minimumWriteReservedDrives; + } + + public void setMinimumWriteReservedDrives(final int minimumWriteReservedDrives) { + this.minimumWriteReservedDrives = minimumWriteReservedDrives; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + + public Quiesced getQuiesced() { + return this.quiesced; + } + + public void setQuiesced(final Quiesced quiesced) { + this.quiesced = quiesced; + } + + + public String getSerialNumber() { + return this.serialNumber; + } + + public void setSerialNumber(final String serialNumber) { + this.serialNumber = serialNumber; + } + + + public TapePartitionState getState() { + return this.state; + } + + public void setState(final TapePartitionState state) { + this.state = state; + } + + + public int getTapeCount() { + return this.tapeCount; + } + + public void setTapeCount(final int tapeCount) { + this.tapeCount = tapeCount; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailure.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailure.java index 87f83ef0c..9ac55f9a2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailure.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailure.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureList.java index d22dac15c..8c2358a51 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistration.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistration.java index d52b5144e..49313309a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistration.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistration.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,8 +20,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.Date; import java.util.UUID; -import java.lang.String; -import java.lang.Integer; @JacksonXmlRootElement(namespace = "Data") public class TapePartitionFailureNotificationRegistration { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistrationList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistrationList.java index 33b0dee32..118e8dae4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistrationList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureNotificationRegistrationList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureType.java index c13e09db0..a1ecdda1f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,6 +17,7 @@ package com.spectralogic.ds3client.models; public enum TapePartitionFailureType { + AUTO_QUIESCED, CLEANING_TAPE_REQUIRED, DUPLICATE_TAPE_BAR_CODES_DETECTED, EJECT_STALLED_DUE_TO_OFFLINE_TAPES, @@ -27,8 +28,11 @@ public enum TapePartitionFailureType { ONLINE_STALLED_DUE_TO_NO_STORAGE_SLOTS, TAPE_DRIVE_IN_ERROR, TAPE_DRIVE_MISSING, + TAPE_DRIVE_NOT_CLEANED, + TAPE_DRIVE_QUIESCED, TAPE_DRIVE_TYPE_MISMATCH, TAPE_EJECTION_BY_OPERATOR_REQUIRED, TAPE_MEDIA_TYPE_INCOMPATIBLE, - TAPE_REMOVAL_UNEXPECTED + TAPE_REMOVAL_UNEXPECTED, + TAPE_IN_INVALID_PARTITION } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionList.java index e5f429e67..e0d207cf0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionState.java index 1d21ea106..8e968f1d5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapePartitionState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeRole.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeRole.java new file mode 100644 index 000000000..61e09f2f1 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeRole.java @@ -0,0 +1,22 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +public enum TapeRole { + NORMAL, + TEST +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeState.java index d943bd7ab..0e08fa726 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -38,6 +38,7 @@ public enum TapeState { CANNOT_FORMAT_DUE_TO_WRITE_PROTECTION, SERIAL_NUMBER_MISMATCH, BAR_CODE_MISSING, + AUTO_COMPACTION_IN_PROGRESS, FORMAT_PENDING, FORMAT_IN_PROGRESS, EJECT_TO_EE_IN_PROGRESS, diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeStateSummaryApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeStateSummaryApiBean.java new file mode 100644 index 000000000..778edec4f --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeStateSummaryApiBean.java @@ -0,0 +1,84 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; +import java.util.ArrayList; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +@JacksonXmlRootElement(namespace = "TapeStateSummary") +public class TapeStateSummaryApiBean { + + // Variables + @JsonProperty("Count") + private int count; + + @JsonProperty("FullOfData") + private int fullOfData; + + @JsonProperty("TapeState") + private TapeState tapeState; + + @JsonProperty("TypeCounts") + @JacksonXmlElementWrapper(useWrapping = false) + private List typeCounts = new ArrayList<>(); + + // Constructor + public TapeStateSummaryApiBean() { + //pass + } + + // Getters and Setters + + public int getCount() { + return this.count; + } + + public void setCount(final int count) { + this.count = count; + } + + + public int getFullOfData() { + return this.fullOfData; + } + + public void setFullOfData(final int fullOfData) { + this.fullOfData = fullOfData; + } + + + public TapeState getTapeState() { + return this.tapeState; + } + + public void setTapeState(final TapeState tapeState) { + this.tapeState = tapeState; + } + + + public List getTypeCounts() { + return this.typeCounts; + } + + public void setTypeCounts(final List typeCounts) { + this.typeCounts = typeCounts; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeTypeSummaryApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeTypeSummaryApiBean.java new file mode 100644 index 000000000..8beef218e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TapeTypeSummaryApiBean.java @@ -0,0 +1,92 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +@JacksonXmlRootElement(namespace = "TapeTypeSummary") +public class TapeTypeSummaryApiBean { + + // Variables + @JsonProperty("AvailableStorageCapacity") + private long availableStorageCapacity; + + @JsonProperty("Count") + private int count; + + @JsonProperty("TotalStorageCapacity") + private long totalStorageCapacity; + + @JsonProperty("Type") + private String type; + + @JsonProperty("UsedStorageCapacity") + private long usedStorageCapacity; + + // Constructor + public TapeTypeSummaryApiBean() { + //pass + } + + // Getters and Setters + + public long getAvailableStorageCapacity() { + return this.availableStorageCapacity; + } + + public void setAvailableStorageCapacity(final long availableStorageCapacity) { + this.availableStorageCapacity = availableStorageCapacity; + } + + + public int getCount() { + return this.count; + } + + public void setCount(final int count) { + this.count = count; + } + + + public long getTotalStorageCapacity() { + return this.totalStorageCapacity; + } + + public void setTotalStorageCapacity(final long totalStorageCapacity) { + this.totalStorageCapacity = totalStorageCapacity; + } + + + public String getType() { + return this.type; + } + + public void setType(final String type) { + this.type = type; + } + + + public long getUsedStorageCapacity() { + return this.usedStorageCapacity; + } + + public void setUsedStorageCapacity(final long usedStorageCapacity) { + this.usedStorageCapacity = usedStorageCapacity; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetApiBean.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetApiBean.java new file mode 100644 index 000000000..073faf689 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetApiBean.java @@ -0,0 +1,118 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +// This code is auto-generated, do not modify +package com.spectralogic.ds3client.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.UUID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JacksonXmlRootElement(namespace = "Data") +public class TargetApiBean { + + // Variables + @JsonProperty("CloudNamingMode") + private CloudNamingMode cloudNamingMode; + + @JsonProperty("DefaultReadPreference") + private TargetReadPreferenceType defaultReadPreference; + + @JsonProperty("Id") + private UUID id; + + @JacksonXmlProperty(isAttribute = true, localName = "Name") + private String name; + + @JsonProperty("PermitGoingOutOfSync") + private boolean permitGoingOutOfSync; + + @JsonProperty("Quiesced") + private Quiesced quiesced; + + @JsonProperty("State") + private TargetState state; + + // Constructor + public TargetApiBean() { + //pass + } + + // Getters and Setters + + public CloudNamingMode getCloudNamingMode() { + return this.cloudNamingMode; + } + + public void setCloudNamingMode(final CloudNamingMode cloudNamingMode) { + this.cloudNamingMode = cloudNamingMode; + } + + + public TargetReadPreferenceType getDefaultReadPreference() { + return this.defaultReadPreference; + } + + public void setDefaultReadPreference(final TargetReadPreferenceType defaultReadPreference) { + this.defaultReadPreference = defaultReadPreference; + } + + + public UUID getId() { + return this.id; + } + + public void setId(final UUID id) { + this.id = id; + } + + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + + public boolean getPermitGoingOutOfSync() { + return this.permitGoingOutOfSync; + } + + public void setPermitGoingOutOfSync(final boolean permitGoingOutOfSync) { + this.permitGoingOutOfSync = permitGoingOutOfSync; + } + + + public Quiesced getQuiesced() { + return this.quiesced; + } + + public void setQuiesced(final Quiesced quiesced) { + this.quiesced = quiesced; + } + + + public TargetState getState() { + return this.state; + } + + public void setState(final TargetState state) { + this.state = state; + } + +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetFailureType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetFailureType.java index d75f3df99..fec0b1fa6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetFailureType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetFailureType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,10 +18,12 @@ public enum TargetFailureType { IMPORT_FAILED, + IMPORT_INCOMPLETE, NOT_ONLINE, WRITE_FAILED, WRITE_INITIATE_FAILED, READ_FAILED, READ_INITIATE_FAILED, - VERIFY_FAILED + VERIFY_FAILED, + VERIFY_COMPLETE } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetReadPreferenceType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetReadPreferenceType.java index cf1087345..e17b84d2c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetReadPreferenceType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetReadPreferenceType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetState.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetState.java index 7a1fff709..58d27772a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetState.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TargetState.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/InitiateMultipartUploadResult.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TypeTypeCountApiBean.java similarity index 56% rename from ds3-sdk/src/main/java/com/spectralogic/ds3client/models/InitiateMultipartUploadResult.java rename to ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TypeTypeCountApiBean.java index 73c8f772e..630623dc4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/InitiateMultipartUploadResult.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/TypeTypeCountApiBean.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,52 +18,51 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; -@JacksonXmlRootElement(namespace = "InitiateMultipartUploadResult") -public class InitiateMultipartUploadResult { +@JacksonXmlRootElement(namespace = "TypeTypeCount") +public class TypeTypeCountApiBean { // Variables - @JsonProperty("Bucket") - private String bucket; + @JsonProperty("Count") + private int count; - @JsonProperty("Key") - private String key; + @JsonProperty("FullOfData") + private int fullOfData; - @JsonProperty("UploadId") - private String uploadId; + @JsonProperty("Type") + private String type; // Constructor - public InitiateMultipartUploadResult() { + public TypeTypeCountApiBean() { //pass } // Getters and Setters - public String getBucket() { - return this.bucket; + public int getCount() { + return this.count; } - public void setBucket(final String bucket) { - this.bucket = bucket; + public void setCount(final int count) { + this.count = count; } - public String getKey() { - return this.key; + public int getFullOfData() { + return this.fullOfData; } - public void setKey(final String key) { - this.key = key; + public void setFullOfData(final int fullOfData) { + this.fullOfData = fullOfData; } - public String getUploadId() { - return this.uploadId; + public String getType() { + return this.type; } - public void setUploadId(final String uploadId) { - this.uploadId = uploadId; + public void setType(final String type) { + this.type = type; } } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/UnavailableMediaUsagePolicy.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/UnavailableMediaUsagePolicy.java index 6a1019d99..c472d6d34 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/UnavailableMediaUsagePolicy.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/UnavailableMediaUsagePolicy.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/User.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/User.java index a7e68fb9d..ab6cd00f9 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/User.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/User.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import java.lang.String; import java.util.UUID; @JacksonXmlRootElement(namespace = "Data") diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/VersioningLevel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/VersioningLevel.java index 46ee8e863..d22b831bd 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/VersioningLevel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/VersioningLevel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,5 +18,6 @@ public enum VersioningLevel { NONE, - KEEP_LATEST + KEEP_LATEST, + KEEP_MULTIPLE_VERSIONS } \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WriteOptimization.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WriteOptimization.java index 6778b4f1b..51baeba17 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WriteOptimization.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WriteOptimization.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WritePreferenceLevel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WritePreferenceLevel.java index 1e47ad31b..074c9263c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WritePreferenceLevel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/WritePreferenceLevel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3Object.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3Object.java index ce860a7bf..6e5a0ef45 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3Object.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3Object.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,16 +15,25 @@ package com.spectralogic.ds3client.models.bulk; -import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.spectralogic.ds3client.serializer.Views; + +import java.util.Objects; +import java.util.UUID; -@JsonFilter("sizeFilter") public class Ds3Object { @JacksonXmlProperty(isAttribute = true, localName = "Name") private String name; + + @JsonView(Views.PutObject.class) @JacksonXmlProperty(isAttribute = true, localName = "Size") private long size; + @JsonView(Views.GetObject.class) + @JacksonXmlProperty(isAttribute = true, localName = "VersionId") + private String versionId; + /** * This constructor is used for XML Serialization. * The preferred method is to use one of the other two constructors. @@ -41,6 +50,29 @@ public Ds3Object() { public Ds3Object(final String name, final long size) { this.name = name; this.size = size; + this.versionId = null; + } + + /** + * Use this constructor when getting files from DS3. + * @param name the name of the object to get from DS3 + * @param versionId The version ID of the object to get from DS3 + */ + public Ds3Object(final String name, final UUID versionId) { + this.name = name; + this.size = 0; + this.versionId = versionId.toString(); + } + + /** + * Use this constructor when getting files from DS3. + * @param name the name of the object to get from DS3 + * @param versionId The version ID of the object to get from DS3 + */ + public Ds3Object(final String name, final String versionId) { + this.name = name; + this.size = 0; + this.versionId = versionId; } /** @@ -50,6 +82,7 @@ public Ds3Object(final String name, final long size) { public Ds3Object(final String name) { this.name = name; this.size = 0; + this.versionId = null; } public String getName() { @@ -68,6 +101,14 @@ public void setSize(final long size) { this.size = size; } + public String getVersionId() { + return versionId; + } + + public void setVersionId(String versionId) { + this.versionId = versionId; + } + @Override public String toString() { return this.name + ":" + this.size; @@ -75,18 +116,17 @@ public String toString() { @Override public int hashCode() { - return java.util.Objects.hash(this.name, this.size); + return java.util.Objects.hash(this.name, this.size, this.versionId); } @Override public boolean equals(final Object obj) { - if (obj instanceof Ds3Object) { - final Ds3Object ds3Obj = (Ds3Object) obj; - if (ds3Obj.getName().equals(this.getName()) && - ds3Obj.getSize() == this.getSize()) { - return true; - } + if (!(obj instanceof Ds3Object)) { + return false; } - return false; + final Ds3Object ds3Obj = (Ds3Object) obj; + return Objects.equals(ds3Obj.getName(), this.getName()) && + ds3Obj.getSize() == this.getSize() && + Objects.equals(ds3Obj.versionId, this.getVersionId()); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java index 9a34369f4..ccb58ad6f 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/Ds3ObjectList.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,62 +16,29 @@ package com.spectralogic.ds3client.models.bulk; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import com.spectralogic.ds3client.models.Priority; -import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; -import com.spectralogic.ds3client.models.WriteOptimization; +import com.spectralogic.ds3client.utils.collections.StreamWrapper; + +import java.util.stream.Stream; +import java.util.stream.StreamSupport; @JacksonXmlRootElement(localName = "Objects") public class Ds3ObjectList { @JsonProperty("Object") - private Iterable objects; - - @JacksonXmlProperty(isAttribute = true, namespace = "", localName = "Priority") - private Priority priority; - - @JacksonXmlProperty(isAttribute = true, namespace = "", localName = "WriteOptimization") - private WriteOptimization writeOptimization; - - @JacksonXmlProperty(isAttribute = true, namespace = "", localName = "ChunkClientProcessingOrderGuarantee") - private JobChunkClientProcessingOrderGuarantee chunkClientProcessingOrderGuarantee; + private Stream objects; public Ds3ObjectList() { } public Ds3ObjectList(final Iterable objects) { - this.objects = objects; + this.objects = StreamSupport.stream(objects.spliterator(), false); } public Iterable getObjects() { - return objects; + return StreamWrapper.wrapStream(this.objects); } public void setObjects(final Iterable objects) { - this.objects = objects; - } - - public Priority getPriority() { - return priority; - } - - public void setPriority(final Priority priority) { - this.priority = priority; - } - - public WriteOptimization getWriteOptimization() { - return this.writeOptimization; - } - - public void setWriteOptimization(final WriteOptimization writeOptimization) { - this.writeOptimization = writeOptimization; - } - - public JobChunkClientProcessingOrderGuarantee getChunkClientProcessingOrderGuarantee() { - return this.chunkClientProcessingOrderGuarantee; - } - - public void setChunkClientProcessingOrderGuarantee(final JobChunkClientProcessingOrderGuarantee chunkClientProcessingOrderGuarantee) { - this.chunkClientProcessingOrderGuarantee = chunkClientProcessingOrderGuarantee; + this.objects = StreamSupport.stream(objects.spliterator(), false); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java index 1ed151d08..077aaeb40 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/PartialDs3Object.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,8 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.spectralogic.ds3client.models.common.Range; +import java.util.UUID; + public class PartialDs3Object extends Ds3Object { @JsonUnwrapped @@ -28,6 +30,16 @@ public PartialDs3Object(final String name, final Range range) { this.range = range; } + public PartialDs3Object(final String name, final Range range, final UUID versionId) { + super(name, versionId); + this.range = range; + } + + public PartialDs3Object(final String name, final Range range, final String versionId) { + super(name, versionId); + this.range = range; + } + public Range getRange() { return range; } @@ -41,9 +53,7 @@ public int hashCode() { public boolean equals(final Object obj) { if (obj instanceof PartialDs3Object) { final PartialDs3Object partialDs3Object = (PartialDs3Object) obj; - if (super.equals(obj) && this.getRange().equals(partialDs3Object.getRange())) { - return true; - } + return super.equals(obj) && this.getRange().equals(partialDs3Object.getRange()); } return false; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/RequestType.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/RequestType.java index a40a687a4..47c0a3ca6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/RequestType.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/bulk/RequestType.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/CommonPrefixes.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/CommonPrefixes.java index ac88ef2af..109fc55e8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/CommonPrefixes.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/CommonPrefixes.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Credentials.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Credentials.java index 6dbe8c1be..5c07abb54 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Credentials.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Credentials.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java index f66466eb5..604c78647 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Range.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -65,9 +65,7 @@ public int hashCode() { public boolean equals(final Object obj) { if (obj instanceof Range) { final Range range = (Range) obj; - if (range.start == this.start && range.end == this.end) { - return true; - } + return range.start == this.start && range.end == this.end; } return false; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/SignatureDetails.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/SignatureDetails.java index 04697c900..0b2418585 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/SignatureDetails.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/SignatureDetails.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/Delete.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/Delete.java index 31761c49f..e25f263ea 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/Delete.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/Delete.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/DeleteObject.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/DeleteObject.java index 067992e2b..0dbe0eee0 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/DeleteObject.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/delete/DeleteObject.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,15 +15,27 @@ package com.spectralogic.ds3client.models.delete; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +@JsonInclude( JsonInclude.Include.NON_NULL ) public class DeleteObject { @JsonProperty("Key") private String key; - public DeleteObject(final String key) { + @JsonProperty("VersionId") + private UUID versionId; + + public DeleteObject(final String key, final UUID versionId) { this.key = key; + this.versionId = versionId; + } + + public DeleteObject(final String key) { + this(key, null); } public String getKey() { @@ -33,4 +45,16 @@ public String getKey() { public void setKey(final String key) { this.key = key; } + + + public UUID getVersionId() + { + return versionId; + } + + + public void setVersionId( final UUID versionId ) + { + this.versionId = versionId; + } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/CompleteMultipartUpload.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/CompleteMultipartUpload.java index e7366eb67..cf67c9753 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/CompleteMultipartUpload.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/CompleteMultipartUpload.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -31,6 +31,10 @@ public CompleteMultipartUpload() { //Pass } + public CompleteMultipartUpload(final List parts) { + this.parts = parts; + } + public List getParts() { return parts; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/Part.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/Part.java index 6bfe38252..b487e60fc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/Part.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/multipart/Part.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -29,6 +29,11 @@ public Part() { //Pass } + public Part(final int partNumber, final String eTag) { + this.partNumber = partNumber; + this.eTag = eTag; + } + public int getPartNumber() { return partNumber; } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/package-info.java index 67eac6ae8..46a654772 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/requestpayloads/Ids.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/requestpayloads/Ids.java new file mode 100644 index 000000000..6568eaa8b --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/models/requestpayloads/Ids.java @@ -0,0 +1,44 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.models.requestpayloads; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; + +import java.util.List; + +/** + * Represents a request payload that is used by {@link com.spectralogic.ds3client.commands.interfaces.AbstractIdsPayloadRequest} + * and is used to marshal to xml a list of IDs in proper format + */ +public class Ids { + + @JsonProperty("Id") + @JacksonXmlElementWrapper( useWrapping = false) + private List ids; + + public Ids(final List ids) { + this.ids = ids; + } + + public List getIds() { + return ids; + } + + public void setIds(final List ids) { + this.ids = ids; + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ConnectionDetails.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ConnectionDetails.java index c1c241751..4dbd57bae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ConnectionDetails.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ConnectionDetails.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestException.java index 67f930375..029f33ab3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestUsingMgmtPortException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestUsingMgmtPortException.java index fce4485ac..b70db862c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestUsingMgmtPortException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedRequestUsingMgmtPortException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedToGetBucketException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedToGetBucketException.java new file mode 100644 index 000000000..d346913f6 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/FailedToGetBucketException.java @@ -0,0 +1,21 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.networking; + +public class FailedToGetBucketException extends RuntimeException { + public FailedToGetBucketException(final String s, final FailedRequestException e) { + super(s, e); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java index 689216476..fdc5fcc9c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HashGeneratingMatchHandler.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; class HashGeneratingMatchHandler implements ChecksumType.MatchHandler { private static final int READ_BUFFER_SIZE = 1024; @@ -51,7 +52,7 @@ public String compute() throws IOException { @Override public String value(final byte[] hash) throws IOException { - return new String(hash, Charset.forName("UTF-8")); + return new String(hash, StandardCharsets.UTF_8); } private String hashInputStream(final Hasher digest, final InputStream stream) throws IOException { @@ -71,14 +72,14 @@ private String hashInputStream(final Hasher digest, final InputStream stream) th return digest.digest(); } - private Hasher getHasher(final ChecksumType.Type checksumType) { + private static Hasher getHasher(final ChecksumType.Type checksumType) { switch (checksumType) { case MD5: return new MD5Hasher(); case SHA_256: return new SHA256Hasher(); case SHA_512: return new SHA512Hasher(); case CRC_32: return new CRC32Hasher(); case CRC_32C: return new CRC32CHasher(); - default: throw new RuntimeException("Unknown checksum type " + checksumType.toString()); + default: throw new RuntimeException("Unknown checksum type " + checksumType); } } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HeadersImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HeadersImpl.java index 713c61878..e395d64db 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HeadersImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HeadersImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HttpVerb.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HttpVerb.java index 12ae3ec50..04218026a 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HttpVerb.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/HttpVerb.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetUtils.java index df8d44e01..2a6e6f6e7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClient.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClient.java index b9cca5e8d..cae884151 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClient.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClient.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClientImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClientImpl.java index 91d821f6b..8e0bfcc1d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClientImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/NetworkClientImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -59,9 +59,8 @@ import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.SignatureException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; import java.util.Map; +import java.util.concurrent.Semaphore; import static com.spectralogic.ds3client.utils.Signature.canonicalizeAmzHeaders; import static com.spectralogic.ds3client.utils.Signature.canonicalizeResource; @@ -88,6 +87,7 @@ public class NetworkClientImpl implements NetworkClient { final private CloseableHttpClient client; final private HttpHost host; + final private Semaphore clientLock; public NetworkClientImpl(final ConnectionDetails connectionDetails) { this(connectionDetails, createDefaultClient(connectionDetails)); @@ -100,6 +100,7 @@ public NetworkClientImpl(final ConnectionDetails connectionDetails, final Closea this.connectionDetails = connectionDetails; this.host = buildHost(connectionDetails); this.client = client; + this.clientLock = new Semaphore(MAX_CONNECTION_PER_ROUTE); } catch (final MalformedURLException e) { throw new RuntimeException(e); } @@ -124,14 +125,9 @@ private static CloseableHttpClient createDefaultClient(final ConnectionDetails c private static CloseableHttpClient createInsecureSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException { final SSLContext sslContext = new SSLContextBuilder() - .useProtocol(INSECURE_SSL_PROTOCOL) - .loadTrustMaterial(null, new TrustStrategy() { - @Override - public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { - return true; - } - }).build(); - final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier()); + .setProtocol(INSECURE_SSL_PROTOCOL) + .loadTrustMaterial(null, (TrustStrategy) (chain, authType) -> true).build(); + final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new String[]{ INSECURE_SSL_PROTOCOL }, null, new NoopHostnameVerifier()); final Registry socketFactoryRegistry = RegistryBuilder.create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) @@ -215,7 +211,7 @@ private class RequestExecutor implements Closeable { private final ChecksumType.Type checksumType; private final CloseableHttpClient client; - public RequestExecutor(final CloseableHttpClient client, final HttpHost host, final Ds3Request ds3Request) throws IOException { + RequestExecutor(final CloseableHttpClient client, final HttpHost host, final Ds3Request ds3Request) throws IOException { this.client = client; this.ds3Request = ds3Request; this.host = host; @@ -230,17 +226,22 @@ public RequestExecutor(final CloseableHttpClient client, final HttpHost host, fi this.hash = this.buildHash(); } - public CloseableHttpResponse execute() throws IOException { + CloseableHttpResponse execute() throws IOException { if (this.content != null) { this.content.reset(); } final HttpRequest httpRequest = this.buildHttpRequest(); - this.addHeaders(httpRequest); + clientLock.acquireUninterruptibly(); try { - return client.execute(this.host, httpRequest, this.getContext()); - } catch (final javax.net.ssl.SSLHandshakeException e) { - throw new InvalidCertificate("The certificate on black pearl is not a strong certificate and the request is being aborted. Configure with the insecure option to perform the request.", e); + this.addHeaders(httpRequest); + try { + return client.execute(this.host, httpRequest, this.getContext()); + } catch (final javax.net.ssl.SSLHandshakeException e) { + throw new InvalidCertificate("The certificate on black pearl is not a strong certificate and the request is being aborted. Configure with the insecure option to perform the request.", e); + } + } finally { + clientLock.release(); } } @@ -271,7 +272,7 @@ private String buildPath() { private void addHeaders(final HttpRequest httpRequest) { // Add common headers. - final String date = DateFormatter.dateToRfc882(); + final String date = DateFormatter.dateToRfc822(); httpRequest.addHeader(HOST, NetUtils.buildHostField(NetworkClientImpl.this.connectionDetails)); httpRequest.addHeader(DATE, date); httpRequest.addHeader(CONTENT_TYPE, this.ds3Request.getContentType()); diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/RequiresMarkSupportedException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/RequiresMarkSupportedException.java index 25862d725..66a081935 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/RequiresMarkSupportedException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/RequiresMarkSupportedException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ResponseProcessingException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ResponseProcessingException.java index 961088acc..da4d7a214 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ResponseProcessingException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/ResponseProcessingException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRedirectsException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRedirectsException.java index a5e7a489e..34623f22c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRedirectsException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRedirectsException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRetriesException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRetriesException.java index 356811d2d..a9cd56396 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRetriesException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/TooManyRetriesException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponse.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponse.java index 60b571c22..9829421c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponse.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponseImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponseImpl.java index facdc8ae7..ddb0882d6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponseImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/WebResponseImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/package-info.java index 78a25e335..e33ffb557 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/networking/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/package-info.java index 2436e0902..ce5c6b7f7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/Views.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/Views.java new file mode 100644 index 000000000..1cf04fe87 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/Views.java @@ -0,0 +1,30 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.serializer; + +/** + * Used to annotate Ds3Object attributes to specify which attributes are + * unique to bulk get vs bulk put request payloads. Note that parameters + * with no annotation will be marshaled into both get and put payloads. + * These are used with the JsonView annotation. + */ +public class Views { + /** Denotes parameters within Ds3Object which are unique to get object request payloads */ + public static class GetObject { } + + /** Denotes parameters within Ds3Object which are unique to get object request payloads */ + public static class PutObject { } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java index 346973197..5c94d8af4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlOutput.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2022 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,20 +17,17 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ser.FilterProvider; -import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.spectralogic.ds3client.models.bulk.Ds3ObjectList; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; public final class XmlOutput { private static final JacksonXmlModule module; @@ -42,6 +39,11 @@ public final class XmlOutput { module = new JacksonXmlModule(); module.setDefaultUseWrapper(false); mapper = new XmlMapper(module); + // we must treat as having nil value - see discussion at + // https://github.com/SpectraLogic/ds3_java_sdk/pull/595 + mapper.configure(FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL, true); + + mapper.registerModule(new Jdk8Module()); final SimpleFilterProvider filterProvider = new SimpleFilterProvider().setFailOnUnknownId(false); mapper.setFilterProvider(filterProvider); if (isProductionBuild()) { @@ -51,47 +53,26 @@ public final class XmlOutput { } } + /** + * Determines if this is a production build. A build is production by default, and only non-production when the + * production build environment variable is false. + */ protected static boolean isProductionBuild() { String productionBuild = System.getenv(PRODUCTION_BUILD); - if (productionBuild != null) { - return productionBuild.equals("true"); - } - - final Properties props = new Properties(); - final InputStream input = XmlOutput.class.getClassLoader().getResourceAsStream("ds3_sdk.properties"); - if (input == null) { - LOG.error("Could not find property file."); - } - else { - try { - props.load(input); - productionBuild = (String) props.get(PRODUCTION_BUILD); - if (productionBuild != null && productionBuild.equals("true")) { - return true; - } - else { - LOG.error("Unknown productionBuild value[{}]. Defaulting to false for unknown XML elements.", productionBuild); - } - } catch (final IOException e) { - LOG.error("Failed to load property file: {}", e); - } - } - - return false; - + return productionBuild == null || !productionBuild.equals("false"); } public static String toXml(final Object object) { return toXml(object, null); } - private static String toXml(final Object object, final FilterProvider filterProvider) { + private static String toXml(final Object object, final Class view) { try { - if (filterProvider == null) { + if (view == null) { return mapper.writeValueAsString(object); } else { - return mapper.writer(filterProvider).writeValueAsString(object); + return mapper.writerWithView(view).writeValueAsString(object); } } catch(final JsonProcessingException e) { @@ -101,11 +82,9 @@ private static String toXml(final Object object, final FilterProvider filterProv public static String toXml(final Ds3ObjectList objects, final boolean isBulkPut) { if (isBulkPut) { - return XmlOutput.toXml(objects); + return XmlOutput.toXml(objects, Views.PutObject.class); } - final FilterProvider filters = new SimpleFilterProvider().addFilter("sizeFilter", - SimpleBeanPropertyFilter.serializeAllExcept("Size")); - return XmlOutput.toXml(objects, filters); + return XmlOutput.toXml(objects, Views.GetObject.class); } public static T fromXml(final String xmlString, final Class type) throws IOException { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlProcessingException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlProcessingException.java index 5a0e6be8d..01b81a55c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlProcessingException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/XmlProcessingException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/package-info.java index d0867b3e0..59b3a2010 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/serializer/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Builder.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Builder.java index fbf5d6e1f..b87549fb3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Builder.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Builder.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java index 29afaf7dc..5be828ca6 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,6 +19,7 @@ import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Arrays; public class ByteArraySeekableByteChannel implements SeekableByteChannel { @@ -101,7 +102,7 @@ public byte[] toByteArray() { @Override public String toString() { - return this.toString(Charset.forName("UTF-8")); + return this.toString(StandardCharsets.UTF_8); } public String toString(final Charset charset) { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/DateFormatter.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/DateFormatter.java index 80ad6d688..c9e6f2c89 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/DateFormatter.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/DateFormatter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,19 +17,20 @@ import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; import java.util.TimeZone; public final class DateFormatter { final static private String RFC822FORMAT = "EEE, dd MMM yyyy HH:mm:ss Z"; /** - * Returns a RFC-882 formatted string with the current time. + * Returns a RFC-822 formatted string with the current time. */ - public static String dateToRfc882() { - return dateToRfc882(new Date()); + public static String dateToRfc822() { + return dateToRfc822(new Date()); } - public static String dateToRfc882(final Date date) { - final SimpleDateFormat sdf = new SimpleDateFormat(RFC822FORMAT); + public static String dateToRfc822(final Date date) { + final SimpleDateFormat sdf = new SimpleDateFormat(RFC822FORMAT, Locale.US); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(date); } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/EmptySeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/EmptySeekableByteChannel.java index 49ba01f00..ddfe787c4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/EmptySeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/EmptySeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/IOUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/IOUtils.java index 60b01e4de..e611660a5 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/IOUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/IOUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/InvalidMd5Exception.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/InvalidMd5Exception.java index 3ef4c9be5..c953e666c 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/InvalidMd5Exception.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/InvalidMd5Exception.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java index 40655806a..952078465 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/JobUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -24,7 +24,6 @@ import com.spectralogic.ds3client.models.*; import java.io.IOException; -import java.security.SignatureException; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -35,8 +34,8 @@ public final class JobUtils { private JobUtils() {} /** - * Finds all the jobs that have any of the files in {@param fileNames} contained in them. When {@param type} is PUT - * only one job ID should be returned. It is possible that when {@param type} is GET that there could be multiple + * Finds all the jobs that have any of the files in {@code fileNames} contained in them. When {@code type} is PUT + * only one job ID should be returned. It is possible that when {@code type} is GET that there could be multiple * job IDs returned. */ public static List findJob(final Ds3Client client, final JobRequestType type, final String bucketName, final Set fileNames) throws IOException { diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/LoggingSeekableByteChannel.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/LoggingSeekableByteChannel.java index 6fdb47d33..7736d02ae 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/LoggingSeekableByteChannel.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/LoggingSeekableByteChannel.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMap.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMap.java index eff7cfe13..6a8843376 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMap.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMap.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMapImpl.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMapImpl.java index 58594c026..61025ca6b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMapImpl.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/MultiMapImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/NotImplementedException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/NotImplementedException.java index 67b7140c3..14929f468 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/NotImplementedException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/NotImplementedException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PerformanceUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PerformanceUtils.java index 613c45b53..7009697c7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PerformanceUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PerformanceUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Predicate.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Predicate.java index 7991027be..98eca61d8 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Predicate.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Predicate.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PropertyUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PropertyUtils.java index c9fb83854..e3f5980f2 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PropertyUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/PropertyUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,7 +15,6 @@ package com.spectralogic.ds3client.utils; -import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.concurrent.atomic.AtomicReference; @@ -27,9 +26,11 @@ public final class PropertyUtils { private static final Logger LOG = LoggerFactory.getLogger(PropertyUtils.class); private static final String SDK_VERSION_PROPERTY_NAME = "version"; + private static final String GIT_COMMIT_HASH_PROPERTY_NAME = "git.commitHash"; private static final String PROPERTIES_FILE_NAME = "ds3_sdk.properties"; - private static AtomicReference versionProperty = new AtomicReference<>(""); + private static final AtomicReference versionProperty = new AtomicReference<>(""); + private static final AtomicReference gitCommitHashProperty = new AtomicReference<>(""); private PropertyUtils() {} @@ -38,24 +39,47 @@ private PropertyUtils() {} * @return The sdk version, if we can find one, an empty string otherwise. */ public static String getSdkVersion() { - if ( ! Guard.isStringNullOrEmpty(versionProperty.get())) { - return versionProperty.get(); + return getPropertyFromPropertiesFile(SDK_VERSION_PROPERTY_NAME, versionProperty); + } + + private static String getPropertyFromPropertiesFile(final String propertyName, final AtomicReference propertyValue) { + if ( ! Guard.isStringNullOrEmpty(propertyValue.get())) { + return propertyValue.get(); + } + + final String propertyFromPropertiesFile = getPropertyFromPropertiesFile(propertyName); + + if ( ! Guard.isStringNullOrEmpty(propertyFromPropertiesFile)) { + propertyValue.set(propertyFromPropertiesFile); } + return propertyValue.get(); + } + + private static String getPropertyFromPropertiesFile(final String propertyName) { final Properties properties = new Properties(); try (final InputStream propertiesStream = PropertyUtils.class.getClassLoader().getResourceAsStream(PROPERTIES_FILE_NAME)) { if (propertiesStream != null) { properties.load(propertiesStream); - final String versionFromPropFile = properties.get(SDK_VERSION_PROPERTY_NAME).toString(); - if (!Guard.isStringNullOrEmpty(versionFromPropFile)) { - versionProperty.set(versionFromPropFile); + final Object propertyObject = properties.get(propertyName); + + if (propertyObject != null) { + return properties.get(propertyName).toString(); } } - } catch (final IOException e) { - LOG.warn("Could not read properties file.", e); + } catch (final Throwable t) { + LOG.warn("Could not read properties file.", t); } - return versionProperty.get(); + return ""; + } + + /** + * Get the git commit hash from a properties file. + * @return The git commit hash, if we can find it, an empty string otherwise. + */ + public static String getGitCommitHash() { + return getPropertyFromPropertiesFile(GIT_COMMIT_HASH_PROPERTY_NAME, gitCommitHashProperty); } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ReadOnlySeekableByteChannelInputStream.kt b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ReadOnlySeekableByteChannelInputStream.kt new file mode 100644 index 000000000..a5f3d196e --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ReadOnlySeekableByteChannelInputStream.kt @@ -0,0 +1,9 @@ +package com.spectralogic.ds3client.utils + +import com.spectralogic.ds3client.helpers.channelbuilders.ReadOnlySeekableByteChannel + +class ReadOnlySeekableByteChannelInputStream( + readOnlySeekableByteChannel: ReadOnlySeekableByteChannel +) : SeekableByteChannelInputStream(readOnlySeekableByteChannel) { + override fun reset(): Unit = Unit +} \ No newline at end of file diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ResponseUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ResponseUtils.java index af199ec9e..a76712138 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ResponseUtils.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/ResponseUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SSLSetupException.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SSLSetupException.java index 805daf16e..ed23c17fc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SSLSetupException.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SSLSetupException.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SafeStringManipulation.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SafeStringManipulation.java index 3ea1f68b8..735393ccc 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SafeStringManipulation.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SafeStringManipulation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SeekableByteChannelInputStream.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SeekableByteChannelInputStream.java index 13db18148..dff55f692 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SeekableByteChannelInputStream.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/SeekableByteChannelInputStream.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -39,7 +39,7 @@ public int read() throws IOException { return -1; } } - + @Override public int read(final byte[] b, final int off, final int len) throws IOException { final ByteBuffer buffer = ByteBuffer.wrap(b); @@ -52,18 +52,18 @@ public int read(final byte[] b, final int off, final int len) throws IOException return -1; } } - + @Override public long skip(final long n) throws IOException { this.seekableByteChannel.position(this.seekableByteChannel.position() + n); return this.seekableByteChannel.position(); } - + @Override public boolean markSupported() { return true; } - + @Override public void mark(final int readlimit) { try { @@ -72,13 +72,13 @@ public void mark(final int readlimit) { throw new RuntimeException(e); } } - + @Override public void reset() throws IOException { this.seekableByteChannel.position(this.markPosition); this.markPosition = 0; } - + @Override public void close() throws IOException { this.seekableByteChannel.close(); diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java index 89b24e39c..dca03d41b 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/Signature.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.security.SignatureException; import java.util.Collection; import java.util.Map; @@ -53,14 +54,14 @@ public static String calculateRFC2104HMAC(final String data, final String key) final String result; try { // get an hmac_sha1 key from the raw key bytes - final SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(Charset.forName("UTF-8")), HMAC_SHA1_ALGORITHM); + final SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), HMAC_SHA1_ALGORITHM); // get an hmac_sha1 Mac instance and initialize with the signing key final Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(signingKey); // compute the hmac on input data bytes - final byte[] rawHmac = mac.doFinal(data.getBytes(Charset.forName("UTF-8"))); + final byte[] rawHmac = mac.doFinal(data.getBytes(StandardCharsets.UTF_8)); result = Base64.encodeBase64String(rawHmac); } catch (final Exception e) { throw new SignatureException("Failed to generate HMAC: " + e.getMessage(), e); @@ -91,14 +92,18 @@ public static String canonicalizeResource(final String path, final Map { * @param The model that is returned by the iterator */ public interface LazyLoader { - List getNextValues(); + Iterable getNextValues(); } - private class LazyObjectIterator implements Iterator { + private static class LazyObjectIterator implements Iterator { private final LazyLoader iterableLoader; - private List cache = null; - private int cachePointer; + private Iterator cache = null; private boolean endOfContent = false; private LazyObjectIterator(final LazyLoader iterableLoader) { @@ -80,7 +76,7 @@ public boolean hasNext() { return false; } - if (cache == null || cachePointer == cache.size()) { + if (cache == null || !cache.hasNext()) { loadCache(); } return !endOfContent; @@ -91,20 +87,16 @@ public E next() { if (endOfContent) { throw new NoSuchElementException("No more content"); } - if (cache == null || cachePointer >= cache.size()) { + if (cache == null || !cache.hasNext()) { loadCache(); } - final E contents = cache.get(cachePointer); - this.cachePointer++; - return contents; + return cache.next(); } private void loadCache() { - this.cache = iterableLoader.getNextValues(); - if (Guard.isNullOrEmpty(this.cache)) { + this.cache = iterableLoader.getNextValues().iterator(); + if (!cache.hasNext()) { endOfContent = true; - } else { - this.cachePointer = 0; } } diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/StreamWrapper.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/StreamWrapper.java new file mode 100644 index 000000000..c40faaba9 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/collections/StreamWrapper.java @@ -0,0 +1,43 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils.collections; + +import org.jetbrains.annotations.NotNull; + +import java.util.Iterator; +import java.util.stream.Stream; + +/** + * Wraps a Stream as an Iterable + */ +public class StreamWrapper implements Iterable { + + private final Stream stream; + + public static Iterable wrapStream(final Stream stream) { + return new StreamWrapper<>(stream); + } + + private StreamWrapper(final Stream stream) { + this.stream = stream; + } + + @NotNull + @Override + public Iterator iterator() { + return stream.iterator(); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32CHasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32CHasher.java index cf3d29d9f..047814af3 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32CHasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32CHasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32Hasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32Hasher.java index 20cbfb7f9..42cf3b84e 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32Hasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/CRC32Hasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java index b188a3f82..1e3cf7e91 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumHasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -44,7 +44,7 @@ public String digest() { return Base64.encodeBase64String(toBytes(checksum.getValue())); } - private byte[] toBytes(final long x) { + private static byte[] toBytes(final long x) { final ByteBuffer buffer = ByteBuffer.allocate(8); buffer.order(ByteOrder.BIG_ENDIAN); buffer.putLong(x); diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java new file mode 100644 index 000000000..1779b7161 --- /dev/null +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/ChecksumUtils.java @@ -0,0 +1,61 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils.hashing; + +import com.spectralogic.ds3client.models.ChecksumType; + +import java.io.IOException; +import java.io.InputStream; + +public final class ChecksumUtils { + private static final int READ_BUFFER_SIZE = 10 * 1024 * 1024; + + private ChecksumUtils() {} + + public static Hasher getHasher(final ChecksumType.Type checksumType) { + switch (checksumType) { + case MD5: + return new MD5Hasher(); + case SHA_256: + return new SHA256Hasher(); + case SHA_512: + return new SHA512Hasher(); + case CRC_32: + return new CRC32Hasher(); + case CRC_32C: + return new CRC32CHasher(); + default: + throw new RuntimeException("Unknown checksum type " + checksumType); + } + } + + public static String hashInputStream(final Hasher digest, final InputStream stream) throws IOException { + final byte[] buffer = new byte[READ_BUFFER_SIZE]; + int bytesRead; + + while (true) { + bytesRead = stream.read(buffer); + + if (bytesRead < 0) { + break; + } + + digest.update(buffer, 0, bytesRead); + } + + return digest.digest(); + } +} diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java index 7fe13fedd..5501cbf12 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Crc32c.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -158,7 +158,7 @@ public void reset() { crc = 0; } - private long updateByte(final byte newByte, final long crc) { + private static long updateByte(final byte newByte, final long crc) { final byte b = (byte) (newByte & BYTE_MASK); final int index = (int) ((crc ^ b) & BYTE_MASK); return (CRC_TABLE[index] ^ (crc >> 8)) & LONG_MASK; diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/DigestHasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/DigestHasher.java index 116961ef6..7447ce38d 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/DigestHasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/DigestHasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Hasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Hasher.java index 67303d1f6..91663bfa7 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Hasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Hasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/MD5Hasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/MD5Hasher.java index 59147bc28..8e1d67a54 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/MD5Hasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/MD5Hasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Md5Hash.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Md5Hash.java index 116f152ac..55b6aeba4 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Md5Hash.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/Md5Hash.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA256Hasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA256Hasher.java index a250bcc08..cc5a34f68 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA256Hasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA256Hasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA512Hasher.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA512Hasher.java index 56accbd45..a0d7a4b32 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA512Hasher.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/hashing/SHA512Hasher.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/package-info.java b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/package-info.java index 8796730da..e05361648 100644 --- a/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/package-info.java +++ b/ds3-sdk/src/main/java/com/spectralogic/ds3client/utils/package-info.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/DeleteBucket.kt b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/DeleteBucket.kt new file mode 100644 index 000000000..3848b2e90 --- /dev/null +++ b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/DeleteBucket.kt @@ -0,0 +1,38 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers + +import com.spectralogic.ds3client.commands.DeleteBucketRequest +import com.spectralogic.ds3client.commands.DeleteObjectsRequest +import com.spectralogic.ds3client.utils.collections.asIterable +import com.spectralogic.ds3client.utils.collections.take + +object DeleteBucket { + fun deleteBucket(helpers: Ds3ClientHelpers, bucket: String) { + deleteBucketContents(helpers, bucket) + helpers.client.deleteBucket(DeleteBucketRequest(bucket)) + } + + fun deleteBucketContents(helpers: Ds3ClientHelpers, bucket: String) { + val client = helpers.client + val objIterator = helpers.listObjects(bucket).iterator() + + while(objIterator.hasNext()) { + val subIterator = objIterator.take(1_000) + client.deleteObjects(DeleteObjectsRequest(bucket, subIterator.asIterable())) + } + } +} \ No newline at end of file diff --git a/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker.kt b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker.kt new file mode 100644 index 000000000..d21b75185 --- /dev/null +++ b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker.kt @@ -0,0 +1,35 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers + +import com.spectralogic.ds3client.models.bulk.Ds3Object +import com.spectralogic.ds3client.utils.collections.StreamWrapper +import java.nio.file.Files +import java.nio.file.Path + +object FileTreeWalker { + /** + * Walks a file system starting at {@param startDir} and returns a Lazy Iterable with all the + * files represented as Ds3Objects. + */ + fun walk(startDir: Path) : Iterable { + return StreamWrapper.wrapStream(Files.walk(startDir).map { + Ds3Object(startDir.relativize(it).toString().replace("\\", "/"), Files.size(it)) + }.filter { + !it.name.isNullOrEmpty() + }) + } +} diff --git a/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/IterableExtensions.kt b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/IterableExtensions.kt new file mode 100644 index 000000000..fc975714b --- /dev/null +++ b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/IterableExtensions.kt @@ -0,0 +1,24 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils.collections + +fun Iterator.asIterable(): Iterable { + return IterableWrapper(this) +} + +private class IterableWrapper constructor(private val iterator: Iterator): Iterable { + override fun iterator(): Iterator = iterator +} diff --git a/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator.kt b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator.kt new file mode 100644 index 000000000..f450376a6 --- /dev/null +++ b/ds3-sdk/src/main/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator.kt @@ -0,0 +1,43 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils.collections + +class WindowedIterator constructor(private val iterator: Iterator, private val windowSize: Int) : Iterator by iterator { + + init { + if (windowSize <= 0) throw IllegalArgumentException("windowSize must be larger than 0") + } + + private var count = 0 + + override fun next(): T { + if (!hasNext()) throw NoSuchElementException("There are no new items to return") + + count++ + return iterator.next() + } + + override fun hasNext(): Boolean { + return if (count >= windowSize) { + false + } else { + iterator.hasNext() + } + } +} + +fun Iterator.take(n: Int): Iterator = WindowedIterator(this, n) + diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/ConnectionFixture.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/ConnectionFixture.java index 389a30d3f..5c412dca6 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/ConnectionFixture.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/ConnectionFixture.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,7 +18,7 @@ import com.spectralogic.ds3client.models.common.Credentials; import com.spectralogic.ds3client.networking.ConnectionDetails; -public class ConnectionFixture { +public final class ConnectionFixture { public static ConnectionDetails getConnection() { return getConnection(8080); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3ClientBuilder_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3ClientBuilder_Test.java index 52b4b67d5..882d33fd3 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3ClientBuilder_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3ClientBuilder_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java index 83f554a50..565e67eef 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,41 +15,50 @@ package com.spectralogic.ds3client; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; -import com.google.common.collect.Multimap; -import com.google.common.collect.TreeMultimap; +import com.google.common.collect.*; import com.spectralogic.ds3client.commands.*; import com.spectralogic.ds3client.commands.spectrads3.*; import com.spectralogic.ds3client.exceptions.ContentLengthNotMatchException; import com.spectralogic.ds3client.models.*; import com.spectralogic.ds3client.models.Objects; import com.spectralogic.ds3client.models.bulk.Ds3Object; +import com.spectralogic.ds3client.models.bulk.PartialDs3Object; import com.spectralogic.ds3client.models.common.Credentials; +import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.models.multipart.CompleteMultipartUpload; +import com.spectralogic.ds3client.models.multipart.Part; import com.spectralogic.ds3client.networking.FailedRequestException; import com.spectralogic.ds3client.networking.FailedRequestUsingMgmtPortException; import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import com.spectralogic.ds3client.utils.PropertyUtils; import com.spectralogic.ds3client.utils.ResourceUtils; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; -import static org.junit.Assert.assertTrue; import java.io.IOException; import java.net.URISyntaxException; import java.nio.channels.FileChannel; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.Month; +import java.time.ZoneId; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; public class Ds3Client_Test { private static final UUID MASTER_OBJECT_LIST_JOB_ID = UUID.fromString("1a85e743-ec8f-4789-afec-97e587a26936"); @@ -71,6 +80,18 @@ public class Ds3Client_Test { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + private final static String IDS_REQUEST_PAYLOAD = "id1id2id3"; + private final static ImmutableList IDS_REQUEST_PAYLOAD_LIST = ImmutableList.of("id1", "id2", "id3"); + + private static final String SIMPLE_OBJECT_REQUEST_PAYLOAD = ""; + private static final List SIMPLE_OBJECT_LIST = Arrays.asList( + new Ds3Object("file1"), + new Ds3Object("file2"), + new Ds3Object("file3") + ); + + private static final String SIMPLE_BULK_OBJECT_LIST_RESPONSE = ""; + @Before public void setTimeZone() { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); @@ -80,7 +101,7 @@ public void setTimeZone() { public void getBuckets() throws IOException, ParseException { final UUID id = UUID.randomUUID(); final String stringResponse = "\n" + - "" + id.toString() + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09"; + "" + id + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09"; final List expectedBucketNames = Arrays.asList( "testBucket2", @@ -138,9 +159,9 @@ public void getBadBuckets() throws IOException { public void getBucket() throws IOException, ParseException { final UUID id = UUID.randomUUID(); final String xmlResponse = "remoteTest161000falseuser/hduser/gutenberg/20417.txt.utf-82014-01-03T13:26:47.000Z8B19F3F41868106382A677C3435BDCE5674570STANDARD" + - "" + id.toString() + "ryanuser/hduser/gutenberg/5000.txt.utf-82014-01-03T13:26:47.000Z9DE344878423E44B129730CE22B4B1371423803STANDARD" + - "" + id.toString() + "ryanuser/hduser/gutenberg/4300.txt.utf-82014-01-03T13:26:47.000Z33EE4519EA7DDAB27CA4E2742326D70B1573150DEEP" + - "" + id.toString() + "ryan"; + "" + id + "ryanuser/hduser/gutenberg/5000.txt.utf-82014-01-03T13:26:47.000Z9DE344878423E44B129730CE22B4B1371423803STANDARD" + + "" + id + "ryanuser/hduser/gutenberg/4300.txt.utf-82014-01-03T13:26:47.000Z33EE4519EA7DDAB27CA4E2742326D70B1573150DEEP" + + "" + id + "ryan"; final ListBucketResult result = MockNetwork .expecting(HttpVerb.GET, "/remoteTest16", null, null) @@ -157,7 +178,7 @@ public void getBucket() throws IOException, ParseException { final List objects = result.getObjects(); assertThat(objects, is(notNullValue())); assertThat(objects.size(), is(3)); - this.assertObjectsEquals( + Ds3Client_Test.assertObjectsEquals( objects.get(0), "user/hduser/gutenberg/20417.txt.utf-8", DATE_FORMAT.parse("2014-01-03T13:26:47.000Z"), @@ -165,7 +186,7 @@ public void getBucket() throws IOException, ParseException { 674570, "STANDARD" ); - this.assertObjectsEquals( + Ds3Client_Test.assertObjectsEquals( objects.get(1), "user/hduser/gutenberg/5000.txt.utf-8", DATE_FORMAT.parse("2014-01-03T13:26:47.000Z"), @@ -173,7 +194,7 @@ public void getBucket() throws IOException, ParseException { 1423803, "STANDARD" ); - this.assertObjectsEquals( + Ds3Client_Test.assertObjectsEquals( objects.get(2), "user/hduser/gutenberg/4300.txt.utf-8", DATE_FORMAT.parse("2014-01-03T13:26:47.000Z"), @@ -183,7 +204,7 @@ public void getBucket() throws IOException, ParseException { ); } - private void assertObjectsEquals( + private static void assertObjectsEquals( final Contents objects, final String key, final Date lastModified, @@ -204,7 +225,7 @@ public void getObjectsSpectraS3() throws IOException, ParseException { queryParams.put("bucket_id", bucketId); final String stringResponse = "" + - "a24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.694Ze37c3ce0-12aa-4f54-87e3-42532aca0e5ebeowulf.txtDATA1a24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.779Zdc628815-c723-4c4e-b68b-5f5d10f38af5sherlock_holmes.txtDATA1a24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.772Z4f6985fd-fbae-4421-ba27-66fdb96187c5tale_of_two_cities.txtDATA1a24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.696Z82c18910-fadb-4461-a152-bf714ae91b55ulysses.txtDATA1"; + "a24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.694Ze37c3ce0-12aa-4f54-87e3-42532aca0e5ebeowulf.txtDATAa24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.779Zdc628815-c723-4c4e-b68b-5f5d10f38af5sherlock_holmes.txtDATAa24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.772Z4f6985fd-fbae-4421-ba27-66fdb96187c5tale_of_two_cities.txtDATAa24d14f3-e2f0-4bfb-ab71-f99d5ef437452015-09-21T20:06:47.696Z82c18910-fadb-4461-a152-bf714ae91b55ulysses.txtDATA"; final ImmutableMap responseHeaders = ImmutableMap.of( "page-truncated", "0", @@ -224,7 +245,6 @@ public void getObjectsSpectraS3() throws IOException, ParseException { beowulf.setId(UUID.fromString("e37c3ce0-12aa-4f54-87e3-42532aca0e5e")); beowulf.setName("beowulf.txt"); beowulf.setType(S3ObjectType.DATA); - beowulf.setVersion(1); final S3Object notBeowulf = new S3Object(); notBeowulf.setBucketId(UUID.fromString("a24d14f3-e2f0-4bfb-ab71-f99d5ef43745")); @@ -232,7 +252,6 @@ public void getObjectsSpectraS3() throws IOException, ParseException { notBeowulf.setId(UUID.fromString("e37c3ce0-12aa-4f54-87e3-42532aca0e5e")); notBeowulf.setName("notBeowulf.txt"); notBeowulf.setType(S3ObjectType.DATA); - notBeowulf.setVersion(1); assertThat(objects.size(), is(4)); assertThat(s3ObjectExists(objects, beowulf), is(true)); @@ -263,7 +282,7 @@ public void getObjectsSpectraS3ParseHeaderException() throws IOException, ParseE } - private boolean s3ObjectExists(final List objects, final S3Object s3obj) { + private static boolean s3ObjectExists(final List objects, final S3Object s3obj) { for (final S3Object obj : objects) { if (s3obj.equals(obj)) { return true; @@ -379,7 +398,7 @@ public void createObject() throws IOException, URISyntaxException { final Path resourcePath = ResourceUtils.loadFileResource("LoremIpsumTwice.txt"); final byte[] fileBytes = Files.readAllBytes(resourcePath); - final String output = new String(fileBytes, Charset.forName("UTF-8")); + final String output = new String(fileBytes, StandardCharsets.UTF_8); final FileChannel channel = FileChannel.open(resourcePath, StandardOpenOption.READ); MockNetwork .expecting(HttpVerb.PUT, "/bucketName/objectName", queryParams, output) @@ -403,7 +422,7 @@ public void createObjectWithMetadata() throws IOException, URISyntaxException { final Path resourcePath = ResourceUtils.loadFileResource("LoremIpsumTwice.txt"); final byte[] fileBytes = Files.readAllBytes(resourcePath); - final String output = new String(fileBytes, Charset.forName("UTF-8")); + final String output = new String(fileBytes, StandardCharsets.UTF_8); final FileChannel channel = FileChannel.open(resourcePath, StandardOpenOption.READ); final PutObjectRequest por = new PutObjectRequest( @@ -439,7 +458,7 @@ public void createObjectWithNullAndEmptyMetadata() throws IOException, URISyntax final Path resourcePath = ResourceUtils.loadFileResource("LoremIpsumTwice.txt"); final byte[] fileBytes = Files.readAllBytes(resourcePath); - final String output = new String(fileBytes, Charset.forName("UTF-8")); + final String output = new String(fileBytes, StandardCharsets.UTF_8); final FileChannel channel = FileChannel.open(resourcePath, StandardOpenOption.READ); final PutObjectRequest por = new PutObjectRequest( @@ -465,18 +484,48 @@ public void createObjectWithNullAndEmptyMetadata() throws IOException, URISyntax @Test public void headObjectWithMetadata() throws IOException { + final UUID versionId = UUID.randomUUID(); final Map responseHeaders = new HashMap<>(); responseHeaders.put("x-amz-meta-key", "value"); + responseHeaders.put("ds3-blob-checksum-type", "MD5"); + responseHeaders.put("ds3-blob-checksum-offset-0", "4nQGNX4nyz0pi8Hvap79PQ=="); + responseHeaders.put("ds3-blob-checksum-offset-10485760", "965Aa0/n8DlO1IwXYFh4bg=="); + responseHeaders.put("ds3-blob-checksum-offset-20971520", "iV2OqJaXJ/jmqgRSb1HmFA=="); + responseHeaders.put("creation-date", "2019-07-11T20:35:47.000Z"); + responseHeaders.put("version-id", versionId.toString()); final HeadObjectRequest request = new HeadObjectRequest("bucket", "obj"); - MockNetwork + final HeadObjectResponse response = MockNetwork .expecting(HttpVerb.HEAD, "/bucket/obj", null, null, null) .returning(200, "", responseHeaders) .asClient() .headObject(request); + + final ImmutableMap expectedBlobChecksums = ImmutableMap.of( + 0L, "4nQGNX4nyz0pi8Hvap79PQ==", + 10485760L, "965Aa0/n8DlO1IwXYFh4bg==", + 20971520L, "iV2OqJaXJ/jmqgRSb1HmFA==" + ); + + assertThat(response.getBlobChecksumType(), is(ChecksumType.Type.MD5)); + assertThat(response.getBlobChecksums().size(), is(expectedBlobChecksums.size())); + + for (final Map.Entry entry : expectedBlobChecksums.entrySet()) { + assertTrue(response.getBlobChecksums().containsKey(entry.getKey())); + assertThat(response.getBlobChecksums().get(entry.getKey()), is(entry.getValue())); + } + + assertThat(response.getVersionId(), is(versionId)); + assertThat(response.getCreationDate().getYear(), is(2019)); + assertThat(response.getCreationDate().getMonth(), is(Month.JULY)); + assertThat(response.getCreationDate().getDayOfMonth(), is(11)); + assertThat(response.getCreationDate().getHour(), is(20)); + assertThat(response.getCreationDate().getMinute(), is(35)); + assertThat(response.getCreationDate().getSecond(), is(47)); + assertThat(response.getCreationDate().getZone(), is(ZoneId.of("Z"))); } @Test @@ -504,24 +553,12 @@ public void getObjectWithMetaData() throws IOException { @Test public void createPutJobSpectraS3() throws IOException { - this.runBulkTest(BulkCommand.PUT, new BulkTestDriver() { - @Override - public MasterObjectList performRestCall(final Ds3Client client, final String bucket, final List objects) - throws IOException { - return client.putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(bucket, objects)).getMasterObjectList(); - } - }); + Ds3Client_Test.runBulkTest(BulkCommand.PUT, (client, bucket, objects) -> client.putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(bucket, objects)).getMasterObjectList()); } @Test public void createGetJobSpectraS3() throws IOException { - this.runBulkTest(BulkCommand.GET, new BulkTestDriver() { - @Override - public MasterObjectList performRestCall(final Ds3Client client, final String bucket, final List objects) - throws IOException { - return client.getBulkJobSpectraS3(new GetBulkJobSpectraS3Request(bucket, objects)).getMasterObjectList(); - } - }); + Ds3Client_Test.runBulkTest(BulkCommand.GET, (client, bucket, objects) -> client.getBulkJobSpectraS3(new GetBulkJobSpectraS3Request(bucket, objects)).getMasterObjectList()); } private interface BulkTestDriver { @@ -529,7 +566,7 @@ MasterObjectList performRestCall(final Ds3Client client, final String bucket, fi throws IOException; } - public void runBulkTest(final BulkCommand command, final BulkTestDriver driver) throws IOException { + private static void runBulkTest(final BulkCommand command, final Ds3Client_Test.BulkTestDriver driver) throws IOException { final List objects = Arrays.asList( new Ds3Object("file1", 256), new Ds3Object("file2", 1202), @@ -647,9 +684,11 @@ public void getJobChunksReadyForClientProcessingSpectraS3() throws IOException, final Map queryParams = new HashMap<>(); queryParams.put("job", MASTER_OBJECT_LIST_JOB_ID.toString()); + final Map headers = new HashMap<>(); + headers.put("retry-after", "10"); final GetJobChunksReadyForClientProcessingSpectraS3Response response = MockNetwork .expecting(HttpVerb.GET, "/_rest_/job_chunk", queryParams, null) - .returning(200, MASTER_OBJECT_LIST_XML) + .returning(200, MASTER_OBJECT_LIST_XML, headers) .asClient() .getJobChunksReadyForClientProcessingSpectraS3(new GetJobChunksReadyForClientProcessingSpectraS3Request(MASTER_OBJECT_LIST_JOB_ID.toString())); @@ -909,6 +948,7 @@ public void testSettingUserAgent() { } @Test + @Ignore // The underlying code references a property file that does not appear to exist: PROPERTIES_FILE_NAME public void testGettingDefaultUserAgent() { final Ds3Client client = Ds3ClientBuilder.create("endpoint", new Credentials("access", "key")) .build(); @@ -926,7 +966,7 @@ public void testGettingDefaultUserAgent() { final String userAgent = newClient.getConnectionDetails().getUserAgent(); final String[] userAgentFields = userAgent.split("-"); - assertTrue(userAgentFields.length >= 2); + assertThat(userAgentFields.length, is(greaterThanOrEqualTo(2))); // look for a pattern like 3.4.0, but leave open the possibility of a string like 3.4.0-SNAPSHOT final Pattern matchPattern = Pattern.compile("\\d+\\.\\d+\\.\\d+"); @@ -936,7 +976,15 @@ public void testGettingDefaultUserAgent() { } @Test - public void VerifySystemHealthSpectraS3() throws IOException { + @Ignore // The underlying code references a property file that does not appear to exist: PROPERTIES_FILE_NAME + public void testGettingGitCommitHash() { + final String gitCommitHash = PropertyUtils.getGitCommitHash(); + + assertEquals(40, gitCommitHash.length()); + } + + @Test + public void verifySystemHealthSpectraS3() throws IOException { final String responsePayload = "0"; final VerifySystemHealthSpectraS3Response response = MockNetwork @@ -1088,7 +1136,7 @@ public void deletePermanentlyLostTapeSpectraS3() throws IOException { final UUID id = UUID.randomUUID(); final DeletePermanentlyLostTapeSpectraS3Response response = MockNetwork - .expecting(HttpVerb.DELETE, "/_rest_/tape/" + id.toString(), null, null) + .expecting(HttpVerb.DELETE, "/_rest_/tape/" + id, null, null) .returning(204, "") .asClient() .deletePermanentlyLostTapeSpectraS3(new DeletePermanentlyLostTapeSpectraS3Request(id.toString())); @@ -1136,4 +1184,433 @@ public void getObjectVerifyFullPayload() throws IOException { jobIdString, 0)); } + + @Test + public void clearSuspectBlobAzureTargetsSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.DELETE, "/_rest_/suspect_blob_azure_target", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .clearSuspectBlobAzureTargetsSpectraS3(new ClearSuspectBlobAzureTargetsSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void clearSuspectBlobPoolsSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.DELETE, "/_rest_/suspect_blob_pool", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .clearSuspectBlobPoolsSpectraS3(new ClearSuspectBlobPoolsSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void clearSuspectBlobS3TargetsSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.DELETE, "/_rest_/suspect_blob_s3_target", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .clearSuspectBlobS3TargetsSpectraS3(new ClearSuspectBlobS3TargetsSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void clearSuspectBlobTapesSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.DELETE, "/_rest_/suspect_blob_tape", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .clearSuspectBlobTapesSpectraS3(new ClearSuspectBlobTapesSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void markSuspectBlobAzureTargetsAsDegradedSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/suspect_blob_azure_target", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .markSuspectBlobAzureTargetsAsDegradedSpectraS3(new MarkSuspectBlobAzureTargetsAsDegradedSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void markSuspectBlobDs3TargetsAsDegradedSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/suspect_blob_ds3_target", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .markSuspectBlobDs3TargetsAsDegradedSpectraS3(new MarkSuspectBlobDs3TargetsAsDegradedSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void markSuspectBlobPoolsAsDegradedSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/suspect_blob_pool", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .markSuspectBlobPoolsAsDegradedSpectraS3(new MarkSuspectBlobPoolsAsDegradedSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void markSuspectBlobS3TargetsAsDegradedSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/suspect_blob_s3_target", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .markSuspectBlobS3TargetsAsDegradedSpectraS3(new MarkSuspectBlobS3TargetsAsDegradedSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void markSuspectBlobTapesAsDegradedSpectraS3Test() throws IOException { + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/suspect_blob_tape", new HashMap<>(), IDS_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .markSuspectBlobTapesAsDegradedSpectraS3(new MarkSuspectBlobTapesAsDegradedSpectraS3Request(IDS_REQUEST_PAYLOAD_LIST)); + } + + @Test + public void getBulkJobSpectraS3WithMixedPayloadTest() throws IOException { + final List objects = Arrays.asList( + new Ds3Object("file1", 256), + new PartialDs3Object("file2", new Range(1202, 1402)), + new Ds3Object("file3", 2523) + ); + + final String bucketName = "bulkTest"; + + final String expectedRequestPayload = ""; + + final String xmlResponse = ""; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "start_bulk_get"); + + final GetBulkJobSpectraS3Response response = MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/bucket/" + bucketName, queryParams, expectedRequestPayload) + .returning(200, xmlResponse) + .asClient() + .getBulkJobSpectraS3(new GetBulkJobSpectraS3Request(bucketName, objects)); + + final List objectListList = response.getMasterObjectList().getObjects(); + assertThat(objectListList.size(), is(1)); + + final List objectList = objectListList.get(0).getObjects(); + assertThat(objectList.size(), is(3)); + + assertObjectEquals(objectList.get(0), "file2", 1202); + assertObjectEquals(objectList.get(1), "file1", 256); + assertObjectEquals(objectList.get(2), "file3", 2523); + } + + + @Test + public void verifyBulkJobSpectraS3Test() throws IOException { + final List objects = Arrays.asList( + new Ds3Object("file1"), + new PartialDs3Object("file2", new Range(1202, 1402)), + new Ds3Object("file3") + ); + + final String bucketName = "bulkTest"; + + final String expectedRequestPayload = ""; + + final String xmlResponse = ""; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "start_bulk_verify"); + + final VerifyBulkJobSpectraS3Response response = MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/bucket/" + bucketName, queryParams, expectedRequestPayload) + .returning(200, xmlResponse) + .asClient() + .verifyBulkJobSpectraS3(new VerifyBulkJobSpectraS3Request(bucketName, objects)); + + final List objectListList = response.getMasterObjectListResult().getObjects(); + assertThat(objectListList.size(), is(1)); + + final List objectList = objectListList.get(0).getObjects(); + assertThat(objectList.size(), is(3)); + + assertObjectEquals(objectList.get(0), "file2", 1202); + assertObjectEquals(objectList.get(1), "file1", 256); + assertObjectEquals(objectList.get(2), "file3", 2523); + } + + @Test + public void getPhysicalPlacementForObjectsTest() throws IOException { + final String responsePayload = ""; + final String bucketName = "BucketName"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + final GetPhysicalPlacementForObjectsSpectraS3Response response = MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/bucket/" + bucketName, queryParams, SIMPLE_OBJECT_REQUEST_PAYLOAD) + .returning(200, responsePayload) + .asClient() + .getPhysicalPlacementForObjectsSpectraS3(new GetPhysicalPlacementForObjectsSpectraS3Request(bucketName, SIMPLE_OBJECT_LIST)); + + assertThat(response.getPhysicalPlacementResult().getAzureTargets(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getDs3Targets(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getPools(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getS3Targets(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getTapes(), is(nullValue())); + } + + @Test + public void getPhysicalPlacementForObjectsWithFullDetailsTest() throws IOException { + final String responsePayload = ""; + final String bucketName = "BucketName"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + queryParams.put("full_details", null); + + final GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response response = MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/bucket/" + bucketName, queryParams, SIMPLE_OBJECT_REQUEST_PAYLOAD) + .returning(200, responsePayload) + .asClient() + .getPhysicalPlacementForObjectsWithFullDetailsSpectraS3(new GetPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request(bucketName, SIMPLE_OBJECT_LIST)); + + assertThat(response.getBulkObjectListResult().getObjects().size(), is(1)); + } + + @Test + public void verifyPhysicalPlacementForObjectsTest() throws IOException { + final String responsePayload = "false10000t1false48d30ecb-84f1-4721-9832-7aa165a1dd7776343269-c32a-4cb0-aec4-57a9dccce6eaPENDING_INSPECTIONfalse20000LTO5false"; + final String bucketName = "BucketName"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "verify_physical_placement"); + + final VerifyPhysicalPlacementForObjectsSpectraS3Response response = MockNetwork + .expecting(HttpVerb.GET, "/_rest_/bucket/" + bucketName, queryParams, SIMPLE_OBJECT_REQUEST_PAYLOAD) + .returning(200, responsePayload) + .asClient() + .verifyPhysicalPlacementForObjectsSpectraS3(new VerifyPhysicalPlacementForObjectsSpectraS3Request(bucketName, SIMPLE_OBJECT_LIST)); + + assertThat(response.getPhysicalPlacementResult().getAzureTargets(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getDs3Targets(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getPools(), is(nullValue())); + assertThat(response.getPhysicalPlacementResult().getTapes().size(), is(1)); + } + + @Test + public void verifyPhysicalPlacementForObjectsWithFullDetailsTest() throws IOException { + final String responsePayload = "false10000t1false5a7bb215-4aff-4806-b217-5fe01ade6a2c2e5b25fc-546e-45b0-951e-8f3d80bb7823PENDING_INSPECTIONfalse20000LTO5false"; + final String bucketName = "BucketName"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "verify_physical_placement"); + queryParams.put("full_details", null); + + final VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Response response = MockNetwork + .expecting(HttpVerb.GET, "/_rest_/bucket/" + bucketName, queryParams, SIMPLE_OBJECT_REQUEST_PAYLOAD) + .returning(200, responsePayload) + .asClient() + .verifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3(new VerifyPhysicalPlacementForObjectsWithFullDetailsSpectraS3Request(bucketName, SIMPLE_OBJECT_LIST)); + + assertThat(response.getBulkObjectListResult().getObjects().size(), is(1)); + } + + @Test + public void ejectStorageDomainBlobsTest() throws IOException { + final String bucketId = "BucketId"; + final String storageDomainId = "StorageDomainId"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "eject"); + queryParams.put("blobs", null); + queryParams.put("bucket_id", bucketId); + queryParams.put("storage_domain", storageDomainId); + + MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/tape", queryParams, SIMPLE_OBJECT_REQUEST_PAYLOAD) + .returning(204, "") + .asClient() + .ejectStorageDomainBlobsSpectraS3(new EjectStorageDomainBlobsSpectraS3Request(bucketId, SIMPLE_OBJECT_LIST, storageDomainId)); + } + + @Test + public void replicatePutJobTest() throws IOException { + final String responsePayload = ""; + final String requestPayload = "This is the request payload content"; + final String bucketName = "BucketName"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "start_bulk_put"); + queryParams.put("replicate", null); + + final ReplicatePutJobSpectraS3Response response = MockNetwork + .expecting(HttpVerb.PUT, "/_rest_/bucket/" + bucketName, queryParams, requestPayload) + .returning(200, responsePayload) + .asClient() + .replicatePutJobSpectraS3(new ReplicatePutJobSpectraS3Request(bucketName, requestPayload)); + + assertThat(response.getMasterObjectListResult().getObjects().size(), is(1)); + } + + @Test + public void getBlobPersistenceTest() throws IOException { + final String responsePayload = "This is the response payload content"; + final String requestPayload = "This is the request payload content"; + + final Map queryParams = new HashMap<>(); + + final GetBlobPersistenceSpectraS3Response response = MockNetwork + .expecting(HttpVerb.GET, "/_rest_/blob_persistence", queryParams, requestPayload) + .returning(200, responsePayload) + .asClient() + .getBlobPersistenceSpectraS3(new GetBlobPersistenceSpectraS3Request(requestPayload)); + + assertThat(response.getStringResult(), is(responsePayload)); + } + + @Test + public void getBlobsOnAzureTargetTest() throws IOException { + final String target = "Target"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + MockNetwork + .expecting(HttpVerb.GET, "/_rest_/azure_target/" + target, queryParams, null) + .returning(200, SIMPLE_BULK_OBJECT_LIST_RESPONSE) + .asClient() + .getBlobsOnAzureTargetSpectraS3(new GetBlobsOnAzureTargetSpectraS3Request(target)); + } + + @Test + public void getBlobsOnTapeTest() throws IOException { + final String target = "Target"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + final Map responseHeaders = new HashMap<>(); + responseHeaders.put("page-truncated", "0"); + responseHeaders.put("total-result-count", "2"); + + final GetBlobsOnTapeSpectraS3Response result = MockNetwork + .expecting(HttpVerb.GET, "/_rest_/tape/" + target, queryParams, null) + .returning(200, SIMPLE_BULK_OBJECT_LIST_RESPONSE, responseHeaders) + .asClient() + .getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(target)); + + assertThat(result.getPagingTruncated(), is(0)); + assertThat(result.getPagingTotalResultCount(), is(2)); + } + + @Test + public void getBlobsOnS3TargetTest() throws IOException { + final String target = "Target"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + MockNetwork + .expecting(HttpVerb.GET, "/_rest_/s3_target/" + target, queryParams, null) + .returning(200, SIMPLE_BULK_OBJECT_LIST_RESPONSE) + .asClient() + .getBlobsOnS3TargetSpectraS3(new GetBlobsOnS3TargetSpectraS3Request(target)); + } + + @Test + public void getBlobsOnPoolTest() throws IOException { + final String target = "Target"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + MockNetwork + .expecting(HttpVerb.GET, "/_rest_/pool/" + target, queryParams, null) + .returning(200, SIMPLE_BULK_OBJECT_LIST_RESPONSE) + .asClient() + .getBlobsOnPoolSpectraS3(new GetBlobsOnPoolSpectraS3Request(target)); + } + + @Test + public void getBlobsOnDs3TargetTest() throws IOException { + final String target = "Target"; + + final Map queryParams = new HashMap<>(); + queryParams.put("operation", "get_physical_placement"); + + MockNetwork + .expecting(HttpVerb.GET, "/_rest_/ds3_target/" + target, queryParams, null) + .returning(200, SIMPLE_BULK_OBJECT_LIST_RESPONSE) + .asClient() + .getBlobsOnDs3TargetSpectraS3(new GetBlobsOnDs3TargetSpectraS3Request(target)); + } + + @Test + public void getObjectNullChannelDeprecatedConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new GetObjectRequest("BucketName", "ObjectName", null)); + } + + @Test + public void getObjectNullChannelUuidConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new GetObjectRequest("BucketName", "ObjectName", null, UUID.randomUUID(), 0)); + } + + @Test + public void getObjectNullChannelStringConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new GetObjectRequest("BucketName", "ObjectName", null, "JobId", 0)); + } + + @Test + public void getObjectNullStreamUuidConstructorTest() { + testNonnullStreamChannelExceptions("Stream", + () -> new GetObjectRequest("BucketName", "ObjectName", UUID.randomUUID(), 0, null)); + } + + @Test + public void getObjectNullStreamStringConstructorTest() { + testNonnullStreamChannelExceptions("Stream", + () -> new GetObjectRequest("BucketName", "ObjectName", "JobId", 0, null)); + } + + @Test + public void putObjectDeprecatedConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new PutObjectRequest("BucketName", "ObjectName", null, 0)); + } + + @Test + public void putObjectNullChannelUuidConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new PutObjectRequest("BucketName", "ObjectName", null, UUID.randomUUID(),0, 0)); + } + + @Test + public void putObjectNullChannelStringConstructorTest() { + testNonnullStreamChannelExceptions("Channel", + () -> new PutObjectRequest("BucketName", "ObjectName", null, "JobId",0, 0)); + } + + @Test + public void putObjectNullStreamUuidConstructorTest() { + testNonnullStreamChannelExceptions("Stream", + () -> new PutObjectRequest("BucketName", "ObjectName", UUID.randomUUID(), 0, 0, null)); + } + + @Test + public void putObjectNullStreamStringConstructorTest() { + testNonnullStreamChannelExceptions("Stream", + () -> new PutObjectRequest("BucketName", "ObjectName", "JobId", 0, 0, null)); + } + + private static void testNonnullStreamChannelExceptions(final String paramName, final Runnable runnable) { + try { + runnable.run(); + fail(); + } catch (final NullPointerException e) { + assertThat(e.getMessage(), is(paramName + " may not be null.")); + } catch (final IllegalArgumentException e) { + // IntelliJ IDEA throws an IllegalArgumentException if parameters are annotated as non-null are passed null values + assertThat(e.getMessage(), startsWith("Argument for @Nonnull parameter '" + paramName.toLowerCase() + "'")); + } + } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/Issue625Injection_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Issue625Injection_Test.java new file mode 100644 index 000000000..1e4790125 --- /dev/null +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/Issue625Injection_Test.java @@ -0,0 +1,39 @@ +package com.spectralogic.ds3client; + +import com.spectralogic.ds3client.models.common.Credentials; +import com.spectralogic.ds3client.networking.ConnectionDetails; +import com.spectralogic.ds3client.networking.NetworkClient; +import com.spectralogic.ds3client.networking.NetworkClientImpl; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.junit.Test; +import static org.mockito.Mockito.mock; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +public class Issue625Injection_Test { + + @Test(timeout = 10000) + public void testHttpClientInjection() { + final ConnectionDetails connectionDetails = ConnectionDetailsImpl.builder("http://localhost:8080", new Credentials("id", "key")).build(); + final CloseableHttpClient customHttpClient = HttpClients.createDefault(); + + // This constructor was previously private + final NetworkClient netClient = new NetworkClientImpl(connectionDetails, customHttpClient); + + final Ds3Client ds3Client = new Ds3ClientImpl(netClient); + + assertThat(((Ds3ClientImpl)ds3Client).getNetClient(), is(netClient)); + } + + @Test(timeout = 10000) + public void testBuilderNetworkClientInjection() { + final NetworkClient netClient = mock(NetworkClient.class); + + final Ds3Client ds3Client = Ds3ClientBuilder.create("http://localhost:8080", new Credentials("id", "key")) + .withNetworkClient(netClient) + .build(); + + assertThat(((Ds3ClientImpl)ds3Client).getNetClient(), is(netClient)); + } +} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockNetwork.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockNetwork.java index 35e73bba3..dd65ba249 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockNetwork.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockNetwork.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -92,7 +92,7 @@ public MockNetwork returning( public MockNetwork returning( final int statusCode, final String responseContent) { - return returning(statusCode, responseContent, new HashMap()); + return returning(statusCode, responseContent, new HashMap<>()); } public Ds3Client asClient() { @@ -105,7 +105,7 @@ public WebResponse getResponse(final Ds3Request request) assertThat(request.getVerb(), is(this.verb)); assertThat(request.getPath(), is(this.path)); if (this.queryParams != null) { - this.assertMapsEqual(this.queryParams, request.getQueryParams()); + MockNetwork.assertMapsEqual(this.queryParams, request.getQueryParams()); } if(this.requestHeaders != null){ @@ -128,7 +128,7 @@ public WebResponse getResponse(final Ds3Request request) return new MockedWebResponse(this.responseContent, this.statusCode, this.headers); } - private void assertMapsEqual(final Map expectedMap, final Map actualMap) { + private static void assertMapsEqual(final Map expectedMap, final Map actualMap) { assertThat(actualMap, is(notNullValue())); assertThat(actualMap.size(), is(expectedMap.size())); for (final Map.Entry entry : expectedMap.entrySet()) { diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedHeaders.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedHeaders.java index 9563fe716..a63a176ea 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedHeaders.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedHeaders.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -45,7 +45,7 @@ public List get(final String key) { @Override public Set keys() { - return null; + return headerValues.keySet(); } protected Set getRealKeys() { diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java index 091fc95af..fe7fc3817 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/MockedWebResponse.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/GetObjectRequest_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/GetObjectRequest_Test.java index 0aea872ba..3513ef4fc 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/GetObjectRequest_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/GetObjectRequest_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,6 +16,7 @@ package com.spectralogic.ds3client.commands; import com.spectralogic.ds3client.models.common.Range; +import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; import org.junit.Test; import java.util.ArrayList; @@ -33,7 +34,7 @@ public void singleRangeFormat() { final GetObjectRequest request = new GetObjectRequest( "bucketName", "objectName", - null, + new ByteArraySeekableByteChannel(0), UUID.randomUUID().toString(), 0); @@ -52,7 +53,7 @@ public void multipleRangeFormat() { final GetObjectRequest request = new GetObjectRequest( "bucketName", "objectName", - null, + new ByteArraySeekableByteChannel(0), UUID.randomUUID().toString(), 0); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/MetadataImpl_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/MetadataImpl_Test.java index 8d3686352..1a75eea63 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/MetadataImpl_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/MetadataImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -68,7 +68,31 @@ public void getMultiValueWithSpace() { assertThat(value.get(2), is("value3")); } - private Metadata genMetadata(final Header... headers) { + @Test + public void getSingleValueLtfs() { + final String userGuid = "060a2b340101010101010f0013-000000-709e29c2d1e20085-e7610015b2a9-a854"; + final Metadata metadata = genMetadata(new BasicHeader("x-spectra-ltfs-user.guid", userGuid)); + final List userGuids = metadata.get("user.guid"); + assertThat(userGuids, is(notNullValue())); + assertFalse(userGuids.isEmpty()); + assertThat(userGuids.size(), is(1)); + assertThat(userGuids.get(0), is(userGuid)); + } + + @Test + public void getTwoValuesLtfs() { + final String userGuid1 = "060a2b340101010101010f0013-000000-709e29c2d1e20085-e7610015b2a9-a854"; + final String userGuid2 = "160a2b340101010101010f0013-000000-709e29c2d1e20085-e7610015b2a9-a854"; + final Metadata metadata = genMetadata(new BasicHeader("x-spectra-ltfs-user.guid", userGuid1 + "," + userGuid2)); + final List userGuids = metadata.get("user.guid"); + assertThat(userGuids, is(notNullValue())); + assertFalse(userGuids.isEmpty()); + assertThat(userGuids.size(), is(2)); + assertThat(userGuids.get(0), is(userGuid1)); + assertThat(userGuids.get(1), is(userGuid2)); + } + + private static Metadata genMetadata(final Header... headers) { final ImmutableMultimap.Builder mapBuilder = ImmutableMultimap.builder(); for (final Header header : headers) { diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/SeekableByteChannelInputStream_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/SeekableByteChannelInputStream_Test.java index 1eadaa633..6ee911855 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/SeekableByteChannelInputStream_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/SeekableByteChannelInputStream_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -95,12 +95,12 @@ public void closeCallsClose() throws IOException { Mockito.verifyNoMoreInteractions(mockChannel); } - private void readAndVerify(final InputStream inputStream, final byte[] expectedBytes) + private static void readAndVerify(final InputStream inputStream, final byte[] expectedBytes) throws IOException, URISyntaxException { final byte[] resultBuffer = new byte[expectedBytes.length]; final byte[] buffer = new byte[10]; int position = 0; - int bytesRead = 0; + int bytesRead; while (0 < (bytesRead = inputStream.read(buffer, 5, 5))) { for (int i = 0; i < bytesRead; i++) { resultBuffer[position] = buffer[5 + i]; diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl_Test.java index 729ff1129..657da87a2 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/interfaces/RequestHeadersImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -36,25 +36,25 @@ private static RequestHeaders getTestRequestHeaders() { } @Test (expected = NullPointerException.class) - public void put_Null_Test() { + public void putNullTest() { final RequestHeaders rh = getTestRequestHeaders(); rh.put(null, null); } @Test (expected = NullPointerException.class) - public void put_NullValue_Test() { + public void putNullValueTest() { final RequestHeaders rh = getTestRequestHeaders(); rh.put("Key", null); } @Test (expected = NullPointerException.class) - public void put_NullKey_Test() { + public void putNullKeyTest() { final RequestHeaders rh = getTestRequestHeaders(); rh.put(null, "Value"); } @Test - public void put_PercentEncoding_Test() { + public void putPercentEncodingTest() { final RequestHeaders rh = getTestRequestHeaders(); rh.put("Key With Space", "Val With Space"); final Multimap result = rh.getMultimap(); @@ -62,13 +62,13 @@ public void put_PercentEncoding_Test() { } @Test (expected = NullPointerException.class) - public void get_Null_Test() { + public void getNullTest() { final RequestHeaders rh = getTestRequestHeaders(); rh.get(null); } @Test - public void get_Test() { + public void getTest() { final RequestHeaders rh = getTestRequestHeaders(); assertThat(rh.get("").size(), is(0)); assertThat(rh.get("Key One").size(), is(2)); @@ -77,17 +77,17 @@ public void get_Test() { } @Test - public void size_Test() { + public void sizeTest() { assertThat(getTestRequestHeaders().size(), is(3)); } @Test (expected = NullPointerException.class) - public void containsKey_NullString_Test() { + public void containsKeyNullStringTest() { assertFalse(getTestRequestHeaders().containsKey(null)); } @Test - public void containsKey_Test() { + public void containsKeyTest() { final RequestHeaders rh = getTestRequestHeaders(); System.out.println(rh.keySet()); @@ -100,13 +100,13 @@ public void containsKey_Test() { } @Test (expected = NullPointerException.class) - public void removeAll_Null_Test() { + public void removeAllNullTest() { final RequestHeaders rh = getTestRequestHeaders(); assertThat(rh.removeAll(null).size(), is(0)); } @Test - public void removeAll_Test() { + public void removeAllTest() { final RequestHeaders rh = getTestRequestHeaders(); assertThat(rh.removeAll("").size(), is(0)); @@ -123,7 +123,7 @@ public void removeAll_Test() { } @Test - public void entries_Test() { + public void entriesTest() { final Collection> result = getTestRequestHeaders().entries(); assertThat(result.size(), is(3)); @@ -142,7 +142,7 @@ public void entries_Test() { } @Test - public void getMultimap_Test() { + public void getMultimapTest() { final Multimap result = getTestRequestHeaders().getMultimap(); assertThat(result.size(), is(3)); @@ -152,7 +152,7 @@ public void getMultimap_Test() { } @Test - public void keySet_Test() { + public void keySetTest() { final Set result = getTestRequestHeaders().keySet(); assertThat(result.size(), is(2)); assertThat(result, hasItem("Key One")); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils_Test.java index 28071aec8..6a7c76833 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/parsers/utils/ResponseParserUtils_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,37 +17,146 @@ import com.google.common.collect.ImmutableMap; import com.spectralogic.ds3client.MockedHeaders; +import com.spectralogic.ds3client.models.ChecksumType; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.time.Month; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Map; +import java.util.UUID; + +import static com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils.*; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; public class ResponseParserUtils_Test { + private static final Logger LOG = LoggerFactory.getLogger(ResponseParserUtils_Test.class); + @Test - public void getRequestId_Test() { + public void getRequestIdTest() { final String requestId = "123"; final ImmutableMap headers = ImmutableMap.of( "x-amz-request-id", requestId, "Content-Type", "Text/xml"); - final String result = ResponseParserUtils.getRequestId(new MockedHeaders(headers)); + final String result = getRequestId(new MockedHeaders(headers)); assertThat(result, is(requestId)); } @Test - public void getRequestId_WithoutRequestId_Test() { + public void getRequestIdWithoutRequestIdTest() { final ImmutableMap headers = ImmutableMap.of( "Content-Type", "Text/xml"); - final String result = ResponseParserUtils.getRequestId(new MockedHeaders(headers)); + final String result = getRequestId(new MockedHeaders(headers)); assertThat(result, is(nullValue())); } @Test - public void getRequestId_EmptyHeaders_Test() { - final String result = ResponseParserUtils.getRequestId(new MockedHeaders(ImmutableMap.of())); + public void getRequestIdEmptyHeadersTest() { + final String result = getRequestId(new MockedHeaders(ImmutableMap.of())); assertThat(result, is(nullValue())); } + + @Test + public void getBlobChecksumMapNoHeadersTest() { + final ImmutableMap result = getBlobChecksumMap(new MockedHeaders(ImmutableMap.of())); + assertThat(result.size(), is(0)); + } + + @Test + public void getBlobChecksumMapNoChecksumHeadersTest() { + final ImmutableMap headers = ImmutableMap.of("key1", "value1", "key2", "value2"); + final ImmutableMap result = getBlobChecksumMap(new MockedHeaders(headers)); + assertThat(result.size(), is(0)); + } + + private static final ImmutableMap TEST_RESPONSE_HEADERS = ImmutableMap.of( + "ds3-blob-checksum-type", "MD5", + "ds3-blob-checksum-offset-0", "4nQGNX4nyz0pi8Hvap79PQ==", + "ds3-blob-checksum-offset-10485760", "965Aa0/n8DlO1IwXYFh4bg==", + "ds3-blob-checksum-offset-20971520", "iV2OqJaXJ/jmqgRSb1HmFA==", + "x-amz-request-id", "895767" + ); + + @Test + public void getBlobChecksumMapWithChecksumHeadersTest() { + final ImmutableMap expectedMap = ImmutableMap.of( + 0L, "4nQGNX4nyz0pi8Hvap79PQ==", + 10485760L, "965Aa0/n8DlO1IwXYFh4bg==", + 20971520L, "iV2OqJaXJ/jmqgRSb1HmFA==" + ); + + final ImmutableMap result = getBlobChecksumMap(new MockedHeaders(TEST_RESPONSE_HEADERS)); + assertThat(result.size(), is(expectedMap.size())); + + for (final Map.Entry entry : expectedMap.entrySet()) { + assertTrue(result.containsKey(entry.getKey())); + assertThat(result.get(entry.getKey()), is(entry.getValue())); + } + } + + @Test + public void toBlobChecksumTypeTest() { + assertThat(toBlobChecksumType("CRC_32"), is(ChecksumType.Type.CRC_32)); + assertThat(toBlobChecksumType("CRC_32C"), is(ChecksumType.Type.CRC_32C)); + assertThat(toBlobChecksumType("MD5"), is(ChecksumType.Type.MD5)); + assertThat(toBlobChecksumType("SHA_256"), is(ChecksumType.Type.SHA_256)); + assertThat(toBlobChecksumType("SHA_512"), is(ChecksumType.Type.SHA_512)); + assertThat(toBlobChecksumType(""), is(ChecksumType.Type.NONE)); + } + + @Test (expected = IllegalArgumentException.class) + public void toBlobChecksumTypeUnknownChecksumType() { + assertThat(toBlobChecksumType("unexpected text"), is(ChecksumType.Type.NONE)); + } + + @Test + public void getBlobChecksumTypeNoHeaderTest() { + final ChecksumType.Type result = getBlobChecksumType(new MockedHeaders(ImmutableMap.of())); + assertThat(result, is(ChecksumType.Type.NONE)); + } + + @Test + public void getBlobChecksumTypeTest() { + final ChecksumType.Type result = getBlobChecksumType(new MockedHeaders(TEST_RESPONSE_HEADERS)); + assertThat(result, is(ChecksumType.Type.MD5)); + } + + @Test + public void getCreationDateTest() { + final ImmutableMap headers = ImmutableMap.of( + "creation-date", "2019-07-11T20:35:47.000Z", + "version-id", "eec64ea6-8434-492f-a068-ef516da801a3" + ); + + final ZonedDateTime result = getCreationDate(new MockedHeaders(headers)); + + assertThat(result.getYear(), is(2019)); + assertThat(result.getMonth(), is(Month.JULY)); + assertThat(result.getDayOfMonth(), is(11)); + assertThat(result.getHour(), is(20)); + assertThat(result.getMinute(), is(35)); + assertThat(result.getSecond(), is(47)); + assertThat(result.getZone(), is(ZoneId.of("Z"))); + } + + @Test + public void getVersionIdTest() { + final UUID versionId = UUID.fromString("eec64ea6-8434-492f-a068-ef516da801a3"); + + final ImmutableMap headers = ImmutableMap.of( + "creation-date", "2019-07-11T20:35:47.000Z", + "version-id", versionId.toString() + ); + + final UUID result = getVersionId(new MockedHeaders(headers)); + assertThat(result, is(versionId)); + } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/spectrads3/GetPutJobToReplicate_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/spectrads3/GetPutJobToReplicate_Test.java index 8f44b380e..03bf6a6a1 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/spectrads3/GetPutJobToReplicate_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/commands/spectrads3/GetPutJobToReplicate_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -28,7 +28,7 @@ public class GetPutJobToReplicate_Test { @Test - public void getPutJobToReplicate_ProcessResponse_Test() throws IOException { + public void getPutJobToReplicateProcessResponseTest() throws IOException { final String responsePayload = "Some response payload"; final ImmutableMap emptyMap = ImmutableMap.of(); final WebResponse webResponse = new MockedWebResponse(responsePayload, 200, emptyMap); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/AutoCloseableCache_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/AutoCloseableCache_Test.java deleted file mode 100644 index a228f3673..000000000 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/AutoCloseableCache_Test.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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 com.spectralogic.ds3client.helpers; - -import com.spectralogic.ds3client.helpers.AutoCloseableCache.ValueBuilder; - -import org.junit.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.sameInstance; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; - -public class AutoCloseableCache_Test { - @Test - public void returnsSameInstanceWhenCalledTwice() throws Exception { - final AutoCloseableCache closeableCache = - new AutoCloseableCache<>(new CloseableImplValueBuilder()); - final CloseableImpl item = closeableCache.get("foo"); - assertThat(item.getKey(), is("foo")); - assertThat(closeableCache.get("foo"), is(sameInstance(item))); - closeableCache.close(); - } - - @Test - public void cacheDisposesAllItemsExactlyOnce() throws Exception { - final AutoCloseableCache closeableCache = - new AutoCloseableCache<>(new CloseableImplValueBuilder()); - - final CloseableImpl item1 = closeableCache.get("foo"); - final CloseableImpl item2 = closeableCache.get("bar"); - - assertThat(item1.getCloseCallCount(), is(0)); - assertThat(item2.getCloseCallCount(), is(0)); - - closeableCache.close(); - - assertThat(item1.getCloseCallCount(), is(1)); - assertThat(item2.getCloseCallCount(), is(1)); - - closeableCache.close(); - - assertThat(item1.getCloseCallCount(), is(1)); - assertThat(item2.getCloseCallCount(), is(1)); - } - - @Test - public void cacheCanCloseItemsEarly() throws Exception { - final AutoCloseableCache closeableCache = - new AutoCloseableCache<>(new CloseableImplValueBuilder()); - - final CloseableImpl item1 = closeableCache.get("foo"); - final CloseableImpl item2 = closeableCache.get("bar"); - - assertThat(item1.getCloseCallCount(), is(0)); - assertThat(item2.getCloseCallCount(), is(0)); - - closeableCache.close("foo"); - - assertThat(item1.getCloseCallCount(), is(1)); - assertThat(item2.getCloseCallCount(), is(0)); - - try { - closeableCache.get("foo"); - fail(); - } catch (final IllegalStateException e) { - } - - closeableCache.close(); - - assertThat(item1.getCloseCallCount(), is(1)); - assertThat(item2.getCloseCallCount(), is(1)); - } - - @Test - public void cacheCanCloseBeforeGet() throws Exception { - final AutoCloseableCache closeableCache = - new AutoCloseableCache<>(new CloseableImplValueBuilder()); - - closeableCache.close("foo"); - - try { - closeableCache.get("foo"); - fail(); - } catch (final IllegalStateException e) { - } - } - - @Test - public void cacheCallsFailWhenDisposed() throws Exception { - final AutoCloseableCache closeableCache = - new AutoCloseableCache<>(new CloseableImplValueBuilder()); - closeableCache.close(); - - try { - closeableCache.get("foo"); - fail(); - } catch (final IllegalStateException e) { - } - try { - closeableCache.close("foo"); - fail(); - } catch (final IllegalStateException e) { - } - } - - private final class CloseableImplValueBuilder implements ValueBuilder { - @Override - public CloseableImpl get(final String key) { - return new CloseableImpl(key); - } - } - - private static final class CloseableImpl implements AutoCloseable { - private final String key; - private int closeCallCount = 0; - - public CloseableImpl(final String key) { - this.key = key; - } - - public String getKey() { - return this.key; - } - - public int getCloseCallCount() { - return this.closeCallCount; - } - - @Override - public void close() throws Exception { - this.closeCallCount++; - } - } -} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java index 762188ec3..43daff02d 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Ds3ClientHelpers_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -24,6 +24,7 @@ import com.spectralogic.ds3client.exceptions.Ds3NoMoreRetriesException; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.Job; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.ObjectChannelBuilder; +import com.spectralogic.ds3client.helpers.pagination.FileSystemKey; import com.spectralogic.ds3client.models.*; import com.spectralogic.ds3client.models.Error; import com.spectralogic.ds3client.models.Objects; @@ -107,7 +108,7 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { public void testReadObjectsWithFailedGet() throws IOException, ParseException { final Ds3Client ds3Client = mock(Ds3Client.class); - Mockito.when(ds3Client.newForNode(Mockito.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); final GetBulkJobSpectraS3Response buildBulkGetResponse = buildBulkGetResponse(); Mockito.when(ds3Client.getBulkJobSpectraS3(hasChunkOrdering(JobChunkClientProcessingOrderGuarantee.NONE))).thenReturn(buildBulkGetResponse); @@ -142,16 +143,22 @@ public void testWriteObjects() throws IOException, ParseException { final Ds3Client ds3Client = buildDs3ClientForBulk(); final PutBulkJobSpectraS3Response bulkPutResponse = buildBulkPutResponse(); - Mockito.when(ds3Client.putBulkJobSpectraS3(Mockito.any(PutBulkJobSpectraS3Request.class))).thenReturn(bulkPutResponse); - - final AllocateJobChunkSpectraS3Response allocateResponse1 = buildAllocateResponse1(); - final AllocateJobChunkSpectraS3Response allocateResponse2 = buildAllocateResponse2(); - final AllocateJobChunkSpectraS3Response allocateResponse3 = buildAllocateResponse3(); - Mockito.when(ds3Client.allocateJobChunkSpectraS3(hasChunkId(CHUNK_ID_1))) - .thenReturn(allocateResponse1) - .thenReturn(allocateResponse2); - Mockito.when(ds3Client.allocateJobChunkSpectraS3(hasChunkId(CHUNK_ID_2))) - .thenReturn(allocateResponse3); + Mockito.when(ds3Client.putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))).thenReturn(bulkPutResponse); + + final MasterObjectList chunk1ReadyMol = new MasterObjectList(); + chunk1ReadyMol.setObjects(Collections.singletonList(chunk1(false))); + + final MasterObjectList chunk2ReadyMol = new MasterObjectList(); + chunk2ReadyMol.setObjects(ImmutableList.of(chunk1(true), chunk2(false))); + + final GetJobChunksReadyForClientProcessingSpectraS3Response response1 = retryGetAvailableAfter(1); + final GetJobChunksReadyForClientProcessingSpectraS3Response response2 = availableJobChunks(chunk1ReadyMol); + final GetJobChunksReadyForClientProcessingSpectraS3Response response3 = availableJobChunks(chunk2ReadyMol); + + Mockito.when(ds3Client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(response1) + .thenReturn(response2) + .thenReturn(response3); final PutObjectResponse response = mock(PutObjectResponse.class); Mockito.when(ds3Client.putObject(putRequestHas(MYBUCKET, "foo", jobId, 0, "foo co"))).thenReturn(response); @@ -202,14 +209,15 @@ public void testWriteObjectsWithFailedPut() throws IOException, ParseException { final ConnectionDetails details = mock(ConnectionDetails.class); Mockito.when(details.getEndpoint()).thenReturn("localhost"); - Mockito.when(ds3Client.newForNode(Mockito.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); Mockito.when(ds3Client.getConnectionDetails()).thenReturn(details); final PutBulkJobSpectraS3Response buildBulkPutResponse = buildBulkPutResponse(); - Mockito.when(ds3Client.putBulkJobSpectraS3(Mockito.any(PutBulkJobSpectraS3Request.class))).thenReturn(buildBulkPutResponse); + Mockito.when(ds3Client.putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))).thenReturn(buildBulkPutResponse); - final AllocateJobChunkSpectraS3Response allocateResponse = buildAllocateResponse2(); - Mockito.when(ds3Client.allocateJobChunkSpectraS3(hasChunkId(CHUNK_ID_1))).thenReturn(allocateResponse); + final GetJobChunksReadyForClientProcessingSpectraS3Response availableChunks = availableJobChunks(buildBulkPutResponse.getMasterObjectList()); + Mockito.when(ds3Client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(availableChunks); final PutObjectResponse putResponse = mock(PutObjectResponse.class); Mockito.when(ds3Client.putObject(putRequestHas(MYBUCKET, "foo", jobId, 0, "foo co"))).thenThrow(new StubException()); @@ -238,7 +246,7 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { } } - private static final class StubException extends RuntimeException { + private static final class StubException extends IOException { private static final long serialVersionUID = 5121719894916333278L; } @@ -257,6 +265,17 @@ public void testListObjects() throws IOException, ParseException { checkContents(contentList.get(1), "bar", "f3f98ff00be128139332bcf4b772be43", "2009-10-14T17:50:31.000Z", 12); checkContents(contentList.get(2), "baz", "802d45fcb9a3f7d00f1481362edc0ec9", "2009-10-18T17:50:35.000Z", 12); } + + @Test + public void testRemoteListDirectory() throws IOException { + final Ds3Client ds3Client = mock(Ds3Client.class); + Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, null))).thenReturn(new StubGetBucketResponse(0)); + Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "baz"))).thenReturn(new StubGetBucketResponse(1)); + Mockito.when(ds3Client.getBucket(getBucketHas(MYBUCKET, "/foo/baz"))).thenReturn(new StubGetBucketResponse(1)); + final Iterable fileSystemKeys = Ds3ClientHelpers.wrap(ds3Client).remoteListDirectory(MYBUCKET, null, "/", null, 0); + final List contentsList = Lists.newArrayList(fileSystemKeys); + assertThat(contentsList.size(), is(3)); + } private static void checkContents( final Contents contents, @@ -276,7 +295,7 @@ public void testRecoverWriteJob() throws IOException, JobRecoveryException, Pars final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyWriteJobResponse = buildModifyWriteJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Mockito.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); final Job job = Ds3ClientHelpers.wrap(ds3Client).recoverWriteJob(jobId); assertThat(job.getJobId(), is(jobId)); @@ -288,7 +307,7 @@ public void testRecoverWriteJobThrowsJobRecoveryExceptionForWrongRequestType() t final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyReadJobResponse = buildModifyReadJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Mockito.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); Ds3ClientHelpers.wrap(ds3Client).recoverWriteJob(jobId); } @@ -298,7 +317,7 @@ public void testRecoverReadJob() throws IOException, JobRecoveryException, Parse final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyReadJobResponse = buildModifyReadJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Mockito.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyReadJobResponse); final Job job = Ds3ClientHelpers.wrap(ds3Client).recoverReadJob(jobId); assertThat(job.getJobId(), is(jobId)); @@ -310,7 +329,7 @@ public void testRecoverReadJobThrowsJobRecoveryExceptionForWrongRequestType() th final Ds3Client ds3Client = buildDs3ClientForBulk(); final ModifyJobSpectraS3Response modifyWriteJobResponse = buildModifyWriteJobResponse(); - Mockito.when(ds3Client.modifyJobSpectraS3(Mockito.any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); + Mockito.when(ds3Client.modifyJobSpectraS3(any(ModifyJobSpectraS3Request.class))).thenReturn(modifyWriteJobResponse); Ds3ClientHelpers.wrap(ds3Client).recoverReadJob(jobId); } @@ -404,7 +423,7 @@ private static Ds3Client buildDs3ClientForBulk() throws IOException, .thenReturn(jobChunksResponse2) .thenReturn(jobChunksResponse3); - Mockito.when(ds3Client.newForNode(Mockito.any())).thenReturn(ds3Client); + Mockito.when(ds3Client.newForNode(any())).thenReturn(ds3Client); Mockito.when(ds3Client.getConnectionDetails()).thenReturn(details); return ds3Client; } @@ -481,18 +500,6 @@ private static ModifyJobSpectraS3Response buildModifyReadJobResponse() throws Pa )); } - private static AllocateJobChunkSpectraS3Response buildAllocateResponse1() { - return retryAllocateLater(1); - } - - private static AllocateJobChunkSpectraS3Response buildAllocateResponse2() { - return allocated(chunk1(false)); - } - - private static AllocateJobChunkSpectraS3Response buildAllocateResponse3() { - return allocated(chunk2(false)); - } - private static MasterObjectList buildJobResponse( final JobRequestType requestType, final JobChunkClientProcessingOrderGuarantee chunkOrdering, @@ -511,7 +518,7 @@ private static MasterObjectList buildJobResponse( "2014-09-17T13:03:54.000Z", UUID.fromString("57919d2d-448c-4e2a-8886-0413af22243e"), "spectra", - Arrays.asList(basicNode(nodeId, "black-pearl")), + Collections.singletonList(basicNode(nodeId, "black-pearl")), Arrays.asList(chunks) ); } @@ -593,12 +600,12 @@ public void testWriteObjectsWithRetryAfter() throws IOException, ParseException final PutBulkJobSpectraS3Response bulkPutResponse = buildBulkPutResponse(); Mockito.when(ds3Client - .putBulkJobSpectraS3(Mockito.any(PutBulkJobSpectraS3Request.class))) + .putBulkJobSpectraS3(any(PutBulkJobSpectraS3Request.class))) .thenReturn(bulkPutResponse); - final AllocateJobChunkSpectraS3Response allocateResponse1 = buildAllocateResponse1(); - Mockito.when(ds3Client.allocateJobChunkSpectraS3(hasChunkId(CHUNK_ID_1))) - .thenReturn(allocateResponse1); + final GetJobChunksReadyForClientProcessingSpectraS3Response response1 = retryGetAvailableAfter(1); + Mockito.when(ds3Client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(response1); final PutObjectResponse response = mock(PutObjectResponse.class); Mockito.when(ds3Client.putObject(putRequestHas(MYBUCKET, "foo", jobId, 0, "foo co"))).thenReturn(response); @@ -655,22 +662,22 @@ public SeekableByteChannel buildChannel(final String key) throws IOException { public void testEnsureBucketExistsRace() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); final HeadBucketResponse response = buildHeadBucketResponse(HeadBucketResponse.Status.DOESNTEXIST); - Mockito.when(ds3Client.headBucket(Mockito.any(HeadBucketRequest.class))).thenReturn(response); - Mockito.when(ds3Client.putBucket(Mockito.any(PutBucketRequest.class))) + Mockito.when(ds3Client.headBucket(any(HeadBucketRequest.class))).thenReturn(response); + Mockito.when(ds3Client.putBucket(any(PutBucketRequest.class))) .thenThrow(new FailedRequestException(ImmutableList.of(202, 409), 409, new Error(), "Conflict", "5")); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(ds3Client); helpers.ensureBucketExists("fake_bucket"); // if this throws an exception, then this test should fail - verify(ds3Client, atLeastOnce()).putBucket(Mockito.any(PutBucketRequest.class)); + verify(ds3Client, atLeastOnce()).putBucket(any(PutBucketRequest.class)); } @Test(expected = FailedRequestException.class) public void testEnsureBucketExistsReturnsError() throws IOException { final Ds3Client ds3Client = mock(Ds3Client.class); final HeadBucketResponse response = buildHeadBucketResponse(HeadBucketResponse.Status.DOESNTEXIST); - Mockito.when(ds3Client.headBucket(Mockito.any(HeadBucketRequest.class))).thenReturn(response); - Mockito.when(ds3Client.putBucket(Mockito.any(PutBucketRequest.class))) + Mockito.when(ds3Client.headBucket(any(HeadBucketRequest.class))).thenReturn(response); + Mockito.when(ds3Client.putBucket(any(PutBucketRequest.class))) .thenThrow(new FailedRequestException(ImmutableList.of(202, 409, 500), 500, new Error(), "Error", "5")); final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(ds3Client); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ExceptionClassifier_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ExceptionClassifier_Test.java index 911add3d4..619a6b291 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ExceptionClassifier_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ExceptionClassifier_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectGetter_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectGetter_Test.java new file mode 100644 index 000000000..b9409947c --- /dev/null +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectGetter_Test.java @@ -0,0 +1,109 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers; + +import com.spectralogic.ds3client.utils.Platform; +import org.apache.commons.io.FileUtils; +import org.junit.Assume; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class FileObjectGetter_Test { + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + @Test + public void testThatNamedPipeThrows() throws IOException, InterruptedException { + Assume.assumeFalse(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + tempDirectory.toFile().deleteOnExit(); + final String FIFO_NAME = "bFifo"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Runtime.getRuntime().exec("mkfifo " + Paths.get(tempDirectory.toString(), FIFO_NAME)).waitFor(); + new FileObjectGetter(tempDirectory).buildChannel(FIFO_NAME); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(FIFO_NAME)); + caughtException.set(true); + } + + assertTrue(caughtException.get()); + } + + @Test + public void testThatFileReportsAsRegularOnWindows() throws IOException, InterruptedException { + Assume.assumeTrue(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String A_FILE_NAME = "aFile.txt"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Files.createFile(Paths.get(tempDirectory.toString(), A_FILE_NAME)); + new FileObjectGetter(tempDirectory).buildChannel(A_FILE_NAME); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(A_FILE_NAME)); + caughtException.set(true); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + + assertFalse(caughtException.get()); + } + + @Test + public void testThatSymbolicLinksAreResolved() { + Assume.assumeFalse(Platform.isWindows()); + final String message = "Hello World"; + final String file = "file.txt"; + try { + final Path tempDirectory = Files.createTempDirectory(Paths.get(System.getProperty("java.io.tmpdir")), "ds3"); + final Path realDirectory = Files.createDirectory(Paths.get(tempDirectory.toString(), "dir")); + final Path symbolicDirectory = Paths.get(tempDirectory.toString(), "symbolic"); + Files.createSymbolicLink(symbolicDirectory, realDirectory); + Files.createFile(Paths.get(realDirectory.toString(), file)); + final ByteBuffer bb = ByteBuffer.wrap(message.getBytes()); + + final SeekableByteChannel getterChannel = new FileObjectGetter(symbolicDirectory).buildChannel(file); + getterChannel.write(bb); + getterChannel.close(); + final String content = new String(Files.readAllBytes(Paths.get(realDirectory.toString(), file))); + assertTrue(message.equals(content)); + } catch (final IOException e) { + fail("Symbolic links are not handled correctly"); + } + } +} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectPutter_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectPutter_Test.java index 12c2507e8..75d21ee4d 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectPutter_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FileObjectPutter_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -16,6 +16,8 @@ package com.spectralogic.ds3client.helpers; import com.spectralogic.ds3client.utils.Platform; +import org.apache.commons.io.FileUtils; +import org.junit.Assume; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,10 +28,14 @@ import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.*; +import java.util.concurrent.atomic.AtomicBoolean; import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeFalse; public class FileObjectPutter_Test { @@ -37,7 +43,7 @@ public class FileObjectPutter_Test { final private static Logger LOG = LoggerFactory.getLogger(FileObjectPutter_Test.class); final private static String testString = "This is some test data."; - final private static byte[] testData = testString.getBytes(Charset.forName("UTF-8")); + final private static byte[] testData = testString.getBytes(StandardCharsets.UTF_8); /** * This test cannot run on Windows without extra privileges @@ -94,7 +100,7 @@ public void testRelativeSymlink() throws IOException, URISyntaxException { final Path symLinkPath = tempDir.resolve("sym_" + tempPath.getFileName().toString()); final Path relPath = Paths.get("..", getParentDir(tempPath), tempPath.getFileName().toString()); - LOG.info("Creating symlink from " + symLinkPath.toString() + " to " + relPath.toString()); + LOG.info("Creating symlink from " + symLinkPath + " to " + relPath); Files.createSymbolicLink(symLinkPath, relPath); getFileWithPutter(tempDir, symLinkPath); @@ -105,14 +111,14 @@ public void testRelativeSymlink() throws IOException, URISyntaxException { } } - private void getFileWithPutter(final Path dir, final Path file) throws IOException { + private static void getFileWithPutter(final Path dir, final Path file) throws IOException { try { final FileObjectPutter putter = new FileObjectPutter(dir); try (final SeekableByteChannel newChannel = putter.buildChannel(file.getFileName().toString())) { assertThat(newChannel, is(notNullValue())); final ByteBuffer buff = ByteBuffer.allocate(testData.length); assertThat(newChannel.read(buff), is(testData.length)); - assertThat(new String(buff.array(), Charset.forName("UTF-8")), is(testString)); + assertThat(new String(buff.array(), StandardCharsets.UTF_8), is(testString)); } } finally { Files.deleteIfExists(file); @@ -124,4 +130,50 @@ private static String getParentDir(final Path path) { final int lastIndex = parentPath.lastIndexOf(File.separator); return parentPath.substring(lastIndex + 1); } + + @Test + public void testThatFileReportsAsRegularOnWindows() throws IOException, InterruptedException { + Assume.assumeTrue(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + + final String A_FILE_NAME = "aFile.txt"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Files.createFile(Paths.get(tempDirectory.toString(), A_FILE_NAME)); + new FileObjectPutter(tempDirectory).buildChannel(A_FILE_NAME); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(A_FILE_NAME)); + caughtException.set(true); + } finally { + FileUtils.deleteDirectory(tempDirectory.toFile()); + } + + assertFalse(caughtException.get()); + } + + @Test + public void testThatNamedPipeThrows() throws IOException, InterruptedException { + Assume.assumeFalse(Platform.isWindows()); + + final String tempPathPrefix = null; + final Path tempDirectory = Files.createTempDirectory(Paths.get("."), tempPathPrefix); + tempDirectory.toFile().deleteOnExit(); + final String FIFO_NAME = "bFifo"; + + final AtomicBoolean caughtException = new AtomicBoolean(false); + + try { + Runtime.getRuntime().exec("mkfifo " + Paths.get(tempDirectory.toString(), FIFO_NAME)).waitFor(); + new FileObjectPutter(tempDirectory).buildChannel(FIFO_NAME); + } catch (final UnrecoverableIOException e) { + assertTrue(e.getMessage().contains(FIFO_NAME)); + caughtException.set(true); + } + + assertTrue(caughtException.get()); + } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FolderNameFilter_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FolderNameFilter_Test.java index 552f6927a..2650ae03a 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FolderNameFilter_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/FolderNameFilter_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory_Test.java index 7bbfc7eb0..5c746accb 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTrackerFactory_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTracker_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTracker_Test.java index 76a2b5cca..b0c1b182e 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTracker_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/JobPartTracker_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -54,7 +54,7 @@ public void trackerCallsTrackers() { } @Test - public void TrackerEventsForward() + public void trackerEventsForward() { final MockObjectPartTracker fooTracker = new MockObjectPartTracker("foo", Arrays.asList(false, true)); final MockObjectPartTracker barTracker = new MockObjectPartTracker("bar", Arrays.asList(true, false)); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Metadata_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Metadata_Test.java new file mode 100644 index 000000000..460b5d127 --- /dev/null +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/Metadata_Test.java @@ -0,0 +1,144 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers; + +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.AllocateJobChunkSpectraS3Response; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategyBuilder; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.ChecksumType; +import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; +import com.spectralogic.ds3client.models.JobNode; +import com.spectralogic.ds3client.models.JobRequestType; +import com.spectralogic.ds3client.models.JobStatus; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; +import com.spectralogic.ds3client.models.Priority; +import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import org.junit.Test; + +import static com.spectralogic.ds3client.helpers.ResponseBuilders.availableJobChunks; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; + +import org.mockito.Mockito; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; + +public class Metadata_Test { + @Test + public void testThatWeSendMetadataWithEachBlob() throws IOException { + final JobNode jobNode = new JobNode(); + jobNode.setEndPoint("endpoint"); + jobNode.setHttpPort(80); + jobNode.setHttpsPort(443); + jobNode.setId(UUID.randomUUID()); + + final String bucketName = "bucket"; + final String fileName = "aFile.txt"; + + final BulkObject blob1 = new BulkObject(); + blob1.setBucket(bucketName); + blob1.setId(UUID.randomUUID()); + blob1.setInCache(false); + blob1.setLatest(true); + blob1.setLength(2); + blob1.setOffset(0); + blob1.setVersionId(UUID.randomUUID()); + blob1.setName(fileName); + + final BulkObject blob2 = new BulkObject(); + blob2.setBucket(bucketName); + blob2.setId(UUID.randomUUID()); + blob2.setInCache(false); + blob2.setLatest(true); + blob2.setLength(2); + blob2.setOffset(2); + blob2.setVersionId(UUID.randomUUID()); + blob2.setName(fileName); + + final Objects chunk = new Objects(); + chunk.setChunkId(UUID.randomUUID()); + chunk.setChunkNumber(1); + chunk.setNodeId(UUID.randomUUID()); + chunk.setObjects(Arrays.asList(blob1, blob2)); + + final MasterObjectList masterObjectList = new MasterObjectList(); + masterObjectList.setAggregating(false); + masterObjectList.setBucketName(bucketName); + masterObjectList.setCachedSizeInBytes(4); + masterObjectList.setChunkClientProcessingOrderGuarantee(JobChunkClientProcessingOrderGuarantee.IN_ORDER); + masterObjectList.setCompletedSizeInBytes(4); + masterObjectList.setJobId(UUID.randomUUID()); + masterObjectList.setEntirelyInCache(false); + masterObjectList.setName("name"); + masterObjectList.setNaked(false); + masterObjectList.setOriginalSizeInBytes(4); + masterObjectList.setPriority(Priority.NORMAL); + masterObjectList.setRequestType(JobRequestType.PUT); + masterObjectList.setStartDate(new Date()); + masterObjectList.setStatus(JobStatus.IN_PROGRESS); + masterObjectList.setUserId(UUID.randomUUID()); + masterObjectList.setUserName("Gracie"); + masterObjectList.setNodes(Collections.singletonList(jobNode)); + masterObjectList.setObjects(Collections.singletonList(chunk)); + + final Map metadata = new HashMap<>(); + metadata.put("fileType", "text"); + + final Ds3ClientHelpers.ObjectChannelBuilder objectChannelBuilder = new Ds3ClientHelpers.ObjectChannelBuilder() { + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + return new ByteArraySeekableByteChannel(4); + } + }; + + final Ds3Client ds3Client = Mockito.mock(Ds3Client.class); + final GetJobChunksReadyForClientProcessingSpectraS3Response availableChunks = availableJobChunks(masterObjectList); + Mockito.when(ds3Client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(availableChunks); + + final AtomicInteger numBlobsForWhichWeGotMetadata = new AtomicInteger(0); + + final TransferStrategy transferStrategy = new TransferStrategyBuilder() + .withDs3Client(ds3Client) + .withMasterObjectList(masterObjectList) + .withChannelBuilder(objectChannelBuilder) + .withMetadataAccess(new MetadataAccess() { + @Override + public Map getMetadataValue(final String filename) { + numBlobsForWhichWeGotMetadata.incrementAndGet(); + return metadata; + } + }) + .makePutTransferStrategy(); + + transferStrategy.transfer(); + + assertEquals(chunk.getObjects().size(), numBlobsForWhichWeGotMetadata.get()); + } +} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartComparator_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartComparator_Test.java index 8142942c3..e0d2659f3 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartComparator_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartComparator_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_CompletePart_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_CompletePart_Test.java index 916904da9..034b344e0 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_CompletePart_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_CompletePart_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.List; import static org.hamcrest.CoreMatchers.equalTo; @@ -70,13 +71,13 @@ public static Collection testCases() { new ObjectPart(0L, 100L), new ObjectPart(200L, 100L) ) }, - new Object[] { "completely before", false, Arrays.asList(new ObjectPart(0L, 99L)) }, - new Object[] { "just before", false, Arrays.asList(new ObjectPart(0L, 100L)) }, - new Object[] { "overlapping before", false, Arrays.asList(new ObjectPart(50L, 100L)) }, - new Object[] { "overlapping both", false, Arrays.asList(new ObjectPart(50L, 200L)) }, - new Object[] { "overlapping after", false, Arrays.asList(new ObjectPart(150L, 100L)) }, - new Object[] { "just after", false, Arrays.asList(new ObjectPart(200L, 100L)) }, - new Object[] { "completely after", false, Arrays.asList(new ObjectPart(201L, 99L)) } + new Object[] { "completely before", false, Collections.singletonList(new ObjectPart(0L, 99L))}, + new Object[] { "just before", false, Collections.singletonList(new ObjectPart(0L, 100L))}, + new Object[] { "overlapping before", false, Collections.singletonList(new ObjectPart(50L, 100L))}, + new Object[] { "overlapping both", false, Collections.singletonList(new ObjectPart(50L, 200L))}, + new Object[] { "overlapping after", false, Collections.singletonList(new ObjectPart(150L, 100L))}, + new Object[] { "just after", false, Collections.singletonList(new ObjectPart(200L, 100L))}, + new Object[] { "completely after", false, Collections.singletonList(new ObjectPart(201L, 99L))} ); } @@ -124,7 +125,7 @@ private Collection buildExpectedEvents() { } private void checkFailure() { - final ObjectPartTracker tracker = new ObjectPartTrackerImpl(this.name, Arrays.asList(new ObjectPart(100L, 100L)), new SameThreadEventRunner()); + final ObjectPartTracker tracker = new ObjectPartTrackerImpl(this.name, Collections.singletonList(new ObjectPart(100L, 100L)), new SameThreadEventRunner()); try { tracker.completePart(this.parts.iterator().next()); Assert.fail(); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_Test.java index 9d9982a07..eaf25af0b 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPartTrackerImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPart_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPart_Test.java index 54829f403..7d1c1939c 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPart_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ObjectPart_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java index 695666d4c..432b57dc3 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RequestMatchers.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2022 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,6 +15,7 @@ package com.spectralogic.ds3client.helpers; +import com.google.common.base.Charsets; import com.spectralogic.ds3client.commands.GetBucketRequest; import com.spectralogic.ds3client.commands.GetObjectRequest; import com.spectralogic.ds3client.commands.PutObjectRequest; @@ -23,18 +24,20 @@ import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; import com.spectralogic.ds3client.models.JobChunkClientProcessingOrderGuarantee; import org.apache.commons.io.IOUtils; +import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; -import org.mockito.ArgumentMatcher; import java.io.IOException; import java.nio.channels.Channels; import java.nio.channels.SeekableByteChannel; +import java.nio.charset.StandardCharsets; import java.util.UUID; -import static org.mockito.Matchers.argThat; +import static org.mockito.hamcrest.MockitoHamcrest.argThat; -public class RequestMatchers { + +public final class RequestMatchers { public static GetBulkJobSpectraS3Request hasChunkOrdering(final JobChunkClientProcessingOrderGuarantee chunkOrdering) { return argThat(new TypeSafeMatcher() { @Override @@ -91,32 +94,6 @@ private void describeRequest(final UUID jobIdValue, final Description descriptio }); } - public static AllocateJobChunkSpectraS3Request hasChunkId(final UUID chunkId) { - return argThat(new TypeSafeMatcher() { - @Override - public void describeTo(final Description description) { - describeRequest(chunkId, description); - } - - @Override - protected boolean matchesSafely(final AllocateJobChunkSpectraS3Request item) { - return chunkId.equals(UUID.fromString(item.getJobChunkId())); - } - - @Override - protected void describeMismatchSafely( - final AllocateJobChunkSpectraS3Request item, - final Description mismatchDescription) { - describeRequest(UUID.fromString(item.getJobChunkId()), mismatchDescription); - } - - private void describeRequest(final UUID chunkIdValue, final Description description) { - description - .appendText("AllocateJobChunkResponse with chunk id: ") - .appendValue(chunkIdValue); - } - }); - } public static GetObjectRequest getRequestHas(final String bucket, final String key, final UUID jobId, final long offset) { return argThat(new TypeSafeMatcher() { @@ -206,27 +183,39 @@ private static Description describeTransferRequest( private static String channelToString(final SeekableByteChannel channel) { try { channel.position(0); - return IOUtils.toString(Channels.newReader(channel, "UTF-8")); + return IOUtils.toString(Channels.newReader(channel, Charsets.UTF_8.name())); } catch (final IOException e) { throw new RuntimeException(e); } } - + public static GetBucketRequest getBucketHas(final String bucket, final String marker) { - return argThat(new ArgumentMatcher() { - @Override - public boolean matches(final Object argument) { - if (!(argument instanceof GetBucketRequest)) { - return false; - } - final GetBucketRequest getBucketRequest = ((GetBucketRequest)argument); - return - getBucketRequest.getBucketName().equals(bucket) - && (marker == null + return argThat(new GetBucketRequestMatcher(bucket, marker)); + } + + private static final class GetBucketRequestMatcher extends BaseMatcher { + private final String bucket; + private final String marker; + public GetBucketRequestMatcher(final String bucket, final String marker) { + this.bucket = bucket; + this.marker = marker; + } + @Override + public boolean matches(Object argument) { + if (!(argument instanceof GetBucketRequest)) { + return false; + } + final GetBucketRequest getBucketRequest = ((GetBucketRequest)argument); + return + getBucketRequest.getBucketName().equals(bucket) + && (marker == null ? null == getBucketRequest.getMarker() : marker.equals(getBucketRequest.getMarker())); - - } - }); + + } + @Override + public void describeTo(Description description) { + description.appendText("getBucketRequest matches"); + } } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ResponseBuilders.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ResponseBuilders.java index b542b599f..bc07448b1 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ResponseBuilders.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/ResponseBuilders.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,6 +15,7 @@ package com.spectralogic.ds3client.helpers; +import com.google.common.base.Charsets; import com.spectralogic.ds3client.commands.GetObjectRequest; import com.spectralogic.ds3client.commands.GetObjectResponse; import com.spectralogic.ds3client.commands.HeadBucketResponse; @@ -29,6 +30,7 @@ import java.nio.channels.Channels; import java.nio.channels.SeekableByteChannel; import java.nio.channels.WritableByteChannel; +import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -71,20 +73,7 @@ public static GetJobChunksReadyForClientProcessingSpectraS3Response retryGetAvai when(response.getRetryAfterSeconds()).thenReturn(retryAfterInSeconds); return response; } - - public static AllocateJobChunkSpectraS3Response allocated(final Objects chunk) { - final AllocateJobChunkSpectraS3Response response = mock(AllocateJobChunkSpectraS3Response.class); - when(response.getStatus()).thenReturn(AllocateJobChunkSpectraS3Response.Status.ALLOCATED); - when(response.getObjectsResult()).thenReturn(chunk); - return response; - } - - public static AllocateJobChunkSpectraS3Response retryAllocateLater(final int retryAfterInSeconds) { - final AllocateJobChunkSpectraS3Response response = mock(AllocateJobChunkSpectraS3Response.class); - when(response.getStatus()).thenReturn(AllocateJobChunkSpectraS3Response.Status.RETRYLATER); - when(response.getRetryAfterSeconds()).thenReturn(retryAfterInSeconds); - return response; - } + public static MasterObjectList jobResponse( final UUID jobId, @@ -179,7 +168,7 @@ public static SeekableByteChannel channelWithContents(final String contents) { } private static T writeToChannel(final String contents, final T channel) { - final Writer writer = Channels.newWriter(channel, "UTF-8"); + final Writer writer = Channels.newWriter(channel, Charsets.UTF_8.name()); try { writer.write(contents); writer.flush(); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder_Test.java index d211c1370..c3ac72730 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectInputStreamBuilder_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder_Test.java index f90c8e4dc..32f392bd2 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/ObjectOutputStreamBuilder_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectGetter.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectGetter.java index 59cf193eb..8d90f8a63 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectGetter.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectGetter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectPutter.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectPutter.java index 84e22db71..2dc6e620f 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectPutter.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channelbuilders/StreamObjectPutter.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -27,7 +27,7 @@ public StreamObjectPutter(final byte[] buf) { } @Override - public InputStream buildInputStream(String key) { + public InputStream buildInputStream(final String key) { return new ByteArrayInputStream(buf); } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel_Test.java index b6fa2c7d2..cfa3f2192 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/RangedSeekableByteChannel_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -24,6 +24,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @@ -36,8 +37,8 @@ public void multipleRangesWithMultipleBlobs() throws IOException { final String firstPartialBlob = "First blob text"; final String secondPartialBlob = "Second Blob text"; - final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(Charset.forName("UTF-8"))); - final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(Charset.forName("UTF-8"))); + final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(StandardCharsets.UTF_8)); + final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(StandardCharsets.UTF_8)); final ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); @@ -77,8 +78,8 @@ public void multipleRangesNotOnBlobBoundryWithMultipleBlobs() throws IOException final String firstPartialBlob = "First blob text"; final String secondPartialBlob = "Second Blob text"; - final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(Charset.forName("UTF-8"))); - final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(Charset.forName("UTF-8"))); + final ByteBuffer firstBlobData = ByteBuffer.wrap(firstPartialBlob.getBytes(StandardCharsets.UTF_8)); + final ByteBuffer secondBlobData = ByteBuffer.wrap(secondPartialBlob.getBytes(StandardCharsets.UTF_8)); final ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory_Test.java index 3794a39e2..376e8942e 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedChannelFactory_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,12 +17,14 @@ import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; import org.junit.Test; import java.io.Writer; import java.nio.channels.Channels; import java.nio.channels.SeekableByteChannel; +import java.nio.charset.StandardCharsets; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @@ -32,13 +34,13 @@ public class WindowedChannelFactory_Test { @Test public void getReturnsWindow() throws Exception { try (final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel()) { - final Writer writer = Channels.newWriter(channel, "UTF-8"); + final Writer writer = Channels.newWriter(channel, Charsets.UTF_8.name()); writer.write("0123456789"); writer.close(); try (final WindowedChannelFactory windowedChannelFactory = new WindowedChannelFactory(channel)) { try (final SeekableByteChannel window = windowedChannelFactory.get(2L, 6L)) { - assertThat(IOUtils.toString(Channels.newReader(window, "UTF-8")), is("234567")); + assertThat(IOUtils.toString(Channels.newReader(window, Charsets.UTF_8.name())), is("234567")); } } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel_Test.java index a84b3ec1a..8aa259ad5 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/channels/WindowedSeekableByteChannel_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -18,6 +18,7 @@ import com.spectralogic.ds3client.helpers.TruncateNotAllowedException; import com.spectralogic.ds3client.utils.ByteArraySeekableByteChannel; +import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; import org.junit.Test; @@ -27,6 +28,7 @@ import java.nio.channels.Channels; import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; @@ -91,7 +93,7 @@ public void writeDoesNotExceedWindow() throws IOException { try (final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel()) { final Object lock = new Object(); try (final WindowedSeekableByteChannel window = new WindowedSeekableByteChannel(channel, lock, 2L, 7L)) { - final ByteBuffer buffer = Charset.forName("UTF-8").encode("0123456789"); + final ByteBuffer buffer = StandardCharsets.UTF_8.encode("0123456789"); buffer.position(1); assertThat(window.write(buffer), is(7)); assertThat(window.position(), is(7L)); @@ -122,14 +124,14 @@ public void readPositionTracking() throws IOException { assertThat(window.position(), is(3L)); assertThat(buffer.position(), is(3)); assertThat(buffer.limit(), is(3)); - assertThat(new String(bytes, 0, 3, Charset.forName("UTF-8")), is("bbb")); + assertThat(new String(bytes, 0, 3, StandardCharsets.UTF_8), is("bbb")); buffer.limit(10); assertThat(window.read(buffer), is(4)); assertThat(window.position(), is(7L)); assertThat(buffer.position(), is(7)); assertThat(buffer.limit(), is(10)); - assertThat(new String(bytes, 3, 4, Charset.forName("UTF-8")), is("cccc")); + assertThat(new String(bytes, 3, 4, StandardCharsets.UTF_8), is("cccc")); } } } @@ -139,11 +141,11 @@ public void writePositionTracking() throws IOException { try (final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel()) { final Object lock = new Object(); try (final WindowedSeekableByteChannel window = new WindowedSeekableByteChannel(channel, lock, 2L, 7L)) { - ByteBuffer buffer = Charset.forName("UTF-8").encode("bbb"); + ByteBuffer buffer = StandardCharsets.UTF_8.encode("bbb"); assertThat(window.write(buffer), is(3)); assertThat(buffer.position(), is(3)); - buffer = Charset.forName("UTF-8").encode("cccc"); + buffer = StandardCharsets.UTF_8.encode("cccc"); assertThat(window.write(buffer), is(4)); assertThat(buffer.position(), is(4)); @@ -250,7 +252,7 @@ public void interactAfterCloseNotAllowed() throws IOException { } private static void writeToChannel(final String string, final SeekableByteChannel channel) throws IOException { - final Writer writer = Channels.newWriter(channel, "UTF-8"); + final Writer writer = Channels.newWriter(channel, Charsets.UTF_8.name()); writer.write(string); writer.flush(); } @@ -263,6 +265,6 @@ private static SeekableByteChannel stringToChannel(final String string) throws I } private static String channelToString(final SeekableByteChannel channel) throws IOException { - return IOUtils.toString(Channels.newReader(channel, "UTF-8")); + return IOUtils.toString(Channels.newReader(channel, Charsets.UTF_8.name())); } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader_Test.java index 92d090b09..febc87bcd 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/SpectraS3PaginationLoader_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/StubbedRequest.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/StubbedRequest.java index 48c30e569..69ffd5de5 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/StubbedRequest.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/pagination/StubbedRequest.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy_Test.java new file mode 100644 index 000000000..a1867507d --- /dev/null +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/blobstrategy/PutBlobStrategy_Test.java @@ -0,0 +1,248 @@ +package com.spectralogic.ds3client.helpers.strategy.blobstrategy; + +import com.google.common.collect.Lists; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Request; +import com.spectralogic.ds3client.commands.spectrads3.GetJobChunksReadyForClientProcessingSpectraS3Response; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; +import org.junit.Test; + +import java.io.IOException; +import java.util.List; +import java.util.UUID; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +public class PutBlobStrategy_Test { + + @Test + public void testGetWorkWithDuplicates() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = mock(MasterObjectList.class); + final EventDispatcher eventDispatcher = mock(EventDispatcher.class); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final UUID jobId = UUID.randomUUID(); + when(mol.getJobId()).thenReturn(jobId); + + final UUID objectId = UUID.randomUUID(); + final BulkObject blob1 = new BulkObject(); + blob1.setId(objectId); + blob1.setOffset(0); + blob1.setInCache(false); + + final BulkObject blob2 = new BulkObject(); + blob2.setId(objectId); + blob2.setOffset(100); + blob2.setInCache(false); + + final Objects chunk = new Objects(); + chunk.setObjects(Lists.newArrayList(blob1, blob2)); + + final MasterObjectList molResult = mock(MasterObjectList.class); + when(molResult.getObjects()).thenReturn(Lists.newArrayList(chunk)); + + final GetJobChunksReadyForClientProcessingSpectraS3Response realResponse = new GetJobChunksReadyForClientProcessingSpectraS3Response(molResult, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null); + when(client.getJobChunksReadyForClientProcessingSpectraS3(any(GetJobChunksReadyForClientProcessingSpectraS3Request.class))) + .thenReturn(realResponse); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, eventDispatcher, retryBehavior, retryDelayBehavior, new JobState(molResult.getObjects()), false); + + final List work = Lists.newArrayList(strategy.getWork()); + + assertThat(work.size(), is(2)); + assertThat(work.get(0).getBlob().getId(), is(objectId)); + assertThat(work.get(1).getBlob().getId(), is(objectId)); + } + + @Test + public void testGetWorkWithDuplicatesSequential() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = mock(MasterObjectList.class); + final EventDispatcher eventDispatcher = mock(EventDispatcher.class); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final UUID jobId = UUID.randomUUID(); + when(mol.getJobId()).thenReturn(jobId); + + final UUID objectId = UUID.randomUUID(); + final BulkObject blob1 = new BulkObject(); + blob1.setId(objectId); + blob1.setOffset(0); + blob1.setInCache(false); + + final BulkObject blob2 = new BulkObject(); + blob2.setId(objectId); + blob2.setOffset(100); + blob2.setInCache(false); + + final Objects chunk = new Objects(); + chunk.setObjects(Lists.newArrayList(blob1, blob2)); + + final MasterObjectList molResult = mock(MasterObjectList.class); + when(molResult.getObjects()).thenReturn(Lists.newArrayList(chunk)); + + final GetJobChunksReadyForClientProcessingSpectraS3Response realResponse = new GetJobChunksReadyForClientProcessingSpectraS3Response(molResult, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null); + + when(client.getJobChunksReadyForClientProcessingSpectraS3(any(GetJobChunksReadyForClientProcessingSpectraS3Request.class))) + .thenReturn(realResponse); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, eventDispatcher, retryBehavior, retryDelayBehavior, new JobState(molResult.getObjects()), true); + + final List work = Lists.newArrayList(strategy.getWork()); + + assertThat(work.size(), is(1)); + assertThat(work.get(0).getBlob().getId(), is(objectId)); + assertThat(work.get(0).getBlob().getOffset(), is(0L)); + } + + @Test + public void testGetWorkRetryLater() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = new MasterObjectList(); + mol.setJobId(UUID.randomUUID()); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final int retryAfterSeconds = 10; + final MasterObjectList emptyMol = new MasterObjectList(); + + when(client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(new GetJobChunksReadyForClientProcessingSpectraS3Response(null, retryAfterSeconds, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.RETRYLATER, null, null)) + .thenReturn(new GetJobChunksReadyForClientProcessingSpectraS3Response(emptyMol, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null)); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, mock(EventDispatcher.class), retryBehavior, retryDelayBehavior, new JobState(emptyMol.getObjects()), false); + + assertThat(Lists.newArrayList(strategy.getWork()).isEmpty(), is(true)); + + verify(retryBehavior).invoke(); + verify(retryDelayBehavior).delay(retryAfterSeconds); + verify(retryBehavior).reset(); + } + + @Test + public void testGetWorkAvailableWithNoWork() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = new MasterObjectList(); + mol.setJobId(UUID.randomUUID()); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final BulkObject blob = new BulkObject(); + blob.setId(UUID.randomUUID()); + blob.setInCache(false); + final Objects chunk = new Objects(); + chunk.setObjects(Lists.newArrayList(blob)); + final MasterObjectList molWithWork = new MasterObjectList(); + molWithWork.setObjects(Lists.newArrayList(chunk)); + + when(client.getJobChunksReadyForClientProcessingSpectraS3(any())) + .thenReturn(new GetJobChunksReadyForClientProcessingSpectraS3Response(new MasterObjectList(), 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null)) + .thenReturn(new GetJobChunksReadyForClientProcessingSpectraS3Response(molWithWork, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null)); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, mock(EventDispatcher.class), retryBehavior, retryDelayBehavior, new JobState(molWithWork.getObjects()), false); + + assertThat(Lists.newArrayList(strategy.getWork()).size(), is(1)); + + verify(retryBehavior).invoke(); + verify(retryDelayBehavior).delay(1); + verify(retryBehavior).reset(); + } + + @Test + public void testGetWorkFiltersInCache() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = mock(MasterObjectList.class); + final EventDispatcher eventDispatcher = mock(EventDispatcher.class); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final UUID jobId = UUID.randomUUID(); + when(mol.getJobId()).thenReturn(jobId); + + final BulkObject blob1 = new BulkObject(); + blob1.setId(UUID.randomUUID()); + blob1.setInCache(true); + + final BulkObject blob2 = new BulkObject(); + blob2.setId(UUID.randomUUID()); + blob2.setInCache(false); + + final Objects chunk = new Objects(); + chunk.setObjects(Lists.newArrayList(blob1, blob2)); + + final MasterObjectList molResult = mock(MasterObjectList.class); + when(molResult.getObjects()).thenReturn(Lists.newArrayList(chunk)); + + final GetJobChunksReadyForClientProcessingSpectraS3Response response = new GetJobChunksReadyForClientProcessingSpectraS3Response( + molResult, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null); + + when(client.getJobChunksReadyForClientProcessingSpectraS3(any(GetJobChunksReadyForClientProcessingSpectraS3Request.class))) + .thenReturn(response); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, eventDispatcher, retryBehavior, retryDelayBehavior, new JobState(molResult.getObjects()), false); + + final List work = Lists.newArrayList(strategy.getWork()); + + assertThat(work.size(), is(1)); + assertThat(work.get(0).getBlob().getId(), is(blob2.getId())); + verify(retryBehavior).reset(); + } + + @Test + public void testBlobCompletedDoesNothing() { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = mock(MasterObjectList.class); + final EventDispatcher eventDispatcher = mock(EventDispatcher.class); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, eventDispatcher, retryBehavior, retryDelayBehavior, new JobState(mol.getObjects()), false); + strategy.blobCompleted(new BulkObject()); + + // We expect an interaction in the constructor of AbstractBlobStrategy + verify(eventDispatcher).attachBlobTransferredEventObserver(any()); + + verify(mol).getObjects(); + + // No other interactions + verifyNoMoreInteractions(client, mol, retryBehavior, retryDelayBehavior); + } + @Test + public void testGetWorkEmptyResponse() throws IOException, InterruptedException { + final Ds3Client client = mock(Ds3Client.class); + final MasterObjectList mol = mock(MasterObjectList.class); + final EventDispatcher eventDispatcher = mock(EventDispatcher.class); + final ChunkAttemptRetryBehavior retryBehavior = mock(ChunkAttemptRetryBehavior.class); + final ChunkAttemptRetryDelayBehavior retryDelayBehavior = mock(ChunkAttemptRetryDelayBehavior.class); + + final UUID jobId = UUID.randomUUID(); + when(mol.getJobId()).thenReturn(jobId); + + final MasterObjectList molResult = mock(MasterObjectList.class); + when(molResult.getObjects()).thenReturn(Lists.newArrayList()); + + final GetJobChunksReadyForClientProcessingSpectraS3Response response = new GetJobChunksReadyForClientProcessingSpectraS3Response( + molResult, 0, GetJobChunksReadyForClientProcessingSpectraS3Response.Status.AVAILABLE, null, null); + + when(client.getJobChunksReadyForClientProcessingSpectraS3(any(GetJobChunksReadyForClientProcessingSpectraS3Request.class))) + .thenReturn(response); + + final PutBlobStrategy strategy = new PutBlobStrategy(client, mol, eventDispatcher, retryBehavior, retryDelayBehavior, new JobState(molResult.getObjects()), false); + + final List work = Lists.newArrayList(strategy.getWork()); + + assertThat(work.isEmpty(), is(true)); + verify(retryBehavior).reset(); + } +} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RangeHelperImpl_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelperImpl_Test.java similarity index 96% rename from ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RangeHelperImpl_Test.java rename to ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelperImpl_Test.java index 7cb229450..be813935a 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/RangeHelperImpl_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/RangeHelperImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -13,7 +13,7 @@ * **************************************************************************** */ -package com.spectralogic.ds3client.helpers; +package com.spectralogic.ds3client.helpers.strategy.transferstrategy; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; @@ -53,7 +53,7 @@ public void testReplacingValueInFirstRange() { } } - private ImmutableCollection makeSomeRanges() { + private static ImmutableCollection makeSomeRanges() { final Range firstRange = Range.byLength(10, 10000); final Range secondRange = Range.byLength(20000, 15000); final Range thirdRange = Range.byLength(40000, 20000); @@ -64,7 +64,7 @@ private ImmutableCollection makeSomeRanges() { .build(); } - private long numBytesToTransfer(final ImmutableCollection ranges, final int numRanges) { + private static long numBytesToTransfer(final ImmutableCollection ranges, final int numRanges) { long result = 0; int currentRange = 0; diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy_Test.java new file mode 100644 index 000000000..52a23c572 --- /dev/null +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/strategy/transferstrategy/TransferStrategy_Test.java @@ -0,0 +1,270 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers.strategy.transferstrategy; + +import com.google.common.collect.Sets; +import com.spectralogic.ds3client.Ds3Client; +import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; +import com.spectralogic.ds3client.helpers.JobPart; +import com.spectralogic.ds3client.helpers.JobState; +import com.spectralogic.ds3client.helpers.events.FailureEvent; +import com.spectralogic.ds3client.helpers.events.SameThreadEventRunner; +import com.spectralogic.ds3client.helpers.strategy.blobstrategy.BlobStrategy; +import com.spectralogic.ds3client.models.BulkObject; +import com.spectralogic.ds3client.models.MasterObjectList; +import com.spectralogic.ds3client.models.Objects; + +import org.junit.Test; +import org.mockito.Mockito; + +import java.io.IOException; +import java.nio.channels.SeekableByteChannel; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class TransferStrategy_Test { + private static final String BLOB1 = "blob1"; + private static final String BLOB2 = "blob2"; + private static final String BLOB3 = "blob3"; + private static final String BLOB4 = "blob4"; + + @Test + public void testContinuallyGettingBlobThatFailsToTransfer() throws IOException { + final Set blobsTransferredSuccessfully = Sets.newConcurrentHashSet(); + final Set blobsThatFailed = Sets.newConcurrentHashSet(); + final AtomicInteger numTimesTransferCalled = new AtomicInteger(0); + + final Ds3Client ds3Client = Mockito.mock(Ds3Client.class); + + new MultiThreadedTransferStrategy(new ContinuallyReturnFailingBlobStrategy(), + new JobState(chunksWithBlobs()), + 10, + new EventDispatcherImpl(new SameThreadEventRunner()), + masterObjectList(), + ds3Client, + FailureEvent.FailureActivity.GettingObject) + .withTransferMethod(transferMethod(blobsTransferredSuccessfully, blobsThatFailed, numTimesTransferCalled)) + .transfer(); + + assertEquals(1, blobsThatFailed.size()); + assertTrue(blobsThatFailed.contains(BLOB2)); + assertEquals(3, blobsTransferredSuccessfully.size()); + assertTrue(blobsTransferredSuccessfully.contains(BLOB1)); + assertTrue(blobsTransferredSuccessfully.contains(BLOB3)); + assertTrue(blobsTransferredSuccessfully.contains(BLOB4)); + assertEquals(4, numTimesTransferCalled.get()); + } + + private static class ContinuallyReturnFailingBlobStrategy implements BlobStrategy { + private final AtomicBoolean getWorkCalledAlready = new AtomicBoolean(false); + + @Override + public Iterable getWork() throws IOException, InterruptedException { + if (getWorkCalledAlready.compareAndSet(false, true)) { + return Arrays.asList(firstChunkWithFailingBlob()); + } + + return Arrays.asList(remainingChunkWithFailingBlob()); + } + + private static JobPart[] firstChunkWithFailingBlob() { + final BulkObject blob1 = new BulkObject(); blob1.setName(BLOB1); + final BulkObject blob2 = new BulkObject(); blob2.setName(BLOB2); + + return new JobPart[] { + new JobPart(null, blob1), + new JobPart(null, blob2) + }; + } + + private static JobPart[] remainingChunkWithFailingBlob() { + final BulkObject blob2 = new BulkObject(); blob2.setName(BLOB2); + final BulkObject blob3 = new BulkObject(); blob3.setName(BLOB3); + final BulkObject blob4 = new BulkObject(); blob4.setName(BLOB4); + + return new JobPart[] { + new JobPart(null, blob2), + new JobPart(null, blob3), + new JobPart(null, blob4) + }; + } + } + + private static List chunksWithBlobs() { + final BulkObject blob1 = new BulkObject(); blob1.setName(BLOB1); blob1.setInCache(false); + final BulkObject blob2 = new BulkObject(); blob2.setName(BLOB2); blob2.setInCache(false); + final BulkObject blob3 = new BulkObject(); blob3.setName(BLOB3); blob3.setInCache(false); + final BulkObject blob4 = new BulkObject(); blob4.setName(BLOB4); blob4.setInCache(false); + + final Objects chunk1 = new Objects(); + chunk1.setObjects(Arrays.asList(blob1, blob2)); + + final Objects chunk2 = new Objects(); + chunk2.setObjects(Arrays.asList(blob3, blob4)); + + return Arrays.asList(chunk1, chunk2); + } + + private static MasterObjectList masterObjectList() { + final MasterObjectList masterObjectList = new MasterObjectList(); + masterObjectList.setObjects(chunksWithBlobs()); + masterObjectList.setJobId(UUID.randomUUID()); + masterObjectList.setBucketName("bucket"); + + return masterObjectList; + } + + private static TransferMethod transferMethod(final Set blobsTransferredSuccessfully, + final Set blobsThatFailed, + final AtomicInteger numTimesTransferCalled) + { + return jobPart -> { + numTimesTransferCalled.incrementAndGet(); + + if (jobPart.getBlob().getName().equals(BLOB2)) { + blobsThatFailed.add(jobPart.getBlob().getName()); + throw new IOException(BLOB2); + } else { + blobsTransferredSuccessfully.add(jobPart.getBlob().getName()); + } + }; + } + + @Test + public void testCanceledTransferDoesNotTryToGetBlobs() throws IOException { + final Ds3Client ds3Client = Mockito.mock(Ds3Client.class); + + final CanceledBlobStrategy blobStrategy = new CanceledBlobStrategy(); + + final TransferStrategy transferStrategy = new TransferStrategyBuilder() + .withMasterObjectList(masterObjectList()) + .withBlobStrategy(blobStrategy) + .withChannelBuilder(new AChannelBuilder()) + .withDs3Client(ds3Client) + .makePutTransferStrategy(); + + transferStrategy.transfer(); + + assertEquals(4, blobStrategy.numAttemptsToUse()); + + blobStrategy.reset(); + + new Thread(() -> { + try { + transferStrategy.cancel(); + } catch (final IOException e) { + System.out.println(e.getMessage()); + assert(false); + } + }).start(); + + transferStrategy.cancel(); + + transferStrategy.transfer(); + + assertEquals(0, blobStrategy.numAttemptsToUse()); + } + + private interface CanceledBehavior { + int numAttemptsToUse(); + void reset(); + void transferStrategy(final TransferStrategy transferStrategy); + void onGetWork(final OnGetWork onGetWork); + } + + private interface OnGetWork { + void onGetWork(final TransferStrategy transferStrategy) throws IOException; + } + + private static class CanceledBlobStrategy implements BlobStrategy, CanceledBehavior { + private final Ds3Client ds3Client = Mockito.mock(Ds3Client.class); + private final AtomicInteger numAttemptsToUse = new AtomicInteger(0); + private TransferStrategy transferStrategy; + private final AtomicReference onGetWork = new AtomicReference<>((transferStrategy) -> { }); + + @Override + public Iterable getWork() throws IOException, InterruptedException { + final int numAttempts = numAttemptsToUse.incrementAndGet(); + onGetWork.get().onGetWork(transferStrategy); + final BulkObject blob = new BulkObject(); blob.setName("blob" + numAttempts); blob.setInCache(false); + return Collections.singletonList(new JobPart(ds3Client, blob)); + } + + @Override + public int numAttemptsToUse() { + return numAttemptsToUse.get(); + } + + @Override + public void reset() { + numAttemptsToUse.set(0); + } + + @Override + public void transferStrategy(final TransferStrategy transferStrategy) { + this.transferStrategy = transferStrategy; + } + + @Override + public void onGetWork(final OnGetWork onGetWork) { + this.onGetWork.set(onGetWork); + } + } + + private static class AChannelBuilder implements Ds3ClientHelpers.ObjectChannelBuilder { + @Override + public SeekableByteChannel buildChannel(final String key) throws IOException { + return null; + } + } + + @Test + public void testCancelingTransferWhileGettingBlobs() throws IOException { + final Ds3Client ds3Client = Mockito.mock(Ds3Client.class); + + final CanceledBlobStrategy blobStrategy = new CanceledBlobStrategy(); + + final TransferStrategyBuilder transferStrategyBuilder = new TransferStrategyBuilder() + .withMasterObjectList(masterObjectList()) + .withBlobStrategy(blobStrategy) + .withChannelBuilder(new AChannelBuilder()) + .withDs3Client(ds3Client); + + final AtomicInteger canceledCount = new AtomicInteger(0); + + transferStrategyBuilder.eventDispatcher() + .attachCanceledEventObserver(new CanceledEventObserver(eventData -> canceledCount.incrementAndGet())); + + final TransferStrategy transferStrategy = transferStrategyBuilder.makePutTransferStrategy(); + + blobStrategy.transferStrategy(transferStrategy); + blobStrategy.onGetWork(TransferStrategy::cancel); + + transferStrategy.transfer(); + + assertEquals(1, blobStrategy.numAttemptsToUse()); + assertEquals(1, canceledCount.get()); + } +} diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers_Test.java index e301bf683..362c3c7d6 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/helpers/util/PartialObjectHelpers_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelFunctionality_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelFunctionality_Test.java index 993c7021f..636a2b169 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelFunctionality_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelFunctionality_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -23,7 +23,7 @@ public class ModelFunctionality_Test { @Test - public void bulkObjectEqualsEmptyObjects_Test() { + public void bulkObjectEqualsEmptyObjectsTest() { final BulkObject obj1 = new BulkObject(); final BulkObject obj2 = new BulkObject(); @@ -31,7 +31,7 @@ public void bulkObjectEqualsEmptyObjects_Test() { } @Test - public void bulkObjectNullableEquals_Test() { + public void bulkObjectNullableEqualsTest() { assertThat(BulkObject.nullableEquals(null, null), is(true)); assertThat(BulkObject.nullableEquals("1", null), is(false)); assertThat(BulkObject.nullableEquals("1", "1"), is(true)); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelParsing_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelParsing_Test.java index 6448b9078..3196ef617 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelParsing_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ModelParsing_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -30,7 +30,7 @@ public class ModelParsing_Test { @Test - public void listBucketResult_Parse_Test() throws IOException { + public void listBucketResultParseTest() throws IOException { final String input = "testmovies/movie1.mov" + "jason04531ac9-6639-4bee-8c09-9c8f0fbdbdcb" + "0movies/movie2.mov" + @@ -49,7 +49,7 @@ public void listBucketResult_Parse_Test() throws IOException { } @Test - public void listBucketResult_CommonPrefixes_Test() throws IOException { + public void listBucketResultCommonPrefixesTest() throws IOException { final String input = "" + "movies/" + "scores/" + @@ -68,7 +68,7 @@ public void listBucketResult_CommonPrefixes_Test() throws IOException { } @Test - public void completeMultipartUpload_Parse_Test() throws IOException { + public void completeMultipartUploadParseTest() throws IOException { final String input = "" + "1a54357aff0632cce46d942af68356b38" + "20c78aef83f66abc1fa1e8477f296d394" + @@ -86,23 +86,17 @@ public void completeMultipartUpload_Parse_Test() throws IOException { } @Test - public void completeMultipartUpload_ToString_Test() { + public void completeMultipartUploadToStringTest() { final String expected = "" + "1a54357aff0632cce46d942af68356b38" + "20c78aef83f66abc1fa1e8477f296d394" + ""; - final Part part1 = new Part(); - part1.setPartNumber(1); - part1.seteTag("a54357aff0632cce46d942af68356b38"); + final ImmutableList parts = ImmutableList.of( + new Part(1, "a54357aff0632cce46d942af68356b38"), + new Part(2, "0c78aef83f66abc1fa1e8477f296d394")); - final Part part2 = new Part(); - part2.setPartNumber(2); - part2.seteTag("0c78aef83f66abc1fa1e8477f296d394"); - - final ImmutableList parts = ImmutableList.of(part1, part2); - final CompleteMultipartUpload input = new CompleteMultipartUpload(); - input.setParts(parts.asList()); + final CompleteMultipartUpload input = new CompleteMultipartUpload(parts.asList()); final String result = XmlOutput.toXml(input); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ServiceList_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ServiceList_Test.java index 5a7f4e58b..81db6f0be 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ServiceList_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/ServiceList_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -28,10 +28,10 @@ public class ServiceList_Test { @Test - public void service_list_serialization() throws IOException { + public void serviceListSerialization() throws IOException { final UUID id = UUID.randomUUID(); final String stringResponse = "\n" + - "" + id.toString() + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09"; + "" + id + "ryantestBucket22013-12-11T23:20:09bulkTest2013-12-11T23:20:09bulkTest12013-12-11T23:20:09bulkTest22013-12-11T23:20:09bulkTest32013-12-11T23:20:09bulkTest42013-12-11T23:20:09bulkTest52013-12-11T23:20:09bulkTest62013-12-11T23:20:09testBucket32013-12-11T23:20:09testBucket12013-12-11T23:20:09testbucket2013-12-11T23:20:09"; final ListAllMyBucketsResult result = XmlOutput.fromXml(stringResponse, ListAllMyBucketsResult.class); assertThat(result, is(notNullValue())); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/common/Credential_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/common/Credential_Test.java index c6185b956..0828f71d0 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/common/Credential_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/models/common/Credential_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/FailedRequestException_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/FailedRequestException_Test.java index fa25268c3..982c242d2 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/FailedRequestException_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/FailedRequestException_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -33,46 +33,46 @@ private static Error createTestError() { } @Test - public void buildRequestIdMessage_Test() { + public void buildRequestIdMessageTest() { final String result = buildRequestIdMessage("123"); assertThat(result, is("for request #123")); } @Test - public void buildRequestIdMessage_EmptyId_Test() { + public void buildRequestIdMessageEmptyIdTest() { final String result = buildRequestIdMessage(""); assertThat(result, is("for unknown request")); } @Test - public void buildRequestIdMessage_NullId_Test() { + public void buildRequestIdMessageNullIdTest() { final String result = buildRequestIdMessage(null); assertThat(result, is("for unknown request")); } @Test - public void buildExceptionMessage_NullErrorAndRequestId_Test() { + public void buildExceptionMessageNullErrorAndRequestIdTest() { final String expected = "Expected a status code of 200, 203 but got 400 for unknown request. Could not parse the response for additional information."; final String result = buildExceptionMessage(null, ImmutableList.of(200, 203), 400, null); assertThat(result, is(expected)); } @Test - public void buildExceptionMessage_NullError_Test() { + public void buildExceptionMessageNullErrorTest() { final String expected = "Expected a status code of 200, 203 but got 400 for request #123. Could not parse the response for additional information."; final String result = buildExceptionMessage(null, ImmutableList.of(200, 203), 400, "123"); assertThat(result, is(expected)); } @Test - public void buildExceptionMessage_NullRequestId_Test() { + public void buildExceptionMessageNullRequestIdTest() { final String expected = "Expected a status code of 200, 203 but got 400 for unknown request. Error message: \"Error message\""; final String result = buildExceptionMessage(createTestError(), ImmutableList.of(200, 203), 400, null); assertThat(result, is(expected)); } @Test - public void buildExceptionMessage_Test() { + public void buildExceptionMessageTest() { final String expected = "Expected a status code of 200, 203 but got 400 for request #123. Error message: \"Error message\""; final String result = buildExceptionMessage(createTestError(), ImmutableList.of(200, 203), 400, "123"); assertThat(result, is(expected)); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/HeadersImpl_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/HeadersImpl_Test.java index 9ab4cce4c..934b4bd5b 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/HeadersImpl_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/networking/HeadersImpl_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -41,7 +41,7 @@ public void unknownHeader() { assertTrue(value.isEmpty()); } - public Headers genHeaders(final Header... headers) { + public static Headers genHeaders(final Header... headers) { return new HeadersImpl(headers); } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/serializer/XmlOutput_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/serializer/XmlOutput_Test.java index 395570f7d..f8c45976f 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/serializer/XmlOutput_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/serializer/XmlOutput_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -51,9 +51,9 @@ public void singleList() throws IOException { public void bucketList() throws IOException { final UUID id = UUID.randomUUID(); final String xmlResponse = "remoteTest161000falseuser/hduser/gutenberg/20417.txt.utf-82014-01-03T13:26:47.000ZNOTRETURNED674570STANDARD" + - "" + id.toString() + "ryanuser/hduser/gutenberg/5000.txt.utf-82014-01-03T13:26:47.000ZNOTRETURNED1423803STANDARD" + - "" + id.toString() + "ryanuser/hduser/gutenberg/4300.txt.utf-82014-01-03T13:26:47.000ZNOTRETURNED1573150STANDARD" + - "" + id.toString() + "ryan"; + "" + id + "ryanuser/hduser/gutenberg/5000.txt.utf-82014-01-03T13:26:47.000ZNOTRETURNED1423803STANDARD" + + "" + id + "ryanuser/hduser/gutenberg/4300.txt.utf-82014-01-03T13:26:47.000ZNOTRETURNED1573150STANDARD" + + "" + id + "ryan"; final ListBucketResult result = XmlOutput.fromXml(xmlResponse, ListBucketResult.class); assertThat(result, is(notNullValue())); @@ -73,7 +73,7 @@ public void bucketListWithEmptyContents() throws IOException { } @Test - public void toXmlWithNoFilter() { + public void toXmlWithSize() { final String expectedString = ""; final List objectList = ImmutableList.of(new Ds3Object("file1", 12), new Ds3Object("file2", 5022)).asList(); final Ds3ObjectList ds3ObjectList = new Ds3ObjectList(objectList); @@ -83,7 +83,7 @@ public void toXmlWithNoFilter() { } @Test - public void toXmlWithFilter() { + public void toXmlWithNoSize() { final String expectedString = ""; final List objectList = ImmutableList.of(new Ds3Object("file1", 12), new Ds3Object("file2", 5022)).asList(); final Ds3ObjectList ds3ObjectList = new Ds3ObjectList(objectList); @@ -93,12 +93,11 @@ public void toXmlWithFilter() { } @Test - public void toXmlWithPriority() { - final String expectedString = ""; - final List objectList = ImmutableList.of(new Ds3Object("file1", 12), new Ds3Object("file2", 5022)).asList(); + public void toXmlWithVersionId() { + final String expectedString = ""; + final List objectList = ImmutableList.of(new Ds3Object("file1", "version1"), new Ds3Object("file2", "version2")).asList(); final Ds3ObjectList ds3ObjectList = new Ds3ObjectList(objectList); - ds3ObjectList.setPriority(Priority.HIGH); - final String result = XmlOutput.toXml(ds3ObjectList, true); + final String result = XmlOutput.toXml(ds3ObjectList, false); assertThat(result, is(expectedString)); } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel_Test.java index ae9d36543..9da6cb9df 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/ByteArraySeekableByteChannel_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/DateFormatter_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/DateFormatter_Test.java index a43d926c2..8b6832d9f 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/DateFormatter_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/DateFormatter_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -19,6 +19,7 @@ import org.junit.Test; import java.util.Date; +import java.util.Locale; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -29,6 +30,16 @@ public class DateFormatter_Test { public void formatDate() { final Date date = new Date(1390414308132L); - assertThat(DateFormatter.dateToRfc882(date), is("Wed, 22 Jan 2014 18:11:48 +0000")); + assertThat(DateFormatter.dateToRfc822(date), is("Wed, 22 Jan 2014 18:11:48 +0000")); + } + + @Test + public void formatDateMandarin() { + final Locale defaultLocale = Locale.getDefault(); + Locale.setDefault(Locale.CHINESE); + final Date date = new Date(1390414308132L); + + assertThat(DateFormatter.dateToRfc822(date), is("Wed, 22 Jan 2014 18:11:48 +0000")); + Locale.setDefault(defaultLocale); } } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Guard_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Guard_Test.java index 6e3ebae07..feb113d3d 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Guard_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Guard_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/JobUtils_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/JobUtils_Test.java index 47edd2615..5f90fdfca 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/JobUtils_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/JobUtils_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2022 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -35,7 +35,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/NetUtils_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/NetUtils_Test.java index 229b6e4f1..9d5d1bfb0 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/NetUtils_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/NetUtils_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -167,21 +167,21 @@ public void escapeSpacesInQueryParam() throws MalformedURLException { @Test public void getPortBack() throws MalformedURLException { final URL url = new URL("http://localhost:8080/path"); - int port = NetUtils.getPort(url); + final int port = NetUtils.getPort(url); assertTrue(port == 8080); } @Test public void getHttpsDefaultPort() throws MalformedURLException { final URL url = new URL("https://localhost/path"); - int port = NetUtils.getPort(url); + final int port = NetUtils.getPort(url); assertTrue(port == 443); } @Test public void getHttpDefaultPort() throws MalformedURLException { final URL url = new URL("http://localhost/path"); - int port = NetUtils.getPort(url); + final int port = NetUtils.getPort(url); assertTrue(port == 80); } diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/SafeString_Manipulation_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/SafeString_Manipulation_Test.java index 0fee2caa4..d6c307f28 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/SafeString_Manipulation_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/SafeString_Manipulation_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,13 +26,13 @@ public class SafeString_Manipulation_Test { @Test - public void safeToString_Int_Test() { + public void safeToStringIntTest() { final int myInt = 5; assertThat(SafeStringManipulation.safeToString(myInt), is("5")); } @Test - public void safeToString_Integer_Test() { + public void safeToStringIntegerTest() { final Integer nullInt = null; assertThat(SafeStringManipulation.safeToString(nullInt), is(nullValue())); @@ -41,13 +41,13 @@ public void safeToString_Integer_Test() { } @Test - public void safeToString_Boolean_Test() { + public void safeToStringBooleanTest() { final boolean myBoolean = true; assertThat(SafeStringManipulation.safeToString(myBoolean), is("true")); } @Test - public void safeToString_Double_Test() { + public void safeToStringDoubleTest() { final double myDouble = 2.1; assertThat(SafeStringManipulation.safeToString(myDouble), is("2.1")); @@ -59,7 +59,7 @@ public void safeToString_Double_Test() { } @Test - public void safeToString_Long_Test() { + public void safeToStringLongTest() { final long myLong = 3; assertThat(SafeStringManipulation.safeToString(myLong), is("3")); @@ -71,7 +71,7 @@ public void safeToString_Long_Test() { } @Test - public void safeToString_String_Test() { + public void safeToStringStringTest() { final String nullString = null; assertThat(SafeStringManipulation.safeToString(nullString), is(nullValue())); @@ -80,7 +80,7 @@ public void safeToString_String_Test() { } @Test - public void safeToString_Date_Test() { + public void safeToStringDateTest() { final Date nullDate = null; assertThat(SafeStringManipulation.safeToString(nullDate), is(nullValue())); @@ -93,7 +93,7 @@ private enum TestEnum { } @Test - public void safeToString_Enum_Test() { + public void safeToStringEnumTest() { final TestEnum nullEnum = null; assertThat(SafeStringManipulation.safeToString(nullEnum), is(nullValue())); @@ -102,7 +102,7 @@ public void safeToString_Enum_Test() { } @Test - public void safeUrlEscape_Test() { + public void safeUrlEscapeTest() { assertThat(SafeStringManipulation.safeUrlEscape(null), is(nullValue())); assertThat(SafeStringManipulation.safeUrlEscape(""), is("")); assertThat(SafeStringManipulation.safeUrlEscape("one2three+four"), is("one2three%2Bfour")); @@ -110,7 +110,7 @@ public void safeUrlEscape_Test() { } @Test - public void safeQueryParamEscape_Test() { + public void safeQueryParamEscapeTest() { assertThat(SafeStringManipulation.safeQueryParamEscape(null), is(nullValue())); assertThat(SafeStringManipulation.safeQueryParamEscape(""), is("")); assertThat(SafeStringManipulation.safeQueryParamEscape("one2three+four"), is("one2three%2Bfour")); diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Signature_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Signature_Test.java index 3052ef645..85d2e1551 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Signature_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Signature_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; import com.spectralogic.ds3client.networking.HttpVerb; import com.spectralogic.ds3client.models.common.Credentials; import com.spectralogic.ds3client.models.common.SignatureDetails; @@ -32,7 +31,6 @@ public class Signature_Test { /** * Example taken from the AWS S3 documentation site: http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader - * @throws SignatureException */ @Test public void getSignature() throws SignatureException { @@ -47,7 +45,6 @@ public void getSignature() throws SignatureException { /** * Example taken from the AWS S3 documentation site: http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader - * @throws SignatureException */ @Test public void putSignature() throws SignatureException { diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Md5Hash_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Md5Hash_Test.java index 89d1bee82..57cac58f4 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Md5Hash_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Md5Hash_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha256Hash_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha256Hash_Test.java index b1fde85e3..7d846c0e9 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha256Hash_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha256Hash_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha512Hash_Test.java b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha512Hash_Test.java index 0cbce97d9..d9969444b 100644 --- a/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha512Hash_Test.java +++ b/ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/hashing/Sha512Hash_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker_Test.kt b/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker_Test.kt new file mode 100644 index 000000000..2150ad6e9 --- /dev/null +++ b/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/helpers/FileTreeWalker_Test.kt @@ -0,0 +1,50 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.helpers + +import com.google.common.collect.ImmutableList +import com.spectralogic.ds3client.models.bulk.Ds3Object +import org.junit.Rule +import org.junit.Test +import org.junit.rules.TemporaryFolder + +import org.hamcrest.CoreMatchers.* +import org.hamcrest.MatcherAssert.assertThat + +class FileTreeWalker_Test { + + @get:Rule + val tempDir = TemporaryFolder() + + @Test + fun basicFileList() { + tempDir.newFile("bar") + tempDir.newFile("baz") + + val walk = FileTreeWalker.walk(tempDir.root.toPath()) + + val listBuilder = ImmutableList.Builder() + + walk.forEach { + listBuilder.add(it) + } + + val fileList = listBuilder.build() + + assertThat(fileList.size, `is`(2)) + + } +} \ No newline at end of file diff --git a/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator_Test.kt b/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator_Test.kt new file mode 100644 index 000000000..28e5217ee --- /dev/null +++ b/ds3-sdk/src/test/kotlin/com/spectralogic/ds3client/utils/collections/WindowedIterator_Test.kt @@ -0,0 +1,76 @@ +/* + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils.collections + +import com.google.common.collect.Lists +import org.junit.Test + +import org.hamcrest.CoreMatchers.* +import org.hamcrest.MatcherAssert.assertThat + +class WindowedIterator_Test { + @Test + fun iterateWholeCollection() { + val list = Lists.newArrayList("value", "hi", "anothervalue") + + val iterator = list.iterator().take(Int.MAX_VALUE) + + var count = 0 + iterator.forEach { + count++ + } + + assertThat(count, `is`(3)) + } + + @Test + fun iteratePart() { + val list = Lists.newArrayList("value", "hi", "anothervalue") + + val iterator = list.iterator().take(1) + + var count = 0 + iterator.forEach { + count++ + } + + assertThat(count, `is`(1)) + } + + @Test + fun iterateAfterFirstIteration() { + val list = Lists.newArrayList("value", "hi", "anothervalue") + + val parentIterator = list.iterator() + val firstIterator = parentIterator.take(1) + + var firstCount = 0 + firstIterator.forEach { + firstCount++ + } + + assertThat(firstCount, `is`(1)) + + val secondIterator = parentIterator.take(Int.MAX_VALUE) + + var secondCount = 0 + secondIterator.forEach { + secondCount++ + } + + assertThat(secondCount, `is`(2)) + } +} \ No newline at end of file diff --git a/ds3-utils/build.gradle b/ds3-utils/build.gradle deleted file mode 100644 index 6b89d6230..000000000 --- a/ds3-utils/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ - -/* - * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -buildscript { - repositories { jcenter() } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - } -} - -apply plugin: 'com.github.johnrengelman.shadow' - -shadowJar { - relocate 'org.apache', 'ds3utilfatjar.org.apache' - relocate 'com.google', 'ds3utilfatjar.com.google' - - dependencies { - exclude(dependency('org.hamcrest:hamcrest-library:1.3')) - exclude(dependency('org.mockito:mockito-core:1.10.19')) - exclude(dependency('junit:junit:4.12')) - exclude(dependency('org.slf4j:slf4j-api:1.7.22')) - exclude(dependency('org.slf4j:slf4j-simple:1.7.22')) - } -} - -artifacts { - archives shadowJar -} - -dependencies { - compile 'commons-codec:commons-codec:1.10' - compile 'com.google.guava:guava:20.0' -} - diff --git a/ds3-utils/build.gradle.kts b/ds3-utils/build.gradle.kts new file mode 100644 index 000000000..558e54d22 --- /dev/null +++ b/ds3-utils/build.gradle.kts @@ -0,0 +1,35 @@ +/* + * ****************************************************************************** + * Copyright 2002 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + `ds3-java-sdk-library-convention` +} + +description = "This module holds classes for utilities used to manage files and " + + "metadata." + +dependencies { + api(project(":ds3-interfaces")) + + implementation(libs.commonsCodec) + implementation(libs.commonsIo) + implementation(libs.guava) + + testImplementation(libs.junit) + testImplementation(libs.junitJupiterApi) + + testRuntimeOnly(libs.junitVintageEngine) + testRuntimeOnly(libs.slf4jSimple) +} diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/commands/interfaces/MetadataImpl.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/commands/interfaces/MetadataImpl.java index f5d6cc440..8b78e755b 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/commands/interfaces/MetadataImpl.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/commands/interfaces/MetadataImpl.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -25,12 +25,13 @@ import java.util.Set; import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toDecodedString; -import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedString; +import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedKeyString; public class MetadataImpl implements Metadata { private static final String X_AMZ_META = "x-amz-meta-"; - final ImmutableMultimap metadata; + private static final String LTFS_METADATA_PREFIX = "x-spectra-ltfs-"; + private final ImmutableMultimap metadata; public MetadataImpl(final Headers headers) { this.metadata = genMetadata(headers); @@ -45,17 +46,27 @@ private static ImmutableMultimap genMetadata(final Headers heade final ImmutableMultimap.Builder mapBuilder = ImmutableMultimap.builder(); for (final String key : headers.keys()) { - if (key.startsWith(X_AMZ_META)) { - final String name = toDecodedString(key.substring(X_AMZ_META.length())); + final String keyWithoutPrefix = metadataKey(key); + if ( ! keyWithoutPrefix.isEmpty()) { final List values = getValues(headers, key); - mapBuilder.putAll(name, values); + mapBuilder.putAll(keyWithoutPrefix, values); } } return mapBuilder.build(); } + private static String metadataKey(final String key) { + if (key.startsWith(X_AMZ_META)) { + return toDecodedString(key.substring(X_AMZ_META.length())); + } else if (key.startsWith(LTFS_METADATA_PREFIX)) { + return toDecodedString(key.substring(LTFS_METADATA_PREFIX.length())); + } + + return ""; + } + private static List getValues(final Headers headers, final String key) { final List valueList = headers.get(key); final List returnList = new ArrayList<>(valueList.size()); @@ -74,7 +85,7 @@ private static List getValues(final Headers headers, final String key) { @Override public List get(final String name) { //Only ASCII chars are lower cased, do not search for key with non-ASCII symbols lower cased - final String lowerCasedName = toDecodedString(toEncodedString(name).toLowerCase()); + final String lowerCasedName = toDecodedString(toEncodedKeyString(name).toLowerCase()); return metadata.get(lowerCasedName).asList(); } @@ -83,3 +94,4 @@ public Set keys() { return metadata.keySet(); } } + diff --git a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java similarity index 69% rename from ds3-interfaces/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java rename to ds3-utils/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java index a351b3af7..352bcabae 100644 --- a/ds3-interfaces/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/exceptions/AggregateException.java @@ -1,16 +1,16 @@ /* - * **************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.exceptions; diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/FailureEventListener.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/FailureEventListener.java index 059f5abc8..5626f428e 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/FailureEventListener.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/FailureEventListener.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/events/FailureEvent.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/events/FailureEvent.java index 36268ecd5..8707940b7 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/events/FailureEvent.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/helpers/events/FailureEvent.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -47,18 +47,19 @@ public Throwable getCausalException() { return causalException; } - public static FailureEvent.Builder builder() { - return new FailureEvent.Builder(); - } - @Override public String toString() { return "Failure " + doingWhat().getActivityText() + " with object named \"" + withObjectNamed() + "\" using system with endpoint " + usingSystemWithEndpoint(); } + public static FailureEvent.Builder builder() { + return new FailureEvent.Builder(); + } + public enum FailureActivity { PuttingObject("putting object"), GettingObject("getting object"), + ComputingChecksum("computing checksum"), RecordingMetadata("recording metadata"), RestoringMetadata("restoring metadata"); diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/FileUtils.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/FileUtils.java index dfade3fd3..ba814c670 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/FileUtils.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/FileUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -17,7 +17,9 @@ import java.io.IOException; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; public final class FileUtils { private FileUtils() {} @@ -39,4 +41,19 @@ public static Path resolveForSymbolic(final Path path) throws IOException { } return path; } + + public static boolean isTransferablePath(final Path path) { + if ( ! Platform.isWindows()) { + try { + final BasicFileAttributes fileAttributes = Files.readAttributes(path, BasicFileAttributes.class); + return fileAttributes.isRegularFile() || fileAttributes.isDirectory(); + } catch (final NoSuchFileException e) { + return true; + } catch (final IOException e) { + return false; + } + } + + return true; + } } \ No newline at end of file diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Guard.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Guard.java index 811f0be6e..7e98c5d96 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Guard.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Guard.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -26,10 +26,22 @@ private Guard() { //pass } + public static boolean isNotNullAndNotEmpty(final Collection collection) { + return !isNullOrEmpty(collection); + } + public static boolean isNullOrEmpty(final Collection collection) { return collection == null || collection.isEmpty(); } + public static boolean isNotNullAndNotEmpty(final Iterable iterable) { + return !isNullOrEmpty(iterable); + } + + public static boolean isNullOrEmpty(final Iterable iterable) { + return iterable == null || ! iterable.iterator().hasNext(); + } + public static boolean isStringNullOrEmpty(final String str) { return str == null || str.isEmpty(); } @@ -40,10 +52,6 @@ public static void throwOnNullOrEmptyString(final String str, final String messa } } - public static boolean isNotNullAndNotEmpty(final Collection collection) { - return !isNullOrEmpty(collection); - } - public static boolean isMultiMapNullOrEmpty(final Multimap multimap) { return multimap == null || multimap.isEmpty(); } diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/MetadataStringManipulation.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/MetadataStringManipulation.java index 24dbbf091..a1bf6fa77 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/MetadataStringManipulation.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/MetadataStringManipulation.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -15,6 +15,7 @@ package com.spectralogic.ds3client.utils; +import com.google.common.base.Utf8; import com.google.common.escape.Escaper; import com.google.common.net.PercentEscaper; import org.apache.commons.codec.CharEncoding; @@ -31,15 +32,17 @@ public final class MetadataStringManipulation { /** * List of printable US-ASCII characters that do not need percent encoding. - * Includes separators equals "=" and comma ",": not encoded for use in creating Range header - * Excludes separators: "(" | ")" | "<" | ">" | "@" | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "{" | "}" - * Excludes Percent "%": not considered safe because it is used in percent encoding - * Excludes Plus "+": not considered safe because its interpreted as space during decoding + * Following the spec https://tools.ietf.org/html/rfc2616#page-31 for Message Headers */ - private static final String HTTP_HEADER_SAFE_CHARS = "!#$&'*-.~^_`|,="; + private static final String HTTP_HEADER_KEY_SAFE_CHARS = "!#$&'*-.~^_`|"; + private static final String HTTP_HEADER_VALUE_SAFE_CHARS = "()<>@,;:\"/\\[]?={}" + HTTP_HEADER_KEY_SAFE_CHARS; - private static final Escaper HTTP_HEADER_ESCAPER = - new PercentEscaper(HTTP_HEADER_SAFE_CHARS, false); + + private static final Escaper HTTP_HEADER_KEY_ESCAPER = + new PercentEscaper(HTTP_HEADER_KEY_SAFE_CHARS, false); + + private static final Escaper HTTP_HEADER_VALUE_ESCAPER = + new PercentEscaper(HTTP_HEADER_VALUE_SAFE_CHARS, false); private MetadataStringManipulation() { //pass @@ -47,15 +50,29 @@ private MetadataStringManipulation() { /** * Percent encodes non-alpha-numeric characters within the specified string - * excluding the symbols listed in {@link #HTTP_HEADER_SAFE_CHARS} using UTF-8 + * excluding the symbols listed in {@link #HTTP_HEADER_KEY_SAFE_CHARS} using UTF-8 */ - public static String toEncodedString(final String str) { + public static String toEncodedKeyString(final String str) { if (str == null) { return null; } final String strUtf8 = new String(str.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); - return getMetadataEscaper().escape(strUtf8); + return getMetadataKeyEscaper().escape(strUtf8); + } + + + /** + * Percent encodes non-alpha-numeric characters within the specified string + * excluding the symbols listed in {@link #HTTP_HEADER_VALUE_SAFE_CHARS} using UTF-8 + */ + public static String toEncodedValueString(final String str) { + if (str == null) { + return null; + } + + final String strUtf8 = new String(str.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); + return getMetadataValueEscaper().escape(strUtf8); } /** @@ -73,7 +90,11 @@ public static String toDecodedString(final String str) { } } - private static Escaper getMetadataEscaper() { - return HTTP_HEADER_ESCAPER; + private static Escaper getMetadataKeyEscaper() { + return HTTP_HEADER_KEY_ESCAPER; + } + + private static Escaper getMetadataValueEscaper() { + return HTTP_HEADER_VALUE_ESCAPER; } } diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Platform.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Platform.java index 9872b50de..86528e902 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Platform.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/Platform.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/ResourceUtils.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/ResourceUtils.java index 9568581d6..d52926786 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/ResourceUtils.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/ResourceUtils.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * diff --git a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/StringExtensions.java b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/StringExtensions.java index 10d5bf576..db19eef97 100644 --- a/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/StringExtensions.java +++ b/ds3-utils/src/main/java/com/spectralogic/ds3client/utils/StringExtensions.java @@ -1,16 +1,16 @@ /* - * **************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.utils; diff --git a/ds3-interfaces/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java b/ds3-utils/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java similarity index 75% rename from ds3-interfaces/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java rename to ds3-utils/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java index 857372dec..7b743cb6d 100644 --- a/ds3-interfaces/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java +++ b/ds3-utils/src/test/java/com/spectralogic/ds3client/exceptions/AggregateException_Test.java @@ -1,16 +1,16 @@ /* - * **************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at + * ****************************************************************************** + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** + * or in the "license" file accompanying this file. + * This file 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 com.spectralogic.ds3client.exceptions; diff --git a/ds3-utils/src/test/java/com/spectralogic/ds3client/utils/MetadataStringManipulation_Test.java b/ds3-utils/src/test/java/com/spectralogic/ds3client/utils/MetadataStringManipulation_Test.java index 01af142ae..4be688e34 100644 --- a/ds3-utils/src/test/java/com/spectralogic/ds3client/utils/MetadataStringManipulation_Test.java +++ b/ds3-utils/src/test/java/com/spectralogic/ds3client/utils/MetadataStringManipulation_Test.java @@ -1,6 +1,6 @@ /* * ****************************************************************************** - * Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved. + * Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * @@ -20,7 +20,8 @@ import java.util.regex.Pattern; import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toDecodedString; -import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedString; +import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedKeyString; +import static com.spectralogic.ds3client.utils.MetadataStringManipulation.toEncodedValueString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertFalse; @@ -33,107 +34,174 @@ public class MetadataStringManipulation_Test { private static final String STRING_WITH_SYMBOLS = "1234567890-!@#$%^&*()_+`~[]\\{}|;':\"./<>?∞πϊφϠ"; private static final String STRING_WITH_SYMBOLS_UNICODE = "1234567890-!@#$%^&*()_+`~[]\\{}|;':\"./<>?\u03C0\u221E\u03CA\u03D5\u03E0"; - private static final Pattern ENCODED_PATTERN = Pattern.compile("[a-zA-Z0-9!#$&'*\\-.~\\^_`|,=%]*"); + private static final Pattern KEY_ENCODED_PATTERN = Pattern.compile("[a-zA-Z0-9!#$&'*-.~^_`|%]*"); + + private static final Pattern VALUE_ENCODED_PATTERN = Pattern.compile("[a-zA-Z0-9!#$&'*-.~^_`|%()<>@,;:\"/\\\\\\[\\]?={}]*"); + + /* + * Verifies that an encoded string only contains key header safe characters + */ + private static boolean isEncodedSafeKeyChars(final String str) { + return KEY_ENCODED_PATTERN.matcher(str).matches(); + } /* - * Verifies that an encoded string only contains header safe characters + * Verifies that an encoded string only contains value header safe characters */ - private static boolean isEncodedSafeChars(final String str) { - return ENCODED_PATTERN.matcher(str).matches(); + private static boolean isEncodedSafeValueChars(final String str) { + return VALUE_ENCODED_PATTERN.matcher(str).matches(); } @Test - public void encodedPattern_Test() { - assertTrue(isEncodedSafeChars("")); - assertTrue(isEncodedSafeChars("abc123")); - assertTrue(isEncodedSafeChars("!#$&'*-.~^_`|,=%")); - - assertFalse(isEncodedSafeChars(" ")); - assertFalse(isEncodedSafeChars("{")); - assertFalse(isEncodedSafeChars("}")); - assertFalse(isEncodedSafeChars("[")); - assertFalse(isEncodedSafeChars("]")); - assertFalse(isEncodedSafeChars("<")); - assertFalse(isEncodedSafeChars(">")); - assertFalse(isEncodedSafeChars("@")); - assertFalse(isEncodedSafeChars(";")); - assertFalse(isEncodedSafeChars(":")); - assertFalse(isEncodedSafeChars("\\")); - assertFalse(isEncodedSafeChars("\"")); - assertFalse(isEncodedSafeChars("/")); - assertFalse(isEncodedSafeChars("?")); - assertFalse(isEncodedSafeChars("+")); - - assertFalse(isEncodedSafeChars("\u221E")); - assertFalse(isEncodedSafeChars("\u03C0")); - assertFalse(isEncodedSafeChars("\u03CA")); - assertFalse(isEncodedSafeChars("\u03D5")); - assertFalse(isEncodedSafeChars("\u03E0")); + public void encodedKeyPatternTest() { + assertTrue(isEncodedSafeKeyChars("")); + assertTrue(isEncodedSafeKeyChars("abc123")); + assertTrue(isEncodedSafeKeyChars("!#$&'*-.~^_`|%")); + + assertFalse(isEncodedSafeKeyChars(" ")); + assertFalse(isEncodedSafeKeyChars("{")); + assertFalse(isEncodedSafeKeyChars("}")); + assertFalse(isEncodedSafeKeyChars("[")); + assertFalse(isEncodedSafeKeyChars("]")); + assertFalse(isEncodedSafeKeyChars("<")); + assertFalse(isEncodedSafeKeyChars(">")); + assertFalse(isEncodedSafeKeyChars("@")); + assertFalse(isEncodedSafeKeyChars(";")); + assertFalse(isEncodedSafeKeyChars(":")); + assertFalse(isEncodedSafeKeyChars("\\")); + assertFalse(isEncodedSafeKeyChars("\"")); + assertFalse(isEncodedSafeKeyChars("/")); + assertFalse(isEncodedSafeKeyChars("?")); + + assertFalse(isEncodedSafeKeyChars("\u221E")); + assertFalse(isEncodedSafeKeyChars("\u03C0")); + assertFalse(isEncodedSafeKeyChars("\u03CA")); + assertFalse(isEncodedSafeKeyChars("\u03D5")); + assertFalse(isEncodedSafeKeyChars("\u03E0")); + } + @Test + public void encodedValuePatternTest() { + assertTrue(isEncodedSafeValueChars("")); + assertTrue(isEncodedSafeValueChars("abc123")); + assertTrue(isEncodedSafeValueChars("!#$&'*-.~^_`|,=%")); + assertTrue(isEncodedSafeValueChars("{")); + assertTrue(isEncodedSafeValueChars("}")); + assertTrue(isEncodedSafeValueChars("<")); + assertTrue(isEncodedSafeValueChars(">")); + assertTrue(isEncodedSafeValueChars("@")); + assertTrue(isEncodedSafeValueChars(";")); + assertTrue(isEncodedSafeValueChars(":")); + assertTrue(isEncodedSafeValueChars("\"")); + assertTrue(isEncodedSafeValueChars("/")); + assertTrue(isEncodedSafeValueChars("?")); + assertTrue(isEncodedSafeValueChars("[")); + assertTrue(isEncodedSafeValueChars("]")); + assertTrue(isEncodedSafeValueChars("\\")); + + assertFalse(isEncodedSafeValueChars(" ")); + + assertFalse(isEncodedSafeValueChars("\u221E")); + assertFalse(isEncodedSafeValueChars("\u03C0")); + assertFalse(isEncodedSafeValueChars("\u03CA")); + assertFalse(isEncodedSafeValueChars("\u03D5")); + assertFalse(isEncodedSafeValueChars("\u03E0")); } @Test - public void encodeDecode_NullString_Test() { - assertThat(toEncodedString(null), is(nullValue())); + public void encodeDecodeNullStringTest() { + assertThat(toEncodedKeyString(null), is(nullValue())); + assertThat(toEncodedValueString(null), is(nullValue())); assertThat(toDecodedString(null), is(nullValue())); } @Test - public void encodeDecode_WithSpaces_Test() { - final String encoded = toEncodedString(STRING_WITH_SPACES); - assertTrue(isEncodedSafeChars(encoded)); - assertThat(toDecodedString(encoded), is(STRING_WITH_SPACES)); + public void encodeDecodeWithSpacesTest() { + final String encodedKey = toEncodedKeyString(STRING_WITH_SPACES); + assertTrue(isEncodedSafeKeyChars(encodedKey)); + assertThat(toDecodedString(encodedKey), is(STRING_WITH_SPACES)); + + final String encodedValue = toEncodedValueString(STRING_WITH_SPACES); + assertTrue(isEncodedSafeValueChars(encodedValue)); + assertThat(toDecodedString(encodedValue), is(STRING_WITH_SPACES)); } @Test - public void encodeDecode_WithSymbols_Test() { - final String encoded = toEncodedString(STRING_WITH_SYMBOLS); - assertTrue(isEncodedSafeChars(encoded)); - assertThat(toDecodedString(encoded), is(STRING_WITH_SYMBOLS)); + public void encodeDecodeWithSymbolsTest() { + final String encodedKey = toEncodedKeyString(STRING_WITH_SYMBOLS); + assertTrue(isEncodedSafeKeyChars(encodedKey)); + assertThat(toDecodedString(encodedKey), is(STRING_WITH_SYMBOLS)); + + final String encodedValue = toEncodedValueString(STRING_WITH_SYMBOLS); + assertTrue(isEncodedSafeValueChars(encodedValue)); + assertThat(toDecodedString(encodedValue), is(STRING_WITH_SYMBOLS)); } @Test - public void encodeDecode_WithUnicodeSymbols_Test() { - final String encoded = toEncodedString(STRING_WITH_SYMBOLS_UNICODE); - assertTrue(isEncodedSafeChars(encoded)); - assertThat(toDecodedString(encoded), is(STRING_WITH_SYMBOLS_UNICODE)); + public void encodeDecodeWithUnicodeSymbolsTest() { + final String encodedKey = toEncodedKeyString(STRING_WITH_SYMBOLS_UNICODE); + assertTrue(isEncodedSafeKeyChars(encodedKey)); + assertThat(toDecodedString(encodedKey), is(STRING_WITH_SYMBOLS_UNICODE)); + + final String encodedValue = toEncodedValueString(STRING_WITH_SYMBOLS_UNICODE); + assertTrue(isEncodedSafeValueChars(encodedValue)); + assertThat(toDecodedString(encodedValue), is(STRING_WITH_SYMBOLS_UNICODE)); } @Test - public void encodeDecode_SpaceAndPlus_Test() { + public void encodeDecodeSpaceAndPlusTest() { final String plusSpace = " +"; - final String encoded = toEncodedString(plusSpace); - assertTrue(isEncodedSafeChars(encoded)); - assertThat(toDecodedString(encoded), is(plusSpace)); + + final String encodedKey = toEncodedKeyString(plusSpace); + assertTrue(isEncodedSafeKeyChars(encodedKey)); + assertThat(toDecodedString(encodedKey), is(plusSpace)); + + final String encodedValue = toEncodedValueString(plusSpace); + assertTrue(isEncodedSafeValueChars(encodedValue)); + assertThat(toDecodedString(encodedValue), is(plusSpace)); } @Test - public void encodeDecode_Range_Test() { + public void encodeDecodeRangeTest() { final String range = "Range=bytes=0-10,110-120"; - final String encoded = toEncodedString(range); - assertTrue(isEncodedSafeChars(encoded)); - assertThat(encoded, is(range)); + final String encodedValue = toEncodedValueString(range); + assertTrue(isEncodedSafeValueChars(encodedValue)); + assertThat(encodedValue, is(range)); assertThat(toDecodedString(range), is(range)); } @Test - public void decodedDecode_LowerCase_Test() { - final String encodedToLower = toEncodedString(STRING_WITH_SYMBOLS).toLowerCase(); - assertTrue(isEncodedSafeChars(encodedToLower)); - assertThat(toDecodedString(encodedToLower), is(STRING_WITH_SYMBOLS)); + public void decodedDecodeLowerCaseTest() { + final String encodedToLowerKey = toEncodedKeyString(STRING_WITH_SYMBOLS).toLowerCase(); + assertTrue(isEncodedSafeKeyChars(encodedToLowerKey)); + assertThat(toDecodedString(encodedToLowerKey), is(STRING_WITH_SYMBOLS)); + + final String encodedToLowerValue = toEncodedValueString(STRING_WITH_SYMBOLS).toLowerCase(); + assertTrue(isEncodedSafeValueChars(encodedToLowerValue)); + assertThat(toDecodedString(encodedToLowerValue), is(STRING_WITH_SYMBOLS)); } @Test - public void encodeDecode_DoubleEncoding_Test() { - final String encoded1 = toEncodedString(STRING_WITH_SYMBOLS); - final String encoded2 = toEncodedString(encoded1); - assertTrue(isEncodedSafeChars(encoded1)); - assertTrue(isEncodedSafeChars(encoded2)); - - final String decoded1 = toDecodedString(encoded2); - final String decoded2 = toDecodedString(decoded1); - assertThat(decoded1, is(encoded1)); - assertThat(decoded2, is(STRING_WITH_SYMBOLS)); + public void encodeDecodeDoubleEncodingTest() { + final String encoded1Key = toEncodedKeyString(STRING_WITH_SYMBOLS); + final String encoded2Key = toEncodedKeyString(encoded1Key); + assertTrue(isEncodedSafeKeyChars(encoded1Key)); + assertTrue(isEncodedSafeKeyChars(encoded2Key)); + + final String decoded1Key = toDecodedString(encoded2Key); + final String decoded2Key = toDecodedString(decoded1Key); + assertThat(decoded1Key, is(encoded1Key)); + assertThat(decoded2Key, is(STRING_WITH_SYMBOLS)); + + final String encoded1Value = toEncodedValueString(STRING_WITH_SYMBOLS); + final String encoded2Value = toEncodedValueString(encoded1Value); + assertTrue(isEncodedSafeValueChars(encoded1Value)); + assertTrue(isEncodedSafeValueChars(encoded2Value)); + + final String decoded1Value = toDecodedString(encoded2Value); + final String decoded2Value = toDecodedString(decoded1Value); + assertThat(decoded1Value, is(encoded1Value)); + assertThat(decoded2Value, is(STRING_WITH_SYMBOLS)); } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d6e2637af..7f93135c4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b0d3b7e83..ac72c34e8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Fri Jan 20 20:11:05 MST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip diff --git a/gradlew b/gradlew index 4ef3a871f..0adc8e1a5 100755 --- a/gradlew +++ b/gradlew @@ -1,78 +1,127 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original 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 +# +# https://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. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,91 +130,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -for s in "${@}" ; do - s=\"$s\" - APP_ARGS=$APP_ARGS" "$s -done - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index e95643d6a..93e3f59f1 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,84 +1,92 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/libs.versions.toml b/libs.versions.toml new file mode 100644 index 000000000..3eac4dfdb --- /dev/null +++ b/libs.versions.toml @@ -0,0 +1,77 @@ +# +# ****************************************************************************** +# Copyright 2022 Spectra Logic Corporation. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use +# this file except in compliance with the License. A copy of the License is located at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# or in the "license" file accompanying this file. +# This file 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. +# **************************************************************************** +# +[versions] +# +# project version +# +ds3SdkVersion = "6.0.0" +# +# dependency versions +# +commonsLang3Version = "3.12.0" +commonsCodecVersion = "1.15" +commonsIoVersion = "2.17.0" +findbugsVersion = "3.0.1" +guavaVersion = "32.1.2-jre" +hamcrestVersion = "2.2" +httpclientVersion = "4.5.13" +jacksonVersion = "2.14.3" # stuck on 2.14.x until we move away from Java 8 as a minimum supported version +jnaVersion = "5.12.1" +junitJupiterVersion = "5.9.0" +junitVersion = "4.13.2" +kotlinVersion = "1.6.10" +mockitoVersion = "4.7.0" +slf4jVersion = "1.7.36" +woodstoxVersion = "4.4.1" + +[libraries] +commonsCodec = { group = "commons-codec", name = "commons-codec", version.ref = "commonsCodecVersion" } +commonsIo = { group = "commons-io", name = "commons-io", version.ref = "commonsIoVersion" } +findbugs = { group = "com.google.code.findbugs", name = "annotations", version.ref = "findbugsVersion" } +guava = { group = "com.google.guava", name = "guava", version.ref = "guavaVersion" } +httpclient = { group = "org.apache.httpcomponents", name = "httpclient", version.ref = "httpclientVersion" } +jacksonBom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "jacksonVersion" } +## jackson version controlled by jackson-bom +jacksonDatatypeJdk8 = { group = "com.fasterxml.jackson.datatype", name="jackson-datatype-jdk8" } +jacksonDataformatXml = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-xml" } +## end jackson-bom controlled dependencies +jna = { group = "net.java.dev.jna", name = "jna", version.ref = "jnaVersion" } +jnaPlatform = { group = "net.java.dev.jna", name = "jna-platform", version.ref = "jnaVersion" } +kotlinStdLib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinVersion" } +## end kotlin-bom controlled dependencies +slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4jVersion" } +woodstoxCoreAsl = { group = "org.codehaus.woodstox", name = "woodstox-core-asl", version.ref = "woodstoxVersion" } +# +# test only libraries +# +commonsLang3 = { group = "org.apache.commons",name = "commons-lang3", version.ref = "commonsLang3Version" } +hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrestVersion" } +junit = { group = "junit", name = "junit", version.ref = "junitVersion"} +junitJupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitJupiterVersion" } +junitVintageEngine = { group = "org.junit.vintage", name = "junit-vintage-engine", version.ref = "junitJupiterVersion" } +mockitoBom = { group = "org.mockito", name = "mockito-bom", version.ref = "mockitoVersion" } +mockitoCore = { group = "org.mockito", name = "mockito-core" } +slf4jSimple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4jVersion" } +# +# plugins used in buildSrc/ +# +kotlinJvmPlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlinVersion" } +owaspDepCheckPlugin = { group = "org.owasp", name = "dependency-check-gradle", version = "10.0.3" } # stuck on this version until we move from building with java 8 +gradleVersionsPlugin = { group = "com.github.ben-manes", name = "gradle-versions-plugin", version = "0.47.0" } + +[plugins] +gitVersionPlugin = { id = "com.palantir.git-version", version = "0.12.2" } # stuck on this version until we move from building with java 8 +shadowPlugin = { id = "com.github.johnrengelman.shadow", version = "7.1.2" } + diff --git a/project_files/owasp/dependency-check-suppression.xml b/project_files/owasp/dependency-check-suppression.xml new file mode 100644 index 000000000..ee60d3e7c --- /dev/null +++ b/project_files/owasp/dependency-check-suppression.xml @@ -0,0 +1,21 @@ + + + + + ^(?!pkg:maven/commons-net/commons-net).*$ + cpe:/a:apache:commons_net + + + + ^pkg:maven/com\.fasterxml\.jackson\.core/jackson\-databind@.*$ + CVE-2023-35116 + + diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index d0a85a6f1..000000000 --- a/settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -/* - * **************************************************************************** - * Copyright 2014-2016 Spectra Logic Corporation. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use - * this file except in compliance with the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. - * This file 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. - * **************************************************************************** - */ - -include 'ds3-sdk-integration', 'ds3-sdk', 'ds3-sdk-samples', 'ds3-interfaces', 'ds3-metadata', 'ds3-utils' -rootProject.name = 'ds3-java-sdk' - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..a1a1208f7 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,39 @@ +/* + * ****************************************************************************** + * Copyright 2022 Spectra Logic Corporation. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use + * this file except in compliance with the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. + * This file 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. + * **************************************************************************** + */ + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention").version("0.7.0") +} + +rootProject.name = "ds3-java-sdk" + +include("ds3-interfaces") +include("ds3-utils") +include("ds3-sdk") +include("ds3-metadata") +include("ds3-sdk-samples") +include("ds3-sdk-integration") +include("ds3-bom") + +dependencyResolutionManagement { + repositories { + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("libs.versions.toml")) + } + } +}