SdkContext Class
- java.
lang. Object - com.
microsoft. azure. management. resources. fluentcore. utils. SdkContext
- com.
public class SdkContext
The class to contain the common factory methods required for SDK framework.
Constructor Summary
Constructor | Description | |
---|---|---|
SdkContext() |
Method Summary
Modifier and Type | Method and Description |
---|---|
static org.joda.time.DateTime | dateTimeNow() |
static rx.Observable<T> |
delayedEmitAsync(T event, int milliseconds)
Wrapper delayed emission, based on delay |
static
Resource |
getResourceNamerFactory()
Gets the current factory for Resource |
static rx.Scheduler |
getRxScheduler()
Gets the current Rx Scheduler for the SDK framework. |
static void |
prepareFileLocation(File[] files)
Prepares the location for file to be created. |
static java.lang.String |
randomResourceName(String prefix, int maxLen)
Gets a random name. |
static java.lang.String[] |
randomResourceNames(String prefix, int maxLen, int count)
Generates the specified number of random resource names with the same prefix. |
static java.lang.String |
randomUuid()
Gets a random UUID. |
static void |
setDelayProvider(DelayProvider delayProvider)
Function to override the Delay |
static void |
setFileProvider(FileProvider fileProvider)
Sets the File |
static void |
setResourceNamerFactory(ResourceNamerFactory resourceNamerFactory)
Function to override the Resource |
static void |
setRxScheduler(Scheduler rxScheduler)
Sets the Rx Scheduler for SDK framework, by default is Scheduler. |
static void |
sleep(int milliseconds)
Wrapper for sleep, based on delay |
Methods inherited from java.lang.Object
Constructor Details
SdkContext
public SdkContext()
Method Details
dateTimeNow
public static DateTime dateTimeNow()
Returns:
delayedEmitAsync
public static Observable
Wrapper delayed emission, based on delayProvider.
Parameters:
Returns:
getResourceNamerFactory
public static ResourceNamerFactory getResourceNamerFactory()
Gets the current factory for ResourceNamer.
Returns:
getRxScheduler
public static Scheduler getRxScheduler()
Gets the current Rx Scheduler for the SDK framework.
Returns:
prepareFileLocation
public static void prepareFileLocation(File[] files)
Prepares the location for file to be created.
Parameters:
Throws:
randomResourceName
public static String randomResourceName(String prefix, int maxLen)
Gets a random name.
Parameters:
Returns:
randomResourceNames
public static String[] randomResourceNames(String prefix, int maxLen, int count)
Generates the specified number of random resource names with the same prefix.
Parameters:
Returns:
randomUuid
public static String randomUuid()
Gets a random UUID.
Returns:
setDelayProvider
public static void setDelayProvider(DelayProvider delayProvider)
Function to override the DelayProvider.
Parameters:
setFileProvider
public static void setFileProvider(FileProvider fileProvider)
Sets the FileProvider for SDK framework, by default it does nothing.
Parameters:
setResourceNamerFactory
public static void setResourceNamerFactory(ResourceNamerFactory resourceNamerFactory)
Function to override the ResourceNamerFactory.
Parameters:
setRxScheduler
public static void setRxScheduler(Scheduler rxScheduler)
Sets the Rx Scheduler for SDK framework, by default is Scheduler.io().
Parameters:
sleep
public static void sleep(int milliseconds)
Wrapper for sleep, based on delayProvider.
Parameters: