当前位置: 首页>>代码示例>>Java>>正文


Java VersionBomPolicyStatusView类代码示例

本文整理汇总了Java中com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView的典型用法代码示例。如果您正苦于以下问题:Java VersionBomPolicyStatusView类的具体用法?Java VersionBomPolicyStatusView怎么用?Java VersionBomPolicyStatusView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VersionBomPolicyStatusView类属于com.blackducksoftware.integration.hub.model.view包,在下文中一共展示了VersionBomPolicyStatusView类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkPolicyFailures

import com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView; //导入依赖的package包/类
private void checkPolicyFailures(final AgentRunningBuild build, final IntLogger logger, final HubServicesFactory services, final MetaService metaService, final ProjectVersionView version, final boolean isDryRun) {
    try {
        if (isDryRun) {
            logger.warn("Will not run the Failure conditions because this was a dry run scan.");
            return;
        }
        final String policyStatusLink = metaService.getFirstLink(version, MetaService.POLICY_STATUS_LINK);

        final VersionBomPolicyStatusView policyStatusItem = services.createHubResponseService().getItem(policyStatusLink, VersionBomPolicyStatusView.class);
        if (policyStatusItem == null) {
            final String message = "Could not find any information about the Policy status of the bom.";
            logger.error(message);
            build.stopBuild(message);
        }

        final PolicyStatusDescription policyStatusDescription = new PolicyStatusDescription(policyStatusItem);
        final String policyStatusMessage = policyStatusDescription.getPolicyStatusMessage();
        if (policyStatusItem.overallStatus == VersionBomPolicyStatusOverallStatusEnum.IN_VIOLATION) {
            build.stopBuild(policyStatusMessage);
        } else {
            logger.info(policyStatusMessage);
        }
    } catch (final Exception e) {
        logger.error(e.getMessage(), e);
        build.stopBuild(e.getMessage());
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:28,代码来源:HubBuildProcess.java

示例2: checkPolicyFailures

import com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView; //导入依赖的package包/类
private TaskResultBuilder checkPolicyFailures(final TaskResultBuilder resultBuilder, final TaskContext taskContext, final IntLogger logger, final HubServicesFactory services, final MetaService metaService,
        final ProjectVersionView version, final boolean isDryRun) {
    try {
        if (isDryRun) {
            logger.warn("Will not run the Failure conditions because this was a dry run scan.");
            return resultBuilder.success();
        }
        final String policyStatusLink = metaService.getFirstLink(version, MetaService.POLICY_STATUS_LINK);

        final VersionBomPolicyStatusView policyStatusItem = services.createHubResponseService().getItem(policyStatusLink, VersionBomPolicyStatusView.class);
        if (policyStatusItem == null) {
            logger.error("Could not find any information about the Policy status of the bom.");
            return resultBuilder.failed();
        }

        final PolicyStatusDescription policyStatusDescription = new PolicyStatusDescription(policyStatusItem);
        final String policyStatusMessage = policyStatusDescription.getPolicyStatusMessage();
        if (policyStatusItem.overallStatus == VersionBomPolicyStatusOverallStatusEnum.IN_VIOLATION) {
            logger.error(policyStatusMessage);
            return resultBuilder.failedWithError();
        }
        logger.info(policyStatusMessage);
        return resultBuilder.success();
    } catch (final IntegrationException e) {
        logger.error(e.getMessage(), e);
        return resultBuilder.failed();
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-bamboo,代码行数:29,代码来源:HubScanTask.java

示例3: checkHubPolicies

import com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView; //导入依赖的package包/类
private void checkHubPolicies() throws MojoExecutionException, MojoFailureException {
    logger.info(String.format(CHECK_POLICIES_STARTING, getBdioFilename()));
    waitForHub();
    try {
        final VersionBomPolicyStatusView policyStatusItem = BUILD_TOOL_HELPER.checkPolicies(getHubServicesFactory(), getHubProjectName(),
                getHubVersionName());
        handlePolicyStatusItem(policyStatusItem);
    } catch (IllegalArgumentException | IntegrationException e) {
        throw new MojoFailureException(String.format(CHECK_POLICIES_ERROR, e.getMessage()), e);
    }

    logger.info(String.format(CHECK_POLICIES_FINISHED, getBdioFilename()));
}
 
开发者ID:blackducksoftware,项目名称:hub-maven-plugin,代码行数:14,代码来源:BuildBOMGoal.java

示例4: handlePolicyStatusItem

import com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView; //导入依赖的package包/类
public void handlePolicyStatusItem(final VersionBomPolicyStatusView policyStatusItem) throws MojoFailureException {
    final PolicyStatusDescription policyStatusDescription = new PolicyStatusDescription(policyStatusItem);
    final String policyStatusMessage = policyStatusDescription.getPolicyStatusMessage();
    logger.info(policyStatusMessage);
    if (VersionBomPolicyStatusOverallStatusEnum.IN_VIOLATION == policyStatusItem.overallStatus) {
        throw new MojoFailureException(policyStatusMessage);
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-maven-plugin,代码行数:9,代码来源:BuildBOMGoal.java


注:本文中的com.blackducksoftware.integration.hub.model.view.VersionBomPolicyStatusView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。