Class RestGlobalVariableServiceImpl
java.lang.Object
com.atlassian.bamboo.plugins.rest.admin.globalvariable.RestGlobalVariableServiceImpl
- All Implemented Interfaces:
RestGlobalVariableService
@Component
public class RestGlobalVariableServiceImpl
extends Object
implements RestGlobalVariableService
Service layer to manage build concurrency
- Since:
- 5.9
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestGlobalVariableServiceImpl
(com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateGlobalVariable
(javax.ws.rs.core.UriInfo uriInfo, RestGlobalVariable restGlobalVariable) Create a global variablevoid
deleteGlobalVariable
(javax.ws.rs.core.UriInfo uriInfo, long variableId) Delete a global variablegetGlobalVariable
(javax.ws.rs.core.UriInfo uriInfo, long variableId) Retrieve a global variable definitiongetGlobalVariables
(javax.ws.rs.core.UriInfo uriInfo) Retrieve all global variables and values on bamboo server Password variables will be encrypted using salted hash.updateGlobalVariable
(javax.ws.rs.core.UriInfo uriInfo, long variableId, RestGlobalVariable restGlobalVariable) Update a global variablevalidateVariable
(RestGlobalVariable restGlobalVariable) javax.ws.rs.core.Response
Server side verification that the encrypted value of a global variable has changed.
-
Field Details
-
KEY_MAX_LENGTH
protected static final int KEY_MAX_LENGTH- See Also:
-
-
Constructor Details
-
RestGlobalVariableServiceImpl
@Autowired public RestGlobalVariableServiceImpl(com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager)
-
-
Method Details
-
getGlobalVariables
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 interfaceRestGlobalVariableService
- Parameters:
uriInfo
- Object that provides access to information of http request- Returns:
- Collection of global variables
- See Also:
-
for how encryption is performed
-
getGlobalVariable
Description copied from interface:RestGlobalVariableService
Retrieve a global variable definition- Specified by:
getGlobalVariable
in interfaceRestGlobalVariableService
- Parameters:
uriInfo
- Object that provides access to information of httpvariableId
- 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 interfaceRestGlobalVariableService
- Parameters:
uriInfo
- Object that provides access to information of http requestrestGlobalVariable
- 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 interfaceRestGlobalVariableService
- Parameters:
uriInfo
- Object that provides access to information of http requestvariableId
- 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 interfaceRestGlobalVariableService
- Parameters:
uriInfo
- Object that provides access to information of http requestvariableId
- Id of the variable to be updatedrestGlobalVariable
- 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
-
verifyGlobalVariableValue
Description copied from interface:RestGlobalVariableService
Server side verification that the encrypted value of a global variable has changed.- Specified by:
verifyGlobalVariableValue
in interfaceRestGlobalVariableService
- Parameters:
request
- variable name and encrypted value to check- Returns:
- response
-