Default Equinox Controller

The DefaultEquinoxController class is useful to give the base behavior of the Equinox's controllers with the default EquinoxUser class and for a greater clarity during your own implementation:



    
    public SomeCustomController extends EquinoxController<EquinoxUser> {
         // rest of the class
    }

    
    public SomeCustomControllerTwo extends EquinoxController<EquinoxUser> {
         // rest of the class
    }

    // wrap the declaration for a better readability
    
    public SomeCustomController extends DefaultEquinoxController {
         // rest of the class
    }

     // wrap the declaration for a better readability
    
    public SomeCustomControllerTwo extends DefaultEquinoxController {
         // rest of the class
    }

Author

N7ghtm4r3 - Tecknobit

Since

1.0.2

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected open var jsonHelper: JsonHelper
jsonHelper helper to work with JSON values
Link copied to clipboard
protected val mantis: Mantis
mantis the translations manager
Link copied to clipboard
protected open var me: T
me user representing the user who made a request on the server
Link copied to clipboard
val NOT_AUTHORIZED_OR_WRONG_DETAILS_MESSAGE: String = "not_authorized_key"
NOT_AUTHORIZED_OR_WRONG_DETAILS_MESSAGE message to use when the request is by a not authorized user or tried to fetch wrong details
Link copied to clipboard
resourcesProvider the resources provider and manager
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully_key"
RESPONSE_SUCCESSFUL_MESSAGE message to use when the request has been successful
Link copied to clipboard
protected open var serverProtector: ServerProtector
protector the instance to launch the server protector to manage the server accesses
Link copied to clipboard
@Autowired(required = false )
protected open var usersRepository: R
usersRepository instance for the user repository
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure_key"
WRONG_PROCEDURE_MESSAGE message to use when the procedure is wrong

Functions

Link copied to clipboard
protected open fun failedResponse(error: String): String
Method to get the payload for a failed response
Link copied to clipboard
Method to generate an identifier of an item No-any params required
Link copied to clipboard
open fun initEquinoxEnvironment(storagePath: String, saveMessage: String, context: Class<out Any>, args: Array<String>, customSubDirectories: Array<String>)
Method to init the serverProtector and create the resources directories correctly
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Method to check whether the user who made a request is an authorized user If the user is authorized the me instance is loaded
Link copied to clipboard
protected open fun loadJsonHelper(payload: String)
protected open fun <V> loadJsonHelper(payload: Map<String, V>)
Method to load the jsonHelper
Link copied to clipboard
protected open fun successResponse(): String
Method to get the payload for a successful response No-any params required
protected open fun <V> successResponse(value: V): HashMap<String, V>
protected open fun successResponse(message: JSONObject): String
Method to get the payload for a successful response