psdi.server

Class MXServer

  • java.lang.Object
    • psdi.server.MXServer
  • All Implemented Interfaces:
    java.rmi.Remote, MaxRemoteProxy, MXServerRemote, FixedLoggerNames, FixedLoggers


    public class MXServer
    extends java.lang.Object
    implements MXServerRemote, FixedLoggers, MaxRemoteProxy
    The MXServer is a run time context for a set of Services. There are two kinds of Services, System Services, and Application Services. Application Services are the home of Maximo Business Objects. While System Services provide support functions for them, e.g. the database connectivity and remote Application Service location facilities.

    See Also:
    Service, ConfigFile, MaximoDD, psdi.mbo.Connection
    • Field Detail

      • nameProperty

        protected static final java.lang.String nameProperty
        The property for the name of the object that is registered in the rmiregistry for this server.
        E.g.: mxe.name=JLServer
        See Also:
        Constant Field Values
      • serverTimeStampUpdateRate

        public static final int serverTimeStampUpdateRate
        The frequency in seconds for the server to update server timestamp to indicate that it is alive.
        See Also:
        Constant Field Values
      • nameDefault

        protected static final java.lang.String nameDefault
        This is the default value for the nameProperty.
        See Also:
        Constant Field Values
      • DBMANAGERCLASSPATH

        protected static final java.lang.String DBMANAGERCLASSPATH
        See Also:
        Constant Field Values
      • registryPortProperty

        protected static final java.lang.String registryPortProperty
        This is the property for configuring the port the MXServer will try contact the registry host on.
        E.g.: mxe.registry.port=1099
        See Also:
        Constant Field Values
      • adminNameProperty

        protected static final java.lang.String adminNameProperty
        The property used for configuring the administration login name
        See Also:
        Constant Field Values
      • adminNameDefault

        protected static final java.lang.String adminNameDefault
        The default login name for administration control of the MXServer
        See Also:
        Constant Field Values
      • adminPasswdProperty

        protected static final java.lang.String adminPasswdProperty
        The property used for configuring the administration password
        See Also:
        Constant Field Values
      • systemBaseCalendar

        protected static final java.lang.String systemBaseCalendar
        The property used for configuring the System Base Calendar
        See Also:
        Constant Field Values
      • adminPasswdDefault

        protected static final java.lang.String adminPasswdDefault
        The default login password for administration control of the MXServer
        See Also:
        Constant Field Values
      • allowLocalObjectsProperty

        protected static final java.lang.String allowLocalObjectsProperty
        See Also:
        Constant Field Values
      • useAppServerSecurityProperty

        protected static final java.lang.String useAppServerSecurityProperty
        A property to indicate whether MAXIMO application is enabled to use Application server security or not. This setting is by default set to false. If this setting is set to true, the MAXIMO application must be configured using several steps mentioned in the System administration guide. Failing to follow the steps and setting this parameter to true, would cause default MAXIMO authentication to be disabled and will cause the application not work, as the MAXIMO application will depend on the Application Server authentication.
        See Also:
        Constant Field Values
      • srvComm

        protected SrvComm srvComm
        This is an RMI command interface to the MXServer. Note: the class also implements a command line interface!
      • maximoCache

        protected java.util.HashMap maximoCache
        Hashtable that holds all cached objects so they can be refreshed without restarting the server
      • dbManager

        protected DBManager dbManager
        Database connections, user and client authentification etc.
      • mxServerConfig

        protected java.util.Properties mxServerConfig
        Configuration information as an extension of java.util.Properties
      • serviceCoordinator

        protected ServiceCoordinator serviceCoordinator
        Intelligent Collection of Serivces. Both System and Application Services
      • shutdown

        protected boolean shutdown
        Set by shutdown(). Is true for one "sleeptime" cycle of the CronTask manager before the server exits. getShutdown() reads it.
      • globalEventTopicTree

        protected static EventTopicTree globalEventTopicTree
        EventTopicTree - The n-ary tree that stores all the subscription information in the server. This member is static so that a static method can be used to access it. This greatly simplifies access to the event mgmt utilities from classes outside the MXServer package.
      • eventTopicsCaches

        protected static TenantLevelObj eventTopicsCaches
      • globalEventTopicsCache

        protected static java.util.Map globalEventTopicsCache
      • RMIPORT

        public static int RMIPORT
        Port number used by RMI to communicate, set in the properties file
      • RMIREGISTRYPORT

        public static int RMIREGISTRYPORT
        Port number used by RMI Registry.
      • CATALOG_REGISTRY_COLUMNS

        protected static final int CATALOG_REGISTRY_COLUMNS
        Catalog registry columns.
        See Also:
        Constant Field Values
      • validLanguageList

        public static java.lang.String[][] validLanguageList
      • printMboCount

        public boolean printMboCount
      • failToGetOracleSID

        public boolean failToGetOracleSID
      • db2UseWithURforViews

        public static boolean db2UseWithURforViews
      • HTML_CONTENT

        public static final java.lang.String HTML_CONTENT
        Used for the HTML content type for sending emails.
        See Also:
        Constant Field Values
      • TEXT_CONTENT

        public static final java.lang.String TEXT_CONTENT
        Used for the text content type for sending emails.
        See Also:
        Constant Field Values
      • MTENABLEDPROPERTY

        public static final java.lang.String MTENABLEDPROPERTY
        See Also:
        Constant Field Values
      • REQ_PARAM_S2STOKEN

        public static final java.lang.String REQ_PARAM_S2STOKEN
        See Also:
        Constant Field Values
      • bundleProperties

        public static final java.lang.String bundleProperties
        See Also:
        Constant Field Values
      • mboCounter

        protected java.util.concurrent.ConcurrentSkipListMap mboCounter
      • mboSetCounter

        protected java.util.concurrent.ConcurrentSkipListMap mboSetCounter
      • mboSetIPCounter

        protected java.util.HashMap mboSetIPCounter
    • Method Detail

      • getMXServer

        public static MXServer getMXServer()
                                    throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
      • getUID

        public static java.lang.Object getUID()
        Returns a unique id as object.
      • getMaxSessionID

        public static long getMaxSessionID()
        Returns a unique maxsession id as object.
      • getGuid

        public java.util.UUID getGuid()
        Return the Guid for this instance of MXServer.
      • getServerHost

        public java.lang.String getServerHost()
        returns server's ip address
        Returns:
        ip address
      • setServerHost

        public void setServerHost(java.lang.String address)
        sets server's ip address
      • addToMaximoCache

        public void addToMaximoCache(java.lang.String name,
                                     MaximoCache obj)
        Adds the cache object to maximo cache.
      • removeFromMaximoCache

        public void removeFromMaximoCache(java.lang.String name)
        Removes the cache object from maximo cache.
      • getFromMaximoCache

        public java.lang.Object getFromMaximoCache(java.lang.String name)
        Returns the cache object to maximo cache.
      • unloadTenantCache

        @TracePrimary
        public void unloadTenantCache()
                                             throws MXException,
                                                    java.rmi.RemoteException
        unload tenant from all maximo caches
        Throws:
        MXException,RemoteException
        MXException
        java.rmi.RemoteException
      • unloadInactiveCaches

        @TracePrimary
        public void unloadInactiveCaches(long interval)
                                                throws MXException,
                                                       java.rmi.RemoteException
        unload tenant from all maximo caches
        Throws:
        MXException,RemoteException
        MXException
        java.rmi.RemoteException
      • getLoadedTenants

        @TracePrimary
        public java.util.Map getLoadedTenants()
                                                     throws MXException,
                                                            java.rmi.RemoteException
        unload tenant from all maximo caches
        Throws:
        MXException,RemoteException
        MXException
        java.rmi.RemoteException
      • reloadMaximoCache

        @TracePrimary
        public void reloadMaximoCache(java.lang.String cacheName,
                                                    boolean updateAllServers)
                                             throws MXException,
                                                    java.rmi.RemoteException
        reloads specific cache
        Specified by:
        reloadMaximoCache in interface MXServerRemote
        Parameters:
        cachename -
        updateAllServers - True to update all other instances of MXServer, false to update only this instance. When true, maxsession.reloadcache is updated for the other instances with the names of cache to be reloaded.
        Throws:
        java.rmi.RemoteException
        MXException
        See Also:
        MXServer.reloadMaximoCache(boolean)
      • unloadTenantCache

        @TracePrimary
        public void unloadTenantCache(java.lang.String cacheName)
                                             throws MXException,
                                                    java.rmi.RemoteException
        remove tenant from specific cache
        Parameters:
        cachename -
        Throws:
        MXException
        java.rmi.RemoteException
      • getLoadedTenants

        @TracePrimary
        public java.util.Set getLoadedTenants(java.lang.String cacheName)
                                                     throws MXException,
                                                            java.rmi.RemoteException
        remove tenant from specific cache
        Parameters:
        cachename -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • reloadMaximoCache

        @TracePrimary
        public void reloadMaximoCache(java.lang.String cacheName,
                                                    java.lang.String key,
                                                    boolean flag)
                                             throws MXException,
                                                    java.rmi.RemoteException
        Reloads a specific sub component of the cache object. E.g. In Maxvars, a specific maxvar can be reinitiliazed from the database.
        Specified by:
        reloadMaximoCache in interface MXServerRemote
        Parameters:
        cachename -
        boolean - flag to indicate if reloadMaximoCache called from crontask or from other sources. True if from other sources , false if from cron task
        Throws:
        MXException,RemoteException
        java.rmi.RemoteException
        MXException
        See Also:
        MXServer.reloadMaximoCache(boolean)
      • destroy

        public void destroy()
        Calls destroy() on each AppService and System Service. E.g. DBManager. Runs the garbage collection one last time to help shutdown any system handle like DDE conversations. Finally, restores the System.out and System.err PrintStreams
      • finalize

        protected void finalize()
        Calls destroy()
        Overrides:
        finalize in class java.lang.Object
      • boot

        protected void boot(java.util.Properties propsFromFile)
                     throws java.lang.Exception
        Boot-strap the server. This method brings up the fundamental infrastructure elements of the MXServer, specifically it reads in the configuration file and starts the DBManager and MaximoDD.
        Parameters:
        propsFromFile - Properties from the maximo properties file (not from the database). These will include properties required for database connectivity.
        Throws:
        java.lang.Exception
      • getValidApps

        public java.util.HashSet getValidApps()
        Return a HashSet of valid apps, according to packaging rules.
        Returns:
        HashSet where each entry is an application name.
        See Also:
        MXServer.packagingCheck(psdi.server.DBManager)
      • addApp

        public void addApp(java.lang.String app)
        Add the specified app to the validApps HashSet. This is to support the Application Designer application.
        Parameters:
        app - Application name
      • removeApp

        public void removeApp(java.lang.String app)
        Remove the specified app from the validApps HashSet. This is to support the Application Designer application.
        Parameters:
        app - Application name
      • getLicenseKeys

        public java.util.HashSet getLicenseKeys()
                                         throws java.rmi.RemoteException
        Return a HashSet of license keys. A license key represents a subset of functionality that is not directly tied to one particular app, e.g. Linear could be a license key.
        Specified by:
        getLicenseKeys in interface MXServerRemote
        Returns:
        HashSet where each entry is a license key value.
        Throws:
        java.rmi.RemoteException
        See Also:
        MXServer.packagingCheck(psdi.server.DBManager)
      • isReadOnlyApp

        public boolean isReadOnlyApp(java.lang.String app)
        Return a HashSet of license keys. A license key represents a subset of functionality that is not directly tied to one particular app, e.g. Linear could be a license key.
        Returns:
        HashSet where each entry is a license key value.
        See Also:
        MXServer.packagingCheck(psdi.server.DBManager)
      • getSystemType

        public java.lang.String getSystemType()
        Return a HashSet of license keys. A license key represents a subset of functionality that is not directly tied to one particular app, e.g. Linear could be a license key.
        Returns:
        HashSet where each entry is a license key value.
        See Also:
        MXServer.packagingCheck(psdi.server.DBManager)
      • getProductKeys

        public java.util.HashSet getProductKeys()
                                         throws java.rmi.RemoteException
        Return a HashSet of product keys. A product key is a reference to a product xml file; for example, the TAMIT product may have a product xml file named "a_tamitbase.xml" and a product key equal to "a_tamitbase". Not evey product xml will have a product key, but for every product key there should exist a product xml file.
        Specified by:
        getProductKeys in interface MXServerRemote
        Returns:
        HashSet where each entry is a product key value.
        Throws:
        java.rmi.RemoteException
        See Also:
        MXServer.packagingCheck(psdi.server.DBManager)
      • getEvalDaysRemaining

        public int getEvalDaysRemaining()
                                 throws MXException,
                                        java.rmi.RemoteException
        Return the number of days remaining in the evaluation period. If this is not an evaluation license, this will return zero.
        Specified by:
        getEvalDaysRemaining in interface MXServerRemote
        Returns:
        Number of days remaining in the evaluation period.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MXServer.evalEndDate
      • getMaxupgValue

        public java.lang.String getMaxupgValue()
        Returns the MAXUPG value of MAXVARS table
      • configure

        protected void configure(java.util.Properties propsFromFile)
                          throws java.lang.Exception
        Reads in the MXServer.properties file.
        Throws:
        java.lang.Exception
      • init

        public void init(java.sql.Connection sysCon)
                  throws java.lang.Exception
        Initialize all the System Services in this environment.
        Throws:
        java.lang.Exception
      • initRegistryInfo

        protected void initRegistryInfo()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • initEventTopicTree

        protected void initEventTopicTree()
      • getEventTopicTree

        public static EventTopicTree getEventTopicTree()
        Static method to access event topic tree.
      • getEventTopicsCache

        public static java.util.Map getEventTopicsCache()
      • getGlobalEventTopicsCache

        public static java.util.Map getGlobalEventTopicsCache()
      • getMaximoCacheNames

        public java.util.Set getMaximoCacheNames()
        Return the names of cache currently in MaximoCache.
      • run

        public void run()
        A place holder incase the MXServer needs to run as a thread.
      • getDBManager

        public DBManager getDBManager()
        Returns:
        the DBManager
      • getCronTaskManager

        public CronTaskManager getCronTaskManager()
        Return the CronTaskManager. This can be called only from AdminModeManager.
        Returns:
        CronTaskManager
      • isAdminModeOn

        public boolean isAdminModeOn(boolean allInstances)
                              throws MXException,
                                     java.rmi.RemoteException
        Tests whether MXServer is in Admin Mode.
        Specified by:
        isAdminModeOn in interface MXServerRemote
        Parameters:
        allInstances - True to test Admin Mode for all instances using this database. False to test Admin Mode for this instance only.
        Returns:
        True if Admin Mode is on.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        MXServer.isAdminModePending(), AdminModeManager
      • listenToAdmin

        public void listenToAdmin(MboRemote listenerMbo,
                                  boolean listen)
                           throws MXException,
                                  java.rmi.RemoteException
        Listen to messages from AdminModeManager when changing Admin Mode.
        Specified by:
        listenToAdmin in interface MXServerRemote
        Parameters:
        listenerMbo - Instance of ProcessMonitor Mbo
        listen - True to listen, False to stop listening
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        AdminModeManager
      • getMaximoDD

        public MaximoDD getMaximoDD()
        Returns:
        the MaximoDD
      • getMaximoMLDD

        public MaximoMLDD getMaximoMLDD()
        Return the MaximoMLDD
      • getMaxMessageCache

        public MaxMessageCache getMaxMessageCache()
        Return the MaximoMessageCache
      • getAppServiceNames

        @Deprecated
        public java.lang.String[] getAppServiceNames()
                                                          throws java.rmi.RemoteException
        Deprecated. 
        Specified by:
        getAppServiceNames in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • getLocalAppList

        public java.lang.String[] getLocalAppList()
                                           throws java.rmi.RemoteException
        Specified by:
        getLocalAppList in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • shutdown

        protected void shutdown(java.lang.Object key)
        Schedules a shutdown
      • getRemoteUsers

        public java.util.Hashtable getRemoteUsers()
        Return the remoteUser Hashtable
        NOT IMPLEMENTED YET
        Returns:
        Hashtable
      • getDate

        public java.util.Date getDate()
                               throws java.rmi.RemoteException
        Returns the current date sync'ed with the database server.
        Specified by:
        getDate in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • getDate

        public java.util.Date getDate(java.util.Locale l,
                                      java.util.TimeZone tz)
                               throws java.rmi.RemoteException
        Returns the date in timezone and locale
        Parameters:
        l -
        tz -
        Returns:
        Date
        Throws:
        java.rmi.RemoteException
      • isRMIEnabled

        public static boolean isRMIEnabled()
      • start

        public static void start(java.util.Properties propsFromFile)
                          throws java.lang.Exception
        Start MXServer.
        Parameters:
        propsFromFile - Properties from the maximo properties file (not from the database). These will include properties required for database connectivity.
        Throws:
        java.lang.Exception
      • isMTEnabled

        public static boolean isMTEnabled()
      • isBotcInstalled

        public static boolean isBotcInstalled()
      • isInlineThreadLog

        public static boolean isInlineThreadLog()
      • useClassicMaximo

        public static boolean useClassicMaximo()
      • hasFeatureToggle

        public static boolean hasFeatureToggle()
      • setTenantRegContext

        public static void setTenantRegContext(java.lang.Integer tenantID)
        Set security context to the tenant of the passed in UserInfo. The method shuld be used at the entry points to the server to establish the tenant context for the request.
      • isTenantRegContext

        public static boolean isTenantRegContext()
      • setTenantContext

        public static void setTenantContext(UserInfo ui)
        Set security context to the tenant of the passed in UserInfo. The method shuld be used at the entry points to the server to establish the tenant context for the request.
      • clearTenantContext

        public static void clearTenantContext()
        Clear the tenant context.
      • setTenantContext

        public static int setTenantContext(UserInfo ui,
                                           int tenantID)
                                    throws MXException
        Set the security context to the tenant by giving a landlord's userinfo. It returns the tenant id of the old security context. This method can be used by switching the security context and switching back by calling the method again with the returned tenant id.
        Parameters:
        ui -
        tenantID -
        Returns:
        the tenant id of the old security context.
        Throws:
        MXException
      • getTenantContext

        public static int getTenantContext()
        Return the tenant ID of the current tenant context. If context hasn't set, -1 will be returned. If this method is called when context is not said, an warning exception stacktrace will be logged.
        Returns:
      • getTenantContext

        public static int getTenantContext(boolean tenantNotSetCheck)
        get the tenant context. If tenantNotSetcheck is true, it will print out a stacktrace when the tenant id isnot set the moment when this is set.
        Parameters:
        tenantNotSetCheck -
        Returns:
        Throws:
        MXException
      • isMasterContext

        public static boolean isMasterContext()
        utility method for determining if the current thread context is for the master.
        Returns:
        true if its a master - false otherwise
      • removeMaxSessionEntriesDeadForAnHour

        public void removeMaxSessionEntriesDeadForAnHour()
        Remove maxsession server entry and related user entries if server is not running for 8 minutes.
        Parameters:
        con -
        Throws:
        java.lang.Exception
      • removeMaxSessionEntriesDeadForAnHour

        public void removeMaxSessionEntriesDeadForAnHour(java.sql.Connection con)
                                                  throws java.lang.Exception
        Remove maxsession server entry and related user entries if server is not running for 8 minutes.
        Parameters:
        con -
        Throws:
        java.lang.Exception
      • retryAsyncTask

        public void retryAsyncTask(java.sql.Connection con,
                                   java.lang.String serverName,
                                   java.lang.String serverHost)
                            throws java.lang.Exception
        Submit the inprogress async task if server was shut down when the task was running before.
        Parameters:
        con -
        serverName -
        serverHost -
        Throws:
        java.lang.Exception
      • upgradeDatabaseCheck

        protected void upgradeDatabaseCheck(java.sql.Connection con)
                                     throws java.lang.Exception
        This method checks if we need to upgrade database and throw a message to run the utility if needed
        Throws:
        java.lang.Exception
      • getMAXUPGValue

        public java.lang.String getMAXUPGValue(java.sql.Connection con,
                                               java.lang.String name)
        Gets the MAXUPG.
        Parameters:
        con - Database connection.
        Returns:
        Maxvar value of varname MAXUPG.
      • needToRunUpdateDB

        public void needToRunUpdateDB(java.lang.String product,
                                      java.lang.String maxupg,
                                      java.lang.String newRelDBVersion,
                                      java.lang.String lastRelDBVersion,
                                      java.lang.String varName,
                                      boolean checkHF)
                               throws java.lang.Exception
        Checks maxupg,new realease version and old release version to see if updbdb needed. This is called once to check the base level and a second time to check the hotfix level.
        Parameters:
        product -
        maxupg - Actual level (from varName). If checking hotfix level and this is null on database, then param will be empty string.
        newRelDBVersion - Required level. If checking hotfix level and none are required, this will be empty string.
        lastRelDBVersion - If checking hotfix level, this will be empty string.
        varName - Varname for getting actual level from maxvars table.
        checkHF - True if checking hotfix level, false is checking base level.
        Throws:
        java.lang.Exception
      • getConfig

        @Deprecated
        public java.util.Properties getConfig()
        Deprecated. 
        Return a copy of all the current properties of MXServer, for use when a Properties object is needed. Also see getProperty for getting the value of a single property. This method should not be exposed remotely.
        Returns:
        Clone of Properties currently in cache
      • getConfig

        @Deprecated
        public java.util.Properties getConfig(UserInfo userInfo)
        Deprecated. 
        Return a copy of all the current non-private properties of MXServer, for use when a Properties object is needed. Also see getProperty for getting the value of a single property. If userInfo is null, this will return null.
        Specified by:
        getConfig in interface MXServerRemote
        Parameters:
        userInfo - UserInfo making the request
        Returns:
        Clone of Properties currently in cache
        See Also:
        MXServer.getConfig(UserInfo userInfo)
      • getProperty

        public java.lang.String getProperty(java.lang.String propName)
        Return the cached property value. This method should not be exposed remotely.
        Parameters:
        propName - Property name
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String)
      • getProperty

        public java.lang.String getProperty(java.lang.String propName,
                                            boolean checkExists)
        Return the cached property value. This method should not be exposed remotely.
        Parameters:
        propName - Property name
        checkExists - Suppress log message if false
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String)
      • getProperty

        public java.lang.String getProperty(java.lang.String propName,
                                            UserInfo userInfo)
        Return the cached property value for a property not flagged as "private". If the property is not defined, this will return null. If the property is defined but has no value, this will return the empty string. If userInfo is null, this will return only public properties.
        Specified by:
        getProperty in interface MXServerRemote
        Parameters:
        propName - Property name
        userInfo - UserInfo making the request
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String)
      • getProperty

        public java.lang.String getProperty(java.lang.String propName,
                                            java.lang.String lang)
        Return the cached property value. This method should not be exposed remotely.
        Parameters:
        propName - Property name
        lang - Language code
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String, String)
      • getProperty

        public java.lang.String getProperty(java.lang.String propName,
                                            java.lang.String lang,
                                            UserInfo userInfo)
        Return the cached property value for a property not flagged as "private". If the property is not defined, this will return null. If the property is defined but has no value, this will return the empty string. If userInfo is null, this will return only public properties.
        Specified by:
        getProperty in interface MXServerRemote
        Parameters:
        propName - Property name
        lang - Language code
        userInfo - UserInfo making the request
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String, String)
      • getPublicProperty

        public java.lang.String getPublicProperty(java.lang.String propName,
                                                  java.lang.String lang)
        Return a property that is flagged as public.
        Specified by:
        getPublicProperty in interface MXServerRemote
        Parameters:
        propName - Property name
        lang - Language code
        Returns:
        Property value
        See Also:
        MaxPropCache.getProperty(String)
      • getSystemUserInfo

        public UserInfo getSystemUserInfo()
                                   throws MXException,
                                          java.rmi.RemoteException
        Returns the system user information for the system user. This method always returns a new copy of the UserInfo object. This should not be exposed remotely.
        Throws:
        MXException
        java.rmi.RemoteException
      • getUserInfo

        public UserInfo getUserInfo(java.lang.String userIdentity)
                             throws MXException,
                                    java.rmi.RemoteException
        Returns the user information for the given user. If the user has already been authenticated, this returns the cached UserInfo. Generally speaking, this should not be called unless the user has alraedy been authenticated. See SecurityService for the available forms of authenticateUser.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        SecurityService.getUserInfo(String)
      • enableService

        public void enableService(java.lang.String svc)
                           throws MXException
        Enable a service.
        Throws:
        MXException
      • disableService

        public void disableService(java.lang.String svc)
        Disable ( unbind ) a service.
      • getURL

        public java.lang.String getURL()
        Returns the URL of the MXServer.
      • setURL

        protected void setURL(java.lang.String url)
      • getRegistryHostName

        public java.lang.String getRegistryHostName()
        Returns the Host name of the registry.
      • setRegistryHostName

        protected void setRegistryHostName(java.lang.String host)
      • getRegistryPort

        public java.lang.String getRegistryPort()
        Returns the port number of the host on which the registry is running.
      • setRegistryPort

        protected void setRegistryPort(java.lang.String port)
      • getMXServerInfo

        public MXServerInfo getMXServerInfo()
        Returns the MXServerInfo object for additional properties.
      • setMXServerInfo

        protected void setMXServerInfo(MXServerInfo mxServerInfo)
      • setName

        protected void setName(java.lang.String name)
      • validateThisApiKeyConfigValue

        public java.lang.String validateThisApiKeyConfigValue(java.lang.String apiKey)
                                                       throws MXException,
                                                              java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • resolveApiKey

        public java.lang.String resolveApiKey(java.lang.String apikey)
                                       throws java.rmi.RemoteException,
                                              MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • validateApiKeyConfigValue

        public java.lang.String validateApiKeyConfigValue()
                                                   throws MXException,
                                                          java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • isLocal

        public boolean isLocal(java.lang.String serviceUrl)
      • createMXTransaction

        public MXTransaction createMXTransaction()
                                          throws java.rmi.RemoteException
        Create a new transaction. The returned MXTransaction is used by a number of places to coordinate objects as a single unit of work.
        Throws:
        java.rmi.RemoteException
      • sendEMail

        public static void sendEMail(java.lang.String to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.Throwable t)
                              throws javax.mail.MessagingException
        Send an email
        Throws:
        javax.mail.MessagingException
      • sendEMail

        public static void sendEMail(java.lang.String to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.String message)
                              throws javax.mail.MessagingException
        Send an email
        Throws:
        javax.mail.MessagingException
      • sendEMail

        public static void sendEMail(java.lang.String to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.String message,
                                     java.lang.String attachment,
                                     java.lang.String filename)
                              throws javax.mail.MessagingException
        Send an email
        Throws:
        javax.mail.MessagingException
      • sendEMail

        public static void sendEMail(java.lang.String[] to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.Throwable t)
                              throws javax.mail.MessagingException
        Throws:
        javax.mail.MessagingException
      • sendEMail

        public static void sendEMail(java.lang.String[] to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.String message)
                              throws javax.mail.MessagingException
        Send an email
        Throws:
        javax.mail.MessagingException
      • sendEMail

        public static void sendEMail(java.lang.String[] to,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.String message,
                                     java.lang.String attachment,
                                     java.lang.String filename)
                              throws javax.mail.MessagingException
        This method takes array of to addresses. When this method is used , make sure each email address in to is a valid email address.
        Parameters:
        to -
        from -
        subject -
        message -
        attachment -
        filename -
        Throws:
        javax.mail.MessagingException
        See Also:
        MXServer.sendEMail( String,String,String,String,String,String,String,String[],String[])
      • sendEMail

        public static void sendEMail(java.lang.String to,
                                     java.lang.String cc,
                                     java.lang.String bcc,
                                     java.lang.String from,
                                     java.lang.String subject,
                                     java.lang.String message,
                                     java.lang.String ReplyTo,
                                     java.lang.String[] fileName,
                                     java.lang.String[] urlName,
                                     java.util.Properties overrideProps)
                              throws javax.mail.MessagingException
        This method uses Internetaddress parse to get email address. to,cc,bcc,replyto can take multiple internet addresses separated by comma.
        Parameters:
        to -
        cc -
        bcc -
        from -
        subject -
        message -
        ReplyTo -
        fileName -
        urlName -
        overrideProps - Properties that should override the system mail properties for this message. For example, "mail.smtp.sendpartial", "true". Usually this parameter will be null or empty.
        Throws:
        javax.mail.MessagingException
      • getDatabaseProductName

        public java.lang.String getDatabaseProductName()
        Returns the name of the database product name.
        Specified by:
        getDatabaseProductName in interface MXServerRemote
      • getDatabaseProductVersion

        public java.lang.String getDatabaseProductVersion()
        Returns the database product version string.
        Specified by:
        getDatabaseProductVersion in interface MXServerRemote
      • getDBPlatform

        public int getDBPlatform()
        Returns the database platform as integer.
        See Also:
        UpgConstants
      • getDBConnUsed

        public int getDBConnUsed()
                          throws java.rmi.RemoteException
        Returns the number of coonections used from the DBManager
        Specified by:
        getDBConnUsed in interface MXServerRemote
        Returns:
        Throws:
        java.rmi.RemoteException
      • getFreeMemory

        public java.lang.String[] getFreeMemory()
                                         throws java.rmi.RemoteException
        Returns a String array of JVM runtime free memory for this server
        Specified by:
        getFreeMemory in interface MXServerRemote
        Returns:
        String [ServerName, total_memory, free_memory, max_memory]
        Throws:
        java.rmi.RemoteException
      • getUserLicenseKey

        @Deprecated
        public java.lang.String getUserLicenseKey()
        Deprecated. 
        Returns the "Internal Use Only" message, otherwise returns the user license key.
        Specified by:
        getUserLicenseKey in interface MXServerRemote
      • getMEAServerVersion

        public java.util.ArrayList getMEAServerVersion()
        Returns the MEA Version
        Specified by:
        getMEAServerVersion in interface MXServerRemote
        Returns:
        version arraylist or null
      • getMXServerVersion

        public java.lang.String[] getMXServerVersion()
        Return the version for MXServer and any add-ons.
        Returns:
        Version info
        See Also:
        Version.getStringForHelpAboutDialog()
      • isValidSite

        public boolean isValidSite(java.lang.String siteId)
                            throws java.rmi.RemoteException
        Returns whether the siteid is valid or not.
        Specified by:
        isValidSite in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • isValidOrganization

        public boolean isValidOrganization(java.lang.String orgId)
                                    throws java.rmi.RemoteException
        Returns whether the orgid is valid or not.
        Specified by:
        isValidOrganization in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • isSiteInOrganization

        public boolean isSiteInOrganization(java.lang.String siteId,
                                            java.lang.String orgId)
                                     throws java.rmi.RemoteException
        Returns whether the site belongs to the org or not.
        Specified by:
        isSiteInOrganization in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • getOrganization

        public java.lang.String getOrganization(java.lang.String siteId)
                                         throws java.rmi.RemoteException
        Returns organization id for the given siteid.
        Specified by:
        getOrganization in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • isMxserverStarted

        public boolean isMxserverStarted()
        returns true or false if mxserver has started or not
        Returns:
        True if MXServer has been started
      • checkAdminRestart

        public void checkAdminRestart()
                               throws MXException,
                                      java.rmi.RemoteException
        When booting, check maxvar to see whether MXServer should be started in Admin Mode.
        Throws:
        MXException
        java.rmi.RemoteException
      • checkFailedTenants

        public void checkFailedTenants()
                                throws java.rmi.RemoteException,
                                       MXException
        Throws:
        java.rmi.RemoteException
        MXException
      • getMXCipher

        public MXCipher getMXCipher()
        Returns instance of MXCipher for encryption / decrypption, for CRYPTO maxtype.
        Returns:
        instance of MXCipher
      • encData

        public byte[] encData(java.lang.String in,
                              int type)
                       throws MXException,
                              java.rmi.RemoteException
        Encrypt the input string.
        Specified by:
        encData in interface MXServerRemote
        Parameters:
        in -
        type - MaxType
        Returns:
        encrypted value of in
        Throws:
        MXException
        java.rmi.RemoteException
      • getMXCipherX

        public MXCipherX getMXCipherX()
        Returns instance of MXCipherX for encryption, for CRYPTOX maxtype.
        Returns:
        instance of MXCipherX
      • getNativeSql

        @Deprecated
        public java.lang.String getNativeSql(java.lang.String jdbcSql)
        Deprecated. 
        Return the native sql statement based on the jdbc sql statement.
        Parameters:
        jdbcSql - The sql string in jdbc format.
        userInfo - The UserInfo object
      • postUserInput

        public void postUserInput(java.lang.String id,
                                  java.lang.Object value,
                                  UserInfo ui)
                           throws java.rmi.RemoteException
        Post the object to the bulletin board maintained by the server.
        Specified by:
        postUserInput in interface MXServerRemote
        Parameters:
        id -
        value -
        ui -
        Throws:
        MXException
        java.rmi.RemoteException
      • getUserInput

        public java.lang.Object getUserInput(java.lang.String id,
                                             UserInfo ui)
                                      throws java.rmi.RemoteException
        Get the user input of the id.
        Specified by:
        getUserInput in interface MXServerRemote
        Parameters:
        id -
        ui -
        Returns:
        Object
        Throws:
        java.rmi.RemoteException
      • removeUserInput

        public void removeUserInput(java.lang.String id,
                                    UserInfo ui)
                             throws java.rmi.RemoteException
        Remove the user input from the bulletin board.
        Specified by:
        removeUserInput in interface MXServerRemote
        Parameters:
        id -
        ui -
        Throws:
        java.rmi.RemoteException
      • clearUserInput

        public void clearUserInput(UserInfo ui)
        Remove the old enough entries (older than 5min).
        Specified by:
        clearUserInput in interface MXServerRemote
        Parameters:
        ui -
        Throws:
        java.rmi.RemoteException
      • getBaseLang

        public java.lang.String getBaseLang()
                                     throws MXException,
                                            java.rmi.RemoteException
        Returns the base language code
        Specified by:
        getBaseLang in interface MXServerRemote
        Returns:
        Base language
        Throws:
        MXException
        java.rmi.RemoteException
      • getLanguageList

        public java.lang.String[][] getLanguageList()
                                             throws MXException,
                                                    java.rmi.RemoteException
        Returns the language ID and name in corresponding language
        Specified by:
        getLanguageList in interface MXServerRemote
        Returns:
        two dimensional string array
        Throws:
        MXException
        java.rmi.RemoteException
      • getMessage

        public java.lang.String getMessage(java.lang.String group,
                                           java.lang.String key,
                                           java.lang.String langCode)
                                    throws MXException,
                                           java.rmi.RemoteException
        Returns the maxmessage entry for group and key
        Specified by:
        getMessage in interface MXServerRemote
        Parameters:
        group -
        key -
        Returns:
        Message
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaggedMessage

        public java.lang.String getTaggedMessage(java.lang.String group,
                                                 java.lang.String key,
                                                 java.lang.String langCode)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Returns the maxmessage with MessageID tagged (BMX id)entry for group and key
        Specified by:
        getTaggedMessage in interface MXServerRemote
        Parameters:
        group -
        key -
        Returns:
        Message with MessageID tagged (BMX id)
        Throws:
        MXException
        java.rmi.RemoteException
      • getMessages

        public java.lang.String[] getMessages(java.lang.String group,
                                              java.lang.String[] key,
                                              java.lang.String langCode)
                                       throws MXException,
                                              java.rmi.RemoteException
        Return list of translated strings from the maxmessages table in the order specified by the array of keys passed
        Specified by:
        getMessages in interface MXServerRemote
        Parameters:
        group -
        key -
        Returns:
        Message array
        Throws:
        MXException
        java.rmi.RemoteException
      • getMessage

        public java.lang.String getMessage(MXException mxe,
                                           java.lang.String langCode)
                                    throws MXException,
                                           java.rmi.RemoteException
        Returns message for the exception and langcode
        Specified by:
        getMessage in interface MXServerRemote
        Parameters:
        mxe -
        langCode -
        Returns:
        Message
        Throws:
        MXException
        java.rmi.RemoteException
      • getTaggedMessage

        public java.lang.String getTaggedMessage(MXException mxe,
                                                 java.lang.String langCode)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Returns message with Messageidfor the exception and langcode
        Specified by:
        getTaggedMessage in interface MXServerRemote
        Parameters:
        mxe -
        langCode -
        Returns:
        Message
        Throws:
        MXException
        java.rmi.RemoteException
      • getMasterModifiedObjects

        public java.util.Map getMasterModifiedObjects()
                                               throws MXException
        Get lsit of objects which were changted (but not configured yet) by Master
        Parameters:
        serverName -
        Returns:
        Map of all objects changed by Master
        Throws:
        MXException
      • getMasterMboValueInfo

        public MboValueInfo getMasterMboValueInfo(MboRemote tenantMbo)
                                           throws MXException
        Get MboValueInfo for Master for given object and atribute
        Parameters:
        tenantMbo - Tenant Mbo
        Returns:
        MboValueInfo for Master context.
        Throws:
        MXException
      • getWarnings

        public java.util.ArrayList getWarnings(java.lang.Object id)
      • clearWarnings

        public void clearWarnings(java.lang.Object id)
      • addWarning

        public void addWarning(MXException e,
                               java.lang.Object id)
      • hasWarnings

        public boolean hasWarnings(java.lang.Object id)
      • incrementMboCount

        @Deprecated
        public void incrementMboCount(java.lang.String name,
                                                  int tenantID)
        Deprecated. 
        Increment the count for the mbo and tenant. This is called when a new Mbo is instantiated.
      • decrementMboCount

        public void decrementMboCount(java.lang.String name,
                                      int tenantID)
        Decrement the mbocount for the mbo and teantnt. This is called when the mbo's phantom reference shows up in the processing queue, which means the mbo has been garbage collected.
        Parameters:
        name -
        tenantID -
      • incrementMbosetCount

        public void incrementMbosetCount(java.lang.String name,
                                         int tenantID)
        This is to count the mbosets to debug gc.
      • decrementMbosetCount

        @Deprecated
        public void decrementMbosetCount(java.lang.String name)
        Deprecated. 
      • decrementMbosetCount

        public void decrementMbosetCount(java.lang.String name,
                                         int tenantID)
      • incrementMbosetIPCount

        public void incrementMbosetIPCount(java.lang.String objName,
                                           java.lang.String clientHost,
                                           java.lang.String clientAddr)
        Used to count AddUser and ForgotPassword sets by IP for IP Blocking checks. Do not call this for other MboSets unless the IP Blocking requirements change.
        Parameters:
        objName - MboSet name
        clientHost -
        clientAddr -
      • decrementMbosetIPCount

        public void decrementMbosetIPCount(java.lang.String objName,
                                           java.lang.String clientHost,
                                           java.lang.String clientAddr)
        Used to count AddUser and ForgotPassword sets by IP for IP Blocking checks. Do not call this for other MboSets unless the IP Blocking requirements change.
        Parameters:
        objName - MboSet name
        clientHost -
        clientAddr -
      • getMboSetIPCount

        public int getMboSetIPCount(java.lang.String objName,
                                    java.lang.String clientHost,
                                    java.lang.String clientAddr)
        Get count by IP. Used by SecurityService for ADDUSER and FORGOTPASSWORD sets.
      • printMaxsessionInfo

        public java.lang.String printMaxsessionInfo()
        Prints user information from maxsession table. Delete maxsession entries dead for an hour
      • getMboCount

        public java.lang.String getMboCount()
        Prints the list of mbosets and the mbo count.
      • getMboSetCount

        public int getMboSetCount(java.lang.String objName)
        Get the number of sets in memory for the specified object.
        Parameters:
        objName - Object name
        Returns:
        Number of MboSets in memory
      • getAllTenantsMboCountAsJSON

        public com.ibm.json.java.JSONObject getAllTenantsMboCountAsJSON()
      • getConditionCache

        public MaxConditionCache getConditionCache()
        return the maximo condition cache. If the cache hasn't initialilzed, it will be null.
        Returns:
        MaxConditionCache
      • setupLongOpPipe

        public java.io.InputStream setupLongOpPipe()
                                            throws MXException
        Set up the piped output stream for writing warnings. This is for long op messages so that UI can use this pipe to get the messages for display.
        Parameters:
        os -
        Throws:
        MXException
      • clearLongOpPipe

        public void clearLongOpPipe()
        Clear out the long op message pipe.
      • writeLongOpMsg

        public void writeLongOpMsg(java.lang.String msg)
      • getSQLServerPrefetchRows

        public int getSQLServerPrefetchRows()
        returns the number of rows to be prefetched for SQLServer.
      • getSecurityContext

        public MXServer.SecurityContextFlag getSecurityContext()
        Get security context flag if transaction can be saved or readonly
        Returns:
      • clearSecurityContext

        public void clearSecurityContext()
        Clear security context flag
      • setSecurityCheck

        public void setSecurityCheck(MXServer.SecurityContextFlag securityFlag)
        Sets the security context flag
        Parameters:
        securityFlag -
      • isSQLServerPrefetchRowsNeeded

        public boolean isSQLServerPrefetchRowsNeeded()
        returns whether to prefetch rows or not.
      • getMxServerConfig

        public java.util.Properties getMxServerConfig()
        Expose the properties. Use this method with caution.
        Returns:
      • getServerCommandRemote

        @Deprecated
        public SrvCommRemote getServerCommandRemote(java.lang.String name,
                                                                java.lang.String passwd)
                                                         throws MXApplicationException
        Deprecated. 
        This method returns the Server Command interface and is essentially the same as getSrvComm() except the user is disconnected after authentication based on USER_LOGOUT disconnect type. Use this method if you don't want a user session lingering around in the MAXSESSION table.
        Specified by:
        getServerCommandRemote in interface MXServerRemote
        Parameters:
        name -
        passwd -
        Returns:
        Throws:
        MXApplicationException
      • getMboCounts

        @Deprecated
        public java.util.ArrayList getMboCounts()
                                                     throws MXApplicationException
        Deprecated. 
        This method returns an ArrayList of MboSet and Mbo counts The Array list contains a list of String[] in the following format String["Server Name","MboSet Name", "MboSet Count", "Mbo Count"]
        Specified by:
        getMboCounts in interface MXServerRemote
        Returns:
        ArrayLIst
        Throws:
        MXApplicationException
      • getMboCounts

        public java.util.ArrayList getMboCounts(int tenantID)
                                         throws MXApplicationException
        This method returns an ArrayList of MboSet and Mbo counts The Array list contains a list of String[] in the following format For non-MT String["Server Name","MboSet Name", "MboSet Count", "Mbo Count"] For MT["Server Name-Tenant Code","MboSet Name", "MboSet Count", "Mbo Count"] String
        Specified by:
        getMboCounts in interface MXServerRemote
        Returns:
        ArrayLIst
        Throws:
        MXApplicationException
      • getBaseCalendar

        public java.lang.String getBaseCalendar()
        Gets The System Calendar Type
      • getTenantIdsList

        public java.util.List getTenantIdsList(UserInfo landlordInfo,
                                               int status)
                                        throws java.rmi.RemoteException,
                                               MXException
        Get a list of tenant ids except for configuration administrator, ordered by tenant ID. The landlord ID is first. The list may be filtered by active or intactive status using the status argument.
        Parameters:
        landlordInfo -
        status -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • getAllTenantIdsList

        public java.util.List getAllTenantIdsList(UserInfo landlordInfo)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Get a list of all the tenant ids except for configuration administrator, ordered by tenant ID. The landlord ID is first.
        Parameters:
        landlordInfo -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • setProxy

        public void setProxy(java.rmi.Remote proxy)
        Specified by:
        setProxy in interface MaxRemoteProxy
      • getTenantRealmMap

        public java.util.HashMap getTenantRealmMap()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Returns the tenant code and real name map
        Specified by:
        getTenantRealmMap in interface MXServerRemote
        Returns:
        two dimensional string array
        Throws:
        MXException
        java.rmi.RemoteException
      • clearTenantRealmMap

        public void clearTenantRealmMap()
                                 throws java.rmi.RemoteException
        Specified by:
        clearTenantRealmMap in interface MXServerRemote
        Throws:
        java.rmi.RemoteException
      • loadCustomApps

        public void loadCustomApps()
      • loadCustomApps

        public void loadCustomApps(java.sql.Connection con)
      • isManage

        public boolean isManage()
                         throws MXException,
                                java.rmi.RemoteException
        returns true if the license MANAGE is present
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException