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)` Use the default GET method to handle the query when the query is on the key/value format
    `java.io.InputStream` | `query(org.apache.solr.common.params.SolrParams solrParams, java.util.Set<org.dataone.service.types.v1.Subject> authorizedSubjects, boolean isMNadmin, org.apache.solr.client.solrj.SolrRequest.METHOD method)` 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, boolean isSysmetaChangeOnly, java.util.Map<java.lang.String,java.util.List<java.lang.Object>> fields, boolean followRevisions)`
    `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)` Submit the index task to the index queue
    `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,
                                           org.apache.solr.common.SolrException

      Query the solr server
      Parameters:
        `query` - the solr query string
        `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`
        `org.apache.solr.common.SolrException`

    - #### 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

      Use the default GET method to 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
        `method` - the method such as GET, POST and et al will be used in the query
      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`

    - #### 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,
                                           org.apache.solr.client.solrj.SolrRequest.METHOD method)
                                    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
        `method` - the method such as GET, POST and et al will be used in the query
      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)

      Submit the index task to the index queue
      Parameters:
        `pid` - the pid will be indexed
        `systemMetadata` - the system metadata associated with the pid
        `fields` - extra fields which need to be indexed
        `followRevisions` - .. if the obsoleted version will be indexed

    - #### submit

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

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