public class WeatherAPIService extends AppService
currentState, dbManager, INIT, liveObjCount, load, LOAD, mxServer, name, RUN, running, stateCmdList, stateList, STOP, url
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
WeatherAPIService() |
WeatherAPIService(MXServer mxServer) |
Modifier and Type | Method and Description |
---|---|
void |
checkConnection(MboRemote weatherOrg)
Process Asset Registry.
|
double |
distance(double lat1,
double lon1,
double lat2,
double lon2,
java.lang.String uom)
Calculate distance between 2 points using GPS Coordinates
|
java.util.Map |
getCurrentWeatherForGeocode(UserInfo userInfo,
double latY,
double longX,
java.lang.String productName)
Get current weather by latitude and longitude.
|
java.util.Map |
getCurrentWeatherForLocation(UserInfo userInfo,
java.lang.String postalCode,
java.lang.String locationCode,
java.lang.String country,
java.lang.String productName)
Get current weather by postal code and country.
|
java.util.Map |
getDailyForecastForGeocode(UserInfo userInfo,
double latY,
double longX,
int duration,
java.lang.String productName)
Get daily forecast by latitude and longitude.
|
java.util.Map |
getDailyForecastForLocation(UserInfo userInfo,
java.lang.String postalCode,
java.lang.String locationCode,
java.lang.String country,
int duration,
java.lang.String productName)
Get daily forecast by postal code and country.
|
java.util.Map |
getHistoricalWeatherForGeocode(UserInfo userInfo,
double latY,
double longX,
java.util.Date startDate,
java.util.Date endDate,
java.lang.String productName)
Get historical weather by latitude and longitude.
|
java.util.Map |
getHistoricalWeatherForLocation(UserInfo userInfo,
java.lang.String postalCode,
java.lang.String locationCode,
java.lang.String country,
java.util.Date startDate,
java.util.Date endDate,
java.lang.String productName)
Get historical weather by latitude and longitude.
|
java.util.Map |
getHourlyForecastForGeocode(UserInfo userInfo,
double latY,
double longX,
java.lang.String hours,
java.lang.String productName)
Get hourly forecast by latitude and longitude.
|
java.util.Map |
getHourlyForecastForLocation(UserInfo userInfo,
java.lang.String postalCode,
java.lang.String locationCode,
java.lang.String country,
java.lang.String hours,
java.lang.String productName)
Get hourly forecast by postal code and country.
|
java.util.List |
getProductCatalog(java.lang.String org)
Get product catalog.
|
MboSetRemote |
getServiceAddresses()
Register/Unregister Weather Organization End Points.
|
java.util.Map |
getWeatherAlertsDetails(UserInfo userInfo,
java.lang.String detailKey,
java.lang.String productName)
Get alerts details.
|
java.util.Map |
getWeatherAlertsForGeocode(UserInfo userInfo,
double latY,
double longX,
java.lang.String productName)
Get alerts by latitude and longitude.
|
java.util.Map |
getWeatherAlertsForLocation(UserInfo userInfo,
java.lang.String postalCode,
java.lang.String locationCode,
java.lang.String country,
java.lang.String productName)
Get weather alert by area id and country.
|
void |
init()
Init method
|
boolean |
isWeatherLicenseInstalled(java.lang.String productName) |
void |
logWeatherAPICall(java.lang.String productName,
java.lang.String resourceName,
UserInfo userInfo)
Insert data to weather asset table
|
void |
processAssetsRegistry(MboRemote weatherZone,
java.lang.String actioncode)
Process Asset Registry.
|
void |
registryEndPointsForAlerts(boolean register)
Register/Unregister Weather Organization End Points.
|
checkSecurity, configure, destroy, freeDBConnection, freeMboSet, getCriteria, getCriteriaList, getCurrentState, getDBConnection, getLiveObjCount, getLoad, getMaximoDD, getMaxVar, getMboSet, getMXServer, getName, getProfile, getProxy, getSchemaOwner, getServiceInfo, getServiceLogger, getSetForRelationship, getSetFromKeys, getStateCmdList, getStateList, getURL, initCriteriaList, isAppService, isRunning, isSingletonService, restart, setName, setProxy, setRunning, setURL, verifyUser, verifyUser
public WeatherAPIService(MXServer mxServer) throws java.rmi.RemoteException
mxServer
- The "Server Environment" this Service is being created in.java.rmi.RemoteException
public WeatherAPIService() throws java.rmi.RemoteException
java.rmi.RemoteException
public void init()
init
in interface Service
init
in class AppService
Service
public java.util.Map getCurrentWeatherForGeocode(UserInfo userInfo, double latY, double longX, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infolatY
- latitudelongX
- longitudeproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getDailyForecastForGeocode(UserInfo userInfo, double latY, double longX, int duration, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infolatY
- latitudelongX
- longitudeduration
- duration of forecast (can be 10, 5, 3)productName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getHourlyForecastForGeocode(UserInfo userInfo, double latY, double longX, java.lang.String hours, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infolatY
- latitudelongX
- longitudeduration
- duration of forecast in hoursproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getHistoricalWeatherForGeocode(UserInfo userInfo, double latY, double longX, java.util.Date startDate, java.util.Date endDate, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infolatY
- latitudelongX
- longitudestartDate
- start dateendDate
- end dateproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getWeatherAlertsForGeocode(UserInfo userInfo, double latY, double longX, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infolatY
- latitudelongX
- longitudeproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getWeatherAlertsDetails(UserInfo userInfo, java.lang.String detailKey, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infodetailKey
- detail keyproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getCurrentWeatherForLocation(UserInfo userInfo, java.lang.String postalCode, java.lang.String locationCode, java.lang.String country, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infopostalCode
- postal codelocationCode
- location codecountry
- countryproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getDailyForecastForLocation(UserInfo userInfo, java.lang.String postalCode, java.lang.String locationCode, java.lang.String country, int duration, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infopostalCode
- postal codelocationCode
- location codecountry
- countryduration
- duration of forecast (can be 10, 5, 3)productName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getHourlyForecastForLocation(UserInfo userInfo, java.lang.String postalCode, java.lang.String locationCode, java.lang.String country, java.lang.String hours, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infopostalCode
- postal codelocationCode
- location codecountry
- countryduration
- duration of forecast in hoursproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getHistoricalWeatherForLocation(UserInfo userInfo, java.lang.String postalCode, java.lang.String locationCode, java.lang.String country, java.util.Date startDate, java.util.Date endDate, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infopostalCode
- postal codelocationCode
- location codecountry
- countrystartDate
- start dateendDate
- end dateproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.Map getWeatherAlertsForLocation(UserInfo userInfo, java.lang.String postalCode, java.lang.String locationCode, java.lang.String country, java.lang.String productName) throws java.rmi.RemoteException, MXException
userInfo
- user infopostalCode
- postal codelocationCode
- area idcountry
- countryproductName
- Product NameMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic void checkConnection(MboRemote weatherOrg) throws java.rmi.RemoteException, MXException
org
- organizationassetInfo
- weather asset infoapiKey
- API KeyendPointName
- end point nameuserInfo
- user infoMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic MboSetRemote getServiceAddresses() throws java.rmi.RemoteException, MXException
userInfo
- user infoMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic void registryEndPointsForAlerts(boolean register) throws java.rmi.RemoteException, MXException
userInfo
- user infoMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic void processAssetsRegistry(MboRemote weatherZone, java.lang.String actioncode) throws java.rmi.RemoteException, MXException
org
- organizationassetInfo
- weather asset infoapiKey
- API KeyendPointName
- end point nameuserInfo
- user infoMXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic java.util.List getProductCatalog(java.lang.String org) throws java.rmi.RemoteException, MXException
MXException
- Maximo Exceptionjava.rmi.RemoteException
- Remote Exceptionpublic boolean isWeatherLicenseInstalled(java.lang.String productName) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void logWeatherAPICall(java.lang.String productName, java.lang.String resourceName, UserInfo userInfo) throws MXException, java.rmi.RemoteException
org
- organizationassetInfo
- Weather Asset Infoconn
- database connection to execute statementjo
- JSON ObjectMXException
- MAXIMO exceptionjava.rmi.RemoteException
public double distance(double lat1, double lon1, double lat2, double lon2, java.lang.String uom) throws java.rmi.RemoteException, MXException
org
- organizationrefId
- refercence Idconn
- database connection to execute statementMXException
- MAXIMO exceptionjava.rmi.RemoteException