com.ibm.jtopenlite.command
Interface Program

All Known Subinterfaces:
OpenListProgram<T,W>
All Known Implementing Classes:
CallServiceProgramProcedure, CloseList, CloseList, CreateUserSpace, DeleteUserSpace, GetListEntries, GetListEntries, OpenListOfJobLogMessages, OpenListOfJobs, OpenListOfJobs, OpenListOfMessages, OpenListOfMessages, OpenListOfObjects, OpenListOfObjects, OpenListOfSpooledFiles, OpenListOfSpooledFiles, ProgramAdapter, RetrieveAuthorizedUsers, RetrieveAuthorizedUsers, RetrieveCurrentAttributes, RetrieveCurrentAttributes, RetrieveJournalEntries, RetrieveJournalReceiverInformation, RetrieveObjectDescription, RetrieveObjectDescription, RetrieveSystemStatus, RetrieveSystemStatus, RetrieveUserSpace, WorkWithCollector

public interface Program

Used by classes that wish to implement a program call, this essentially represents a System i program (PGM). The CommandConnection.call() method will internally call the methods on this interface when it needs information about the Program being called.

The current order of operations (subject to change) that CommandConnection uses when call(Program) is invoked is as follows:
  1. CommandConnection.call(program)
  2. --> program.newCall()
  3. --> program.getNumberOfParameters()
  4. --> begin loop
  5. ------> program.getParameterInputLength()
  6. --> end loop
  7. --> program.getProgramName()
  8. --> program.getProgramLibrary()
  9. --> begin loop
  10. ------> program.getParameterInputLength()
  11. ------> program.getParameterOutputLength()
  12. ------> program.getParameterType()
  13. ------> program.getParameterInputData()
  14. --> end loop
  15. --> program.getNumberOfParameters()
  16. --> begin loop
  17. ------> program.getParameterOutputLength()
  18. ------> program.getTempDataBuffer()
  19. ------> program.setParameterOutputData()
  20. --> end loop

See Also:
CommandConnection.call(Program)

Method Summary
 int getNumberOfParameters()
          Returns the number of parameters for this program.
 byte[] getParameterInputData(int parmIndex)
          Returns the input data of the parameter at the specified index.
 int getParameterInputLength(int parmIndex)
          Returns the input length of the parameter at the specified index.
 int getParameterOutputLength(int parmIndex)
          Returns the output length of the parameter at the specified index.
 int getParameterType(int parmIndex)
          Returns the type of parameter at the specified index.
 String getProgramLibrary()
          Returns the library of the program object.
 String getProgramName()
          Returns the name of the program object.
 byte[] getTempDataBuffer()
          The implementor can create their own temp byte array for the output parameter size and reuse it each time a call is performed, or for more than one parameter on the same call.
 void newCall()
          Invoked before any other methods on this interface by CommandConnection whenever this Program is called.
 void setParameterOutputData(int parmIndex, byte[] tempData, int maxLength)
          Sets the output data for the parameter at the specified index.
 

Method Detail

newCall

void newCall()
Invoked before any other methods on this interface by CommandConnection whenever this Program is called.


getNumberOfParameters

int getNumberOfParameters()
Returns the number of parameters for this program.


getParameterInputLength

int getParameterInputLength(int parmIndex)
Returns the input length of the parameter at the specified index.


getParameterOutputLength

int getParameterOutputLength(int parmIndex)
Returns the output length of the parameter at the specified index.


getParameterType

int getParameterType(int parmIndex)
Returns the type of parameter at the specified index.

See Also:
Parameter

getParameterInputData

byte[] getParameterInputData(int parmIndex)
Returns the input data of the parameter at the specified index.


getTempDataBuffer

byte[] getTempDataBuffer()
The implementor can create their own temp byte array for the output parameter size and reuse it each time a call is performed, or for more than one parameter on the same call. The implementor can choose to ignore this, and simply return null. The command connection checks to see if the buffer returned by this method is not null and large enough to accommodate the output parameter size.


setParameterOutputData

void setParameterOutputData(int parmIndex,
                            byte[] tempData,
                            int maxLength)
Sets the output data for the parameter at the specified index.


getProgramName

String getProgramName()
Returns the name of the program object.


getProgramLibrary

String getProgramLibrary()
Returns the library of the program object.