Search in sources :

Example 1 with TAzureStorageContainerExistProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties in project components by Talend.

the class AzureStorageContainerExistRuntimeTest method setup.

@Before
public void setup() {
    properties = new TAzureStorageContainerExistProperties(PROP_ + "ExistContainer");
    properties.setupProperties();
    // valid connection
    properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
    properties.connection.protocol.setValue(Protocol.HTTP);
    properties.connection.accountName.setValue("fakeAccountName");
    properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
    runtimeContainer = new RuntimeContainerMock();
    this.existContainer = new AzureStorageContainerExistRuntime();
}
Also used : RuntimeContainerMock(org.talend.components.azurestorage.RuntimeContainerMock) TAzureStorageContainerExistProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties) TAzureStorageConnectionProperties(org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties) Before(org.junit.Before)

Example 2 with TAzureStorageContainerExistProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties in project components by Talend.

the class AzureStorageContainerExistRuntime method initialize.

@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
    ValidationResult validationResult = super.initialize(runtimeContainer, properties);
    if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
        return validationResult;
    }
    TAzureStorageContainerExistProperties componentProperties = (TAzureStorageContainerExistProperties) properties;
    this.dieOnError = componentProperties.dieOnError.getValue();
    this.azureStorageBlobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
    return ValidationResult.OK;
}
Also used : TAzureStorageContainerExistProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties) ValidationResult(org.talend.daikon.properties.ValidationResult) AzureStorageBlobService(org.talend.components.azurestorage.blob.AzureStorageBlobService)

Example 3 with TAzureStorageContainerExistProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties in project components by Talend.

the class AzureStorageBaseBlobTestIT method doContainerExist.

/**
 * doContainerExist - Checks if container exists
 *
 * @param container {@link String} container
 * @return {@link Boolean} true if exists.
 * @throws Exception the exception
 */
@SuppressWarnings("rawtypes")
public Boolean doContainerExist(String container) throws Exception {
    TAzureStorageContainerExistProperties properties = new TAzureStorageContainerExistProperties("tests");
    setupConnectionProperties(properties);
    properties.container.setValue(container);
    BoundedReader reader = createBoundedReader(properties);
    return reader.start();
}
Also used : TAzureStorageContainerExistProperties(org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties) BoundedReader(org.talend.components.api.component.runtime.BoundedReader)

Aggregations

TAzureStorageContainerExistProperties (org.talend.components.azurestorage.blob.tazurestoragecontainerexist.TAzureStorageContainerExistProperties)3 Before (org.junit.Before)1 BoundedReader (org.talend.components.api.component.runtime.BoundedReader)1 RuntimeContainerMock (org.talend.components.azurestorage.RuntimeContainerMock)1 AzureStorageBlobService (org.talend.components.azurestorage.blob.AzureStorageBlobService)1 TAzureStorageConnectionProperties (org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1