Skip to content

Commit

Permalink
Merge pull request #434 from rpmoore/interface_fix
Browse files Browse the repository at this point in the history
Removing a redundant interface which was causing some compilation errors
  • Loading branch information
GraciesPadre authored Jan 25, 2017
2 parents 81f63f3 + e0e6cd2 commit 74ef4ec
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

allprojects {
group = 'com.spectralogic.ds3'
version = '3.2.9'
version = '3.2.10'
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* ****************************************************************************
*/

package com.spectralogic.ds3client.helpers.Ds3ClientHelpers;
package com.spectralogic.ds3client.helpers;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


import com.google.common.collect.ImmutableMap;
import com.spectralogic.ds3client.helpers.Ds3ClientHelpers.MetadataAccess;
import com.spectralogic.ds3client.helpers.MetadataAccess;
import com.spectralogic.ds3client.metadata.interfaces.MetadataStore;
import com.spectralogic.ds3client.utils.Platform;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
import com.spectralogic.ds3client.commands.*;
import com.spectralogic.ds3client.commands.interfaces.BulkResponse;
import com.spectralogic.ds3client.commands.spectrads3.*;
import com.spectralogic.ds3client.helpers.Ds3ClientHelpers;
import com.spectralogic.ds3client.helpers.JobRecoveryException;
import com.spectralogic.ds3client.helpers.JobRecoveryNotActiveException;
import com.spectralogic.ds3client.helpers.ObjectCompletedListener;
import com.spectralogic.ds3client.helpers.*;
import com.spectralogic.ds3client.helpers.options.WriteJobOptions;
import com.spectralogic.ds3client.integration.test.helpers.JobStatusHelper;
import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds;
Expand Down Expand Up @@ -1178,7 +1175,7 @@ public void testHelperMetadata() throws IOException, URISyntaxException {

final AtomicBoolean calledWithMetadata = new AtomicBoolean(false);

job.withMetadata(new Ds3ClientHelpers.MetadataAccess() {
job.withMetadata(new MetadataAccess() {
@Override
public Map<String, String> getMetadataValue(final String filename) {
if (filename.equals("beowulf.txt")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.spectralogic.ds3client.Ds3ClientBuilder;
import com.spectralogic.ds3client.helpers.Ds3ClientHelpers;
import com.spectralogic.ds3client.helpers.FileObjectPutter;
import com.spectralogic.ds3client.helpers.MetadataAccess;
import com.spectralogic.ds3client.models.bulk.Ds3Object;

import java.io.IOException;
Expand Down Expand Up @@ -51,7 +52,7 @@ public static void main(final String[] args) throws IOException {
final Ds3ClientHelpers.Job job = helper.startWriteJob(bucketName, objects);

// To put metadata with each file we need to attach the metadata with a callback
job.withMetadata(new Ds3ClientHelpers.MetadataAccess() {
job.withMetadata(new MetadataAccess() {
@Override
public Map<String, String> getMetadataValue(final String objectName) {
// Return a map of the metadata that you want assigned to the request object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.nio.channels.SeekableByteChannel;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;

/**
Expand Down Expand Up @@ -121,10 +120,6 @@ void transfer(final ObjectChannelBuilder channelBuilder)
throws IOException;
}

public interface MetadataAccess {
Map<String, String> getMetadataValue(final String filename);
}

/**
* Wraps the given {@link com.spectralogic.ds3client.Ds3ClientImpl} with helper methods.
* @param client An instance of {@link com.spectralogic.ds3client.Ds3Client}, usually gotten from a call to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void removeMetadataReceivedListener(final MetadataReceivedListener listen
}

@Override
public Ds3ClientHelpers.Job withMetadata(final Ds3ClientHelpers.MetadataAccess access) {
public Ds3ClientHelpers.Job withMetadata(final MetadataAccess access) {
throw new IllegalStateException("withMetadata method is not used with Read Jobs");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class WriteJobImpl extends JobImpl {
private final int retryAfter; // Negative retryAfter value represent infinity retries
private final int retryDelay; //Negative value means use default

private Ds3ClientHelpers.MetadataAccess metadataAccess = null;
private MetadataAccess metadataAccess = null;
private ChecksumFunction checksumFunction = null;

public WriteJobImpl(
Expand Down Expand Up @@ -80,7 +80,7 @@ public void removeMetadataReceivedListener(final MetadataReceivedListener listen
}

@Override
public Ds3ClientHelpers.Job withMetadata(final Ds3ClientHelpers.MetadataAccess access) {
public Ds3ClientHelpers.Job withMetadata(final MetadataAccess access) {
checkRunning();
this.metadataAccess = access;
return this;
Expand Down

0 comments on commit 74ef4ec

Please sign in to comment.