本文整理匯總了Java中org.axway.grapes.utils.client.GrapesClient類的典型用法代碼示例。如果您正苦於以下問題:Java GrapesClient類的具體用法?Java GrapesClient怎麽用?Java GrapesClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GrapesClient類屬於org.axway.grapes.utils.client包,在下文中一共展示了GrapesClient類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: NotificationHandler
import org.axway.grapes.utils.client.GrapesClient; //導入依賴的package包/類
public NotificationHandler(final GrapesConfig config) {
client = new GrapesClient(config.getHost(), String.valueOf(config.getPort()));
if (config.getPublisherCredentials() != null) {
user = config.getPublisherCredentials().getUsername();
password = config.getPublisherCredentials().getPassword();
}
}
示例2: doTestConnection
import org.axway.grapes.utils.client.GrapesClient; //導入依賴的package包/類
/**
* Performs on-the-fly validation of the form field 'credentials'.
*
* @param host String
* @param port String
* @param timeout String
* @return
*/
public FormValidation doTestConnection(@QueryParameter final String host, @QueryParameter final String port, @QueryParameter final String timeout) {
final GrapesClient client = new GrapesClient(host, port);
if (client.isServerAvailable()) {
return FormValidation.ok("Success.");
}
else {
return FormValidation.warning("Server not reachable!");
}
}
示例3: GrapesBuildAction
import org.axway.grapes.utils.client.GrapesClient; //導入依賴的package包/類
/**
* Initiate the report
*
* @param module Module
* @param grapesClient GrapesClient
*/
public GrapesBuildAction(final Module module, final GrapesClient grapesClient) {
if(grapesClient == null ||
module == null ){
return;
}
title = "Dependency report of " + module.getName() + " in version " + module.getVersion();
// Init the report with Grapes server information
try{
final Organization organization = grapesClient.getModuleOrganization(module.getName(), module.getVersion());
final List<String> corporateFilters = organization.getCorporateGroupIdPrefixes();
dependencies = new HashMap<Dependency, String>();
final List<Dependency> moduleDependencies = ModuleUtils.getCorporateDependencies(module, corporateFilters);
for(Dependency dependency: moduleDependencies){
final String lastVersion = getLastVersion(grapesClient, dependency);
this.dependencies.put(dependency, lastVersion);
}
thirdParty = ModuleUtils.getThirdPartyLibraries(module, corporateFilters);
ancestors = grapesClient.getModuleAncestors(module.getName(), module.getVersion());
initOk = true;
} catch (Exception e){
GrapesPlugin.getLogger().log(Level.WARNING, "Failed to generate build dependency report for " + module.getName(), e);
}
}
示例4: getLastVersion
import org.axway.grapes.utils.client.GrapesClient; //導入依賴的package包/類
/**
* Returns the last version of a dependency
*
*
* @param grapesClient
* @param dependency Dependency
* @return String
*/
public String getLastVersion(final GrapesClient grapesClient, final Dependency dependency){
final Logger logger = LogManager.getLogManager().getLogger("hudson.WebAppMain");
try{
final Artifact target = dependency.getTarget();
return grapesClient.getArtifactLastVersion(target.getGavc());
} catch (GrapesCommunicationException e) {
logger.info("Failed to get last version of : " + dependency.getTarget().getGavc());
}
return "";
}
示例5: execute
import org.axway.grapes.utils.client.GrapesClient; //導入依賴的package包/類
public void execute() throws MojoExecutionException {
if (isExecuteSkipped()) {
return;
}
// Execute only one time
if(project.equals(reactorProjects.get(0))){
try {
final File workingFolder = GrapesMavenPlugin.getGrapesPluginWorkingFolder(reactorProjects.get(0));
final Module rootModule = GrapesMavenPlugin.getModule(workingFolder, GrapesMavenPlugin.MODULE_JSON_FILE_NAME);
getLog().info("Sending " + rootModule.getName() + "...");
getLog().info("Connection to Grapes");
getLog().info("Host: " + host);
getLog().info("Port: " + port);
getLog().info("User: " + user);
final GrapesClient client = new GrapesClient(host, port);
if(!client.isServerAvailable()){
throw new MojoExecutionException("Grapes is unreachable");
}
client.postModule(rootModule, user, password);
getLog().info("Information successfully sent");
} catch (Exception e) {
if(failOnError){
throw new MojoExecutionException("An error occurred during Grapes server Notification." , e);
}
else{
getLog().debug("An error occurred during Grapes server Notification.", e);
getLog().info("Failed to send information to Grapes");
}
}
}
}