SdkContext Class

  • java.lang.Object
    • com.microsoft.azure.management.resources.fluentcore.utils.SdkContext

public class SdkContext

The class to contain the common factory methods required for SDK framework.

Method Summary

Modifier and Type Method and Description
ResourceNamerFactory getResourceNamerFactory()

Gets the current factory for ResourceNamer.

Scheduler getRxScheduler()

Gets the current Rx Scheduler for the SDK framework.

String randomResourceName(String prefix, int maxLen)

Gets a random name.

String [] randomResourceNames(String prefix, int maxLen, int count)

Generates the specified number of random resource names with the same prefix.

String randomUuid()

Gets a random UUID.

void setDelayProvider(DelayProvider delayProvider)

Function to override the DelayProvider.

void setResourceNamerFactory(ResourceNamerFactory resourceNamerFactory)

Function to override the ResourceNamerFactory.

void setRxScheduler(Scheduler rxScheduler)

Sets the Rx Scheduler for SDK framework, by default is Scheduler.io().

void sleep(int milliseconds)

Wrapper for sleep, based on delayProvider.

Method Details

getResourceNamerFactory

public static ResourceNamerFactory getResourceNamerFactory()

Gets the current factory for ResourceNamer.

Returns:

resourceNamer factory.

getRxScheduler

public static Scheduler getRxScheduler()

Gets the current Rx Scheduler for the SDK framework.

Returns:

current rx scheduler.

randomResourceName

public static String randomResourceName(String prefix, int maxLen)

Gets a random name.

Parameters:

prefix - the prefix to be used if possible
maxLen - the maximum length for the random generated name

Returns:

the random name

randomResourceNames

public static String [] randomResourceNames(String prefix, int maxLen, int count)

Generates the specified number of random resource names with the same prefix.

Parameters:

prefix - the prefix to be used if possible
maxLen - the maximum length for the random generated name
count - the number of names to generate

Returns:

random names

randomUuid

public static String randomUuid()

Gets a random UUID.

Returns:

the random UUID.

setDelayProvider

public static void setDelayProvider(DelayProvider delayProvider)

Function to override the DelayProvider.

Parameters:

delayProvider - delayProvider to override.

setResourceNamerFactory

public static void setResourceNamerFactory(ResourceNamerFactory resourceNamerFactory)

Function to override the ResourceNamerFactory.

Parameters:

resourceNamerFactory - factory to override.

setRxScheduler

public static void setRxScheduler(Scheduler rxScheduler)

Sets the Rx Scheduler for SDK framework, by default is Scheduler.io().

Parameters:

rxScheduler - current Rx Scheduler to be used in SDK framework.

sleep

public static void sleep(int milliseconds)

Wrapper for sleep, based on delayProvider.

Parameters:

milliseconds - number of millisecond for which thread should put on sleep.

Applies to