com.ibm.ims.db
Class SSA

java.lang.Object
  |
  +--com.ibm.ims.db.SSA

public class SSA
extends java.lang.Object

SSA represents a Segment Search Argument. It provides functions to add command codes and qualification statements.


Field Summary
static byte AND
          Boolean operator AND
static byte CONCATENATED_KEY
          Command code meaning concatenated key
static byte ENQUEUE_SEGMENT
          Command code meaning enqueue segment
static short EQUALS
          Relational operator for equals (=)
static byte FIRST_OCCURRENCE
          Command code meaning first occurrence
static short GREATER_OR_EQUAL
          Relational operator for greater than or equal to (>=)
static short GREATER_THAN
          Relational operator for greater than (>)
static byte INDEPENDENT_AND
          Boolean operator INDEPENDENT AND
static byte LAST_OCCURRENCE
          Command code meaning last occurrence
static short LESS_OR_EQUAL
          Relational operator for less than or equal to (<=)
static short LESS_THAN
          Relational operator for less than (<)
static byte LOCK_CLASS_A
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_B
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_C
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_D
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_E
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_F
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_G
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_H
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_I
          Code designating the lock class of a segment (for use with command code Q)
static byte LOCK_CLASS_J
          Code designating the lock class of a segment (for use with command code Q)
static byte MAINTAIN_POS_AT_LEVEL
          Command code meaning maintain position at this level
static byte MAINTAIN_POS_AT_SUPERIOR_LEVELS
          Command code meaning maintain position at this level and all superior levels
static short NOT_EQUAL
          Relational operator for not equal to (!=)
static byte NULL_COMMAND
          Command code meaning null command code (ignored)
static byte OR
          Boolean operator OR
static byte PATH_CALL
          Command code meaning path call
static byte PATH_CALL_IGNORE
          Command code meaning path call ignore
static byte SET_PARENTAGE
          Command code meaning set parentage
 
Constructor Summary
protected SSA(java.lang.String segmentNameReference)
          Protected constructor to create an unqualified SAA.
protected SSA(java.lang.String segmentNameReference, java.lang.String fieldName, short ssaRelationalOperator, java.lang.String comparisonValue)
          Package constructor to create a qualified SAA.
 
Method Summary
 void addCommandCode(byte ssaCommandCode)
          Adds a command code to an SSA.
 void addCommandCode(byte ssaCommandCode, byte lockClass)
          Adds a command code to an SSA.
 void addCommandCode(byte ssaCommandCode, byte[] concatenatedKey)
          Adds a command code to an SSA.
 void addQualificationStatement(byte ssaBooleanOperator, java.lang.String fieldName, short ssaRelationalOperator, java.lang.String comparisonValue)
          Adds a qualification statement to an SSA.
 void addQualificationStatement(SSAQualificationStatement ssaQualificationStatement)
          Adds a qualification statement specified by the ssaQualificationStatement argument to an SSA.
 void addQualificationStatement(java.lang.String fieldName, short ssaRelationalOperator, java.lang.String comparisonValue)
          Adds a qualification statement to an SSA.
static SSA createInstance(java.lang.String segmentNameReference)
          Creates an unqualified SSA.
static SSA createInstance(java.lang.String segmentNameReference, java.lang.String fieldName, short ssaRelationalOperator, java.lang.String comparisonValue)
          Creates a qualified SSA.
 byte[] getBytes(DLIDatabaseView dbView)
          Deprecated. Replaced by getBytes(String, DLIDatabaseView)
 byte[] getBytes(java.lang.String dbPCBNameReference, DLIDatabaseView dbView)
          Returns the SSA in EBCDIC exactly as IMS needs it to be.
 void resetCommandCodes()
          Turns off all command codes for this SSA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUALS

public static final short EQUALS
Relational operator for equals (=)

GREATER_OR_EQUAL

public static final short GREATER_OR_EQUAL
Relational operator for greater than or equal to (>=)

LESS_OR_EQUAL

public static final short LESS_OR_EQUAL
Relational operator for less than or equal to (<=)

GREATER_THAN

public static final short GREATER_THAN
Relational operator for greater than (>)

LESS_THAN

public static final short LESS_THAN
Relational operator for less than (<)

NOT_EQUAL

public static final short NOT_EQUAL
Relational operator for not equal to (!=)

AND

public static final byte AND
Boolean operator AND

OR

public static final byte OR
Boolean operator OR

INDEPENDENT_AND

public static final byte INDEPENDENT_AND
Boolean operator INDEPENDENT AND

NULL_COMMAND

public static final byte NULL_COMMAND
Command code meaning null command code (ignored)

CONCATENATED_KEY

public static final byte CONCATENATED_KEY
Command code meaning concatenated key

