Package jmri.server.json
Class JsonDeleteTokenManager
java.lang.Object
jmri.server.json.JsonDeleteTokenManager
class JsonDeleteTokenManager extends Object
Manager for deletion tokens in the JSON protocols. This is a separate manager
to be able to support the RESTful API where the connection where a token is
generated may be broken before the client's deletion request containing the
token is sent.
Note this is package private and is not part of a committed to API.
- Since:
- 4.15.6
-
Constructor Summary
Constructors Constructor Description JsonDeleteTokenManager()
-
Method Summary
Modifier and Type Method Description (package private) boolean
acceptToken(String type, String name, String token)
Accept a token.(package private) static JsonDeleteTokenManager
getDefault()
Use this method to access the default instance.(package private) String
getToken(String type, String name)
Generate a token to allow deletion following the rejection of a deletion request.
-
Constructor Details
-
Method Details
-
getDefault
Use this method to access the default instance. This ensures that public API does not need to be exposed forInstanceManagerAutoDefault
to function.- Returns:
- the default instance
-
acceptToken
Accept a token. If the token is not valid, any valid token is also invalidated.- Parameters:
type
- the type of the object to deletename
- the name of the object to deletetoken
- the token to test- Returns:
- true if the token was accepted; false otherwise
-
getToken
Generate a token to allow deletion following the rejection of a deletion request.- Parameters:
type
- the type of the object to deletename
- the name of the object to delete- Returns:
- the token to use to confirm a deletion should be accepted
-