signature:
public class TableDeserializer { /** * Reserved for internal use . Parses the operation response as an entity . Parses the result returned in the
 * specified stream in JSON format into a { @ link TableResult } containing an entity of the specified class type
 * projected using the specified resolver .
 * @ param parser
 * The < code > JsonParser < / code > to read the data to parse from .
 * @ param clazzType
 * The class type < code > T < / code > implementing { @ link TableEntity } for the entity returned . Set to
 * < code > null < / code > to ignore the returned entity and copy only response properties into the
 * { @ link TableResult } object .
 * @ param resolver
 * An { @ link EntityResolver } instance to project the entity into an instance of type < code > R < / code > . Set
 * to < code > null < / code > to return the entity as an instance of the class type < code > T < / code > .
 * @ param options
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation .
 * @ param opContext
 * An { @ link OperationContext } object used to track the execution of the operation .
 * @ return
 * A { @ link TableResult } containing the parsed entity result of the operation .
 * @ throws IOException
 * if an error occurs while accessing the stream .
 * @ throws InstantiationException
 * if an error occurs while constructing the result .
 * @ throws IllegalAccessException
 * if an error occurs in reflection while parsing the result .
 * @ throws StorageException
 * if a storage service error occurs .
 * @ throws IOException
 * if an error occurs while accessing the stream .
 * @ throws JsonParseException
 * if an error occurs while parsing the stream . */
private static < T extends TableEntity , R > TableResult parseJsonEntity ( final JsonParser parser , final Class < T > clazzType , HashMap < String , PropertyPair > classProperties , final EntityResolver < R > resolver , final TableRequestOptions options , final OperationContext opContext ) throws JsonParseException , IOException , StorageException , InstantiationException , IllegalAccessException { } }

implementation:
final TableResult res = new TableResult ( ) ; final HashMap < String , EntityProperty > properties = new HashMap < String , EntityProperty > ( ) ; if ( ! parser . hasCurrentToken ( ) ) { parser . nextToken ( ) ; } JsonUtilities . assertIsStartObjectJsonToken ( parser ) ; parser . nextToken ( ) ; // get all metadata , if present
while ( parser . getCurrentName ( ) . startsWith ( ODataConstants . ODATA_PREFIX ) ) { final String name = parser . getCurrentName ( ) . substring ( ODataConstants . ODATA_PREFIX . length ( ) ) ; // get the value token
parser . nextToken ( ) ; if ( name . equals ( ODataConstants . ETAG ) ) { String etag = parser . getValueAsString ( ) ; res . setEtag ( etag ) ; } // get the key token
parser . nextToken ( ) ; } if ( resolver == null && clazzType == null ) { return res ; } // get object properties
while ( parser . getCurrentToken ( ) != JsonToken . END_OBJECT ) { String key = Constants . EMPTY_STRING ; String val = Constants . EMPTY_STRING ; EdmType edmType = null ; // checks if this property is preceded by an OData property type annotation
if ( options . getTablePayloadFormat ( ) != TablePayloadFormat . JsonNoMetadata && parser . getCurrentName ( ) . endsWith ( ODataConstants . ODATA_TYPE_SUFFIX ) ) { parser . nextToken ( ) ; edmType = EdmType . parse ( parser . getValueAsString ( ) ) ; parser . nextValue ( ) ; key = parser . getCurrentName ( ) ; val = parser . getValueAsString ( ) ; } else { key = parser . getCurrentName ( ) ; parser . nextToken ( ) ; val = parser . getValueAsString ( ) ; edmType = evaluateEdmType ( parser . getCurrentToken ( ) , parser . getValueAsString ( ) ) ; } final EntityProperty newProp = new EntityProperty ( val , edmType ) ; newProp . setDateBackwardCompatibility ( options . getDateBackwardCompatibility ( ) ) ; properties . put ( key , newProp ) ; parser . nextToken ( ) ; } String partitionKey = null ; String rowKey = null ; Date timestamp = null ; String etag = null ; // Remove core properties from map and set individually
EntityProperty tempProp = properties . remove ( TableConstants . PARTITION_KEY ) ; if ( tempProp != null ) { partitionKey = tempProp . getValueAsString ( ) ; } tempProp = properties . remove ( TableConstants . ROW_KEY ) ; if ( tempProp != null ) { rowKey = tempProp . getValueAsString ( ) ; } tempProp = properties . remove ( TableConstants . TIMESTAMP ) ; if ( tempProp != null ) { tempProp . setDateBackwardCompatibility ( false ) ; timestamp = tempProp . getValueAsDate ( ) ; if ( res . getEtag ( ) == null ) { etag = getETagFromTimestamp ( tempProp . getValueAsString ( ) ) ; res . setEtag ( etag ) ; } } // do further processing for type if JsonNoMetdata by inferring type information via resolver or clazzType
if ( options . getTablePayloadFormat ( ) == TablePayloadFormat . JsonNoMetadata && ( options . getPropertyResolver ( ) != null || clazzType != null ) ) { if ( options . getPropertyResolver ( ) != null ) { for ( final Entry < String , EntityProperty > p : properties . entrySet ( ) ) { final String key = p . getKey ( ) ; final String value = p . getValue ( ) . getValueAsString ( ) ; EdmType edmType ; // try to use the property resolver to get the type
try { edmType = options . getPropertyResolver ( ) . propertyResolver ( partitionKey , rowKey , key , value ) ; } catch ( Exception e ) { throw new StorageException ( StorageErrorCodeStrings . INTERNAL_ERROR , SR . CUSTOM_RESOLVER_THREW , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; } // try to create a new entity property using the returned type
try { final EntityProperty newProp = new EntityProperty ( value , edmType ) ; newProp . setDateBackwardCompatibility ( options . getDateBackwardCompatibility ( ) ) ; properties . put ( p . getKey ( ) , newProp ) ; } catch ( IllegalArgumentException e ) { throw new StorageException ( StorageErrorCodeStrings . INVALID_TYPE , String . format ( SR . FAILED_TO_PARSE_PROPERTY , key , value , edmType ) , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; } } } else if ( clazzType != null ) { if ( classProperties == null ) { classProperties = PropertyPair . generatePropertyPairs ( clazzType ) ; } for ( final Entry < String , EntityProperty > p : properties . entrySet ( ) ) { PropertyPair propPair = classProperties . get ( p . getKey ( ) ) ; if ( propPair != null ) { final EntityProperty newProp = new EntityProperty ( p . getValue ( ) . getValueAsString ( ) , propPair . type ) ; newProp . setDateBackwardCompatibility ( options . getDateBackwardCompatibility ( ) ) ; properties . put ( p . getKey ( ) , newProp ) ; } } } } // set the result properties , now that they are appropriately parsed
res . setProperties ( properties ) ; // use resolver if provided , else create entity based on clazz type
if ( resolver != null ) { res . setResult ( resolver . resolve ( partitionKey , rowKey , timestamp , res . getProperties ( ) , res . getEtag ( ) ) ) ; } else if ( clazzType != null ) { // Generate new entity and return
final T entity = clazzType . newInstance ( ) ; entity . setEtag ( res . getEtag ( ) ) ; entity . setPartitionKey ( partitionKey ) ; entity . setRowKey ( rowKey ) ; entity . setTimestamp ( timestamp ) ; entity . readEntity ( res . getProperties ( ) , opContext ) ; res . setResult ( entity ) ; } return res ;


signature:
public class Canonicalizer { /** * Add x - ms - prefixed headers in a fixed order .
 * @ param conn
 * the HttpURLConnection for the operation
 * @ param canonicalizedString
 * the canonicalized string to add the canonicalized headerst to . */
private static void addCanonicalizedHeaders ( final HttpURLConnection conn , final StringBuilder canonicalizedString ) { } }

implementation:
// Look for header names that start with
// HeaderNames . PrefixForStorageHeader
// Then sort them in case - insensitive manner .
final Map < String , List < String > > headers = conn . getRequestProperties ( ) ; final ArrayList < String > httpStorageHeaderNameArray = new ArrayList < String > ( ) ; for ( final String key : headers . keySet ( ) ) { if ( key . toLowerCase ( Utility . LOCALE_US ) . startsWith ( Constants . PREFIX_FOR_STORAGE_HEADER ) ) { httpStorageHeaderNameArray . add ( key . toLowerCase ( Utility . LOCALE_US ) ) ; } } Collections . sort ( httpStorageHeaderNameArray ) ; // Now go through each header ' s values in the sorted order and append
// them to the canonicalized string .
for ( final String key : httpStorageHeaderNameArray ) { final StringBuilder canonicalizedElement = new StringBuilder ( key ) ; String delimiter = ":" ; final ArrayList < String > values = getHeaderValues ( headers , key ) ; boolean appendCanonicalizedElement = false ; // Go through values , unfold them , and then append them to the
// canonicalized element string .
for ( final String value : values ) { if ( value != null ) { appendCanonicalizedElement = true ; } // Unfolding is simply removal of CRLF .
final String unfoldedValue = CRLF . matcher ( value ) . replaceAll ( Matcher . quoteReplacement ( Constants . EMPTY_STRING ) ) ; // Append it to the canonicalized element string .
canonicalizedElement . append ( delimiter ) ; canonicalizedElement . append ( unfoldedValue ) ; delimiter = "," ; } // Now , add this canonicalized element to the canonicalized header
// string .
if ( appendCanonicalizedElement ) { appendCanonicalizedElement ( canonicalizedString , canonicalizedElement . toString ( ) ) ; } }


signature:
public class Canonicalizer { /** * Append a string to a string builder with a newline constant
 * @ param builder
 * the StringBuilder object
 * @ param element
 * the string to append . */
protected static void appendCanonicalizedElement ( final StringBuilder builder , final String element ) { } }

implementation: builder . append ( "\n" ) ; builder . append ( element ) ;


signature:
public class Canonicalizer { /** * Constructs a canonicalized string from the request ' s headers that will be used to construct the signature string
 * for signing a Blob or Queue service request under the Shared Key Full authentication scheme .
 * @ param address
 * the request URI
 * @ param accountName
 * the account name associated with the request
 * @ param method
 * the verb to be used for the HTTP request .
 * @ param contentType
 * the content type of the HTTP request .
 * @ param contentLength
 * the length of the content written to the outputstream in bytes , - 1 if unknown
 * @ param date
 * the date / time specification for the HTTP request
 * @ param conn
 * the HttpURLConnection for the operation .
 * @ return A canonicalized string .
 * @ throws StorageException */
protected static String canonicalizeHttpRequest ( final java . net . URL address , final String accountName , final String method , final String contentType , final long contentLength , final String date , final HttpURLConnection conn ) throws StorageException { } }

implementation:
// The first element should be the Method of the request .
// I . e . GET , POST , PUT , or HEAD .
final StringBuilder canonicalizedString = new StringBuilder ( ExpectedBlobQueueCanonicalizedStringLength ) ; canonicalizedString . append ( conn . getRequestMethod ( ) ) ; // The next elements are
// If any element is missing it may be empty .
appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . CONTENT_ENCODING ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . CONTENT_LANGUAGE ) ) ; appendCanonicalizedElement ( canonicalizedString , contentLength <= 0 ? Constants . EMPTY_STRING : String . valueOf ( contentLength ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . CONTENT_MD5 ) ) ; appendCanonicalizedElement ( canonicalizedString , contentType != null ? contentType : Constants . EMPTY_STRING ) ; final String dateString = Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . DATE ) ; // If x - ms - date header exists , Date should be empty string
appendCanonicalizedElement ( canonicalizedString , dateString . equals ( Constants . EMPTY_STRING ) ? date : Constants . EMPTY_STRING ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . IF_MODIFIED_SINCE ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . IF_MATCH ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . IF_NONE_MATCH ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . IF_UNMODIFIED_SINCE ) ) ; appendCanonicalizedElement ( canonicalizedString , Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . RANGE ) ) ; addCanonicalizedHeaders ( conn , canonicalizedString ) ; appendCanonicalizedElement ( canonicalizedString , getCanonicalizedResource ( address , accountName ) ) ; return canonicalizedString . toString ( ) ;


