Package jmri.server.json
Class JsonDeleteTokenManager
java.lang.Object
jmri.server.json.JsonDeleteTokenManager
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 -
Method Summary
Modifier and TypeMethodDescription(package private) booleanacceptToken(String type, String name, String token) Accept a token.(package private) static JsonDeleteTokenManagerUse this method to access the default instance.(package private) StringGenerate a token to allow deletion following the rejection of a deletion request.
-
Constructor Details
-
JsonDeleteTokenManager
-
-
Method Details
-
getDefault
Use this method to access the default instance. This ensures that public API does not need to be exposed forInstanceManagerAutoDefaultto 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
-