com.ibm.as400.resource
Class ProgramAttributeSetter

java.lang.Object
  |
  +--com.ibm.as400.resource.ProgramAttributeSetter
All Implemented Interfaces:
java.io.Serializable

public class ProgramAttributeSetter
extends java.lang.Object
implements java.io.Serializable

The ProgramAttributeSetter class sets attribute values by calling an AS/400 program. The program call is specified using Program Call Markup Language (PCML).

This class uses a ProgramMap object to define how attribute values are specified in the PCML definition. This class is intended as a helper class for implementing subclasses of Resource.

See Also:
Serialized Form

Constructor Summary
ProgramAttributeSetter(AS400 system, ProgramCallDocument document, ProgramMap attributeMap)
          Constructs a ProgramAttributeSetter object.
 
Method Summary
 void initializeAttributeValues(ProgramAttributeGetter attributeGetter)
          Initializes the attribute values for the setter.
 void initializeAttributeValues(ProgramAttributeGetter attributeGetter, java.lang.Object[] attrsToInitializeFirst)
          Initializes the attribute values for the setter.
 void setValues(java.lang.Object[] attributeIDs, java.lang.Object[] values)
          Sets the attribute values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgramAttributeSetter

public ProgramAttributeSetter(AS400 system,
                              ProgramCallDocument document,
                              ProgramMap attributeMap)
Constructs a ProgramAttributeSetter object.
Parameters:
system - The system.
document - The PCML document.
attributeMap - The attribute map.
Method Detail

initializeAttributeValues

public void initializeAttributeValues(ProgramAttributeGetter attributeGetter)
                               throws ResourceException
Initializes the attribute values for the setter. This is useful for "setter" programs that have multiple fields, all of which must contain valid values.
Parameters:
attributeGetter - The attribute getter with which to retrieve the current values from the system.
Throws:
ResourceException - If an error occurs.

initializeAttributeValues

public void initializeAttributeValues(ProgramAttributeGetter attributeGetter,
                                      java.lang.Object[] attrsToInitializeFirst)
                               throws ResourceException
Initializes the attribute values for the setter. This is useful for "setter" programs that have multiple fields, all of which must contain valid values.
Parameters:
attributeGetter - The attribute getter with which to retrieve the current values from the system.
attrsToInitializeFirst - The IDs of the attributes to initialize first, in desired order of initialization. These will typically be "length of another field" attributes.
Throws:
ResourceException - If an error occurs.

setValues

public void setValues(java.lang.Object[] attributeIDs,
                      java.lang.Object[] values)
               throws ResourceException
Sets the attribute values. The system must be set before this is called.
Parameters:
attributeIDs - The attribute IDs.
values - The values. This array must contain the same number of elements as attributeIDs.
Throws:
ResourceException - If an error occurs.