Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.subsystems.qsys.util
Class ISeriesProjectUtil

java.lang.Object
  extended by com.ibm.etools.iseries.subsystems.qsys.util.ISeriesProjectUtil

public class ISeriesProjectUtil
extends Object

This class manages the interface from the iSeries Remote Systems Explorer to the iSeries projects. The iSeries project plugin already requires the iSeries plugin so we cannot directly reference the iSeries project plugin. However we still need to access iSeries projects in order to search for copy books via the verifiers and error list. So this class is created to isolate all iSeries project dependencies.


Nested Class Summary
protected static class ISeriesProjectUtil.ConnectionState
          Simple inner class for saving the libl and curlib while running the program verifier for an iSeries project member.
 
Field Summary
static String copyright
           
 
Method Summary
 void communicationsStateChange(CommunicationsEvent commEvent)
           
static String convertLocalPathToRemotePath(String localPath)
          Convert the specified localPath into a remote path of the form library/file(member).
static IFile findMemberInISeriesProject(IProject project, String library, String file, String member)
          Search for the member in the iSeries project and return the corresponding IFile for the member if it is found, otherwise return null.
static IFile findMemberInISeriesProject(IProject project, String libraryName, String fileName, String memberName, boolean searchReferences)
          Search for the member in the iSeries project and return the corresponding IFile for the member if it is found.
static IFolder findSourceFileInISeriesProject(IProject project, String library, String file)
          Search for the source file in the iSeries project and return the corresponding IFolder for the source file if it is found, otherwise return null.
static IFolder findSourceFileInISeriesProject(IProject project, String libraryName, String fileName, boolean searchReferences)
          Search for the source file in the iSeries project and return the corresponding IFolder for the source file if it is found.
static String getAssociatedLibrary(IProject project)
          Get the associated library for an iSeries project
static int getFileRecordLength(IFile file)
          Method getFileRecordLength.
protected static ISeriesProjectUtil getInstance()
          Method for retrieving Singleton instance.
static IBMiConnection getISeriesConnection(IProject project)
          Returns the ISeriesConnection associated with the project.
static IProject getISeriesProjectByName(String name)
          Returns the iSeries project with the specified name.
static String getProjectNameFromRemotePath(String localPath)
          retrieve the project name from the remote path.
static boolean isISeriesProject(IProject project)
          Test if the project is an iSeries project.
static boolean isISeriesProjectMember(IFile file)
          Check if the specified local path represents a member that belongs to an iSeries project in the workspace.
static boolean isISeriesProjectMember(String localFilePath)
          Check if the specified local path represents a member that belongs to an iSeries project in the workspace.
 boolean isPassiveCommunicationsListener()
           
static void projectVerifyRestoreConnection(IProject project)
          Restores the RSE connection associated with the iSeries project after running the program verifier.
static void projectVerifySetupConnection(IProject project)
          Prime the RSE connection associated with the iSeries project before running the program verifier.
 
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
Method Detail

getInstance

protected static ISeriesProjectUtil getInstance()
Method for retrieving Singleton instance. The purpose of the Singleton is to delay creating the hashtable until required.


isISeriesProject

public static boolean isISeriesProject(IProject project)
                                throws CoreException
Test if the project is an iSeries project.

Returns:
true if the project is an iSeries project, false if it is not.
Throws:
CoreException

getISeriesProjectByName

public static IProject getISeriesProjectByName(String name)
                                        throws CoreException
Returns the iSeries project with the specified name.

Parameters:
name - The name of the iSeries project
Returns:
The iSeries project with the specified name or null if no iSeries project exists with this name.
Throws:
CoreException

isISeriesProjectMember

public static boolean isISeriesProjectMember(String localFilePath)
Check if the specified local path represents a member that belongs to an iSeries project in the workspace.

Parameters:
localPath - A fully qualified pathname for the local file. (i.e. d:\wdsc\wssd\workspace\my iseries project\file\member.rpgle).
Returns:
true if the localpath represents a member in an iSeries project, false if it does not.

isISeriesProjectMember

public static boolean isISeriesProjectMember(IFile file)
Check if the specified local path represents a member that belongs to an iSeries project in the workspace.

Parameters:
localPath - A fully qualified pathname for the local file. (i.e. d:\wdsc\wssd\workspace\my iseries project\file\member.rpgle).
Returns:
true if the localpath represents a member in an iSeries project, false if it does not.

getProjectNameFromRemotePath

public static String getProjectNameFromRemotePath(String localPath)
retrieve the project name from the remote path.

Parameters:
localPath - the path of the file
Returns:
the project name that the file belongs to or null if the file does not belong to an iSeries project

convertLocalPathToRemotePath

public static String convertLocalPathToRemotePath(String localPath)
Convert the specified localPath into a remote path of the form library/file(member). The localPath must refer to a file that exists in an iSeries project.

Returns:
The remote path syntax for the iSeries or null if the local path does not refer to a member in an iSeries project.

findSourceFileInISeriesProject

public static IFolder findSourceFileInISeriesProject(IProject project,
                                                     String library,
                                                     String file)
                                              throws CoreException
Search for the source file in the iSeries project and return the corresponding IFolder for the source file if it is found, otherwise return null.

Throws:
CoreException

findSourceFileInISeriesProject

public static IFolder findSourceFileInISeriesProject(IProject project,
                                                     String libraryName,
                                                     String fileName,
                                                     boolean searchReferences)
                                              throws CoreException
Search for the source file in the iSeries project and return the corresponding IFolder for the source file if it is found. If the source file is not found then search all referenced projects for the source file.

Throws:
CoreException

findMemberInISeriesProject

public static IFile findMemberInISeriesProject(IProject project,
                                               String library,
                                               String file,
                                               String member)
                                        throws CoreException
Search for the member in the iSeries project and return the corresponding IFile for the member if it is found, otherwise return null.

Throws:
CoreException

findMemberInISeriesProject

public static IFile findMemberInISeriesProject(IProject project,
                                               String libraryName,
                                               String fileName,
                                               String memberName,
                                               boolean searchReferences)
                                        throws CoreException
Search for the member in the iSeries project and return the corresponding IFile for the member if it is found. If the member is not found then search all referenced projects for the member.

Throws:
CoreException

getISeriesConnection

public static IBMiConnection getISeriesConnection(IProject project)
Returns the ISeriesConnection associated with the project. SystemIFileProperties properties = new SystemIFileProperties( file ); properties.setRemoteFileSubSystem(SystemPlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem));


getFileRecordLength

public static int getFileRecordLength(IFile file)
Method getFileRecordLength. Return the record length for the source physical file sourceFile in the iSeries project project.

Parameters:
project - The iSeries project to use for finding the source physical file.
sourceFile - The name of the source phsyical file to lookup.
Returns:
int The record length of the source physical file.

projectVerifySetupConnection

public static void projectVerifySetupConnection(IProject project)
                                         throws SystemMessageException
Prime the RSE connection associated with the iSeries project before running the program verifier. This is required to "emulate" the behaviour of the project build action which moves the associated library into the current library of the library list and moves the current library to the top of the user portion of the library list.

Throws:
SystemMessageException

projectVerifyRestoreConnection

public static void projectVerifyRestoreConnection(IProject project)
                                           throws SystemMessageException
Restores the RSE connection associated with the iSeries project after running the program verifier.

Throws:
SystemMessageException

getAssociatedLibrary

public static String getAssociatedLibrary(IProject project)
                                   throws CoreException
Get the associated library for an iSeries project

Throws:
CoreException

communicationsStateChange

public void communicationsStateChange(CommunicationsEvent commEvent)
See Also:
com.ibm.etools.systems.subsystems.ICommunicationsListener#communicationsStateChange(CommunicationsEvent)

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
See Also:
com.ibm.etools.systems.subsystems.ICommunicationsListener#isPassiveCommunicationsListener()

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.