com.axiomalaska.sos
Class ObservationSubmitter
java.lang.Object
com.axiomalaska.sos.ObservationSubmitter
public class ObservationSubmitter
- extends java.lang.Object
This class is used to push observations from a station and it's
phenomena/sensor into the SOS
There are two ways to add observations to the SOS.
1.) Push a ObservationCollection
2.) Pull observations from a ObservationRetriever
1.) Call method update(ObservationCollection observationCollection) with a
prebuilt ObservationCollection. This will only add the observations that have not
already been added to the SOS.
2.) Methods
update(List stations, ObservationRetriever observationRetriever)
update(Station station, ObservationRetriever observationRetriever)
updateObservations(Station station, Phenomenon phenomenon, ObservationRetriever observationRetriever)
Methods take a one or more stations with option of a phenomenon and a ObservationRetriever.
All the combinations or the stations and phenomena are used to pull
observations from the ObservationRetriever object. ObservationRetriever
represents an interface to pull observations from a database or some data store.
Create the Object and pass in the URL to your SOS server Then call update
method with a station or a list of station to be used to update the SOS with.
- Author:
- Lance Finfrock
|
Constructor Summary |
ObservationSubmitter(java.lang.String sosUrl)
Default constructor
Creates a default logger and IdCreator |
ObservationSubmitter(java.lang.String sosUrl,
IdCreator idCreator)
ObservationUpdater built with a custom idCreator |
ObservationSubmitter(java.lang.String sosUrl,
org.apache.log4j.Logger logger)
Built with a custom logger
creates a default IdCreator |
ObservationSubmitter(java.lang.String sosUrl,
org.apache.log4j.Logger logger,
IdCreator idCreator)
ObservationUpdater built with a custom idCreator and logger |
|
Method Summary |
void |
update(java.util.List<SosStation> stations,
ObservationRetriever observationRetriever,
PublisherInfo publisherInfo)
Pull: Update the SOS with observations pulled from the observationRetriever with
the each station and its phenomena
This code first checks if a station is already created in the
SOS with a DescribeSensor call. |
void |
update(ObservationCollection observationCollection,
PublisherInfo publisherInfo)
Push: Update the SOS with the given observationCollection |
void |
update(SosStation station,
ObservationRetriever observationRetriever,
PublisherInfo publisherInfo)
Pull: Update the SOS with observations pulled from the observationRetriever
with the passed in station with all its phenomena
This code first checks if a station is already created in the
SOS with a DescribeSensor call. |
void |
update(SosStation station,
SosSensor sensor,
ObservationRetriever observationRetriever)
Pull: Update the observations of a station with a specific phenomenon in the SOS server. |
void |
update(SosStation station,
SosSensor sensor,
SosPhenomenon phenomenon,
ObservationRetriever observationRetriever)
Pull: Update the observations of a station with a specific phenomenon in the SOS server. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObservationSubmitter
public ObservationSubmitter(java.lang.String sosUrl)
- Default constructor
Creates a default logger and IdCreator
- Parameters:
sosUrl - - the URL to the SOS server
ObservationSubmitter
public ObservationSubmitter(java.lang.String sosUrl,
org.apache.log4j.Logger logger)
- Built with a custom logger
creates a default IdCreator
- Parameters:
sosUrl - - the URL to the SOS serverlogger - - custom logger. Used to log information from the update process
ObservationSubmitter
public ObservationSubmitter(java.lang.String sosUrl,
IdCreator idCreator)
- ObservationUpdater built with a custom idCreator
- Parameters:
sosUrl - - the URL to the SOS serveridCreator - - custom idCreator. Used to create SOS IDs from stations and phenomena
ObservationSubmitter
public ObservationSubmitter(java.lang.String sosUrl,
org.apache.log4j.Logger logger,
IdCreator idCreator)
- ObservationUpdater built with a custom idCreator and logger
- Parameters:
sosUrl - - the URL to the SOS serveridCreator - - custom idCreator. Used to create SOS IDs from stations and phenomenalogger - - custom logger. Used to log information from the update process
update
public void update(ObservationCollection observationCollection,
PublisherInfo publisherInfo)
throws java.lang.Exception
- Push: Update the SOS with the given observationCollection
- Parameters:
observationCollection - - the data used to update the SOS
- Throws:
java.lang.Exception
update
public void update(java.util.List<SosStation> stations,
ObservationRetriever observationRetriever,
PublisherInfo publisherInfo)
throws java.lang.Exception
- Pull: Update the SOS with observations pulled from the observationRetriever with
the each station and its phenomena
This code first checks if a station is already created in the
SOS with a DescribeSensor call. Then if the station is not in the
SOS it is created with a RegisterSensor call to the SOS. Then a request
for the newest observations is called on the ObservationRetriever object.
- Parameters:
stations - - a list of stations used to pull observationsobservationRetriever - - the data store of observations used to
pull observations from
- Throws:
java.lang.Exception
update
public void update(SosStation station,
ObservationRetriever observationRetriever,
PublisherInfo publisherInfo)
throws java.lang.Exception
- Pull: Update the SOS with observations pulled from the observationRetriever
with the passed in station with all its phenomena
This code first checks if a station is already created in the
SOS with a DescribeSensor call. Then if the station is not in the
SOS it is created with a RegisterSensor call to the SOS. Then a request
for the newest observations is called on the ObservationRetriever object.
- Parameters:
station - - the station to be used to pull observationsobservationRetriever - - the data store of observations used to
pull observations from
- Throws:
java.lang.Exception
update
public void update(SosStation station,
SosSensor sensor,
ObservationRetriever observationRetriever)
throws java.lang.Exception
- Pull: Update the observations of a station with a specific phenomenon in the SOS server.
- Parameters:
station - - the station to pull observations
Requirement: The station is already createdsensor - - the sensor to pull observationsobservationRetriever - - the data store of observations used to
pull observations from
- Throws:
java.lang.Exception
update
public void update(SosStation station,
SosSensor sensor,
SosPhenomenon phenomenon,
ObservationRetriever observationRetriever)
throws java.lang.Exception
- Pull: Update the observations of a station with a specific phenomenon in the SOS server.
- Parameters:
station - - the station to pull observations.
Requirement: The station is already createdsensor - - the sensor to pull observations from.
Requirement: the sensor is already createdphenomenon - - the phenomenon to pull observationsobservationRetriever - - the data store of observations used to
pull observations from
- Throws:
java.lang.Exception
Copyright © 2012. All Rights Reserved.