edu.iris.dmc.service
Class EventService

java.lang.Object
  extended by edu.iris.dmc.service.BaseService
      extended by edu.iris.dmc.service.EventService

public class EventService
extends BaseService

Event service is the main class for querying the Event service


Field Summary
 
Fields inherited from class edu.iris.dmc.service.BaseService
appName, baseUrl, DEFAULT_READ_TIMEOUT_IN_MS, password, userAgent, username
 
Constructor Summary
EventService(String baseUrl, String version, String compatabilityVersion, String userAgent)
           
 
Method Summary
 List<Event> fetch(EventCriteria criteria)
          fetch events from IRIS event service
 Event get(Long id, boolean includeMagnitudes)
          A convenient method to retrieve a single event when the id is provided.
 List<Event> load(InputStream inputStream)
          Load events from inputstream, example local file
 void stream(OutputStream out, Criteria criteria)
          Stream result into output stream, can be used to save result to a local file.
 
Methods inherited from class edu.iris.dmc.service.BaseService
authenticate, getAppName, getBaseUrl, getConnection, setAppName, setBaseUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventService

public EventService(String baseUrl,
                    String version,
                    String compatabilityVersion,
                    String userAgent)
Method Detail

get

public Event get(Long id,
                 boolean includeMagnitudes)
          throws NoDataFoundException,
                 IOException
A convenient method to retrieve a single event when the id is provided. The id is data center specific.

Parameters:
id -
includeMagnitudes -
Returns:
the Event
Throws:
IOException
NoDataFoundException

stream

public void stream(OutputStream out,
                   Criteria criteria)
            throws NoDataFoundException,
                   CriteriaException,
                   IOException,
                   ServiceNotSupportedException,
                   UnauthorizedAccessException
Stream result into output stream, can be used to save result to a local file.

Overrides:
stream in class BaseService
Parameters:
out -
criteria -
Throws:
NoDataFoundException - (404)
CriteriaException - (400)
IOException
ServiceNotSupportedException
UnauthorizedAccessException

fetch

public List<Event> fetch(EventCriteria criteria)
                  throws NoDataFoundException,
                         CriteriaException,
                         IOException,
                         ServiceNotSupportedException
fetch events from IRIS event service

Parameters:
criteria -
Returns:
list of events
Throws:
NoDataFoundException
CriteriaException
ServiceNotSupportedException
IOException

load

public List<Event> load(InputStream inputStream)
                 throws IOException
Load events from inputstream, example local file

Parameters:
inputStream -
Returns:
list of events
Throws:
IOException


Copyright © 2013. All Rights Reserved.