Search in sources :

Example 1 with TargetRegistry

use of com.mercedesbenz.sechub.domain.scan.TargetRegistry 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

TargetRegistry (com.mercedesbenz.sechub.domain.scan.TargetRegistry)1 UUIDTraceLogID (com.mercedesbenz.sechub.sharedkernel.UUIDTraceLogID)1 SecHubConfiguration (com.mercedesbenz.sechub.sharedkernel.configuration.SecHubConfiguration)1 SecHubExecutionException (com.mercedesbenz.sechub.sharedkernel.execution.SecHubExecutionException)1 InetAddress (java.net.InetAddress)1 URI (java.net.URI)1