Class XMLSurveyFinder

java.lang.Object
skyview.survey.XMLSurveyFinder
All Implemented Interfaces:
SurveyFinder

public class XMLSurveyFinder
extends java.lang.Object
implements SurveyFinder
This class provides functionality to translate survey names into associated survey description files.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  XMLSurveyFinder.SurveyLink  
  • Constructor Summary

    Constructors 
    Constructor Description
    XMLSurveyFinder()
    Set up the SurveyFinder and populate the map.
    XMLSurveyFinder​(boolean dump)  
  • Method Summary

    Modifier and Type Method Description
    void dump()
    Create a cached translation between survey names and files.
    Survey find​(java.lang.String shortName)
    Do we have this survey?
    java.lang.String findFile​(java.lang.String shortName)
    Find the survey file given the short name
    java.lang.String[] getSurveys()
    What surveys do we know about?
    protected void getSurveysFromMainifest()
    Get surveys from a user manifest.
    protected void getSurveysFromManifest​(boolean dump)  
    protected void getSurveysFromRoot()
    Get the surveys in the document root area
    protected void getSurveysFromUser()
    Get user specified surveys
    protected boolean loadSurveyCacheFromFile​(java.lang.String hashFile)  
    protected boolean loadSurveyCacheFromUrl​(java.lang.String url)  
    protected java.lang.String localCacheName()
    Get path to the local cache using the path to the jar file being executed.
    static void main​(java.lang.String[] args)
    Main class.
    protected java.lang.String manifestName()  
    protected void manifestToHash()
    Read XML files to populate survey hash in memory.
    void read​(java.lang.String file)  
    protected java.lang.String remoteCacheName()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XMLSurveyFinder

      public XMLSurveyFinder()
      Set up the SurveyFinder and populate the map. Overloaded to pass a flag for whether the context is simply to dump the survey manifest.
    • XMLSurveyFinder

      public XMLSurveyFinder​(boolean dump)
  • Method Details

    • dump

      public void dump()
      Create a cached translation between survey names and files. This can be used to save a little time when running SkyView. Note that the hash that is written was already created in the XMLSurveyFinder constructor above.
    • read

      public void read​(java.lang.String file)
    • getSurveysFromRoot

      protected void getSurveysFromRoot()
      Get the surveys in the document root area
    • getSurveysFromUser

      protected void getSurveysFromUser()
      Get user specified surveys
    • getSurveysFromMainifest

      protected void getSurveysFromMainifest()
      Get surveys from a user manifest. This is how SkyView-in-a-Jar gets its surveys. Result is that the XMLSurveyFinder's hash object is filled. Overloaded for case of dump
    • getSurveysFromManifest

      protected void getSurveysFromManifest​(boolean dump)
    • localCacheName

      protected java.lang.String localCacheName()
      Get path to the local cache using the path to the jar file being executed.
    • remoteCacheName

      protected java.lang.String remoteCacheName()
    • manifestName

      protected java.lang.String manifestName()
    • manifestToHash

      protected void manifestToHash()
      Read XML files to populate survey hash in memory.
    • loadSurveyCacheFromUrl

      protected boolean loadSurveyCacheFromUrl​(java.lang.String url)
    • loadSurveyCacheFromFile

      protected boolean loadSurveyCacheFromFile​(java.lang.String hashFile)
    • find

      public Survey find​(java.lang.String shortName)
      Do we have this survey?
      Specified by:
      find in interface SurveyFinder
    • findFile

      public java.lang.String findFile​(java.lang.String shortName)
      Find the survey file given the short name
    • getSurveys

      public java.lang.String[] getSurveys()
      What surveys do we know about?
      Specified by:
      getSurveys in interface SurveyFinder
    • main

      public static void main​(java.lang.String[] args)
      Main class.
      With no arguments simply list all of the survey names.
      With the single argument "dump": Create a cached names file that can be used to speed up the initialization.
      With any other single argument: show the metadata for the selected survey
      With multiple arguments survey metakey1 [metakey2...] show the requested metadata for the requested survey