public class zFTPConnector extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.net.ftp.FTPClient |
FTPClient
FTPClient from Apache Commons-Net.
|
protected boolean |
JESINTERFACELEVEL1 |
protected static Pattern |
JesJobName
Pattern for search of jobName
|
protected String |
jobCC
Job's MaxCC.
|
protected String |
jobID
JobID in JES.
|
protected String |
jobName
Jobname in JES.
|
protected static Logger |
logger
Simple logger.
|
protected String |
logPrefix
Log prefix (default: "zFTPConnector")
|
protected String |
password
User password.
|
protected int |
port
FTP port for connection
|
protected String |
server
LPAR name or IP to connect to.
|
protected String |
userID
UserID.
|
protected static long |
waitInterval
Will ask LPAR once in 10 seconds.
|
protected long |
waitTime
Time to wait before giving up in milliseconds.
|
| Constructor and Description |
|---|
zFTPConnector(String server,
int port,
String userID,
String password,
boolean JESINTERFACELEVEL1,
String logPrefix)
Basic constructor with minimal parameters required.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkJobAvailability() |
protected boolean |
connect()
Try to connect to the
server using the parameters passed to the constructor. |
protected void |
deleteJobLog()
Delete job log from spool.
|
protected boolean |
fetchJobLog(OutputStream outputStream)
Fetch job log from spool.
|
String |
getJobCC()
Get JobCC.
|
String |
getJobID()
Get JobID.
|
String |
getJobName()
Get Jobname.
|
protected boolean |
logon()
Try to logon to the
server using the parameters passed to the constructor. |
protected boolean |
obtainJobRC() |
boolean |
submit(InputStream inputStream,
boolean wait,
int waitTime,
OutputStream outputStream,
boolean deleteLogFromSpool)
Submit job for execution.
|
protected boolean |
waitForCompletion(OutputStream outputStream)
Wait for he completion of the job.
|
protected String server
protected int port
protected String userID
protected String password
protected long waitTime
0 will wait forever.protected String jobID
protected String jobName
protected String jobCC
protected boolean JESINTERFACELEVEL1
protected static final long waitInterval
protected org.apache.commons.net.ftp.FTPClient FTPClient
protected String logPrefix
protected static final Pattern JesJobName
protected static final Logger logger
public zFTPConnector(String server, int port, String userID, String password, boolean JESINTERFACELEVEL1, String logPrefix)
server - LPAR name or IP address to connect to.port - LPAR password.userID - UserID.password - User password.JESINTERFACELEVEL1 - Is FTP server configured for JESINTERFACELEVEL=1?logPrefix - Log prefix.protected boolean connect()
server using the parameters passed to the constructor.zFTPConnector(String, int, String, String, boolean, String)protected boolean logon()
server using the parameters passed to the constructor.
Also, site filetype=jes jesjobname=* jesowner=* command is invoked.zFTPConnector(String, int, String, String, boolean, String),
connect()public boolean submit(InputStream inputStream, boolean wait, int waitTime, OutputStream outputStream, boolean deleteLogFromSpool)
inputStream - JCL text of the job.wait - Whether we need for the job to complete.waitTime - Maximum wait time in minutes. If set to 0, will wait forever.outputStream - Stream to put job log. Can be Null.deleteLogFromSpool - Whether the job log should be deleted fro spool upon job end.jobCC holds the response of the operation (including errors).connect(),
logon(),
waitForCompletion(OutputStream),
deleteJobLog()protected boolean waitForCompletion(OutputStream outputStream)
outputStream - Stream to hold job log.submit(InputStream, boolean, int, OutputStream, boolean),
fetchJobLog(OutputStream)protected boolean checkJobAvailability()
protected boolean fetchJobLog(OutputStream outputStream)
outputStream - Stream to hold the job log.waitForCompletion(OutputStream)protected boolean obtainJobRC()
protected void deleteJobLog()
jobID.public String getJobID()
jobID.public String getJobName()
jobName.public String getJobCC()
jobCC.Copyright © 2004-2015. All Rights Reserved.