com.vmware.vcloud.sdk
Class SdkUtil

java.lang.Object
  extended by com.vmware.vcloud.sdk.SdkUtil

public class SdkUtil
extends Object

The SdkUtil contains methods for, 1. retrieving messages from the I18N resource bundles. 2. provides SDK level GET PUT POST DELETE methods which calls and validates the GET PUT POST DELETE methods in the RestUtil.

Since:
API 1.5, SDK 1.5
Author:
EcosystemEngineering

Method Summary
static
<T> T
delete(VcloudClient client, String url, int statusCode)
          This method calls the DELETE operation in the Rest Utility.
static
<T> T
get(VcloudClient client, String url, int statusCode)
          This method calls the GET operation in the Rest Utility.
static String getI18nString(SdkMessage sdkMessage)
          This method returns the I18N String from the resource bundle based on the systems locale.
static
<T> T
post(VcloudClient client, String url, String requestString, String mediaType, int statusCode)
          This method calls the POST operation in the Rest Utility.
static
<T> T
put(VcloudClient client, String url, String requestString, String mediaType, int statusCode)
          This method calls the PUT operation in the Rest Utility.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getI18nString

public static String getI18nString(SdkMessage sdkMessage)
This method returns the I18N String from the resource bundle based on the systems locale.

Parameters:
sdkMessage - SdkMessage
Returns:
String

get

public static <T> T get(VcloudClient client,
                        String url,
                        int statusCode)
             throws VCloudException
This method calls the GET operation in the Rest Utility. This method also validates the response for 200 OK.

Parameters:
client - VcloudClient
url - String
Returns:
Throws:
VCloudException

post

public static <T> T post(VcloudClient client,
                         String url,
                         String requestString,
                         String mediaType,
                         int statusCode)
              throws VCloudException
This method calls the POST operation in the Rest Utility. This method validates the response based on the expected status code.

Parameters:
client - VcloudClient
url - String
requestString - String
mediaType - String
statusCode -
Returns:
Throws:
VCloudException

put

public static <T> T put(VcloudClient client,
                        String url,
                        String requestString,
                        String mediaType,
                        int statusCode)
             throws VCloudException
This method calls the PUT operation in the Rest Utility. This method validates the response based on the expected status code.

Parameters:
client - VcloudClient
url - String
requestString - String
mediaType - String
statusCode -
Returns:
Throws:
VCloudException

delete

public static <T> T delete(VcloudClient client,
                           String url,
                           int statusCode)
                throws VCloudException
This method calls the DELETE operation in the Rest Utility. This method validates the response based on the expected status code.

Parameters:
client - VcloudClient
url - String
statusCode -
Returns:
Throws:
VCloudException


Copyright © 2016. All Rights Reserved.