Package tethys.dbxml

Class DBXMLQueries

java.lang.Object
tethys.dbxml.DBXMLQueries

public class DBXMLQueries extends Object
Some standard queries we're going to want to make from various parts of the system as the user interacts with the GUI.
Author:
dg50
  • Constructor Details

  • Method Details

    • executeQuery

      public DBQueryResult executeQuery(String jsonQueryString) throws TethysQueryException
      Execute a DBXML query. Returns an object which included the time taken to execute the query and either a returned Document or an Exception. Or will return null if the server is not connected
      Parameters:
      jsonQueryString -
      Returns:
      query result
      Throws:
      TethysQueryException
    • getCollectionDocumentList

      public ArrayList<DocumentInfo> getCollectionDocumentList(Collection collection)
      Get a list of all documents in a collection.
      Parameters:
      collection -
      Returns:
      list of all documents in a collection, or null if no collection.
    • getProjectNames

      public ArrayList<String> getProjectNames()
      Get a list of project names.
      Returns:
    • getProjectDeployments

      public ArrayList<nilus.Deployment> getProjectDeployments(String projectName, String instrumentId)
      Get project deployments that use a specific instrument id. More use than the call without this extra clause since it can handle overlapping deployments.
      Parameters:
      projectName -
      instrumentId -
      Returns:
    • getProjectDeployments

      public ArrayList<nilus.Deployment> getProjectDeployments(String projectName)
      Get some basic (not all) data for deployments associated with a project. Note that this may include deployments which are NOT part of the current dataset. That requires a search on Instrument as well.
      Parameters:
      projectName -
      Returns:
    • getDetectionsDocuments

      public ArrayList<String> getDetectionsDocuments(PamDataBlock dataBlock, String deploymentId)
      Get a list of Detections documents which associate with a datablock and a deploymentId.
      Parameters:
      dataBlock -
      deploymentId - can be null to get all docs for data block
      Returns:
    • getLocalizationDocuments

      public ArrayList<String> getLocalizationDocuments(PamDataBlock dataBlock, String deploymentId)
      Get a list of Localization documents which associate with a datablock and a deploymentId.
      Parameters:
      dataBlock -
      deploymentId - can be null to get all docs for data block
      Returns:
    • getDeploymentDocuments

      public ArrayList<String> getDeploymentDocuments(Collection collection, String deploymentId)
      Get the names of all the detection or localisation documents for a given deployment id.
      Parameters:
      collection - Localizations or Detetections
      deploymentId - Deployment document id.
      Returns:
    • getDetectionsDocuments

      public ArrayList<String> getDetectionsDocuments(String deploymentId)
      Get the names of all detection documents for a given deployment for all data streams.
      Parameters:
      deploymentId -
      Returns:
    • getLocalizationsDocuments

      public ArrayList<String> getLocalizationsDocuments(String deploymentId)
      Get the names of all localisation documents for a given deployment for all data streams.
      Parameters:
      deploymentId -
      Returns:
    • countData

      public int countData(PamDataBlock dataBlock, String deploymentId)
    • getDocument

      public String getDocument(String collection, String documentId)
    • documentExists

      public boolean documentExists(String collection, String documentId)
      Find out if a document exists ?
      Parameters:
      collection -
      documentId -
      Returns:
    • countDetections2

      public int countDetections2(String docName)
      Count on effort detections in a Detections document
      Parameters:
      docName -
      Returns:
    • countLocalizations2

      public int countLocalizations2(String docName)
      Count on effort detections in a Detections document
      Parameters:
      docName -
      Returns:
    • getElementData

      public String getElementData(Element root, String elName)
    • getElementAttribute

      public String getElementAttribute(Element root, String elName, String attribute)
    • convertStringToXMLDocument

      public Document convertStringToXMLDocument(String xmlString)
    • getDetectionsDocInfo

      public nilus.Detections getDetectionsDocInfo(String detectionsDocName)
      Get the basic information about a Detections document. This is basically everything apart from the actual detections themselves.
      Parameters:
      aDoc -
      Returns:
    • getLocalizationDocInfo

      public nilus.Localize getLocalizationDocInfo(String locDocName)
      Get the basic information about a Detections document. This is basically everything apart from the actual detections themselves.
      Parameters:
      aDoc -
      Returns: