/** * Munge this catalog so the given dataset is the top catalog. * * @param ds make this top; must be existing dataset in this catalog. * * @deprecated in favor of thredds.catalog.util.DeepCopyUtils.subsetCatalogOnDataset */ public void subset(InvDataset ds) { InvDatasetImpl dataset = (InvDatasetImpl) ds; // Make all inherited metadata local. dataset.transferMetadata(dataset, true); topDataset = dataset; datasets.clear(); // throw away the rest datasets.add(topDataset); // parent lookups need to be local //InvService service = dataset.getServiceDefault(); //if (service != null) LOOK // dataset.serviceName = service.getName(); dataset.dataType = dataset.getDataType(); // all properties need to be local // LOOK dataset.setPropertiesLocal( new ArrayList(dataset.getProperties())); // next part requires this before it dataset.setCatalog(this); dataset.parent = null; // any referenced services need to be local List<InvService> services = new ArrayList<InvService>(dataset.getServicesLocal()); findServices(services, dataset); dataset.setServicesLocal(services); finish(); }
/** * Munge this catalog so the given dataset is the top catalog. * * @param ds make this top; must be existing dataset in this catalog. * * @deprecated in favor of thredds.catalog.util.DeepCopyUtils.subsetCatalogOnDataset */ public void subset(InvDataset ds) { InvDatasetImpl dataset = (InvDatasetImpl) ds; // Make all inherited metadata local. dataset.transferMetadata(dataset, true); topDataset = dataset; datasets.clear(); // throw away the rest datasets.add(topDataset); // parent lookups need to be local //InvService service = dataset.getServiceDefault(); //if (service != null) LOOK // dataset.serviceName = service.getName(); dataset.dataType = dataset.getDataType(); // all properties need to be local // LOOK dataset.setPropertiesLocal( new ArrayList(dataset.getProperties())); // next part requires this before it dataset.setCatalog(this); dataset.parent = null; // any referenced services need to be local List<InvService> services = new ArrayList<InvService>(dataset.getServicesLocal()); findServices(services, dataset); dataset.setServicesLocal(services); finish(); }
/** * Munge this catalog so the given dataset is the top catalog. * * @param ds make this top; must be existing dataset in this catalog. * * @deprecated in favor of thredds.catalog.util.DeepCopyUtils.subsetCatalogOnDataset */ public void subset(InvDataset ds) { InvDatasetImpl dataset = (InvDatasetImpl) ds; // Make all inherited metadata local. dataset.transferMetadata(dataset, true); topDataset = dataset; datasets.clear(); // throw away the rest datasets.add(topDataset); // parent lookups need to be local //InvService service = dataset.getServiceDefault(); //if (service != null) LOOK // dataset.serviceName = service.getName(); dataset.dataType = dataset.getDataType(); // all properties need to be local // LOOK dataset.setPropertiesLocal( new ArrayList(dataset.getProperties())); // next part requires this before it dataset.setCatalog(this); dataset.parent = null; // any referenced services need to be local List<InvService> services = new ArrayList<InvService>(dataset.getServicesLocal()); findServices(services, dataset); dataset.setServicesLocal(services); finish(); }
private void addTopLevelMetadata( InvCatalog catalog, boolean isRegularCatalog ) { if ( this.topLevelMetadataContainer == null ) return; if ( ! catalogLevel.getPath().equals( currentLevel.getPath() ) ) return; // Transfer all metadata from given metadata container to the top // InvDataset. This propagates any public metadata from the given // metadata container to all generated catalogs. InvDatasetImpl topInvDs = (InvDatasetImpl) catalog.getDataset(); topInvDs.transferMetadata( this.topLevelMetadataContainer, true ); // LOOK experimental datasetScan may have its own access elements for ( Iterator it = this.topLevelMetadataContainer.getAccess().iterator(); it.hasNext(); ) { InvAccess invAccess = (InvAccess) it.next(); topInvDs.addAccess( invAccess ); InvService s = invAccess.getService(); ( (InvCatalogImpl) catalog ).addService( s ); } // If this is a collection level scan, set some special attributes // that transferMetadata() doesn't transfer. boolean isCollectionLevel = catalogLevel.getPath().equals( collectionLevel.getPath() ); if ( isCollectionLevel && isRegularCatalog ) { topInvDs.setHarvest( this.topLevelMetadataContainer.isHarvest() ); topInvDs.setCollectionType( this.topLevelMetadataContainer.getCollectionType() ); } // Finish catalog. ( (InvCatalogImpl) catalog ).finish(); }
private void addTopLevelMetadata( InvCatalog catalog, boolean isRegularCatalog ) { if ( this.topLevelMetadataContainer == null ) return; if ( ! catalogLevel.getPath().equals( currentLevel.getPath() ) ) return; // Transfer all metadata from given metadata container to the top // InvDataset. This propagates any public metadata from the given // metadata container to all generated catalogs. InvDatasetImpl topInvDs = (InvDatasetImpl) catalog.getDataset(); topInvDs.transferMetadata( this.topLevelMetadataContainer, true ); // LOOK experimental datasetScan may have its own access elements for ( Iterator it = this.topLevelMetadataContainer.getAccess().iterator(); it.hasNext(); ) { InvAccess invAccess = (InvAccess) it.next(); topInvDs.addAccess( invAccess ); InvService s = invAccess.getService(); ( (InvCatalogImpl) catalog ).addService( s ); } // If this is a collection level scan, set some special attributes // that transferMetadata() doesn't transfer. boolean isCollectionLevel = catalogLevel.getPath().equals( collectionLevel.getPath() ); if ( isCollectionLevel && isRegularCatalog ) { topInvDs.setHarvest( this.topLevelMetadataContainer.isHarvest() ); topInvDs.setCollectionType( this.topLevelMetadataContainer.getCollectionType() ); } // Finish catalog. ( (InvCatalogImpl) catalog ).finish(); }
private void addTopLevelMetadata( InvCatalog catalog, boolean isRegularCatalog ) { if ( this.topLevelMetadataContainer == null ) return; if ( ! catalogLevel.getPath().equals( currentLevel.getPath() ) ) return; // Transfer all metadata from given metadata container to the top // InvDataset. This propagates any public metadata from the given // metadata container to all generated catalogs. InvDatasetImpl topInvDs = (InvDatasetImpl) catalog.getDataset(); topInvDs.transferMetadata( this.topLevelMetadataContainer, true ); // LOOK experimental datasetScan may have its own access elements for ( Iterator it = this.topLevelMetadataContainer.getAccess().iterator(); it.hasNext(); ) { InvAccess invAccess = (InvAccess) it.next(); topInvDs.addAccess( invAccess ); InvService s = invAccess.getService(); ( (InvCatalogImpl) catalog ).addService( s ); } // If this is a collection level scan, set some special attributes // that transferMetadata() doesn't transfer. boolean isCollectionLevel = catalogLevel.getPath().equals( collectionLevel.getPath() ); if ( isCollectionLevel && isRegularCatalog ) { topInvDs.setHarvest( this.topLevelMetadataContainer.isHarvest() ); topInvDs.setCollectionType( this.topLevelMetadataContainer.getCollectionType() ); } // Finish catalog. ( (InvCatalogImpl) catalog ).finish(); }
private InvCatalogImpl makeCatalogRuns(URI baseURI) throws IOException { if ((catalogRuns == null) || checkIfChanged()) { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); URI myURI = baseURI.resolve( getCatalogHref(RUNS)); InvCatalogImpl runCatalog = new InvCatalogImpl( getFullName(), parent.getVersion(), myURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata( (InvDatasetImpl) this.getParent(), true ); // make all inherited metadata local top.setName(TITLE_RUNS); runCatalog.addDataset(top); // any referenced services need to be local List<InvService> services = new ArrayList<InvService>( getServicesLocal()); InvService service = getServiceDefault(); if ((service != null) && !services.contains(service)) runCatalog.addService(service); for (InvDatasetImpl ds : makeRunDatasets()) { top.addDataset(ds); } runCatalog.finish(); this.catalogRuns = runCatalog; } return catalogRuns; }
private InvCatalogImpl makeCatalogForecasts(URI baseURI) throws IOException { if ((catalogForecasts == null) || checkIfChanged()){ InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); URI myURI = baseURI.resolve( getCatalogHref(FORECAST)); InvCatalogImpl foreCatalog = new InvCatalogImpl( getFullName(), parent.getVersion(), myURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata( (InvDatasetImpl) this.getParent(), true ); // make all inherited metadata local top.setName(TITLE_FORECAST); foreCatalog.addDataset(top); // any referenced services need to be local List<InvService> services = getServicesLocal(); InvService service = getServiceDefault(); if ((service != null) && !services.contains(service)) foreCatalog.addService(service); for (InvDatasetImpl ds : makeForecastDatasets()) { top.addDataset(ds); } foreCatalog.finish(); this.catalogForecasts = foreCatalog; } return catalogForecasts; }
private InvCatalogImpl makeCatalogOffsets(URI baseURI) throws IOException { if ((catalogOffsets == null) || checkIfChanged()) { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); URI myURI = baseURI.resolve( getCatalogHref(OFFSET)); InvCatalogImpl offCatalog = new InvCatalogImpl( getFullName(), parent.getVersion(), myURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata( (InvDatasetImpl) this.getParent(), true ); // make all inherited metadata local top.setName(TITLE_OFFSET); offCatalog.addDataset(top); // any referenced services need to be local List<InvService> services = getServicesLocal(); InvService service = getServiceDefault(); if ((service != null) && !services.contains(service)) offCatalog.addService(service); for (InvDatasetImpl ds : makeOffsetDatasets()) { top.addDataset(ds); } offCatalog.finish(); this.catalogOffsets = offCatalog; } return catalogOffsets; }
InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(getLatestFileName());
InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(getLatestFileName());
resultDs.transferMetadata( (InvDatasetImpl) dataset, copyInheritedMetadataFromParents );
InvDatasetImpl parent = (InvDatasetImpl) this.getParent(); if (parent != null) top.transferMetadata(parent, true); // make all inherited metadata local
private InvCatalogImpl makeCatalogRuns(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(RUNS)); InvCatalogImpl runCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(RUN_TITLE); // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); //if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); runCatalog.addDataset(top); // services need to be local runCatalog.addService(virtualService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeRunDatasets()) top.addDataset(ds); runCatalog.finish(); return runCatalog; }
private InvCatalogImpl makeCatalogRuns(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(RUNS)); InvCatalogImpl runCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(RUN_TITLE); // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); //if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); runCatalog.addDataset(top); // services need to be local runCatalog.addService(virtualService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeRunDatasets()) top.addDataset(ds); runCatalog.finish(); return runCatalog; }
private InvCatalogImpl makeCatalogOffsets(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(OFFSET)); InvCatalogImpl offCatalog; offCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); top.setName(OFFSET_TITLE); offCatalog.addDataset(top); // services need to be local offCatalog.addService(virtualService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeOffsetDatasets()) top.addDataset(ds); offCatalog.finish(); return offCatalog; }
InvDatasetImpl parent = (InvDatasetImpl) this.getParent(); if (parent != null) top.transferMetadata(parent, true); // make all inherited metadata local
private InvCatalogImpl makeCatalogOffsets(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(OFFSET)); InvCatalogImpl offCatalog; offCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); top.setName(OFFSET_TITLE); offCatalog.addDataset(top); // services need to be local offCatalog.addService(virtualService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeOffsetDatasets()) top.addDataset(ds); offCatalog.finish(); return offCatalog; }
private InvCatalogImpl makeCatalogForecasts(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(FORECAST)); InvCatalogImpl foreCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(FORECAST_TITLE); // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); foreCatalog.addDataset(top); // services need to be local foreCatalog.addService(virtualService); foreCatalog.addService(cdmrService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeForecastDatasets()) top.addDataset(ds); foreCatalog.finish(); return foreCatalog; }
private InvCatalogImpl makeCatalogForecasts(URI catURI, State localState) throws IOException { InvCatalogImpl parent = (InvCatalogImpl) getParentCatalog(); //URI myURI = baseURI.resolve(getCatalogHref(FORECAST)); InvCatalogImpl foreCatalog = new InvCatalogImpl(getFullName(), parent.getVersion(), catURI); InvDatasetImpl top = new InvDatasetImpl(this); top.setParent(null); top.transferMetadata((InvDatasetImpl) this.getParent(), true); // make all inherited metadata local top.setName(FORECAST_TITLE); // add Variables, GeospatialCoverage, TimeCoverage ThreddsMetadata tmi = top.getLocalMetadataInheritable(); if (localState.vars != null) tmi.addVariables(localState.vars); if (localState.coverage != null) tmi.setGeospatialCoverage(localState.coverage); if (localState.dateRange != null) tmi.setTimeCoverage(localState.dateRange); foreCatalog.addDataset(top); // services need to be local foreCatalog.addService(virtualService); foreCatalog.addService(cdmrService); top.getLocalMetadataInheritable().setServiceName(virtualService.getName()); for (InvDatasetImpl ds : makeForecastDatasets()) top.addDataset(ds); foreCatalog.finish(); return foreCatalog; }