signature:
public class Canonicalizer { /** * Constructs a canonicalized string that will be used to construct the signature string
 * for signing a Table service request under the Shared Key authentication scheme .
 * @ param address
 * the request URI
 * @ param accountName
 * the account name associated with the request
 * @ param method
 * the verb to be used for the HTTP request .
 * @ param contentType
 * the content type of the HTTP request .
 * @ param contentLength
 * the length of the content written to the outputstream in bytes , - 1 if unknown
 * @ param date
 * the date / time specification for the HTTP request
 * @ param conn
 * the HttpURLConnection for the operation .
 * @ return A canonicalized string .
 * @ throws StorageException */
protected static String canonicalizeTableHttpRequest ( final java . net . URL address , final String accountName , final String method , final String contentType , final long contentLength , final String date , final HttpURLConnection conn ) throws StorageException { } }

implementation:
// The first element should be the Method of the request .
// I . e . GET , POST , PUT , or HEAD .
final StringBuilder canonicalizedString = new StringBuilder ( ExpectedTableCanonicalizedStringLength ) ; canonicalizedString . append ( conn . getRequestMethod ( ) ) ; // The second element should be the MD5 value .
// This is optional and may be empty .
final String httpContentMD5Value = Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . CONTENT_MD5 ) ; appendCanonicalizedElement ( canonicalizedString , httpContentMD5Value ) ; // The third element should be the content type .
appendCanonicalizedElement ( canonicalizedString , contentType ) ; // The fourth element should be the request date .
// See if there ' s an storage date header .
// If there ' s one , then don ' t use the date header .
final String dateString = Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . DATE ) ; // If x - ms - date header exists , Date should be that value .
appendCanonicalizedElement ( canonicalizedString , dateString . equals ( Constants . EMPTY_STRING ) ? date : dateString ) ; appendCanonicalizedElement ( canonicalizedString , getCanonicalizedResourceLite ( address , accountName ) ) ; return canonicalizedString . toString ( ) ;


signature:
public class Canonicalizer { /** * Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key Lite
 * authentication scheme .
 * @ param address
 * the resource URI .
 * @ param accountName
 * the account name for the request .
 * @ return the canonicalized resource string .
 * @ throws StorageException */
protected static String getCanonicalizedResource ( final java . net . URL address , final String accountName ) throws StorageException { } }

implementation:
// Resource path
final StringBuilder resourcepath = new StringBuilder ( "/" ) ; resourcepath . append ( accountName ) ; // Note that AbsolutePath starts with a ' / ' .
resourcepath . append ( address . getPath ( ) ) ; final StringBuilder canonicalizedResource = new StringBuilder ( resourcepath . toString ( ) ) ; // query parameters
if ( address . getQuery ( ) == null || ! address . getQuery ( ) . contains ( "=" ) ) { // no query params .
return canonicalizedResource . toString ( ) ; } final Map < String , String [ ] > queryVariables = PathUtility . parseQueryString ( address . getQuery ( ) ) ; final Map < String , String > lowercasedKeyNameValue = new HashMap < String , String > ( ) ; for ( final Entry < String , String [ ] > entry : queryVariables . entrySet ( ) ) { // sort the value and organize it as comma separated values
final List < String > sortedValues = Arrays . asList ( entry . getValue ( ) ) ; Collections . sort ( sortedValues ) ; final StringBuilder stringValue = new StringBuilder ( ) ; for ( final String value : sortedValues ) { if ( stringValue . length ( ) > 0 ) { stringValue . append ( "," ) ; } stringValue . append ( value ) ; } // key turns out to be null for ? a & b & c & d
lowercasedKeyNameValue . put ( ( entry . getKey ( ) ) == null ? null : entry . getKey ( ) . toLowerCase ( Utility . LOCALE_US ) , stringValue . toString ( ) ) ; } final ArrayList < String > sortedKeys = new ArrayList < String > ( lowercasedKeyNameValue . keySet ( ) ) ; Collections . sort ( sortedKeys ) ; for ( final String key : sortedKeys ) { final StringBuilder queryParamString = new StringBuilder ( ) ; queryParamString . append ( key ) ; queryParamString . append ( ":" ) ; queryParamString . append ( lowercasedKeyNameValue . get ( key ) ) ; appendCanonicalizedElement ( canonicalizedResource , queryParamString . toString ( ) ) ; } return canonicalizedResource . toString ( ) ;


