Package edu.ucsb.nceas.metacat.admin
Class SolrAdmin
java.lang.Object
edu.ucsb.nceas.metacat.admin.MetacatAdmin
edu.ucsb.nceas.metacat.admin.SolrAdmin
Control the display of the Solr configuration page and the processing
of the configuration values.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class edu.ucsb.nceas.metacat.admin.MetacatAdmin
COMPLETE, FAILURE, IN_PROGRESS, NOT_REQUIRED, PENDING, SUCCESS
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkSolrStatus
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Check the current solr status - such as if the solr core/solr-home directory exists, and send back actions which user can choose based on the status.void
configureSolr
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle configuration of the solr the first time that Metacat starts or when it is explicitly called.static SolrAdmin
Get the single instance of SolrDAdmin.Get a list of db versions in which the solr db hasn't been upgradedGet the map of upgrade classes should be run in the upgrade.protected void
handleWarningActions
(String action, javax.servlet.http.HttpServletRequest request, Vector<String> processingErrors) Method to handle a warning message in the request, which have user's response.protected static boolean
Check if the db is a fresh installation.protected void
processResponse
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Process the user's choices to the solr serverprotected static void
updateSolrStatus
(String version, boolean status) Update the solr_upgraded status for the given metacat versionvalidateOptions
(javax.servlet.http.HttpServletRequest request) Validate the most important configuration options submitted by the user.Methods inherited from class edu.ucsb.nceas.metacat.admin.MetacatAdmin
updateUpgradeStatus
-
Field Details
-
CREATE
- See Also:
-
REGISTER
- See Also:
-
REGISTERANDUPDATE
- See Also:
-
CREATEWITHWARN
- See Also:
-
CREATEORUPDATEWITHWARN
- See Also:
-
REGISTERWITHWARN
- See Also:
-
REGISTERANDUPDATEWITHWARN
- See Also:
-
KEEP
- See Also:
-
UPDATE
- See Also:
-
UNKNOWN
- See Also:
-
ACTION
- See Also:
-
CURRENTCOREINSTANCEDIR
- See Also:
-
NEWSOLRCOREORNOT
- See Also:
-
NEWSOLRCORE
- See Also:
-
EXISTINGCORE
- See Also:
-
SOLRCORENAME
- See Also:
-
NEWSOLCORENAME
- See Also:
-
-
Method Details
-
getInstance
Get the single instance of SolrDAdmin.- Returns:
- the single instance of SolrAdmin
- Throws:
AdminException
-
configureSolr
public void configureSolr(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AdminException Handle configuration of the solr the first time that Metacat starts or when it is explicitly called. Collect necessary update information from the administrator.- Parameters:
request
- the http request informationresponse
- the http response to be sent back to the client- Throws:
AdminException
-
checkSolrStatus
protected void checkSolrStatus(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AdminException Check the current solr status - such as if the solr core/solr-home directory exists, and send back actions which user can choose based on the status.- Parameters:
request
- the request from the clientresponse
- the response which will be sent back to the client- Throws:
AdminException
-
processResponse
protected void processResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AdminException Process the user's choices to the solr server- Parameters:
request
- the request from the clientresponse
- the response which will be sent back to the client- Throws:
AdminException
-
handleWarningActions
protected void handleWarningActions(String action, javax.servlet.http.HttpServletRequest request, Vector<String> processingErrors) throws edu.ucsb.nceas.utilities.GeneralPropertyException, AdminException, org.dataone.service.exceptions.UnsupportedType, ParserConfigurationException, IOException, SAXException, org.apache.solr.client.solrj.SolrServerException, ServiceException, edu.ucsb.nceas.utilities.UtilException Method to handle a warning message in the request, which have user's response.- Parameters:
action
- the action needs to be handledrequest
- the request from the clientprocessingErrors
- the vector to store error message- Throws:
edu.ucsb.nceas.utilities.GeneralPropertyException
AdminException
org.dataone.service.exceptions.UnsupportedType
ParserConfigurationException
IOException
SAXException
org.apache.solr.client.solrj.SolrServerException
ServiceException
edu.ucsb.nceas.utilities.UtilException
-
validateOptions
Validate the most important configuration options submitted by the user.- Specified by:
validateOptions
in classMetacatAdmin
- Returns:
- a vector holding error message for any fields that fail validation.
-
getSolrUpdateClasses
protected static Map<String,String> getSolrUpdateClasses() throws SQLException, edu.ucsb.nceas.utilities.PropertyNotFoundExceptionGet the map of upgrade classes should be run in the upgrade. If this is a fresh installation, no classes will be added to it. The key of map is the db version and the value is the update class.- Returns:
- the map of upgrade classes. An empty map will be return if nothing is found.
- Throws:
SQLException
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
getNonUpgradedSolrVersions
protected static Vector<DBVersion> getNonUpgradedSolrVersions() throws SQLException, edu.ucsb.nceas.utilities.PropertyNotFoundExceptionGet a list of db versions in which the solr db hasn't been upgraded- Returns:
- the list of db versions in which the solr db hasn't been upgraded. An empty vector will be returned if nothing was found.
- Throws:
SQLException
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
isFreshInstall
Check if the db is a fresh installation. If the db_version has only one row, we consider it a fresh installation.- Returns:
- ture if it is; otherwise false.
- Throws:
SQLException
-
updateSolrStatus
Update the solr_upgraded status for the given metacat version- Parameters:
version
- the version of Metacat will be updated in the db_version table.status
- the status will be applied.- Throws:
SQLException
-