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 Modifier and Type Field Description protected static int
KEY_MAX_LENGTH
-
Constructor Summary
Constructors Constructor Description RestGlobalVariableServiceImpl(com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestGlobalVariable
createGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, RestGlobalVariable restGlobalVariable)
Create a global variablevoid
deleteGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, long variableId)
Delete a global variableRestGlobalVariable
getGlobalVariable(javax.ws.rs.core.UriInfo uriInfo, long variableId)
Retrieve a global variable definitionRestGlobalVariables
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 variableErrorCollection
validateVariable(RestGlobalVariable restGlobalVariable)
javax.ws.rs.core.Response
verifyGlobalVariableValue(RestVerificationRequest request)
Server side verification that the encrypted value of a global variable has changed.
-
-
-
Field Detail
-
KEY_MAX_LENGTH
protected static final int KEY_MAX_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RestGlobalVariableServiceImpl
@Autowired public RestGlobalVariableServiceImpl(com.atlassian.sal.api.message.I18nResolver i18nResolver, RestPermissionCheck restPermissionCheck, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager)
-
-
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 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
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 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
public ErrorCollection validateVariable(RestGlobalVariable restGlobalVariable)
-
verifyGlobalVariableValue
public javax.ws.rs.core.Response verifyGlobalVariableValue(RestVerificationRequest request)
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
-
-