signature:
public class Canonicalizer { /** * Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key Lite
 * authentication scheme .
 * @ param address
 * the resource URI .
 * @ param accountName
 * the account name for the request .
 * @ return the canonicalized resource string .
 * @ throws StorageException */
protected static String getCanonicalizedResourceLite ( final java . net . URL address , final String accountName ) throws StorageException { } }

implementation:
// Resource path
final StringBuilder resourcepath = new StringBuilder ( "/" ) ; resourcepath . append ( accountName ) ; // Note that AbsolutePath starts with a ' / ' .
resourcepath . append ( address . getPath ( ) ) ; final StringBuilder canonicalizedResource = new StringBuilder ( resourcepath . toString ( ) ) ; // query parameters
final Map < String , String [ ] > queryVariables = PathUtility . parseQueryString ( address . getQuery ( ) ) ; final String [ ] compVals = queryVariables . get ( "comp" ) ; if ( compVals != null ) { final List < String > sortedValues = Arrays . asList ( compVals ) ; Collections . sort ( sortedValues ) ; canonicalizedResource . append ( "?comp=" ) ; final StringBuilder stringValue = new StringBuilder ( ) ; for ( final String value : sortedValues ) { if ( stringValue . length ( ) > 0 ) { stringValue . append ( "," ) ; } stringValue . append ( value ) ; } canonicalizedResource . append ( stringValue ) ; } return canonicalizedResource . toString ( ) ;


signature:
public class Canonicalizer { /** * Gets all the values for the given header in the one to many map , performs a trimStart ( ) on each return value
 * @ param headers
 * a one to many map of key / values representing the header values for the connection .
 * @ param headerName
 * the name of the header to lookup
 * @ return an ArrayList < String > of all trimmed values corresponding to the requested headerName . This may be empty
 * if the header is not found . */
private static ArrayList < String > getHeaderValues ( final Map < String , List < String > > headers , final String headerName ) { } }

implementation:
final ArrayList < String > arrayOfValues = new ArrayList < String > ( ) ; List < String > values = null ; for ( final Entry < String , List < String > > entry : headers . entrySet ( ) ) { if ( entry . getKey ( ) . toLowerCase ( Utility . LOCALE_US ) . equals ( headerName ) ) { values = entry . getValue ( ) ; break ; } } if ( values != null ) { for ( final String value : values ) { // canonicalization formula requires the string to be left
// trimmed .
arrayOfValues . add ( Utility . trimStart ( value ) ) ; } } return arrayOfValues ;


signature:
public class StorageCredentialsHelper { /** * Computes a signature for the specified string using the HMAC - SHA256 algorithm .
 * @ param value
 * The UTF - 8 - encoded string to sign .
 * @ return A < code > String < / code > that contains the HMAC - SHA256 - encoded signature .
 * @ throws InvalidKeyException
 * If the key is not a valid Base64 - encoded string . */
public static synchronized String computeHmac256 ( final StorageCredentials creds , final String value ) throws InvalidKeyException { } }

implementation: if ( creds . getClass ( ) . equals ( StorageCredentialsAccountAndKey . class ) ) { byte [ ] utf8Bytes = null ; try { utf8Bytes = value . getBytes ( Constants . UTF8_CHARSET ) ; } catch ( final UnsupportedEncodingException e ) { throw new IllegalArgumentException ( e ) ; } return Base64 . encode ( ( ( StorageCredentialsAccountAndKey ) creds ) . getHmac256 ( ) . doFinal ( utf8Bytes ) ) ; } else { return null ; }


signature:
public class StorageCredentialsHelper { /** * Signs a request using the specified operation context under the Shared Key authentication scheme .
 * @ param request
 * An < code > HttpURLConnection < / code > object that represents the request to sign .
 * @ param contentLength
 * The length of the content written to the output stream . If unknown , specify - 1.
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws InvalidKeyException
 * If the given key is invalid .
 * @ throws StorageException
 * If a storage service error occurred . */
public static void signTableRequest ( final StorageCredentials creds , final java . net . HttpURLConnection request , final long contentLength , OperationContext opContext ) throws InvalidKeyException , StorageException { } }

implementation: if ( creds . getClass ( ) . equals ( StorageCredentialsAccountAndKey . class ) ) { opContext = opContext == null ? new OperationContext ( ) : opContext ; request . setRequestProperty ( Constants . HeaderConstants . DATE , Utility . getGMTTime ( ) ) ; final Canonicalizer canonicalizer = CanonicalizerFactory . getTableCanonicalizer ( request ) ; final String stringToSign = canonicalizer . canonicalize ( request , creds . getAccountName ( ) , contentLength ) ; final String computedBase64Signature = StorageCredentialsHelper . computeHmac256 ( creds , stringToSign ) ; Logger . debug ( opContext , LogConstants . SIGNING , stringToSign ) ; request . setRequestProperty ( Constants . HeaderConstants . AUTHORIZATION , String . format ( "%s %s:%s" , "SharedKey" , creds . getAccountName ( ) , computedBase64Signature ) ) ; }


signature:
public class CloudQueue { /** * Gets the first message from a list of queue messages , if any .
 * @ param messages
 * The < code > Iterable < / code > collection of { @ link CloudQueueMessage } objects to get the first message
 * from .
 * @ return The first { @ link CloudQueueMessage } from the list of queue messages , or < code > null < / code > if the list is
 * empty . */
private static CloudQueueMessage getFirstOrNull ( final Iterable < CloudQueueMessage > messages ) { } }

implementation: for ( final CloudQueueMessage m : messages ) { return m ; } return null ;


signature:
public class CloudQueue { /** * Adds a message to the back of the queue with the specified options .
 * @ param message
 * A { @ link CloudQueueMessage } object that specifies the message to add .
 * The message object is modified to include the message ID and pop receipt ,
 * and can be used in subsequent calls to updateMessage and deleteMessage .
 * @ param timeToLiveInSeconds
 * The maximum time to allow the message to be in the queue . A value of zero will set the time - to - live to
 * the service default value of seven days .
 * @ param initialVisibilityDelayInSeconds
 * The length of time during which the message will be invisible , starting when it is added to the queue ,
 * or 0 to make the message visible immediately . This value must be greater than or equal to zero and
 * less than or equal to the time - to - live value .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void addMessage ( final CloudQueueMessage message , final int timeToLiveInSeconds , final int initialVisibilityDelayInSeconds , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: Utility . assertNotNull ( "message" , message ) ; Utility . assertNotNull ( "messageContent" , message . getMessageContentAsByte ( ) ) ; Utility . assertInBounds ( "timeToLiveInSeconds" , timeToLiveInSeconds , 0 , QueueConstants . MAX_TIME_TO_LIVE_IN_SECONDS ) ; final int realTimeToLiveInSeconds = timeToLiveInSeconds == 0 ? QueueConstants . MAX_TIME_TO_LIVE_IN_SECONDS : timeToLiveInSeconds ; Utility . assertInBounds ( "initialVisibilityDelayInSeconds" , initialVisibilityDelayInSeconds , 0 , realTimeToLiveInSeconds - 1 ) ; if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . addMessageImpl ( message , realTimeToLiveInSeconds , initialVisibilityDelayInSeconds , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Clears all messages from the queue , using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void clear ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . clearImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Creates the queue , using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void create ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . createImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Creates the queue if it does not already exist , using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return A value of < code > true < / code > if the queue is created in the storage service , otherwise < code > false < / code >
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public boolean createIfNotExists ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; boolean exists = this . exists ( true , options , opContext ) ; if ( exists ) { return false ; } else { try { this . create ( options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_CONFLICT && StorageErrorCodeStrings . QUEUE_ALREADY_EXISTS . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } }


signature:
public class CloudQueue { /** * Deletes the queue , using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void delete ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . deleteImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Deletes the queue if it exists , using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return A value of < code > true < / code > if the queue existed in the storage service and has been deleted , otherwise
 * < code > false < / code > .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public boolean deleteIfExists ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; boolean exists = this . exists ( true , options , opContext ) ; if ( exists ) { try { this . delete ( options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_NOT_FOUND && StorageErrorCodeStrings . QUEUE_NOT_FOUND . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } } else { return false ; }


signature:
public class CloudQueue { /** * Deletes the specified message from the queue , using the specified request options and operation context .
 * @ param message
 * A { @ link CloudQueueMessage } object that specifies the message to delete .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void deleteMessage ( final CloudQueueMessage message , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: Utility . assertNotNull ( "message" , message ) ; Utility . assertNotNullOrEmpty ( "messageId" , message . getId ( ) ) ; Utility . assertNotNullOrEmpty ( "popReceipt" , message . getPopReceipt ( ) ) ; if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . deleteMessageImpl ( message , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Downloads the queue ' s metadata and approximate message count value , using the specified request options and
 * operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueue } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void downloadAttributes ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . downloadAttributesImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Returns a value that indicates whether the queue existse , using the specified request options and operation
 * context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return < code > true < / code > if the queue exists in the storage service , otherwise < code > false < / code > .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public boolean exists ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: return this . exists ( false , options , opContext ) ;


signature:
public class CloudQueue { /** * Get a single message request ( Used internally only ) .
 * @ return The < code > URI < / code > for a single message request .
 * @ throws URISyntaxException
 * If the resource URI is invalid .
 * @ throws StorageException */
private StorageUri getIndividualMessageAddress ( final String messageId , final OperationContext opContext ) throws URISyntaxException , StorageException { } }

