Class ServerShell
- java.lang.Object
- com.iizix.server.ServerShell
- All Implemented Interfaces:
IWebServiceEngine
,WebSocketAcceptor
,IAdditonalInformation<UserInfoHistoryEntry>
,IAppLoader
,IServer
,IKStringInfoProviderHolder
- Direct Known Subclasses:
JakartaEEServer
,JettyRunConfiguration
public abstract class ServerShell extends java.lang.Object implements IServer, WebSocketAcceptor, IWebServiceEngine, IKStringInfoProviderHolder, IAdditonalInformation<UserInfoHistoryEntry>
The Server Shell.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.server.IServer
IServer.State
Field Summary
Fields Modifier and Type Field Description protected ExternalBrowserPagesImpl
externalBrowserPages
The external server pages.protected static MemoryJarURLStreamHandlerFactory
memoryJarFactory
The memory Jar stream handler factory.protected static XJarURLStreamHandlerFactory
xjarFactory
The XJar stream handler factory.
Constructor Summary
Constructors Constructor Description ServerShell(java.io.File configFileParam)
Constructor.
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static IServer.State
_getState()
Gets the state of the server.static void
_registerApplication(java.lang.String jndiName, java.lang.Object injector)
Registers an application with the server.static void
_unregisterApplication(java.lang.String jndiName, java.lang.Object injector)
Unregisters an application with the server.boolean
addDisposeListener(IServerDisposeListener listener)
Adds a server dispose.IEndPoint[]
addEndPointListener(IEndPointListener listener)
Adds a listener of end point create/dispose and retrieves the list of current end points.void
addFileUploader(IWSUploaderAcceptor endPoint)
Adds a new web file loader acceptor for an end point.boolean
addModule(IServerModule<?> module)
Adds a server module for processing.void
configureSessionMgr()
Configures the client session manager with the settings for idle timeout, dormant time and heartbeat interval.boolean
dispose()
Disposes of the server, e.g.abstract boolean
doCompressNormalHTML()
Flag indicating the normal HTML files needs compression along with CSS minify and JS compression.protected void
flushStartupLog()
Flushes a potential start-up logging to console for exceptions causing server not to initialize the logging system.boolean
getAccessibleEnvironments(HttpServletRequest request, java.util.List<ServerConfigEnvProps> envs)
Gets the environments that are supported for the request.ActiveUserSessions
getActiveUserSessions()
The active user sessions.UserInfoHistoryEntry
getAdditionalInformation()
Allocates a new instance of the additional information to be stored with the history entry.java.util.Map<java.lang.String,java.lang.String>
getAppAliases()
Gets the unmodifiable map of application aliases.AppFactory
getApplication(java.lang.String id)
Gets an application that has been registered with an ID.AppFactory[]
getApplications()
Gets the applications that are loaded and registered.java.io.File
getCurrentDirectory()
Gets the server current directory.MailSender
getDefaultMailSender()
Gets the default mail sender.java.lang.String
getEmailVerificationURL(BasicUserInfo bui, java.lang.String email, java.lang.String externalWebServerBaseURL)
Gets a verification URL for an email address.IEndPoint[]
getEndPointsInstances()
Gets an array of all end points.java.lang.String
getETag(java.io.File file)
Gets the map of web server mappings for files.java.util.concurrent.ExecutorService
getExecutorService()
Gets the Server ExecutorService.java.lang.String
getExternalWebServerBaseURL()
Attempts to get the default external host address from the current thread's context.WSFileProviderEngine
getFileProviderEngine()
Gets the WSFile provider engine.java.lang.String[]
getHandledContextPaths()
Gets the list of potential handled context paths for the websocket.OSSystemInfo.HistoryEntry<UserInfoHistoryEntry>[]
getHistory(long start)
Gets the history entries gathered between a date up to the last available entry.java.lang.Class<UserInfoHistoryEntry>
getInfoClass()
Gets the class of the additional information.static ServerShell
getInstance()
Gets the instance of the main server.protected static ServerShell
getInstance(java.lang.Class<ServerShell> server)
Gets the instance of the main server.IKStringInfoProvider
getKStringInfoProvider()
Retrieves the KStringInfoProvider for the calling thread.MailSender
getMailSender(java.lang.String name)
Gets the default mail sender.PropFactory
getPropertyFactory()
Gets the server property factory.PropMgr
getPropertyManager()
Gets the server property manager.java.io.File
getServerConfigFile()
Gets the Server Config File.ServerLogger
getServerLogger()
Gets the server logger instance.ServerProps
getServerProperties()
Gets the Server Properties.ServerSettings
getServerSettings()
Gets the container for server settings.java.lang.ThreadGroup
getServerThreadGroup()
Gets the ThreadGroup for server threads.ISourceResolver
getSourceResolver()
Gets the source file resolver.long
getStartTime()
Gets the server's start time (not the creation time).IServer.State
getState()
Gets the server state.ITXPCoordinator
getTXPCoordinator()
The transaction processor coordinator.WebLogos
getWebLogos()
Gets the instance of the WebLogos.abstract IWebServerCompression
getWebServerCompression()
Gets the web server compression interface.java.io.File
getWebServerMapping(java.lang.String mappedFile)
Gets the map of web server mappings for files.WebThumbs
getWebThumbs()
Gets the instance of the WebThumbs.protected Worker
getWorker()
Gets the server worker.IWSUploaderService
getWSUploaderService()
Gets the web service file uploader service.protected void
initializeCompressedFiles()
Initializes and compresses the HTML files and all sources and CSS files loaded from there.static void
initializeURNFactory()
Initializes the URN factory along with its providers.java.lang.Object
isRequestURIAccepted(IWebSocketComm comm, java.lang.String uri, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headerFields)
Called to check if a request URI can be accepted.abstract void
loadApplications()
Called to load the applications.PropCnr
loadFile(java.io.File file)
Loads a property file.PropCnr
loadFile(java.lang.String fileName, java.io.InputStream inputStream)
Loads a property file.java.util.List<IPluginDescriptor<?>>
loadPlugins(java.lang.String names)
Loads required plug-in's.protected void
loadPluginsAndConfig()
Performs initial setup, loading plugins and the configuration file.protected void
loadServerConfig()
Loads or reloads the server config and starts the WSFile provider engine.void
onApplicationSessionStarted(AppSessionGyro appGyro)
Called when an application is instantiated and started by a user session.void
onApplicationSessionStopped(AppSessionGyro appGyro)
Called when an application is stopped.protected void
onDispose()
Called prior to disposing.protected void
onDisposed()
Called after disposing.void
onEndPointDisposed(IEndPoint endPoint)
Called when an end point is disposed of.void
onStartServer()
Called to initialize the server.AppDefinition
registerApplication(java.lang.String id, AppDefinition app)
Registers an application with an ID available in the server.void
registerApplication(java.lang.String jndiName, java.lang.Object injector)
Registers an application with the server.protected boolean
registerEndPointConstructor(IEndPointConstructor<?> epc)
Registers an end point constructor.static void
registerRegionLocationServiceProviders(ServerSettings settings, boolean isTestMode)
Registers the Region Location Service Providers.boolean
registerRequestPrinter(java.lang.String target, IWebServerRequestPrinter processor)
Registers a new request printer.boolean
removeDisposeListener(IServerDisposeListener listener)
Removes a server dispose listener.boolean
removeEndPointListener(IEndPointListener listener)
Adds a listener of end point create/dispose and retrieves the list of current end points.void
removeFileUploader(IWSUploaderAcceptor endPoint)
Removes a new web file loader acceptor for an end point.boolean
removeModule(IServerModule<?> module)
Removes a server module for processing.void
saveFile(java.io.File file, PropCnr cnr)
Saves a property file.boolean
saveServerConfig()
Saves the Server Properties if required, creating a backup file of the previous configuration as "filename-DD MMM YYYY hh:mm:ss.SSS.iiziServer".static void
setWSFileProviderEngine(WSFileProviderEngine engine)
Assigns the web server file provider engine.static void
shutdownRegionLocationServiceProviders()
Shuts down the Region Location Service Providers.void
startServer()
Processes server start-up asynchronously.void
unregisterApplication(java.lang.String jndiName, java.lang.Object injector)
Unregisters an application with the server.protected boolean
unregisterEndPointConstructor(IEndPointConstructor<?> epc)
Unregisters an end point constructor.boolean
unregisterRequestPrinter(java.lang.String target, IWebServerRequestPrinter processor)
Unregister a previously registered request printer.static void
updateWebServerRoot(java.io.File dirHint)
Update the web server root for the license system.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.iizix.server.IServer
getRootDirectory
Methods inherited from interface com.iizix.IWebServiceEngine
configureProxy, getProxy
Field Detail
memoryJarFactory
protected static MemoryJarURLStreamHandlerFactory memoryJarFactory
The memory Jar stream handler factory.
xjarFactory
protected static XJarURLStreamHandlerFactory xjarFactory
The XJar stream handler factory.
externalBrowserPages
protected ExternalBrowserPagesImpl externalBrowserPages
The external server pages.
Constructor Detail
ServerShell
public ServerShell(java.io.File configFileParam) throws java.io.IOException, PropException
Constructor.- Parameters:
configFileParam
- The configuration file, null for default.- Throws:
java.io.IOException
- For load failure.PropException
- For property errors.
Method Detail
updateWebServerRoot
public static void updateWebServerRoot(java.io.File dirHint)
Update the web server root for the license system. This method is not intended to be called, it is done only by the IIZI framework.- Parameters:
dirHint
- The directory hint might be non-null. If so, that one should be used.
setWSFileProviderEngine
public static void setWSFileProviderEngine(WSFileProviderEngine engine)
Assigns the web server file provider engine. This method is not intended to be called, it is done only by the IIZI framework.- Parameters:
engine
- The engine.- Throws:
java.lang.IllegalStateException
- In case the engine is already set by the framework.
getInstance
public static ServerShell getInstance()
Gets the instance of the main server. If the server never has been started, it will be started before returning the instance.- Returns:
- null if it is stopped.
getInstance
protected static ServerShell getInstance(java.lang.Class<ServerShell> server)
Gets the instance of the main server. If the server never has been started, it will be started before returning the instance.- Returns:
- null if it is stopped.
_getState
public static IServer.State _getState()
Gets the state of the server.- Returns:
- The server state: STARTING, STARTED, STOPPING or STOPPED.
_unregisterApplication
public static void _unregisterApplication(java.lang.String jndiName, java.lang.Object injector)
Unregisters an application with the server.- Parameters:
jndiName
- The full JNDI name of the application.injector
- The instance of the application injector.- Throws:
java.lang.NullPointerException
- If the server has not been started.
_registerApplication
public static void _registerApplication(java.lang.String jndiName, java.lang.Object injector)
Registers an application with the server.- Parameters:
jndiName
- The full JNDI name of the application.injector
- The instance of the application injector.- Throws:
java.lang.NullPointerException
- If the server has not been started.
registerRegionLocationServiceProviders
public static void registerRegionLocationServiceProviders(ServerSettings settings, boolean isTestMode)
Registers the Region Location Service Providers.- Parameters:
settings
- The settings.isTestMode
- Flag for test mode.- Throws:
java.lang.IllegalStateException
- For invalid server states.
shutdownRegionLocationServiceProviders
public static void shutdownRegionLocationServiceProviders()
Shuts down the Region Location Service Providers.This method is used for testing and not by the server.
- Throws:
java.lang.IllegalStateException
- For invalid state.
initializeURNFactory
public static void initializeURNFactory()
Initializes the URN factory along with its providers. This method is intended to be used by the IIZI framework and not instantiated to be called.
getAppAliases
public java.util.Map<java.lang.String,java.lang.String> getAppAliases()
Gets the unmodifiable map of application aliases.- Returns:
- The map of aliasAppID as keys and appID as values.
getCurrentDirectory
public java.io.File getCurrentDirectory()
Gets the server current directory.- Returns:
- The current directory (canonical form).
getStartTime
public final long getStartTime()
Gets the server's start time (not the creation time).- Returns:
- The start time in milliseconds since the Epoch, zero if not yet started.
getExecutorService
public final java.util.concurrent.ExecutorService getExecutorService()
Gets the Server ExecutorService.- Specified by:
getExecutorService
in interfaceIAppLoader
getServerThreadGroup
public final java.lang.ThreadGroup getServerThreadGroup()
Gets the ThreadGroup for server threads.
getState
public final IServer.State getState()
Gets the server state.
getActiveUserSessions
public final ActiveUserSessions getActiveUserSessions()
The active user sessions.- Returns:
- The instance controlling the active user sessions, null if server hasn't been started.
loadPluginsAndConfig
protected final void loadPluginsAndConfig() throws java.lang.Throwable
Performs initial setup, loading plugins and the configuration file.- Throws:
java.io.IOException
- For server singleton errors.java.lang.Throwable
- For other severe server failures.
startServer
public final void startServer() throws java.lang.Throwable
Processes server start-up asynchronously.- Specified by:
startServer
in interfaceIServer
- Throws:
java.lang.Throwable
- for startup errors.
getServerLogger
public ServerLogger getServerLogger()
Gets the server logger instance.
flushStartupLog
protected void flushStartupLog()
Flushes a potential start-up logging to console for exceptions causing server not to initialize the logging system.
registerRequestPrinter
public boolean registerRequestPrinter(java.lang.String target, IWebServerRequestPrinter processor)
Registers a new request printer.- Specified by:
registerRequestPrinter
in interfaceIServer
- Parameters:
target
- The target URL, always starting with "/" and doesn't contain the query.processor
- The print processor.- Returns:
- true if added successfully, false if the print processor already exists or the server is not started yet.
unregisterRequestPrinter
public boolean unregisterRequestPrinter(java.lang.String target, IWebServerRequestPrinter processor)
Unregister a previously registered request printer.- Specified by:
unregisterRequestPrinter
in interfaceIServer
- Parameters:
target
- The target URL, always starting with "/" and doesn't contain the query.processor
- The print processor.- Returns:
- true if removed successfully, false if the print processor does not exist or doesn't match, or the server is not yet started.
getExternalWebServerBaseURL
public java.lang.String getExternalWebServerBaseURL()
Attempts to get the default external host address from the current thread's context.Note: the
SessionInfo
instance will be attempted to be retrieved from the current thread and used for the external server address, including protocol (http:// or https://). Note that if the iiziServer is behind a proxy that handles SSL, the protocol returned here would be "http://" if not configured properly in the server configuration.- Returns:
- The external host address, including protocol (http:// or https://) and potentially a port as (:8080), or null if it cannot be established. The string never ends with a '/'.
getEmailVerificationURL
public java.lang.String getEmailVerificationURL(BasicUserInfo bui, java.lang.String email, java.lang.String externalWebServerBaseURL)
Gets a verification URL for an email address. This URL is used to send a mail to the email in question with the link using this URL. When the user clicks on the link, the email gets verified in the database and all logging is handled by the server.Note: if the parameter
externalHostAddress
isnull
, theSessionInfo
instance will be attempted to be retrieved from the current thread and used for the external server address, including protocol (http:// or https://). Note that if the iiziServer is behind a proxy that handles SSL, the protocol returned here would be "http://" if not configured properly in the server configuration.If the
SessionInfo
cannot be located, the server's external URL configuration is used.- Parameters:
bui
- The basic user information.email
- The email in question.externalWebServerBaseURL
- The external base URL for the web server, e.g. "https://lic.mindus.co", usenull
for default. The default address is retrieved usinggetExternalWebServerBaseURL()
.- Returns:
- The URL, or
null
if the external host address cannot be created.PLEASE NOTE THAT IF THE DOMAIN NAME FAILS TO BE RETRIEVED, THE "url" DOES NOT CONTAIN THAT INFORMATION. It will then just be a path such as "/iizi-email-verification?...".
The return URL is
null
if the SHA-256 message digest fails to be created due to Java not having unlimited security configured. If this is the case, an error message is logged prior to returning.
getServerConfigFile
public final java.io.File getServerConfigFile()
Gets the Server Config File.- Returns:
- The config file used to start the server with.
loadServerConfig
protected final void loadServerConfig() throws java.io.IOException, PropException
Loads or reloads the server config and starts the WSFile provider engine. This call can only be done by the framework and is not intended to be called.- Throws:
java.io.IOException
- For load failure.PropException
- For property errors.
getServerProperties
public final ServerProps getServerProperties()
Gets the Server Properties.- Specified by:
getServerProperties
in interfaceIServer
getServerSettings
public ServerSettings getServerSettings()
Gets the container for server settings.
configureSessionMgr
public void configureSessionMgr()
Configures the client session manager with the settings for idle timeout, dormant time and heartbeat interval.
saveServerConfig
public boolean saveServerConfig() throws java.io.IOException
Saves the Server Properties if required, creating a backup file of the previous configuration as "filename-DD MMM YYYY hh:mm:ss.SSS.iiziServer".- Returns:
- true for successful save, false for no change.
- Throws:
java.io.IOException
- For load failure.
getDefaultMailSender
public MailSender getDefaultMailSender() throws NotFoundException, AddressException, NoSuchProviderException, java.io.IOException
Gets the default mail sender.- Specified by:
getDefaultMailSender
in interfaceIServer
- Returns:
- The default mail sender.
- Throws:
NotFoundException
- If the mail sender is not found.java.io.IOException
- If the mail queue directory does not exist.NoSuchProviderException
- If the "smtp" or "smtps" providers do not exist!AddressException
- If the default sender failed to parse.
getMailSender
public MailSender getMailSender(java.lang.String name) throws NotFoundException, AddressException, NoSuchProviderException, java.io.IOException
Gets the default mail sender.- Specified by:
getMailSender
in interfaceIServer
- Parameters:
name
- The mail sender name, null for default or the first one found if no default is configured.- Returns:
- The default mail sender.
- Throws:
NotFoundException
- If the mail sender is not found.java.io.IOException
- If the mail queue directory does not exist.NoSuchProviderException
- If the "smtp" or "smtps" providers do not exist!AddressException
- If the default sender failed to parse.
loadApplications
public abstract void loadApplications() throws java.lang.Throwable
Called to load the applications.- Specified by:
loadApplications
in interfaceIServer
- Throws:
java.lang.Throwable
- for start-up errors.
registerApplication
public final AppDefinition registerApplication(java.lang.String id, AppDefinition app) throws ServerApplicationSetupException
Registers an application with an ID available in the server.- Specified by:
registerApplication
in interfaceIServer
- Parameters:
id
- The ID of the application.app
- The application.- Returns:
- The previous overwritten application, or null for a new application.
- Throws:
ServerApplicationSetupException
- In case a plug-in fail to initialize.
getApplication
public final AppFactory getApplication(java.lang.String id)
Gets an application that has been registered with an ID. The table of appID aliases is checked.- Parameters:
id
- The application ID or an alias of the appID.- Returns:
- The application factory, or null if not registered.
getApplications
public final AppFactory[] getApplications()
Gets the applications that are loaded and registered. The appIDs are only the non-aliased names.- Returns:
- The application factories loaded.
onApplicationSessionStarted
public void onApplicationSessionStarted(AppSessionGyro appGyro)
Called when an application is instantiated and started by a user session.- Parameters:
appGyro
- The application session.
onApplicationSessionStopped
public void onApplicationSessionStopped(AppSessionGyro appGyro)
Called when an application is stopped.- Parameters:
appGyro
- The application session.
addDisposeListener
public boolean addDisposeListener(IServerDisposeListener listener)
Adds a server dispose. Calling this method multiple times with the same listener will have no effect (but to return false).- Specified by:
addDisposeListener
in interfaceIServer
- Parameters:
listener
- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
java.lang.NullPointerException
- If the listener isnull
.
removeDisposeListener
public boolean removeDisposeListener(IServerDisposeListener listener)
Removes a server dispose listener.- Specified by:
removeDisposeListener
in interfaceIServer
- Parameters:
listener
- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
onStartServer
public void onStartServer() throws java.lang.Throwable
Called to initialize the server.- Specified by:
onStartServer
in interfaceIServer
- Throws:
java.lang.Throwable
- for start-up errors.
getWorker
protected final Worker getWorker()
Gets the server worker.
dispose
public final boolean dispose()
Disposes of the server, e.g. at shut-down. This dispose call will wait until the server has shut-down successfully.
onDispose
protected void onDispose()
Called prior to disposing. Override to process.
onDisposed
protected void onDisposed()
Called after disposing. Override to process.
getPropertyFactory
public final PropFactory getPropertyFactory()
Gets the server property factory.
getPropertyManager
public final PropMgr getPropertyManager()
Gets the server property manager.- Specified by:
getPropertyManager
in interfaceIAppLoader
loadFile
public final PropCnr loadFile(java.io.File file) throws java.io.IOException, PropException
Loads a property file.- Specified by:
loadFile
in interfaceIAppLoader
- Parameters:
file
- The file to load.- Returns:
- A Property container.
- Throws:
java.io.IOException
- For file errors.PropException
- For property errors.
loadFile
public final PropCnr loadFile(java.lang.String fileName, java.io.InputStream inputStream) throws java.io.IOException, PropException
Loads a property file.- Specified by:
loadFile
in interfaceIAppLoader
- Parameters:
fileName
- The file name for logging.inputStream
- The file input stream.- Returns:
- A Property container.
- Throws:
java.io.IOException
- For file errors.PropException
- For property errors.
saveFile
public final void saveFile(java.io.File file, PropCnr cnr) throws java.io.IOException, PropException
Saves a property file.- Parameters:
file
- The file to load.cnr
- The property container to save.- Throws:
java.io.IOException
- For file errors.PropException
- For property errors.
getAccessibleEnvironments
public boolean getAccessibleEnvironments(HttpServletRequest request, java.util.List<ServerConfigEnvProps> envs)
Gets the environments that are supported for the request. Pass in an empty ArrayList ofenvs
that is filled in.- Parameters:
request
- The HTTP request.envs
- The environment list is filled in upon return.- Returns:
- true if the request is "valid", false if the "host" header doesn't match and that each environment should be interrogated. The return value could be true even if there is no specific environment in
envs
that matches, but the request is valid.
loadPlugins
public final java.util.List<IPluginDescriptor<?>> loadPlugins(java.lang.String names) throws java.io.IOException
Loads required plug-in's.Each plug-in must have a class called "name.server.Descriptor" that implement the interface
com.iizix.IPluginDescriptor
available.The plug-in definition should be found at the "name/schema/properties.xml", but the iiziGo modules have the "iizigo" module instead of "iizix". To figure out translation of names, a class called "name.server.Descriptor" is loaded and should implement the interface
- Specified by:
loadPlugins
in interfaceIAppLoader
- Parameters:
names
- The plug-in name, e.g. "com.iizigo.db,com.iizigo.term,com.iizigo.ws".- Returns:
- The list of plug-in descriptors.
- Throws:
java.io.IOException
- If a plug-in failed to load.
addModule
public boolean addModule(IServerModule<?> module)
Adds a server module for processing. The module can have an end point constructor that is added during initialization.
removeModule
public boolean removeModule(IServerModule<?> module)
Removes a server module for processing. This will unregister a potential end point constructor and dispose of the module.- Specified by:
removeModule
in interfaceIServer
- Parameters:
module
- The server module.- Returns:
- true for success, false if already removed.
registerEndPointConstructor
protected final boolean registerEndPointConstructor(IEndPointConstructor<?> epc)
Registers an end point constructor.- Parameters:
epc
- The end point constructor.- Returns:
- true for success, false for failure e.g.
epc
is null or it is already registered.
unregisterEndPointConstructor
protected final boolean unregisterEndPointConstructor(IEndPointConstructor<?> epc)
Unregisters an end point constructor.- Parameters:
epc
- The end point constructor.- Returns:
- true for success, false for failure.
isRequestURIAccepted
public final java.lang.Object isRequestURIAccepted(IWebSocketComm comm, java.lang.String uri, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headerFields)
Called to check if a request URI can be accepted.- Specified by:
isRequestURIAccepted
in interfaceWebSocketAcceptor
- Parameters:
comm
- The WebSocket communication instance.uri
- The request URI, formatted as e.g. "/something/more.ws?query-params".headerFields
- HTTP header fields.- Returns:
- Object an object that is attached to the communications, or null if the URI is not accepted.
getHandledContextPaths
public java.lang.String[] getHandledContextPaths()
Gets the list of potential handled context paths for the websocket.- Specified by:
getHandledContextPaths
in interfaceWebSocketAcceptor
- Returns:
- The array of possibly handled context path.
getEndPointsInstances
public final IEndPoint[] getEndPointsInstances()
Gets an array of all end points. Avoid this method as it causes unnecessary garbage collection, use getEndPointsCollection instead.- Specified by:
getEndPointsInstances
in interfaceIServer
- Returns:
- An array of IEndPoint instances.
onEndPointDisposed
public final void onEndPointDisposed(IEndPoint endPoint)
Called when an end point is disposed of.- Specified by:
onEndPointDisposed
in interfaceIServer
addEndPointListener
public final IEndPoint[] addEndPointListener(IEndPointListener listener)
Adds a listener of end point create/dispose and retrieves the list of current end points. Calling this method several times with the same listener does not add a new one, it is similar to callinggetEndPointInstances()
.- Specified by:
addEndPointListener
in interfaceIServer
- Parameters:
listener
- The end point listener.- Returns:
- An array of EndPoint instances.
removeEndPointListener
public final boolean removeEndPointListener(IEndPointListener listener)
Adds a listener of end point create/dispose and retrieves the list of current end points. Calling this method several times with the same listener does not add a new one, it is similar to callinggetEndPointInstances()
.- Specified by:
removeEndPointListener
in interfaceIServer
- Parameters:
listener
- The end point listener.- Returns:
- true for success, false if not added as listener.
getTXPCoordinator
public final ITXPCoordinator getTXPCoordinator()
The transaction processor coordinator.- Specified by:
getTXPCoordinator
in interfaceIServer
getKStringInfoProvider
public final IKStringInfoProvider getKStringInfoProvider()
Retrieves the KStringInfoProvider for the calling thread. The Client Session Gyro is looked up to process it.- Specified by:
getKStringInfoProvider
in interfaceIKStringInfoProviderHolder
- Returns:
- The KString information provider instance, or null if not possible.
registerApplication
public void registerApplication(java.lang.String jndiName, java.lang.Object injector)
Registers an application with the server.- Parameters:
jndiName
- The full JNDI name of the application.injector
- The instance of the application injector.
unregisterApplication
public void unregisterApplication(java.lang.String jndiName, java.lang.Object injector)
Unregisters an application with the server.- Parameters:
jndiName
- The full JNDI name of the application.injector
- The instance of the application injector.
getHistory
public final OSSystemInfo.HistoryEntry<UserInfoHistoryEntry>[] getHistory(long start)
Gets the history entries gathered between a date up to the last available entry. The history entries are gathered at specific interval defined at start of history.- Parameters:
start
- The start time for the events in milliseconds since the Epoch, or zero for all history entries.- Returns:
- The entries, possibly empty array.
getInfoClass
public final java.lang.Class<UserInfoHistoryEntry> getInfoClass()
Gets the class of the additional information.- Specified by:
getInfoClass
in interfaceIAdditonalInformation<UserInfoHistoryEntry>
- Returns:
- The Class for additional information, or null for none.
getAdditionalInformation
public final UserInfoHistoryEntry getAdditionalInformation()
Allocates a new instance of the additional information to be stored with the history entry. If the
returnsgetInfoClass()
null
, this method can also returnnull
.- Specified by:
getAdditionalInformation
in interfaceIAdditonalInformation<UserInfoHistoryEntry>
- Returns:
- A new instance of additional information, or null for none.
initializeCompressedFiles
protected void initializeCompressedFiles() throws java.io.IOException
Initializes and compresses the HTML files and all sources and CSS files loaded from there.- Throws:
java.io.IOException
- For I/O errors.
getSourceResolver
public ISourceResolver getSourceResolver()
Gets the source file resolver.- Returns:
- The instance used to resolve file names.
getFileProviderEngine
public WSFileProviderEngine getFileProviderEngine()
Gets the WSFile provider engine.The engine is initialized as soon as the server configuration file has been loaded, before any additional processing is done.
- Returns:
- The file provider engine, null if not yet initialized.
getWebThumbs
public WebThumbs getWebThumbs() throws java.io.IOException
Gets the instance of the WebThumbs.- Returns:
- The singleton (per server instance).
- Throws:
java.io.IOException
- For I/O errors when creating the WebThumbs directory for persistent images.
getWebLogos
public WebLogos getWebLogos() throws java.io.IOException
Gets the instance of the WebLogos.- Returns:
- The singleton (per server instance).
- Throws:
java.io.IOException
- For I/O errors when creating the WebLogos directory for persistent images.
addFileUploader
public void addFileUploader(IWSUploaderAcceptor endPoint)
Adds a new web file loader acceptor for an end point.- Parameters:
endPoint
- The end point.- Throws:
java.lang.ClassCastException
- If the end point is not configurable to receive file uploads.java.lang.IllegalStateException
- If the end point is already added.
removeFileUploader
public void removeFileUploader(IWSUploaderAcceptor endPoint)
Removes a new web file loader acceptor for an end point.- Parameters:
endPoint
- The end point.
getWSUploaderService
public IWSUploaderService getWSUploaderService()
Gets the web service file uploader service.- Returns:
- The instance of the web service file uploader service.
doCompressNormalHTML
public abstract boolean doCompressNormalHTML()
Flag indicating the normal HTML files needs compression along with CSS minify and JS compression.The files are typically: iiziApp.html and iiziVSViewer.html.
- Returns:
- true by default, override to return false (e.g. for internal development).
getWebServerCompression
public abstract IWebServerCompression getWebServerCompression()
Gets the web server compression interface.- Returns:
- The instance of the interface implemented by the web server.
getWebServerMapping
public java.io.File getWebServerMapping(java.lang.String mappedFile)
Gets the map of web server mappings for files.- Parameters:
mappedFile
- The file to map.- Returns:
- The mapping from String (such as "dojo.root" or "iiziRun.root") to File Returns null if not found.
getETag
public java.lang.String getETag(java.io.File file)
Gets the map of web server mappings for files.- Parameters:
file
- The file.- Returns:
- The weak ETag for the resource.mapping from String (such as "dojo.root" or "iiziRun.root") to File Returns null if not found.