public boolean isDatasetUseable ( InvDataset ds , StringBuilder sbuff ) { boolean ok = true ; sbuff . append ( "Dataset " + ds . getName ( ) + " id = " + ds . getID ( ) + ": " ) ; if ( ! ds . isHarvest ( ) ) { ok = false ; sbuff . append ( "Dataset " + ds . getName ( ) + " id = " + ds . getID ( ) + " has harvest = false\n" ) ; } if ( ds . getName ( ) == null ) { ok = false ; sbuff . append ( " missing Name field\n" ) ; } if ( ds . getUniqueID ( ) == null ) { ok = false ; sbuff . append ( " missing ID field\n" ) ; } ThreddsMetadata . Variables vs = ds . getVariables ( "DIF" ) ; if ( ( vs == null ) || ( vs . getVariableList ( ) . size ( ) == 0 ) ) vs = ds . getVariables ( "GRIB-1" ) ; if ( ( vs == null ) || ( vs . getVariableList ( ) . size ( ) == 0 ) ) vs = ds . getVariables ( "GRIB-2" ) ; if ( ( vs == null ) || ( vs . getVariableList ( ) . size ( ) == 0 ) ) { ok = false ; sbuff . append ( " missing Variables with DIF or GRIB compatible vocabulary\n" ) ; } List list = ds . getPublishers ( ) ; if ( ( list == null ) || ( list . size ( ) == 0 ) ) { ok = false ; sbuff . append ( " must have publisher element that defines the data center\n" ) ; } String summary = ds . getDocumentation ( "summary" ) ; if ( summary == null ) { ok = false ; sbuff . append ( " must have documentation element of type summary\n" ) ; } sbuff . append ( " useable= " + ok + "\n" ) ; return ok ; }
See if a dataset is harvestable to a DIF record .