Class GlassfishDomain

  • All Implemented Interfaces:
    java.io.Serializable

    public class GlassfishDomain
    extends java.lang.Object
    implements java.io.Serializable
    Readonly representation of Glassfish domain xml file.

    This representation focuses only on publishing server related aspects.

    For details on the several getters methods please read the Glassfish documentation.

    Use getInstance() and readInstance() to read it from cache or from disk.

    See Also:
    Serialized Form
    • Field Detail

      • DOMAIN_XML_FILE

        public static final java.lang.String DOMAIN_XML_FILE
        Relative location of domain xml file of Glassfish or Payara server.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GlassfishDomain

        public GlassfishDomain()
    • Method Detail

      • getInstance

        public static GlassfishDomain getInstance()
        Get current domain configuration. Will be read from disk if not already cached.
        Returns:
        instance
      • readInstance

        public static GlassfishDomain readInstance()
        Get current domain configuration from disk.
        Returns:
        glassfish domain
      • readInstance

        public static GlassfishDomain readInstance​(java.io.File file)
        Get domain configuration from a specified file.
        Parameters:
        file - the file
        Returns:
        glassfish domain
      • getApplication

        public GlassfishDomain.Application getApplication​(java.lang.String name)
        Gets application.
        Parameters:
        name - the name
        Returns:
        the application
      • getConfig

        public GlassfishDomain.Config getConfig​(java.lang.String name)
        Gets config.
        Parameters:
        name - the name
        Returns:
        the config
      • getConnectorConnectionPool

        public GlassfishDomain.ConnectorConnectionPool getConnectorConnectionPool​(java.lang.String name)
        Gets connector connection pool.
        Parameters:
        name - the name
        Returns:
        the connector connection pool
      • getConnectorConnectionPools

        public java.util.List<GlassfishDomain.ConnectorConnectionPool> getConnectorConnectionPools()
        Gets connector connection pools.
        Returns:
        the connector connection pools
      • getConnectorResource

        public GlassfishDomain.ConnectorResource getConnectorResource​(java.lang.String name)
        Gets connector resource.
        Parameters:
        name - the name
        Returns:
        the connector resource
      • getConnectorResourcePools

        public java.util.List<GlassfishDomain.ConnectorResource> getConnectorResourcePools()
        Gets connector resource pools.
        Returns:
        the connector resource pools
      • getDefaultConfig

        public GlassfishDomain.Config getDefaultConfig()
        Gets default config.
        Returns:
        the default config
      • getJdbcConnectionPool

        public GlassfishDomain.JdbcConnectionPool getJdbcConnectionPool​(java.lang.String name)
        Gets Jdbc connection pool.
        Parameters:
        name - the name
        Returns:
        the jdbc connection pool
      • getJdbcConnectionPools

        public java.util.List<GlassfishDomain.JdbcConnectionPool> getJdbcConnectionPools()
        Gets Jdbc connection pools.
        Returns:
        the jdbc connection pools
      • getJdbcResource

        public GlassfishDomain.JdbcResource getJdbcResource​(java.lang.String name)
        Gets Jdbc resource.
        Parameters:
        name - the name
        Returns:
        the jdbc resource
      • getJdbcResources

        public java.util.List<GlassfishDomain.JdbcResource> getJdbcResources()
        Gets Jdbc resources.
        Returns:
        the jdbc resources
      • getJmxPort

        public int getJmxPort()
        Gets jmx port.
        Returns:
        the jmx port
      • getResources

        public java.util.List<java.io.Serializable> getResources()
        Gets resources.
        Returns:
        the resources
      • getResources

        public <T> java.util.List<T> getResources​(java.lang.Class<T> clazz)
        Gets resources.
        Type Parameters:
        T - the type parameter
        Parameters:
        clazz - the clazz
        Returns:
        the resources
      • getServer

        public GlassfishDomain.Server getServer​(java.lang.String name)
        get a Server with a given name
        Parameters:
        name - name of the server
        Returns:
        Server with the given name
      • getServerConfig

        public GlassfishDomain.Config getServerConfig()
        Gets server config.
        Returns:
        Config server-config
      • hasJdbcConnectionPool

        public boolean hasJdbcConnectionPool​(java.lang.String name)
        Checks if JdbcConnection Pool exists for a given name
        Parameters:
        name - the name
        Returns:
        the boolean
      • hasJdbcResource

        public boolean hasJdbcResource​(java.lang.String jndiName)
        check if the given Jndi has a Jdbc resource
        Parameters:
        jndiName - as String
        Returns:
        true if the given Jndi has a Jdbc Resource. Otherwise, false.
      • isSecure

        public boolean isSecure()
        Is secure boolean.
        Returns:
        true if secureAdmin is enabled. Otherwise, false.