Ametista Collector Controller

@RestController
@RequestMapping(value = "BASE_EQUINOX_ENDPOINT + APPLICATIONS_KEY + "/{" + APPLICATION_IDENTIFIER_KEY + "}"" )
open class AmetistaCollectorController : DefaultAmetistaController

The AmetistaCollectorController class is useful to manage all the collection operations requested by the Ametista-Engine

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@Autowired
private open var collectorHelper: CollectorHelper
collectorHelper helper to manage the collection operations
Link copied to clipboard
private val DEBUG_OPERATION_EXECUTED_SUCCESSFULLY: String = "debug_operation_executed_successfully_key"
DEBUG_OPERATION_EXECUTED_SUCCESSFULLY message sent when the collection request has been completed successfully
Link copied to clipboard
private val IS_DEBUG_MODE: String = "is_debug_mode"
IS_DEBUG_MODE whether the analytics sent by the Ametista-Engine must be counted
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
private val PLATFORM_ALREADY_CONNECTED: String = "platform_already_connected_key"
PLATFORM_ALREADY_CONNECTED error message used when the platform requested to connect is already connected
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
@PutMapping(path = ""/" + PERFORMANCE_ANALYTICS_KEY", params = [], headers = [] )
open fun collectAnalytic(@PathVariable(value = "application_id") applicationId: String, @RequestHeader(value = "server_secret") serverSecret: String, @RequestParam(value = "app_version") appVersion: String, @RequestParam(value = "platform") platform: Platform, @RequestParam(value = "performance_analytic_type") type: PerformanceAnalytic.PerformanceAnalyticType, @RequestParam(value = "is_debug_mode", defaultValue = "false", required = false) isDebugMode: Boolean, @RequestBody(required = false) payload: Map<String, String>): String
Method to collect an analytics for the application
Link copied to clipboard
@PutMapping(path = ""/" + ISSUES_KEY", params = [], headers = [] )
open fun collectIssue(@PathVariable(value = "application_id") applicationId: String, @RequestHeader(value = "server_secret") serverSecret: String, @RequestParam(value = "app_version") appVersion: String, @RequestParam(value = "platform") platform: Platform, @RequestParam(value = "is_debug_mode", defaultValue = "false", required = false) isDebugMode: Boolean, @RequestBody payload: Map<String, Any>): String
Method to collect a new issue for the application
Link copied to clipboard
@PutMapping(params = [], headers = [] )
open fun connectPlatform(@PathVariable(value = "application_id") applicationId: String, @RequestHeader(value = "server_secret") serverSecret: String, @RequestParam(value = "platform") platform: Platform): String
Method to connect a new platform for the application
Link copied to clipboard
protected open fun failedResponse(error: String): String
Link copied to clipboard
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
private open fun sendDebugRequestResponse(): String
Method to send the debug request response
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 validateCollectorRequest(applicationId: String, serverSecret: String): AmetistaApplication
Method to validate the collector request checking the server secret and the identifier of the application sent