public class WeatherAPIService extends AppService
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<java.lang.String,java.lang.Object> |
getCurrentWeatherForGeocode(UserInfo userInfo,
double latY,
double longX,
java.lang.String productName)
Get current weather by latitude and longitude.
|
java.util.Map<java.lang.String,java.lang.Object> |
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<java.lang.String,java.lang.Object> |
getDailyForecastForGeocode(UserInfo userInfo,
double latY,
double longX,
int duration,
java.lang.String productName)
Get daily forecast by latitude and longitude.
|
java.util.Map<java.lang.String,java.lang.Object> |
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<java.lang.String,java.lang.Object> |
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<java.lang.String,java.lang.Object> |
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<java.lang.String,java.lang.Object> |
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<java.lang.String,java.lang.Object> |
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<java.lang.Object> |
getProductCatalog(java.lang.String org)
Get product catalog.
|
MboSetRemote |
getServiceAddresses()
Register/Unregister Weather Organization End Points.
|
java.util.Map<java.lang.String,java.lang.Object> |
getWeatherAlertsDetails(UserInfo userInfo,
java.lang.String detailKey,
java.lang.String productName)
Get alerts details.
|
java.util.Map<java.lang.String,java.lang.Object> |
getWeatherAlertsForGeocode(UserInfo userInfo,
double latY,
double longX,
java.lang.String productName)
Get alerts by latitude and longitude.
|
java.util.Map<java.lang.String,java.lang.Object> |
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, getCurrentState, getDBConnection, getLiveObjCount, getLoad, getMaximoDD, getMaxVar, getMboSet, getMXServer, getName, getProfile, getProxy, getSchemaOwner, getServiceInfo, getServiceLogger, getSetForRelationship, getSetFromKeys, getStateCmdList, getStateList, getURL, initCriteriaList, isAppService, isRunning, isSingletonService, restart, 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.String,java.lang.Object> 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<java.lang.Object> 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