• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Results类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.forge.addon.ui.result.Results的典型用法代码示例。如果您正苦于以下问题:Java Results类的具体用法?Java Results怎么用?Java Results使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Results类属于org.jboss.forge.addon.ui.result包,在下文中一共展示了Results类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    UIContext uiContext = context.getUIContext();
    Map<Object, Object> attributeMap = uiContext.getAttributeMap();

    List<GitClonedRepoDetails> clonedRepos = (List<GitClonedRepoDetails>) attributeMap.get(AttributeMapKeys.GIT_CLONED_REPOS);
    if (clonedRepos != null) {
        for (GitClonedRepoDetails clonedRepo : clonedRepos) {
            Git git = clonedRepo.getGit();
            String gitUrl = clonedRepo.getGitUrl();
            UserDetails userDetails = clonedRepo.getUserDetails();
            File basedir = clonedRepo.getDirectory();
            String message = "Adding pipeline";
            try {
                LOG.info("Performing a git commit and push on URI " + gitUrl);
                gitAddCommitAndPush(git, gitUrl, userDetails, basedir, message);
            } catch (GitAPIException e) {
                return Results.fail("Failed to commit and push repository " + clonedRepo.getGitRepoName() + " due to " + e, e);
            } finally {
                removeTemporaryFiles(basedir);
            }
        }
    }
    return Results.success();
}
 
开发者ID:fabric8-launcher,项目名称:launcher-backend,代码行数:26,代码来源:GitCommitAndPushStep.java


