public OWS getSingleConfiguredService() { List<ResourceIdentifier<OWS>> owss = workspace.getResourcesOfType( OWSProvider.class ); if ( owss.size() == 1 ) { return workspace.getResource( OWSProvider.class, owss.get( 0 ).getId() ); } return null; }
/** * Returns the service controller instance based on the class of the service controller. * * @param c * class of the requested service controller, e.g. <code>WPSController.getClass()</code> * @return the instance of the requested service used by OGCFrontController, or null if no such service controller * is active */ public List<OWS> getByOWSClass( Class<?> c ) { List<ResourceIdentifier<OWS>> list = workspace.getResourcesOfType( OWSProvider.class ); List<OWS> services = new ArrayList<OWS>(); for ( ResourceIdentifier<OWS> id : list ) { OWS ows = workspace.getResource( OWSProvider.class, id.getId() ); if ( ows != null ) { if ( c == ows.getClass() ) { services.add( ows ); } } } return services; }
/** * Returns all available processes. * * @return available process, may be empty, but never <code>null</code> */ public Map<CodeType, WPSProcess> getProcesses() { Map<CodeType, WPSProcess> processes = new HashMap<CodeType, WPSProcess>(); for ( ResourceIdentifier<ProcessProvider> rid : workspace.getResourcesOfType( ProcessProviderProvider.class ) ) { ProcessProvider prov = workspace.getResource( rid.getProvider(), rid.getId() ); if ( prov != null ) { Map<CodeType, ? extends WPSProcess> idToProcess = prov.getProcesses(); if ( idToProcess != null ) { processes.putAll( idToProcess ); } } } return processes; }
/** * Return all active {@link OWS}. * * @return the instance of the requested service used by OGCFrontController, or null if the service is not * registered. */ public Map<String, List<OWS>> getAll() { List<ResourceIdentifier<OWS>> list = workspace.getResourcesOfType( OWSProvider.class ); Map<String, List<OWS>> services = new HashMap<String, List<OWS>>(); for ( ResourceIdentifier<OWS> id : list ) { OWS ows = workspace.getResource( OWSProvider.class, id.getId() ); if ( ows == null ) { continue; } String[] names = ( (OWSProvider) ows.getMetadata().getProvider() ).getImplementationMetadata().getImplementedServiceName(); for ( String name : names ) { List<OWS> owss = services.get( name ); if ( owss == null ) { owss = new ArrayList<OWS>(); services.put( name, owss ); } owss.add( ows ); } } return services; }
/** * Determines the {@link OWS} instance that is responsible for handling XML requests in the given namespace. * * @param ns * XML namespace * @return responsible <code>OWS</code> or null, if no responsible service was found */ public List<OWS> getByRequestNS( String ns ) { List<ResourceIdentifier<OWS>> list = workspace.getResourcesOfType( OWSProvider.class ); List<OWS> services = new ArrayList<OWS>(); for ( ResourceIdentifier<OWS> id : list ) { OWS ows = workspace.getResource( OWSProvider.class, id.getId() ); if ( ows == null ) { continue; } for ( String name : ( (OWSProvider) ows.getMetadata().getProvider() ).getImplementationMetadata().getHandledNamespaces() ) { if ( name.equalsIgnoreCase( ns ) ) { services.add( ows ); } } } return services; }
/** * Returns the {@link OWS} instance that is responsible for handling requests with a certain name, e.g. GetMap, * GetFeature. * * @param requestName * request name, e.g. "GetMap" or "GetFeature" * @return responsible <code>OWS</code> or null, if no responsible service was found */ public List<OWS> getByRequestName( String requestName ) { List<ResourceIdentifier<OWS>> list = workspace.getResourcesOfType( OWSProvider.class ); List<OWS> services = new ArrayList<OWS>(); for ( ResourceIdentifier<OWS> id : list ) { OWS ows = workspace.getResource( OWSProvider.class, id.getId() ); if ( ows == null ) { continue; } for ( String name : ( (OWSProvider) ows.getMetadata().getProvider() ).getImplementationMetadata().getHandledRequests() ) { if ( name.equalsIgnoreCase( "GetCapabilities" ) ) { continue; } if ( name.equalsIgnoreCase( requestName ) ) { services.add( ows ); } } } return services; }
/** * Returns the {@link OWS} instance that is responsible for handling requests to a certain service type, e.g. WMS, * WFS. * * @param serviceType * service type code, e.g. "WMS" or "WFS" * @return responsible <code>OWS</code> or null, if no responsible service was found */ public List<OWS> getByServiceType( String serviceType ) { List<ResourceIdentifier<OWS>> list = workspace.getResourcesOfType( OWSProvider.class ); List<OWS> services = new ArrayList<OWS>(); for ( ResourceIdentifier<OWS> id : list ) { OWS ows = workspace.getResource( OWSProvider.class, id.getId() ); if ( ows == null ) { continue; } for ( String name : ( (OWSProvider) ows.getMetadata().getProvider() ).getImplementationMetadata().getImplementedServiceName() ) { if ( name.equalsIgnoreCase( serviceType ) ) { services.add( ows ); } } } return services; }
/** * Returns the process with the specified identifier. * * @param id * identifier of the process, must not be <code>null</code> * @return process with the specified identifier or <code>null</code> if no such process exists */ public WPSProcess getProcess( CodeType id ) { WPSProcess process = null; for ( ResourceIdentifier<ProcessProvider> rid : workspace.getResourcesOfType( ProcessProviderProvider.class ) ) { ProcessProvider prov = workspace.getResource( rid.getProvider(), rid.getId() ); process = prov.getProcess( id ); if ( process != null ) { break; } } return process; }
List<ResourceIdentifier<FeatureStore>> stores = workspace.getResourcesOfType( FeatureStoreProvider.class ); for ( ResourceIdentifier<FeatureStore> id : stores ) { FeatureStore store = workspace.getResource( id.getProvider(), id.getId() );
if ( metadataStoreId == null ) { LOG.info( "Metadata store id is not configured. Initializing/looking up configured record stores." ); List<ResourceIdentifier<MetadataStore<? extends MetadataRecord>>> stores = workspace.getResourcesOfType( MetadataStoreProvider.class ); List<MetadataStore<? extends MetadataRecord>> availableStores = new ArrayList<MetadataStore<?>>(); for ( ResourceIdentifier<MetadataStore<? extends MetadataRecord>> id : stores ) {
if ( metadataUrlTemplate == null ) { List<ResourceIdentifier<OWS>> owss = workspace.getResourcesOfType( OWSProvider.class ); for ( ResourceIdentifier<OWS> id : owss ) { OWS o = workspace.getResource( OWSProvider.class, id.getId() );