-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b43a95
commit c98b59b
Showing
18 changed files
with
310 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...spectralogic/ds3client/commands/parsers/MarkTapeForCompactionSpectraS3ResponseParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<MarkTapeForCompactionSpectraS3Response> { | ||
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); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...com/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Request.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* ****************************************************************************** | ||
* Copyright 2014-2019 Spectra Logic Corporation. All Rights Reserved. | ||
* Licensed under the Apache License, Version 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; | ||
import com.google.common.net.UrlEscapers; | ||
|
||
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; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...om/spectralogic/ds3client/commands/spectrads3/MarkTapeForCompactionSpectraS3Response.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.