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.
|
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 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 |
getDateFormat()
Gets the order of date components (SESSION:DATE-FORMAT) for conversion to/from strings.
|
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-HANLDE 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 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 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 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 |
isRemote()
Indicates if the session is for the context of an appserver.
|
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 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(java.lang.String iconName)
Set the state of SESSION:LOAD-ICON attribute.
|
static void |
readOnlyError(java.lang.String attribute)
API needed to implement read-only attribute assignment (a 4GL
"feature").
|
static void |
set3D(logical value)
Set THREE-D attribute value for SESSION handle.
|
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 |
setMultitaskingInterval(NumberType interval)
Set the value of SESSION:MULTITASKING-INTERVAL attribute.
|
static void |
setPrinterControlHandle(integer value)
Set the state of SESSION:PRINTER-CONTROL-HANLDE 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 |
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 |
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 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 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 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 loadedpublic 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-HANLDE 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 character getServerConnectionId()