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
32 changes: 32 additions & 0 deletions contract/5_0_x_contract.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4602,6 +4602,32 @@
</ResponseCodes>
<Version>1.BDA9A7110ADB2C122D0CA705B6B1D6FA</Version>
</RequestHandler>
<RequestHandler Classification="spectrads3" Name="com.spectralogic.s3.server.handler.reqhandler.spectrads3.object.UndeleteObjectRequestHandler">
<Request Action="BULK_MODIFY" HttpVerb="PUT" IncludeIdInPath="false" Resource="OBJECT" ResourceType="NON_SINGLETON">
<OptionalQueryParams>
<Param Name="VersionId" Type="java.util.UUID"/>
</OptionalQueryParams>
<RequiredQueryParams>
<Param Name="BucketId" Type="java.util.UUID"/>
<Param Name="Name" Type="java.lang.String"/>
</RequiredQueryParams>
</Request>
<ResponseCodes>
<ResponseCode>
<Code>200</Code>
<ResponseTypes>
<ResponseType Type="com.spectralogic.s3.common.dao.domain.ds3.S3Object"/>
</ResponseTypes>
</ResponseCode>
<ResponseCode>
<Code>404</Code>
<ResponseTypes>
<ResponseType Type="com.spectralogic.s3.server.domain.HttpErrorResultApiBean"/>
</ResponseTypes>
</ResponseCode>
</ResponseCodes>
<Version>1.94C075BD3FE76604F8ED084C9B9E4AE5</Version>
</RequestHandler>
<RequestHandler Classification="spectrads3" Name="com.spectralogic.s3.server.handler.reqhandler.spectrads3.object.VerifyPhysicalPlacementForObjectsRequestHandler">
<Request Action="SHOW" HttpVerb="GET" IncludeIdInPath="true" Operation="VERIFY_PHYSICAL_PLACEMENT" Resource="BUCKET" ResourceType="NON_SINGLETON">
<OptionalQueryParams>
Expand Down Expand Up @@ -5442,6 +5468,12 @@
<ResponseType Type="com.spectralogic.s3.common.dao.domain.ds3.StorageDomainMember"/>
</ResponseTypes>
</ResponseCode>
<ResponseCode>
<Code>400</Code>
<ResponseTypes>
<ResponseType Type="com.spectralogic.s3.server.domain.HttpErrorResultApiBean"/>
</ResponseTypes>
</ResponseCode>
</ResponseCodes>
<Version>1.2861D535C9E907B2316C6DD326F9C9DB</Version>
</RequestHandler>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,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));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* ******************************************************************************
* 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.parsers;

import com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser;
import com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils;
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 UndeleteObjectSpectraS3ResponseParser extends AbstractResponseParser<UndeleteObjectSpectraS3Response> {
private final int[] expectedStatusCodes = new int[]{200};

@Override
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 S3Object result = XmlOutput.fromXml(inputStream, S3Object.class);
return new UndeleteObjectSpectraS3Response(result, this.getChecksum(), this.getChecksumType());
}

default:
assert false: "validateStatusCode should have made it impossible to reach this line";
}
}

throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* ******************************************************************************
* 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.spectrads3;

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* ******************************************************************************
* 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.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;
}

}