implementation: return PathUtility . appendPathToUri ( this . getMessageRequestAddress ( opContext ) , messageId ) ;


signature:
public class CloudQueue { /** * Get the message request base address ( Used internally only ) .
 * @ return The message request < code > URI < / code > .
 * @ throws URISyntaxException
 * If the resource URI is invalid .
 * @ throws StorageException */
private StorageUri getMessageRequestAddress ( final OperationContext opContext ) throws URISyntaxException , StorageException { } }

implementation: if ( this . messageRequestAddress == null ) { this . messageRequestAddress = PathUtility . appendPathToUri ( this . getTransformedAddress ( opContext ) , QueueConstants . MESSAGES ) ; } return this . messageRequestAddress ;


signature:
public class CloudQueue { /** * Peeks a message from the queue , using the specified request options and operation context . A peek request
 * retrieves a message from the front of the queue without changing its visibility .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return An { @ link CloudQueueMessage } object that represents the requested message from the queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public CloudQueueMessage peekMessage ( final QueueRequestOptions options , final OperationContext opContext ) throws StorageException { } }

implementation:
return getFirstOrNull ( this . peekMessages ( 1 , null /* options */
, null /* opContext */
) ) ;


signature:
public class CloudQueue { /** * Peeks a specified number of messages from the queue . A peek request retrieves messages from the front of the
 * queue without changing their visibility .
 * @ param numberOfMessages
 * The number of messages to retrieve .
 * @ return An enumerable collection of { @ link CloudQueueMessage } objects that represents the requested messages from
 * the queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public Iterable < CloudQueueMessage > peekMessages ( final int numberOfMessages ) throws StorageException { } }

implementation:
return this . peekMessages ( numberOfMessages , null /* options */
, null /* opContext */
) ;


signature:
public class CloudQueue { /** * Peeks a set of messages from the queue , using the specified request options and operation context . A peek request
 * retrieves messages from the front of the queue without changing their visibility .
 * @ param numberOfMessages
 * The number of messages to retrieve .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return An enumerable collection of { @ link CloudQueueMessage } objects that represents the requested messages from
 * the queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public Iterable < CloudQueueMessage > peekMessages ( final int numberOfMessages , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: Utility . assertInBounds ( "numberOfMessages" , numberOfMessages , 1 , QueueConstants . MAX_NUMBER_OF_MESSAGES_TO_PEEK ) ; if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; return ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . peekMessagesImpl ( numberOfMessages , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Retrieves a message from the front of the queue , using the specified request options and operation context . This
 * operation marks the retrieved message as invisible in the queue for the specified visibility timeout period .
 * @ param visibilityTimeoutInSeconds
 * Specifies the visibility timeout for the message , in seconds .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return An { @ link CloudQueueMessage } object that represents a message in this queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public CloudQueueMessage retrieveMessage ( final int visibilityTimeoutInSeconds , final QueueRequestOptions options , final OperationContext opContext ) throws StorageException { } }

implementation: return getFirstOrNull ( this . retrieveMessages ( 1 , visibilityTimeoutInSeconds , options , opContext ) ) ;


signature:
public class CloudQueue { /** * Retrieves the specified number of messages from the front of the queue using the default request options . This
 * operation marks the retrieved messages as invisible in the queue for the default visibility timeout period .
 * @ param numberOfMessages
 * The number of messages to retrieve .
 * @ return An enumerable collection of { @ link CloudQueueMessage } objects that represents the retrieved messages from
 * the queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public Iterable < CloudQueueMessage > retrieveMessages ( final int numberOfMessages ) throws StorageException { } }

implementation:
return this . retrieveMessages ( numberOfMessages , QueueConstants . DEFAULT_VISIBILITY_MESSAGE_TIMEOUT_IN_SECONDS , null /* options */
, null /* opContext */
) ;


signature:
public class CloudQueue { /** * Retrieves the specified number of messages from the front of the queue using the specified request options and
 * operation context . This operation marks the retrieved messages as invisible in the queue for the default
 * visibility timeout period .
 * @ param numberOfMessages
 * The number of messages to retrieve .
 * @ param visibilityTimeoutInSeconds
 * Specifies the visibility timeout for the retrieved messages , in seconds .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return An enumerable collection of { @ link CloudQueueMessage } objects that represents the messages retrieved from
 * the queue .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public Iterable < CloudQueueMessage > retrieveMessages ( final int numberOfMessages , final int visibilityTimeoutInSeconds , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: Utility . assertInBounds ( "numberOfMessages" , numberOfMessages , 1 , QueueConstants . MAX_NUMBER_OF_MESSAGES_TO_PEEK ) ; Utility . assertInBounds ( "visibilityTimeoutInSeconds" , visibilityTimeoutInSeconds , 0 , QueueConstants . MAX_TIME_TO_LIVE_IN_SECONDS ) ; if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; return ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . retrieveMessagesImpl ( numberOfMessages , visibilityTimeoutInSeconds , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Updates the specified message in the queue with a new visibility timeout value in seconds .
 * @ param message
 * The { @ link CloudQueueMessage } to update in the queue .
 * @ param visibilityTimeoutInSeconds
 * Specifies the new visibility timeout for the message , in seconds .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public void updateMessage ( final CloudQueueMessage message , final int visibilityTimeoutInSeconds ) throws StorageException { } }

implementation:
this . updateMessage ( message , visibilityTimeoutInSeconds , EnumSet . of ( MessageUpdateFields . VISIBILITY ) , null /* options */
, null /* opContext */
) ;


