psdi.app.bim.loader

Class LoaderUtils

  • java.lang.Object
    • psdi.app.bim.loader.LoaderUtils
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected void addCurrencyCode(java.util.Currency currency) 
      protected boolean addUnitOfMeasure(java.lang.String unit, java.lang.String abreviation, java.lang.String description, java.lang.String siteId) 
      static java.lang.String arrayToCommaString(java.lang.String[] values) 
      protected boolean doUpdate(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item) 
      java.text.NumberFormat getFormater() 
      ModelProcessIntf getLoader() 
      int getUnitFieldLength() 
      int getUpdateMode() 
      static boolean isNotInternetEmail(java.lang.String value)
      Quick heuristic to filter out values that are not Internet email addresses Not guaranteed to filter all bad addresses, but won't eliminate any good ones
      boolean isValidDomainName(java.lang.String name)
      Validates that a domain name conforms to the widely accepted TLD format.
      boolean isValidEmail(java.lang.String address) 
      void logException(Page page, ItemBase item, java.lang.Throwable t) 
      static java.lang.String messageFromException(java.lang.Throwable t) 
      boolean setDateValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item) 
      void setDescriptionValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
      Sets an optional description field on any Mbo with check for null, logic for exception handling, and warning message on failure.
      boolean setDurationValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item) 
      protected void setFloatValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
      Sets an optional float value on any Mbo with check for null, that it is a valid integer, exception handling, and warning message on failure
      protected void setIntValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
      Sets an optional integer value on any Mbo with check for null, that it is a valid integer, exception handling, and warning message on failure
      protected void setMeasurmentValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
      Sets an optional measurement value on any Mbo with check for null, that it is a valid.
      protected void setReference(MboRemote mbo, java.lang.String attribute, java.lang.String value)
      Sets a reference between Mbos.
      protected void setReference(MboRemote mbo, java.lang.String attribute, java.lang.String value, long flags)
      Sets a reference between Mbos.
      protected void setString(MboRemote mbo, java.lang.String attribute, java.lang.String value)
      Sets a string value that is not directly from a COBie item class or that the calling code needs to trap exceptions for
      protected boolean setStringValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item)
      Sets a string value that is not directly from a COBie item class or that the calling code needs to trap exceptions for
      void setTimestamp(MboRemote mbo, java.lang.String attribute, ItemBase item) 
      boolean setUnitValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item) 
      boolean setUnitValue(MboRemote mbo, java.lang.String attribute, java.lang.String value, ItemBase item, boolean logError)
      Sets an Mbo unit of measure value.
      static boolean valueHasContent(java.lang.String value) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getUpdateMode

        public int getUpdateMode()
      • getFormater

        public java.text.NumberFormat getFormater()
      • getUnitFieldLength

        public int getUnitFieldLength()
      • addCurrencyCode

        protected void addCurrencyCode(java.util.Currency currency)
                                throws java.rmi.RemoteException,
                                       MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • addUnitOfMeasure

        protected boolean addUnitOfMeasure(java.lang.String unit,
                                           java.lang.String abreviation,
                                           java.lang.String description,
                                           java.lang.String siteId)
      • doUpdate

        protected boolean doUpdate(MboRemote mbo,
                                   java.lang.String attribute,
                                   java.lang.String value,
                                   ItemBase item)
      • isValidDomainName

        public boolean isValidDomainName(java.lang.String name)
        Validates that a domain name conforms to the widely accepted TLD format.

        Note: The formal definition of allowable domain names is much looser. This method uses the stricter definition in common practice for registered domains

        Parameters:
        name -
        Returns:
      • logException

        public void logException(Page page,
                                 ItemBase item,
                                 java.lang.Throwable t)
      • isValidEmail

        public boolean isValidEmail(java.lang.String address)
      • setDateValue

        public boolean setDateValue(MboRemote mbo,
                                    java.lang.String attribute,
                                    java.lang.String value,
                                    ItemBase item)
      • setDescriptionValue

        public void setDescriptionValue(MboRemote mbo,
                                        java.lang.String attribute,
                                        java.lang.String value,
                                        ItemBase item)
        Sets an optional description field on any Mbo with check for null, logic for exception handling, and warning message on failure. The value is trucated if necessary to fit in the base field, and if it was truncated, the long description field is set with the full value
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
        item - The item that was the source of the value, Used for error reporting
      • setDurationValue

        public boolean setDurationValue(MboRemote mbo,
                                        java.lang.String attribute,
                                        java.lang.String value,
                                        ItemBase item)
      • setFloatValue

        protected void setFloatValue(MboRemote mbo,
                                     java.lang.String attribute,
                                     java.lang.String value,
                                     ItemBase item)
        Sets an optional float value on any Mbo with check for null, that it is a valid integer, exception handling, and warning message on failure
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
      • setIntValue

        protected void setIntValue(MboRemote mbo,
                                   java.lang.String attribute,
                                   java.lang.String value,
                                   ItemBase item)
        Sets an optional integer value on any Mbo with check for null, that it is a valid integer, exception handling, and warning message on failure
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
      • setMeasurmentValue

        protected void setMeasurmentValue(MboRemote mbo,
                                          java.lang.String attribute,
                                          java.lang.String value,
                                          ItemBase item)
        Sets an optional measurement value on any Mbo with check for null, that it is a valid. Attempts to remove any trailing not numeric character - typical a units designation integer, exception handling, and warning message on failure
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
      • setReference

        protected void setReference(MboRemote mbo,
                                    java.lang.String attribute,
                                    java.lang.String value)
                             throws java.rmi.RemoteException,
                                    MXException
        Sets a reference between Mbos. Handled separately to allow a control point on update policy
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
        Throws:
        java.rmi.RemoteException
        MXException
      • setReference

        protected void setReference(MboRemote mbo,
                                    java.lang.String attribute,
                                    java.lang.String value,
                                    long flags)
                             throws java.rmi.RemoteException,
                                    MXException
        Sets a reference between Mbos. Handled separately to allow a control point on update policy
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
        Throws:
        java.rmi.RemoteException
        MXException
      • setString

        protected void setString(MboRemote mbo,
                                 java.lang.String attribute,
                                 java.lang.String value)
                          throws java.rmi.RemoteException,
                                 MXException
        Sets a string value that is not directly from a COBie item class or that the calling code needs to trap exceptions for
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
        Throws:
        MXException
        java.rmi.RemoteException
      • setStringValue

        protected boolean setStringValue(MboRemote mbo,
                                         java.lang.String attribute,
                                         java.lang.String value,
                                         ItemBase item)
        Sets a string value that is not directly from a COBie item class or that the calling code needs to trap exceptions for
        Parameters:
        mbo - Target Mbo
        attribute - Attribute name
        value - New value for field
      • setTimestamp

        public void setTimestamp(MboRemote mbo,
                                 java.lang.String attribute,
                                 ItemBase item)
      • setUnitValue

        public boolean setUnitValue(MboRemote mbo,
                                    java.lang.String attribute,
                                    java.lang.String value,
                                    ItemBase item)
      • setUnitValue

        public boolean setUnitValue(MboRemote mbo,
                                    java.lang.String attribute,
                                    java.lang.String value,
                                    ItemBase item,
                                    boolean logError)
        Sets an Mbo unit of measure value. Depending on policy, it may add it to the unit of measure table (if missing) or not validate it
        Parameters:
        mbo -
        attribute -
        value -
        item -
        logError -
        Returns:
      • arrayToCommaString

        public static java.lang.String arrayToCommaString(java.lang.String[] values)
      • isNotInternetEmail

        public static boolean isNotInternetEmail(java.lang.String value)
        Quick heuristic to filter out values that are not Internet email addresses Not guaranteed to filter all bad addresses, but won't eliminate any good ones
        Parameters:
        value -
        Returns:
      • messageFromException

        public static java.lang.String messageFromException(java.lang.Throwable t)
      • valueHasContent

        public static boolean valueHasContent(java.lang.String value)