public thredds.catalog.ThreddsMetadata getLocalMetadata() { return proxy.getLocalMetadata(); }
/** * Transfer all inheritable metadata from fromDs to the local metadata of this dataset. * Called by InvDatasetScan to transfer inheritable metaddata to the nested catalogRef * * @param fromDs transfer from here */ public void transferMetadata(InvDatasetImpl fromDs, boolean copyInheritedMetadataFromParents) { if (fromDs == null) return; logger.debug(" transferMetadata= " + fromDs.getName()); if (this != fromDs) getLocalMetadata().add(fromDs.getLocalMetadata(), false); transferInheritableMetadata(fromDs, getLocalMetadataInheritable(), copyInheritedMetadataFromParents); setResourceControl(fromDs.getRestrictAccess()); }
/** * Transfer all inheritable metadata from fromDs to the local metadata of this dataset. * Called by InvDatasetScan to transfer inheritable metaddata to the nested catalogRef * * @param fromDs transfer from here */ public void transferMetadata(InvDatasetImpl fromDs, boolean copyInheritedMetadataFromParents) { if (fromDs == null) return; if (debugInherit2) System.out.println(" transferMetadata= " + fromDs.getName()); if (this != fromDs) getLocalMetadata().add(fromDs.getLocalMetadata(), false); transferInheritableMetadata(fromDs, getLocalMetadataInheritable(), copyInheritedMetadataFromParents); setResourceControl(fromDs.getRestrictAccess()); }
public thredds.catalog.ThreddsMetadata getLocalMetadata() { return proxy.getLocalMetadata(); }
/** * Transfer all inheritable metadata from fromDs to the local metadata of this dataset. * Called by InvDatasetScan to transfer inheritable metaddata to the nested catalogRef * * @param fromDs transfer from here */ public void transferMetadata(InvDatasetImpl fromDs, boolean copyInheritedMetadataFromParents) { if (fromDs == null) return; if (debugInherit2) System.out.println(" transferMetadata= " + fromDs.getName()); if (this != fromDs) getLocalMetadata().add(fromDs.getLocalMetadata(), false); transferInheritableMetadata(fromDs, getLocalMetadataInheritable(), copyInheritedMetadataFromParents); setResourceControl(fromDs.getRestrictAccess()); }
public thredds.catalog.ThreddsMetadata getLocalMetadata() { return proxy.getLocalMetadata(); }
/** * copy constructor * * @param from copy from here */ public InvDatasetImpl(InvDatasetImpl from) { super(from.getParent(), from.getName()); // steal everything this.tm = new ThreddsMetadata(from.getLocalMetadata()); this.tmi = new ThreddsMetadata(from.getLocalMetadataInheritable()); this.accessLocal = new ArrayList<InvAccess>(from.getAccessLocal()); this.servicesLocal = new ArrayList<InvService>(from.getServicesLocal()); this.harvest = from.harvest; this.collectionType = from.collectionType; }
/** * Remove the given InvMetadata from the set of metadata local to this dataset. * * @param metadata remove this * @return true if an InvMetadata is removed, false otherwise. */ public boolean removeLocalMetadata(InvMetadata metadata) { InvDatasetImpl parentDataset = ((InvDatasetImpl) metadata.getParentDataset()); List localMdata = parentDataset.getLocalMetadata().getMetadata(); if (localMdata.contains(metadata)) { if (localMdata.remove(metadata)) { hashCode = 0; // Need to recalculate the hash code. return (true); } } return (false); }
/** * copy constructor * * @param from copy from here */ public InvDatasetImpl(InvDatasetImpl from) { super(from.getParent(), from.getName()); // steal everything this.tm = new ThreddsMetadata(from.getLocalMetadata()); this.tmi = new ThreddsMetadata(from.getLocalMetadataInheritable()); this.accessLocal = new ArrayList<>(from.getAccessLocal()); this.servicesLocal = new ArrayList<>(from.getServicesLocal()); this.harvest = from.harvest; this.collectionType = from.collectionType; }
/** * Remove the given InvMetadata from the set of metadata local to this dataset. * * @param metadata remove this * @return true if an InvMetadata is removed, false otherwise. */ public boolean removeLocalMetadata(InvMetadata metadata) { InvDatasetImpl parentDataset = ((InvDatasetImpl) metadata.getParentDataset()); List localMdata = parentDataset.getLocalMetadata().getMetadata(); if (localMdata.contains(metadata)) { if (localMdata.remove(metadata)) { hashCode = 0; // Need to recalculate the hash code. return (true); } } return (false); }
/** * copy constructor * * @param from copy from here */ public InvDatasetImpl(InvDatasetImpl from) { super(from.getParent(), from.getName()); // steal everything this.tm = new ThreddsMetadata(from.getLocalMetadata()); this.tmi = new ThreddsMetadata(from.getLocalMetadataInheritable()); this.accessLocal = new ArrayList<>(from.getAccessLocal()); this.servicesLocal = new ArrayList<>(from.getServicesLocal()); this.harvest = from.harvest; this.collectionType = from.collectionType; }
/** * Remove the given InvMetadata from the set of metadata local to this dataset. * * @param metadata remove this * @return true if an InvMetadata is removed, false otherwise. */ public boolean removeLocalMetadata(InvMetadata metadata) { InvDatasetImpl parentDataset = ((InvDatasetImpl) metadata.getParentDataset()); List localMdata = parentDataset.getLocalMetadata().getMetadata(); if (localMdata.contains(metadata)) { if (localMdata.remove(metadata)) { hashCode = 0; // Need to recalculate the hash code. return (true); } } return (false); }
public static long getDataSizeInBytes(OpendapLeaf leaf) { return (long) ((InvDatasetImpl) leaf.getDataset()).getLocalMetadata().getDataSize(); }
/** * test */ public static void main(String[] args) { InvDatasetImpl topDs = new InvDatasetImpl(null, "topDs", FeatureType.valueOf("GRID"), "myService", "myUrlPath/"); InvService myS = new InvService("myService", ServiceType.DODS.toString(), "http://thredds.ucar.edu/cgi-bin/dods/nph-dods", "", null); topDs.addService(myS); topDs.getLocalMetadata().setServiceName("myService"); InvDatasetImpl childDs = new InvDatasetImpl(null, "childDs", null, null, "myUrlPath/"); topDs.addDataset(childDs); InvService ts = childDs.findService("myService"); System.out.println("InvDatasetImpl.main(): " + childDs.getAccess(ServiceType.DODS).toString()); }
private List<InvDatasetImpl> makeRunDatasets() throws IOException { List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); String id = getID(); if (id == null) id = getPath(); for (CalendarDate runDate : fmrc.getRunDates()) { String name = getName() + "_" + RUN_NAME + runDate; name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path + "/" + RUNS + "/" + name); nested.setID(id + "/" + RUNS + "/" + name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data from Run " + name); CalendarDateRange dr = fmrc.getDateRangeForRun(runDate); if (dr != null) tm.setTimeCoverage(dr); datasets.add(nested); } Collections.reverse(datasets); return datasets; }
private List<InvDatasetImpl> makeRunDatasets() throws IOException { makeFmrc(); List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); DateFormatter formatter = new DateFormatter(); String id = getID(); if (id == null) id = getPath(); for (Date runDate : fmrc.getRunDates()) { //String name = StringUtil.escape(formatter.toDateTimeStringISO( runDate), ""); String name = getName()+"_"+RUN_NAME+formatter.toDateTimeStringISO( runDate); name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path+"/"+RUNS+"/"+name); nested.setID(id+"/"+RUNS+"/"+name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data from Run "+name); datasets.add( nested); } Collections.reverse( datasets); return datasets; }
private List<InvDatasetImpl> makeOffsetDatasets() throws IOException { makeFmrc(); List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); String id = getID(); if (id == null) id = getPath(); for (Double offset : fmrc.getForecastOffsets()) { String name = getName()+"_"+OFFSET_NAME+offset+"hr"; name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path+"/"+OFFSET+"/"+name); nested.setID(id+"/"+OFFSET+"/"+name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data from the "+offset+" hour forecasts, across different model runs."); datasets.add( nested); } return datasets; }
private List<InvDatasetImpl> makeForecastDatasets() throws IOException { List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); String id = getID(); if (id == null) id = getPath(); for (CalendarDate forecastDate : fmrc.getForecastDates()) { String name = getName() + "_" + FORECAST_NAME + forecastDate; name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path + "/" + FORECAST + "/" + name); nested.setID(id + "/" + FORECAST + "/" + name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data with the same forecast date, " + name + ", across different model runs."); tm.setTimeCoverage(CalendarDateRange.of(forecastDate, forecastDate)); datasets.add(nested); } return datasets; }
private List<InvDatasetImpl> makeForecastDatasets() throws IOException { List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); String id = getID(); if (id == null) id = getPath(); for (CalendarDate forecastDate : fmrc.getForecastDates()) { String name = getName() + "_" + FORECAST_NAME + forecastDate; name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path + "/" + FORECAST + "/" + name); nested.setID(id + "/" + FORECAST + "/" + name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data with the same forecast date, " + name + ", across different model runs."); tm.setTimeCoverage(CalendarDateRange.of(forecastDate, forecastDate)); datasets.add(nested); } return datasets; }
private List<InvDatasetImpl> makeForecastDatasets() throws IOException { makeFmrc(); List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>(); DateFormatter formatter = new DateFormatter(); String id = getID(); if (id == null) id = getPath(); for (Date forecastDate : fmrc.getForecastDates()) { String name = getName()+"_"+FORECAST_NAME+formatter.toDateTimeStringISO( forecastDate); name = StringUtil2.replace(name, ' ', "_"); InvDatasetImpl nested = new InvDatasetImpl(this, name); nested.setUrlPath(path+"/"+FORECAST+"/"+name); nested.setID(id+"/"+FORECAST+"/"+name); ThreddsMetadata tm = nested.getLocalMetadata(); tm.addDocumentation("summary", "Data with the same forecast date, "+name+", across different model runs."); datasets.add( nested); } return datasets; }