signature:
public class CloudQueue { /** * Updates a message in the queue , using the specified request options and operation context .
 * @ param message
 * The { @ link CloudQueueMessage } to update in the queue .
 * @ param visibilityTimeoutInSeconds
 * Specifies the new visibility timeout for the message , in seconds .
 * @ param messageUpdateFields
 * An < code > EnumSet < / code > of { @ link MessageUpdateFields } values that specifies which parts of the
 * message are to be updated .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void updateMessage ( final CloudQueueMessage message , final int visibilityTimeoutInSeconds , final EnumSet < MessageUpdateFields > messageUpdateFields , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: Utility . assertNotNull ( "message" , message ) ; Utility . assertNotNullOrEmpty ( "messageId" , message . getId ( ) ) ; Utility . assertNotNullOrEmpty ( "popReceipt" , message . getPopReceipt ( ) ) ; Utility . assertInBounds ( "visibilityTimeoutInSeconds" , visibilityTimeoutInSeconds , 0 , QueueConstants . MAX_TIME_TO_LIVE_IN_SECONDS ) ; if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . updateMessageImpl ( message , visibilityTimeoutInSeconds , messageUpdateFields , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Uploads the metadata in the < code > CloudQueue < / code > object to the queue , using the specified request options and
 * operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
@ DoesServiceRequest public void uploadMetadata ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . uploadMetadataImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Uploads the queue ' s permissions using the specified request options and operation context .
 * @ param permissions
 * A { @ link QueuePermissions } object that represents the permissions to upload .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public void uploadPermissions ( final QueuePermissions permissions , QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . uploadPermissionsImpl ( permissions , options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Downloads the permissions settings for the queue using the specified request options and operation context .
 * @ param options
 * A { @ link QueueRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudQueueClient } ) .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return A { @ link QueuePermissions } object that represents the container ' s permissions .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public QueuePermissions downloadPermissions ( QueueRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = QueueRequestOptions . populateAndApplyDefaults ( options , this . queueServiceClient ) ; return ExecutionEngine . executeWithRetry ( this . queueServiceClient , this , this . downloadPermissionsImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Returns a shared access signature for the queue .
 * @ param policy
 * The access policy for the shared access signature .
 * @ param groupPolicyIdentifier
 * A queue - level access policy .
 * @ return A shared access signature for the queue .
 * @ throws InvalidKeyException
 * If an invalid key was passed .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws IllegalArgumentException
 * If an unexpected value is passed . */
public String generateSharedAccessSignature ( final SharedAccessQueuePolicy policy , final String groupPolicyIdentifier ) throws InvalidKeyException , StorageException { } }

implementation:
return this . generateSharedAccessSignature ( policy , groupPolicyIdentifier , null /* IP range */
, null /* protocols */
) ;


signature:
public class CloudQueue { /** * Returns a shared access signature for the queue .
 * @ param policy
 * The access policy for the shared access signature .
 * @ param groupPolicyIdentifier
 * A queue - level access policy .
 * @ param ipRange
 * A { @ link IPRange } object containing the range of allowed IP addresses .
 * @ param protocols
 * A { @ link SharedAccessProtocols } representing the allowed Internet protocols .
 * @ return A shared access signature for the queue .
 * @ throws InvalidKeyException
 * If an invalid key was passed .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws IllegalArgumentException
 * If an unexpected value is passed . */
public String generateSharedAccessSignature ( final SharedAccessQueuePolicy policy , final String groupPolicyIdentifier , final IPRange ipRange , final SharedAccessProtocols protocols ) throws InvalidKeyException , StorageException { } }

implementation: if ( ! StorageCredentialsHelper . canCredentialsSignRequest ( this . queueServiceClient . getCredentials ( ) ) ) { final String errorMessage = SR . CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY ; throw new IllegalArgumentException ( errorMessage ) ; } final String resourceName = this . getSharedAccessCanonicalName ( ) ; final String signature = SharedAccessSignatureHelper . generateSharedAccessSignatureHashForQueue ( policy , groupPolicyIdentifier , resourceName , ipRange , protocols , this . queueServiceClient ) ; final UriQueryBuilder builder = SharedAccessSignatureHelper . generateSharedAccessSignatureForQueue ( policy , groupPolicyIdentifier , ipRange , protocols , signature ) ; return builder . toString ( ) ;


signature:
public class CloudQueue { /** * Returns the canonical name for shared access .
 * @ return the canonical name for shared access . */
private String getSharedAccessCanonicalName ( ) { } }

implementation: String accountName = this . getServiceClient ( ) . getCredentials ( ) . getAccountName ( ) ; String queueName = this . getName ( ) ; return String . format ( "/%s/%s/%s" , SR . QUEUE , accountName , queueName ) ;


signature:
public class CloudQueue { /** * Returns the transformed URI for the resource if the given credentials require transformation .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation . This object
 * is used to track requests to the storage service , and to provide additional runtime information about
 * the operation .
 * @ return A < code > java . net . URI < / code > object that represents the transformed URI .
 * @ throws IllegalArgumentException
 * If the URI is not absolute .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException
 * If the resource URI is invalid . */
private final StorageUri getTransformedAddress ( final OperationContext opContext ) throws URISyntaxException , StorageException { } }

implementation: return this . queueServiceClient . getCredentials ( ) . transformUri ( this . getStorageUri ( ) , opContext ) ;


signature:
public class CloudQueue { /** * Verifies the passed in URI . Then parses it and uses its components to populate this resource ' s properties .
 * @ param completeUri
 * A { @ link StorageUri } object which represents the complete URI .
 * @ param credentials
 * A { @ link StorageCredentials } object used to authenticate access .
 * @ throws StorageException
 * If a storage service error occurred . */
private void parseQueryAndVerify ( final StorageUri completeUri , final StorageCredentials credentials ) throws StorageException { } }

implementation: Utility . assertNotNull ( "completeUri" , completeUri ) ; if ( ! completeUri . isAbsolute ( ) ) { throw new IllegalArgumentException ( String . format ( SR . RELATIVE_ADDRESS_NOT_PERMITTED , completeUri . toString ( ) ) ) ; } this . storageUri = PathUtility . stripURIQueryAndFragment ( completeUri ) ; final StorageCredentialsSharedAccessSignature parsedCredentials = SharedAccessSignatureHelper . parseQuery ( completeUri ) ; if ( credentials != null && parsedCredentials != null ) { throw new IllegalArgumentException ( SR . MULTIPLE_CREDENTIALS_PROVIDED ) ; } try { final boolean usePathStyleUris = Utility . determinePathStyleFromUri ( this . storageUri . getPrimaryUri ( ) ) ; this . queueServiceClient = new CloudQueueClient ( PathUtility . getServiceClientBaseAddress ( this . getStorageUri ( ) , usePathStyleUris ) , credentials != null ? credentials : parsedCredentials ) ; this . name = PathUtility . getContainerNameFromUri ( storageUri . getPrimaryUri ( ) , usePathStyleUris ) ; } catch ( final URISyntaxException e ) { throw Utility . generateNewUnexpectedStorageException ( e ) ; }


signature:
public class CloudAnalyticsClient { /** * Gets the { @ link CloudBlobDirectory } object for the logs for a specific storage service .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ return
 * A { @ link CloudBlobDirectory } object .
 * @ throws URISyntaxException
 * @ throws StorageException */
public CloudBlobDirectory getLogDirectory ( StorageService service ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNull ( "service" , service ) ; return this . blobClient . getContainerReference ( this . LogContainer ) . getDirectoryReference ( service . toString ( ) . toLowerCase ( Locale . US ) ) ;


signature:
public class CloudAnalyticsClient { /** * Gets the hour metrics table for a specific storage service .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ param location
 * A { @ link StorageLocation } enumeration value that indicates which storage location to use .
 * @ return
 * The { @ link CloudTable } object for the storage service .
 * @ throws URISyntaxException
 * @ throws StorageException */
public CloudTable getHourMetricsTable ( StorageService service , StorageLocation location ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNull ( "service" , service ) ; if ( location == null ) { location = StorageLocation . PRIMARY ; } switch ( service ) { case BLOB : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_PRIMARY_TRANSACTIONS_BLOB ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_SECONDARY_TRANSACTIONS_BLOB ) ; } case FILE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_PRIMARY_TRANSACTIONS_FILE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_SECONDARY_TRANSACTIONS_FILE ) ; } case QUEUE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_PRIMARY_TRANSACTIONS_QUEUE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_SECONDARY_TRANSACTIONS_QUEUE ) ; } case TABLE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_PRIMARY_TRANSACTIONS_TABLE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_HOUR_SECONDARY_TRANSACTIONS_TABLE ) ; } default : throw new IllegalArgumentException ( SR . INVALID_STORAGE_SERVICE ) ; }


