Search in sources :

Example 21 with Nullable

use of com.microsoft.azuretools.azurecommons.helpers.Nullable in project azure-tools-for-java by Microsoft.

the class ArcadiaSparkCompute method getStorageAccount.

@Nullable
@Override
public IHDIStorageAccount getStorageAccount() {
    DataLakeStorageAccountDetails storageAccountDetails = getWorkSpace().getStorageAccountDetails();
    if (storageAccountDetails == null || storageAccountDetails.accountUrl() == null || storageAccountDetails.filesystem() == null) {
        log().warn(String.format("Storage account info is invalid for workspace %s. AccountUrl: %s, filesystem: %s.", getWorkSpace().getName(), storageAccountDetails.accountUrl(), storageAccountDetails.filesystem()));
        return null;
    }
    // Sample response:
    // "accountUrl": "https://accountName.dfs.core.windows.net",
    // "filesystem": "fileSystemName"
    URI storageUri = AbfsUri.parse(storageAccountDetails.accountUrl() + "/" + storageAccountDetails.filesystem()).getUri();
    return new ADLSGen2StorageAccount(this, storageUri.getHost(), true, storageAccountDetails.filesystem());
}
Also used : ADLSGen2StorageAccount(com.microsoft.azure.hdinsight.sdk.storage.ADLSGen2StorageAccount) URI(java.net.URI) DataLakeStorageAccountDetails(com.microsoft.azure.hdinsight.sdk.rest.azure.synapse.models.DataLakeStorageAccountDetails) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable)

Example 22 with Nullable

use of com.microsoft.azuretools.azurecommons.helpers.Nullable in project azure-tools-for-java by Microsoft.

the class SparkBatchSubmission method getSSLSocketFactory.

@Nullable
protected SSLConnectionSocketFactory getSSLSocketFactory() {
    TrustStrategy ts = ServiceManager.getServiceProvider(TrustStrategy.class);
    SSLConnectionSocketFactory sslSocketFactory = null;
    if (ts != null) {
        try {
            SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(ts).build();
            sslSocketFactory = new SSLConnectionSocketFactory(sslContext, HttpObservable.isSSLCertificateValidationDisabled() ? NoopHostnameVerifier.INSTANCE : new DefaultHostnameVerifier());
        } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
            log().error("Prepare SSL Context for HTTPS failure. " + ExceptionUtils.getStackTrace(e));
        }
    }
    return sslSocketFactory;
}
Also used : TrustStrategy(org.apache.http.ssl.TrustStrategy) DefaultHostnameVerifier(org.apache.http.conn.ssl.DefaultHostnameVerifier) SSLContext(javax.net.ssl.SSLContext) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) KeyStoreException(java.security.KeyStoreException) SSLConnectionSocketFactory(org.apache.http.conn.ssl.SSLConnectionSocketFactory) SSLContextBuilder(org.apache.http.ssl.SSLContextBuilder) KeyManagementException(java.security.KeyManagementException) Nullable(com.microsoft.azuretools.azurecommons.helpers.Nullable)

Aggregations

Nullable (com.microsoft.azuretools.azurecommons.helpers.Nullable)22 Project (com.intellij.openapi.project.Project)4 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 ILogger (com.microsoft.azure.hdinsight.common.logger.ILogger)3 NotNull (com.microsoft.azuretools.azurecommons.helpers.NotNull)3 ConsoleView (com.intellij.execution.ui.ConsoleView)2 Module (com.intellij.openapi.module.Module)2 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)2 ProgressManager (com.intellij.openapi.progress.ProgressManager)2 LightVirtualFile (com.intellij.testFramework.LightVirtualFile)2 HDIException (com.microsoft.azure.hdinsight.sdk.common.HDIException)2 Azure (com.microsoft.azure.management.Azure)2 Action (com.microsoft.azure.toolkit.lib.common.action.Action)2 ActionView (com.microsoft.azure.toolkit.lib.common.action.ActionView)2 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)2 AzureMessager (com.microsoft.azure.toolkit.lib.common.messager.AzureMessager)2 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)2 AzureOperationBundle.title (com.microsoft.azure.toolkit.lib.common.operation.AzureOperationBundle.title)2 AzureTask (com.microsoft.azure.toolkit.lib.common.task.AzureTask)2 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)2