PATH_CALL

public static final byte PATH_CALL
Command code meaning path call

FIRST_OCCURRENCE

public static final byte FIRST_OCCURRENCE
Command code meaning first occurrence

LAST_OCCURRENCE

public static final byte LAST_OCCURRENCE
Command code meaning last occurrence

PATH_CALL_IGNORE

public static final byte PATH_CALL_IGNORE
Command code meaning path call ignore

SET_PARENTAGE

public static final byte SET_PARENTAGE
Command code meaning set parentage

ENQUEUE_SEGMENT

public static final byte ENQUEUE_SEGMENT
Command code meaning enqueue segment

MAINTAIN_POS_AT_LEVEL

public static final byte MAINTAIN_POS_AT_LEVEL
Command code meaning maintain position at this level

MAINTAIN_POS_AT_SUPERIOR_LEVELS

public static final byte MAINTAIN_POS_AT_SUPERIOR_LEVELS
Command code meaning maintain position at this level and all superior levels

LOCK_CLASS_A

public static final byte LOCK_CLASS_A
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_B

public static final byte LOCK_CLASS_B
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_C

public static final byte LOCK_CLASS_C
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_D

public static final byte LOCK_CLASS_D
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_E

public static final byte LOCK_CLASS_E
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_F

public static final byte LOCK_CLASS_F
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_G

public static final byte LOCK_CLASS_G
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_H

public static final byte LOCK_CLASS_H
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_I

public static final byte LOCK_CLASS_I
Code designating the lock class of a segment (for use with command code Q)

LOCK_CLASS_J

public static final byte LOCK_CLASS_J
Code designating the lock class of a segment (for use with command code Q)
Constructor Detail

SSA

protected SSA(java.lang.String segmentNameReference)
Protected constructor to create an unqualified SAA.
Parameters:
segmentNameReference - the reference name to the actual name of the segment that does not have the naming restrictions of segment names in a DBD (upper case, maximum length of 8 characters)

SSA

protected SSA(java.lang.String segmentNameReference,
              java.lang.String fieldName,
              short ssaRelationalOperator,
              java.lang.String comparisonValue)
Package constructor to create a qualified SAA.
Parameters:
segmentNameReference - the reference name to the actual name of the segment that does not have the naming restrictions of segment names in a DBD (upper case, maximum length of 8 characters)
fieldName - the field name to be used to further qualify the SSA
ssaRelationalOperator - the relational operator to indicate the kind of checking
comparisonValue - the value the field name is compared with
Method Detail

addCommandCode

public void addCommandCode(byte ssaCommandCode)
Adds a command code to an SSA.

The SSA class defines several constants that can be supplied as values for the ssaCommandCode argument: NULL_COMMAND, FIRST_OCCURRENCE, LAST_OCCURRENCE, PATH_CALL, PATH_CALL_IGNORE, SET_PARENTAGE, MAINTAIN_POS_AT_LEVEL, and MAINTAIN_POS_AT_SUPERIOR_LEVELS.

Parameters:
ssaCommandCode - a constant to indicate the function to execute

addCommandCode

public void addCommandCode(byte ssaCommandCode,
                           byte[] concatenatedKey)
Adds a command code to an SSA.

Overloaded method for supplying the concatenated key while using the CONCATENATED_KEY command code.

The CONCATENATED_KEY command code can only be used separately and will remove any other already set command codes.

Parameters:
ssaCommandCode - a constant to indicate the function to execute
concatenatedKey - byte array containing concatenated key

addCommandCode

public void addCommandCode(byte ssaCommandCode,
                           byte lockClass)
Adds a command code to an SSA. This method is used to specify a lock class for a segment.

The SSA class defines the constant ENQUEUE_SEGMENT to be supplied as the value for the ssaCommandCode argument. The following codes are provided to specify the lock class for the segment: LOCK_CLASS_A, LOCK_CLASS_B, LOCK_CLASS_C, LOCK_CLASS_D, LOCK_CLASS_E, LOCK_CLASS_F, LOCK_CLASS_G, LOCK_CLASS_H, LOCK_CLASS_I, and LOCK_CLASS_J.

Parameters:
ssaCommandCode - a constant to indicate the function to execute

addQualificationStatement

public void addQualificationStatement(byte ssaBooleanOperator,
                                      java.lang.String fieldName,
                                      short ssaRelationalOperator,
                                      java.lang.String comparisonValue)
                               throws DLIException
Adds a qualification statement to an SSA. To indicate that a comparison value may be changed at a later time, pass a null reference for the value. When using the SSA, call the setValue(int index, String value) method in SSAList to substitute in the desired value.

The SSA class defines several constants that can be supplied as values for the ssaBooleanOperator argument: AND, OR, and INDEPENDENT_AND.

The SSA class defines several constants that can be supplied as values for the ssaRelationalOperator argument: EQUALS, GREATER_OR_EQUAL, LESS_OR_EQUAL, GREATER_THAN, LESS_THAN, and NOT_EQUAL.

Parameters:
ssaBooleanOperator - a constant to link qualifications together in SSAs with multiple qualifications
fieldName - the field name to be used to further qualify the SSA
ssaRelationalOperator - a constant to indicate the kind of checking
comparisonValue - the value the field name is compared with
Throws:
DLIException - if the SSA is formed incorrectly (the first qualification statement added is a multiple qualification statement)
See Also:
SSAList.setValue(int, String)

addQualificationStatement

public void addQualificationStatement(SSAQualificationStatement ssaQualificationStatement)
                               throws DLIException
Adds a qualification statement specified by the ssaQualificationStatement argument to an SSA.
Parameters:
ssaQualificationStatement - an SSA qualification statement
Throws:
DLIException - if the SSA is formed incorrectly (the first qualification statement added is a multiple qualification statement)

addQualificationStatement

public void addQualificationStatement(java.lang.String fieldName,
                                      short ssaRelationalOperator,
                                      java.lang.String comparisonValue)
                               throws DLIException
Adds a qualification statement to an SSA. To indicate that a comparison value may be changed at a later time, pass a null reference for the value. When using the SSA, call the setValue(int index, String value) method in SSAList to substitute in the desired value.

The SSA class defines several constants that can be supplied as values for the ssaBooleanOperator argument: AND, OR, and INDEPENDENT_AND.

The SSA class defines several constants that can be supplied as values for the ssaRelationalOperator argument: EQUALS, GREATER_OR_EQUAL, LESS_OR_EQUAL, GREATER_THAN, LESS_THAN, and NOT_EQUAL.

Parameters:
fieldName - the field name to be used to further qualify the SSA
ssaRelationalOperator - a constant to indicate the kind of checking
comparisonValue - the value the field name is compared with
Throws:
DLIException - if the SSA is formed incorrectly (the first qualification statement added is a multiple qualification statement)
See Also:
SSAList.setValue(int, String)

createInstance

public static SSA createInstance(java.lang.String segmentNameReference)
Creates an unqualified SSA. Qualification statements may be added to this SSA to qualify it.
Parameters:
segmentNameReference - the reference name to the actual name of the segment that does not have the naming restrictions of segment names in a DBD (upper case, maximum length of 8 characters)

createInstance

public static SSA createInstance(java.lang.String segmentNameReference,
                                 java.lang.String fieldName,
                                 short ssaRelationalOperator,
                                 java.lang.String comparisonValue)
Creates a qualified SSA. More qualification statements may also be added. To indicate that a comparison value may be changed at a later time, pass a null reference for the value. When using the SSA, call one of the overloaded setValue() methods of the SSAList class to substitute in the desired value.
Parameters:
segmentNameReference - the reference name to the actual name of the segment that does not have the naming restrictions of segment names in a DBD (upper case, maximum length of 8 characters)
fieldName - the field name to be used to further qualify the SSA
ssaRelationalOperator - the relational operator to indicate the kind of checking
comparisonValue - the value the field name is compared with
See Also:
SSAList.setValue(int, BigDecimal), SSAList.setValue(int, double), SSAList.setValue(int, float), SSAList.setValue(int, int), SSAList.setValue(int, long), SSAList.setValue(int, short), SSAList.setValue(int, String)

getBytes

public byte[] getBytes(DLIDatabaseView dbView)
                throws DLIException
Deprecated. Replaced by getBytes(String, DLIDatabaseView)

Returns the SSA in EBCDIC exactly as IMS needs it to be.
Returns:
a byte array specifying the entire SSA in EBCDIC

resetCommandCodes

public void resetCommandCodes()
Turns off all command codes for this SSA.

getBytes

public byte[] getBytes(java.lang.String dbPCBNameReference,
                       DLIDatabaseView dbView)
                throws DLIException
Returns the SSA in EBCDIC exactly as IMS needs it to be.
Parameters:
dbPCBNameReference - the database PCB name that was provided via the dbPCBNameReference parameter to either the DLIDatabaseView(String, String, String, DLISegmentInfo[]) constructor or DLIDatabaseView.addDatabase(String, String, DLISegmentInfo[]) method, which specifies the database the SSA is accessing
dbView - the DLIDatabaseView object which contains the view(s) (list of PCBs) the object has access to
Returns:
a byte array specifying the entire SSA in EBCDIC
Throws:
DLIException - if the segment the SSA contains does not exist in the database view


(C) International Business Machines Corporation 2004. All rights reserved.