Search in sources :

Example 6 with UUIDTraceLogID

use of com.mercedesbenz.sechub.sharedkernel.UUIDTraceLogID in project sechub by mercedes-benz.

the class AbstractInstallSetupProductExecutor method execute.

@Override
public final List<ProductResult> execute(SecHubExecutionContext context, ProductExecutorContext executorContext) throws SecHubExecutionException {
    UUIDTraceLogID traceLogId = context.getTraceLogId();
    LOG.debug("Executing {}", traceLogId);
    SecHubConfiguration config = context.getConfiguration();
    S setup = getInstallSetup();
    TargetRegistry registry = createTargetRegistry();
    List<URI> uris = resolveURIsForTarget(config);
    registerURIs(traceLogId, setup, registry, uris);
    List<InetAddress> inetAdresses = resolveInetAdressForTarget(config);
    registerInetAdresses(traceLogId, setup, registry, inetAdresses);
    customRegistration(traceLogId, setup, registry, config);
    try {
        return execute(context, executorContext, registry, setup);
    } catch (SecHubExecutionException e) {
        throw e;
    } catch (Exception e) {
        /*
             * every other exception is wrapped to a SecHub execution exception which is
             * handled
             */
        throw new SecHubExecutionException(getIdentifier() + " execution failed." + traceLogId, e);
    }
}
Also used : SecHubExecutionException(com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException) UUIDTraceLogID(com.mercedesbenz.sechub.sharedkernel.UUIDTraceLogID) TargetRegistry(com.mercedesbenz.sechub.domain.scan.TargetRegistry) SecHubConfiguration(com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration) URI(java.net.URI) InetAddress(java.net.InetAddress) SecHubExecutionException(com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException)

Aggregations

UUIDTraceLogID (com.mercedesbenz.sechub.sharedkernel.UUIDTraceLogID)6 SecHubConfiguration (com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration)5 SecHubExecutionContext (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionContext)2 SecHubExecutionException (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException)2 Test (org.junit.jupiter.api.Test)2 SecHubLicenseScanConfiguration (com.mercedesbenz.sechub.commons.model.SecHubLicenseScanConfiguration)1 TargetRegistry (com.mercedesbenz.sechub.domain.scan.TargetRegistry)1 ProductIdentifier (com.mercedesbenz.sechub.domain.scan.product.ProductIdentifier)1 ProductResult (com.mercedesbenz.sechub.domain.scan.product.ProductResult)1 InetAddress (java.net.InetAddress)1 URI (java.net.URI)1 UUID (java.util.UUID)1