Class CompareMetadataStage

  • All Implemented Interfaces:
    Stage

    public class CompareMetadataStage
    extends java.lang.Object
    implements Stage
    Validation stage for checking that two sets of table metadata (presumably obtained via different routes) are equivalent to each other.
    Since:
    7 Jun 2011
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean compatibleDataTypes​(java.lang.String dt1, java.lang.String dt2)
      Indicates whether two datatypes are compatible with each other.
      static CompareMetadataStage createStage​(TableMetadataStage stage1, TableMetadataStage stage2)
      Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.
      java.lang.String getDescription()
      Returns a short one-line description of this stage.
      void run​(Reporter reporter, uk.ac.starlink.vo.TapService tapService)
      Performs the validation checks for this stage.
      static java.lang.String stripAdqlType​(java.lang.String dtype)
      Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.
      • Methods inherited from class java.lang.Object

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

      • CompareMetadataStage

        public CompareMetadataStage​(java.lang.String srcDesc1,
                                    java.lang.String srcDesc2,
                                    MetadataHolder metaHolder1,
                                    MetadataHolder metaHolder2)
        Constructor.
        Parameters:
        srcDesc1 - short description of source of first metadata set
        srcDesc2 - short description of source of second metadata set
        metaHolder1 - supplies first metadata set at comparison time
        metaHolder2 - supplies second metadata set at comparison time
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Stage
        Returns a short one-line description of this stage.
        Specified by:
        getDescription in interface Stage
        Returns:
        description in imperative mood
      • run

        public void run​(Reporter reporter,
                        uk.ac.starlink.vo.TapService tapService)
        Description copied from interface: Stage
        Performs the validation checks for this stage.
        Specified by:
        run in interface Stage
        Parameters:
        reporter - destination for validation messages
        tapService - TAP service description
      • compatibleDataTypes

        public static boolean compatibleDataTypes​(java.lang.String dt1,
                                                  java.lang.String dt2)
        Indicates whether two datatypes are compatible with each other. Datatypes may be either VOTable or TAP/adql type. See VODataService v1.1 section 3.5.3 and TAP v1.0 section 2.5. The logic is somewhat sloppy.

        Note however that, as clarified by TAP 1.0 Erratum #3, TAP/ADQL has no type system, so any comparison involving the types listed in TAP v1.0 section 2.5 cannot be normative. So any report issued on failure of this test should only be a Warning and not an Error.

        Parameters:
        dt1 - first data type
        dt2 - second data type
        Returns:
        true iff it looks like the submitted types are compatible
      • stripAdqlType

        public static java.lang.String stripAdqlType​(java.lang.String dtype)
        Takes a string which may be an ADQL type and strips off confusing parts including any "adql:" prefix and trailing parenthesis.
        Parameters:
        dtype - string which may be an ADQL datatype
        Returns:
        base ADQL data type if appropriate, else input string
      • createStage

        public static CompareMetadataStage createStage​(TableMetadataStage stage1,
                                                       TableMetadataStage stage2)
        Utility method to construct a CompareMetadataStage instance given two TableMetadataStage objects.
        Parameters:
        stage1 - first metadata producing stage
        stage2 - second metadata producing stage
        Returns:
        comparison stage