Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.remotebuild
Class RBSystem

java.lang.Object
  extended by com.ibm.etools.iseries.remotebuild.RBSystem

public class RBSystem
extends Object


Field Summary
static String COPYRIGHT
           
 
Constructor Summary
RBSystem(IBMiConnection connection)
          Create a new system given its ISeriesConnection.
 
Method Summary
 void cancelJob(JobTicket ticket)
          Cancels the job associated with a particular ticket.
 RBStatus checkAuthorities(RBResource resource, String[] authorities)
          Checks the existence and authorities of an object on the system.
 boolean checkBinaryObject(RBBinaryObject resource)
          Check existence of the binary object on the system
 RBStatus checkBinaryObjectContents(RBBinaryObject resource)
          Checks the contents of a save file for conflict on the system.
 boolean checkFile(RBFile resource)
          Checks the existence of a file object on the system.
 boolean checkLibrary(RBLibrary resource)
          Checks the existence of a library.
 boolean checkMember(RBMember resource)
          Checks the existence of a member on the system.
 RBStatus checkMemberContents(RBMember resource)
          Checks the contents of a member for conflict on the system.
 boolean checkSaveFile(RBSaveFile resource)
          Checks the existence of a save file object on the system.
 RBStatus checkSaveFileContents(RBSaveFile resource)
          Checks the contents of a save file for conflict on the system.
 RBStatus checkSaveFileExistence(RBSaveFile resource)
          Checks the existence of a save file object on the system.
 boolean checkServer()
          Tests to see if the service program QDEVTOOLS/QRBUTIL exists.
 RBStatus checkSourceFileProperties(RBSourceFile resource)
          Checks the properties of a source file on the target against those stored locally.
 RBStatus clearSaveFile(RBSaveFile resource)
          Clears a new save file on the target system.
 RBStatus copySavfToQTEMP(String saveFileName)
           
 RBStatus createBinaryObject(RBBinaryObject binaryObject)
           
 RBStatus createLibrary(RBLibrary resource)
          Creates a library on the system.
 RBStatus createMember(RBMember resource)
          Creates a new member on the system.
 RBStatus createSaveFile(RBSaveFile resource)
          Creates a new save file on the target system.
 RBStatus createSourceFile(RBSourceFile resource)
          Creates a new source file if one doesn't already exists.
 IBMiConnection getConnection()
           
 String getMetadataFileName(String tag, String suffix)
           
 String getNextTag()
          Returns the next tag for naming files.
 RBStatus getServerStatus()
          Tests to see if the connection exists and the service program QDEVTOOLS/QRBUTIL exists.
static RBSystem getSystemFor(IBMiConnection connection)
          Create a new RBSystem object, if necessary, for this connection.
 String getSystemName()
           
 RBStatus modifyMemberProperties(RBMember resource, Collection<String> properties)
          Modifies the properties of a member on the target system.
 RBStatus modifyMemberSourceType(RBMember resource)
          Modifies the source type of a member on the target system.
 RBStatus modifySaveFileProperties(RBSaveFile resource, Collection<String> properties)
          Modifies the properties of a save file.
 RBStatus modifySourceFileProperties(RBSourceFile resource, Collection<String> properties)
          Modify the properties of an existing source file.
 void refreshJobStatus(Set ticketSet)
          Deprecated. The job's status can not be directly set anymore, instead it is pulled from the actual OS/400 job.
 RBStatus restoreSavfContents(RBBinaryObject resource)
           
 RBStatus runCommand(CLCommand command)
          Runs a command immediately.
 RBStatus runCommand(String command)
          Runs a command string immediately.
 RBStatus submitCommand(CLCommand command)
          Runs a command in batch.
 RBStatus submitCommand(String command)
          Runs a command string in batch.
 RBStatus writeArguments(String tag, Map arguments)
          Writes the argument list contained in the map to the argument metadata file for the tag on the host system.
 RBStatus writeBinaryObject(RBBinaryObject resource)
          Writes a binary object on the target system.
 RBStatus writeMember(RBMember resource)
          Writes the contents of a member to the system.
 RBStatus writeSaveFile(RBSaveFile resource)
          Writes a save file on the target system.
 RBStatus writeStreamFile(RBResource resource)
          Creates a new stream file on the target system.
 RBStatus writeStreamFile(Reader reader, String ifsName)
          Creates a new text stream file on the target system using a reader as the input source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

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

