psdi.app.measurement

Class MeasurementService

    • Constructor Detail

      • MeasurementService

        public MeasurementService()
                           throws java.rmi.RemoteException
        Constructor for MeasurementService.
        Throws:
        java.rmi.RemoteException
      • MeasurementService

        public MeasurementService(MXServer mxServer)
                           throws java.rmi.RemoteException
        Constructor for MeasurementService.
        Parameters:
        mxServer - -- the "Server Environment" this Service is being created in.
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • getConversionFactor

        public double getConversionFactor(UserInfo userInfo,
                                          java.lang.String fromUOM,
                                          java.lang.String toUOM)
                                   throws MXException,
                                          java.rmi.RemoteException
        Returns the conversion factor that will convert the "from" unit of measure (UOM) to the "to" unit of measure.
        This method checks the Conversion table as follows:
        1. - If the "form" & "to" units of measure (UOMs) are the same, returns 1.
        2. - Checks the conversion table for a match for the UOMs and returns the factor if a match is found.
        3. - If no match is found, checks the table for the inverse conversion factor for the UOMs and returns 1/factor if a match is found.
        4. - If no match is found, throws an exception.

        Specified by:
        getConversionFactor in interface MeasurementServiceRemote
        Parameters:
        UserInfo - The userInfo of the calling Mbo.
        fromUOM - The unit of measure(UOM) to be converted from.
        toUOM - The unit of measure to be converted to.
        Throws:
        ParametesAreRequired - if either UOM parameter is empty.
        FactorDoesNotExist - if a valid relationship does not exist.
        MXException
        java.rmi.RemoteException