signature:
public class CloudAnalyticsClient { /** * Gets the minute metrics table for a specific storage service .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ param location
 * A { @ link StorageLocation } enumeration value that indicates which storage location to use .
 * @ return
 * The < code > CloudTable < / code > object for the storage service .
 * @ throws URISyntaxException
 * @ throws StorageException */
public CloudTable getMinuteMetricsTable ( StorageService service , StorageLocation location ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNull ( "service" , service ) ; if ( location == null ) { location = StorageLocation . PRIMARY ; } switch ( service ) { case BLOB : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_PRIMARY_TRANSACTIONS_BLOB ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_SECONDARY_TRANSACTIONS_BLOB ) ; } case FILE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_PRIMARY_TRANSACTIONS_FILE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_SECONDARY_TRANSACTIONS_FILE ) ; } case QUEUE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_PRIMARY_TRANSACTIONS_QUEUE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_SECONDARY_TRANSACTIONS_QUEUE ) ; } case TABLE : if ( location == StorageLocation . PRIMARY ) { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_PRIMARY_TRANSACTIONS_TABLE ) ; } else { return this . tableClient . getTableReference ( Constants . AnalyticsConstants . METRICS_MINUTE_SECONDARY_TRANSACTIONS_TABLE ) ; } default : throw new IllegalArgumentException ( SR . INVALID_STORAGE_SERVICE ) ; }


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log blobs , retrieved lazily .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ return
 * An enumerable collection of objects that implement < code > ListBlobItem < / code > and are retrieved lazily .
 * @ throws URISyntaxException
 * @ throws StorageException */
public Iterable < ListBlobItem > listLogBlobs ( StorageService service ) throws URISyntaxException , StorageException { } }

implementation:
return this . listLogBlobs ( service , null /* startTime */
, null /* endTime */
, null /* operations */
, null /* details */
, null /* options */
, null /* operationContext */
) ;


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log blobs , retrieved lazily .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ param startTime
 * A < code > java . util . Date < / code > object representing the start of the time range for which logs should
 * be retrieved .
 * @ param endTime
 * A < code > java . util . Date < / code > object representing the end of the time range for which logs should
 * be retrieved .
 * @ param operations
 * A { @ link LoggingOperations } enumeration set that indicates which log types to return .
 * @ param details
 * A { @ link BlobListingDetails } enumeration set that indicates whether or not blob metadata should
 * be returned . None or METADATA are the only valid values .
 * @ param options
 * A { @ link BlobRequestOptions } object that specifies additional options for the request .
 * @ param operationContext
 * An { @ link OperationContext } object that represents the context for the current operation .
 * @ return
 * An enumerable collection of objects that implement { @ link ListBlobItem } and are retrieved lazily .
 * @ throws StorageException
 * @ throws URISyntaxException */
public Iterable < ListBlobItem > listLogBlobs ( StorageService service , Date startTime , Date endTime , EnumSet < LoggingOperations > operations , BlobListingDetails details , BlobRequestOptions options , OperationContext operationContext ) throws StorageException , URISyntaxException { } }

implementation: Utility . assertNotNull ( "service" , service ) ; if ( operations == null ) { operations = EnumSet . allOf ( LoggingOperations . class ) ; } if ( ! ( details == null || details . equals ( BlobListingDetails . METADATA ) ) ) { throw new IllegalArgumentException ( SR . INVALID_LISTING_DETAILS ) ; } if ( operations . equals ( EnumSet . noneOf ( LoggingOperations . class ) ) ) { throw new IllegalArgumentException ( SR . INVALID_LOGGING_LEVEL ) ; } EnumSet < BlobListingDetails > metadataDetails ; if ( details != null && ( details . equals ( BlobListingDetails . METADATA ) || ! operations . equals ( EnumSet . allOf ( LoggingOperations . class ) ) ) ) { metadataDetails = EnumSet . of ( BlobListingDetails . METADATA ) ; } else { metadataDetails = EnumSet . noneOf ( BlobListingDetails . class ) ; } return new LogBlobIterable ( this . getLogDirectory ( service ) , startTime , endTime , operations , metadataDetails , options , operationContext ) ;


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log records , retrieved lazily .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ return
 * An enumerable collection of objects that implement < code > ListBlobItem < / code > and are retrieved lazily .
 * @ throws URISyntaxException
 * @ throws StorageException */
public Iterable < LogRecord > listLogRecords ( StorageService service ) throws URISyntaxException , StorageException { } }

implementation:
return this . listLogRecords ( service , null /* startTime */
, null /* endTime */
, null /* options */
, null /* operationContext */
) ;


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log records , retrieved lazily .
 * @ param service
 * A { @ link StorageService } enumeration value that indicates which storage service to use .
 * @ param startTime
 * A < code > java . util . Date < / code > object representing the start of the time range for which logs should
 * be retrieved .
 * @ param endTime
 * A < code > java . util . Date < / code > object representing the end of the time range for which logs should
 * be retrieved .
 * @ param options
 * A { @ link BlobRequestOptions } object that specifies additional options for the request .
 * @ param operationContext
 * An { @ link OperationContext } object that represents the context for the current operation .
 * @ return
 * An enumerable collection of objects that implement { @ link ListBlobItem } and are retrieved lazily .
 * @ throws StorageException
 * @ throws URISyntaxException */
public Iterable < LogRecord > listLogRecords ( StorageService service , Date startTime , Date endTime , BlobRequestOptions options , OperationContext operationContext ) throws StorageException , URISyntaxException { } }

implementation: Utility . assertNotNull ( "service" , service ) ; EnumSet < LoggingOperations > operations = EnumSet . allOf ( LoggingOperations . class ) ; EnumSet < BlobListingDetails > metadataDetails = EnumSet . noneOf ( BlobListingDetails . class ) ; Iterator < ListBlobItem > blobIterator = new LogBlobIterable ( this . getLogDirectory ( service ) , startTime , endTime , operations , metadataDetails , options , operationContext ) . iterator ( ) ; return new LogRecordIterable ( blobIterator ) ;


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log records , retrieved lazily .
 * @ param logBlobs
 * An { @ link Iterable } of blobs to parse LogRecords from .
 * @ return
 * An enumerable collection of objects that implement { @ link LogRecords } and are retrieved lazily .
 * @ throws StorageException
 * @ throws URISyntaxException */
public static Iterable < LogRecord > parseLogBlobs ( Iterable < ListBlobItem > logBlobs ) { } }

implementation: Utility . assertNotNull ( "logBlobs" , logBlobs ) ; return new LogRecordIterable ( logBlobs . iterator ( ) ) ;


signature:
public class CloudAnalyticsClient { /** * Returns an enumerable collection of log records , retrieved lazily .
 * @ param logBlobs
 * An { @ link Iterable } of blobs to parse LogRecords from .
 * @ return
 * An enumerable collection of objects that implement { @ link LogRecords } and are retrieved lazily .
 * @ throws StorageException
 * @ throws URISyntaxException */
public static Iterable < LogRecord > parseLogBlob ( ListBlobItem logBlob ) { } }

implementation: Utility . assertNotNull ( "logBlob" , logBlob ) ; ArrayList < ListBlobItem > blobWrapper = new ArrayList < ListBlobItem > ( ) ; blobWrapper . add ( logBlob ) ; return new LogRecordIterable ( blobWrapper . iterator ( ) ) ;


signature:
public class TableRequestOptions { /** * Initializes the values for this < code > TableRequestOptions < / code > instance , if they are currently
 * < code > null < / code > , using the values specified in the { @ link CloudTableClient } parameter .
 * @ param options
 * A { @ link TableRequestOptions } object which represents the input options to copy from when applying
 * defaults .
 * @ param client
 * A { @ link CloudTableClient } object from which to copy the timeout and retry policy .
 * @ return A { @ link TableRequestOptions } object . */
protected static final TableRequestOptions populateAndApplyDefaults ( final TableRequestOptions options , final CloudTableClient client ) { } }

implementation: TableRequestOptions modifiedOptions = new TableRequestOptions ( options ) ; TableRequestOptions . populate ( modifiedOptions , client . getDefaultRequestOptions ( ) ) ; TableRequestOptions . applyDefaults ( modifiedOptions ) ; return modifiedOptions ;


signature:
public class TableRequestOptions { /** * Applies defaults to the options passed in .
 * @ param modifiedOptions
 * The options to apply defaults to . */
protected static void applyDefaults ( final TableRequestOptions modifiedOptions ) { } }