RBSystem

public RBSystem(IBMiConnection connection)
Create a new system given its ISeriesConnection. This will create an entirely new RBSystem object. It is better to use RBSystem.getSystemFor(connection) since that will return an existing RBSystem for this connection.

See Also:
RBSystem#getSystemFor(ISeriesConnection).
Method Detail

getSystemFor

public static RBSystem getSystemFor(IBMiConnection connection)
Create a new RBSystem object, if necessary, for this connection. If one already exists, return that one.


checkServer

public boolean checkServer()
Tests to see if the service program QDEVTOOLS/QRBUTIL exists. If so it returns true. If the program is not installed it returns false.


getServerStatus

public RBStatus getServerStatus()
Tests to see if the connection exists and the service program QDEVTOOLS/QRBUTIL exists. If so it returns an OK status, otherwise it returns an error status.


getSystemName

public String getSystemName()
Returns:
the system name. This is the IP name or address of the system as stored by the connection.

getConnection

public IBMiConnection getConnection()
Returns:
the connection used by this system.

checkAuthorities

public RBStatus checkAuthorities(RBResource resource,
                                 String[] authorities)
Checks the existence and authorities of an object on the system. Returns an existence error if the object does not exist. Returns an authorization error if the authorities requested are not available. If the authorization requested is null then authorization is not tested.


checkLibrary

public boolean checkLibrary(RBLibrary resource)
Checks the existence of a library. Returns true of the library can be found. Returns false if the library does not exist or if the result cannot be determined.


createLibrary

public RBStatus createLibrary(RBLibrary resource)
Creates a library on the system. Returns an error if the library already exists.


checkFile

public boolean checkFile(RBFile resource)
Checks the existence of a file object on the system.


checkBinaryObject

public boolean checkBinaryObject(RBBinaryObject resource)
Check existence of the binary object on the system

Parameters:
binaryObject - Binary object to be restored on the system
Returns:
True if the target object exists, false if otherwise

checkSaveFile

public boolean checkSaveFile(RBSaveFile resource)
Checks the existence of a save file object on the system. This will return false if a resource with the same name but is not a save file exists under the library, which could cause a creation of a save file to fail.


checkSaveFileExistence

public RBStatus checkSaveFileExistence(RBSaveFile resource)
Checks the existence of a save file object on the system.

Returns:
An RBStatus with one of the following codes:
  • RBStatus.OK: Save file exists on the host with the same name as the resource.
  • RBStatus.CODE_OBJECT_MISSING: No file exists on the host with the same name as the resource
  • RBStatus.CODE_EXISTING_SAVE_FILE_NAME: File exists on the host with the same name as the resource

createSourceFile

public RBStatus createSourceFile(RBSourceFile resource)
Creates a new source file if one doesn't already exists. Sets the properties on the source file at creation time.


checkSourceFileProperties

public RBStatus checkSourceFileProperties(RBSourceFile resource)
Checks the properties of a source file on the target against those stored locally. Returns a status of CODE_RCDLEN_CONFLICT if the local record length is greater than the target systems record length.


modifySourceFileProperties

public RBStatus modifySourceFileProperties(RBSourceFile resource,
                                           Collection<String> properties)
Modify the properties of an existing source file.


createSaveFile

public RBStatus createSaveFile(RBSaveFile resource)
Creates a new save file on the target system. Precondition: no save file exists on the system.

See Also:
checkSaveFile(RBSaveFile)

clearSaveFile

public RBStatus clearSaveFile(RBSaveFile resource)
Clears a new save file on the target system. This is whenever an upload is done and save file already exists on the system.


writeSaveFile

public RBStatus writeSaveFile(RBSaveFile resource)
Writes a save file on the target system. Although the pushOptions are accepted, there is no host editing of save files so there is possibility of conflict.


writeBinaryObject

public RBStatus writeBinaryObject(RBBinaryObject resource)
Writes a binary object on the target system.

Parameters:
resource -
Returns:
Status of the remote operation.

copySavfToQTEMP

