static private InvService makeCdmrFeatureService() { return new InvService( "cdmrFeature","cdmrFeature", context + cdmrFeatureServiceUrlPath, null,null ); }
static private InvService makeCdmrFeatureService() { return new InvService("cdmrFeature", "cdmrFeature", context + cdmrFeatureServiceUrlPath, null, null); }
/** * Construct a SimpleCatalogBuilder for a given collection. * * @param collectionPath an path for the collection to be cataloged (used as the base of the generated URL, can be an empty string or null). If null, the collectionLevel final path segment is used. * @param collectionCrDs the root level of the collection to be cataloged. * @param serviceName specifies the name of the service to be used in the resulting catalogs. * @param serviceTypeName specifies the THREDDS service type, e.g., "OPENDAP" * @param serviceURL the base URL to the service */ public SimpleCatalogBuilder( String collectionPath, CrawlableDataset collectionCrDs, String serviceName, String serviceTypeName, String serviceURL ) { this.collectionPath = ( collectionPath == null ? collectionCrDs.getName() : collectionPath ); this.collectionCrDs = collectionCrDs; service = new InvService( serviceName, serviceTypeName, serviceURL, null, null ); }
/** * Construct a SimpleCatalogBuilder for a given collection. * * @param collectionPath an path for the collection to be cataloged (used as the base of the generated URL, can be an empty string or null). If null, the collectionLevel final path segment is used. * @param collectionCrDs the root level of the collection to be cataloged. * @param serviceName specifies the name of the service to be used in the resulting catalogs. * @param serviceTypeName specifies the THREDDS service type, e.g., "OPENDAP" * @param serviceURL the base URL to the service */ public SimpleCatalogBuilder( String collectionPath, CrawlableDataset collectionCrDs, String serviceName, String serviceTypeName, String serviceURL ) { this.collectionPath = ( collectionPath == null ? collectionCrDs.getName() : collectionPath ); this.collectionCrDs = collectionCrDs; service = new InvService( serviceName, serviceTypeName, serviceURL, null, null ); }
/** * Construct a SimpleCatalogBuilder for a given collection. * * @param collectionPath an path for the collection to be cataloged (used as the base of the generated URL, can be an empty string or null). If null, the collectionLevel final path segment is used. * @param collectionCrDs the root level of the collection to be cataloged. * @param serviceName specifies the name of the service to be used in the resulting catalogs. * @param serviceTypeName specifies the THREDDS service type, e.g., "OPENDAP" * @param serviceURL the base URL to the service */ public SimpleCatalogBuilder( String collectionPath, CrawlableDataset collectionCrDs, String serviceName, String serviceTypeName, String serviceURL ) { this.collectionPath = ( collectionPath == null ? collectionCrDs.getName() : collectionPath ); this.collectionCrDs = collectionCrDs; service = new InvService( serviceName, serviceTypeName, serviceURL, null, null ); }
protected InvService makeServiceVirtual(InvService org) { if (org.getServiceType() != ServiceType.COMPOUND) return org; InvService result = new InvService(Virtual_Services, ServiceType.COMPOUND.toString(), null, null, null); for (InvService service : org.getServices()) { if (service.getServiceType() != ServiceType.HTTPServer) { result.addService(service); } } return result; }
protected InvService makeVirtualService(InvService org) { if (org.getServiceType() != ServiceType.COMPOUND) return org; InvService result = new InvService(Virtual_Services, ServiceType.COMPOUND.toString(), null, null, null); for (InvService service : org.getServices()) { if (service.getServiceType() != ServiceType.HTTPServer) { result.addService(service); } } return result; }
/** * 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()); }
/** * Construct an InvDatasetImpl which refers to a urlPath. * This is used to create a standalone InvDatasetImpl, outside of an InvCatalog. * An "anonymous" InvServerImpl is created and attached to the InvDataset. * * @param urlPath : construct URL from this path * @param dataType : data type * @param stype : ServiceType */ public InvDatasetImpl(String urlPath, FeatureType dataType, ServiceType stype) { super(null, "local file"); tm.setDataType(dataType); tm.setServiceName("anon"); this.urlPath = urlPath; // create anonomous service addService(new InvService(tm.getServiceName(), stype.toString(), "", "", null)); finish(); }
/** * Construct an InvDatasetImpl which refers to a urlPath. * This is used to create a standalone InvDatasetImpl, outside of an InvCatalog. * An "anonymous" InvServerImpl is created and attached to the InvDataset. * * @param urlPath : construct URL from this path * @param dataType : data type * @param stype : ServiceType */ public InvDatasetImpl(String urlPath, FeatureType dataType, ServiceType stype) { super(null, "local file"); tm.setDataType(dataType); tm.setServiceName("anon"); this.urlPath = urlPath; // create anonymous service addService(new InvService(tm.getServiceName(), stype.toString(), "", "", null)); finish(); }
/** * Construct an InvDatasetImpl which refers to a urlPath. * This is used to create a standalone InvDatasetImpl, outside of an InvCatalog. * An "anonymous" InvServerImpl is created and attached to the InvDataset. * * @param urlPath : construct URL from this path * @param dataType : data type * @param stype : ServiceType */ public InvDatasetImpl(String urlPath, FeatureType dataType, ServiceType stype) { super(null, "local file"); tm.setDataType(dataType); tm.setServiceName("anon"); this.urlPath = urlPath; // create anonymous service addService(new InvService(tm.getServiceName(), stype.toString(), "", "", null)); finish(); }
private InvDatasetImpl createDataset(String[] serviceTypeNames) throws URISyntaxException { final InvDatasetImpl dapDataset = new InvDatasetImpl(null, "datasetName", FeatureType.NONE, serviceTypeNames[0], "http://wherever.you.want.bc"); final InvCatalogImpl catalog = new InvCatalogImpl("catalogName", "1.0", new URI("http://x.y")); dapDataset.setCatalog(catalog); for (String serviceName : serviceTypeNames) { final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant"); final InvAccessImpl invAccess = new InvAccessImpl(dapDataset, "http://y.z", dapService); dapDataset.addAccess(invAccess); } dapDataset.finish(); return dapDataset; }
private InvDataset createDataset(InvCatalog catalog, String datasetName, final String serviceName) { final InvDatasetImpl dapDataset = new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc"); dapDataset.setCatalog(catalog); final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant"); dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService)); dapDataset.finish(); return dapDataset; }
private InvDatasetImpl createDataset(InvCatalogImpl catalog, String datasetName, final String serviceName) { final InvDatasetImpl dapDataset = new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc"); dapDataset.setCatalog(catalog); final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant"); dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService)); dapDataset.finish(); return dapDataset; }
private InvDatasetImpl createDataset(InvCatalogImpl catalog, String datasetName, final String serviceName) { final InvDatasetImpl dapDataset = new InvDatasetImpl(null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc"); dapDataset.setCatalog(catalog); final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant"); dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService)); dapDataset.finish(); return dapDataset; }
protected InvService makeServiceDefault() { // LOOK need (thredds.server.config.AllowableService) InvService result = new InvService("Default", ServiceType.COMPOUND.toString(), null, null, null); result.addService(InvService.opendap); result.addService(InvService.fileServer); result.addService(InvService.wms); result.addService(InvService.wcs); result.addService(InvService.ncss); result.addService(InvService.cdmremote); result.addService(InvService.ncml); result.addService(InvService.uddc); result.addService(InvService.iso); return result; }
public static InvService copyService( InvService service ) { if ( service == null ) throw new IllegalArgumentException( "Service may not be null."); InvService resultService = new InvService( service.getName(), service.getServiceType().toString(), service.getBase(), service.getSuffix(), service.getDescription() ); for ( InvService curService : service.getServices()) { resultService.addService( copyService( curService ) ); } for ( InvProperty curProperty : service.getProperties()) { resultService.addProperty( copyProperty( curProperty ) ); } for ( InvProperty curDatasetRoot : service.getDatasetRoots()) { resultService.addDatasetRoot( copyProperty( curDatasetRoot) ); } return resultService; }
public static InvService copyService( InvService service ) { if ( service == null ) throw new IllegalArgumentException( "Service may not be null."); InvService resultService = new InvService( service.getName(), service.getServiceType().toString(), service.getBase(), service.getSuffix(), service.getDescription() ); for ( InvService curService : service.getServices()) { resultService.addService( copyService( curService ) ); } for ( InvProperty curProperty : service.getProperties()) { resultService.addProperty( copyProperty( curProperty ) ); } for ( InvProperty curDatasetRoot : service.getDatasetRoots()) { resultService.addDatasetRoot( copyProperty( curDatasetRoot) ); } return resultService; }
public static InvService copyService( InvService service ) { if ( service == null ) throw new IllegalArgumentException( "Service may not be null."); InvService resultService = new InvService( service.getName(), service.getServiceType().toString(), service.getBase(), service.getSuffix(), service.getDescription() ); for ( InvService curService : service.getServices()) { resultService.addService( copyService( curService ) ); } for ( InvProperty curProperty : service.getProperties()) { resultService.addProperty( copyProperty( curProperty ) ); } for ( InvProperty curDatasetRoot : service.getDatasetRoots()) { resultService.addDatasetRoot( copyProperty( curDatasetRoot) ); } return resultService; }
protected InvService readService(Element s, URI baseURI) { String name = s.getAttributeValue("name"); String type = s.getAttributeValue("serviceType"); String serviceBase = s.getAttributeValue("base"); String suffix = s.getAttributeValue("suffix"); String desc = s.getAttributeValue("desc"); InvService service = new InvService(name, type, serviceBase, suffix, desc); java.util.List<Element> propertyList = s.getChildren("property", defNS); for (Element e : propertyList) { InvProperty p = readProperty(e); service.addProperty(p); } java.util.List<Element> rootList = s.getChildren("datasetRoot", defNS); for (Element e : rootList) { InvProperty root = readDatasetRoot(e); service.addDatasetRoot(root); } // nested services java.util.List<Element> serviceList = s.getChildren("service", defNS); for (Element e : serviceList) { InvService ss = readService(e, baseURI); service.addService(ss); } if (InvCatalogFactory.debugXML) System.out.println(" Service added: " + service); return service; }