Class DatasetConfig


  • public class DatasetConfig
    extends Object
    A class representing a dataset in the XML config. This contains all of the information needed to define a Dataset. It also contains methods for storing state information about the loading process.
    Author:
    Guy Griffiths
    • Constructor Detail

      • DatasetConfig

        public DatasetConfig()
    • Method Detail

      • needsRefresh

        public boolean needsRefresh()
      • forceRefresh

        public void forceRefresh()
        Forces this dataset to be refreshed the next time it has an opportunity
      • getId

        public String getId()
        Returns:
        The ID of the Dataset being configured
      • getLocation

        public String getLocation()
        Returns:
        The location (on disk/network/internet) of the Dataset being configured
      • getTitle

        public String getTitle()
      • isQueryable

        public boolean isQueryable()
        Returns:
        Whether the Dataset being configured may have its values queried
      • isDownloadable

        public boolean isDownloadable()
        Returns:
        Whether the Dataset being configured may have its values downloaded
      • isDisabled

        public boolean isDisabled()
        Returns:
        Whether the Dataset being configured is enabled
      • getUpdateInterval

        public int getUpdateInterval()
        Returns:
        How often, in minutes the Dataset should be updated (i.e. have metadata re-read in case of changes)
      • getDataReaderClass

        public String getDataReaderClass()
        Returns:
        The class used to convert the location given in getLocation() to a Dataset
      • getCopyrightStatement

        public String getCopyrightStatement()
        Returns:
        A copyright statement associated with this Dataset
      • getMoreInfo

        public String getMoreInfo()
        Returns:
        Arbitrary additional information associated with this Dataset
      • getMetadataUrl

        public String getMetadataUrl()
        Returns:
        A URL containing further metadata associated with this Dataset
      • getMetadataDesc

        public String getMetadataDesc()
        Returns:
        A description of further metadata associated with this Dataset
      • getMetadataMimetype

        public String getMetadataMimetype()
        Returns:
        The mimetype of further metadata associated with this Dataset
      • getVariableById

        public VariableConfig getVariableById​(String variableId)
        Returns:
        The VariableConfig objects representing the variables with the given ID in the represented Dataset, or null if the specified variable ID doesn't exist
      • getLoadingProgress

        public List<String> getLoadingProgress()
        Returns:
        A List of Strings representing the completed stages of the dataset loading
      • isReady

        public boolean isReady()
        Returns:
        true if this dataset is ready for use
      • isLoading

        public boolean isLoading()
        Returns:
        true if this dataset is not ready because it is being loaded
      • hasError

        public boolean hasError()
        Returns:
        If there has been an error whilst loaded the associated Dataset
      • getException

        public Throwable getException()
        Returns:
        Any Exception which was thrown during the loading of the associated Dataset
      • setId

        public void setId​(String id)
      • setTitle

        public void setTitle​(String title)
      • setLocation

        public void setLocation​(String location)
      • setQueryable

        public void setQueryable​(boolean queryable)
      • setDownloadable

        public void setDownloadable​(boolean downloadable)
      • setDataReaderClass

        public void setDataReaderClass​(String dataReaderClass)
      • setCopyrightStatement

        public void setCopyrightStatement​(String copyrightStatement)
      • setMoreInfo

        public void setMoreInfo​(String moreInfo)
      • setDisabled

        public void setDisabled​(boolean disabled)
      • setUpdateInterval

        public void setUpdateInterval​(int updateInterval)
      • setMetadataUrl

        public void setMetadataUrl​(String metadataUrl)
      • setMetadataDesc

        public void setMetadataDesc​(String metadataDesc)
      • setMetadataMimetype

        public void setMetadataMimetype​(String metadataMimetype)
      • setErr

        public void setErr​(Exception err)
      • setNumErrorsInARow

        public void setNumErrorsInARow​(int numErrorsInARow)
      • setLoadingProgress

        public void setLoadingProgress​(List<String> loadingProgress)
      • getLastUpdateTime

        public org.joda.time.DateTime getLastUpdateTime()
      • setLastSuccessfulUpdateTime

        public void setLastSuccessfulUpdateTime​(org.joda.time.DateTime lastSuccessfulUpdateTime)
      • setLastFailedUpdateTime

        public void setLastFailedUpdateTime​(org.joda.time.DateTime lastFailedUpdateTime)