Class AdminConsolePlugin
- java.lang.Object
-
- org.jivesoftware.openfire.container.AdminConsolePlugin
-
-
Field Summary
Fields Modifier and Type Field Description static SystemProperty<Boolean>
ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_ENABLED
Enable / Disable adding a 'Content-Security-Policy' HTTP header to the response to requests made against the admin console.static SystemProperty<String>
ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_RESPONSEVALUE
The header value when adding a 'Content-Security-Policy' HTTP header to the response to requests made against the admin console.static SystemProperty<Boolean>
ADMIN_CONSOLE_FORWARDED
Enable / Disable parsing a 'X-Forwarded-For' style HTTP header of HTTP requests.static SystemProperty<String>
ADMIN_CONSOLE_FORWARDED_FOR
The HTTP header name for 'forwarded for'static SystemProperty<String>
ADMIN_CONSOLE_FORWARDED_HOST
The HTTP header name for 'forwarded hosts'.static SystemProperty<String>
ADMIN_CONSOLE_FORWARDED_HOST_NAME
Sets a forced valued for the host header.static SystemProperty<String>
ADMIN_CONSOLE_FORWARDED_SERVER
The HTTP header name for 'forwarded server'.static String
secret
Random secret used by JVM to allow SSO.
-
Constructor Summary
Constructors Constructor Description AdminConsolePlugin()
Create a Jetty module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroyPlugin()
Destroys the plugin.int
getAdminSecurePort()
Returns the TLS port on which the admin console is current operating.int
getAdminUnsecurePort()
Returns the non-TLS port on which the admin console is currently operating.String
getBindInterface()
Returnsnull
if the admin console will be available in all network interfaces of this machine or a String representing the only interface where the admin console will be available.org.eclipse.jetty.server.handler.ContextHandlerCollection
getContexts()
Returns the collection of Jetty contexts used in the admin console.void
initializePlugin(PluginManager manager, File pluginDir)
Initializes the plugin.boolean
isRestartNeeded()
Returns true if the Jetty server needs to be restarted.void
pauseAutoRestartEnabled(Duration pause)
Temporarily disables auto-restarting of the plugin's webserver when certificate changes are detected.void
restart()
Restart the admin console (and it's HTTP server) without restarting the plugin.protected void
shutdown()
Shuts down the Jetty server.protected void
startup()
Starts the Jetty instance.
-
-
-
Field Detail
-
ADMIN_CONSOLE_FORWARDED
public static final SystemProperty<Boolean> ADMIN_CONSOLE_FORWARDED
Enable / Disable parsing a 'X-Forwarded-For' style HTTP header of HTTP requests.
-
ADMIN_CONSOLE_FORWARDED_FOR
public static final SystemProperty<String> ADMIN_CONSOLE_FORWARDED_FOR
The HTTP header name for 'forwarded for'
-
ADMIN_CONSOLE_FORWARDED_SERVER
public static final SystemProperty<String> ADMIN_CONSOLE_FORWARDED_SERVER
The HTTP header name for 'forwarded server'.
-
ADMIN_CONSOLE_FORWARDED_HOST
public static final SystemProperty<String> ADMIN_CONSOLE_FORWARDED_HOST
The HTTP header name for 'forwarded hosts'.
-
ADMIN_CONSOLE_FORWARDED_HOST_NAME
public static final SystemProperty<String> ADMIN_CONSOLE_FORWARDED_HOST_NAME
Sets a forced valued for the host header.
-
ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_ENABLED
public static final SystemProperty<Boolean> ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_ENABLED
Enable / Disable adding a 'Content-Security-Policy' HTTP header to the response to requests made against the admin console.
-
ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_RESPONSEVALUE
public static final SystemProperty<String> ADMIN_CONSOLE_CONTENT_SECURITY_POLICY_RESPONSEVALUE
The header value when adding a 'Content-Security-Policy' HTTP header to the response to requests made against the admin console.
-
secret
public static final String secret
Random secret used by JVM to allow SSO. Only other cluster nodes can use this secret as a way to integrate the admin consoles of each cluster node.
-
-
Method Detail
-
startup
protected void startup()
Starts the Jetty instance.
-
shutdown
protected void shutdown()
Shuts down the Jetty server.
-
initializePlugin
public void initializePlugin(PluginManager manager, File pluginDir)
Description copied from interface:Plugin
Initializes the plugin.- Specified by:
initializePlugin
in interfacePlugin
- Parameters:
manager
- the plugin manager.pluginDir
- the directory where the plugin is located.
-
destroyPlugin
public void destroyPlugin()
Description copied from interface:Plugin
Destroys the plugin.Implementations of this method must release all resources held by the plugin such as file handles, database or network connections, and references to core Openfire classes. In other words, a garbage collection executed after this method is called must be able to clean up all plugin classes.
- Specified by:
destroyPlugin
in interfacePlugin
-
isRestartNeeded
public boolean isRestartNeeded()
Returns true if the Jetty server needs to be restarted. This is usually required when certificates are added, deleted or modified or when server ports were modified.- Returns:
- true if the Jetty server needs to be restarted.
-
getBindInterface
public String getBindInterface()
Returnsnull
if the admin console will be available in all network interfaces of this machine or a String representing the only interface where the admin console will be available.- Returns:
- String representing the only interface where the admin console will be available or null if it will be available in all interfaces.
-
getAdminUnsecurePort
public int getAdminUnsecurePort()
Returns the non-TLS port on which the admin console is currently operating.- Returns:
- the non-TLS port on which the admin console is currently operating.
-
getAdminSecurePort
public int getAdminSecurePort()
Returns the TLS port on which the admin console is current operating.- Returns:
- the TLS port on which the admin console is current operating.
-
getContexts
public org.eclipse.jetty.server.handler.ContextHandlerCollection getContexts()
Returns the collection of Jetty contexts used in the admin console. A root context "/" is where the admin console lives. Additional contexts can be added dynamically for other web applications that should be run as part of the admin console server process. The following pseudo code demonstrates how to do this:ContextHandlerCollection contexts = ((AdminConsolePlugin)pluginManager.getPlugin("admin")).getContexts(); context = new WebAppContext(SOME_DIRECTORY, "/CONTEXT_NAME"); contexts.addHandler(context); context.setWelcomeFiles(new String[]{"index.jsp"}); context.start();
- Returns:
- the Jetty handlers.
-
restart
public void restart()
Restart the admin console (and it's HTTP server) without restarting the plugin.
-
pauseAutoRestartEnabled
public void pauseAutoRestartEnabled(Duration pause)
Temporarily disables auto-restarting of the plugin's webserver when certificate changes are detected.- Parameters:
pause
- The duration for which certificate changes are ignored.
-
-