public class IRIS extends Object
IRIS
provides various methods that can be used to access
the IRIS Global Module. Basic operations such as GET, SET, KILL etc. are
supported. There are also methods to execute class methods and routines.
Any method will throw a Runtime exception on encountering any kind of error.Modifier and Type | Method and Description |
---|---|
Boolean |
classMethodBoolean(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as an instance of
Boolean . |
byte[] |
classMethodBytes(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as an instance of
byte[] . |
Double |
classMethodDouble(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as an instance of
Double . |
Long |
classMethodLong(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as an instance of
Long . |
void |
classMethodStatusCode(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as IRIS Status Code
If the status code indicates an error, then Exception is thrown
Otherwise methods returns normally
Arguments may be of any of the following types:
Integer ,
Short , String , Long , Double ,
Float , byte[] , Boolean , Time ,
Date , or Timestamp . |
String |
classMethodString(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method, passing 0 or more arguments and
returning the method's return value as an instance of
String . |
void |
classMethodVoid(String className,
String methodName,
Object... args)
Calls a IRIS ObjectScript class method with no return value, passing 0
or more arguments.
|
void |
close() |
static IRIS |
createIRIS(com.intersystems.jdbc.IRISConnection conn) |
Boolean |
functionBoolean(String functionName,
String routineName,
Object... args)
Calls a IRIS ObjectScript function, passing 0 or more arguments and
returning the function's return value as an instance of
Boolean . |
byte[] |
functionBytes(String functionName,
String routineName,
Object... args)
Calls a IRIS ObjectScript function, passing 0 or more arguments and
returning the function's return value as an instance of
byte[] . |
Double |
functionDouble(String functionName,
String routineName,
Object... args)
Calls a IRIS ObjectScript function, passing 0 or more arguments and
returning the function's return value as an instance of
Double . |
Long |
functionLong(String functionName,
String routineName,
Object... args)
Calls a IRIS ObjectScript function, passing 0 or more arguments and
returning the function's return value as an instance of
Long . |
String |
functionString(String functionName,
String routineName,
Object... args)
Calls a IRIS ObjectScript function, passing 0 or more arguments and
returning the function's return value as an instance of
String . |
Boolean |
getBoolean(String globalName,
Object... subscripts)
Gets the value of the global as a Boolean.
|
byte[] |
getBytes(String globalName,
Object... subscripts)
Gets the value of the global as a byte[].
|
Date |
getDate(String globalName,
Object... subscripts)
Gets the value of the global as a java.sql.Date.
|
Double |
getDouble(String globalName,
Object... subscripts)
Gets the value of the global as a Double.
|
Float |
getFloat(String globalName,
Object... subscripts)
Gets the value of the global as a Float.
|
InputStream |
getInputStream(String globalName,
Object... subscripts)
Gets the value of the global as a InputStream.
|
Integer |
getInteger(String globalName,
Object... subscripts)
Gets the value of the global as a Integer.
|
IRISIterator |
getIRISIterator(int prefetchSizeHint,
String globalName,
Object... subscripts)
Allows iterating over a global in the $ORDER sense by returning an iterator that can be
used to extract subscripts and global node values.
|
IRISIterator |
getIRISIterator(String globalName,
Object... subscripts)
Allows iterating over a global in the $ORDER sense by returning an iterator that can be
used to extract subscripts and global node values.
|
Long |
getLong(String globalName,
Object... subscripts)
Gets the value of the global as a Long.
|
List<com.intersystems.jdbc.ListReader> |
getNodes(String globalName,
Object... subscripts)
Note: This method is for internal use only.
|
Object |
getObject(String globalName,
Object... subscripts)
Gets the value of the global as an Object.
|
Reader |
getReader(String globalName,
Object... subscripts)
Gets the value of the global as a Reader.
|
Short |
getShort(String globalName,
Object... subscripts)
Gets the value of the global as a Short.
|
String |
getString(String globalName,
Object... subscripts)
Gets the value of the global as a String.
|
Time |
getTime(String globalName,
Object... subscripts)
Gets the value of the global as a java.sql.Time.
|
Timestamp |
getTimestamp(String globalName,
Object... subscripts)
Gets the value of the global as a java.sql.Timestamp.
|
Integer |
getTLevel()
Get the level of the current nested IRIS transaction.
|
long |
increment(Integer value,
String globalName,
Object... subscripts)
Increments the specified global with the passed value.
|
int |
isDefined(String globalName,
Object... subscripts)
Checks if a a global contains data ($DATA).
|
void |
kill(String globalName,
Object... subscripts)
Kills the global node including any descendants.
|
boolean |
lock(String lockMode,
Integer timeout,
String globalName,
Object... subscripts)
Lock the global, returns true on success.
|
void |
procedure(String procedureName,
String routineName,
Object... args)
Calls a IRIS ObjectScript procedure, passing 0 or more arguments.
|
void |
releaseAllLocks()
Release all locks associated with the session.
|
void |
set(Boolean value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Boolean value. |
void |
set(byte[] value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
byte[] value. |
void |
set(Date value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
java.sql.Date value. |
void |
set(Double value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Double value. |
void |
set(Float value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Float value. |
void |
set(InputStream value,
String globalName,
Object... subscripts)
Sets the current node's value to the data in the given InputStream.
|
void |
set(Integer value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Integer value. |
void |
set(Long value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Long value. |
void |
set(Object value,
String globalName,
Object... subscripts)
Sets the current node's value to the specified value.
|
void |
set(Reader value,
String globalName,
Object... subscripts)
Sets the current node's value to the data in the given Reader.
|
void |
set(Short value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
Short value. |
void |
set(String value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
String value. |
void |
set(Timestamp value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
java.sql.Timestamp value. |
void |
set(Time value,
String globalName,
Object... subscripts)
Sets the current node's value to the given
java.sql.Time value. |
<T extends Serializable> |
set(T value,
String globalName,
Object... subscripts)
Sets the current node's value to an instance of an object that implements
Serializable.
|
void |
tCommit()
Commit the current IRIS transaction.
|
void |
tRollback()
Roll back all open IRIS transactions in the session.
|
void |
tRollbackOne()
Roll back the current level IRIS transaction only.
|
void |
tStart()
Start/open a IRIS transaction.
|
void |
unlock(String lockMode,
String globalName,
Object... subscripts)
Unlock the global.
|
public static IRIS createIRIS(com.intersystems.jdbc.IRISConnection conn) throws SQLException
SQLException
public final Boolean getBoolean(String globalName, Object... subscripts)
null
if
node is undefined. Returns false if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final byte[] getBytes(String globalName, Object... subscripts)
null
if
node is undefined.globalName
- global namesubscripts
- global subscriptspublic final Integer getInteger(String globalName, Object... subscripts)
null
if
node is undefined. Returns 0 if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final Short getShort(String globalName, Object... subscripts)
null
if
node is undefined. Returns 0 if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final Long getLong(String globalName, Object... subscripts)
null
if node
is undefined. Returns 0 if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final Object getObject(String globalName, Object... subscripts)
null
if node
is undefined.globalName
- global namesubscripts
- global subscriptspublic final String getString(String globalName, Object... subscripts)
null
if
node is undefined. This method does some translation between type-less
IRIS and typed Java, regarding the empty string and null. A null
character in IRIS $CHAR(0) is translated to the empty string in Java "".
An empty string in IRIS "" is translated to null in Java. This
translation is consistent with the way JDBC handles these values.globalName
- global namesubscripts
- global subscriptspublic final Float getFloat(String globalName, Object... subscripts)
null
if
node is undefined. Returns 0.0 if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final Double getDouble(String globalName, Object... subscripts)
null
if
node is undefined. Returns 0.0 if node value is empty string.globalName
- global namesubscripts
- global subscriptspublic final Timestamp getTimestamp(String globalName, Object... subscripts)
null
if node is undefined.globalName
- global namesubscripts
- global subscriptspublic final Time getTime(String globalName, Object... subscripts)
null
if node is undefined.globalName
- global namesubscripts
- global subscriptspublic final Date getDate(String globalName, Object... subscripts)
null
if node is undefined.globalName
- global namesubscripts
- global subscriptspublic final InputStream getInputStream(String globalName, Object... subscripts)
null
if node is undefined. This method is currently limited to the maximum size
of a single global node.globalName
- global namesubscripts
- global subscriptspublic final Reader getReader(String globalName, Object... subscripts)
null
if
node is undefined. This method is currently limited to the maximum size
of a single global node.globalName
- global namesubscripts
- global subscriptspublic final void set(Integer value, String globalName, Object... subscripts)
Integer
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Integer
value to which to set this nodesubscripts
- subscriptspublic final void set(Boolean value, String globalName, Object... subscripts)
Boolean
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Boolean
value to which to set this nodesubscripts
- subscriptspublic final void set(Short value, String globalName, Object... subscripts)
Short
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Short
value to which to set this nodesubscripts
- subscriptspublic final void set(Long value, String globalName, Object... subscripts)
Long
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Long
value to which to set this nodesubscripts
- subscriptspublic final void set(Double value, String globalName, Object... subscripts)
Double
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Double
value to which to set this nodesubscripts
- subscriptspublic final void set(Float value, String globalName, Object... subscripts)
Float
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- Float
value to which to set this nodesubscripts
- subscriptspublic final void set(Date value, String globalName, Object... subscripts)
java.sql.Date
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- java.sql.Date
value to which to set this nodesubscripts
- subscriptspublic final void set(Time value, String globalName, Object... subscripts)
java.sql.Time
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- java.sql.Time
value to which to set this nodesubscripts
- subscriptspublic final void set(Timestamp value, String globalName, Object... subscripts)
java.sql.Timestamp
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- java.sql.Timestamp
value to which to set this nodesubscripts
- subscriptspublic final void set(String value, String globalName, Object... subscripts)
String
value.
This method does some translation between typed Java and type-less
IRIS, regarding the empty string and null. An empty string in Java ""
is translated to the null string character in IRIS $CHAR(0). A null
in Java is translated to the empty string in IRIS. This translation
is consistent with the way JDBC handles these values.globalName
- global namevalue
- String
value to which to set this nodesubscripts
- subscriptspublic final void set(byte[] value, String globalName, Object... subscripts)
byte[]
value.
A null value translates to "" in IRIS.globalName
- global namevalue
- byte[]
value to which to set this nodesubscripts
- subscriptspublic final void set(InputStream value, String globalName, Object... subscripts)
value
- InputStream value to which to set this nodeglobalName
- global namesubscripts
- subscriptspublic final void set(Reader value, String globalName, Object... subscripts)
value
- Reader value to which to set this nodeglobalName
- global namesubscripts
- subscriptspublic final <T extends Serializable> void set(T value, String globalName, Object... subscripts)
T
- type variableglobalName
- global namevalue
- Serializable valuesubscripts
- subscriptspublic final void set(Object value, String globalName, Object... subscripts)
Integer
, Boolean
,
Short
, Long
, Double
,
Float
, String
, java.sql.Date
,
java.sql.Time
, java.sql.Timestamp
,
Serializable
, byte[]
, Reader
or
InputStream
. A null value translates to "" in IRIS.globalName
- global namevalue
- Object
value to which to set this nodesubscripts
- subscriptspublic final void kill(String globalName, Object... subscripts)
globalName
- global namesubscripts
- global subscriptspublic final long increment(Integer value, String globalName, Object... subscripts)
value
- Integer
value to which to set this nodeglobalName
- global namesubscripts
- global subscriptspublic final int isDefined(String globalName, Object... subscripts)
globalName
- global namesubscripts
- global subscriptspublic final List<com.intersystems.jdbc.ListReader> getNodes(String globalName, Object... subscripts)
globalName
- global namesubscripts
- global subscriptspublic final IRISIterator getIRISIterator(String globalName, Object... subscripts)
globalName
- global namesubscripts
- global subscriptspublic final IRISIterator getIRISIterator(int prefetchSizeHint, String globalName, Object... subscripts)
prefetchSizeHint
- hint to iterator for size of chunks (in bytes) to use when fetching data from serverglobalName
- global namesubscripts
- global subscriptspublic final Boolean classMethodBoolean(String className, String methodName, Object... args)
Boolean
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodBoolean
.public final String classMethodString(String className, String methodName, Object... args)
String
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodString
.public final Long classMethodLong(String className, String methodName, Object... args)
Long
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodLong
.public final Double classMethodDouble(String className, String methodName, Object... args)
Double
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methoddouble
.public final byte[] classMethodBytes(String className, String methodName, Object... args)
byte[]
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodbyte[]
.public final void classMethodStatusCode(String className, String methodName, Object... args)
Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodRuntimeException
- when the status code returned by the method indicates an errorpublic final void classMethodVoid(String className, String methodName, Object... args)
Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments. Throws an exception if a non-null argument is passed to the
right of a null argument.className
- fully qualified name of the IRIS class to which the
called method belongsmethodName
- name of the IRIS class methodargs
- 0 or more arguments to pass to the methodpublic final String functionString(String functionName, String routineName, Object... args)
String
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.functionName
- name of the IRIS ObjectScript function to callroutineName
- name of the routine containing the functionargs
- 0 or more arguments to pass to the functionString
.public final Long functionLong(String functionName, String routineName, Object... args)
Long
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.functionName
- name of the IRIS ObjectScript function to callroutineName
- name of the routine containing the functionargs
- 0 or more arguments to pass to the functionLong
.public final Double functionDouble(String functionName, String routineName, Object... args)
Double
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.functionName
- name of the IRIS ObjectScript function to callroutineName
- name of the routine containing the functionargs
- 0 or more arguments to pass to the functionDouble
.public final byte[] functionBytes(String functionName, String routineName, Object... args)
byte[]
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.functionName
- name of the IRIS ObjectScript function to callroutineName
- name of the routine containing the functionargs
- 0 or more arguments to pass to the functionbyte[]
.public final Boolean functionBoolean(String functionName, String routineName, Object... args)
Boolean
.
Arguments may be of any of the following types: Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.functionName
- name of the IRIS ObjectScript function to callroutineName
- name of the routine containing the functionargs
- 0 or more arguments to pass to the functionBoolean
.public final void procedure(String procedureName, String routineName, Object... args)
Integer
,
Short
, String
, Long
, Double
,
Float
, byte[]
, Boolean
, Time
,
Date
, or Timestamp
.
Trailing arguments may be omitted, causing default
values to be used for those arguments, either by passing fewer than the
full number of arguments, or by passing null
for trailing
arguments.procedureName
- name of the IRIS ObjectScript procedure to call.routineName
- name of the routine containing the procedure.args
- 0 or more arguments to pass to the procedure.public final boolean lock(String lockMode, Integer timeout, String globalName, Object... subscripts)
lockMode
- combination of the following chars, S for shared lock, E for escalating lock, default is empty string (exclusive and non-escalating)timeout
- amount to wait to acquire the lock in secondsglobalName
- global namesubscripts
- global subscriptspublic final void unlock(String lockMode, String globalName, Object... subscripts)
lockMode
- combination of the following chars , S for shared lock, E for escalating lock, default is empty string (exclusive and non-escalating)globalName
- global namesubscripts
- global subscriptspublic final void releaseAllLocks()
public final void tStart()
public final void tCommit()
public final void tRollback()
public final void tRollbackOne()
public final Integer getTLevel()
© 2024 InterSystems Corporation, Cambridge, MA. All rights reserved. Privacy & Terms Guarantee Accessibility