public class SessionUtils
extends java.lang.Object
CommonSession
interface (or one of its super interfaces) and are not statically
implemented by the classes used by the asHandle()
.Modifier and Type | Class and Description |
---|---|
private static class |
SessionUtils.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<SessionUtils.WorkArea> |
work
Context local proxy that allows SESSION attributes to be pushed from server to client.
|
Constructor and Description |
---|
SessionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
_isRemote()
Indicates if the session is for the context of an appserver.
|
static handle |
asHandle()
Get a the instance for the SESSION system handle.
|
(package private) static void |
clientDisconnected()
Mark this context as the client has disconnected (due to an abend, socket disconnect, etc).
|
static object<? extends OerequestInfo> |
currentRequestInfo()
Get the CURRENT-REQUEST-INFO attribute of this session.
|
static object<? extends OerequestInfo> |
currentResponseInfo()
Get the CURRENT-RESPONSE-INFO attribute of this session.
|
static logical |
export(character procList)
Method that specifies the remote procedures the client can execute from the AppServer
session.
|
static logical |
export(java.lang.String procList)
Method that specifies the remote procedures the client can execute from the AppServer
session.
|
static handle |
firstBuffer()
Returns the handle for the first dynamic buffer in the first table containing a dynamic
buffer.
|
static handle |
firstChild()
Returns the handle for the first window in the session.
|
static object<?> |
firstObject()
Get the FIRST-OBJECT attribute of this session.
|
static handle |
firstQuery()
Returns the handle for the first created dynamic query.
|
static handle |
firstServer()
Get the FIRST-SERVER attribute of this session.
|
static handle |
firstServerSocket()
Get the FIRST-SERVER-SOCKET attribute of this session.
|
static handle |
firstSocket()
Get the FIRST-SOCKET attribute of this session.
|
static character |
getContextHelpFile()
Get the CONTEXT-HELP-FILE attribute of this session.
|
static character |
getDateFormat()
Gets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
static long |
getExitCode()
Get the value of SESSION:EXIT-CODE attribute.
|
static handle |
getFirstDataSet()
Obtain a handle to the first dynamic
DataSet object created in the current session. |
static handle |
getFirstDataSource()
Obtain a handle to the first dynamic
DataSource object created in the current session. |
static character |
getICFParameter()
Get the ICFPARAMETER attribute of this session.
|
static integer |
getMultitaskingInterval()
Get the value of SESSION:MULTITASKING-INTERVAL attribute.
|
static character |
getParameter()
Get the value of the PARAMETER attribute, which is set to the value of the 4GL
-param command line option specified for the current session. |
static integer |
getPixelsPerColumn()
Get the PIXELS-PER-COLUMN attribute of this session.
|
static integer |
getPixelsPerRow()
Get the PIXELS-PER-ROW attribute of this session.
|
static integer |
getPrinterControlHandle()
Get the state of SESSION:PRINTER-CONTROL-HANDLE attribute.
|
static integer |
getPrinterHDC()
Get the state of SESSION:PRINTER-HDC attribute.
|
static character |
getPrinterName()
Get the state of SESSION:PRINTER-NAME attribute.
|
static character |
getPrinterPort()
Get the state of SESSION:PRINTER-PORT attribute.
|
static character |
getPrinters()
The SESSION:GET-PRINTERS method.
|
static character |
getResourceType()
Get the type of its associated handle.
|
static logical |
getServerConnectionBoundRequest()
Get the SERVER-CONNECTION-BOUND-REQUEST attribute of this session.
|
static character |
getServerConnectionContext()
Get the SERVER-CONNECTION-CONTEXT attribute of this session.
|
static character |
getServerConnectionId()
Get the value of SESSION:SERVER-CONNECTION-ID attribute.
|
static character |
getServerOperatingMode()
Method implementation for getting the SERVER-OPERATING-MODE attribute of the session handle.
|
static integer |
getSessionDisplayTimeZone()
Obtains the currently configured DISPLAY-TIMEZONE attribute for the current
user's context.
|
static character |
getSessionTimeSource()
Obtains the currently configured TIME-SOURCE attribute for the current
user's context.
|
static integer |
getSessionTimeZone()
Accesses the SESSION:TIMEZONE used as the default offset in minutes from
UTC for this user's context.
|
static logical |
getSessionTooltips()
Accesses the SESSION:TOOLTIPS attribute for this session.
|
static character |
getStartupParameters()
Get the state of SESSION:STARTUP-PARAMETERS attribute.
|
static character |
getTerminationHook()
Get the TERMINATION-HOOK attribute of this session.
|
static integer |
getYearOffset()
Implementation of SESSION:YEAR-OFFSET attribute getter.
|
static java.lang.Long |
id()
Get this resource's ID.
|
static void |
id(long id)
Set this resource's ID.
|
static logical |
is3D()
Get THREE-D attribute value for SESSION handle.
|
static logical |
isClientDisconnected()
Get the CLIENT-DISCONNECTED attribute of this session.
|
static boolean |
isClientlog()
Check if client log is active
|
static logical |
isDataEntryReturn()
Get the state of SESSION:DATA-ENTRY-RETURN attribute.
|
static logical |
isDebugAlert()
Get the state of SESSION:DEBUG-ALERT attribute.
|
static logical |
isErrorStackTrace()
Get the ERROR-STACK-TRACE attribute of this session.
|
static logical |
isRemote()
Indicates if the session is for the context of an appserver.
|
static logical |
isServerConnectionBound()
Get the SERVER-CONNECTION-BOUND attribute of this session.
|
static logical |
isSuppressWarnings()
Get the state of SESSION:SUPPRESS-WARNINGS attribute.
|
static logical |
isSystemAlertBoxes()
Get the state of SESSION:SYSTEM-ALERT-BOXES attribute.
|
static handle |
lastChild()
Returns the handle for the last window in the session.
|
static object<?> |
lastObject()
Get the LAST-OBJECT attribute of this session.
|
static handle |
lastServer()
Get the LAST-SERVER attribute of this session.
|
static handle |
lastServerSocket()
Get the LAST-SERVER-SOCKET attribute of this session.
|
static handle |
lastSocket()
Get the LAST-SOCKET attribute of this session.
|
static logical |
loadIcon(character iconName)
Set the state of SESSION:LOAD-ICON attribute.
|
static logical |
loadIcon(java.lang.String iconName)
Set the state of SESSION:LOAD-ICON attribute.
|
static object<? extends OeversionInfo> |
localVersionInfo()
Get the LOCAL-VERSION-INFO attribute of this session.
|
static void |
readOnlyError(java.lang.String attribute)
API needed to implement read-only attribute assignment (a 4GL "feature").
|
static void |
readOnlyError(java.lang.String attribute,
java.lang.Object expr)
Emitted and to be used only in cases the attribute is read-only.
|
static void |
set3D(logical value)
Set THREE-D attribute value for SESSION handle.
|
static void |
setContextHelpFile(character file)
Set the CONTEXT-HELP-FILE attribute of this session.
|
static void |
setContextHelpFile(java.lang.String file)
Set the CONTEXT-HELP-FILE attribute of this session.
|
static void |
setDataEntryReturn(boolean on)
Set the state of SESSION:DATA-ENTRY-RETURN attribute.
|
static void |
setDataEntryReturn(logical on)
Set the state of SESSION:DATA-ENTRY-RETURN attribute.
|
static void |
setDateFormat(character dateFormat)
Sets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
static void |
setDateFormat(java.lang.String dateFormat)
Sets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
static void |
setDebugAlert(boolean on)
Set the state of SESSION:DEBUG-ALERT attribute.
|
static void |
setDebugAlert(logical on)
Set the state of SESSION:DEBUG-ALERT attribute.
|
static void |
setErrorStackTrace(boolean state)
Set the ERROR-STACK-TRACE attribute of this session.
|
static void |
setErrorStackTrace(logical state)
Set the ERROR-STACK-TRACE attribute of this session.
|
static void |
setExitCode(long value)
Set the value of SESSION:EXIT-CODE attribute.
|
static void |
setMultitaskingInterval(NumberType interval)
Set the value of SESSION:MULTITASKING-INTERVAL attribute.
|
static void |
setPrinterControlHandle(integer value)
Set the state of SESSION:PRINTER-CONTROL-HANDLE attribute.
|
static void |
setPrinterName(character value)
Set the state of SESSION:PRINTER-NAME attribute.
|
static void |
setPrinterPort(character value)
Set the state of SESSION:PRINTER-PORT attribute.
|
static void |
setServerConnectionBoundRequest(boolean state)
Set the SERVER-CONNECTION-BOUND-REQUEST attribute of this session.
|
static void |
setServerConnectionBoundRequest(logical state)
Set the SERVER-CONNECTION-BOUND-REQUEST attribute of this session.
|
static void |
setServerConnectionContext(character val)
Set the SERVER-CONNECTION-CONTEXT attribute of this session.
|
static void |
setServerConnectionContext(java.lang.String val)
Set the SERVER-CONNECTION-CONTEXT attribute of this session.
|
static void |
setSessionDisplayTimeZone(NumberType displayTimezone)
Sets the
DISPLAY-TIMEZONE attribute for the user's context. |
static void |
setSessionTimeSource(character timeSource)
Sets the
TIME-SOURCE attribute for the user's context. |
static void |
setSessionTimeZone(NumberType offset)
Sets the SESSION:TIMEZONE used as the default offset in minutes from
UTC for this user's context.
|
static void |
setSessionTooltips(logical tooltips)
Sets the SESSION:TOOLTIPS attribute for this session.
|
static void |
setSuppressWarnings(boolean value)
Set the state of SESSION:SUPPRESS-WARNINGS attribute.
|
static void |
setSuppressWarnings(logical value)
Set the state of SESSION:SUPPRESS-WARNINGS attribute.
|
static void |
setSystemAlertBoxes(boolean on)
Set the state of SESSION:SYSTEM-ALERT-BOXES attribute.
|
static void |
setSystemAlertBoxes(logical on)
Set the state of SESSION:SYSTEM-ALERT-BOXES attribute.
|
static void |
setTerminationHook(character hook)
Set the TERMINATION-HOOK attribute of this session.
|
static void |
setTerminationHook(java.lang.String hook)
Set the TERMINATION-HOOK attribute of this session.
|
static void |
setYearOffset(NumberType year)
Implementation of SESSION:YEAR-OFFSET attribute setter.
|
static boolean |
unknown()
Implementation for the
WrappedResource.unknown() API. |
static boolean |
valid()
Implementation for the
WrappedResource.valid() API. |
private static final ContextLocal<SessionUtils.WorkArea> work
public static handle asHandle()
StaticProxy.obtain(Class, Class[])
, using the
CommonSession
interface and its methods implemented by these
classes: SessionUtils
, EnvironmentOps
, date
,
LogicalTerminal
, ProcedureManager
.public static java.lang.Long id()
public static void id(long id)
This is a no-op for system handles.
id
- The resource's ID.public static character getResourceType()
public static boolean valid()
WrappedResource.valid()
API.public static boolean unknown()
WrappedResource.unknown()
API.public static void readOnlyError(java.lang.String attribute)
attribute
- The attribute's name.handle.readOnlyError(handle, String)
public static void readOnlyError(java.lang.String attribute, java.lang.Object expr)
**Unable to assign UNKNOWN value to attribute <attribute> on <widget id>.
attribute
- The read-only attribute.expr
- The value which is attempted to be assigned to the read-only attribute.public static logical isRemote()
true
if the session is for the context of an appserver.public static boolean _isRemote()
true
if the session is for the context of an appserver.public static logical isClientDisconnected()
true
if the FWD client has disconnected (due to an abend, socket close, etc).public static character getTerminationHook()
public static void setTerminationHook(character hook)
This attribute is valid only for non-remote sessions - for a remote session, a message will be logged.
hook
- The hook, a character expression with an external program name or a static method reference
following the com.goldencode.Foo:someStaticMethod
syntax.public static void setTerminationHook(java.lang.String hook)
hook
- The hook, a character expression with an external program name or a static method reference
following the com.goldencode.Foo:someStaticMethod
syntax.public static character getServerOperatingMode()
Possible values:
public static logical export(java.lang.String procList)
procList
- The list of procedure and name-patterns separated by comma.true
if the method succeeded.public static logical export(character procList)
procList
- The list of procedure and name-patterns separated by comma.true
if the method succeeded.public static character getParameter()
-param
command line option specified for the current session.
The following is the precedence order (highest to lowest) for obtaining the value of this parameter:
SESSION:PARAMETER
value for this context.public static handle firstBuffer()
public static handle firstChild()
public static handle lastChild()
public static handle firstQuery()
TODO: this should call a worker method from the persist package.
public static handle firstServer()
public static handle firstServerSocket()
public static handle firstSocket()
public static handle lastServer()
public static handle lastServerSocket()
public static handle lastSocket()
public static handle getFirstDataSet()
DataSet
object created in the current session.
The list of Datasets is reversed (it is a stack instead of a queue).
SESSION:FIRST-DATASET
, as described above.public static handle getFirstDataSource()
DataSource
object created in the current session.
The list of DataSources is reversed (it is a stack instead of a queue).
SESSION:FIRST-DATA-SOURCE
, as described above.public static void setDateFormat(java.lang.String dateFormat)
The order of the 3 date sub-components as a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value set is specific to the current user's context.
dateFormat
- Defines the order of date components for conversion to/from strings.public static void setDateFormat(character dateFormat)
The order of the 3 date sub-components as a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value set is specific to the current user's context.
dateFormat
- Defines the order of date components for conversion to/from strings.public static character getDateFormat()
The order of the 3 date sub-components is a 3 character string using "M", "D" and "Y" once each. The order from index 0 to index 2 represents the left to right ordering of the components. So the leftmost date component will be defined by the character at index position 0.
The value accessed is specific to the current user's context.
public static logical isDebugAlert()
public static void setDebugAlert(logical on)
on
- The new state for SESSION:DEBUG-ALERT attribute.public static void setDebugAlert(boolean on)
on
- The new state for SESSION:DEBUG-ALERT attribute.public static logical isDataEntryReturn()
public static void setDataEntryReturn(logical on)
on
- The new state for SESSION:DATA-ENTRY-RETURN attribute.public static void setDataEntryReturn(boolean on)
on
- The new state for SESSION:DATA-ENTRY-RETURN attribute.public static logical loadIcon(java.lang.String iconName)
iconName
- The file name of the icon to be loadedtrue
if successfulpublic static logical loadIcon(character iconName)
iconName
- The file name of the icon to be loadedtrue
if successfulpublic static void setSessionTimeZone(NumberType offset)
offset
- The new timezone offset which must be between -840 and 840
inclusive. The value may also be unknown
which
is the equivalent of resetting this attribute to the default.public static integer getSessionTimeZone()
unknown
will be returned.public static character getSessionTimeSource()
The default value is "local" which in Progress means that the client machine is the source (this is the same as the empty string ""). It is common to use a database name in the 4GL, which makes the application use the database server as the time source.
public static void setSessionTimeSource(character timeSource)
TIME-SOURCE
attribute for the user's context.
This attribute is can be read and written but it is not honored for
date/time processing in P2J. The intention of the attribute is to define
the system from which time values will be obtained. In P2J, time values
are always obtained from the application server.timeSource
- The new value to set. If null
, then the empty
string will be used, which in the 4GL has the same affect as
"local".public static integer getSessionDisplayTimeZone()
public static void setSessionDisplayTimeZone(NumberType displayTimezone)
DISPLAY-TIMEZONE
attribute for the user's context.
This attribute is used for displaying DATETIME-TZ values that do not have
the timezone specified in the display format.displayTimezone
- The new value to set.public static integer getYearOffset()
date.getWindowingYear()
).public static void setYearOffset(NumberType year)
date.getWindowingYear()
).year
- The new start year for the two-digit windowing range.public static integer getPixelsPerRow()
public static integer getPixelsPerColumn()
public static void setSessionTooltips(logical tooltips)
tooltips
- The new value for session related TOOLTIPS attribute.public static logical getSessionTooltips()
true
if tooltips are available for this session
false
otherwise.public static logical is3D()
public static void set3D(logical value)
value
- The value to set.public static boolean isClientlog()
true
if client log is activepublic static character getPrinterName()
public static void setPrinterName(character value)
value
- The new state for SESSION:PRINTER-NAME attribute.public static character getPrinterPort()
public static void setPrinterPort(character value)
value
- The new state for SESSION:PRINTER-PORT attribute.public static integer getPrinterControlHandle()
public static void setPrinterControlHandle(integer value)
value
- The new state for SESSION:PRINTER-CONTROL-HANDLE attribute.public static integer getPrinterHDC()
public static character getPrinters()
public static logical isSuppressWarnings()
public static void setSuppressWarnings(logical value)
value
- The new state for SESSION:SUPPRESS-WARNINGS attribute.public static void setSuppressWarnings(boolean value)
value
- The new state for SESSION:SUPPRESS-WARNINGS attribute.public static character getStartupParameters()
public static void setSystemAlertBoxes(boolean on)
on
- The new state for SESSION:SYSTEM-ALERT-BOXES attribute.public static void setSystemAlertBoxes(logical on)
on
- The new state for SESSION:SYSTEM-ALERT-BOXES attribute.public static logical isSystemAlertBoxes()
public static void setMultitaskingInterval(NumberType interval)
interval
- The new value of SESSION:MULTITASKING-INTERVAL attribute.public static integer getMultitaskingInterval()
public static void setExitCode(long value)
value
- The new value of SESSION:EXIT-CODE attribute.public static long getExitCode()
public static logical isServerConnectionBound()
public static character getServerConnectionContext()
public static void setServerConnectionContext(java.lang.String val)
val
- The attribute's value.public static void setServerConnectionContext(character val)
val
- The attribute's value.public static character getServerConnectionId()
public static object<?> firstObject()
public static object<?> lastObject()
public static object<? extends OeversionInfo> localVersionInfo()
public static object<? extends OerequestInfo> currentRequestInfo()
public static object<? extends OerequestInfo> currentResponseInfo()
public static character getICFParameter()
public static character getContextHelpFile()
public static void setContextHelpFile(java.lang.String file)
file
- The file name.public static void setContextHelpFile(character file)
file
- The file name.public static logical getServerConnectionBoundRequest()
public static void setServerConnectionBoundRequest(boolean state)
state
- The bound state.public static void setServerConnectionBoundRequest(logical state)
state
- The bound state.public static void setErrorStackTrace(logical state)
state
- The attribute's state.public static void setErrorStackTrace(boolean state)
state
- The attribute's state.public static logical isErrorStackTrace()
static void clientDisconnected()