implementation: Utility . assertNotNull ( "modifiedOptions" , modifiedOptions ) ; RequestOptions . applyBaseDefaultsInternal ( modifiedOptions ) ; if ( modifiedOptions . getTablePayloadFormat ( ) == null ) { modifiedOptions . setTablePayloadFormat ( TablePayloadFormat . Json ) ; } if ( modifiedOptions . getDateBackwardCompatibility ( ) == null ) { modifiedOptions . setDateBackwardCompatibility ( false ) ; }


signature:
public class TableRequestOptions { /** * Populates any null fields in the first requestOptions object with values from the second requestOptions object .
 * @ param modifiedOptions
 * A { @ link TableRequestOptions } object from which to copy options .
 * @ param clientOptions
 * A { @ link TableRequestOptions } object where options will be copied .
 * @ return A { @ link RequestOptions } object . */
private static void populate ( TableRequestOptions modifiedOptions , final TableRequestOptions clientOptions ) { } }

implementation:
RequestOptions . populateRequestOptions ( modifiedOptions , clientOptions , true /* setStartTime */
) ; if ( modifiedOptions . getTablePayloadFormat ( ) == null ) { modifiedOptions . setTablePayloadFormat ( clientOptions . getTablePayloadFormat ( ) ) ; } if ( modifiedOptions . getPropertyResolver ( ) == null ) { modifiedOptions . setPropertyResolver ( clientOptions . getPropertyResolver ( ) ) ; } if ( modifiedOptions . getDateBackwardCompatibility ( ) == null ) { modifiedOptions . setDateBackwardCompatibility ( clientOptions . getDateBackwardCompatibility ( ) ) ; }


signature:
public class CloudQueueMessage { /** * Gets the content of the message as a byte array .
 * @ return A < code > byte < / code > array which contains the content of the message .
 * @ throws StorageException
 * If a storage service error occurred . */
public final byte [ ] getMessageContentAsByte ( ) throws StorageException { } }

implementation: if ( Utility . isNullOrEmpty ( this . messageContent ) ) { return new byte [ 0 ] ; } if ( this . messageType == QueueMessageType . RAW_STRING ) { try { return this . messageContent . getBytes ( Constants . UTF8_CHARSET ) ; } catch ( final UnsupportedEncodingException e ) { throw Utility . generateNewUnexpectedStorageException ( e ) ; } } else { return Base64 . decode ( this . messageContent ) ; }


signature:
public class CloudQueueMessage { /** * Gets the content of the message as a string .
 * @ return A < code > String < / code > which contains the content of the message .
 * @ throws StorageException
 * If a storage service error occurred . */
public final String getMessageContentAsString ( ) throws StorageException { } }

implementation: if ( this . messageType == QueueMessageType . RAW_STRING ) { return this . messageContent ; } else { if ( Utility . isNullOrEmpty ( this . messageContent ) ) { return null ; } try { return new String ( Base64 . decode ( this . messageContent ) , Constants . UTF8_CHARSET ) ; } catch ( final UnsupportedEncodingException e ) { throw Utility . generateNewUnexpectedStorageException ( e ) ; } }


signature:
public class CloudQueueMessage { /** * Gets the content of the message for transfer ( internal use only ) .
 * @ return A < code > String < / code > which contains the content of the message .
 * @ throws StorageException
 * If a storage service error occurred . */
protected final String getMessageContentForTransfer ( final boolean shouldEncodeMessage ) throws StorageException { } }

implementation: String result = null ; if ( this . messageType == QueueMessageType . RAW_STRING && shouldEncodeMessage ) { result = Base64 . encode ( this . getMessageContentAsByte ( ) ) ; } else { result = this . messageContent ; } if ( result != null && result . length ( ) > QueueConstants . MAX_MESSAGE_SIZE ) { throw new IllegalArgumentException ( String . format ( SR . INVALID_MESSAGE_LENGTH , QueueConstants . MAX_MESSAGE_SIZE ) ) ; } return result ;


signature:
public class CloudQueueMessage { /** * Sets the content of the message as a < code > byte < / code > array .
 * @ param content
 * A < code > byte < / code > array which contains the content of the message . */
public final void setMessageContent ( final byte [ ] content ) { } }

implementation: Utility . assertNotNull ( "content" , content ) ; this . messageContent = Base64 . encode ( content ) ; this . messageType = QueueMessageType . BASE_64_ENCODED ;


signature:
public class SharedAccessQueuePolicy { /** * Converts this policy ' s permissions to a string .
 * @ return A < code > String < / code > that represents the shared access permissions in the " raup " format , which is
 * described at { @ link SharedAccessQueuePolicy # setPermissionsFromString ( String ) } . */
@ Override public String permissionsToString ( ) { } }

implementation:
if ( this . permissions == null ) { return Constants . EMPTY_STRING ; } // The service supports a fixed order = > raup
final StringBuilder builder = new StringBuilder ( ) ; if ( this . permissions . contains ( SharedAccessQueuePermissions . READ ) ) { builder . append ( "r" ) ; } if ( this . permissions . contains ( SharedAccessQueuePermissions . ADD ) ) { builder . append ( "a" ) ; } if ( this . permissions . contains ( SharedAccessQueuePermissions . UPDATE ) ) { builder . append ( "u" ) ; } if ( this . permissions . contains ( SharedAccessQueuePermissions . PROCESSMESSAGES ) ) { builder . append ( "p" ) ; } return builder . toString ( ) ;


signature:
public class SharedAccessQueuePolicy { /** * Sets shared access permissions using the specified permissions string .
 * @ param value
 * A < code > String < / code > that represents the shared access permissions . The string must contain one or
 * more of the following values . Note that they must be lower case , and the order that they are specified
 * must be in the order of " raup " .
 * < ul >
 * < li > < code > d < / code > : Read access . < / li >
 * < li > < code > l < / code > : Add access . < / li >
 * < li > < code > r < / code > : Update access . < / li >
 * < li > < code > w < / code > : ProcessMessages access . < / li >
 * < / ul > */
@ Override public void setPermissionsFromString ( final String value ) { } }

implementation: final char [ ] chars = value . toCharArray ( ) ; final EnumSet < SharedAccessQueuePermissions > retSet = EnumSet . noneOf ( SharedAccessQueuePermissions . class ) ; for ( final char c : chars ) { switch ( c ) { case 'r' : retSet . add ( SharedAccessQueuePermissions . READ ) ; break ; case 'a' : retSet . add ( SharedAccessQueuePermissions . ADD ) ; break ; case 'u' : retSet . add ( SharedAccessQueuePermissions . UPDATE ) ; break ; case 'p' : retSet . add ( SharedAccessQueuePermissions . PROCESSMESSAGES ) ; break ; default : throw new IllegalArgumentException ( "value" ) ; } } this . permissions = retSet ;


signature:
public class FileListHandler { /** * Parse and return the response .
 * @ param stream
 * @ param directory
 * @ return
 * @ throws ParserConfigurationException
 * @ throws SAXException
 * @ throws IOException */
public static ListResponse < ListFileItem > getFileAndDirectoryList ( final InputStream stream , final CloudFileDirectory directory ) throws ParserConfigurationException , SAXException , IOException { } }

implementation: SAXParser saxParser = Utility . getSAXParser ( ) ; FileListHandler handler = new FileListHandler ( directory ) ; saxParser . parse ( stream , handler ) ; return handler . response ;


signature:
public class TableRequest { /** * Reserved for internal use . Adds continuation token values to the specified query builder , if set .
 * @ param builder
 * The { @ link UriQueryBuilder } object to apply the continuation token properties to .
 * @ param continuationToken
 * The { @ link ResultContinuation } object containing the continuation token values to apply to the query
 * builder . Specify < code > null < / code > if no continuation token values are set .
 * @ throws StorageException
 * if an error occurs in accessing the query builder or continuation token . */
private static void applyContinuationToQueryBuilder ( final UriQueryBuilder builder , final ResultContinuation continuationToken ) throws StorageException { } }

