Class Registry


  • public class Registry
    extends java.lang.Object
    Represents the current TDI installation including installed components and fixes that have been applied.
    • Constructor Summary

      Constructors 
      Constructor Description
      Registry​(java.lang.String installDir)
      Class constructor that takes an installation directory
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump()
      Outputs information about this TDI installation to standard out.
      boolean getClobber()
      Gets the clobber variable
      InstalledComponent getComponent​(java.lang.String name)
      Gets the object representing the specified name if this TDI installation has it installed.
      java.lang.String getEdition()
      Gets the edition
      java.lang.Object[] getFixes()
      Gets the fixes applied to this TDI installation
      static java.lang.String getFixName​(java.lang.String fix)  
      java.lang.String getInstallDir()
      Gets the install directory location
      java.lang.Object[] getInstalledComponents()
      Gets the components installed for this TDI installation
      java.lang.String getLevel()
      Gets the TDI level
      java.lang.String getLicenseType()
      Gets the license type
      boolean isInstalled​(java.lang.String component)
      Tells if a certain component is installed
      void restore()
      Updates the .registry file during a rollback operation
      void setClobber​(boolean c)
      Sets the clobber variable
      void setLevel​(java.lang.String l)
      Sets the level variable
      void setLicenseType​(java.lang.String ltype)
      Sets the license type
      int update​(Fix fix, boolean clean)
      Updates the .registry file after a rollback or update.
      int updateCommon()
      performs actual writing of the .registry during an update.
      • Methods inherited from class java.lang.Object

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

      • Registry

        public Registry​(java.lang.String installDir)
                 throws java.lang.Exception
        Class constructor that takes an installation directory
        Parameters:
        installDir - The TDI installation directory
        Throws:
        java.lang.Exception - If an error occurs while reading the .registry file in the specified location
    • Method Detail

      • setClobber

        public void setClobber​(boolean c)
        Sets the clobber variable
        Parameters:
        c - true or false indicating if we are in a clobber case
      • getClobber

        public boolean getClobber()
        Gets the clobber variable
        Returns:
        true if this is a clobber case, false otherwise
      • setLevel

        public void setLevel​(java.lang.String l)
        Sets the level variable
        Parameters:
        l - The TDI level
      • getLevel

        public java.lang.String getLevel()
        Gets the TDI level
        Returns:
        The TDI level
      • getInstallDir

        public java.lang.String getInstallDir()
        Gets the install directory location
        Returns:
        TDI install directory
      • getEdition

        public java.lang.String getEdition()
        Gets the edition
        Returns:
        The edition of this install as indicated in FixUtils
        See Also:
        FixUtils
      • getLicenseType

        public java.lang.String getLicenseType()
        Gets the license type
        Returns:
        The license type of this install as indicated in FixUtils
        See Also:
        FixUtils
      • setLicenseType

        public void setLicenseType​(java.lang.String ltype)
        Sets the license type
        See Also:
        FixUtils
      • getFixes

        public java.lang.Object[] getFixes()
        Gets the fixes applied to this TDI installation
        Returns:
        An array with a list of fixes applied
      • getInstalledComponents

        public java.lang.Object[] getInstalledComponents()
        Gets the components installed for this TDI installation
        Returns:
        An array representation of the installed TDI components
      • getComponent

        public InstalledComponent getComponent​(java.lang.String name)
        Gets the object representing the specified name if this TDI installation has it installed.
        Parameters:
        name - The name of the component to look for
        Returns:
        The object representing the specified component or null if not found
      • isInstalled

        public boolean isInstalled​(java.lang.String component)
        Tells if a certain component is installed
        Parameters:
        component - The name of the component to search for
        Returns:
        true if the component was found, false otherwise
        See Also:
        FixUtils
      • restore

        public void restore()
        Updates the .registry file during a rollback operation
      • update

        public int update​(Fix fix,
                          boolean clean)
        Updates the .registry file after a rollback or update.
        Parameters:
        fix - The fix we are adding or null if we are rolling back
        clean - If true, clear the registry
        Returns:
        0 if the update was successful, nonzero otherwise
      • updateCommon

        public int updateCommon()
        performs actual writing of the .registry during an update.
        Returns:
        0 if the update was successful, nonzero otherwise
      • dump

        public void dump()
        Outputs information about this TDI installation to standard out.
      • getFixName

        public static java.lang.String getFixName​(java.lang.String fix)