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


Java Results.success方法代码示例

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


在下文中一共展示了Results.success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: execute

import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    File instanceFile = getFile(project, instancePath.getValue());
    File schemaFile = new File(
            instanceFile.getParentFile(), instanceFile.getName() + XSD_EXT);
    File targetPath = new File(
            project.getRoot().getChild("src/main/java").getFullyQualifiedName());

    XmlModelGenerator xmlGen = new XmlModelGenerator();
    JCodeModel model = xmlGen.generateFromInstance(
            instanceFile,
            schemaFile, packageName.getValue(), targetPath);

    addGeneratedTypes(project, model);
    return Results.success("Model classes created for " + instancePath.getValue());
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:18,代码来源:ModelFromXMLCommand.java

示例12: execute

import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    MapperContext mapCtx = getMapperContext(project);
    CamelConfigBuilder camelConfig = CamelConfigBuilder.loadConfig(
            getFile(project, CAMEL_CTX_PATH));
    
    camelConfig.addTransformation(mapCtx.getTransformId(),
            mapCtx.getDozerPath(),
            TransformType.valueOf(mapCtx.getSourceType()), 
            mapCtx.getSourceModel().getType(),
            TransformType.valueOf(mapCtx.getTargetType()),
            mapCtx.getTargetModel().getType());
    
    FileOutputStream fos = new FileOutputStream(getFile(project, CAMEL_CTX_PATH));
    camelConfig.saveConfig(fos);
    fos.close();
    return Results.success();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:20,代码来源:ConfigureCamelStep.java

示例13: execute

import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    // Create configuration
    getMapperContext(project).setDozerPath(dozerConfig.getValue());
    MapperConfiguration config = loadConfig(project);
    config.addClassMapping(sourceModel.getValue(), targetModel.getValue());

    // Load models into mapper context
    getMapperContext(project).setSourceModel(loadModel(project, sourceModel.getValue()));
    getMapperContext(project).setTargetModel(loadModel(project, targetModel.getValue()));

    // Save on our way out
    saveConfig(project);
    return Results.success("Created mapping configuration.");
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:17,代码来源:CreateMappingCommand.java

示例14: execute

import org.jboss.forge.addon.ui.result.Results; //导入方法依赖的package包/类
@Override
public Result execute(UIExecutionContext context) throws Exception {
    Project project = getSelectedProject(context);
    File schemaFile = getFile(project, schemaPath.getValue());
    URL jsonSchemaUrl = schemaFile.toURI().toURL();
    File targetPath = new File(project.getRoot().getChild("src/main/java").getFullyQualifiedName());

    JsonModelGenerator modelGen = new JsonModelGenerator();

    JCodeModel model = modelGen.generateFromSchema(
            className.getValue(), packageName.getValue(), jsonSchemaUrl, targetPath);

    addGeneratedTypes(project, model);

    return Results.success("Model classes created for " + schemaPath.getValue());
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:17,代码来源:ModelFromJSONSchemaCommand.java

示例15: execute

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

    griffonFacet = griffonVersion.getValue();

    FrameworkTypes frameworkTypeValue = frameworkType.getValue();
    LanguageTypes languageTypeValue = languageType.getValue();

    griffonFacet.setLanguage(languageTypeValue);
    griffonFacet.setFramework(frameworkTypeValue);

    if (facetFactory.install(getSelectedProject(context.getUIContext()), griffonFacet)) {
        return Results.success(properties.getMessage("plugin.install.success"));
    }

    return Results.fail(properties.getMessage("plugin.install.failure"));
}
 
开发者ID:jughyd,项目名称:griffon-forge-addon,代码行数:18,代码来源:SetupCommand.java


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