Applications Controller

@RestController
@RequestMapping(value = "BASE_EQUINOX_ENDPOINT + USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + APPLICATIONS_KEY" )
open class ApplicationsController : DefaultAmetistaController

The ApplicationsController class is useful to manage all the applications operations

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@Autowired
private open var applicationsHelper: ApplicationsHelper
applicationsHelper helper to manage the applications database operations
Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
protected val mantis: Mantis
Link copied to clipboard
protected open var me: T
Link copied to clipboard
Link copied to clipboard
open var resourcesProvider: ResourcesProvider
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully_key"
Link copied to clipboard
protected open var serverProtector: ServerProtector
Link copied to clipboard
protected open var usersRepository: R
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure_key"

Functions

Link copied to clipboard
@PostMapping(headers = [] )
open fun addApplication(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @ModelAttribute application: ApplicationsHelper.ApplicationPayload): String
Method to save and add in the system a new application
Link copied to clipboard
@DeleteMapping(path = "{" + APPLICATION_IDENTIFIER_KEY + "}", headers = [] )
open fun deleteApplication(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String): String
Method to delete an existing application
Link copied to clipboard
@PostMapping(path = "{" + APPLICATION_IDENTIFIER_KEY + "}", headers = [] )
open fun editApplication(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String, @ModelAttribute application: ApplicationsHelper.ApplicationPayload): String
Method to edit an existing application
Link copied to clipboard
protected open fun failedResponse(error: String): String
Link copied to clipboard
Link copied to clipboard
@GetMapping(path = "{" + APPLICATION_IDENTIFIER_KEY + "}", headers = [] )
open fun <T> getApplication(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String): T
Method to get an existing application
Link copied to clipboard
@GetMapping(headers = [] )
open fun <T> getApplications(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @RequestParam(name = "page", defaultValue = "0", required = false) page: Int, @RequestParam(name = "page_size", defaultValue = "10", required = false) pageSize: Int, @RequestParam(name = "name", defaultValue = "", required = false) name: String, @RequestParam(name = "platforms", defaultValue = "", required = false) platforms: List<String>): T
Method to get the applications list registered in the system
Link copied to clipboard
@GetMapping(path = ""{" + APPLICATION_IDENTIFIER_KEY + "}/" + ISSUES_KEY", headers = [] )
open fun <T> getIssues(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String, @RequestParam(name = "platform") platform: Platform, @RequestParam(name = "page", defaultValue = "0", required = false) page: Int, @RequestParam(name = "page_size", defaultValue = "10", required = false) pageSize: Int, @RequestParam(name = "filters", defaultValue = "", required = false) filters: Set<String>): T
Method to get the issues related to an application
Link copied to clipboard
@PostMapping(path = ""{" + APPLICATION_IDENTIFIER_KEY + "}/" + PERFORMANCES_KEY", headers = [] )
open fun <T> getPerformanceData(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String, @RequestParam(name = "platform") platform: Platform, @RequestBody payload: Map<String, Any>): T
Method to get the performance data of an application
Link copied to clipboard
@GetMapping(path = ""{" + APPLICATION_IDENTIFIER_KEY + "}/" + VERSION_FILTERS_KEY", headers = [] )
open fun <T> getVersionSamples(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "application_id") applicationId: String, @RequestParam(name = "platform") platform: Platform, @RequestParam(name = "performance_analytic_type") analyticType: PerformanceAnalytic.PerformanceAnalyticType): T
Method to get all the available versions target for a specific analytic
Link copied to clipboard
open fun initEquinoxEnvironment(storagePath: String, saveMessage: String, context: Class<out Any>, args: Array<String>, customSubDirectories: Array<String>)
Link copied to clipboard
protected open fun isAdmin(userId: String, token: String): Boolean
Method to get whether the user who request to execute an action is a ADMIN
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Link copied to clipboard
protected open fun isViewer(userId: String, token: String): Boolean
Method to get whether the user who request to execute an action is a VIEWER
Link copied to clipboard
protected open fun <V> loadJsonHelper(payload: Map<String, V>)
Link copied to clipboard
protected open fun successResponse(): String
protected open fun <V> successResponse(value: V): HashMap<String, V>
Link copied to clipboard
private open fun userAllowedAndApplicationExists(userId: String, token: String, applicationId: String): Boolean
Method to check if the user is allowed to operate (him/she is an ADMIN) and the application exists
Link copied to clipboard
Method to validate the payload used in the addApplication or editApplication operations
Link copied to clipboard
private open fun validateUserAndFetchApplication(userId: String, token: String, applicationId: String): AmetistaApplication
Method to check if the user is allowed to operate (him/she is an ADMIN) and the application exists