edu.iris.dmc.service
Class BaseService
java.lang.Object
edu.iris.dmc.service.BaseService
- Direct Known Subclasses:
- EventService, RespService, SacpzService, StationService, WaveformService
public class BaseService
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_READ_TIMEOUT_IN_MS
public static int DEFAULT_READ_TIMEOUT_IN_MS
appName
protected String appName
baseUrl
protected String baseUrl
userAgent
protected String userAgent
username
protected String username
password
protected String password
BaseService
public BaseService(String version,
String v,
String userAgent)
authenticate
protected void authenticate(boolean authenticate)
getConnection
protected HttpURLConnection getConnection(String baseUrl,
String params)
throws IOException,
ServiceNotSupportedException
- Throws:
IOException
ServiceNotSupportedException
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.
- Parameters:
out
- criteria
-
- Throws:
NoDataFoundException
- (404)
CriteriaException
- (400)
IOException
ServiceNotSupportedException
UnauthorizedAccessException
setAppName
public void setAppName(String appName)
- Provide an appName included in the User-Agent. This text string is
intended to uniquely identify an application. Preferred string format:
"APPNAME/VERSION"
- Parameters:
appName
-
getAppName
public String getAppName()
- Returns:
- the App name used for User-Agent
getBaseUrl
public String getBaseUrl()
setBaseUrl
public void setBaseUrl(String url)
Copyright © 2013. All Rights Reserved.