Class RestMonitoringAdapter

  • All Implemented Interfaces:
    Adapter

    @Service
    public final class RestMonitoringAdapter
    extends org.glassfish.grizzly.http.server.HttpHandler
    implements Adapter
    The adapter class for the Rest Monitoring application.
    Author:
    Andrew Pielage
    • Constructor Detail

      • RestMonitoringAdapter

        public RestMonitoringAdapter()
    • Method Detail

      • postConstruct

        @PostConstruct
        public void postConstruct()
      • appExistsInConfig

        public boolean appExistsInConfig()
      • appExistsInConfig

        public boolean appExistsInConfig​(String contextRoot)
      • getSystemApplicationConfig

        public Application getSystemApplicationConfig()
        Gets the application config for the system application with the matching name or context root (in that order).
        Returns:
        The application config, or null if there is no matching application
      • getSystemApplicationConfig

        public Application getSystemApplicationConfig​(String contextRoot)
        Gets the application config for the system application with the matching context root. This method is used over the overloaded method if you want to skip trying to get the application config based on the application name, such as if you've reconfigured the application.
        Parameters:
        contextRoot - The context root of the application
        Returns:
        The application config, or null if there is no matching application.
      • service

        public void service​(org.glassfish.grizzly.http.server.Request request,
                            org.glassfish.grizzly.http.server.Response response)
                     throws Exception
        Specified by:
        service in class org.glassfish.grizzly.http.server.HttpHandler
        Throws:
        Exception
      • getHttpService

        public org.glassfish.grizzly.http.server.HttpHandler getHttpService()
        Description copied from interface: Adapter
        Get the underlying Grizzly HttpHandler.
        Specified by:
        getHttpService in interface Adapter
        Returns:
        the underlying Grizzly HttpHandler.
      • getContextRoot

        public String getContextRoot()
        Description copied from interface: Adapter
        Returns the context root for this adapter
        Specified by:
        getContextRoot in interface Adapter
        Returns:
        context root
      • getListenPort

        public int getListenPort()
        Description copied from interface: Adapter
        Returns the listener port for this adapter
        Specified by:
        getListenPort in interface Adapter
        Returns:
        listener port
      • getVirtualServers

        public List<String> getVirtualServers()
        Description copied from interface: Adapter
        Returns the virtual servers supported by this adapter
        Specified by:
        getVirtualServers in interface Adapter
        Returns:
        List<String> the virtual server list supported by the adapter
      • isRegistered

        public boolean isRegistered()
        Description copied from interface: Adapter
        Checks whether this adapter has been registered as a network endpoint.
        Specified by:
        isRegistered in interface Adapter
      • setRegistered

        public void setRegistered​(boolean isRegistered)
        Description copied from interface: Adapter
        Marks this adapter as having been registered or unregistered as a network endpoint
        Specified by:
        setRegistered in interface Adapter
      • isAppRegistered

        public boolean isAppRegistered()
      • setAppRegistered

        public void setAppRegistered​(boolean appRegistered)
      • isAppRegistered

        public boolean isAppRegistered​(String contextRoot)
        Overloaded method that checks if an application with the provided context root has been registered to this instance.
        Parameters:
        contextRoot - The context root to match.
        Returns:
        True if an application has been registered to this instance.