public final class DefaultProjectSuffixImpl extends AbstractProjectSuffixPluginHelper
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
DOI 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
Plugin name.
|
private Map<String,Integer> |
options
options for JDBC.
|
private static String |
OWNER
Plugin owner.
|
private static String |
VERSION
Plugin version.
|
Constructor and Description |
---|
DefaultProjectSuffixImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addProjectSuffix(int projectID,
String projectName)
Adds a suffix project in the database.
|
boolean |
deleteProject(int projectID)
Deletes a suffix project from the database.
|
List<DOIUser> |
getAllDOIUsersForProject(int doiSuffix)
Returns the users related to a project.
|
String |
getAuthor()
Returns the author of the plugin.
|
String |
getDescription()
Returns the description of the plugin
|
int |
getIDFrom(String projectName)
Returns the project suffix based on the project name.
|
String |
getLicense()
Returns the license of the plugin.
|
String |
getName()
Returns the name of the plugin.
|
String |
getOwner()
Returns the owner of the plugin.
|
String |
getProjectFrom(int projectID)
Returns the project name based on the suffix project.
|
List<DOIProject> |
getProjects()
Returns the database records.
|
List<DOIProject> |
getProjectsFromUser(String userName)
Returns the projects related to a specific user.
|
String |
getVersion()
Returns the version of the plugin.
|
void |
initConnection()
Inits the connection
|
boolean |
isConfigured()
Checks if the plugin is already configured
|
boolean |
isExistID(int projectID)
Tests is a suffix project exists in the database.
|
boolean |
isExistProjectName(String projectName)
Tests is the project name exists in the database.
|
static boolean |
isPassword(String key)
Checks if the keyword is a password.
|
void |
release()
Release the plugin.
|
boolean |
renameProject(int projectId,
String newProjectName)
Rename a project in the database.
|
void |
setConfiguration(Object configuration)
Sets the configuration.
|
StringBuilder |
validate()
Validates the parameters in the configuration file.
|
private static final org.apache.logging.log4j.Logger LOG
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 final String NAME
private DOIDbDataAccessService das
private boolean configured
public void setConfiguration(Object configuration)
configuration
- configuration parameterspublic void initConnection() throws DoiRuntimeException
PluginConfiguration
DoiRuntimeException
- When an connection error happenspublic boolean addProjectSuffix(int projectID, String projectName)
addProjectSuffix
in class AbstractProjectSuffixDBHelper
projectID
- suffix projectprojectName
- project namepublic boolean deleteProject(int projectID)
deleteProject
in class AbstractProjectSuffixDBHelper
projectID
- the suffix projectpublic boolean isExistID(int projectID)
isExistID
in class AbstractProjectSuffixDBHelper
projectID
- suffix projectpublic boolean isExistProjectName(String projectName)
isExistProjectName
in class AbstractProjectSuffixDBHelper
projectName
- the project namepublic String getProjectFrom(int projectID) throws DOIDbException
getProjectFrom
in class AbstractProjectSuffixDBHelper
projectID
- the suffix projectDOIDbException
- when an error occurspublic int getIDFrom(String projectName) throws DOIDbException
getIDFrom
in class AbstractProjectSuffixDBHelper
projectName
- the project nameDOIDbException
- When an error occurspublic List<DOIProject> getProjects() throws DOIDbException
getProjects
in class AbstractProjectSuffixDBHelper
DOIDbException
- When an error occurspublic List<DOIProject> getProjectsFromUser(String userName) throws DOIDbException
getProjectsFromUser
in class AbstractProjectSuffixDBHelper
userName
- usernameDOIDbException
- When an error occurspublic boolean renameProject(int projectId, String newProjectName)
renameProject
in class AbstractProjectSuffixDBHelper
projectId
- suffix project to be renamednewProjectName
- the new project namepublic String getName()
public String getDescription()
public String getVersion()
public String getAuthor()
public String getOwner()
public String getLicense()
public List<DOIUser> getAllDOIUsersForProject(int doiSuffix)
getAllDOIUsersForProject
in class AbstractProjectSuffixDBHelper
doiSuffix
- projectpublic StringBuilder validate()
public static boolean isPassword(String key)
key
- keyword to checkpublic void release()
public boolean isConfigured()
PluginConfiguration
Copyright © 2017–2020 CNES. All rights reserved.