Class GlassfishDomain

java.lang.Object
com.priint.pubserver.appserver.GlassfishDomain
All Implemented Interfaces:
Serializable

public class GlassfishDomain extends Object implements 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:
  • Field Details

    • DOMAIN_XML_FILE

      public static final String DOMAIN_XML_FILE
      Relative location of domain xml file of Glassfish or Payara server.
      See Also:
  • Constructor Details

    • GlassfishDomain

      public GlassfishDomain()
  • Method Details

    • 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(File file)
      Get domain configuration from a specified file.
      Parameters:
      file - the file
      Returns:
      glassfish domain
    • getApplication

      public GlassfishDomain.Application getApplication(String name)
      Gets application.
      Parameters:
      name - the name
      Returns:
      the application
    • getApplications

      public List<GlassfishDomain.Application> getApplications()
      Gets applications.
      Returns:
      the applications
    • getConfig

      public GlassfishDomain.Config getConfig(String name)
      Gets config.
      Parameters:
      name - the name
      Returns:
      the config
    • getConfigs

      public List<GlassfishDomain.Config> getConfigs()
      Gets configs.
      Returns:
      the configs
    • getConnectorConnectionPool

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

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

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

      public 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(String name)
      Gets Jdbc connection pool.
      Parameters:
      name - the name
      Returns:
      the jdbc connection pool
    • getJdbcConnectionPools

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

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

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

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

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

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

      public GlassfishDomain.Server getServer(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
    • getServers

      public List<GlassfishDomain.Server> getServers()
      Gets servers.
      Returns:
      List servers
    • hasJdbcConnectionPool

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

      public boolean hasJdbcResource(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.