public final class DefaultTokenImpl extends AbstractTokenDBPluginHelper
Modifier and Type | Field and Description |
---|---|
private static String |
AUTHOR
Plugin author.
|
private Map<String,String> |
conf
Configuration file.
|
private boolean |
configured
Status of the plugin configuration.
|
private DOIDbDataAccessService |
das
Database access.
|
private static String |
DESCRIPTION
Plugin description.
|
private static String |
LICENSE
Plugin license.
|
private static org.apache.logging.log4j.Logger |
LOG
Logger.
|
private String |
NAME
Name of the class.
|
private Map<String,Integer> |
options
Options for JDBC.
|
private static String |
OWNER
Plugin owner.
|
private static String |
VERSION
Plugin version.
|
Constructor and Description |
---|
DefaultTokenImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addToken(String jwt)
Adds a token in the database
|
boolean |
deleteToken(String jwt)
Deletes a token from the database.
|
String |
getAuthor()
Returns the author of the plugin.
|
String |
getDescription()
Returns the description of the plugin
|
String |
getLicense()
Returns the license of the plugin.
|
String |
getName()
Returns the name of the plugin.
|
String |
getOwner()
Returns the owner of the plugin.
|
List<String> |
getTokens()
Return the token list from database.
|
String |
getVersion()
Returns the version of the plugin.
|
void |
initConnection()
Inits the connection
|
boolean |
isConfigured()
Checks if the plugin is already configured
|
boolean |
isExist(String jwt)
Tests if the token exists in the database.
|
static boolean |
isPassword(String key)
Checks if the keyword is a password.
|
void |
release()
Release the plugin.
|
void |
setConfiguration(Object configuration)
Sets the configuration.
|
StringBuilder |
validate()
Validates the parameters in the configuration file.
|
private static final String DESCRIPTION
private static final String VERSION
private static final String OWNER
private static final String AUTHOR
private static final String LICENSE
private static final org.apache.logging.log4j.Logger LOG
private final String NAME
private DOIDbDataAccessService das
private boolean configured
public void setConfiguration(Object configuration)
configuration
- configuration parameterspublic void initConnection() throws DoiRuntimeException
DoiRuntimeException
- When an connection error happenspublic boolean addToken(String jwt)
addToken
in class AbstractTokenDBHelper
jwt
- a tokenpublic boolean deleteToken(String jwt)
deleteToken
in class AbstractTokenDBHelper
jwt
- the tokenpublic boolean isExist(String jwt)
isExist
in class AbstractTokenDBHelper
jwt
- the tokenpublic List<String> getTokens() throws DOIDbException
getTokens
in class AbstractTokenDBHelper
DOIDbException
- when an error occurspublic String getName()
public String getDescription()
public String getVersion()
public String getAuthor()
public String getOwner()
public String getLicense()
public StringBuilder validate()
public static boolean isPassword(String key)
key
- keyword to checkpublic void release()
public boolean isConfigured()
Copyright © 2017–2020 CNES. All rights reserved.