public class SOSAdapter extends Object implements IServiceAdapter
Modifier and Type | Field and Description |
---|---|
static String |
DELETE_SENSOR |
static String |
DESCRIBE_SENSOR |
static String |
DESCRIPTION
Description of the SOSAdapter
|
static String |
GET_CAPABILITIES |
static String |
GET_FEATURE_OF_INTEREST |
static String |
GET_OBSERVATION |
static String |
GET_OBSERVATION_BY_ID |
static String |
INSERT_OBSERVATION |
static String |
INSERT_SENSOR
Replaces version 1.0.0 operation
REGISTER_SENSOR |
static String |
REGISTER_SENSOR
In version 2.0.0 replaced by
INSERT_SENSOR |
static String |
RESOURCE_OPERATION
The name of the service operation which returns the data to be added to a map view as a layer.
|
protected String |
serviceVersion
the schema version this adapter instance shall work with.
|
Constructor and Description |
---|
SOSAdapter(String serviceVersion) |
SOSAdapter(String serviceVersion,
HttpClient httpClient) |
SOSAdapter(String serviceVersion,
ISOSRequestBuilder requestBuilder)
Allows to create an SOSAdapter with custom (non-default) instance of
ISOSRequestBuilder . |
Modifier and Type | Method and Description |
---|---|
OperationResult |
doOperation(Operation operation,
ParameterContainer parameters) |
OperationResult |
doOperation(Operation operation,
ParameterContainer parameters,
int connectionTimeout,
int readTimeout) |
String |
getDescription()
returns the description of this Service Adapter
|
ISOSRequestBuilder |
getRequestBuilder() |
String |
getResourceOperationName()
returns the ResourceOperationName
|
String |
getServiceType()
returns the type of the service which is connectable by this ServiceAdapter
|
String |
getServiceVersion() |
String[] |
getSupportedVersions()
returns the supported versions of the service
|
ServiceDescriptor |
initService(net.opengis.sos.x20.CapabilitiesDocument capsDoc) |
ServiceDescriptor |
initService(net.opengis.sos.x10.CapabilitiesDocument capsDoc) |
ServiceDescriptor |
initService(OperationResult getCapabilitiesResult) |
ServiceDescriptor |
initService(String url)
initializes the ServiceDescriptor by requesting the capabilities document of the SOS.
|
ServiceDescriptor |
initService(String serviceEndpoint,
ISOSRequestBuilder.Binding binding)
initializes the ServiceDescriptor by requesting the capabilities document of the SOS using the binding specified.
|
OXFFeatureCollection |
requestObservations(String sosURL,
String offering,
String observedProperty,
String eventTime)
Convenient method to request Observations from an SOS.
|
void |
setHttpClient(HttpClient httpClient)
Sets a custom
HttpClient for service communication. |
void |
setRequestBuilder(ISOSRequestBuilder requestBuilder) |
public static final String GET_CAPABILITIES
public static final String GET_OBSERVATION
public static final String GET_OBSERVATION_BY_ID
public static final String DESCRIBE_SENSOR
public static final String DELETE_SENSOR
public static final String GET_FEATURE_OF_INTEREST
public static final String INSERT_OBSERVATION
public static final String REGISTER_SENSOR
INSERT_SENSOR
public static final String INSERT_SENSOR
REGISTER_SENSOR
public static final String DESCRIPTION
public static final String RESOURCE_OPERATION
protected String serviceVersion
public SOSAdapter(String serviceVersion)
serviceVersion
- the schema version for which this adapter instance shall be initialized.public SOSAdapter(String serviceVersion, HttpClient httpClient)
serviceVersion
- the schema version for which this adapter instance shall be initialized.httpclient
- the (decorated) HttpClient
to use for service connections.public SOSAdapter(String serviceVersion, ISOSRequestBuilder requestBuilder)
ISOSRequestBuilder
.SimpleHttpClient
for service communication. If
further features are needed the SimpleHttpClient
can be decorated with further configuration
setups like a GzipEnabledHttpClient
or a ProxyAwareHttpClient
.serviceVersion
- the schema version for which this adapter instance shall be initialized.requestBuilder
- a custom request builder implementation, if null
a default builder will be used
(according to the given version).ISOSRequestBuilder
public void setRequestBuilder(ISOSRequestBuilder requestBuilder)
requestBuilder
- a custom ISOSRequestBuilder
implementation the SOSAdapter
shall use.public void setHttpClient(HttpClient httpClient)
HttpClient
for service communication. A SimpleHttpClient
can be decorated
to enable for example GZIP encoding (setting Accept-Encoding plus GZIP decompressing) or being aware of
proxies.httpClient
- a customly configured HttpClient
the SOSAdapter
shall use.ProxyAwareHttpClient
,
GzipEnabledHttpClient
public ServiceDescriptor initService(String url) throws ExceptionReport, OXFException
initService
in interface IServiceAdapter
url
- the base URL of the SOSserviceVersion
- the schema version to which the service description shall be conform.ExceptionReport
- if service side exception occursOXFException
- if internal exception (in general parsing error or Capabilities doc is incorrect) occurspublic ServiceDescriptor initService(String serviceEndpoint, ISOSRequestBuilder.Binding binding) throws OXFException, ExceptionReport
serviceEndpoint
- binding
- OXFException
ExceptionReport
public ServiceDescriptor initService(OperationResult getCapabilitiesResult) throws ExceptionReport, OXFException
ExceptionReport
OXFException
public ServiceDescriptor initService(net.opengis.sos.x20.CapabilitiesDocument capsDoc) throws OXFException
OXFException
public ServiceDescriptor initService(net.opengis.sos.x10.CapabilitiesDocument capsDoc) throws OXFException
capsDoc
- OXFException
public OperationResult doOperation(Operation operation, ParameterContainer parameters) throws ExceptionReport, OXFException
doOperation
in interface IServiceAdapter
operation
- the operation which the adapter has to execute on the service. this operation includes also the
parameter values.parameters
- Map which contains the parameters of the operation and the corresponding parameter valuesExceptionReport
- Report which contains the service sided exceptionsOXFException
- if the sending of the post message failed.public OperationResult doOperation(Operation operation, ParameterContainer parameters, int connectionTimeout, int readTimeout) throws ExceptionReport, OXFException
operation
- the operation which the adapter has to execute on the service. this operation includes also the
parameter values.parameters
- Map which contains the parameters of the operation and the corresponding parameter valuesconnectionTimeout
- The connectionTimeout to be used for this operation in millis.
A value < 1 will be ignored.readTimeout
- The readTimeout to be used for this operation in millis.
A value < 1 will be ignored.ExceptionReport
- Report which contains the service sided exceptionsOXFException
- if the sending of the post message failed.public OXFFeatureCollection requestObservations(String sosURL, String offering, String observedProperty, String eventTime) throws OXFException, ExceptionReport
OXFException
ExceptionReport
public String getResourceOperationName()
getResourceOperationName
in interface IServiceAdapter
public String getDescription()
getDescription
in interface IServiceAdapter
public String getServiceType()
getServiceType
in interface IServiceAdapter
public String[] getSupportedVersions()
getSupportedVersions
in interface IServiceAdapter
public ISOSRequestBuilder getRequestBuilder()
public String getServiceVersion()
Copyright © 2012–2017 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.