public int accept( InvDataset d) { // check all access for any that has this servicee for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == type) return 1; } // cant tell about DQC and resolvers !! for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == ServiceType.QC) return 0; if (a.getService().getServiceType() == ServiceType.RESOLVER) return 0; } return -1; } }
public int accept( InvDataset d) { // check all access for any that has this servicee for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == type) return 1; } // cant tell about DQC and resolvers !! for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == ServiceType.QC) return 0; if (a.getService().getServiceType() == ServiceType.RESOLVER) return 0; } return -1; } }
public int accept( InvDataset d) { // check all access for any that has this servicee for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == type) return 1; } // cant tell about DQC and resolvers !! for (InvAccess a : d.getAccess()) { if (a.getService().getServiceType() == ServiceType.QC) return 0; if (a.getService().getServiceType() == ServiceType.RESOLVER) return 0; } return -1; } }
private InvAccess findAccessByServiceType(List<InvAccess> accessList, ServiceType type) { for (InvAccess a : accessList) { if (type.toString().equalsIgnoreCase(a.getService().getServiceType().toString())) return a; } return null; }
/** * Get access element of the specified service type for this dataset. * If more than one, get the first one. * * @param type find this ServiceType * @return InvAccess or null if there is not one. */ public InvAccess getAccess(thredds.catalog.ServiceType type) { for (InvAccess a : getAccess()) { InvService s = a.getService(); if (s.getServiceType() == type) return a; } return null; }
private InvAccess findAccessByServiceType(List<InvAccess> accessList, ServiceType type) { for (InvAccess a : accessList) { if (type.toString().equalsIgnoreCase(a.getService().getServiceType().toString())) return a; } return null; }
private InvAccess findAccessByServiceType(List<InvAccess> accessList, ServiceType type) { for (InvAccess a : accessList) { if (type.toString().equalsIgnoreCase(a.getService().getServiceType().toString())) return a; } return null; }
/** * Get access element of the specified service type for this dataset. * If more than one, get the first one. * * @param type find this ServiceType * @return InvAccess or null if there is not one. */ public InvAccess getAccess(thredds.catalog.ServiceType type) { for (InvAccess a : getAccess()) { InvService s = a.getService(); if (s.getServiceType() == type) return a; } return null; }
/** * Get access element of the specified service type for this dataset. * If more than one, get the first one. * * @param type find this ServiceType * @return InvAccess or null if there is not one. */ public InvAccess getAccess(thredds.catalog.ServiceType type) { for (InvAccess a : getAccess()) { InvService s = a.getService(); if (s.getServiceType() == type) return a; } return null; }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
void findServices(List<InvService> result, InvDataset ds) { if (ds instanceof InvCatalogRef) return; // look for access elements with unresolved services for (InvAccess a : ds.getAccess()) { InvService s = a.getService(); InvDataset d = a.getDataset(); if (null == d.findService(s.getName()) && !(result.contains(s))) result.add(s); } // recurse into nested datasets for (InvDataset nested : ds.getDatasets()) { findServices(result, nested); } }
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(); }
public static InvAccess copyAccess( InvAccess access, InvDataset parentDataset, List<InvService> availableServices ) { if ( parentDataset == null ) throw new IllegalArgumentException( "Parent dataset may not be null."); String serviceName = access.getService().getName(); InvService service = findServiceByName( serviceName, availableServices); if ( service == null ) { logger.warn( "Access service [" + serviceName + "] not in available service list."); return null; // ToDo Support copying service. //service = copyService( access.getService() ); } DataFormatType dataFormatType = access.getDataFormatType(); InvAccessImpl resultAccess; if ( dataFormatType == null ) { resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service ); resultAccess.setSize( access.getDataSize() ); } else resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service.getName(), null, dataFormatType.toString(), access.getDataSize() ); return resultAccess; }
public static InvAccess copyAccess( InvAccess access, InvDataset parentDataset, List<InvService> availableServices ) { if ( parentDataset == null ) throw new IllegalArgumentException( "Parent dataset may not be null."); String serviceName = access.getService().getName(); InvService service = findServiceByName( serviceName, availableServices); if ( service == null ) { logger.warn( "Access service [" + serviceName + "] not in available service list."); return null; // ToDo Support copying service. //service = copyService( access.getService() ); } DataFormatType dataFormatType = access.getDataFormatType(); InvAccessImpl resultAccess = null; if ( dataFormatType == null ) { resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service ); resultAccess.setSize( access.getDataSize() ); } else resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service.getName(), null, dataFormatType.toString(), access.getDataSize() ); return resultAccess; }
public static InvAccess copyAccess( InvAccess access, InvDataset parentDataset, List<InvService> availableServices ) { if ( parentDataset == null ) throw new IllegalArgumentException( "Parent dataset may not be null."); String serviceName = access.getService().getName(); InvService service = findServiceByName( serviceName, availableServices); if ( service == null ) { logger.warn( "Access service [" + serviceName + "] not in available service list."); return null; // ToDo Support copying service. //service = copyService( access.getService() ); } DataFormatType dataFormatType = access.getDataFormatType(); InvAccessImpl resultAccess; if ( dataFormatType == null ) { resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service ); resultAccess.setSize( access.getDataSize() ); } else resultAccess = new InvAccessImpl( parentDataset, access.getUrlPath(), service.getName(), null, dataFormatType.toString(), access.getDataSize() ); return resultAccess; }
private ThreddsDataFactory.Result openFeatureDataset(FeatureType wantFeatureType, InvAccess access, ucar.nc2.util.CancelTask task, Result result) throws IOException { result.featureType = wantFeatureType; result.accessUsed = access; // special handling for IMAGE if (result.featureType == FeatureType.IMAGE) { result.imageURL = access.getStandardUrlName(); result.location = result.imageURL; return result; } if (access.getService().getServiceType() == ServiceType.CdmrFeature) { result.featureDataset = CdmrFeatureDataset.factory(wantFeatureType, access.getStandardUrlName()); } else { // all other datatypes NetcdfDataset ncd = openDataset(access, true, task, result); if (null != ncd) { result.featureDataset = FeatureDatasetFactoryManager.wrap(result.featureType, ncd, task, result.errLog); } } if (null == result.featureDataset) result.fatalError = true; else { result.location = result.featureDataset.getLocation(); if ((result.featureType == null) && (result.featureDataset != null)) result.featureType = result.featureDataset.getFeatureType(); } return result; }
private ThreddsDataFactory.Result openFeatureDataset(FeatureType wantFeatureType, InvAccess access, ucar.nc2.util.CancelTask task, Result result) throws IOException { result.featureType = wantFeatureType; result.accessUsed = access; // special handling for IMAGE if (result.featureType == FeatureType.IMAGE) { result.imageURL = access.getStandardUrlName(); result.location = result.imageURL; return result; } if (access.getService().getServiceType() == ServiceType.CdmrFeature) { result.featureDataset = CdmrFeatureDataset.factory(wantFeatureType, access.getStandardUrlName()); } else { // all other datatypes NetcdfDataset ncd = openDataset(access, true, task, result); if (null != ncd) { result.featureDataset = FeatureDatasetFactoryManager.wrap(result.featureType, ncd, task, result.errLog); } } if (null == result.featureDataset) result.fatalError = true; else { result.location = result.featureDataset.getLocation(); if ((result.featureType == null) && (result.featureDataset != null)) result.featureType = result.featureDataset.getFeatureType(); } return result; }