com.atlassian.bamboo.plugins.rest.admin.globalvariable
Class RestGlobalVariableServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.plugins.rest.admin.globalvariable.RestGlobalVariableServiceImpl
All Implemented Interfaces:
RestGlobalVariableService

public class RestGlobalVariableServiceImpl
extends Object
implements RestGlobalVariableService

Since:
5.9

Field Summary
protected static int KEY_MAX_LENGTH
           
protected static int VALUE_MAX_LENGTH
           
 
Constructor Summary
RestGlobalVariableServiceImpl(VariableDefinitionManager variableDefinitionManager, VariableConfigurationService variableConfigurationService, com.atlassian.struts.TextProvider textProvider, RestPermissionCheck restPermissionCheck)
           
 
Method Summary
 RestGlobalVariable createGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, RestGlobalVariable restGlobalVariable)
          Create a global variable
 void deleteGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, long variableId)
          Delete a global variable
 RestGlobalVariable getGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, long variableId)
          Retrieve a global variable definition
 RestGlobalVariables getGlobalVariables(javax.ws.rs.core.UriInfo uriInfo)
          Retrieve all global variables and values on bamboo server Password variables will be encrypted using salted hash.
 RestGlobalVariable updateGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, long variableId, RestGlobalVariable restGlobalVariable)
          Update a global variable
 ErrorCollection validateVariable(RestGlobalVariable restGlobalVariable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_MAX_LENGTH

protected static final int VALUE_MAX_LENGTH
See Also:
Constant Field Values

KEY_MAX_LENGTH

protected static final int KEY_MAX_LENGTH
See Also:
Constant Field Values
Constructor Detail

RestGlobalVariableServiceImpl

public RestGlobalVariableServiceImpl(VariableDefinitionManager variableDefinitionManager,
                                     VariableConfigurationService variableConfigurationService,
                                     com.atlassian.struts.TextProvider textProvider,
                                     RestPermissionCheck restPermissionCheck)
Method Detail

getGlobalVariables

public RestGlobalVariables getGlobalVariables(javax.ws.rs.core.UriInfo uriInfo)
Description copied from interface: RestGlobalVariableService
Retrieve all global variables and values on bamboo server Password variables will be encrypted using salted hash.

Specified by:
getGlobalVariables in interface RestGlobalVariableService
Parameters:
uriInfo - Object that provides access to information of http request
Returns:
Collection of global variables
See Also:
for how encryption is performed

getGlobalVariable

public RestGlobalVariable getGlobalVariable(javax.ws.rs.core.UriInfo uriInfo,
                                            long variableId)
Description copied from interface: RestGlobalVariableService
Retrieve a global variable definition

Specified by:
getGlobalVariable in interface RestGlobalVariableService
Parameters:
uriInfo - Object that provides access to information of http
variableId - id fo the variable
Returns:
RestGlobalVariable object that contains name, value and link to the variable

createGlobalVariable

public RestGlobalVariable createGlobalVariable(javax.ws.rs.core.UriInfo uriInfo,
                                               RestGlobalVariable restGlobalVariable)
                                        throws WebValidationException
Description copied from interface: RestGlobalVariableService
Create a global variable

Specified by:
createGlobalVariable in interface RestGlobalVariableService
Parameters:
uriInfo - Object that provides access to information of http request
restGlobalVariable - The global variable to be created
Returns:
The created global variable
Throws:
WebValidationException - If some parameter is illegal, e.g. empty variable name, illegal characters in variable name, etc.

deleteGlobalVariable

public void deleteGlobalVariable(javax.ws.rs.core.UriInfo uriInfo,
                                 long variableId)
Description copied from interface: RestGlobalVariableService
Delete a global variable

Specified by:
deleteGlobalVariable in interface RestGlobalVariableService
Parameters:
uriInfo - Object that provides access to information of http request
variableId - Id of the variable to be removed

updateGlobalVariable

public RestGlobalVariable updateGlobalVariable(javax.ws.rs.core.UriInfo uriInfo,
                                               long variableId,
                                               RestGlobalVariable restGlobalVariable)
                                        throws WebValidationException
Description copied from interface: RestGlobalVariableService
Update a global variable

Specified by:
updateGlobalVariable in interface RestGlobalVariableService
Parameters:
uriInfo - Object that provides access to information of http request
variableId - Id of the variable to be updated
restGlobalVariable - New name/value of the global variable
Returns:
The updated variable
Throws:
WebValidationException - If the name/value is invalid, e.g. exceeds max value length

validateVariable

public ErrorCollection validateVariable(RestGlobalVariable restGlobalVariable)


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.