Search in sources :

Example 1 with TAzureStorageContainerCreateProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties in project components by Talend.

the class AzureStorageBaseBlobTestIT method doContainerCreate.

/**
 * doContainerCreate.
 *
 * @param container {@link String} container
 * @param access {@link AccessControl} access
 * @return <code>Boolean</code> {@link Boolean} boolean
 * @throws Exception the exception
 */
@SuppressWarnings("rawtypes")
public Boolean doContainerCreate(String container, TAzureStorageContainerCreateProperties.AccessControl access) throws Exception {
    TAzureStorageContainerCreateProperties properties = new TAzureStorageContainerCreateProperties("tests");
    setupConnectionProperties(properties);
    properties.container.setValue(container);
    properties.accessControl.setValue(access);
    BoundedReader reader = createBoundedReader(properties);
    return reader.start();
}
Also used : TAzureStorageContainerCreateProperties(org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties) BoundedReader(org.talend.components.api.component.runtime.BoundedReader)

Example 2 with TAzureStorageContainerCreateProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties in project components by Talend.

the class AzureStorageContainerCreateRuntime method initialize.

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

Example 3 with TAzureStorageContainerCreateProperties

use of org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties in project components by Talend.

the class AzureStorageContainerCreateRuntimeTest method setup.

@Before
public void setup() {
    properties = new TAzureStorageContainerCreateProperties(PROP_ + "CreateContainer");
    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");
    properties.accessControl.setValue(AccessControl.Public);
    runtimeContainer = new RuntimeContainerMock();
    this.containerCreate = new AzureStorageContainerCreateRuntime();
}
Also used : TAzureStorageContainerCreateProperties(org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties) RuntimeContainerMock(org.talend.components.azurestorage.RuntimeContainerMock) TAzureStorageConnectionProperties(org.talend.components.azurestorage.tazurestorageconnection.TAzureStorageConnectionProperties) Before(org.junit.Before)

Aggregations

TAzureStorageContainerCreateProperties (org.talend.components.azurestorage.blob.tazurestoragecontainercreate.TAzureStorageContainerCreateProperties)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