implementation: if ( continuationToken != null ) { if ( continuationToken . getNextPartitionKey ( ) != null ) { builder . add ( TableConstants . TABLE_SERVICE_NEXT_PARTITION_KEY , continuationToken . getNextPartitionKey ( ) ) ; } if ( continuationToken . getNextRowKey ( ) != null ) { builder . add ( TableConstants . TABLE_SERVICE_NEXT_ROW_KEY , continuationToken . getNextRowKey ( ) ) ; } if ( continuationToken . getNextTableName ( ) != null ) { builder . add ( TableConstants . TABLE_SERVICE_NEXT_TABLE_NAME , continuationToken . getNextTableName ( ) ) ; } }


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an < code > HttpURLConnection < / code > to perform a table batch operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . This parameter is unused .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param batchID
 * The < code > String < / code > containing the batch identifier .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection batch ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String batchID ) throws IOException , URISyntaxException , StorageException { } }

implementation: final URI queryUri = PathUtility . appendPathToSingleUri ( rootUri , "$batch" ) ; final HttpURLConnection retConnection = BaseRequest . createURLConnection ( queryUri , tableOptions , queryBuilder , opContext ) ; setAcceptHeaderForHttpWebRequest ( retConnection , tableOptions . getTablePayloadFormat ( ) ) ; retConnection . setRequestProperty ( Constants . HeaderConstants . CONTENT_TYPE , String . format ( TableConstants . HeaderConstants . MULTIPART_MIXED_FORMAT , batchID ) ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . MAX_DATA_SERVICE_VERSION , TableConstants . HeaderConstants . MAX_DATA_SERVICE_VERSION_VALUE ) ; retConnection . setRequestMethod ( "POST" ) ; retConnection . setDoOutput ( true ) ; return retConnection ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs the core < code > HttpURLConnection < / code > to perform an operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param queryBuilder
 * The < code > UriQueryBuilder < / code > for the request .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * The identity of the entity , to pass in the Service Managment REST operation URI as
 * < code > < em > tableName < / em > ( < em > identity < / em > ) < / code > . If < code > null < / code > , only the < em > tableName < / em >
 * value will be passed .
 * @ param requestMethod
 * The HTTP request method to set .
 * @ param options
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . This parameter is unused .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
private static HttpURLConnection coreCreate ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String eTag , final String identity , final String requestMethod ) throws IOException , URISyntaxException , StorageException { } }

implementation:
URI queryUri = null ; // Do point query / delete etc .
if ( ! Utility . isNullOrEmpty ( identity ) ) { queryUri = PathUtility . appendPathToSingleUri ( rootUri , tableName . concat ( String . format ( "(%s)" , identity ) ) ) ; } else { queryUri = PathUtility . appendPathToSingleUri ( rootUri , tableName ) ; } final HttpURLConnection retConnection = BaseRequest . createURLConnection ( queryUri , tableOptions , queryBuilder , opContext ) ; setAcceptHeaderForHttpWebRequest ( retConnection , tableOptions . getTablePayloadFormat ( ) ) ; retConnection . setRequestProperty ( Constants . HeaderConstants . CONTENT_TYPE , TableConstants . HeaderConstants . JSON_CONTENT_TYPE ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . MAX_DATA_SERVICE_VERSION , TableConstants . HeaderConstants . MAX_DATA_SERVICE_VERSION_VALUE ) ; if ( ! Utility . isNullOrEmpty ( eTag ) ) { retConnection . setRequestProperty ( Constants . HeaderConstants . IF_MATCH , eTag ) ; } retConnection . setRequestMethod ( requestMethod ) ; return retConnection ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an < code > HttpURLConnection < / code > to perform a delete operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * The identity of the entity . The resulting request will be formatted as / tableName ( identity ) if not
 * null or empty .
 * @ param eTag
 * The etag of the entity .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection delete ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final String eTag ) throws IOException , URISyntaxException , StorageException { } }

implementation: return coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , eTag , identity , "DELETE" ) ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an < code > HttpURLConnection < / code > to perform an insert operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * The identity of the entity . The resulting request will be formatted as / tableName ( identity ) if not
 * null or empty .
 * @ param eTag
 * The etag of the entity , can be null for straight inserts .
 * @ param updateType
 * The { @ link TableUpdateType } type of update to be performed . Specify < code > null < / code > for straight
 * inserts .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection insert ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final String eTag , final boolean echoContent , final TableUpdateType updateType ) throws IOException , URISyntaxException , StorageException { } }

implementation:
HttpURLConnection retConnection = null ; if ( updateType == null ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , eTag , null /* identity */
, "POST" ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . PREFER , echoContent ? TableConstants . HeaderConstants . RETURN_CONTENT : TableConstants . HeaderConstants . RETURN_NO_CONTENT ) ; } else if ( updateType == TableUpdateType . MERGE ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , null /* ETAG */
, identity , "POST" ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . X_HTTP_METHOD , "MERGE" ) ; } else if ( updateType == TableUpdateType . REPLACE ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , null /* ETAG */
, identity , "PUT" ) ; } retConnection . setDoOutput ( true ) ; return retConnection ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an HttpURLConnection to perform a merge operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * The identity of the entity . The resulting request will be formatted as / tableName ( identity ) if not
 * null or empty .
 * @ param eTag
 * The etag of the entity .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection merge ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final String eTag ) throws IOException , URISyntaxException , StorageException { } }

implementation: final HttpURLConnection retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , eTag , identity , "POST" ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . X_HTTP_METHOD , "MERGE" ) ; retConnection . setDoOutput ( true ) ; return retConnection ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an HttpURLConnection to perform a single entity query operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * The identity of the entity . The resulting request will be formatted as / tableName ( identity ) if not
 * null or empty .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection query ( final URI rootUri , final TableRequestOptions tableOptions , UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final ResultContinuation continuationToken ) throws IOException , URISyntaxException , StorageException { } }

implementation: if ( queryBuilder == null ) { queryBuilder = new UriQueryBuilder ( ) ; } applyContinuationToQueryBuilder ( queryBuilder , continuationToken ) ; final HttpURLConnection retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , null , identity , "GET" ) ; return retConnection ;


signature:
public class TableRequest { /** * Reserved for internal use . Constructs an HttpURLConnection to perform an update operation .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param queryBuilder
 * The { @ link UriQueryBuilder } for the operation .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ param tableName
 * The name of the table .
 * @ param identity
 * A < code > String < / code > representing the identity of the entity . The resulting request will be formatted
 * using < em > / tableName ( identity ) < / em > if identity is not > code > null < / code > or empty .
 * @ param eTag
 * The etag of the entity .
 * @ return
 * An < code > HttpURLConnection < / code > to use to perform the operation .
 * @ throws IOException
 * if there is an error opening the connection .
 * @ throws URISyntaxException
 * if the resource URI is invalid .
 * @ throws StorageException
 * if a storage service error occurred during the operation . */
public static HttpURLConnection update ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final String eTag ) throws IOException , URISyntaxException , StorageException { } }

implementation: final HttpURLConnection retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , eTag , identity , "PUT" ) ; retConnection . setDoOutput ( true ) ; return retConnection ;


signature:
public class TableRequest { /** * Sets the ACL for the table . Sign with length of aclBytes .
 * @ param rootUri
 * A < code > java . net . URI < / code > containing an absolute URI to the resource .
 * @ param tableOptions
 * A { @ link TableRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudTableClient } .
 * @ param opContext
 * An { @ link OperationContext } object for tracking the current operation . Specify < code > null < / code > to
 * safely ignore operation context .
 * @ return a HttpURLConnection configured for the operation .
 * @ throws StorageException */
public static HttpURLConnection setAcl ( final URI rootUri , final TableRequestOptions options , final OperationContext opContext ) throws IOException , URISyntaxException , StorageException { } }

implementation: UriQueryBuilder queryBuilder = new UriQueryBuilder ( ) ; queryBuilder . add ( Constants . QueryConstants . COMPONENT , "acl" ) ; final HttpURLConnection retConnection = BaseRequest . createURLConnection ( rootUri , options , queryBuilder , opContext ) ; retConnection . setRequestMethod ( "PUT" ) ; retConnection . setDoOutput ( true ) ; return retConnection ;