public RBStatus copySavfToQTEMP(String saveFileName)
                         throws SystemMessageException
Throws:
SystemMessageException

restoreSavfContents

public RBStatus restoreSavfContents(RBBinaryObject resource)
                             throws SystemMessageException
Throws:
SystemMessageException

modifySaveFileProperties

public RBStatus modifySaveFileProperties(RBSaveFile resource,
                                         Collection<String> properties)
Modifies the properties of a save file.


checkMember

public boolean checkMember(RBMember resource)
Checks the existence of a member on the system. Returns true if the member exists. Returns false if the member does not exist of if its existence cannot be determined.


checkMemberContents

public RBStatus checkMemberContents(RBMember resource)
Checks the contents of a member for conflict on the system. Done by comparing the date of last update on the remote system with the remembered date. If the member has changed on the remote system a conflict is reported.


checkSaveFileContents

public RBStatus checkSaveFileContents(RBSaveFile resource)
Checks the contents of a save file for conflict on the system. Done by comparing the date of last update on the remote system with the remembered date. If the save file has changed on the remote system a conflict is reported.


checkBinaryObjectContents

public RBStatus checkBinaryObjectContents(RBBinaryObject resource)
Checks the contents of a save file for conflict on the system. Done by comparing the date of last update on the remote system with the remembered date. If the save file has changed on the remote system a conflict is reported.


createMember

public RBStatus createMember(RBMember resource)
Creates a new member on the system. Returns an error status if the member already exists. The contents and properties of the member are also set at this time.


writeMember

public RBStatus writeMember(RBMember resource)
Writes the contents of a member to the system. Returns an error if the member does not exist.


modifyMemberProperties

public RBStatus modifyMemberProperties(RBMember resource,
                                       Collection<String> properties)
Modifies the properties of a member on the target system. Some of these may also alter the timestamp of the member on the target system. Thus, this operation also updates the local copy of the remote timestamp. TODO: aaa Actually it doesn't update the timestamp


modifyMemberSourceType

public RBStatus modifyMemberSourceType(RBMember resource)
Modifies the source type of a member on the target system.


writeStreamFile

public RBStatus writeStreamFile(RBResource resource)
Creates a new stream file on the target system.


writeStreamFile

public RBStatus writeStreamFile(Reader reader,
                                String ifsName)
Creates a new text stream file on the target system using a reader as the input source. Files are always written in CCSID 37, currently.

Parameters:
reader - The reader on the input that will be written to the ifs file.
ifsName - the name of the ifs file to write.
Returns:
an RBStatus

runCommand

public RBStatus runCommand(CLCommand command)
Runs a command immediately.


runCommand

public RBStatus runCommand(String command)
Runs a command string immediately.


submitCommand

public RBStatus submitCommand(CLCommand command)
Runs a command in batch.


submitCommand

public RBStatus submitCommand(String command)
Runs a command string in batch.


getNextTag

public String getNextTag()
Returns the next tag for naming files. The tag is a nine digit string that can be used to group things together. For example, a tag may be used to name various stream files in IFS so that they are associated with a particular activity that takes place on the server. The tags begin at 000000000 and are incremented by one for each function call. There is one tag generator per user profile. Returns null if the service program QDEVTOOLS/QRBUTIL is not found.


getMetadataFileName

public String getMetadataFileName(String tag,
                                  String suffix)
Parameters:
tag - the tag to use to qualify the file.
suffix - the String suffix to add to the tag.
Returns:
the absolute path name of the file. This will be null if an error occurred.

refreshJobStatus

public void refreshJobStatus(Set ticketSet)
Deprecated. The job's status can not be directly set anymore, instead it is pulled from the actual OS/400 job.

Refreshes the job status in a set of job tickets. Any tickets in this set that do not match this system's connection are skipped.


cancelJob

public void cancelJob(JobTicket ticket)
Cancels the job associated with a particular ticket. Does nothing if this system's connection does not match the ticket's.


writeArguments

public RBStatus writeArguments(String tag,
                               Map arguments)
Writes the argument list contained in the map to the argument metadata file for the tag on the host system. It will create any directories necessary. Arguments are always written in CCSID 37.


createBinaryObject

public RBStatus createBinaryObject(RBBinaryObject binaryObject)

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.