com.atlassian.bamboo.v2.build.agent.capability
Class CapabilityHelperImpl

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.agent.capability.CapabilityHelperImpl
All Implemented Interfaces:
CapabilityHelper

public class CapabilityHelperImpl
extends java.lang.Object
implements CapabilityHelper

Class that helps the display and configuration of capabilities and requirements


Field Summary
protected  java.util.Map<java.lang.String,CapabilityType> builtinCapabilityTypes
           
 
Constructor Summary
CapabilityHelperImpl(com.atlassian.plugin.PluginAccessor pluginAccessor)
           
 
Method Summary
 com.opensymphony.webwork.dispatcher.json.JSONObject buildCapabilityJsonObject(Capability capability)
          Build JSON object from capability.
 java.lang.String getCapabilityExtraInfo(java.lang.String key)
          tries to figure out the extra information of a capability based on the key.
 java.lang.String getCapabilityLabel(java.lang.String key)
          Tries to figure out the capability Label.
 java.lang.String getCapabilityTabForKey(java.lang.String key)
          Get the jquery represnetation of the capability to pick the correct tab to navigate to.
 java.lang.String getCapabilityType(java.lang.String key)
          The key of the type of capability e.g.
 CapabilityType getCapabilityTypeFromKey(java.lang.String key)
          get capability Type object from capability key.
 CapabilityType getCapabilityTypeFromTypeString(java.lang.String capabilityTypeKey)
           
 java.util.List<CapabilityType> getCapabilityTypes()
           
 java.util.Collection<BuilderCapabilityDescriptor> getFilteredBuildersFromTypeString(java.lang.String capabilityTypeKey, java.lang.String capabilityPrefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builtinCapabilityTypes

protected final java.util.Map<java.lang.String,CapabilityType> builtinCapabilityTypes
Constructor Detail

CapabilityHelperImpl

public CapabilityHelperImpl(com.atlassian.plugin.PluginAccessor pluginAccessor)
Method Detail

buildCapabilityJsonObject

@NotNull
public com.opensymphony.webwork.dispatcher.json.JSONObject buildCapabilityJsonObject(@NotNull
                                                                                             Capability capability)
                                                                              throws com.opensymphony.webwork.dispatcher.json.JSONException
Build JSON object from capability.

Specified by:
buildCapabilityJsonObject in interface CapabilityHelper
Parameters:
capability - Capability
Returns:
JSON object
Throws:
com.opensymphony.webwork.dispatcher.json.JSONException - When an error occurs during creation of JSON object

getCapabilityTypeFromTypeString

@Nullable
public CapabilityType getCapabilityTypeFromTypeString(java.lang.String capabilityTypeKey)
Specified by:
getCapabilityTypeFromTypeString in interface CapabilityHelper

getFilteredBuildersFromTypeString

public java.util.Collection<BuilderCapabilityDescriptor> getFilteredBuildersFromTypeString(java.lang.String capabilityTypeKey,
                                                                                           java.lang.String capabilityPrefix)
Specified by:
getFilteredBuildersFromTypeString in interface CapabilityHelper

getCapabilityTypeFromKey

@NotNull
public CapabilityType getCapabilityTypeFromKey(java.lang.String key)
Description copied from interface: CapabilityHelper
get capability Type object from capability key. e.g. Jdk, Builder, Generic (for custom)

Specified by:
getCapabilityTypeFromKey in interface CapabilityHelper
Parameters:
key - of the capability
Returns:
capbilty type for the given key

getCapabilityType

public java.lang.String getCapabilityType(java.lang.String key)
Description copied from interface: CapabilityHelper
The key of the type of capability e.g. "jdk"

Specified by:
getCapabilityType in interface CapabilityHelper
Parameters:
key - of the capability
Returns:
key representing the capability type

getCapabilityLabel

@NotNull
public java.lang.String getCapabilityLabel(java.lang.String key)
Tries to figure out the capability Label. If it fails it will return the original key.

Specified by:
getCapabilityLabel in interface CapabilityHelper
Parameters:
key - to find the label for
Returns:
the label for the capability (or the original passed in key, if it fails)

getCapabilityExtraInfo

@Nullable
public java.lang.String getCapabilityExtraInfo(java.lang.String key)
tries to figure out the extra information of a capability based on the key. If it fails it returns null.

Specified by:
getCapabilityExtraInfo in interface CapabilityHelper
Parameters:
key - of the capability
Returns:
the extra information (pretty) for that capability.

getCapabilityTabForKey

public java.lang.String getCapabilityTabForKey(java.lang.String key)
Get the jquery represnetation of the capability to pick the correct tab to navigate to.

Specified by:
getCapabilityTabForKey in interface CapabilityHelper
Parameters:
key - to replace (usually the Label of the capability)
Returns:
jquery representation of the key.

getCapabilityTypes

public java.util.List<CapabilityType> getCapabilityTypes()
Specified by:
getCapabilityTypes in interface CapabilityHelper
Returns:
a list of all selectable capability types.


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.