示例2: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(final UIExecutionContext context) throws Exception
{
   final UIContext uiContext = context.getUIContext();
   applyUIValues(uiContext);

   // add driver dependency
   final Project project = helper.getProject(uiContext);
   final DatabaseType database = dbType.getValue();
   final Coordinate driverCoordinate = database.getDriverCoordinate();
   SpringBootHelper.addDependency(project, driverCoordinate.getGroupId(), driverCoordinate.getArtifactId())
            .setScopeType("runtime");
   SpringBootHelper.addSpringBootDependency(project, SpringBootFacet.SPRING_BOOT_STARTER_DATA_JPA_ARTIFACT)
            .setScopeType("runtime");

   return Results.success("Spring Boot JPA successfully set up!");
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:18,代码来源:SpringBootJPASetupWizard.java


示例3: next

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public NavigationResult next(UINavigationContext context) throws Exception
{
   applyUIValues(context.getUIContext());

   final DatabaseType database = dbType.getValue();
   if (!isNotEmbeddedDB(database))
   {
      return Results.navigateTo(FinishJPASetupCommand.class);
   }
   else
   {
      if (dataSourceName.hasValue())
      {
         // if we specified a datasource, use it
         return Results.navigateTo(AddJNDIDatasourceCommand.class);
      }
      else
      {
         // otherwise, we're using the DB URL, so deal with it
         return Results.navigateTo(AddDBURLCommand.class);
      }
   }
}
 
开发者ID:forge,项目名称:springboot-addon,代码行数:25,代码来源:SpringBootJPASetupWizard.java


示例4: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    String buildConfigName = buildName.getValue();
    Objects.assertNotNull(buildConfigName, "buildName");
    Map<String, String> labels = BuildConfigs.createBuildLabels(buildConfigName);
    String gitUrlText = getOrFindGitUrl(context, gitUri.getValue());
    String imageText = image.getValue();
    List<EnvVar> envVars = createEnvVars(buildConfigName, gitUrlText, mavenCommand.getValue());
    BuildConfig buildConfig = BuildConfigs.createIntegrationTestBuildConfig(buildConfigName, labels, gitUrlText, imageText, envVars);

    LOG.info("Generated BuildConfig: " + toJson(buildConfig));

    ImageStream imageRepository = BuildConfigs.imageRepository(buildConfigName, labels);

    Controller controller = createController();
    controller.applyImageStream(imageRepository, "generated ImageStream: " + toJson(imageRepository));
    controller.applyBuildConfig(buildConfig, "generated BuildConfig: " + toJson(buildConfig));
    return Results.success("Added BuildConfig: " + Builds.getName(buildConfig) + " to OpenShift at master: " + getKubernetes().getMasterUrl());
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:NewIntegrationTestBuildCommand.java


示例5: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    StopWatch watch = new StopWatch();

    log.debug("Starting to setup fabric8 project");

    Project project = getSelectedProject(context.getUIContext());
    if (project == null) {
        return Results.fail("No pom.xml available so cannot edit the project!");
    }

    // setup fabric8-maven-plugin
    setupFabricMavenPlugin(project);
    log.debug("fabric8-maven-plugin now setup");

    // make sure we have resources as we need it later
    facetFactory.install(project, ResourcesFacet.class);

    log.info("execute took " + watch.taken());
    return Results.success();
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:Fabric8SetupStep.java


示例6: ensureCamelArtifactIdAdded

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
public static Result ensureCamelArtifactIdAdded(Project project, CamelComponentDetails details, DependencyInstaller dependencyInstaller) {
    String groupId = details.getGroupId();
    String artifactId = details.getArtifactId();
    Dependency core = CamelProjectHelper.findCamelCoreDependency(project);
    if (core == null) {
        return Results.fail("The project does not include camel-core");
    }

    // we want to use same version as camel-core if its a camel component
    // otherwise use the version from the dto
    String version;
    if ("org.apache.camel".equals(groupId)) {
        version = core.getCoordinate().getVersion();
    } else {
        version = details.getVersion();
    }
    DependencyBuilder component = DependencyBuilder.create().setGroupId(groupId)
            .setArtifactId(artifactId).setVersion(version);

    // install the component
    dependencyInstaller.install(project, component);
    return null;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:24,代码来源:CamelCommandsHelper.java


示例7: editEndpointXml

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
private Result editEndpointXml(List<String> lines, String lineNumber, String endpointUrl, String uri, FileResource file, String xml) {
    // the list is 0-based, and line number is 1-based
    int idx = Integer.valueOf(lineNumber) - 1;
    String line = lines.get(idx);

    // replace uri with new value
    line = StringHelper.replaceAll(line, endpointUrl, uri);
    lines.set(idx, line);

    LOG.info("Updating " + endpointUrl + " to " + uri + " at line " + lineNumber + " in file " + xml);

    // and save the file back
    String content = LineNumberHelper.linesToString(lines);
    file.setContents(content);

    return Results.success("Update endpoint uri: " + uri + " in file " + xml);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:18,代码来源:ConfigureEndpointPropertiesStep.java


示例8: editEndpointOther

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
protected Result editEndpointOther(Project project, ResourcesFacet facet, FileResource file, String uri, String endpointUrl,
                                  String currentFile, String lineNumber) throws Exception {

    List<String> lines = LineNumberHelper.readLines(file.getResourceInputStream());

    // the list is 0-based, and line number is 1-based
    int idx = Integer.valueOf(lineNumber) - 1;
    String line = lines.get(idx);

    // replace uri with new value
    line = StringHelper.replaceAll(line, endpointUrl, uri);
    lines.set(idx, line);

    LOG.info("Updating " + endpointUrl + " to " + uri + " at line " + lineNumber + " in file " + currentFile);

    // and save the file back
    String content = LineNumberHelper.linesToString(lines);
    file.setContents(content);

    return Results.success("Update endpoint uri: " + uri + " in file " + currentFile);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:ConfigureEndpointPropertiesStep.java


示例9: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    String url = getJolokiaUrl();
    if (url == null) {
        return Results.fail("Not connected to remote jolokia agent. Use camel-connect command first");
    }

    boolean val = "true".equals(decode.getValue());
    String[] val2 = null;
    if (filter.getValue() != null) {
        String s = filter.getValue().toString();
        val2 = s.split(",");
    }

    org.apache.camel.commands.EndpointStatisticCommand command = new org.apache.camel.commands.EndpointStatisticCommand(name.getValue(), val, val2);
    command.execute(getController(), getOutput(context), getError(context));

    return Results.success();
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:EndpointStatsCommand.java


示例10: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext uiExecutionContext) throws Exception {
    configuration.setProperty("CamelJolokiaUrl", url.getValue());
    // username and password is optional
    configuration.setProperty("CamelJolokiaUsername", username.getValue());
    configuration.setProperty("CamelJolokiaPassword", password.getValue());

    // ping to see if the connection works
    JolokiaCamelController controller = new DefaultJolokiaCamelController();
    controller.connect(url.getValue(), username.getValue(), password.getValue());

    boolean ok = controller.ping();
    if (ok) {
        return Results.success("Connected to " + url.getValue() + (username.getValue() != null ? " using " + username.getValue() : ""));
    } else {
        return Results.fail("Error connecting to " + url.getValue());
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:19,代码来源:ConnectCommand.java


示例11: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    String url = getJolokiaUrl();
    if (url == null) {
        return Results.fail("Not connected to remote jolokia agent. Use camel-connect command first");
    }

    boolean val = "true".equals(decode.getValue());
    boolean val2 = "true".equals(verbose.getValue());
    boolean val3 = "true".equals(explain.getValue());

    org.apache.camel.commands.EndpointListCommand command = new org.apache.camel.commands.EndpointListCommand(name.getValue(), val, val2, val3);
    command.execute(getController(), getOutput(context), getError(context));

    return Results.success();
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:17,代码来源:EndpointListCommand.java


示例12: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext uiExecutionContext) throws Exception {
    String url = getJolokiaUrl();
    if (url == null) {
        return Results.fail("Not connected to remote jolokia agent. Use camel-connect command first");
    }

    String username = configuration.getString("CamelJolokiaUsername");

    JolokiaCamelController controller = getController();

    // ping to see if the connection works
    boolean ok = controller.ping();
    if (ok) {
        return Results.success("Connected to " + url + (username != null ? " using " + username : ""));
    } else {
        return Results.fail("Error connecting to " + url);
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:ConnectedCommand.java


示例13: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    String scheme = name.getValue();

    // maybe the connector has already been added to the catalog
    String json = camelCatalog.componentJSonSchema(scheme);
    if (json == null) {
        // discover classpath and find all the connectors and add them to the catalog
        Project project = getSelectedProjectOrNull(context.getUIContext());
        if (project != null) {
            discoverCustomCamelComponentsOnClasspathAndAddToCatalog(camelCatalog, project);
        }
        // load schema again
        json = camelCatalog.componentJSonSchema(scheme);
    }

    if (json != null) {
        return Results.success(json);
    } else {
        return Results.fail("Connector " + scheme + " not found");
    }
}
 
开发者ID:fabric8io,项目名称:django,代码行数:23,代码来源:ConnectorDetailsCommand.java


示例14: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    String text = labels.getValue();

    if (text != null && !text.isEmpty()) {
        dto.setLabels(text.split(","));
    } else {
        dto.setLabels(null);
    }

    // marshal DTO
    String json = toJson(dto);

    // write the connector json file
    FileResource<?> fileResource = getCamelConnectorFile(context);
    fileResource.setContents(json);

    return Results.success("Updated labels on Connector: " + dto.getName());
}
 
开发者ID:fabric8io,项目名称:django,代码行数:20,代码来源:EditConnectorLabelsCommand.java


示例15: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
   ConnectionProfileManager manager = managerProvider.getConnectionProfileManager();
   if (connectionProfile != null)
   {
      ConnectionProfile connection = manager.loadConnectionProfiles().get(connectionProfile.getValue());
      if (!connection.isSavePassword())
      {
         String password = connectionProfilePassword.getValue();
         if (password == null)
            password = "";
         connection.setPassword(password);
      }
      Project selectedProj = getSelectedProject(context);
      if (selectedProj.getFacet(DatabaseMigrationFacet.class).isInstalled())
         selectedProj.getFacet(DatabaseMigrationFacet.class).setPropertiesFile(connection);
   }
   return Results
            .success("Properties stored!");
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:22,代码来源:SetPropertiesCommand.java


示例16: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
   Project selectedProj = getSelectedProject(context);
   ChangeLogFileGenerator generator = new ChangeLogFileGenerator(selectedProj);

   String mode = generationMode.getValue();
   if (mode.equals(Constants.MODE_EMPTY_CHANGELOG))
   {
      generator.generateEmptyMasterChangeLog();
   }
   else
   {
      //generator.generateChangeLogFromDatabase();
   }
   return Results
            .success("Master ChangeLog File has been created");
}
 
开发者ID:forge,项目名称:db-migration-addon,代码行数:19,代码来源:GenerateMasterChangeLogFileCommand.java


示例17: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext executionContext) throws Exception
{
   UIProvider provider = executionContext.getUIContext().getProvider();
   UIOutput output = provider.getOutput();
   PrintStream out = output.out();
   for (FractionDescriptor fraction : WildFlySwarmFacet.getAllFractionDescriptors())
   {
      if (!fraction.isInternal())
      {
         String msg = String.format("%s: %s (%s)", fraction.getArtifactId(), fraction.getName(),
                  fraction.getDescription());
         out.println(msg);
      }
   }
   return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:18,代码来源:ListFractionsCommand.java


示例18: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
   Project project = getSelectedProject(context);
   UIOutput output = context.getUIContext().getProvider().getOutput();
   PackagingFacet packagingFacet = project.getFacet(PackagingFacet.class);
   try
   {
      packagingFacet.createBuilder().addArguments("wildfly-swarm:run").runTests(false).build(output.out(),
               output.err());
   }
   catch (BuildException ie)
   {
      if (!(ie.getCause() instanceof InterruptedException))
      {
         return Results.fail("Error while running the build", ie.getCause());
      }
   }
   return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:21,代码来源:RunCommand.java


示例19: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
   Project project = getSelectedProject(context);

   final DependencyFacet dependencyFacet = project.getFacet(DependencyFacet.class);
   if (!isArquillianWildflySwarmDependencyInstalled(dependencyFacet)) {
      installArquillianWildflySwarmDependency(dependencyFacet);
   }

   JavaClassSource test = Roaster.create(JavaClassSource.class)
           .setPackage(targetPackage.getValue())
           .setName(named.getValue());

   addArquillianRunner(test);
   addDefaultDeploymentAnnotation(test, project);
   addArquillianResourceEnricher(test);
   addTestMethod(test);

   JavaSourceFacet facet = project.getFacet(JavaSourceFacet.class);
   facet.saveTestJavaSource(test);

   return Results.success(String.format("Test Class %s.%s was created", targetPackage.getValue(), named.getValue()));
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:24,代码来源:CreateTestClassCommand.java


示例20: execute

import org.jboss.forge.addon.ui.result.Results; //导入依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception
{
    Project project = getSelectedProject(context);
    WildFlySwarmFacet facet = project.getFacet(WildFlySwarmFacet.class);
    if (fractionElements.hasValue())
    {
        List<FractionDescriptor> fractions = Lists.toList(fractionElements.getValue());
        facet.installFractions(fractions);
        List<String> artifactIds = fractions.stream().map(FractionDescriptor::getArtifactId)
                    .collect(Collectors.toList());
        return Results.success("Wildfly Swarm Fractions '"
                    + artifactIds
                    + "' were successfully added to the project descriptor");
    }
    return Results.success();
}
 
开发者ID:forge,项目名称:wildfly-swarm-addon,代码行数:18,代码来源:AddFractionCommand.java



注:本文中的org.jboss.forge.addon.ui.result.Results类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XYBlockRenderer类代码示例发布时间:2022-05-21
下一篇:
Java ValueFactory类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap