All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.JobLog

java.lang.Object
   |
   +----com.ibm.as400.access.JobLog

public class JobLog
extends Object
implements Serializable
The JobLog class represents an AS/400 job log. This is used to get a list of messages in a job log or to write messages to a job log.

For example:

 JobLog log = new JobLog (as400, jobName, jobUser, jobNumber);
 Enumeration e = log.getMessages ();
 while (e.hasMoreElements ())
 {
    QueuedMessage message = (QueuedMessage) e.nextElement ();
    System.out.println (message.getText ());
 }
 

JobLog objects generate the following events:

See Also:
QueuedMessage

Constructor Index

 o JobLog()
Constructs a JobLog object.
 o JobLog(AS400)
Constructs a JobLog object.
 o JobLog(AS400, String, String, String)
Constructs a JobLog object.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener to be notified when the value of any bound property is changed.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener to be notified when the value of any constrained property is changed.
 o getLength()
Returns the number of messages in the list that was most recently retrieved from the AS/400 (the last call to getMessages()).
 o getMessages()
Returns a list of messages in the job log.
 o getName()
Returns the job name.
 o getNumber()
Returns the job number.
 o getSystem()
Returns the AS/400 system on which the job log exists.
 o getUser()
Returns the user name.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a property change listener from the listener list.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable change listener from the listener list.
 o setName(String)
Sets the job name.
 o setNumber(String)
Sets the job number.
 o setSystem(AS400)
Sets the AS/400 system on which the job log exists.
 o setUser(String)
Sets the user name.
 o writeMessage(AS400, String, int)
Writes a program message to the job log for the job in which the program is running.
 o writeMessage(AS400, String, int, byte[])
Writes a program message to the job log for the job in which the program is running.
 o writeMessage(AS400, String, int, String)
Writes a program message to the job log for the job in which the program is running.
 o writeMessage(AS400, String, int, String, byte[])
Writes a program message to the job log for the job in which the program is running.

Constructors

 o JobLog
 public JobLog()
Constructs a JobLog object. The system, name, user, and number properties need to be set before using any method requiring a connection to the AS/400.

 o JobLog
 public JobLog(AS400 system)
Constructs a JobLog object. The name, user, and number properties need to be set before using any method requiring a connection to the AS/400.

Parameters:
system - The AS/400 system.
 o JobLog
 public JobLog(AS400 system,
               String name,
               String user,
               String number)
Constructs a JobLog object.

Parameters:
system - The AS/400 system.
name - The job name.
user - The job user.
number - The job number.

Methods

 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property is changed. The propertyChange() method will be be called.

Parameters:
listener - The PropertyChangeListener.
 o addVetoableChangeListener
 public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property is changed. The vetoableChange() method will be called.

Parameters:
listener - The VetoableChangeListener.
 o getName
 public String getName()
Returns the job name.

Returns:
The job name, or "" if none has been set.
 o getNumber
 public String getNumber()
Returns the job number.

Returns:
The job number, or "" if none has been set.
 o getLength
 public int getLength()
Returns the number of messages in the list that was most recently retrieved from the AS/400 (the last call to getMessages()).

Returns:
The number of messages, or 0 if no list has been retrieved.
 o getMessages
 public Enumeration getMessages() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
Returns a list of messages in the job log. A valid AS/400 system, job name, user, and number must be provided before this call is made.

Returns:
An Enumeration of QueuedMessage objects.
Throws: AS400Exception
If the AS/400 system returns an error message.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o getSystem
 public AS400 getSystem()
Returns the AS/400 system on which the job log exists.

Returns:
The AS/400 system on which the job log exists.
 o getUser
 public String getUser()
Returns the user name.

Returns:
The user name, or "" if none has been set.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener from the listener list.

Parameters:
listener - The PropertyChangeListener.
 o removeVetoableChangeListener
 public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable change listener from the listener list.

Parameters:
listener - The VetoableChangeListener.
 o setName
 public void setName(String name) throws PropertyVetoException
Sets the job name. This takes effect the next time that getMessages() is called.

Parameters:
name - The job name. This value cannot be null.
Throws: PropertyVetoException
If the change is vetoed.
 o setNumber
 public void setNumber(String number) throws PropertyVetoException
Sets the job number. This takes effect the next time that getMessages() is called.

Parameters:
number - The job number. This value cannot be null.
Throws: PropertyVetoException
If the change is vetoed.
 o setSystem
 public void setSystem(AS400 system) throws PropertyVetoException
Sets the AS/400 system on which the job log exists.

Parameters:
system - The AS/400 system on which the job log exists. This value cannot be null.
Throws: PropertyVetoException
If the change is vetoed.
 o setUser
 public void setUser(String user) throws PropertyVetoException
Sets the user name. This takes effect the next time that getMessages() is called.

Parameters:
user - The user name. This value cannot be null.
Throws: PropertyVetoException
If the change is vetoed.
 o writeMessage
 public static void writeMessage(AS400 system,
                                 String id,
                                 int type) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, AS400Exception
Writes a program message to the job log for the job in which the program is running. The AS400 system, message id and message type must be set before calling this method.

Parameters:
system - The AS400 object that specifies the AS/400 to write the message to. If the AS400 object specifies localhost, the message will be written to the job log of the process this method is called from. Otherwise the message will be written to the QZRCSRVS job on the AS/400 specified by the AS400 object.
id - The message ID. The message must be in the default message file /QSYS.LIB/QCPFMSG.MSGF.
type - The message type. Valid types are:
  • AS400Message.COMPLETION
  • AS400Message.DIAGNOSTIC
  • AS400Message.INFORMATIONAL
  • AS400Message.ESCAPE
Throws: AS400Exception
If the AS/400 system returns an error message.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o writeMessage
 public static void writeMessage(AS400 system,
                                 String id,
                                 int type,
                                 byte substitutionText[]) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, AS400Exception
Writes a program message to the job log for the job in which the program is running. The AS400 system, message ID, message type and substitution text must be set before calling this method.

Parameters:
system - The AS400 object that specifies the AS/400 to write the message to. If the AS400 object specifies localhost, the message will be written to the job log of the process this method is called from. Otherwise the message will be written to the QZRCSRVS job on the AS/400 specified by the AS400 object.
id - The message ID. The message must be in the default message file /QSYS.LIB/QCPFMSG.MSGF. If this is an immediate message the message ID must be blanks.
type - The message type. Valid types are:
  • AS400Message.COMPLETION
  • AS400Message.DIAGNOSTIC
  • AS400Message.INFORMATIONAL
  • AS400Message.ESCAPE
For an immediate message the message type must be AS400Message.INFORMATIONAL.
substitutionText - The message substitution text supplied as a byte array. The substitution text can be from 0-32767 bytes for a conventional message and from 1-6000 bytes for an immediate message.
Throws: AS400Exception
If the AS/400 system returns an error message.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o writeMessage
 public static void writeMessage(AS400 system,
                                 String id,
                                 int type,
                                 String path) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, AS400Exception
Writes a program message to the job log for the job in which the program is running. The AS400 system, message ID, message type and message path must be set before calling this method.

Parameters:
system - The AS400 object that specifies the AS/400 to write the message to. If the AS400 object specifies localhost, the message will be written to the job log of the process this method is called from. Otherwise the message will be written to the QZRCSRVS job on the AS/400 specified by the AS400 object.
id - The message ID. The message ID must be for a message in a QSYS file system message file.
type - The message type. Valid types are:
  • AS400Message.COMPLETION
  • AS400Message.DIAGNOSTIC
  • AS400Message.INFORMATIONAL
  • AS400Message.ESCAPE
path - The path must be a valid integrated file system path to a message file in the QSYS file system. A path such as /QSYS.LIB/MYLIB.LIB/MYMSG.MSGF can be specified. *LIBL and *CURLIB are not accepted.
Throws: AS400Exception
If the AS/400 system returns an error message.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o writeMessage
 public static void writeMessage(AS400 system,
                                 String id,
                                 int type,
                                 String path,
                                 byte substitutionText[]) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, AS400Exception
Writes a program message to the job log for the job in which the program is running. The AS400 system, message ID, message type, message path and substitution text must be set before calling this method.

Parameters:
system - The AS400 object that specifies the AS/400 to write the message to. If the AS400 object specifies localhost, the message will be written to the job log of the process this method is called from. Otherwise the message will be written to the QZRCSRVS job on the AS/400 specified by the AS400 object.
id - The message ID. The message ID must be for a message in a QSYS file system message file. If this is an immediate message the message ID must be blanks.
type - The message type. Valid types are:
  • AS400Message.COMPLETION
  • AS400Message.DIAGNOSTIC
  • AS400Message.INFORMATIONAL
  • AS400Message.ESCAPE
For an immediate message the message type must be AS400Message.INFORMATIONAL.
path - The path must be a valid integrated file system path to a message file in the QSYS file system. A path such as /QSYS.LIB/MYLIB.LIB/MYMSG.MSGF can be specified. *LIBL and *CURLIB are not accepted.
substitutionText - The message substitution text supplied as a byte array. The substitution text can be from 0-32767 bytes for a conventional message and from 1-6000 bytes for an immediate message.
Throws: AS400Exception
If the AS/400 system returns an error message.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.

All Packages  Class Hierarchy  This Package  Previous  Next  Index