edu.ucsb.nceas.metacat.index

## Class MetacatSolrIndex

- java.lang.Object
- - edu.ucsb.nceas.metacat.index.MetacatSolrIndex

-     public class MetacatSolrIndex
      extends java.lang.Object

  This class will query the solr server and return the result.
  Author:
    tao

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MetacatSolrIndex` | `getInstance()`
    `java.io.InputStream` | `query(org.apache.solr.common.params.SolrParams solrParams, java.util.Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin)` Handle the query when the query is on the key/value format
    `java.io.InputStream` | `query(java.lang.String query, java.util.Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin)` Query the solr server
    `void` | `submit(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata systemMetadata, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> fields, boolean followRevisions)`
    `void` | `submitDeleteTask(org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysMeta)` Submit a deleting-index task

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static MetacatSolrIndex getInstance()
                                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### query

          public java.io.InputStream query(java.lang.String query,
                                           java.util.Set<org.dataone.service.types.v1.Subject> authorizedSubjects,
                                           boolean isMNadmin)
                                    throws org.apache.solr.client.solrj.SolrServerException,
                                           java.io.IOException,
                                           edu.ucsb.nceas.utilities.PropertyNotFoundException,
                                           java.sql.SQLException,
                                           java.lang.ClassNotFoundException,
                                           javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException,
                                           org.dataone.service.exceptions.NotImplemented,
                                           org.dataone.service.exceptions.NotFound,
                                           org.dataone.service.exceptions.UnsupportedType

      Query the solr server
      Parameters:
        `query` - the solr query
        `authorizedSubjects` - the authorized subjects in this query session
        `isMNadmin` - the indicator of the authorized subjects are the mn admin or not
      Returns:
        the result as the InputStream
      Throws:
        `org.apache.solr.client.solrj.SolrServerException`
        `java.lang.ClassNotFoundException`
        `java.sql.SQLException`
        `edu.ucsb.nceas.utilities.PropertyNotFoundException`
        `org.xml.sax.SAXException`
        `javax.xml.parsers.ParserConfigurationException`
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `java.io.IOException`

    - #### query

          public java.io.InputStream query(org.apache.solr.common.params.SolrParams solrParams,
                                           java.util.Set<org.dataone.service.types.v1.Subject> authorizedSubjects,
                                           boolean isMNadmin)
                                    throws org.apache.solr.client.solrj.SolrServerException,
                                           java.io.IOException,
                                           edu.ucsb.nceas.utilities.PropertyNotFoundException,
                                           java.sql.SQLException,
                                           java.lang.ClassNotFoundException,
                                           javax.xml.parsers.ParserConfigurationException,
                                           org.xml.sax.SAXException,
                                           org.dataone.service.exceptions.NotImplemented,
                                           org.dataone.service.exceptions.NotFound,
                                           org.dataone.service.exceptions.UnsupportedType

      Handle the query when the query is on the key/value format
      Parameters:
        `solrParams` - the query with the key/value format
        `authorizedSubjects` - the authorized subjects in this query session
        `isMNadmin` - the indicator of the authorized subjects are the mn admin or not
      Returns:
        the query result as the InputStream object
      Throws:
        `org.apache.solr.client.solrj.SolrServerException`
        `java.io.IOException`
        `edu.ucsb.nceas.utilities.PropertyNotFoundException`
        `java.sql.SQLException`
        `java.lang.ClassNotFoundException`
        `javax.xml.parsers.ParserConfigurationException`
        `org.xml.sax.SAXException`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.UnsupportedType`

    - #### submitDeleteTask

          public void submitDeleteTask(org.dataone.service.types.v1.Identifier pid,
                                       org.dataone.service.types.v2.SystemMetadata sysMeta)

      Submit a deleting-index task
      Parameters:
        `pid` - the pid's solr document will be deleted.

    - #### submit

          public void submit(org.dataone.service.types.v1.Identifier pid,
                             org.dataone.service.types.v2.SystemMetadata systemMetadata,
                             java.util.Map<java.lang.String,java.util.List<java.lang.Object>> fields,
                             boolean followRevisions)

Copyright © 2020 Regents of the University of California. All Rights Reserved.