Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.resources
Class QSYSRemoteMemberTransfer

java.lang.Object
  extended by com.ibm.etools.iseries.subsystems.qsys.resources.QSYSRemoteMemberTransfer

public class QSYSRemoteMemberTransfer
extends Object


Field Summary
static String copyright
           
static int EOR
           
static String FIRST_RECORD
           
 
Constructor Summary
QSYSRemoteMemberTransfer(IQSYSMember member, String localPath)
          Constructor with default encoding UTF-8.
QSYSRemoteMemberTransfer(IQSYSMember member, String localPath, boolean leaveVisual)
          Constructor.
QSYSRemoteMemberTransfer(IQSYSMember member, String localPath, String encoding)
          Constructor.
 
Method Summary
static void acquireLock(String localPath)
          Acquire the lock to download or upload the remote member that maps to the localpath
 void changeBidiFormat()
          Converts the member from logical to visual or visual to logical as needed.
 void download()
          Get the member from the server
 void download(boolean removeSequenceNumbers, IProgressMonitor monitor)
          Get the member from the server
 void download(IProgressMonitor monitor)
          Get the member from the server
 String getLocalPath()
          Gets the localPath where the member is to be downloaded.
 IQSYSMember getMember()
          Gets the member.
 boolean getNoToAll()
          Retrieves the no to all value
 boolean getYesToAll()
          Retrieves the yes to all value
 boolean isLogicalTransfer()
          indicates whether a logical transfer is being used
static void releaseLock(String localPath)
          Releases the lock to download or upload the remote member that maps to the localpath.
 void setEncoding(String encoding)
          Sets the local encoding to use.
 void setLocalPath(String localPath)
          Sets the local path where the member should be downloaded.
 void setMember(IQSYSMember member)
          Sets the member.
static void setRecordFormat(SequentialFile seqFile, IQSYSMember member)
          Set the record format for the sequential file before reading / writing.
 void setRecordFormat(Vector recordFormatPoints)
          Set the record format to use during conversion.
 void setRemoveTrailingBlanks(boolean value)
          Sets whether or not trailing blanks should be removed upon download.
 void setYesNoToAll(boolean yes, boolean no, boolean moreThanOneFile)
          Sets the values for the prompting message for auto-detection of sequence numbers
 void upload()
          Put the member back to the server
 void upload(boolean insertSequenceNumbersIfRequired, int startSeqNum, int incrSeqNum)
          Put the member back to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static String copyright

EOR

public static final int EOR
See Also:
Constant Field Values

FIRST_RECORD

public static final String FIRST_RECORD
See Also:
Constant Field Values
Constructor Detail

QSYSRemoteMemberTransfer

public QSYSRemoteMemberTransfer(IQSYSMember member,
                                String localPath)
Constructor with default encoding UTF-8.

Parameters:
member - the member.
localPath - the local path to download to.

QSYSRemoteMemberTransfer

public QSYSRemoteMemberTransfer(IQSYSMember member,
                                String localPath,
                                String encoding)
Constructor.

Parameters:
member - the member.
localPath - the local path to download to.
encoding - the encoding of the local file.

QSYSRemoteMemberTransfer

public QSYSRemoteMemberTransfer(IQSYSMember member,
                                String localPath,
                                boolean leaveVisual)
Constructor.

Parameters:
member - the member.
localPath - the local path to download to.
leaveVisual - true if you want the file to be left in visual format
Method Detail

setMember

public void setMember(IQSYSMember member)
Sets the member.

Parameters:
member - the member.

getMember

public IQSYSMember getMember()
Gets the member.

Returns:
the member.

setLocalPath

public void setLocalPath(String localPath)
Sets the local path where the member should be downloaded.

Parameters:
localPath - the local path.

getLocalPath

public String getLocalPath()
Gets the localPath where the member is to be downloaded.

Returns:
the local path.

setEncoding

public void setEncoding(String encoding)
Sets the local encoding to use.

Parameters:
encoding - the local encoding to use.

download

public void download()
              throws QSYSEncapsulatedReturnCodeException,
                     QSYSEncapsulatedException,
                     SystemMessageException
Get the member from the server

Throws:
QSYSEncapsulatedReturnCodeException
QSYSEncapsulatedException
SystemMessageException

download

public void download(IProgressMonitor monitor)
              throws QSYSEncapsulatedReturnCodeException,
                     QSYSEncapsulatedException,
                     SystemMessageException
Get the member from the server

Throws:
QSYSEncapsulatedReturnCodeException
QSYSEncapsulatedException
SystemMessageException

download

public void download(boolean removeSequenceNumbers,
                     IProgressMonitor monitor)
              throws QSYSEncapsulatedReturnCodeException,
                     QSYSEncapsulatedException,
                     SystemMessageException
Get the member from the server

Throws:
QSYSEncapsulatedReturnCodeException
QSYSEncapsulatedException
SystemMessageException

upload

public void upload()
            throws QSYSEncapsulatedReturnCodeException,
                   QSYSEncapsulatedException,
                   SystemMessageException
Put the member back to the server

Throws:
QSYSEncapsulatedReturnCodeException
QSYSEncapsulatedException
SystemMessageException

upload

public void upload(boolean insertSequenceNumbersIfRequired,
                   int startSeqNum,
                   int incrSeqNum)
            throws QSYSEncapsulatedReturnCodeException,
                   QSYSEncapsulatedException,
                   SystemMessageException
Put the member back to the server.

Parameters:
insertSequenceNumbersIfRequired - insert sequence numbers if required. Note that if this is true, then we first do a check to determine if the first few records of the member are missing sequence numbers. If so, then we check each line before adding sequence numbers to it. Otherwise, we assume no line needs sequence numbers. This is for efficiency.
Throws:
QSYSEncapsulatedReturnCodeException
QSYSEncapsulatedException
SystemMessageException

setRecordFormat

public void setRecordFormat(Vector recordFormatPoints)
Set the record format to use during conversion. This is especially important for BIDI source. Only the points specified will be converted from visual to logical on download and from logical to visual on upload. For example, a source physical file member would use the following to only convert the text area, and not the sequence numbers.

Vector format = new Vector(); format.add(new Point(13, ISeriesMemberTransfer.EOR)); ISeriesMemberTransfer transfer = new ISeriesMemberTransfer(member, location); transfer.setRecordFormat(format); transfer.download(); NOTE:No error checking for overlapping or non ascending order of points will be performed. Also, to indicate to-the-end-of the record, use ISeriesMemberTransfer.EOR

Parameters:
recordFormatPoints - A vector of points to use when converting from visual to logical and logical to visual
Since:
6.0.1

setRecordFormat

public static void setRecordFormat(SequentialFile seqFile,
                                   IQSYSMember member)
                            throws Exception
Set the record format for the sequential file before reading / writing.

Throws:
Exception

isLogicalTransfer

public boolean isLogicalTransfer()
indicates whether a logical transfer is being used

Returns:
true if the transfer is for a visual bidi ccsid, and a visual transfer was not requested.
Since:
6.0.1

changeBidiFormat

public void changeBidiFormat()
                      throws QSYSEncapsulatedException
Converts the member from logical to visual or visual to logical as needed.

Throws:
QSYSEncapsulatedException - thrown if an unexpected error is received from the file system
Since:
6.0.1

setRemoveTrailingBlanks

public void setRemoveTrailingBlanks(boolean value)
Sets whether or not trailing blanks should be removed upon download.

Parameters:
value - True if the trailing blanks should be stripped, false otherwise
Since:
6.0.1

setYesNoToAll

public void setYesNoToAll(boolean yes,
                          boolean no,
                          boolean moreThanOneFile)
Sets the values for the prompting message for auto-detection of sequence numbers

Parameters:
yes - Whether or not yes to all has already been pushed
no - whether or not no to all has already been pushed
moreThanOneFile - Whether or not more than one file is being transferred
Since:
7.0

getNoToAll

public boolean getNoToAll()
Retrieves the no to all value

Returns:
true if no to all button has been pushed
Since:
7.0

getYesToAll

public boolean getYesToAll()
Retrieves the yes to all value

Returns:
true if the yes to all button has been pushed.
Since:
7.0

acquireLock

public static void acquireLock(String localPath)
Acquire the lock to download or upload the remote member that maps to the localpath


releaseLock

public static void releaseLock(String localPath)
Releases the lock to download or upload the remote member that maps to the localpath. Callers must make sure to call aquireLock before calling releaseLock.


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.