Class AzureConfigurationParserUtils
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.azure.util.AzureConfigurationParserUtils
-
public class AzureConfigurationParserUtils extends Object
Utility class for parsing Oak Segment Azure configuration (e.g. connection string, container name, uri, etc.) from custom encoded String or Azure standard URI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAzureConfigurationParserUtils.AzureConnectionKey
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_ACCOUNT_NAMEstatic StringKEY_CONNECTION_STRINGstatic StringKEY_CONTAINER_NAMEstatic StringKEY_DIRstatic StringKEY_STORAGE_URI
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisCustomAzureConnectionString(String conn)static Map<String,String>parseAzureConfigurationFromCustomConnection(String conn)Parses a custom encoded connection string of the form (line breaks added for clarity):
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1; AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==; BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
ContainerName=mycontainer;
Directory=mydir
where the first three lines in the string represent a standard Azure Connection String and the last two lines are Oak Segment Azure specific arguments.static Map<String,String>parseAzureConfigurationFromUri(String uriStr)Parses a standard Azure URI in the format https://myaccount.blob.core.windows.net/container/repo,
-
-
-
Field Detail
-
KEY_CONNECTION_STRING
public static final String KEY_CONNECTION_STRING
- See Also:
- Constant Field Values
-
KEY_CONTAINER_NAME
public static final String KEY_CONTAINER_NAME
- See Also:
- Constant Field Values
-
KEY_ACCOUNT_NAME
public static final String KEY_ACCOUNT_NAME
- See Also:
- Constant Field Values
-
KEY_STORAGE_URI
public static final String KEY_STORAGE_URI
- See Also:
- Constant Field Values
-
KEY_DIR
public static final String KEY_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isCustomAzureConnectionString
public static boolean isCustomAzureConnectionString(String conn)
- Parameters:
conn- the connection string- Returns:
trueif this is a custom encoded Azure connection String,falseotherwise
-
parseAzureConfigurationFromCustomConnection
public static Map<String,String> parseAzureConfigurationFromCustomConnection(String conn)
Parses a custom encoded connection string of the form (line breaks added for clarity):
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1; AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==; BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;
ContainerName=mycontainer;
Directory=mydir
where the first three lines in the string represent a standard Azure Connection String and the last two lines are Oak Segment Azure specific arguments. Please note that all configuration keys are semicolon separated, except for the last entry. The order of keys is not important.- Parameters:
conn- the connection string- Returns:
- parsed configuration map containing the Azure connectionString, containerName and dir (key names in bold)
-
parseAzureConfigurationFromUri
public static Map<String,String> parseAzureConfigurationFromUri(String uriStr)
Parses a standard Azure URI in the format https://myaccount.blob.core.windows.net/container/repo,- Parameters:
uriStr- the Azure URI as string- Returns:
- parsed configuration map containing accountName, storageUri and dir (key names in bold)
-
-