idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
164,400
public String getViewId ( FacesContext context , String fromAction , String outcome ) { return this . getNavigationCase ( context , fromAction , outcome ) . getToViewId ( context ) ; }
Returns the view ID that would be created for the given action and outcome
43
14
164,401
@ FFDCIgnore ( { NumberFormatException . class , IllegalArgumentException . class , ParseException . class } ) private long handleRetry ( String retryValue ) { // RETRY_AFTER is a String that can either correspond to seconds (long) // or a HTTP-Date (which can be one of 7 variations)" if ( ! ( retryValue . contains ( ":" ) ) ) { // Must be a long since all dates include ":" try { Long retryLong = Long . valueOf ( retryValue ) ; //The RETRY_AFTER value is in seconds so change units return TimeUnit . MILLISECONDS . convert ( retryLong . longValue ( ) , TimeUnit . SECONDS ) ; } catch ( NumberFormatException e ) { LOG . fine ( "SSE RETRY_AFTER Incorrect time value: " + e ) ; } } else { char [ ] retryValueArray = retryValue . toCharArray ( ) ; //handle date try { SimpleDateFormat sdf = null ; // Determine the appropriate HTTP-Date pattern if ( retryValueArray [ 3 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEE, dd MMM yyyy HH:mm:ss z" ) ; // RTC 822, updated by RFC 1123 } else if ( retryValueArray [ 6 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEEEEE, dd-MMM-yy HH:mm:ss z" ) ; // RFC 850, obsoleted by RFC 1036 } else if ( retryValueArray [ 7 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEEEEEE, dd-MMM-yy HH:mm:ss z" ) ; // RFC 850, obsoleted by RFC 1036 } else if ( retryValueArray [ 8 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEEEEEEE, dd-MMM-yy HH:mm:ss z" ) ; // RFC 850, obsoleted by RFC 1036 } else if ( retryValueArray [ 9 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEEEEEEEE, dd-MMM-yy HH:mm:ss z" ) ; // RFC 850, obsoleted by RFC 1036 } else if ( retryValueArray [ 8 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEEEEEEE, dd-MMM-yy HH:mm:ss z" ) ; // RFC 850, obsoleted by RFC 1036 } else if ( retryValueArray [ 8 ] == ' ' ) { sdf = new SimpleDateFormat ( "EEE MMM d HH:mm:ss yyyy" ) ; // ANSI C's asctime() format } else { sdf = new SimpleDateFormat ( "EEE MMM dd HH:mm:ss yyyy" ) ; // ANSI C's asctime() format } Date retryDate = sdf . parse ( retryValue ) ; long retryTime = retryDate . getTime ( ) ; long now = System . currentTimeMillis ( ) ; long delayTime = retryTime - now ; if ( delayTime > 0 ) { return delayTime ; //HTTP Date is in milliseconds } LOG . fine ( "SSE RETRY_AFTER Date value represents a time already past" ) ; } catch ( IllegalArgumentException ex ) { LOG . fine ( "SSE RETRY_AFTER Date value format incorrect: " + ex ) ; } catch ( ParseException e2 ) { LOG . fine ( "SSE RETRY_AFTER Date value cannot be parsed: " + e2 ) ; } } return - 1L ; }
return the milliseconds to delay before reconnecting ; - 1 means don t reconnect
810
15
164,402
public static final void WASInstallDirectory ( String WASInstallDirectory ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "WASInstallDirectory" , WASInstallDirectory ) ; _WASInstallDirectory = WASInstallDirectory ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "WASInstallDirectory" ) ; }
Sets the WAS install directory .
77
7
164,403
public static final void cellName ( String name ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "cellName" , name ) ; _cellName = name ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "cellName" ) ; }
Sets the name of the cell in which the current server resides
64
13
164,404
public static final void clusterName ( String name ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "clusterName" , name ) ; _clusterName = name ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "clusterName" ) ; }
Sets the name of the cluster in which the current server resides
67
13
164,405
public static final void nodeName ( String name ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "nodeName" , name ) ; _nodeName = name ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "nodeName" ) ; }
Sets the name of the node in which the current server resides
64
13
164,406
public static final void serverName ( String name ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "serverName" , name ) ; _serverName = name ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "serverName" ) ; }
Sets the name of the current WAS server
64
9
164,407
public static final void serverShortName ( String name ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "serverShortName" , name ) ; _serverShortName = name ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "serverShortName" ) ; }
Sets the short name of the current WAS server
68
10
164,408
public static final void uuid ( String uuid ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "uuid" , uuid ) ; _uuid = uuid ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "uuid" ) ; }
Sets the UUID of the current WAS server
67
10
164,409
public static final String fqServerName ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fqServerName" ) ; String fqServerName = _serverName ; // RLSUtils.FQHAMCompatibleServerName(_cellName,_nodeName,_serverName); tWAS if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fqServerName" , fqServerName ) ; return fqServerName ; }
Gets the fully qualified name of the current WAS server
109
11
164,410
public static final void HAEnabled ( boolean HAEnabled ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "HAEnabled" , new Boolean ( HAEnabled ) ) ; _HAEnabled = HAEnabled ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "HAEnabled" ) ; }
Sets the HAEnabled flag
71
6
164,411
public static final void localFailureScope ( FailureScope localFailureScope ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "localFailureScope" , localFailureScope ) ; _localFailureScope = localFailureScope ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "localFailureScope" ) ; }
Sets the local FailureScope reference .
75
8
164,412
public static final boolean isZOS ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isZOS" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isZOS" , new Boolean ( _isZOS ) ) ; return _isZOS ; }
Gets the isZOS flag .
72
8
164,413
public static final void useFileLocking ( boolean useFileLocking ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "useFileLocking" , new Boolean ( useFileLocking ) ) ; _useFileLocking = useFileLocking ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "useFileLocking" ) ; }
Sets the useFileLocking flag .
85
9
164,414
private void registerDefaultDelegationProvider ( ComponentContext cc ) { defaultDelegationProvider = new DefaultDelegationProvider ( ) ; defaultDelegationProvider . setSecurityService ( securityServiceRef . getService ( ) ) ; defaultDelegationProvider . setIdentityStoreHandlerService ( identityStoreHandlerServiceRef ) ; BundleContext bc = cc . getBundleContext ( ) ; Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( "type" , "defaultProvider" ) ; defaultDelegationProviderReg = bc . registerService ( DelegationProvider . class , defaultDelegationProvider , props ) ; }
Register the webcontainer s default delegation provider .
144
9
164,415
private Map < String , RoleSet > updateMapForSpecialSubject ( String appName , Map < String , RoleSet > specialSubjectToRolesMap , String specialSubjectName ) { RoleSet computedRoles = RoleSet . EMPTY_ROLESET ; Set < String > rolesForSubject = new HashSet < String > ( ) ; //TODO what if the appName is not present in the map? for ( SecurityRole role : resourceToAuthzInfoMap . get ( appName ) . securityRoles ) { String roleName = role . getName ( ) ; for ( SpecialSubject specialSubject : role . getSpecialSubjects ( ) ) { String specialSubjectNameFromRole = specialSubject . getType ( ) . toString ( ) ; if ( specialSubjectName . equals ( specialSubjectNameFromRole ) ) { rolesForSubject . add ( roleName ) ; } } } if ( ! rolesForSubject . isEmpty ( ) ) { computedRoles = new RoleSet ( rolesForSubject ) ; } specialSubjectToRolesMap . put ( specialSubjectName , computedRoles ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Added the following subject to role mapping for application: " + appName + "." , specialSubjectName , computedRoles ) ; } return specialSubjectToRolesMap ; }
Parse the security - role entries to look for the specified special subject and update the subject - to - roles mapping with the result . If the special subject was not found an empty list is added to the subject - to - roles map . Otherwise the list contains the set of roles mapped to the special subject .
300
62
164,416
@ FFDCIgnore ( EntryNotFoundException . class ) private String getMissingAccessId ( com . ibm . ws . javaee . dd . appbnd . Subject subjectFromArchive ) { String subjectType = null ; try { SecurityService securityService = securityServiceRef . getService ( ) ; UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; if ( ! userRegistryService . isUserRegistryConfigured ( ) ) return null ; UserRegistry userRegistry = userRegistryService . getUserRegistry ( ) ; String realm = userRegistry . getRealm ( ) ; if ( subjectFromArchive instanceof Group ) { subjectType = "group" ; String groupUniqueId = userRegistry . getUniqueGroupId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_GROUP , realm , groupUniqueId ) ; } else if ( subjectFromArchive instanceof User ) { subjectType = "user" ; String uniqueId = userRegistry . getUniqueUserId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , realm , uniqueId ) ; } } catch ( EntryNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "No entry found for " + subjectType + " " + subjectFromArchive . getName ( ) + " found in user registry. Unable to create access ID." ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "EntryNotFoundException details:" , e ) ; } } } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected exception getting the accessId for " + subjectFromArchive . getName ( ) + ": " + e ) ; } } return null ; }
Get the access id for a user or group in the bindings config by looking up the user registry .
456
20
164,417
private String updateMissingUserAccessId ( AuthzTableContainer maps , User user , String userNameFromRole ) { String accessIdFromRole ; accessIdFromRole = getMissingAccessId ( user ) ; if ( accessIdFromRole != null ) { maps . userToAccessIdMap . put ( userNameFromRole , accessIdFromRole ) ; } else { // Unable to compute the accessId, store an invalid access ID indicate this maps . userToAccessIdMap . put ( userNameFromRole , INVALID_ACCESS_ID ) ; } return accessIdFromRole ; }
Update the map for the specified user name . If the accessID is successfully computed the map will be updated with the accessID . If the accessID can not be computed due to the user not being found INVALID_ACCESS_ID will be stored .
125
53
164,418
private String updateMissingGroupAccessId ( AuthzTableContainer maps , Group group , String groupNameFromRole ) { String accessIdFromRole ; accessIdFromRole = getMissingAccessId ( group ) ; if ( accessIdFromRole != null ) { maps . groupToAccessIdMap . put ( groupNameFromRole , accessIdFromRole ) ; } else { // Unable to compute the accessId, store an invalid access ID indicate this // and avoid future attempts maps . groupToAccessIdMap . put ( groupNameFromRole , INVALID_ACCESS_ID ) ; } return accessIdFromRole ; }
Update the map for the specified group name . If the accessID is successfully computed the map will be updated with the accessID . If the accessID can not be computed due to the user not being found INVALID_ACCESS_ID will be stored .
130
53
164,419
private void fireProgressEvent ( int state , int progress , String messageKey , RepositoryResource installResource ) throws InstallException { String resourceName = null ; if ( installResource instanceof EsaResource ) { EsaResource esar = ( ( EsaResource ) installResource ) ; if ( esar . getVisibility ( ) . equals ( Visibility . PUBLIC ) || esar . getVisibility ( ) . equals ( Visibility . INSTALL ) ) { resourceName = ( esar . getShortName ( ) == null ) ? installResource . getName ( ) : esar . getShortName ( ) ; } else if ( ! firePublicAssetOnly && messageKey . equals ( "STATE_DOWNLOADING" ) ) { messageKey = "STATE_DOWNLOADING_DEPENDENCY" ; resourceName = "" ; } else { return ; } } if ( installResource instanceof SampleResource ) { SampleResource sr = ( ( SampleResource ) installResource ) ; resourceName = sr . getShortName ( ) == null ? installResource . getName ( ) : sr . getShortName ( ) ; } else { resourceName = installResource . getName ( ) ; } fireProgressEvent ( state , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( messageKey , resourceName ) ) ; }
Fires a progress event message to be displayed
284
9
164,420
public void fireInstallProgressEvent ( int progress , InstallAsset installAsset ) throws InstallException { if ( installAsset . isServerPackage ( ) ) fireProgressEvent ( InstallProgressEvent . DEPLOY , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_DEPLOYING" , installAsset . toString ( ) ) , true ) ; else if ( installAsset . isFeature ( ) ) { ESAAsset esaa = ( ( ESAAsset ) installAsset ) ; if ( esaa . isPublic ( ) ) { String resourceName = ( esaa . getShortName ( ) == null ) ? esaa . getDisplayName ( ) : esaa . getShortName ( ) ; fireProgressEvent ( InstallProgressEvent . INSTALL , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_INSTALLING" , resourceName ) , true ) ; } else if ( ! firePublicAssetOnly ) { fireProgressEvent ( InstallProgressEvent . INSTALL , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_INSTALLING_DEPENDENCY" ) , true ) ; } } else { fireProgressEvent ( InstallProgressEvent . INSTALL , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_INSTALLING" , installAsset . toString ( ) ) , true ) ; } }
Fires an install progress event to be displayed
320
9
164,421
public void fireDownloadProgressEvent ( int progress , RepositoryResource installResource ) throws InstallException { if ( installResource . getType ( ) . equals ( ResourceType . FEATURE ) ) { Visibility v = ( ( EsaResource ) installResource ) . getVisibility ( ) ; if ( v . equals ( Visibility . PUBLIC ) || v . equals ( Visibility . INSTALL ) ) { EsaResource esar = ( EsaResource ) installResource ; String resourceName = ( esar . getShortName ( ) == null ) ? installResource . getName ( ) : esar . getShortName ( ) ; fireProgressEvent ( InstallProgressEvent . DOWNLOAD , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_DOWNLOADING" , resourceName ) , true ) ; } else if ( ! firePublicAssetOnly ) { fireProgressEvent ( InstallProgressEvent . DOWNLOAD , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_DOWNLOADING_DEPENDENCY" ) , true ) ; } } else if ( installResource . getType ( ) . equals ( ResourceType . PRODUCTSAMPLE ) || installResource . getType ( ) . equals ( ResourceType . OPENSOURCE ) ) { fireProgressEvent ( InstallProgressEvent . DOWNLOAD , progress , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_DOWNLOADING" , installResource . getName ( ) ) , true ) ; } }
Fires a download progress event to be displayed
331
9
164,422
public void installFeatures ( Collection < String > featureNames , String toExtension , boolean acceptLicense , String userId , String password ) throws InstallException { installFeatures ( featureNames , toExtension , acceptLicense , userId , password , 1 ) ; }
Installs the specified features
54
5
164,423
public void installFeature ( String esaLocation , String toExtension , boolean acceptLicense ) throws InstallException { fireProgressEvent ( InstallProgressEvent . CHECK , 1 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING" ) ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; String feature = getResolveDirector ( ) . resolve ( esaLocation , toExtension , product . getInstalledFeatures ( ) , installAssets , 10 , 40 ) ; if ( installAssets . isEmpty ( ) ) { throw ExceptionUtils . create ( Messages . PROVISIONER_MESSAGES . getLogMessage ( "tool.feature.exists" , feature ) , InstallException . ALREADY_EXISTS ) ; } this . installAssets = new ArrayList < List < InstallAsset > > ( 1 ) ; this . installAssets . add ( installAssets ) ; }
Installs the feature found in the given esa location
214
11
164,424
public void installFeatureNoResolve ( String esaLocation , String toExtension , boolean acceptLicense ) throws InstallException { fireProgressEvent ( InstallProgressEvent . CHECK , 1 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING" ) ) ; ArrayList < InstallAsset > singleFeatureInstall = new ArrayList < InstallAsset > ( ) ; InstallAsset esa = null ; try { esa = new ESAAsset ( new File ( esaLocation ) , toExtension , false ) ; } catch ( ZipException e ) { throw ExceptionUtils . create ( Messages . PROVISIONER_MESSAGES . getLogMessage ( "tool.install.download.esa" , esaLocation , e . getMessage ( ) ) , InstallException . BAD_ARGUMENT ) ; } catch ( IOException e ) { throw ExceptionUtils . create ( Messages . PROVISIONER_MESSAGES . getLogMessage ( "tool.install.download.esa" , esaLocation , e . getMessage ( ) ) , InstallException . BAD_ARGUMENT ) ; } singleFeatureInstall . add ( esa ) ; this . installAssets = new ArrayList < List < InstallAsset > > ( 1 ) ; this . installAssets . add ( singleFeatureInstall ) ; }
Installs the feature found in the given esa location without resolving dependencies
290
14
164,425
public void installFeature ( Collection < String > featureIds , File fromDir , String toExtension , boolean acceptLicense , boolean offlineOnly ) throws InstallException { //fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING")); this . installAssets = new ArrayList < List < InstallAsset > > ( ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; ArrayList < String > unresolvedFeatures = new ArrayList < String > ( ) ; Collection < ESAAsset > autoFeatures = getResolveDirector ( ) . getAutoFeature ( fromDir , toExtension ) ; getResolveDirector ( ) . resolve ( featureIds , fromDir , toExtension , offlineOnly , installAssets , unresolvedFeatures ) ; if ( ! offlineOnly && ! unresolvedFeatures . isEmpty ( ) ) { log ( Level . FINEST , "installFeature() determined unresolved features: " + unresolvedFeatures . toString ( ) + " from " + fromDir . getAbsolutePath ( ) ) ; installFeatures ( unresolvedFeatures , toExtension , acceptLicense , null , null , 5 ) ; } if ( ! installAssets . isEmpty ( ) ) { getResolveDirector ( ) . resolveAutoFeatures ( autoFeatures , installAssets ) ; this . installAssets . add ( installAssets ) ; } if ( this . installAssets . isEmpty ( ) ) { throw ExceptionUtils . createByKey ( InstallException . ALREADY_EXISTS , "ALREADY_INSTALLED" , featureIds . toString ( ) ) ; } }
Installs the features found in the inputed featureIds collection
366
13
164,426
public ServerPackageAsset resolveServerPackage ( File archiveFile ) throws InstallException { ServerPackageAsset spa = ( ServerPackageJarAsset . validType ( archiveFile . getAbsolutePath ( ) . toLowerCase ( ) ) ) ? new ServerPackageJarAsset ( archiveFile , false ) : new ServerPackageZipAsset ( archiveFile , false ) ; this . installAssets = new ArrayList < List < InstallAsset > > ( ) ; this . installAssets . add ( Arrays . asList ( ( InstallAsset ) spa ) ) ; return spa ; }
Creates a new server package asset from the inputed archive file
117
13
164,427
public Collection < String > getServerFeaturesToInstall ( Set < ServerAsset > servers , boolean offlineOnly ) throws InstallException , IOException { Set < String > features = new TreeSet < String > ( ) ; Set < String > serverNames = new HashSet < String > ( servers . size ( ) ) ; Set < String > allServerNames = new HashSet < String > ( servers . size ( ) ) ; for ( ServerAsset sa : servers ) { Collection < String > requiredFeatures = sa . getRequiredFeatures ( ) ; if ( ! requiredFeatures . isEmpty ( ) ) { logger . log ( Level . FINEST , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "LOG_DEPLOY_SERVER_FEATURES" , sa . getServerName ( ) , InstallUtils . getFeatureListOutput ( requiredFeatures ) ) ) ; features . addAll ( requiredFeatures ) ; serverNames . add ( sa . getServerName ( ) ) ; } allServerNames . add ( sa . getServerName ( ) ) ; } Collection < String > featuresToInstall = getFeaturesToInstall ( features , offlineOnly ) ; if ( ! featuresToInstall . isEmpty ( ) ) { logger . log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "LOG_DEPLOY_ADDITIONAL_FEATURES_REQUIRED" , serverNames , featuresToInstall ) ) ; } else { logger . log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "LOG_DEPLOY_NO_ADDITIONAL_FEATURES_REQUIRED" , allServerNames ) ) ; } return featuresToInstall ; }
Creates a collection of features required for all servers in the inputed set .
378
16
164,428
public void installFixes ( Collection < String > fixes , String userId , String password ) throws InstallException { fireProgressEvent ( InstallProgressEvent . CHECK , 1 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING" ) ) ; List < String > fixesToInstall = new ArrayList < String > ( fixes . size ( ) ) ; for ( String fix : fixes ) { fixesToInstall . add ( fix ) ; } RepositoryConnectionList loginInfo = getResolveDirector ( ) . getRepositoryConnectionList ( null , userId , password , this . getClass ( ) . getCanonicalName ( ) + ".installFixes" ) ; Resolver resolver = new Resolver ( loginInfo ) ; List < IfixResource > ifixResources = resolver . resolveFixResources ( fixesToInstall ) ; if ( ifixResources . isEmpty ( ) ) throw ExceptionUtils . createByKey ( "ERROR_FAILED_TO_RESOLVE_IFIX" , InstallUtils . getFeatureListOutput ( fixes ) ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; int progress = 10 ; int interval = 40 / ifixResources . size ( ) ; for ( IfixResource fix : ifixResources ) { fireProgressEvent ( InstallProgressEvent . DOWNLOAD , progress , "STATE_DOWNLOADING" , fix ) ; progress += interval ; File d ; try { d = InstallUtils . download ( this . product . getInstallTempDir ( ) , fix ) ; } catch ( InstallException e ) { throw e ; } catch ( Exception e ) { throw ExceptionUtils . createByKey ( e , "ERROR_FAILED_TO_DOWNLOAD_IFIX" , fix . getName ( ) , this . product . getInstallTempDir ( ) . getAbsolutePath ( ) ) ; } try { installAssets . add ( new FixAsset ( fix . getName ( ) , d , true ) ) ; } catch ( Exception e ) { throw ExceptionUtils . createByKey ( e , "ERROR_INVALID_IFIX" , fix . getName ( ) ) ; } } this . installAssets = new ArrayList < List < InstallAsset > > ( 1 ) ; this . installAssets . add ( installAssets ) ; }
Set Director to install the specified fixes including the following tasks - determine to install the fix or not - call Resolver to resolve the required fixes - call Massive Client to download the assets
512
36
164,429
public Set < InstallLicense > getFeatureLicense ( Collection < String > featureIds , File fromDir , String toExtension , boolean offlineOnly , Locale locale ) throws InstallException { Set < InstallLicense > licenses = new HashSet < InstallLicense > ( ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; ArrayList < String > unresolvedFeatures = new ArrayList < String > ( ) ; Collection < ESAAsset > autoFeatures = getResolveDirector ( ) . getAutoFeature ( fromDir , toExtension ) ; getResolveDirector ( ) . resolve ( featureIds , fromDir , toExtension , offlineOnly , installAssets , unresolvedFeatures ) ; if ( ! offlineOnly && ! unresolvedFeatures . isEmpty ( ) ) { log ( Level . FINEST , "getFeatureLicense() determined unresolved features: " + unresolvedFeatures . toString ( ) + " from " + fromDir . getAbsolutePath ( ) ) ; licenses = getFeatureLicense ( unresolvedFeatures , locale , null , null ) ; } if ( installAssets . isEmpty ( ) ) { return licenses ; } getResolveDirector ( ) . resolveAutoFeatures ( autoFeatures , installAssets ) ; Map < String , InstallLicenseImpl > licenseIds = new HashMap < String , InstallLicenseImpl > ( ) ; for ( InstallAsset installAsset : installAssets ) { if ( installAsset . isFeature ( ) ) { ESAAsset esa = ( ESAAsset ) installAsset ; if ( esa . isPublic ( ) ) { ExeInstallAction . incrementNumOfLocalFeatures ( ) ; } LicenseProvider lp = esa . getLicenseProvider ( locale ) ; String licenseId = esa . getLicenseId ( ) ; if ( licenseId != null && ! licenseId . isEmpty ( ) ) { InstallLicenseImpl ili = licenseIds . get ( licenseId ) ; if ( ili == null ) { ili = new InstallLicenseImpl ( licenseId , null , lp ) ; licenseIds . put ( licenseId , ili ) ; } ili . addFeature ( esa . getProvideFeature ( ) ) ; } } } licenses . addAll ( licenseIds . values ( ) ) ; return licenses ; }
Creates a set of install licenses for all features to be installed
489
13
164,430
public Set < InstallLicense > getFeatureLicense ( String esaLocation , Locale locale ) throws InstallException { Set < InstallLicense > licenses = new HashSet < InstallLicense > ( ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; getResolveDirector ( ) . resolve ( esaLocation , "" , product . getInstalledFeatures ( ) , installAssets , 10 , 40 ) ; if ( installAssets . isEmpty ( ) ) { return licenses ; } Map < String , InstallLicenseImpl > licenseIds = new HashMap < String , InstallLicenseImpl > ( ) ; for ( InstallAsset installAsset : installAssets ) { if ( installAsset . isFeature ( ) ) { ESAAsset esa = ( ESAAsset ) installAsset ; LicenseProvider lp = esa . getLicenseProvider ( locale ) ; String licenseId = esa . getLicenseId ( ) ; if ( licenseId != null && ! licenseId . isEmpty ( ) ) { InstallLicenseImpl ili = licenseIds . get ( licenseId ) ; if ( ili == null ) { ili = new InstallLicenseImpl ( licenseId , null , lp ) ; licenseIds . put ( licenseId , ili ) ; } ili . addFeature ( esa . getProvideFeature ( ) ) ; } } } licenses . addAll ( licenseIds . values ( ) ) ; return licenses ; }
Gets the licenses for the specified esa location .
311
11
164,431
public Set < InstallLicense > getFeatureLicense ( Collection < String > featureNames , Locale locale , String userId , String password ) throws InstallException { Set < InstallLicense > licenses = new HashSet < InstallLicense > ( ) ; if ( featureNames == null || featureNames . isEmpty ( ) ) return licenses ; Map < String , List < List < RepositoryResource > > > installResources = getResolveDirector ( ) . resolveMap ( featureNames , DownloadOption . required , userId , password ) ; if ( isEmpty ( installResources ) ) { this . installAssets = new ArrayList < List < InstallAsset > > ( 0 ) ; return licenses ; } return getFeatureLicense ( locale , installResources ) ; }
Gets the licenses for the specified feature names
154
9
164,432
public Set < InstallLicense > getServerPackageFeatureLicense ( File archive , boolean offlineOnly , Locale locale ) throws InstallException { String aName = archive . getAbsolutePath ( ) . toLowerCase ( ) ; ServerPackageAsset spa = null ; if ( ServerPackageZipAsset . validType ( aName ) ) { spa = new ServerPackageZipAsset ( archive , false ) ; } else if ( ServerPackageJarAsset . validType ( aName ) ) { spa = new ServerPackageJarAsset ( archive , false ) ; } else { return new HashSet < InstallLicense > ( ) ; } return getFeatureLicense ( spa . getRequiredFeatures ( ) , locale , null , null ) ; }
Gets the licenses for the specified archive file
147
9
164,433
public Set < InstallLicense > getServerFeatureLicense ( File serverXML , boolean offlineOnly , Locale locale ) throws InstallException , IOException { if ( null != serverXML ) { return getFeatureLicense ( new ServerAsset ( serverXML ) . getRequiredFeatures ( ) , locale , null , null ) ; } return new HashSet < InstallLicense > ( ) ; }
Gets the licenses for the specified server XML file
80
10
164,434
public void cleanUp ( ) { fireProgressEvent ( InstallProgressEvent . CLEAN_UP , 98 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CLEANING" ) ) ; if ( installAssets != null ) { for ( List < InstallAsset > iaList : installAssets ) { for ( InstallAsset asset : iaList ) { asset . delete ( ) ; } } } boolean del = InstallUtils . deleteDirectory ( this . product . getInstallTempDir ( ) ) ; if ( ! del ) this . product . getInstallTempDir ( ) . deleteOnExit ( ) ; installAssets = null ; setScriptsPermission = false ; if ( resolveDirector != null ) resolveDirector . cleanUp ( ) ; if ( uninstallDirector != null ) uninstallDirector . cleanUp ( ) ; log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_CLEANUP_SUCCESS" ) ) ; }
Clean up the downloaded install assets ; reset installAssets and uninstallAssets .
224
16
164,435
public Collection < String > getInstalledFeatureNames ( ) { if ( installAssets == null ) return null ; Collection < String > installed = new ArrayList < String > ( ) ; for ( List < InstallAsset > iaList : installAssets ) { for ( InstallAsset asset : iaList ) { if ( asset . isFeature ( ) ) { ESAAsset esa = ( ESAAsset ) asset ; if ( esa . isPublic ( ) ) { String esaName = esa . getShortName ( ) ; if ( esaName == null || esaName . isEmpty ( ) ) esaName = esa . getFeatureName ( ) ; installed . add ( esaName ) ; } } } } return installed ; }
Get a collection of installed feature names
163
7
164,436
public void enableConsoleLog ( Level level , boolean verbose ) { InstallLogUtils . enableConsoleLogging ( level , verbose ) ; InstallLogUtils . enableConsoleErrorLogging ( verbose ) ; }
Enables console logging amd console error logging
46
8
164,437
public void reapplyFixIfNeeded ( ) throws ReapplyFixException { BundleRepositoryRegistry . initializeDefaults ( null , false ) ; Set < String > fixesToReapply = ValidateCommandTask . getFixesToReapply ( product . getManifestFileProcessor ( ) , new InstallUtils . InstallCommandConsole ( ) ) ; try { fireProgressEvent ( InstallProgressEvent . CHECK , 90 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_VALIDATING_FIXES" , fixesToReapply . toString ( ) ) ) ; this . enableEvent = false ; if ( fixesToReapply . isEmpty ( ) ) { log ( Level . FINEST , "No fix is required to be reapplied." ) ; } else { installFixes ( fixesToReapply , null , null ) ; install ( ExistsAction . replace , false , false ) ; log ( Level . FINEST , "Successfully reapplied the following fixes: " + fixesToReapply . toString ( ) ) ; } } catch ( InstallException e ) { log ( Level . FINEST , "Failed to reapply the following fixes: " + fixesToReapply . toString ( ) ) ; throw new ReapplyFixException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "LOG_REINSTALL_FIXES_WARNING" , fixesToReapply . toString ( ) ) . trim ( ) , e , InstallException . RUNTIME_EXCEPTION ) ; } finally { this . enableEvent = true ; } }
Reinstalls fixes that need to be applied again if any exist
346
13
164,438
public void setScriptsPermission ( int event ) { if ( event == InstallProgressEvent . POST_INSTALL ? setScriptsPermission : getUninstallDirector ( ) . needToSetScriptsPermission ( ) ) { fireProgressEvent ( event , 95 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_SET_SCRIPTS_PERMISSION" ) ) ; try { SelfExtractUtils . fixScriptPermissions ( new SelfExtractor . NullExtractProgress ( ) , product . getInstallDir ( ) , null ) ; } catch ( Exception e ) { } } }
Sets the scripts permissions to executable
137
7
164,439
public List < EsaResource > queryFeatures ( String searchStr ) throws InstallException { List < EsaResource > features = new ArrayList < EsaResource > ( ) ; RepositoryConnectionList loginInfo = getResolveDirector ( ) . getRepositoryConnectionList ( null , null , null , this . getClass ( ) . getCanonicalName ( ) + ".queryFeatures" ) ; try { for ( ProductInfo productInfo : ProductInfo . getAllProductInfo ( ) . values ( ) ) { log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_FEATURES" ) ) ; features . addAll ( loginInfo . findMatchingEsas ( searchStr , new ProductInfoProductDefinition ( productInfo ) , Visibility . PUBLIC ) ) ; log ( Level . FINE , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_SEARCHING_ADDONS" ) ) ; features . addAll ( loginInfo . findMatchingEsas ( searchStr , new ProductInfoProductDefinition ( productInfo ) , Visibility . INSTALL ) ) ; } log ( Level . FINE , " " ) ; } catch ( ProductInfoParseException pipe ) { throw ExceptionUtils . create ( pipe ) ; } catch ( DuplicateProductInfoException dpie ) { throw ExceptionUtils . create ( dpie ) ; } catch ( ProductInfoReplaceException pire ) { throw ExceptionUtils . create ( pire ) ; } catch ( RepositoryException re ) { throw ExceptionUtils . create ( re , re . getCause ( ) , getResolveDirector ( ) . getProxy ( ) , getResolveDirector ( ) . defaultRepo ( ) ) ; } return features ; }
Searches for features that match the specified search string
390
11
164,440
public Map < String , Collection < String > > downloadAssetsInstallUtility ( Set < String > assetsNames , File toDir , DownloadOption downloadOption , String user , String password , boolean isOverride ) throws InstallException { fireProgressEvent ( InstallProgressEvent . CHECK , 1 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING" ) ) ; createRepoConfig ( toDir , assetsNames ) ; if ( assetsNames == null || assetsNames . isEmpty ( ) ) { throw ExceptionUtils . createByKey ( "ERROR_ASSETS_LIST_INVALID" ) ; } Map < String , Collection < String > > downloaded = new HashMap < String , Collection < String > > ( ) ; RepositoryDownloadUtil . writeResourcesToDiskRepo ( downloaded , toDir , getResolveDirector ( ) . getInstallResources ( ) , this . product . getProductVersion ( ) , eventManager , getResolveDirector ( ) . defaultRepo ( ) ) ; return downloaded ; }
Downloads the assets specified in assetsNames using Install Utility
226
11
164,441
public Map < String , InstalledFeature > getInstalledCoreFeatures ( ) { try { Map < String , InstalledFeature > installedFeatures = new TreeMap < String , InstalledFeature > ( ) ; Map < String , ProvisioningFeatureDefinition > fdMap = product . getCoreFeatureDefinitions ( ) ; for ( Entry < String , ProvisioningFeatureDefinition > entry : fdMap . entrySet ( ) ) { installedFeatures . put ( entry . getKey ( ) , new InstalledAssetImpl ( entry . getValue ( ) ) ) ; } return installedFeatures ; } catch ( FeatureToolException rte ) { log ( Level . FINEST , "Director.getInstalledCoreFeatures() got exception." , rte ) ; return null ; } }
Gets installed core features
160
5
164,442
public Map < String , InstalledFeatureCollection > getInstalledFeatureCollections ( ) { try { Map < String , InstalledFeatureCollection > installedFeatureCollections = new TreeMap < String , InstalledFeatureCollection > ( ) ; Map < String , ProvisioningFeatureDefinition > fdMap = product . getFeatureCollectionDefinitions ( ) ; for ( Entry < String , ProvisioningFeatureDefinition > entry : fdMap . entrySet ( ) ) { installedFeatureCollections . put ( entry . getKey ( ) , new InstalledAssetImpl ( entry . getValue ( ) ) ) ; } return installedFeatureCollections ; } catch ( FeatureToolException rte ) { log ( Level . FINEST , "Director.getInstalledFeatureCollections() got exception." , rte ) ; return null ; } }
Get installed feature collections
171
4
164,443
public void installAssets ( Collection < String > assetIds , File fromDir , RepositoryConnectionList loginInfo ) throws InstallException { this . installAssets = new ArrayList < List < InstallAsset > > ( ) ; ArrayList < InstallAsset > installAssets = new ArrayList < InstallAsset > ( ) ; ArrayList < String > unresolvedFeatures = new ArrayList < String > ( ) ; Collection < ESAAsset > autoFeatures = getResolveDirector ( ) . getAutoFeature ( fromDir , InstallConstants . TO_USER ) ; getResolveDirector ( ) . resolve ( assetIds , fromDir , InstallConstants . TO_USER , false , installAssets , unresolvedFeatures ) ; if ( ! unresolvedFeatures . isEmpty ( ) ) { log ( Level . FINEST , "installAssets() determined unresolved features: " + unresolvedFeatures . toString ( ) + " from " + fromDir . getAbsolutePath ( ) ) ; installAssets ( unresolvedFeatures , loginInfo ) ; } if ( ! installAssets . isEmpty ( ) ) { getResolveDirector ( ) . resolveAutoFeatures ( autoFeatures , installAssets ) ; this . installAssets . add ( installAssets ) ; } if ( this . installAssets . isEmpty ( ) ) { throw ExceptionUtils . createByKey ( InstallException . ALREADY_EXISTS , "ASSETS_ALREADY_INSTALLED" , assetIds . toString ( ) ) ; } }
Installs the specified assets from a specific directory
322
9
164,444
public void installAssets ( Collection < String > assetIds , RepositoryConnectionList loginInfo ) throws InstallException { fireProgressEvent ( InstallProgressEvent . CHECK , 1 , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "STATE_CHECKING_ASSETS" ) ) ; if ( assetIds == null || assetIds . isEmpty ( ) ) { throw ExceptionUtils . createByKey ( "ERROR_ASSETS_LIST_INVALID" ) ; } RepositoryConnectionList li = loginInfo == null ? getResolveDirector ( ) . getRepositoryConnectionList ( null , null , null , this . getClass ( ) . getCanonicalName ( ) + ".installAssets" ) : loginInfo ; Map < String , List < List < RepositoryResource > > > installResources = getResolveDirector ( ) . resolveMap ( assetIds , li , false ) ; if ( isEmpty ( installResources ) ) { throw ExceptionUtils . createByKey ( InstallException . ALREADY_EXISTS , "ASSETS_ALREADY_INSTALLED" , InstallUtils . getShortNames ( product . getFeatureDefinitions ( ) , assetIds ) . toString ( ) ) ; } downloadAssets ( installResources , InstallConstants . TO_USER ) ; }
Installs the specified assets
290
5
164,445
public void checkResources ( ) throws InstallException { getResolveDirector ( ) . checkResources ( ) ; if ( installAssets != null ) { for ( List < InstallAsset > iaList : installAssets ) { for ( InstallAsset ia : iaList ) { checkResource ( ia ) ; } } } long required = getResolveDirector ( ) . getInstallResourcesMainAttachmentSize ( ) ; String requiredSpace = castToPrintableMessage ( required ) ; logger . log ( Level . FINEST , "Total required space for installation is " + requiredSpace + " including temporary files." ) ; File wlpDir = product . getInstallDir ( ) ; long free = wlpDir . getFreeSpace ( ) ; String wlpDirSpace = castToPrintableMessage ( wlpDir . getFreeSpace ( ) ) ; logger . log ( Level . FINEST , "Total available space is " + wlpDirSpace + "." ) ; if ( free < required ) { try { throw ExceptionUtils . createByKey ( "ERROR_WLP_DIR_NO_SPACE" , wlpDir . getCanonicalPath ( ) , wlpDirSpace , requiredSpace ) ; } catch ( IOException e ) { throw ExceptionUtils . create ( e ) ; } } }
Checks if resources in installAssets are already installed and if there is enough space in the install directory to install
278
23
164,446
public String castToPrintableMessage ( long number ) { long i = number / 1048576 ; if ( i > 0 ) return String . valueOf ( i ) + " MB" ; else { long l = number / 1024 ; return String . valueOf ( l ) + " KB" ; } }
Casts a long to MB or KB
64
8
164,447
public Map < String , Collection < String > > getInstalledAssetNames ( ) { if ( installAssets == null ) return null ; Map < String , Collection < String > > installed = new HashMap < String , Collection < String > > ( ) ; Collection < String > installedAddons = new ArrayList < String > ( ) ; Collection < String > installedFeatures = new ArrayList < String > ( ) ; Collection < String > installedFixes = new ArrayList < String > ( ) ; Collection < String > installedSamples = new ArrayList < String > ( ) ; Collection < String > installedOpenSources = new ArrayList < String > ( ) ; for ( List < InstallAsset > iaList : installAssets ) { for ( InstallAsset asset : iaList ) { if ( asset . isFeature ( ) ) { ESAAsset esa = ( ESAAsset ) asset ; if ( esa . isPublic ( ) ) { String esaName = esa . getShortName ( ) ; if ( esaName == null || esaName . isEmpty ( ) ) esaName = esa . getFeatureName ( ) ; if ( esa . isAddon ( ) ) installedAddons . add ( esaName ) ; else installedFeatures . add ( esaName ) ; } } else if ( asset . isFix ( ) ) { installedFixes . add ( asset . toString ( ) ) ; } else if ( asset . isSample ( ) ) { installedSamples . add ( asset . toString ( ) ) ; } else if ( asset . isOpenSource ( ) ) { installedOpenSources . add ( asset . toString ( ) ) ; } } } installed . put ( InstallConstants . ADDON , installedAddons ) ; installed . put ( InstallConstants . FEATURE , installedFeatures ) ; installed . put ( InstallConstants . IFIX , installedFixes ) ; installed . put ( InstallConstants . SAMPLE , installedSamples ) ; installed . put ( InstallConstants . OPENSOURCE , installedOpenSources ) ; return installed ; }
Gets the names of assets inside installAssets
445
10
164,448
public Set < InstallLicense > getFeatureLicense ( Locale locale ) throws InstallException { Map < String , InstallLicenseImpl > licenseIds = new HashMap < String , InstallLicenseImpl > ( ) ; getFeatureLicenseFromInstallAssets ( locale , licenseIds , getResolveDirector ( ) . getLocalInstallAssets ( ) ) ; getFeatureLicenseFromInstallResources ( locale , licenseIds , getResolveDirector ( ) . getInstallResources ( ) ) ; Set < InstallLicense > licenses = new HashSet < InstallLicense > ( ) ; licenses . addAll ( licenseIds . values ( ) ) ; return licenses ; }
Gets the feature licenses of install assets and resources
135
10
164,449
public Collection < String > getSampleLicense ( Locale locale ) throws InstallException { Collection < String > licenses = new ArrayList < String > ( ) ; for ( List < List < RepositoryResource > > targetList : getResolveDirector ( ) . getInstallResources ( ) . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { for ( RepositoryResource mr : mrList ) { ResourceType type = mr . getType ( ) ; if ( type . equals ( ResourceType . PRODUCTSAMPLE ) || type . equals ( ResourceType . OPENSOURCE ) ) { try { AttachmentResource lar = mr . getLicenseAgreement ( locale ) ; if ( lar != null ) licenses . add ( InstallLicenseImpl . getLicense ( lar ) ) ; } catch ( RepositoryException e ) { throw ExceptionUtils . createByKey ( e , "ERROR_FAILED_TO_GET_ASSET_LICENSE" , mr . getName ( ) ) ; } } } } } return licenses ; }
Gets the sample licenses from install resources
228
8
164,450
public Collection < String > getSamplesOrOpenSources ( ) { Collection < String > samplesOrOpenSources = new ArrayList < String > ( ) ; Map < String , List < List < RepositoryResource > > > installResources = getResolveDirector ( ) . getInstallResources ( ) ; if ( installResources != null ) { for ( List < List < RepositoryResource > > targetList : installResources . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { for ( RepositoryResource mr : mrList ) { ResourceType type = mr . getType ( ) ; if ( type . equals ( ResourceType . PRODUCTSAMPLE ) || type . equals ( ResourceType . OPENSOURCE ) ) { samplesOrOpenSources . add ( InstallUtils . getResourceId ( mr ) ) ; } } } } } return samplesOrOpenSources ; }
Creates a collection of Sample and Open Source resource names from install resource
192
14
164,451
public void downloadAssets ( String toExtension ) throws InstallException { downloadAssets ( getResolveDirector ( ) . getInstallResources ( ) , toExtension ) ; if ( getResolveDirector ( ) . getLocalInstallAssetsSize ( ) > 0 ) this . installAssets . add ( getResolveDirector ( ) . getLocalInstallAssets ( ) ) ; }
Downloads assets in install resources
82
6
164,452
public void resolve ( String feature , File esaFile , String toExtension ) throws InstallException { getResolveDirector ( ) . resolve ( feature , esaFile , toExtension ) ; }
Resolves feature names
42
4
164,453
public boolean resolveExistingAssetsFromDirectoryRepo ( Collection < String > featureNames , File repoDir , boolean isOverwrite ) throws InstallException { return getResolveDirector ( ) . resolveExistingAssetsFromDirectoryRepo ( featureNames , repoDir , isOverwrite ) ; }
Resolves existing assets from a specified directory
62
8
164,454
public void uninstall ( Collection < String > ids , boolean force ) throws InstallException { getUninstallDirector ( ) . uninstall ( ids , force ) ; }
Uninstalls the ids
34
6
164,455
public void uninstall ( boolean checkDependency , String [ ] productIds , Collection < File > toBeDeleted ) throws InstallException { getUninstallDirector ( ) . uninstall ( checkDependency , productIds , toBeDeleted ) ; }
Uninstalls product depending on dependencies
55
7
164,456
public void uninstallFeaturesByProductId ( String productId , boolean exceptPlatformFeatures ) throws InstallException { String [ ] productIds = new String [ 1 ] ; productIds [ 0 ] = productId ; uninstallFeaturesByProductId ( productIds , exceptPlatformFeatures ) ; }
Calls below method to uninstall features by product id
60
10
164,457
public synchronized final void append ( Link link ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "append" ) ; Link prev = _dummyTail . _getPreviousLink ( ) ; link . _link ( prev , _dummyTail , _nextPositionToIssue ++ , this ) ; prev . _setNextLink ( link ) ; _dummyTail . _setPreviousLink ( link ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "append" , _debugString ( ) ) ; }
Append a link to the end of the list .
152
11
164,458
public final AbstractItem findFirstMatching ( final Filter filter ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findFirstMatching" , filter ) ; AbstractItem found = null ; Link link = getHead ( ) ; while ( link != null && found == null ) { found = ( ( AbstractItemLink ) link ) . matches ( filter ) ; if ( found == null ) { // Defect 493652/PK59872 // We need to lock on the list at this point as our current link // may have been unlinked by another thread during the matches() // call. In that case we need to start at the head of the list again // as the next/previous pointers for the unlinked link will not be // set. synchronized ( this ) { if ( link . isPhysicallyUnlinked ( ) ) { // We have been unlinked while we were doing the match. // Start again at the beginning of the list. link = getHead ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current link is PhysicallyUnlinked so returning to beginning of list." ) ; } else { link = link . getNextLogicalLink ( ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findFirstMatching" , found ) ; return found ; }
Method get returns the first unlocked matching object on the list .
341
12
164,459
public final AbstractItem removeFirstMatching ( final Filter filter , PersistentTransaction transaction ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeFirstMatching" , new Object [ ] { filter , transaction } ) ; AbstractItem found = null ; Link link = getHead ( ) ; while ( link != null && found == null ) { found = ( ( AbstractItemLink ) link ) . removeIfMatches ( filter , transaction ) ; if ( found == null ) { // Defect 493652/PK59872 // We need to lock on the list at this point as our current link // may have been unlinked by another thread during the matches() // call. In that case we need to start at the head of the list again // as the next/previous pointers for the unlinked link will not be // set. synchronized ( this ) { if ( link . isPhysicallyUnlinked ( ) ) { // We have been unlinked while we were doing the match. // Start again at the beginning of the list. link = getHead ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Current link is PhysicallyUnlinked so returning to beginning of list." ) ; } else { link = link . getNextLogicalLink ( ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeFirstMatching" , found ) ; return found ; }
Method removes the first unlocked matching object on the list destructively under transactional control .
359
17
164,460
public final void xmlWriteOn ( FormattedWriter writer , String tagName ) throws IOException { Link link = getHead ( ) ; if ( link != null ) { writer . newLine ( ) ; writer . startTag ( tagName ) ; writer . indent ( ) ; while ( link != null ) { writer . newLine ( ) ; link . xmlWriteOn ( writer ) ; link = link . getNextPhysicalLink ( ) ; } writer . outdent ( ) ; writer . newLine ( ) ; writer . endTag ( tagName ) ; } }
Used when the transactional list is NOT part of a prioritized list .
118
15
164,461
public int countLinks ( ) { int count = 0 ; Link look = _dummyHead . getNextLogicalLink ( ) ; while ( look != null && _dummyTail != look ) { count ++ ; look = look . _getNextLink ( ) ; } return count ; }
This is a method used by the unit tests to determine the number of links in the list . It s too inefficient for any other purpose .
62
28
164,462
private void purge ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isEntryEnabled ( ) ) SibTr . entry ( this , _tc , "purge" ) ; Iterator < Map . Entry < K , TimedValue < V > > > it = _realMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < K , TimedValue < V > > entry = it . next ( ) ; TimedValue < V > value = entry . getValue ( ) ; if ( value . hasExipred ( ) ) { it . remove ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isDebugEnabled ( ) ) { SibTr . debug ( _tc , "The value with the key " + entry . getKey ( ) + " has expired" ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isEntryEnabled ( ) ) SibTr . exit ( this , _tc , "purge" ) ; }
This method removes any expired data from the map .
237
10
164,463
private static StringBuilder toBase64 ( long value ) { StringBuilder result = new StringBuilder ( 23 ) ; // Initialize with the size of ID if using Base64 for ( int shift = 60 ; shift >= 0 ; shift -= 6 ) { result . append ( Base64 [ ( int ) ( ( value >> shift ) & 0x3F ) ] ) ; } return result ; }
Return 11 chars of Base64 string for the 64 bits of the value padded with 2 zero bits
81
19
164,464
private void nextQueue ( ) { if ( super . hasNext ( ) ) { do { if ( _currentSubIterator != null ) _currentSubIterator . finished ( ) ; _currentSubIterator = null ; _currentQueue = ( SIMPQueueControllable ) super . next ( ) ; try { _currentSubIterator = _currentQueue . getRemoteQueuePointIterator ( ) ; } catch ( SIMPException e ) { // No FFDC code needed if ( tc . isDebugEnabled ( ) ) SibTr . exception ( tc , e ) ; } } // Retry if we failed to get an iterator, that iterator does not // have any remote queue points in it and we have more queues available. while ( ( _currentSubIterator == null || ! _currentSubIterator . hasNext ( ) ) && super . hasNext ( ) ) ; } else { _currentQueue = null ; if ( _currentSubIterator != null ) _currentSubIterator . finished ( ) ; _currentSubIterator = null ; } }
Move to the next stream which has active ranges
215
9
164,465
@ SuppressWarnings ( "unchecked" ) public static < T > T getContextData ( String name ) { EventImpl event = ( EventImpl ) CurrentEvent . get ( ) ; if ( null != event ) { return ( T ) event . getContextData ( name ) ; } return null ; }
Query possible EventLocal context data for the current Event runtime based on the provided name value . If an EventLocal was created under the target name then the currently running Event runtime would return its value .
66
39
164,466
public static < T > EventLocal < T > getLocal ( String name ) { return ( EventLocal < T > ) eventLocalNames . get ( name ) ; }
Query possible EventLocal for the current Event based on the provided name value . If an EventLocal was created under the target name then the currently running event runtime would return its value .
35
36
164,467
public T get ( ) { EventImpl event = ( EventImpl ) CurrentEvent . get ( ) ; if ( null == event ) { return null ; } return event . get ( this ) ; }
Query the current value if any of this EventLocal .
41
11
164,468
public void set ( T value ) { EventImpl event = ( EventImpl ) CurrentEvent . get ( ) ; if ( null != event ) { event . set ( this , value ) ; } }
Set the value of the current EventLocal to the input item .
41
13
164,469
public T remove ( ) { EventImpl event = ( EventImpl ) CurrentEvent . get ( ) ; if ( null != event ) { // Also need to remove name, if specified, from the Event's Set. if ( name != null ) { event . removeEventLocalName ( name ) ; } return event . remove ( this ) ; } return null ; }
Remove this EventLocal from the current event .
75
9
164,470
protected void validate ( ) throws IOException { if ( null != this . error ) { throw this . error ; } if ( isClosed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "validate - is closed: hc: " + this . hashCode ( ) + " details: " + this ) ; } throw new IOException ( "Stream is closed" ) ; } if ( null == this . output ) { setBufferSize ( 32768 ) ; } }
Perform validation of the stream before processing external requests to write data .
121
14
164,471
@ FFDCIgnore ( { IOException . class } ) private void convertFile ( FileChannel fc ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Converting FileChannel to buffers" ) ; } final WsByteBuffer [ ] body = new WsByteBuffer [ 1 ] ; final WsByteBufferPoolManager mgr = HttpDispatcher . getBufferManager ( ) ; final long max = fc . size ( ) ; final long blocksize = ( 1048576L < max ) ? 1048576L : max ; long offset = 0 ; while ( offset < max ) { ByteBuffer bb = fc . map ( MapMode . READ_ONLY , offset , blocksize ) ; offset += blocksize ; WsByteBuffer wsbb = mgr . wrap ( bb ) ; body [ 0 ] = wsbb ; try { this . isc . sendResponseBody ( body ) ; } catch ( MessageSentException mse ) { FFDCFilter . processException ( mse , getClass ( ) . getName ( ) , "convertFile" , new Object [ ] { this , this . isc } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Invalid state, message-sent-exception received; " + this . isc ) ; } this . error = new IOException ( "Invalid state" ) ; throw this . error ; } catch ( IOException ioe ) { // no FFDC required this . error = ioe ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Received exception during write: " + ioe ) ; } throw ioe ; } finally { wsbb . release ( ) ; } } // end-while }
User attempted to use the optimized FileChannel writing ; however that path is currently disabled . This method will read the file and do repeated write calls until done . This avoids TCP channel doing it in one big block .
422
42
164,472
private List < InMemoryMappingFile > copyInMemoryMappingFiles ( List < InMemoryMappingFile > copyIMMF ) { List < InMemoryMappingFile > immf = new ArrayList < InMemoryMappingFile > ( ) ; for ( InMemoryMappingFile file : copyIMMF ) { immf . add ( new InMemoryMappingFile ( file . getMappingFile ( ) ) ) ; } return immf ; }
Private method that takes a list of InMemoryMappingFiles and copies them by assigning a new id while sharing the same underlying byte array . This method avoids unnecessarily create identical byte arrays . Once all references to a byte array are deleted the garbage collector will cleanup the byte array .
96
55
164,473
protected Channel createChannel ( ChannelData channelData ) throws ChannelException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "createChannel" ) ; } TCPChannelConfiguration newCC = new TCPChannelConfiguration ( channelData ) ; TCPChannel channel = null ; boolean isOverrideClassUsed = false ; if ( ( ! newCC . isNIOOnly ( ) ) && ( commClass != null ) && ( ChannelFrameworkImpl . getRef ( ) . getAsyncIOEnabled ( ) ) ) { try { channel = ( TCPChannel ) commClass . newInstance ( ) ; ChannelTermination ct = channel . setup ( channelData , newCC , this ) ; if ( ct != null ) { this . terminationList . put ( commClassName , ct ) ; } isOverrideClassUsed = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "using CommClass: " + commClass ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception trying to instantiate CommClass: " + e ) ; } } } if ( ! isOverrideClassUsed ) { channel = new NioTCPChannel ( ) ; ChannelTermination ct = channel . setup ( channelData , newCC , this ) ; if ( ct != null ) { this . terminationList . put ( "NioTCPChannel" , ct ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "createChannel" ) ; } return channel ; }
Declared abstract in the ChannelFactoryImpl class .
385
10
164,474
public void processException ( HttpServletRequest req , HttpServletResponse res ) throws IOException { if ( redirectURL != null ) { res . sendRedirect ( redirectURL ) ; return ; } if ( message == null ) { res . sendError ( statusCode ) ; } else { res . sendError ( statusCode , message ) ; } }
Process security violation exception
76
4
164,475
public static String getMD5String ( String str ) { MessageDigest messageDigest = getMessageDigest ( MD5 ) ; return getHashString ( str , messageDigest ) ; }
Calculate MD5 hash of a String
41
9
164,476
public static String getFileMD5String ( File file ) throws IOException { MessageDigest messageDigest = getMessageDigest ( MD5 ) ; return getFileHashString ( file , messageDigest ) ; }
Calculate MD5 hash of a File
46
9
164,477
public static String getSHA256String ( String str ) { MessageDigest messageDigest = getMessageDigest ( SHA256 ) ; return getHashString ( str , messageDigest ) ; }
Calculate SHA - 256 hash of a String
41
10
164,478
public static String getFileSHA256String ( File file ) throws IOException { MessageDigest messageDigest = getMessageDigest ( SHA256 ) ; return getFileHashString ( file , messageDigest ) ; }
Calculate SHA - 256 hash of a File
46
10
164,479
private static MessageDigest getMessageDigest ( String digestType ) { MessageDigest messageDigest ; try { messageDigest = MessageDigest . getInstance ( digestType ) ; } catch ( NoSuchAlgorithmException e ) { //should not happen throw new RuntimeException ( e ) ; } return messageDigest ; }
this code replaces the creation of the message digest in a static code block as that was found to fail when multi threaded .
69
24
164,480
public void install ( InstallAsset installAsset , List < File > filesInstalled , Collection < String > featuresToBeInstalled , ExistsAction existsAction , Set < String > executableFiles , Map < String , Set < String > > extattrFiles , boolean downloadDependencies , RestRepositoryConnectionProxy proxy , ChecksumsManager checksumsManager ) throws IOException , InstallException { if ( installAsset . isFeature ( ) ) ESAAdaptor . install ( product , ( ESAAsset ) installAsset , filesInstalled , featuresToBeInstalled , existsAction , executableFiles , extattrFiles , checksumsManager ) ; else if ( installAsset . isFix ( ) ) FixAdaptor . install ( product , ( FixAsset ) installAsset ) ; else if ( installAsset . isServerPackage ( ) ) if ( installAsset instanceof JarAsset ) { ServerPackageJarAdaptor . install ( product , ( JarAsset ) installAsset , filesInstalled , downloadDependencies , proxy ) ; } else { ServicePackageAdaptor . install ( product , ( ServerPackageAsset ) installAsset , filesInstalled , existsAction ) ; } else if ( installAsset . isSample ( ) ) ServerPackageJarAdaptor . install ( product , ( JarAsset ) installAsset , filesInstalled , downloadDependencies , proxy ) ; else if ( installAsset . isOpenSource ( ) ) ServerPackageJarAdaptor . install ( product , ( JarAsset ) installAsset , filesInstalled , downloadDependencies , proxy ) ; }
Determines which install method to call based on the type of installAsset
321
15
164,481
public void installFeatureNoDependencyCheck ( InstallAsset installAsset , List < File > filesInstalled , Collection < String > featuresToBeInstalled , ExistsAction existsAction , Set < String > executableFiles , Map < String , Set < String > > extattrFiles , boolean downloadDependencies , RestRepositoryConnectionProxy proxy , ChecksumsManager checksumsManager ) throws IOException , InstallException { ESAAdaptor . install ( product , ( ESAAsset ) installAsset , filesInstalled , featuresToBeInstalled , existsAction , executableFiles , extattrFiles , checksumsManager , true ) ; }
Installs Feature while skipping dependency check
131
7
164,482
public void uninstall ( UninstallAsset uninstallAsset , boolean checkDependency , List < File > filesRestored ) throws IOException , ParserConfigurationException , SAXException , InstallException { if ( uninstallAsset . getType ( ) . equals ( UninstallAssetType . feature ) ) { // Remove the feature contents and metadata ESAAdaptor . uninstallFeature ( uninstallAsset , uninstallAsset . getProvisioningFeatureDefinition ( ) , getBaseDir ( uninstallAsset . getProvisioningFeatureDefinition ( ) ) , filesRestored ) ; } else if ( uninstallAsset . getType ( ) . equals ( UninstallAssetType . fix ) ) { FixAdaptor . uninstallFix ( uninstallAsset . getIFixInfo ( ) , product . getInstallDir ( ) , filesRestored ) ; } InstallUtils . updateFingerprint ( product . getInstallDir ( ) ) ; }
Determines which install method to call based on the type of uninstallAsset
185
15
164,483
public void preCheck ( UninstallAsset uninstallAsset ) throws InstallException { if ( uninstallAsset . getType ( ) . equals ( UninstallAssetType . feature ) ) { ESAAdaptor . preCheck ( uninstallAsset , uninstallAsset . getProvisioningFeatureDefinition ( ) , getBaseDir ( uninstallAsset . getProvisioningFeatureDefinition ( ) ) ) ; } else if ( uninstallAsset . getType ( ) . equals ( UninstallAssetType . fix ) ) { FixAdaptor . preCheck ( uninstallAsset . getIFixInfo ( ) , product . getInstallDir ( ) ) ; } }
Determines which preCheck method to call based on the uninstalLAsset type
127
17
164,484
public final FFDCLogger append ( String description , Object value ) { lines . add ( description ) ; lines . add ( new StringBuffer ( ) . append ( TAB ) . append ( value ) . append ( AdapterUtil . EOLN ) . toString ( ) ) ; return this ; }
Appends FFDC information to the log .
65
9
164,485
public final FFDCLogger append ( String info ) { lines . add ( new StringBuffer ( ) . append ( info ) . append ( AdapterUtil . EOLN ) . toString ( ) ) ; return this ; }
Appends a single line of FFDC information .
49
10
164,486
public final FFDCLogger append ( String [ ] moreLines ) { int numLines = moreLines . length ; for ( int i = 0 ; i < numLines ; i ++ ) lines . ( moreLines [ i ] ) ; return this ; }
Appends output from another FFDC self introspect method .
59
12
164,487
public final FFDCLogger indent ( Object value ) { lines . add ( new StringBuffer ( ) . append ( TAB ) . append ( value ) . toString ( ) ) ; return this ; }
Appends an indented line of FFDC information .
44
11
164,488
public final FFDCLogger introspect ( String description , Object value ) { if ( value instanceof FFDCSelfIntrospectable ) append ( ( ( FFDCSelfIntrospectable ) value ) . introspectSelf ( ) ) ; else append ( description , value ) ; return this ; }
Appends the FFDC self introspection information for the object provided . If none is available then we delegate to the normal append method .
64
27
164,489
private ProvisioningFeatureDefinition getCachedFeature ( String featureName ) { List < ProvisioningFeatureDefinition > featureList = symbolicNameToFeature . get ( featureName ) ; if ( featureList == null ) { featureName = publicNameToSymbolicName . get ( featureName . toLowerCase ( ) ) ; if ( featureName != null ) { featureList = symbolicNameToFeature . get ( featureName ) ; } } if ( featureList == null || featureList . isEmpty ( ) ) { return null ; } return getPreferredVersion ( featureName , featureList ) ; }
Get a feature by name but without going and checking the remote repository if we don t know about it
125
20
164,490
private List < RepositoryResource > getResourcesForName ( String resourceName ) { List < RepositoryResource > results = new ArrayList <> ( ) ; try { results . addAll ( repositoryConnection . getMatchingEsas ( FilterableAttribute . SYMBOLIC_NAME , resourceName ) ) ; results . addAll ( repositoryConnection . getMatchingEsas ( FilterableAttribute . LOWER_CASE_SHORT_NAME , resourceName . toLowerCase ( ) ) ) ; results . addAll ( repositoryConnection . getMatchingSamples ( FilterableAttribute . LOWER_CASE_SHORT_NAME , resourceName . toLowerCase ( ) ) ) ; } catch ( RepositoryBackendException e ) { // Don't worry if we fail to contact the repository // worst case is we report a resource as missing rather than available on another version/edition } return results ; }
Fetch the feature and sample resources that match the given name whether or not they re applicable to the current product
190
22
164,491
private boolean isApplicable ( RepositoryResource resource ) { if ( resource instanceof ApplicableToProduct ) { if ( ( ( ApplicableToProduct ) resource ) . getAppliesTo ( ) == null ) { return true ; // No appliesTo -> applicable } } return ( ( RepositoryResourceImpl ) resource ) . doesResourceMatch ( productDefinitions , null ) ; }
Return whether the given resource is applicable to the current product definitions .
79
13
164,492
public Collection < ApplicableToProduct > getNonApplicableResourcesForName ( String resourceName ) { List < ApplicableToProduct > result = nameToNonApplicableResources . get ( resourceName ) ; if ( result == null ) { // We don't expect this to happen, if we're looking for non-applicable resources, it's because we failed to resolve it earlier cacheFeaturesForName ( resourceName ) ; result = nameToNonApplicableResources . get ( resourceName ) ; } if ( result == null ) { // Still null, very odd return Collections . emptySet ( ) ; } return Collections . unmodifiableList ( result ) ; }
Return all features and samples in the repository with the given name which don t apply to the installed products
139
20
164,493
protected void close ( boolean closeWrapperOnly ) throws SQLException { TraceComponent tc = getTracer ( ) ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "close" ) ; // Make sure we only get closed once. if ( state == State . CLOSED ) // already closed, just return { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "close" , "Already closed" ) ; return ; } state = State . CLOSED ; if ( isTraceOn && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "state --> " + state . name ( ) ) ; // Close all children. Then close the current wrapper, saving the first exception // encountered. Others are logged. closeChildWrappers ( ) ; SQLException sqlX = freeResourcesOnClose ? closeResources ( ) : null ; SQLException sqlX2 = closeWrapper ( closeWrapperOnly ) ; sqlX = sqlX == null ? sqlX2 : sqlX ; // When JDBC event listeners are enabled, the connection error notification is sent // prior to raising the error, which means close is invoked prior to mapException. // The reference to the parent wrapper must be kept so that exception mapping can // still be performed. childWrappers = null ; ifcToDynamicWrapper . clear ( ) ; dynamicWrapperToImpl . clear ( ) ; if ( sqlX != null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "close" , sqlX ) ; throw sqlX ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "close" ) ; }
Default close method for all JDBC wrappers accessible to users . This method closes all child wrappers and invokes the closeWrapper method implemented by the wrapper subclass . If the wrapper is already closed a message stating the wrapper has already been closed is logged to the trace .
408
55
164,494
final void closeChildWrappers ( ) { TraceComponent tc = getTracer ( ) ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // Close any child wrappers in the child wrapper list. if ( childWrappers != null && ! childWrappers . isEmpty ( ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Closing child wrappers" ) ; WSJdbcObject wrapper = null ; // Children remove themselves from the childWrappers list as they are closed. for ( int i = childWrappers . size ( ) ; i > 0 ; ) try { wrapper = ( WSJdbcObject ) childWrappers . get ( -- i ) ; wrapper . close ( ) ; } catch ( SQLException closeX ) // can't fail here, need to keep closing { FFDCFilter . processException ( closeX , "com.ibm.ws.rsadapter.jdbc.WSJdbcObject.closeChildWrappers" , "554" , this ) ; } catch ( IndexOutOfBoundsException ioobX ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "ArrayIndexOutOfBoundsException is caught during closeChildWrappers() of the WSJdbcObject" ) ; Tr . debug ( this , tc , "Possible causes:" ) ; Tr . debug ( this , tc , "multithreaded access of JDBC objects by the Application" ) ; Tr . debug ( this , tc , "Application is closing JDBC objects in a finalize()" ) ; Tr . debug ( this , tc , "Exception is: " , ioobX ) ; } throw ioobX ; } } // Close this object's single child wrapper, if one exists. if ( childWrapper != null ) try { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Closing child wrapper" ) ; childWrapper . close ( ) ; } catch ( SQLException closeX ) { FFDCFilter . processException ( closeX , "com.ibm.ws.rsadapter.jdbc.WSJdbcObject.closeChildWrappers" , "573" , this ) ; } }
Close all child objects of this wrapper . Errors that occur while closing child objects should not be thrown . Errors may be logged instead .
508
26
164,495
final void init ( WSJdbcObject parent ) { if ( parent != null ) { parentWrapper = parent ; dsConfig = parent . dsConfig ; freeResourcesOnClose = parent . freeResourcesOnClose ; } if ( freeResourcesOnClose ) // then initialize data structures to track them { arrays = new LinkedList < Array > ( ) ; blobs = new LinkedList < Blob > ( ) ; clobs = new LinkedList < Clob > ( ) ; resources = new LinkedList < Closeable > ( ) ; xmls = new LinkedList < SQLXML > ( ) ; } }
Initialize the parent wrapper field and copy some fields from the parent wrapper .
134
15
164,496
protected void introspectAll ( FFDCLogger info ) { info . append ( this . toString ( ) ) ; // Allow any wrapper specific info to be inserted first. introspectWrapperSpecificInfo ( info ) ; // Display generic information. info . append ( "Wrapper State: " , state . name ( ) ) ; info . append ( "Parent wrapper:" , parentWrapper ) ; info . append ( "Child wrapper:" ) ; info . indent ( childWrapper ) ; if ( childWrappers != null ) { try { info . append ( "# of Child Wrappers " + childWrappers . size ( ) ) ; info . append ( "Child wrappers:" ) ; for ( int i = 0 ; i < childWrappers . size ( ) ; i ++ ) { info . indent ( childWrappers . get ( i ) ) ; } } catch ( Throwable th ) { // No FFDC code needed; closed on another thread; ignore. } } //end if info . eoln ( ) ; }
Collects generic FFDC information applicable to all JDBC wrappers . Formats this information to the provided FFDC logger . FFDC information for all child wrappers should be included in the result .
216
40
164,497
private void gatherMetatypeFilesAndStats ( ) throws IOException , JAXBException { for ( File bundle : directory . listFiles ( ) ) { if ( bundle . isFile ( ) ) { analyzeBundle ( bundle ) ; } } }
Iterates through and gathers the projects to validate along with scanning all the other projects to gather their information for validating the projects .
53
26
164,498
static long getFreeSpace ( final File fileInFs ) { try { long result = ( long ) getInstance ( ) . doPrivileged ( new PrivilegedAction < Long > ( ) { public Long run ( ) { return fileInFs . getFreeSpace ( ) ; } } ) ; return result ; } catch ( SecurityException se ) { return - 1 ; } }
Returns free space on a file system containing the passed in file
78
12
164,499
static Timer createTimer ( ) { try { return getInstance ( ) . doPrivileged ( new PrivilegedAction < Timer > ( ) { @ Override public Timer run ( ) { return new Timer ( true ) ; // 691649 } } ) ; } catch ( SecurityException se ) { // TODO: Add logging here but be careful since this code is used in logging logic itself // and may result in an indefinite loop. return null ; } }
creates a new nameless non - daemon Timer
98
11