com.sonyericsson.hudson.plugins.metadata.cli
Class CliUtils

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.metadata.cli.CliUtils

public abstract class CliUtils
extends Object

Common utility functions for the CLI commands.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Nested Class Summary
static class CliUtils.NoItemException
          Exception thrown when the user has selected something that doesn't exist.
static class CliUtils.NoMetadataException
          Exception thrown when a user has selected something that doesn't have any metadata.
static class CliUtils.Status
          Status codes to be returned from the cli commands.
 
Method Summary
static MetadataContainer<MetadataValue> getContainer(String node, String job, Integer build, boolean createContainer)
          Finds the container that has been selected on the commandline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContainer

public static MetadataContainer<MetadataValue> getContainer(String node,
                                                            String job,
                                                            Integer build,
                                                            boolean createContainer)
                                                     throws org.kohsuke.args4j.CmdLineException,
                                                            CliUtils.NoItemException,
                                                            CliUtils.NoMetadataException,
                                                            IOException
Finds the container that has been selected on the commandline.

Parameters:
node - the node parameter.
job - the job parameter
build - the build parameter
createContainer - create the container when it doesn't exist instead of failing, if the specified item doesn't exist it will still fail..
Returns:
the container if one is found.
Throws:
org.kohsuke.args4j.CmdLineException - if the combination of arguments are bad.
CliUtils.NoItemException - if the requested item (node, job or build) couldn't be found.
CliUtils.NoMetadataException - if the item doesn't contain any metadata.
IOException - if a metadata container needed to be added and it failed to do so.


Copyright © 2004-2013. All Rights Reserved.