| Constructor and Description |
|---|
VcdUtils() |
| Modifier and Type | Method and Description |
|---|---|
static URI |
buildDeleteUri(URI baseHref,
Boolean force,
Boolean recursive)
Constructs a
URI which has the correct delete parameters set as URL
parameters if applicable |
static com.vmware.vcloud.api.rest.schema_v1_5.LinkType |
findLink(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource,
com.vmware.vcloud.api.rest.links.LinkRelation rel,
String mediaType)
Returns the link of the specified rel and type in the specified resource
|
static com.vmware.vcloud.api.rest.schema_v1_5.LinkType |
findLink(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource,
com.vmware.vcloud.api.rest.links.LinkRelation rel,
String mediaType,
boolean failIfAbsent)
Returns the link of the specified rel and type in the specified resource
|
static String |
getEntityId(com.vmware.vcloud.api.rest.schema_v1_5.EntityType entityType)
Gets an entity's ID in a form that can be used as an input parameter to a service method that
expects an ID.
|
static List<com.vmware.vcloud.api.rest.schema_v1_5.LinkType> |
getLinks(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource,
com.vmware.vcloud.api.rest.links.LinkRelation rel,
String mediaType)
Returns all the links of the specified rel and type in the specified resource
|
static <T extends com.vmware.vcloud.api.rest.schema_v1_5.EntityType> |
getTask(T entityType)
Convenience method to get
TaskType from given resource. |
static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType |
makeRef(com.vmware.vcloud.api.rest.schema_v1_5.EntityType entity)
Convenience method to turn an
EntityType into a ReferenceType to that entity. |
static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType |
makeRef(com.vmware.vcloud.api.rest.schema_v1_5.IdentifiableResourceType identifiableResource)
Convenience method to turn an
IdentifiableResourceType into a ReferenceType to that resource. |
static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType |
makeRef(com.vmware.vcloud.api.rest.schema_v1_5.LinkType link)
Convenience method to turn a
LinkType into a ReferenceType to the linked-to resource. |
static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType |
makeRef(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource)
Convenience method to turn a
ResourceType into a ReferenceType to that resource. |
static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType |
makeRef(String href)
Convenience method to turn a
String of an URL into a ReferenceType with that URL. |
public static URI buildDeleteUri(URI baseHref, Boolean force, Boolean recursive)
URI which has the correct delete parameters set as URL
parameters if applicablebaseHref - force - true, false or null which indicates the parameter should
be omittedrecursive - true, false or null which indicates the parameter should
be omittedURI which can be further altered by the caller if necessary.public static String getEntityId(com.vmware.vcloud.api.rest.schema_v1_5.EntityType entityType)
VcdClient and/or CXF's REST client support. The vCloud API, being a "proper" sort of
REST, returns links to resources in its responses with the idea that clients traverse the
graph of vCloud objects by following those links. However, the vCloud JAX-RS
interfaces/handlers are "service-oriented" in a way that makes it hard to usefully represent
those links in a CXF REST client. Instead, clients end up doing the bad thing of using entity
IDs to compose URLs (CXF composes them on the clients behalf, using JAX-RS annotations in the
vCloud JAX-RS interfaces, which is just as bad), rather than simply following returned links.
We should figure out if there's a way to do better.public static com.vmware.vcloud.api.rest.schema_v1_5.LinkType findLink(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource,
com.vmware.vcloud.api.rest.links.LinkRelation rel,
String mediaType)
throws MissingLinkException,
MultipleLinksException
resource - the resource with the linkrel - the rel of the desired linkmediaType - media type of contentMissingLinkException - if no link of the specified rel and media type is foundMultipleLinksException - if multiple links of the specified rel and media type are foundpublic static com.vmware.vcloud.api.rest.schema_v1_5.LinkType findLink(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource,
com.vmware.vcloud.api.rest.links.LinkRelation rel,
String mediaType,
boolean failIfAbsent)
throws MissingLinkException,
MultipleLinksException
resource - the resource with the linkrel - the rel of the desired linkmediaType - media type of contentfailIfAbsent - controls whether an exception is thrown if there's not exactly one link of the specified rel and media typeMissingLinkException - if no link of the specified rel and media type is foundMultipleLinksException - if multiple links of the specified rel and media type are foundpublic static List<com.vmware.vcloud.api.rest.schema_v1_5.LinkType> getLinks(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource, com.vmware.vcloud.api.rest.links.LinkRelation rel, String mediaType)
resource - the resource with the linkrel - the rel of the desired linkmediaType - media type of contentpublic static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType makeRef(com.vmware.vcloud.api.rest.schema_v1_5.ResourceType resource)
ResourceType into a ReferenceType to that resource.public static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType makeRef(com.vmware.vcloud.api.rest.schema_v1_5.IdentifiableResourceType identifiableResource)
IdentifiableResourceType into a ReferenceType to that resource.public static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType makeRef(com.vmware.vcloud.api.rest.schema_v1_5.EntityType entity)
EntityType into a ReferenceType to that entity.public static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType makeRef(com.vmware.vcloud.api.rest.schema_v1_5.LinkType link)
LinkType into a ReferenceType to the linked-to resource.public static com.vmware.vcloud.api.rest.schema_v1_5.ReferenceType makeRef(String href)
String of an URL into a ReferenceType with that URL.public static <T extends com.vmware.vcloud.api.rest.schema_v1_5.EntityType> com.vmware.vcloud.api.rest.schema_v1_5.TaskType getTask(T entityType)
TaskType from given resource.RuntimeException - if more than one TaskType found in given resource.Copyright © 2019 VMware. All rights reserved.