com.ibm.tivoli.maximo.weather

Class WeatherUtils

  • java.lang.Object
    • com.ibm.tivoli.maximo.weather.WeatherUtils


  • public class WeatherUtils
    extends java.lang.Object
    • Constructor Detail

      • WeatherUtils

        public WeatherUtils()
    • Method Detail

      • createEvent

        public static void createEvent(java.lang.String productCode,
                                       UserInfo userInfo)
                                throws java.rmi.RemoteException,
                                       MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • createSubscription

        public static void createSubscription(java.lang.String productCode,
                                              java.lang.String personid,
                                              UserInfo userInfo)
                                       throws java.rmi.RemoteException,
                                              MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getLatitudeLongitudeForWO

        public static WeatherAddress getLatitudeLongitudeForWO(MboRemote workOrder)
                                                        throws java.rmi.RemoteException,
                                                               MXException
        Gets the latitude and longitude for work order. The returning object is an array of double values. The first position [0] holds the Latitude, while the second position [1] holds the Longitude. In case, there is no lat/long set for this WO, a null object shall be returned. It searches for SA on the WO, then ASSET, and then LOCATION, returning null if no SA is found.
        Parameters:
        workOrder -
        Returns:
        An array of doubles containing the latitude and the longitude for the Work Order.
        Throws:
        MXException
        java.rmi.RemoteException
      • getWeatherLookup

        public static WeatherForecastLookup getWeatherLookup(long woid,
                                                             java.util.Date start,
                                                             java.util.Date end,
                                                             UserInfo userInfo)
                                                      throws java.rmi.RemoteException,
                                                             MXException
        Retrieve weather lookup information, using: WONUM, SCHEDSTART and SCHEDFINISH. Weather Lookup info is composed by latitude, longitude, and weather forecast type.
        Parameters:
        woNum - - Work Order number.
        start - - Start Date.
        end - - End Date.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • GetWeatherConfig

        public static WeatherConfig GetWeatherConfig(java.lang.String appname,
                                                     java.lang.String weatherName,
                                                     java.lang.String portforlio,
                                                     UserInfo userInfo)
                                              throws java.rmi.RemoteException,
                                                     MXException
        Retrieve weather config information, using: appname, weatherName,portfolio .
        Parameters:
        appname - - application name.
        weatherName - - Weather config name.
        portfolio - - Current,Daily or Hourly.
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • woInWeatherAlertLifeSpan

        public boolean woInWeatherAlertLifeSpan(MboRemote wo,
                                                MboRemote alertImpact)
                                         throws java.rmi.RemoteException,
                                                MXException
        check if wo schedule is in alert life span
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • assignmentInWeatherAlertLifeSpan

        public boolean assignmentInWeatherAlertLifeSpan(Assignment assignment,
                                                        WeatherAlertImpact alertImpact)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        check if wo schedule is in alert life span
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • overlapAlert

        public boolean overlapAlert(java.util.Date WorkStart,
                                    java.util.Date WorkFinish,
                                    MboRemote alertImpact)
                             throws java.rmi.RemoteException,
                                    MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • woInWeatherZone

        public boolean woInWeatherZone(MboRemote wo,
                                       MboRemote zone)
                                throws java.rmi.RemoteException,
                                       MXException
        Calculaye distance beween two weather address and weather zone
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • geoDistance

        public double geoDistance(WeatherAddress addr,
                                  MboRemote zone)
                           throws java.rmi.RemoteException,
                                  MXException
        Calculate distance between two weather address and weather zone
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • getLifeSpanMin

        public int getLifeSpanMin(java.lang.String lifespan)
                           throws java.rmi.RemoteException,
                                  MXException
        getLifespan in min fromString like 2d,12h,60m
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • getWeatherAlertImpactForLoc

        public MboSetRemote getWeatherAlertImpactForLoc(WeatherAddress addr,
                                                        UserInfo userInfo)
                                                 throws java.rmi.RemoteException,
                                                        MXException
        Calculate distance between two weather address and weather zone
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • getweatherAlertForAddr

        public java.lang.String getweatherAlertForAddr(java.util.Date apptdate,
                                                       WeatherAddress addr,
                                                       UserInfo userinfo)
                                                throws java.rmi.RemoteException,
                                                       MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • locationInWeatherZone

        public boolean locationInWeatherZone(WeatherAddress addr,
                                             MboRemote zone)
                                      throws java.rmi.RemoteException,
                                             MXException
        check if location in weather zone
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException
      • geoDistance

        public static double geoDistance(double lat1,
                                         double lon1,
                                         double lat2,
                                         double lon2,
                                         java.lang.String uom)
                                  throws java.rmi.RemoteException,
                                         MXException
        Calculate distance between two geo points
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException