Class Registry


  • @Deprecated
    public class Registry
    extends java.lang.Object
    Deprecated.
    The scope of the APR/Native Library will be reduced in Tomcat 10.1.x / Tomcat Native 2.x onwards to only include those components required to provide OpenSSL integration with the NIO and NIO2 connectors.
    Windows Registry support
    Author:
    Mladen Turk
    • Constructor Summary

      Constructors 
      Constructor Description
      Registry()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static int close​(long key)
      Deprecated.
      Close the specified Registry key.
      static long create​(int root, java.lang.String name, int sam, long pool)
      Deprecated.
      Create or open a Registry Key.
      static int deleteKey​(int root, java.lang.String name, boolean onlyIfEmpty)
      Deprecated.
      Delete the Registry subkey
      static int deleteValue​(long key, java.lang.String name)
      Deprecated.
      Delete the Registry value
      static java.lang.String[] enumKeys​(long key)
      Deprecated.
      Enumerate the Registry subkeys
      static java.lang.String[] enumValues​(long key)
      Deprecated.
      Enumerate the Registry values
      static int getSize​(long key, java.lang.String name)
      Deprecated.
      Get the Registry key length.
      static int getType​(long key, java.lang.String name)
      Deprecated.
      Get the Registry key type.
      static java.lang.String[] getValueA​(long key, java.lang.String name)
      Deprecated.
      Get the Registry value for REG_MULTI_SZ
      static byte[] getValueB​(long key, java.lang.String name)
      Deprecated.
      Get the Registry value for REG_BINARY
      static int getValueI​(long key, java.lang.String name)
      Deprecated.
      Get the Registry value for REG_DWORD
      static long getValueJ​(long key, java.lang.String name)
      Deprecated.
      Get the Registry value for REG_QWORD or REG_DWORD
      static java.lang.String getValueS​(long key, java.lang.String name)
      Deprecated.
      Get the Registry value for REG_SZ or REG_EXPAND_SZ
      static long open​(int root, java.lang.String name, int sam, long pool)
      Deprecated.
      Opens the specified Registry Key.
      static int setValueA​(long key, java.lang.String name, java.lang.String[] val)
      Deprecated.
      Set the Registry value for REG_MULTI_SZ
      static int setValueB​(long key, java.lang.String name, byte[] val)
      Deprecated.
      Set the Registry value for REG_BINARY
      static int setValueE​(long key, java.lang.String name, java.lang.String val)
      Deprecated.
      Set the Registry value for REG_EXPAND_SZ
      static int setValueI​(long key, java.lang.String name, int val)
      Deprecated.
      Set the Registry value for REG_DWORD
      static int setValueJ​(long key, java.lang.String name, long val)
      Deprecated.
      Set the Registry value for REG_QWORD
      static int setValueS​(long key, java.lang.String name, java.lang.String val)
      Deprecated.
      Set the Registry value for REG_SZ
      • Methods inherited from class java.lang.Object

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

      • Registry

        public Registry()
        Deprecated.
    • Method Detail

      • create

        public static long create​(int root,
                                  java.lang.String name,
                                  int sam,
                                  long pool)
                           throws Error
        Deprecated.
        Create or open a Registry Key.
        Parameters:
        name - Registry Subkey to open
        root - Root key, one of HKEY_*
        sam - Access mask that specifies the access rights for the key.
        pool - Pool used for native memory allocation
        Returns:
        Opened Registry key
        Throws:
        Error - An error occurred
      • open

        public static long open​(int root,
                                java.lang.String name,
                                int sam,
                                long pool)
                         throws Error
        Deprecated.
        Opens the specified Registry Key.
        Parameters:
        name - Registry Subkey to open
        root - Root key, one of HKEY_*
        sam - Access mask that specifies the access rights for the key.
        pool - Pool used for native memory allocation
        Returns:
        Opened Registry key
        Throws:
        Error - An error occurred
      • close

        public static int close​(long key)
        Deprecated.
        Close the specified Registry key.
        Parameters:
        key - The Registry key descriptor to close.
        Returns:
        the operation status
      • getType

        public static int getType​(long key,
                                  java.lang.String name)
        Deprecated.
        Get the Registry key type.
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Value type or negative error value
      • getValueI

        public static int getValueI​(long key,
                                    java.lang.String name)
                             throws Error
        Deprecated.
        Get the Registry value for REG_DWORD
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Registry key value
        Throws:
        Error - An error occurred
      • getValueJ

        public static long getValueJ​(long key,
                                     java.lang.String name)
                              throws Error
        Deprecated.
        Get the Registry value for REG_QWORD or REG_DWORD
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Registry key value
        Throws:
        Error - An error occurred
      • getSize

        public static int getSize​(long key,
                                  java.lang.String name)
        Deprecated.
        Get the Registry key length.
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Value size or negative error value
      • getValueS

        public static java.lang.String getValueS​(long key,
                                                 java.lang.String name)
                                          throws Error
        Deprecated.
        Get the Registry value for REG_SZ or REG_EXPAND_SZ
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Registry key value
        Throws:
        Error - An error occurred
      • getValueA

        public static java.lang.String[] getValueA​(long key,
                                                   java.lang.String name)
                                            throws Error
        Deprecated.
        Get the Registry value for REG_MULTI_SZ
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Registry key value
        Throws:
        Error - An error occurred
      • getValueB

        public static byte[] getValueB​(long key,
                                       java.lang.String name)
                                throws Error
        Deprecated.
        Get the Registry value for REG_BINARY
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to query
        Returns:
        Registry key value
        Throws:
        Error - An error occurred
      • setValueI

        public static int setValueI​(long key,
                                    java.lang.String name,
                                    int val)
        Deprecated.
        Set the Registry value for REG_DWORD
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • setValueJ

        public static int setValueJ​(long key,
                                    java.lang.String name,
                                    long val)
        Deprecated.
        Set the Registry value for REG_QWORD
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • setValueS

        public static int setValueS​(long key,
                                    java.lang.String name,
                                    java.lang.String val)
        Deprecated.
        Set the Registry value for REG_SZ
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • setValueE

        public static int setValueE​(long key,
                                    java.lang.String name,
                                    java.lang.String val)
        Deprecated.
        Set the Registry value for REG_EXPAND_SZ
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • setValueA

        public static int setValueA​(long key,
                                    java.lang.String name,
                                    java.lang.String[] val)
        Deprecated.
        Set the Registry value for REG_MULTI_SZ
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • setValueB

        public static int setValueB​(long key,
                                    java.lang.String name,
                                    byte[] val)
        Deprecated.
        Set the Registry value for REG_BINARY
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to set
        val - The the value to set
        Returns:
        If the function succeeds, the return value is 0
      • enumKeys

        public static java.lang.String[] enumKeys​(long key)
                                           throws Error
        Deprecated.
        Enumerate the Registry subkeys
        Parameters:
        key - The Registry key descriptor to use.
        Returns:
        Array of all subkey names
        Throws:
        Error - An error occurred
      • enumValues

        public static java.lang.String[] enumValues​(long key)
                                             throws Error
        Deprecated.
        Enumerate the Registry values
        Parameters:
        key - The Registry key descriptor to use.
        Returns:
        Array of all value names
        Throws:
        Error - An error occurred
      • deleteValue

        public static int deleteValue​(long key,
                                      java.lang.String name)
        Deprecated.
        Delete the Registry value
        Parameters:
        key - The Registry key descriptor to use.
        name - The name of the value to delete
        Returns:
        If the function succeeds, the return value is 0
      • deleteKey

        public static int deleteKey​(int root,
                                    java.lang.String name,
                                    boolean onlyIfEmpty)
        Deprecated.
        Delete the Registry subkey
        Parameters:
        root - Root key, one of HKEY_*
        name - Subkey to delete
        onlyIfEmpty - If true will not delete a key if it contains any subkeys or values
        Returns:
        If the function succeeds, the return value is 0