psdi.app.currency

Class Exchange

  • All Implemented Interfaces:
    java.rmi.Remote, ExchangeRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class Exchange
    extends Mbo
    implements ExchangeRemote
    MBO object to represent Exchange. The Exchange object stores and maintains the exchange rate between the different currencies. See Currency Package description for details.

    This is an organization level object.

    The key attribute for this object are OrgId, CurrencyCode, CurrencyCodeTo and ExpireDate.

    The attributes in this object are as follows:

    Attribute NameDescription
    ActiveDate Date on which the exchange rate becomes active.
    ChangeBy, ChangeDateThe name or user identifer of the person who last modified the record; the date when this record was last modified.
    CurrencyCodeCode used to identify the currency.
    CurrencyCodeTo The currency code to be used to convert from the currency code in the key field.
    EnterBy, EnterDateThe name or user identifer of the person entering this exchange rate; the date and time for this exchange rate creation.
    ExchangeRateThe exchange rate is the multiplier MAXIMO uses when calculating conversion from this currency to base currency.
    ExpireDateDate after which the exchange rate is no longer valid.
    MemoNote entered by user.
    OrgIdIdentifier of the organization for this Exchange.
    • Constructor Detail

      • Exchange

        public Exchange(MboSet ms)
                 throws MXException,
                        java.rmi.RemoteException
        Construct the exchange object.
        Parameters:
        ms -
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Initialize the exchange object. Set the changedate and changeby fields to be readonly always.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Adds an Exchange record.
        Attribute Name Attribute Value
        enterby Current username
        enterdate Current date
        changedate Current username
        changeby Current date
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • modify

        public void modify()
                    throws MXException,
                           java.rmi.RemoteException
        Called whenever a change is made to any attribute of a MBO. The programmer should override if interested in intercepting this event. If an MXException is thrown from this routine, the change of value is rolled back, this provides a mechanism to abort any changes. This method has overridden the Mbo.modify() method to set the changeby and the changedate fields whenever any attributes on the Exchange Mbo are altered.
        Overrides:
        modify in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • validateDates

        public void validateDates()
                           throws MXException,
                                  java.rmi.RemoteException
        Validates if the active date and the expire date on the current Mbo clashes with other dates specified on other Exchange rows with the same 'From' and 'To' currency When a new exchange rate is being entered, a validation occurs to make sure the active date is not after an existing active date and before an existing expiration date and that the expiration date is not after an existing active date and before and existing expiration date.
        Throws:
        MXException
        java.rmi.RemoteException