Package thredds.catalog

Examples of thredds.catalog.InvDatasetImpl


    parentDsUrl1 = "http://server/parentDatasetUrl1";
    parentDsUrl2 = "http://server/parentDatasetUrl2";
    parentDsUrl3 = "http://server/ParentDatasetUrl3";

    parentDs1 = new InvDatasetImpl( null, parentDsName1);
    parentDs1.setUrlPath( parentDsUrl1);
    parentDs2 = new InvDatasetImpl( null, parentDsName2);
    parentDs2.setUrlPath( parentDsUrl2);
    parentDs3 = new InvDatasetImpl( null, parentDsName3);
    parentDs3.setUrlPath( parentDsUrl3);

    name1 = "name 1";
    name2 = "name 2";
View Full Code Here


    String namerName = "Eta Namer";
    String namerMatchPattern = "([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])_eta_211.nc$";
    String namerSubstitutionPattern = "NCEP Eta $1-$2-$3 $4:00:00 GMT";
    String dsName = "NCEP Eta 2004-05-08 12:00:00 GMT";

    InvDatasetImpl dsParent = new InvDatasetImpl( null, parentDsName );
    InvDatasetImpl ds = new InvDatasetImpl( null, null, null, null, dsUrlPath );
    DatasetNamer dsNamer = new DatasetNamer( dsParent, namerName, true, DatasetNamerType.REGULAR_EXPRESSION,
                            namerMatchPattern, namerSubstitutionPattern,
                            null, null );
    assertTrue( "Namer <" + dsNamer.getName() + "> failed to name dataset <urlPath=" + ds.getUrlPath() + ">",
                dsNamer.nameDataset( ds));
    assertTrue( "Dataset name <" + ds.getName() + "> does not match expected <" + dsName + ">.",
                ds.getName().equals( dsName ));

    //       DatasetNamer( InvDataset parentDs,
    //                   String name, boolean addLevel, DatasetNamerType type,
    //                   String matchPattern, String substitutePattern,
    //                   String attribContainer, String attribName)
View Full Code Here

            RegExpAndDurationTimeCoverageEnhancer
                    .getInstanceToMatchOnDatasetName(
                            matchPattern, substitutionPattern, duration );
    assertTrue( timeCoverageEnhancer != null );

    InvDatasetImpl ds = new InvDatasetImpl( null, dsName );
    CrawlableDataset crDs = new MockCrawlableDataset( dsName, false );

    assertTrue( "Failed to add metadata.",
                timeCoverageEnhancer.addMetadata( ds, crDs ));
  }
View Full Code Here

            RegExpAndDurationTimeCoverageEnhancer
                    .getInstanceToMatchOnDatasetName(
                            matchPattern, substitutionPattern, duration );
    assertTrue( timeCoverageEnhancer != null );

    InvDatasetImpl ds = new InvDatasetImpl( null, dsName );
    CrawlableDataset crDs = new MockCrawlableDataset( dsName, false );

    assertTrue( "Unexpected success adding metadata.",
                ! timeCoverageEnhancer.addMetadata( ds, crDs ));
  }
View Full Code Here

            RegExpAndDurationTimeCoverageEnhancer
                    .getInstanceToMatchOnDatasetPath(
                            matchPattern, substitutionPattern, duration );
    assertTrue( timeCoverageEnhancer != null );

    InvDatasetImpl ds = new InvDatasetImpl( null, dsName );
    CrawlableDataset crDs = new MockCrawlableDataset( dsName, false );

    assertTrue( "Failed to add metadata.",
                timeCoverageEnhancer.addMetadata( ds, crDs ) );

    // This dataset hasn't been finalized so ds.getTimeCoverage() doesn't work.
    String startDateString = ds.getLocalMetadata().getTimeCoverage().getStart().getText();
    String expectedStartDateString = "2009-06-03T03";
    assertTrue( "TimeCoverage start date [" + startDateString + "] not as expected [" + expectedStartDateString + "].",
                startDateString.equals( expectedStartDateString ));
  }
View Full Code Here

    String matchPattern = "([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])";
    String substitutionPattern = "$1-$2-$3T$4:00:00";
    String duration = "60 hours";

    DatasetEnhancer1.DatasetMetadataAdder adder = new DatasetEnhancer1.AddTimeCoverageModels( matchPattern, substitutionPattern, duration);
    InvDatasetImpl dataset = new InvDatasetImpl( null, "2005061512_NAM.wmo" );
    adder.addMetadata( dataset);

    String expectedDateText = "2005-06-15T12:00:00";
    String dateText = dataset.getTimeCoverage().getStart().getText();
    assertTrue( "Date text <" + dateText + "> not as expected <" + expectedDateText + ">.",
                dateText.equals( expectedDateText ) );
  }
View Full Code Here

  }

  public void testAddId()
  {
    DatasetEnhancer1.DatasetMetadataAdder adder = new DatasetEnhancer1.AddId( "baseId" );
    InvDatasetImpl dataset = new InvDatasetImpl( null, "2005061512_NAM.wmo" );
    adder.addMetadata( dataset );

    String expectedId = "baseId/2005061512_NAM.wmo";
    String id = dataset.getID();
    assertTrue( "ID <" + id + "> not as expected <" + expectedId + ">.",
                id.equals( expectedId ) );
  }
View Full Code Here

  {
    name = "service name";
    base = "http://www.unidata.ucar.edu/";
    suffix = "suffix";
    type = ServiceType.getType( "DODS");
    parent = new InvDatasetImpl( null, "parent dataset");

    accessPointHeader1 = "access point header1";
    accessPointHeader2 = "access point header2";

    me = new ResultService( name, type, base, suffix, accessPointHeader1 );
View Full Code Here

   */
  public boolean nameDatasetList(java.util.List datasetList)
          throws java.lang.Exception {
    boolean returnValue = false;

    InvDatasetImpl curDataset = null;
    for (int i = 0; i < datasetList.size(); i++) {
      curDataset = (InvDatasetImpl) datasetList.get(i);
      returnValue &= this.nameDataset(curDataset);
    }
    return (returnValue);
View Full Code Here

    }

    InvCatalogFactory fac = InvCatalogFactory.getDefaultFactory( false );
    InvCatalogImpl cat = fac.readXML( catAsString.toString(), catURI );

    InvDatasetImpl ds = (InvDatasetImpl) cat.getDatasets().get( 0 );
    double d = ds.getDataSize();

    fac.writeXML(cat, System.out);
    assertTrue( "Size of data <" + d + "> not as expected <" + sizeBytes + ">.", Misc.closeEnough(d, sizeBytes));
  }
View Full Code Here

TOP

Related Classes of thredds.catalog.InvDatasetImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.