Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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.FileSystemKey;
import com.spectralogic.ds3client.helpers.pagination.FileSystemKey;
import com.spectralogic.ds3client.networking.FailedRequestException;
import com.spectralogic.ds3client.utils.collections.LazyIterable;
import org.junit.AfterClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,26 @@

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 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;

}

Expand All @@ -42,11 +49,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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,26 @@

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 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;

}

Expand All @@ -42,11 +49,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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import com.spectralogic.ds3client.models.DataIsolationLevel;
import java.lang.Integer;
import com.spectralogic.ds3client.models.DataPersistenceRuleType;
import java.util.UUID;
import com.google.common.net.UrlEscapers;

public class ModifyDataPersistenceRuleSpectraS3Request extends AbstractRequest {

// Variables

private final String dataPersistenceRule;
private final String dataPersistenceRuleId;

private DataIsolationLevel isolationLevel;

Expand All @@ -38,8 +39,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;

}

Expand Down Expand Up @@ -72,11 +79,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;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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 {
Expand All @@ -27,6 +28,8 @@ public class RawImportAllTapesSpectraS3Request extends AbstractRequest {

private final String bucketId;

private String storageDomainId;

private Priority taskPriority;

// Constructor
Expand All @@ -40,6 +43,20 @@ public RawImportAllTapesSpectraS3Request(final String bucketId) {
this.getQueryParams().put("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);
Expand All @@ -63,6 +80,11 @@ public String getBucketId() {
}


public String getStorageDomainId() {
return this.storageDomainId;
}


public Priority getTaskPriority() {
return this.taskPriority;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,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 {

Expand All @@ -30,6 +30,8 @@ public class RawImportTapeSpectraS3Request extends AbstractRequest {

private final String bucketId;

private String storageDomainId;

private Priority taskPriority;

// Constructor
Expand All @@ -54,6 +56,20 @@ public RawImportTapeSpectraS3Request(final String bucketId, final String tapeId)
this.getQueryParams().put("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);
Expand Down Expand Up @@ -82,6 +98,11 @@ public String getBucketId() {
}


public String getStorageDomainId() {
return this.storageDomainId;
}


public Priority getTaskPriority() {
return this.taskPriority;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* ****************************************************************************
*/

package com.spectralogic.ds3client.models;
package com.spectralogic.ds3client.exceptions;
public class UnableToConvertToCommonPrefixesException extends RuntimeException {
public UnableToConvertToCommonPrefixesException(final String s) {
super(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/
package com.spectralogic.ds3client.models;
package com.spectralogic.ds3client.exceptions;

public class UnabledToConvertToContentsException extends RuntimeException {
public UnabledToConvertToContentsException(final String s) {
public class UnableToConvertToContentsException extends RuntimeException {
public UnableToConvertToContentsException(final String s) {
super(s);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.spectralogic.ds3client.helpers.options.WriteJobOptions;
import com.spectralogic.ds3client.helpers.strategy.transferstrategy.TransferStrategy;
import com.spectralogic.ds3client.models.Contents;
import com.spectralogic.ds3client.models.FileSystemKey;
import com.spectralogic.ds3client.helpers.pagination.FileSystemKey;
import com.spectralogic.ds3client.models.bulk.Ds3Object;
import com.spectralogic.ds3client.utils.Predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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.pagination.FileSystemKey;
import com.spectralogic.ds3client.helpers.pagination.GetBucketKeyLoaderFactory;
import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcher;
import com.spectralogic.ds3client.helpers.strategy.transferstrategy.EventDispatcherImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/
package com.spectralogic.ds3client.models;
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;
Expand Down Expand Up @@ -74,7 +78,7 @@ public CommonPrefixes toCommonPrefixes() throws RuntimeException{

public Contents toContents() throws RuntimeException {
if (isPrefix()) {
throw new UnabledToConvertToContentsException("Could not create a Contents");
throw new UnableToConvertToContentsException("Could not create a Contents");
}
final Contents contents = new Contents();
contents.setETag(eTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.common.collect.FluentIterable;
import com.spectralogic.ds3client.Ds3Client;
import com.spectralogic.ds3client.models.Contents;
import com.spectralogic.ds3client.models.FileSystemKey;
import com.spectralogic.ds3client.models.ListBucketResult;
import com.spectralogic.ds3client.models.common.CommonPrefixes;
import com.spectralogic.ds3client.utils.collections.LazyIterable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class ActiveJob {
@JsonProperty("CreatedAt")
private Date createdAt;

@JsonProperty("DeadJobCleanupAllowed")
private boolean deadJobCleanupAllowed;

@JsonProperty("ErrorMessage")
private String errorMessage;

Expand Down Expand Up @@ -150,6 +153,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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
public class TapeDrive {

// Variables
@JsonProperty("CleaningRequired")
private boolean cleaningRequired;

@JsonProperty("ErrorMessage")
private String errorMessage;

Expand All @@ -38,6 +41,9 @@ public class TapeDrive {
@JsonProperty("LastCleaned")
private Date lastCleaned;

@JsonProperty("MfgSerialNumber")
private String mfgSerialNumber;

@JsonProperty("PartitionId")
private UUID partitionId;

Expand All @@ -60,6 +66,15 @@ public TapeDrive() {

// Getters and Setters

public boolean getCleaningRequired() {
return this.cleaningRequired;
}

public void setCleaningRequired(final boolean cleaningRequired) {
this.cleaningRequired = cleaningRequired;
}


public String getErrorMessage() {
return this.errorMessage;
}
Expand Down Expand Up @@ -96,6 +111,15 @@ public void setLastCleaned(final Date lastCleaned) {
}


public String getMfgSerialNumber() {
return this.mfgSerialNumber;
}

public void setMfgSerialNumber(final String mfgSerialNumber) {
this.mfgSerialNumber = mfgSerialNumber;
}


public UUID getPartitionId() {
return this.partitionId;
}
Expand Down
Loading