本文整理汇总了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());
}
}
示例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();
}
}
示例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()));
}
示例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);
}
}