Class InstallHelper


  • public class InstallHelper
    extends Object
    Group of methods intended to streamline the PL/Java installation/startup experience.
    Author:
    Chapman Flack
    • Constructor Summary

      Constructors 
      Constructor Description
      InstallHelper()  
    • Method Summary

      Modifier and Type Method Description
      static void groundwork​(String module_pathname, String loadpath_tbl, String loadpath_tbl_quoted, boolean asExtension, boolean exNihilo)
      When PL/Java is loaded as an end-in-itself (that is, by LOAD on its own or from its extension script on CREATE EXTENSION or ALTER EXTENSION, not just in the course of handling a call of a Java function), this method will be called to ensure there is a schema sqlj and that it contains the right, possibly updated, stuff.
      static String hello​(String nativeVer, String serverBuiltVer, String serverRunningVer, String user, String dbname, String clustername, String datadir, String libdir, String sharedir, String etcdir)
      Perform miscellaneous early PL/Java initialization, and return a string detailing the versions of PL/Java, PostgreSQL, and Java in use, which the native caller can use in its "PL/Java loaded" (a/k/a "hello") triumphant ereport.
    • Constructor Detail

      • InstallHelper

        public InstallHelper()
    • Method Detail

      • hello

        public static String hello​(String nativeVer,
                                   String serverBuiltVer,
                                   String serverRunningVer,
                                   String user,
                                   String dbname,
                                   String clustername,
                                   String datadir,
                                   String libdir,
                                   String sharedir,
                                   String etcdir)
                            throws SQLException
        Perform miscellaneous early PL/Java initialization, and return a string detailing the versions of PL/Java, PostgreSQL, and Java in use, which the native caller can use in its "PL/Java loaded" (a/k/a "hello") triumphant ereport.

        This method calls beginEnforcing rather late, so that the policy needn't be cluttered with permissions for the operations only needed before that point. Policy is being enforced by the time this method returns (except in case of JEP 411 fallback as described at beginEnforcing).

        Throws:
        SQLException
      • groundwork

        public static void groundwork​(String module_pathname,
                                      String loadpath_tbl,
                                      String loadpath_tbl_quoted,
                                      boolean asExtension,
                                      boolean exNihilo)
                               throws SQLException,
                                      ParseException,
                                      IOException
        When PL/Java is loaded as an end-in-itself (that is, by LOAD on its own or from its extension script on CREATE EXTENSION or ALTER EXTENSION, not just in the course of handling a call of a Java function), this method will be called to ensure there is a schema sqlj and that it contains the right, possibly updated, stuff.
        Throws:
        SQLException
        ParseException
        IOException