Search in sources :

Example 6 with DtsRegistry

use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.

the class DtsListingManager method getDtsBaseUrl.

private String getDtsBaseUrl(String path, Long dtsId) {
    DtsRegistry registry = dtsRegistryManager.load(dtsId);
    Assert.isTrue(registry.getPrefixes().stream().anyMatch(prefix -> path.startsWith(trimTrailingDelimiter(prefix))), String.format("Required path %s does not satisfy DTS registry with id %d", path, dtsId));
    return registry.getUrl();
}
Also used : DtsDataStorageListing(com.epam.pipeline.entity.dts.DtsDataStorageListing) Service(org.springframework.stereotype.Service) RequiredArgsConstructor(lombok.RequiredArgsConstructor) AuthManager(com.epam.pipeline.manager.security.AuthManager) Result(com.epam.pipeline.controller.Result) DtsRegistry(com.epam.pipeline.entity.dts.DtsRegistry) Assert(org.springframework.util.Assert) DtsRegistry(com.epam.pipeline.entity.dts.DtsRegistry)

Example 7 with DtsRegistry

use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.

the class DtsConfigurationProviderImpl method validateEntry.

@Override
public void validateEntry(DtsRunConfigurationEntry entry) {
    DtsRegistry dts = dtsRegistryManager.load(entry.getDtsId());
    Assert.isTrue(dts.isSchedulable(), messageHelper.getMessage(MessageConstants.ERROR_DTS_NOT_SCHEDULABLE, dts.getName()));
    if (entry.getPipelineId() != null) {
        pipelineManager.load(entry.getPipelineId());
    }
}
Also used : DtsRegistry(com.epam.pipeline.entity.dts.DtsRegistry)

Example 8 with DtsRegistry

use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.

the class DtsConfigurationProviderImpl method stop.

@Override
public boolean stop(Long runId, DtsExecutionPreferences executionPreferences) {
    DtsRegistry dts = dtsRegistryManager.load(executionPreferences.getDtsId());
    Assert.isTrue(dts.isSchedulable(), messageHelper.getMessage(MessageConstants.ERROR_DTS_NOT_SCHEDULABLE, dts.getName()));
    try {
        dtsSubmissionManager.stopSubmission(dts.getId(), runId);
    } catch (DtsRequestException e) {
        log.error("Failed to stop submission on DTS: {}", e);
        return false;
    }
    return true;
}
Also used : DtsRegistry(com.epam.pipeline.entity.dts.DtsRegistry) DtsRequestException(com.epam.pipeline.exception.DtsRequestException)

Aggregations

DtsRegistry (com.epam.pipeline.entity.dts.DtsRegistry)8 Transactional (org.springframework.transaction.annotation.Transactional)3 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)1 Result (com.epam.pipeline.controller.Result)1 DtsDataStorageListing (com.epam.pipeline.entity.dts.DtsDataStorageListing)1 DtsRequestException (com.epam.pipeline.exception.DtsRequestException)1 AuthManager (com.epam.pipeline.manager.security.AuthManager)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 Test (org.junit.Test)1 Service (org.springframework.stereotype.Service)1 Assert (org.springframework.util.Assert)1