mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
corrected return type for getting a metadata value
This commit is contained in:
parent
6634d6a80a
commit
fc2c71a803
@ -36,7 +36,6 @@ import org.jclouds.rest.binders.BindToXMLPayload;
|
||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||
@ -123,7 +122,7 @@ public interface MediaAsyncClient {
|
||||
@Consumes
|
||||
@JAXBResponseParser
|
||||
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
|
||||
ListenableFuture<MetadataEntry> getMetadataEntry(@EndpointParam(parser = ReferenceToEndpoint.class) Reference mediaRef,
|
||||
ListenableFuture<MetadataValue> getMetadataValue(@EndpointParam(parser = ReferenceToEndpoint.class) Reference mediaRef,
|
||||
@PathParam("key") String key);
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.jclouds.concurrent.Timeout;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Media;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||
@ -82,11 +81,11 @@ public interface MediaClient {
|
||||
Task mergeMetadata(Reference mediaRef, Metadata metadata);
|
||||
|
||||
/**
|
||||
* Retrieves a metadata entry
|
||||
* Retrieves a metadata value
|
||||
*
|
||||
* @return the metadata entry, or null if not found
|
||||
* @return the metadata value, or null if not found
|
||||
*/
|
||||
MetadataEntry getMetadataEntry(Reference mediaRef, String key);
|
||||
MetadataValue getMetadataValue(Reference mediaRef, String key);
|
||||
|
||||
/**
|
||||
* Sets the metadata for the particular key for the media to the value provided.
|
||||
@ -95,7 +94,7 @@ public interface MediaClient {
|
||||
* @return a task. This operation is asynchronous and the user should monitor the returned
|
||||
* task status in order to check when it is completed.
|
||||
*/
|
||||
Task setMetadata(Reference mediaRef, String key, MetadataValue metadataEntry);
|
||||
Task setMetadata(Reference mediaRef, String key, MetadataValue metadataValue);
|
||||
|
||||
/**
|
||||
* Deletes a metadata entry.
|
||||
|
@ -251,11 +251,11 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||
.xmlFilePayload("/media/metadataEntry.xml", VCloudDirectorMediaType.METADATA_ENTRY)
|
||||
.httpResponseBuilder().build());
|
||||
|
||||
MetadataEntry expected = metadataEntry();
|
||||
MetadataValue expected = metadataValue();
|
||||
|
||||
Reference mediaRef = Reference.builder().href(mediaUri).build();
|
||||
|
||||
assertEquals(client.getMediaClient().getMetadataEntry(mediaRef, "key"), expected);
|
||||
assertEquals(client.getMediaClient().getMetadataValue(mediaRef, "key"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -465,15 +465,15 @@ public class MediaClientExpectTest extends BaseVCloudDirectorRestClientExpectTes
|
||||
.build();
|
||||
}
|
||||
|
||||
private static MetadataEntry metadataEntry() {
|
||||
return MetadataEntry.builder()
|
||||
private static MetadataValue metadataValue() {
|
||||
return MetadataValue.builder()
|
||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/cmedia/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key"))
|
||||
.link(Link.builder()
|
||||
.rel("up")
|
||||
.type("application/vnd.vmware.vcloud.metadata+xml")
|
||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata"))
|
||||
.build())
|
||||
.key("key").value("value").build();
|
||||
.value("value").build();
|
||||
}
|
||||
|
||||
private Task mergeMetadataTask() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user