idx
int64 0
165k
| question
stringlengths 73
5.81k
| target
stringlengths 5
918
|
---|---|---|
164,700 | public static < T > T findFirstNextByType ( FaceletHandler nextHandler , Class < T > type ) { if ( type . isAssignableFrom ( nextHandler . getClass ( ) ) ) { return ( T ) nextHandler ; } else if ( nextHandler instanceof javax . faces . view . facelets . CompositeFaceletHandler ) { for ( FaceletHandler handler : ( ( javax . faces . view . facelets . CompositeFaceletHandler ) nextHandler ) . getHandlers ( ) ) { if ( type . isAssignableFrom ( handler . getClass ( ) ) ) { return ( T ) handler ; } } } return null ; } | Find the first occurence of a tag handler that is instanceof T |
164,701 | public static boolean tryToClose ( Closeable closeable ) { Object token = ThreadIdentityManager . runAsServer ( ) ; try { if ( closeable != null ) { try { closeable . close ( ) ; return true ; } catch ( IOException e ) { } } } finally { ThreadIdentityManager . reset ( token ) ; } return false ; } | Close the closeable object |
164,702 | private static void setDefaultDiscoveryProperties ( ) { defaultDiscoveryProperties . put ( KEY_OIDC_RESPONSE_TYPES_SUPP , new String [ ] { "code" , "token" , "id_token token" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_SUB_TYPES_SUPP , new String [ ] { "public" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_ID_TOKEN_SIGNING_ALG_VAL_SUPP , new String [ ] { "HS256" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_SCOPES_SUPP , new String [ ] { "openid" , "general" , "profile" , "email" , "address" , "phone" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_CLAIMS_SUPP , new String [ ] { "sub" , "groupIds" , "name" , "preferred_username" , "picture" , "locale" , "email" , "profile" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_RESP_MODES_SUPP , new String [ ] { "query" , "fragment" , "form_post" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_GRANT_TYPES_SUPP , new String [ ] { "authorization_code" , "implicit" , "refresh_token" , "client_credentials" , "password" , "urn:ietf:params:oauth:grant-type:jwt-bearer" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_TOKEN_EP_AUTH_METHODS_SUPP , new String [ ] { "client_secret_post" , "client_secret_basic" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_DISPLAY_VAL_SUPP , new String [ ] { "page" } ) ; defaultDiscoveryProperties . put ( KEY_OIDC_CLAIM_TYPES_SUPP , new String [ ] { "normal" } ) ; defaultDiscoveryClaimsParmSupp = false ; defaultDiscoveryRequestParmSupp = false ; defaultDiscoveryRequestUriParmSupp = false ; defaultDiscoveryRequireRequestUriRegistrationSupp = false ; } | Should model what is set as default in the oidc . server metatype . xml |
164,703 | public void populateCustomRequestParameterMap ( ConfigurationAdmin configAdmin , HashMap < String , String > paramMapToPopulate , String [ ] configuredCustomRequestParams , String configAttrName , String configAttrValue ) { if ( configuredCustomRequestParams == null ) { return ; } for ( String configuredParameter : configuredCustomRequestParams ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Configured custom request param [" + configuredParameter + "]" ) ; } Configuration config = getConfigurationFromConfigAdmin ( configAdmin , configuredParameter ) ; if ( config != null ) { addCustomRequestParameterValueToMap ( config , paramMapToPopulate , configAttrName , configAttrValue ) ; } } } | Populates a map of custom request parameter names and values to add to a certain OpenID Connect request type . |
164,704 | public void stopModule ( EJBModuleMetaDataImpl mmd ) { try { uninstall ( mmd , false ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".stop" , "3059" , this ) ; throw new ContainerEJBException ( "Failed to stop - caught Throwable" , t ) ; } } | Stops an EJB module . |
164,705 | protected void bindInterfaces ( NameSpaceBinder < ? > binder , BeanMetaData bmd ) throws Exception { HomeWrapperSet homeSet = null ; EJSHome home = bmd . homeRecord . getHome ( ) ; if ( home != null ) { homeSet = home . getWrapperSet ( ) ; } int numRemoteInterfaces = countInterfaces ( bmd , false ) ; int numLocalInterfaces = countInterfaces ( bmd , true ) ; boolean singleGlobalInterface = ( numRemoteInterfaces + numLocalInterfaces ) == 1 ; bindInterfaces ( binder , bmd , homeSet , false , numRemoteInterfaces , singleGlobalInterface ) ; bindInterfaces ( binder , bmd , homeSet , true , numLocalInterfaces , singleGlobalInterface ) ; } | Bind all local and remote interfaces for a bean to all binding locations . |
164,706 | private int countInterfaces ( BeanMetaData bmd , boolean local ) { String homeInterfaceClassName = local ? bmd . localHomeInterfaceClassName : bmd . homeInterfaceClassName ; boolean hasLocalBean = local && bmd . ivLocalBean ; String [ ] businessInterfaceNames = local ? bmd . ivBusinessLocalInterfaceClassNames : bmd . ivBusinessRemoteInterfaceClassNames ; int result = ( homeInterfaceClassName == null ? 0 : 1 ) + ( hasLocalBean ? 1 : 0 ) + ( businessInterfaceNames == null ? 0 : businessInterfaceNames . length ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "countInterfaces: " + bmd . j2eeName + ", local=" + local + ", result=" + result ) ; return result ; } | Determine the number of remote or local interfaces exposed by a bean . |
164,707 | private void bindInterfaces ( NameSpaceBinder < ? > binder , BeanMetaData bmd , HomeWrapperSet homeSet , boolean local , int numInterfaces , boolean singleGlobalInterface ) throws NamingException , RemoteException , CreateException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "bindInterfaces: " + bmd . j2eeName + ", deferred=" + ( homeSet == null ) + ", local=" + local ) ; String homeInterfaceClassName = local ? bmd . localHomeInterfaceClassName : bmd . homeInterfaceClassName ; boolean hasLocalBean = local && bmd . ivLocalBean ; String [ ] businessInterfaceNames = local ? bmd . ivBusinessLocalInterfaceClassNames : bmd . ivBusinessRemoteInterfaceClassNames ; if ( numInterfaces > 1 && bmd . simpleJndiBindingName != null ) { Tr . warning ( tc , "SIMPLE_BINDING_NAME_MISSUSED_CNTR0168W" , new Object [ ] { bmd . enterpriseBeanName , bmd . _moduleMetaData . ivName , bmd . _moduleMetaData . ivAppName } ) ; } HomeRecord hr = bmd . homeRecord ; if ( homeInterfaceClassName != null ) { bindInterface ( binder , hr , homeSet , numInterfaces , singleGlobalInterface , homeInterfaceClassName , - 1 , local ) ; } int interfaceIndex = 0 ; if ( hasLocalBean ) { bindInterface ( binder , hr , homeSet , numInterfaces , singleGlobalInterface , bmd . enterpriseBeanClassName , interfaceIndex , local ) ; interfaceIndex ++ ; } if ( businessInterfaceNames != null ) { for ( String businessInterfaceName : businessInterfaceNames ) { bindInterface ( binder , hr , homeSet , numInterfaces , singleGlobalInterface , businessInterfaceName , interfaceIndex , local ) ; interfaceIndex ++ ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "bindInterfaces" ) ; } | Bind all interfaces for a bean to all binding locations . |
164,708 | private < T > void bindInterface ( NameSpaceBinder < T > binder , HomeRecord hr , HomeWrapperSet homeSet , int numInterfaces , boolean singleGlobalInterface , String interfaceName , int interfaceIndex , boolean local ) throws NamingException , RemoteException , CreateException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "bindInterface: " + hr . getJ2EEName ( ) + ", " + interfaceIndex + ", " + interfaceName + ", local=" + local ) ; T bindingObject = binder . createBindingObject ( hr , homeSet , interfaceName , interfaceIndex , local ) ; boolean deferred = homeSet == null ; if ( hr . bindToContextRoot ( ) ) { binder . bindBindings ( bindingObject , hr , numInterfaces , singleGlobalInterface , interfaceIndex , interfaceName , local , deferred ) ; } if ( hr . bindToJavaNameSpaces ( ) ) { T javaBindingObject = binder . createJavaBindingObject ( hr , homeSet , interfaceName , interfaceIndex , local , bindingObject ) ; bindObjectToJavaNameSpaces ( binder , javaBindingObject , hr , singleGlobalInterface , interfaceName , interfaceIndex , local ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "bindInterface" ) ; } | Bind a single interface to all binding locations . |
164,709 | protected void bindAllRemoteInterfacesToContextRoot ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "bindAllRemoteInterfacesToContextRoot" ) ; Map < EJBModuleMetaDataImpl , NameSpaceBinder < ? > > binders = new HashMap < EJBModuleMetaDataImpl , NameSpaceBinder < ? > > ( ) ; HomeOfHomes homeOfHomes = ( ivContainer != null ) ? ivContainer . getHomeOfHomes ( ) : null ; if ( homeOfHomes != null ) { List < HomeRecord > hrs = ivContainer . getHomeOfHomes ( ) . getAllHomeRecords ( ) ; for ( HomeRecord hr : hrs ) { if ( hr . bindToContextRoot ( ) ) { BeanMetaData bmd = hr . getBeanMetaData ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "processing bindings for " + bmd . j2eeName ) ; if ( bmd . homeInterfaceClassName != null ) { bindRemoteInterfaceToContextRoot ( binders , hr , bmd . homeInterfaceClassName , - 1 ) ; } if ( bmd . ivBusinessRemoteInterfaceClassNames != null ) { int interfaceIndex = 0 ; for ( String remoteInterfaceName : bmd . ivBusinessRemoteInterfaceClassNames ) { bindRemoteInterfaceToContextRoot ( binders , hr , remoteInterfaceName , interfaceIndex ++ ) ; } } } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "bindAllRemoteInterfacesToContextRoot" ) ; } | Bind the remote interfaces for all beans known to the container . |
164,710 | protected void addHome ( BeanMetaData bmd ) throws ContainerException { try { EJSContainer . homeOfHomes . addHome ( bmd ) ; } catch ( Throwable ex ) { ContainerException ex2 = new ContainerException ( ex ) ; Tr . error ( tc , "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E" , new Object [ ] { ex , ex2 . toString ( ) } ) ; throw ex2 ; } } | Adds a home to make it externally accessible . |
164,711 | protected EJSHome initializeDeferredEJBImpl ( HomeRecord hr ) throws ContainerException , EJBConfigurationException { BeanMetaData bmd = hr . getBeanMetaData ( ) ; Object originalLoader = ThreadContextAccessor . UNCHANGED ; try { if ( ! bmd . fullyInitialized ) { originalLoader = svThreadContextAccessor . pushContextClassLoader ( getServerClassLoader ( ) ) ; bmd . wccm . reload ( ) ; finishBMDInit ( bmd ) ; } originalLoader = svThreadContextAccessor . repushContextClassLoader ( originalLoader , hr . getClassLoader ( ) ) ; return fireMetaDataCreatedAndStartBean ( bmd ) ; } finally { svThreadContextAccessor . popContextClassLoader ( originalLoader ) ; if ( bmd . wccm != null ) { bmd . wccm . unload ( ) ; } } } | Actually initializes the deferred EJB . Assumes that a runtime thread context has already been established . |
164,712 | protected ReferenceContext createReferenceContext ( BeanMetaData bmd ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createReferenceContext: " + bmd . j2eeName ) ; if ( bmd . ivReferenceContext == null ) { bmd . ivReferenceContext = getInjectionEngine ( ) . createReferenceContext ( ) ; bmd . ivReferenceContext . add ( new ComponentNameSpaceConfigurationProviderImpl ( bmd , this ) ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createReferenceContext" , bmd . ivReferenceContext ) ; return bmd . ivReferenceContext ; } | Creates the reference context for this EJB . |
164,713 | private void finishBMDInit ( BeanMetaData bmd ) throws ContainerException , EJBConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "finishBMDInit: " + bmd . j2eeName ) ; createReferenceContext ( bmd ) ; ivEJBMDOrchestrator . finishBMDInitWithReferenceContext ( bmd ) ; bmd . _moduleMetaData . freeResourcesAfterAllBeansInitialized ( bmd ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "finishBMDInit" ) ; } | Fully initialize the BeanMetaData . When this method completes successfully bmd . fullyInitialized will be true ; this method must not be called if this field is already true . The context class loader must be the runtime class loader when calling this method . |
164,714 | public ComponentNameSpaceConfiguration finishBMDInitForReferenceContext ( BeanMetaData bmd ) throws EJBConfigurationException , ContainerException { return ivEJBMDOrchestrator . finishBMDInitForReferenceContext ( bmd , ivDefaultDataSourceJNDIName , ivWebServicesHandlerResolver ) ; } | Finish filling out enough of the bean metadata to be able to create the component namespace configuration for the bean . The context class loader must be the runtime class loader when calling this method . |
164,715 | private EJSHome fireMetaDataCreatedAndStartBean ( BeanMetaData bmd ) throws ContainerException { if ( ! bmd . isManagedBean ( ) ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "startBean: Fire Component Metadata created event to listeners for: " + bmd . j2eeName ) ; bmd . ivMetaDataDestroyRequired = true ; fireMetaDataCreated ( bmd ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + "startBean" , "445" , this ) ; throw new ContainerException ( "Failed to start " + bmd . j2eeName , t ) ; } } return startBean ( bmd ) ; } | Starts the bean by creating a home instance via the container . When this method completes successfully bmd . homeRecord . homeInternal will be set to indicate that this home is started ; this method must not be called if this field is already set . The context class loader must be the bean class loader when calling this method . |
164,716 | protected int createNonPersistentAutomaticTimers ( String appName , String moduleName , List < AutomaticTimerBean > timerBeans ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createNonPersistentAutomaticTimers: " + moduleName ) ; int numCreated = 0 ; for ( AutomaticTimerBean timerBean : timerBeans ) { if ( timerBean . getNumNonPersistentTimers ( ) != 0 ) { for ( TimerMethodData timerMethod : timerBean . getMethods ( ) ) { for ( TimerMethodData . AutomaticTimer timer : timerMethod . getAutomaticTimers ( ) ) { if ( ! timer . isPersistent ( ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "creating non-persistent automatic timer " + timer ) ; createNonPersistentAutomaticTimer ( timerBean , timer , timerMethod ) ; numCreated ++ ; } } } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createNonPersistentAutomaticTimers: " + numCreated ) ; return numCreated ; } | F743 - 506 RTC109678 |
164,717 | protected Timer createNonPersistentCalendarTimer ( BeanO beanO , ParsedScheduleExpression parsedExpr , Serializable info ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . entry ( tc , "createNonPersistentCalendarTimer : " + beanO ) ; TimerNpImpl timer = new TimerNpImpl ( beanO . getId ( ) , parsedExpr , info ) ; queueOrStartNpTimer ( beanO , timer ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createNonPersistentCalendarTimer : " + timer ) ; return timer ; } | Creates a non - persistent calendar based EJB timer . |
164,718 | private synchronized final boolean _declareDiscardable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_declareDiscardable" ) ; boolean linkHasBecomeReleasable = false ; if ( _isStorageManaged ) { if ( ! _itemIsDiscardableIfPersistentRepresentationStable ) { linkHasBecomeReleasable = _persistentRepresentationIsStable ; if ( linkHasBecomeReleasable ) { _strongReferenceToItem = NULL_STRONG_REF ; } _itemIsDiscardableIfPersistentRepresentationStable = true ; } } else { _itemIsDiscardableIfPersistentRepresentationStable = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_declareDiscardable" , Boolean . valueOf ( linkHasBecomeReleasable ) ) ; return linkHasBecomeReleasable ; } | The state has changed so that the item could be discarded if it has a stable persistent representation . Change the flags that control the discard and return true if this call has resulted in a change to the releasable state . |
164,719 | private synchronized final boolean _declareNotDiscardable ( AbstractItem item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "_declareNotDiscardable" ) ; boolean notifyRequired = false ; _strongReferenceToItem = item ; if ( _itemIsDiscardableIfPersistentRepresentationStable ) { notifyRequired = _persistentRepresentationIsStable ; _itemIsDiscardableIfPersistentRepresentationStable = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_declareNotDiscardable" , Boolean . valueOf ( notifyRequired ) ) ; return notifyRequired ; } | The state has changed so that the item must not be discarded regardless of whether it has a stable persistent representation . Change the flags that control the discard and return true if this call has resulted in a change to the releasable state . |
164,720 | private final AbstractItem _getAndAssertItem ( ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "_getAndAssertItem" ) ; AbstractItem item = null ; synchronized ( this ) { item = _strongReferenceToItem ; } if ( item == NULL_STRONG_REF ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "_getAndAssertItem" ) ; throw new SevereMessageStoreException ( "_getAndAssertItem" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "_getAndAssertItem" , item ) ; return item ; } | Gets a reference to the item which is asserted to be obtained from the strong reference . We use this when we know that the state of the item tells us that there is a strong reference . |
164,721 | public final void persistRedeliveredCount ( int redeliveredCount ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "persistRedeliveredCount" ) ; PersistentTransaction msTran = ( PersistentTransaction ) getMessageStore ( ) . getTransactionFactory ( ) . createAutoCommitTransaction ( ) ; Persistable perTuple = getTuple ( ) ; perTuple . setRedeliveredCount ( redeliveredCount ) ; final Task persistTask = new PersistRedeliveredCount ( this ) ; try { msTran . addWork ( persistTask ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.persistRedeliveredCount" , "1:1198:1.241" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught persisting redelivery count!" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "persistRedeliveredCount" ) ; } | Use this to persist redelivered count . Invoke indirectly by the API . This method uses auto - commit transaction to perform the task of persisting the redelivered count . This does not involve any external participants . Therefore this operation does not require maintaining transaction states . |
164,722 | final void cmdAdd ( final LinkOwner stream , long lockID , final PersistentTransaction transaction ) throws StreamIsFull , ProtocolException , TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cmdAdd" , new Object [ ] { "Item Link: " + this , "Stream Link: " + stream , formatLockId ( lockID ) , "Transaction: " + transaction } ) ; synchronized ( this ) { if ( ItemLinkState . STATE_NOT_STORED == _itemLinkState ) { ListStatistics stats = getParentStatistics ( ) ; stream . _assertCanAddChild ( transaction , stats ) ; stats . incrementAdding ( _inMemoryItemSize ) ; _lockID = lockID ; _transactionId = transaction . getPersistentTranId ( ) ; if ( NO_LOCK_ID == lockID ) { _itemLinkState = ItemLinkState . STATE_ADDING_UNLOCKED ; } else { _itemLinkState = ItemLinkState . STATE_ADDING_LOCKED ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Invalid Item state: " + _itemLinkState ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdAdd" ) ; throw new StateException ( _itemLinkState . toString ( ) ) ; } } final Task task = new AddTask ( this ) ; transaction . addWork ( task ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdAdd" ) ; } | Set the state to adding |
164,723 | final void cmdRemoveExpiring ( final long lockId , final PersistentTransaction transaction ) throws ProtocolException , TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cmdRemoveExpiring" , new Object [ ] { "Item Link: " + this , "Stream Link: " + _owningStreamLink , formatLockId ( lockId ) , "Transaction: " + transaction } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "expiring item " + _tuple . getUniqueId ( ) ) ; synchronized ( this ) { if ( ItemLinkState . STATE_LOCKED_FOR_EXPIRY == _itemLinkState ) { if ( _lockID != lockId ) { throw new LockIdMismatch ( _lockID , lockId ) ; } ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . decrementExpiring ( ) ; stats . incrementRemoving ( ) ; } _transactionId = transaction . getPersistentTranId ( ) ; _itemLinkState = ItemLinkState . STATE_REMOVING_EXPIRING ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Invalid Item state: " + _itemLinkState ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdRemoveExpiring" ) ; throw new StateException ( _itemLinkState . toString ( ) ) ; } } final Task task = new RemoveLockedTask ( this ) ; transaction . addWork ( task ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdRemoveExpiring" ) ; } | Remove while locked for expiry |
164,724 | private synchronized final boolean isStateLocked ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isStateLocked" ) ; SibTr . exit ( this , tc , "isStateLocked" , _itemLinkState ) ; } if ( _itemLinkState == ItemLinkState . STATE_LOCKED ) { return true ; } else { return false ; } } | Simple function to check if the item link state is in ItemLinkState . STATE_LOCKED . Seperate function is created to acquire the lock |
164,725 | public final AbstractItem getItem ( ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getItem" ) ; AbstractItem item = _getItemNoRestore ( ) ; synchronized ( this ) { if ( isExpired ( ) ) { item = null ; } else { if ( null == item ) { try { item = _restoreItem ( ) ; } catch ( SevereMessageStoreException e ) { try { StringWriter stringWriter = new StringWriter ( ) ; FormattedWriter writer = new FormattedWriter ( stringWriter ) ; this . xmlWriteOn ( writer ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem" , "1:2252:1.241" , this , new Object [ ] { stringWriter } ) ; writer . close ( ) ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem" , "1:2257:1.241" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "RuntimeException caught restoring Item!" , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getItem" ) ; throw e ; } catch ( RuntimeException re ) { try { StringWriter stringWriter = new StringWriter ( ) ; FormattedWriter writer = new FormattedWriter ( stringWriter ) ; this . xmlWriteOn ( writer ) ; FFDCFilter . processException ( re , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem" , "1:2274:1.241" , this , new Object [ ] { stringWriter } ) ; writer . close ( ) ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem" , "1:2279:1.241" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "RuntimeException caught restoring Item!" , re ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getItem" ) ; throw re ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getItem" , item ) ; } return item ; } | When the item is required the hard and soft references are examined to detect an existing item in memory . If there is one then this item is used . If the item does not have a hard or soft reference but does have a persistent representation then we attempt to restore the item from its persistent representation . If we have no persistent representation or fail to recreate from the persistent representation then we unlink the link . |
164,726 | private final void setInMemoryItemSize ( AbstractItem item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setInMemoryItemSize" , item ) ; if ( item != null ) { _inMemoryItemSize = item . getInMemoryDataSize ( ) ; } else { _inMemoryItemSize = _tuple . getPersistentSize ( ) * MEMORY_SIZE_MULTIPLIER ; } _tuple . setInMemoryByteSize ( _inMemoryItemSize ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setInMemoryItemSize" , _inMemoryItemSize ) ; } | setInMemoryItemSize Set the _inMemoryItemSize from the Item itself if we have one or from what we can find out from the Tuple . Also set the corresponding value in the Tuple . |
164,727 | final boolean isExpired ( ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isExpired" ) ; if ( isAvailable ( ) && internalCanExpire ( ) ) { long expiryTime = _tuple . getExpiryTime ( ) ; if ( expiryTime != 0 && expiryTime <= Expirer . timeNow ( ) ) { boolean hasBecomeNonReleasable = false ; synchronized ( this ) { if ( ItemLinkState . STATE_AVAILABLE == _itemLinkState ) { AbstractItem item = _getItemNoRestore ( ) ; if ( null == item ) { item = _restoreItem ( ) ; } ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . incrementExpiring ( ) ; stats . decrementAvailable ( ) ; } _lockID = AbstractItemLink . EXPIRY_LOCK_ID ; hasBecomeNonReleasable = _declareNotDiscardable ( item ) ; _itemLinkState = ItemLinkState . STATE_LOCKED_FOR_EXPIRY ; } } if ( hasBecomeNonReleasable ) { _declareNotReleasable ( ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isExpired" , Boolean . valueOf ( isExpiring ( ) ) ) ; return isExpiring ( ) ; } | Establish whether the item has reached its expiry time and if so query it to see if it is willing to expire . If so set the state accordingly and lock the item for expiry . |
164,728 | public final AbstractItem matches ( final Filter filter , boolean allowUnavailable ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "matches" , new Object [ ] { filter , Boolean . valueOf ( allowUnavailable ) } ) ; AbstractItem foundItem = null ; if ( allowUnavailable || isAvailable ( ) ) { if ( ! isExpired ( ) ) { AbstractItem item = getItem ( ) ; if ( null == item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "item does not exist" ) ; } else { try { if ( null == filter || filter . filterMatches ( item ) ) { foundItem = item ; } } catch ( Exception e ) { } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "matches" , foundItem ) ; return foundItem ; } | Version used by browse cursor as it can be set to allow matching unavailable items to be seen . |
164,729 | public final void persistLock ( final Transaction transaction ) throws ProtocolException , TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "persistLock" , transaction ) ; if ( null != transaction ) { PersistentTransaction mstran = ( PersistentTransaction ) transaction ; cmdPersistLock ( mstran ) ; getTuple ( ) . setLockID ( getLockID ( ) ) ; final Task task = new PersistLock ( this ) ; mstran . addWork ( task ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "persistLock" ) ; } | Use this to lock persistently . Invoke indirectly by the API . |
164,730 | public final List < DataSlice > readDataFromPersistence ( ) throws SevereMessageStoreException { List < DataSlice > dataSlices ; PersistentMessageStore pm = getMessageStoreImpl ( ) . getPersistentMessageStore ( ) ; try { dataSlices = pm . readDataOnly ( getTuple ( ) ) ; } catch ( PersistenceException pe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence" , "1:3271:1.241" , this ) ; throw new SevereMessageStoreException ( pe ) ; } return dataSlices ; } | Feature SIB0112le . ms . 1 |
164,731 | public final void releaseItem ( ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "releaseItem" ) ; synchronized ( this ) { _strongReferenceToItem = NULL_STRONG_REF ; } if ( _softReferenceToItem != null ) { _softReferenceToItem . clear ( ) ; } if ( _isStorageManaged && ( _itemCacheManagedReference != NULL_CACHE_REF ) ) { _itemCache . unmanage ( this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "release item(" + getID ( ) + ":" + _inMemoryItemSize + ") new cacheSize = " + _itemCache . getCurrentSize ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "releaseItem" ) ; } | Releases all references to the item as a result of the final removal of the item from the MS |
164,732 | public final void releaseIfDiscardable ( ) throws SevereMessageStoreException { boolean unlink = false ; if ( isStoreNever ( ) ) { synchronized ( this ) { if ( ItemLinkState . STATE_AVAILABLE == _itemLinkState ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "removing STORE_NEVER item as a result of discard" ) ; ListStatistics stats = getParentStatistics ( ) ; synchronized ( stats ) { stats . decrementAvailable ( ) ; stats . decrementTotal ( _inMemoryItemSize ) ; } _itemLinkState = ItemLinkState . STATE_NOT_STORED ; unlink = true ; } } } if ( unlink ) { getMessageStoreImpl ( ) . unregister ( this ) ; unlink ( ) ; } } | This is the callback from the item cache to indicate that the discardable item should be freed . It s only used to remove STORE_NEVER items from the MS when the cache of these items is full . |
164,733 | public final AbstractItem removeIfMatches ( final Filter filter , PersistentTransaction transaction ) throws ProtocolException , TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeIfMatches" , new Object [ ] { filter , transaction } ) ; AbstractItem foundItem = cmdRemoveIfMatches ( filter , transaction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeIfMatches" , foundItem ) ; return foundItem ; } | remove the item if it matches and is available |
164,734 | private Lifecycle _getLifecycle ( FacesContext facesContext ) { LifecycleFactory factory = ( LifecycleFactory ) FactoryFinder . getFactory ( FactoryFinder . LIFECYCLE_FACTORY ) ; String id = facesContext . getExternalContext ( ) . getInitParameter ( FacesServlet . LIFECYCLE_ID_ATTR ) ; if ( id == null ) { id = LifecycleFactory . DEFAULT_LIFECYCLE ; } return factory . getLifecycle ( id ) ; } | Gets the current Lifecycle instance from the LifecycleFactory |
164,735 | private boolean locationInOutputDir ( String location ) { String expandedOutputLocation = cfgSvc . resolveString ( LibertyConstants . DEFAULT_OUTPUT_LOCATION ) ; return location . startsWith ( LibertyConstants . DEFAULT_OUTPUT_LOCATION ) || location . startsWith ( expandedOutputLocation ) ; } | Determines if the location is rooted in the server s output location . |
164,736 | private void setLocation ( String _location ) { String res = null ; File resFile = null ; boolean relativePath = true ; boolean defaultPath = false ; try { res = cfgSvc . resolveString ( _location ) ; resFile = new File ( res ) ; relativePath = ! resFile . isAbsolute ( ) ; } catch ( IllegalStateException e ) { } if ( resFile == null || ( ! resFile . isFile ( ) && relativePath ) ) { try { res = cfgSvc . resolveString ( LibertyConstants . DEFAULT_CONFIG_LOCATION + _location ) ; resFile = new File ( res ) ; } catch ( IllegalStateException e ) { } if ( resFile == null || ! resFile . isFile ( ) ) { try { res = cfgSvc . resolveString ( LibertyConstants . DEFAULT_OUTPUT_LOCATION + _location ) ; resFile = new File ( res ) ; defaultPath = true ; } catch ( IllegalStateException e ) { } } } if ( isDefault && ( defaultPath || locationInOutputDir ( _location ) ) ) { this . initializeAtStartup = true ; } if ( ( res != null && resFile . isFile ( ) ) || isDefault ) { this . location = res ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found store under [" + location + "]" ) ; } } else { Tr . warning ( tc , "ssl.keystore.not.found.warning" , res , name ) ; } } | Set the physical location of this store to the input value . This method will resolve all symbolic names in the location . If location is just a file name then we assume its location is the LibertyConstants . DEFAULT_CONFIG_LOCATION . |
164,737 | private void setFileBased ( Boolean flag ) { this . fileBased = flag ; setProperty ( Constants . SSLPROP_KEY_STORE_FILE_BASED , flag . toString ( ) ) ; } | Set the flag on whether this keystore is filebased or not to the input value . |
164,738 | private void setReadOnly ( Boolean flag ) { this . readOnly = flag ; setProperty ( Constants . SSLPROP_KEY_STORE_READ_ONLY , flag . toString ( ) ) ; } | Set the flag on whether this keystore is read only to the input flag . |
164,739 | private void setInitializeAtStartup ( Boolean flag ) { this . initializeAtStartup = flag ; setProperty ( Constants . SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP , flag . toString ( ) ) ; } | Set the flag on whether this keystore should initialize at startup . |
164,740 | public String getLocation ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getLocation -> " + location ) ; } return this . location ; } | Query the location of this keystore . |
164,741 | public long getPollingRate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getPollingRate returning " + pollingRate ) ; return this . pollingRate ; } | Query the monitor interval |
164,742 | public String getTrigger ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getTrigger returning " + trigger ) ; return this . trigger ; } | Query the file monitoring trigger |
164,743 | public KeyStore getKeyStore ( boolean reinitialize , boolean createIfNotPresent ) throws Exception { if ( myKeyStore == null || reinitialize ) { myKeyStore = do_getKeyStore ( reinitialize , createIfNotPresent ) ; } return myKeyStore ; } | Get the key store wrapped by this object . |
164,744 | public void store ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "store" ) ; try { String name = getProperty ( Constants . SSLPROP_KEY_STORE_NAME ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Storing KeyStore " + name ) ; String SSLKeyFile = getProperty ( Constants . SSLPROP_KEY_STORE ) ; String SSLKeyPassword = decodePassword ( getProperty ( Constants . SSLPROP_KEY_STORE_PASSWORD ) ) ; String SSLKeyStoreType = getProperty ( Constants . SSLPROP_KEY_STORE_TYPE ) ; boolean readOnly = Boolean . parseBoolean ( getProperty ( Constants . SSLPROP_KEY_STORE_READ_ONLY ) ) ; boolean fileBased = Boolean . parseBoolean ( getProperty ( Constants . SSLPROP_KEY_STORE_FILE_BASED ) ) ; String SSLKeyStoreStash = getProperty ( Constants . SSLPROP_KEY_STORE_CREATE_CMS_STASH ) ; KeyStore ks = getKeyStore ( false , false ) ; if ( ks != null && ! readOnly ) { if ( fileBased ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Storing filebased keystore type " + SSLKeyStoreType ) ; String keyStoreLocation = SSLKeyFile ; String keyStorePassword = SSLKeyPassword ; final FileOutputStream fos = new FileOutputStream ( keyStoreLocation ) ; try { ks . store ( fos , keyStorePassword . toCharArray ( ) ) ; } finally { fos . close ( ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Storing non-filebased keystore type " + SSLKeyStoreType ) ; String keyStoreLocation = SSLKeyFile ; String keyStorePassword = SSLKeyPassword ; URL ring = new URL ( keyStoreLocation ) ; URLConnection ringConnect = ring . openConnection ( ) ; final OutputStream fos = ringConnect . getOutputStream ( ) ; try { ks . store ( fos , keyStorePassword . toCharArray ( ) ) ; } finally { fos . close ( ) ; } } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception storing KeyStore; " + e ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "store" , this ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "store" ) ; } | Store the current information into the wrapped keystore . |
164,745 | public void initializeKeyStore ( boolean reinitialize ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "initializeKeyStore" ) ; try { String initAtStartup = getProperty ( Constants . SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP ) ; boolean createIfMissing = LibertyConstants . DEFAULT_KEYSTORE_REF_ID . equals ( getProperty ( "id" ) ) ; if ( Boolean . parseBoolean ( initAtStartup ) || reinitialize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Initializing keystore at startup." ) ; getKeyStore ( reinitialize , createIfMissing ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception initializing KeyStore; " + e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "initializeKeyStore" ) ; } | Initialize the wrapped keystore . |
164,746 | public void provideExpirationWarnings ( int daysBeforeExpireWarning , String keyStoreName ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "provideExpirationWarnings" , Integer . valueOf ( daysBeforeExpireWarning ) ) ; KeyStore keystore = getKeyStore ( false , false ) ; if ( keystore != null ) { try { Enumeration < String > e = keystore . aliases ( ) ; if ( e != null ) { for ( ; e . hasMoreElements ( ) ; ) { String alias = e . nextElement ( ) ; if ( null == alias ) continue ; Certificate [ ] cert_chain = keystore . getCertificateChain ( alias ) ; if ( null == cert_chain ) continue ; for ( int i = 0 ; i < cert_chain . length ; i ++ ) { printWarning ( daysBeforeExpireWarning , keyStoreName , alias , ( X509Certificate ) cert_chain [ i ] ) ; } } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception validating KeyStore expirations; " + e ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "provideExpirationWarnings" , this ) ; throw e ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "provideExpirationWarnings" ) ; } | Cycle through the keystore looking for expired certificates . Print a warning for any certificates that are expired or will expire during the input interval . |
164,747 | public void printWarning ( int daysBeforeExpireWarning , String keyStoreName , String alias , X509Certificate cert ) { try { long millisDelta = ( ( ( ( daysBeforeExpireWarning * 24L ) * 60L ) * 60L ) * 1000L ) ; long millisBeforeExpiration = cert . getNotAfter ( ) . getTime ( ) - System . currentTimeMillis ( ) ; long daysLeft = ( ( ( ( millisBeforeExpiration / 1000L ) / 60L ) / 60L ) / 24L ) ; if ( millisBeforeExpiration < 0 ) { Tr . error ( tc , "ssl.expiration.expired.CWPKI0017E" , new Object [ ] { alias , keyStoreName } ) ; } else if ( millisBeforeExpiration < millisDelta ) { Tr . warning ( tc , "ssl.expiration.warning.CWPKI0016W" , new Object [ ] { alias , keyStoreName , Long . valueOf ( daysLeft ) } ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "The certificate with alias " + alias + " from keyStore " + keyStoreName + " has " + daysLeft + " days left before expiring." ) ; } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Exception reading KeyStore certificates during expiration check; " + e ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "printWarning" , this ) ; } } | Print a warning about a certificate being expired or soon to be expired in the keystore . |
164,748 | public static InputStream openKeyStore ( String fileName ) throws MalformedURLException , IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "openKeyStore: " + fileName ) ; URL urlFile = null ; File kfile = new File ( fileName ) ; if ( kfile . exists ( ) && kfile . length ( ) == 0 ) { throw new IOException ( "Keystore file exists, but is empty: " + fileName ) ; } else if ( ! kfile . exists ( ) ) { urlFile = new URL ( fileName ) ; } else { urlFile = new URL ( "file:" + kfile . getCanonicalPath ( ) ) ; } InputStream fis = urlFile . openStream ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "openKeyStore: " + ( null != fis ) ) ; return fis ; } | The purpose of this method is to open the passed in file which represents the key store . |
164,749 | public void setCertificateEntry ( String alias , Certificate cert ) throws KeyStoreException , KeyException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "setCertificateEntry" , new Object [ ] { alias , cert } ) ; } if ( Boolean . parseBoolean ( getProperty ( Constants . SSLPROP_KEY_STORE_READ_ONLY ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Unable to update readonly store" ) ; } throw new KeyStoreException ( "Unable to add to read-only store" ) ; } final KeyStoreManager mgr = KeyStoreManager . getInstance ( ) ; try { KeyStore jKeyStore = getKeyStore ( false , false ) ; if ( null == jKeyStore ) { final String keyStoreLocation = getProperty ( Constants . SSLPROP_KEY_STORE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Cannot load the Java keystore at location \"" + keyStoreLocation + "\"" ) ; } throw new KeyStoreException ( "Cannot load the Java keystore at location \"" + keyStoreLocation + "\"" ) ; } jKeyStore . setCertificateEntry ( alias , cert ) ; try { store ( ) ; } catch ( IOException e ) { final String ksType = getProperty ( Constants . SSLPROP_KEY_STORE_TYPE ) ; if ( ( ksType . equals ( Constants . KEYSTORE_TYPE_JCERACFKS ) || ksType . equals ( Constants . KEYSTORE_TYPE_JCECCARACFKS ) || ksType . equals ( Constants . KEYSTORE_TYPE_JCEHYBRIDRACFKS ) ) ) { KeyStore ks = getKeyStore ( true , false ) ; if ( mgr . checkIfSignerAlreadyExistsInTrustStore ( ( X509Certificate ) cert , ks ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Certificate already exists in RACF: " + e . getMessage ( ) ) ; } } else { throw new KeyException ( e . getMessage ( ) , e ) ; } } else { throw new KeyException ( e . getMessage ( ) , e ) ; } } } catch ( KeyStoreException kse ) { throw kse ; } catch ( KeyException ke ) { throw ke ; } catch ( Exception e ) { throw new KeyException ( e . getMessage ( ) , e ) ; } AbstractJSSEProvider . clearSSLContextCache ( ) ; mgr . clearJavaKeyStoresFromKeyStoreMap ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "setCertificateEntry" ) ; } } | Set a new certificate into the keystore and save the updated store . |
164,750 | private SerializableProtectedString getKeyPassword ( String alias ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getKeyPassword " + alias ) ; SerializableProtectedString keyPass = certAliasInfo . get ( alias ) ; if ( keyPass != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getKeyPassword entry found." ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getKeyPassword -> null" ) ; } return keyPass ; } | Query the password of a key entry in this keystore . |
164,751 | private void validateServerVariables ( ValidationHelper helper , Context context , Set < String > variables , Server t ) { ServerVariables serverVariables = t . getVariables ( ) ; for ( String variable : variables ) { if ( serverVariables == null || ! serverVariables . containsKey ( variable ) ) { final String message = Tr . formatMessage ( tc , "serverVariableNotDefined" , variable ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( "variables" ) , message ) ) ; } } } | Ensures that all the serverVariables are defined |
164,752 | private Set < String > validateURL ( ValidationHelper helper , Context context , String url ) { String pathToCheck = url ; Set < String > serverVariables = new HashSet < String > ( ) ; while ( pathToCheck . contains ( "{" ) ) { if ( ! pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "serverInvalidURL" , pathToCheck ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( "url" ) , message ) ) ; return serverVariables ; } int firstIndex = pathToCheck . indexOf ( "{" ) ; int lastIndex = pathToCheck . indexOf ( "}" ) ; if ( firstIndex > lastIndex ) { final String message = Tr . formatMessage ( tc , "serverInvalidURL" , pathToCheck ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( "url" ) , message ) ) ; return serverVariables ; } String variable = pathToCheck . substring ( firstIndex + 1 , lastIndex ) ; if ( variable . isEmpty ( ) || variable . contains ( "{" ) || variable . contains ( "/" ) ) { final String message = Tr . formatMessage ( tc , "serverInvalidURL" , pathToCheck ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( "url" ) , message ) ) ; return serverVariables ; } serverVariables . add ( variable ) ; pathToCheck = pathToCheck . substring ( lastIndex + 1 ) ; } if ( pathToCheck . contains ( "}" ) ) { final String message = Tr . formatMessage ( tc , "serverInvalidURL" , pathToCheck ) ; helper . addValidationEvent ( new ValidationEvent ( ValidationEvent . Severity . ERROR , context . getLocation ( "url" ) , message ) ) ; return serverVariables ; } return serverVariables ; } | Validate the url and extract server variables parameters |
164,753 | public int findFirstEyeCatcher ( byte [ ] buffer , int off , int len ) { if ( off < 0 || off >= buffer . length ) { throw new IllegalArgumentException ( "Offset should be in the buffer boundaries" ) ; } if ( off + len > buffer . length ) { len = buffer . length - off ; } int p = off + EYE_CATCHER . length - 1 ; for ( int i = EYE_CATCHER . length - 1 ; i >= 0 ; i -- , p -- ) { if ( p >= off + len ) { return - 1 ; } byte b = buffer [ p ] ; if ( b != EYE_CATCHER [ i ] ) { if ( i == EYE_CATCHER . length - 1 ) { for ( i -- ; i >= 0 ; i -- ) { if ( b == EYE_CATCHER [ i ] ) { break ; } } p += EYE_CATCHER . length - i ; } else { p += EYE_CATCHER . length * 2 - i ; } i = EYE_CATCHER . length ; } } return p + 1 ; } | assumption that the EYE_CATCHER does not have repeatable bytes . |
164,754 | private void initialize ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "initialize" ) ; subsets = new ReliabilitySubset [ maxReliabilityIndex + 1 ] ; subsetIDs = new long [ maxReliabilityIndex + 1 ] ; for ( int i = 0 ; i < subsetIDs . length ; i ++ ) { subsetIDs [ i ] = NO_ID ; } createControlAdapter ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initialize" ) ; } | Initialize some arrays |
164,755 | protected void setStream ( int priority , Reliability reliability , Stream stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setStream" , new Object [ ] { new Integer ( priority ) , reliability , stream } ) ; ReliabilitySubset subset = getSubset ( reliability ) ; subset . setStream ( priority , stream ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setStream" ) ; } | Set an element in the stream array |
164,756 | public void updateCellule ( SIBUuid8 newRemoteMEUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "updateCellule" , newRemoteMEUuid ) ; this . remoteMEUuid = newRemoteMEUuid ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "updateCellule" ) ; } | This method should only be called when the streamSet was created with an unknown targetCellule and WLM has now told us correct targetCellule . This can only happen when the SourceStreamManager is owned by a PtoPOuptuHandler within a LinkHandler |
164,757 | private ReliabilitySubset createPersistentSubset ( Reliability reliability , TransactionCommon tran ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createPersistentSubset" , new Object [ ] { reliability } ) ; ReliabilitySubset subset = new ReliabilitySubset ( reliability , initialData ) ; subsets [ getIndex ( reliability ) ] = subset ; if ( reliability . compareTo ( Reliability . BEST_EFFORT_NONPERSISTENT ) > 0 ) { try { Transaction msTran = txManager . resolveAndEnlistMsgStoreTransaction ( tran ) ; itemStream . addItem ( subset , msTran ) ; subsetIDs [ getIndex ( reliability ) ] = subset . getID ( ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.gd.StreamSet.createPersistentSubset" , "1:398:1.67" , this ) ; subsetIDs [ getIndex ( reliability ) ] = NO_ID ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createPersistentSubset" , e ) ; } } } else { subsetIDs [ getIndex ( reliability ) ] = NO_ID ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createPersistentSubset" , subset ) ; return subset ; } | Create a new ReliabilitySubset for the given reliability . If it is not express store it in the message store and record the message store ID . |
164,758 | private void createNonPersistentSubsets ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createNonPersistentSubsets" ) ; for ( int i = 0 ; i < subsets . length ; i ++ ) { createNonPersistentSubset ( getReliability ( i ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNonPersistentSubsets" ) ; } | Create all the ReliabilitySubsets non persistently . |
164,759 | private ReliabilitySubset createNonPersistentSubset ( Reliability reliability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNonPersistentSubset" , new Object [ ] { reliability } ) ; ReliabilitySubset subset = new ReliabilitySubset ( reliability , initialData ) ; subsets [ getIndex ( reliability ) ] = subset ; subsetIDs [ getIndex ( reliability ) ] = NO_ID ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNonPersistentSubset" , subset ) ; return subset ; } | Create a new ReliabilitySubset for the given Reliability but do not persist it . |
164,760 | public Stream getStream ( int priority , Reliability reliability ) throws SIResourceException { return getSubset ( reliability ) . getStream ( priority ) ; } | Get a specific stream based on priority and reliability |
164,761 | public SIBUuid12 getDestUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getDestUuid" ) ; SibTr . exit ( tc , "getDestUuid" , destID ) ; } return destID ; } | Get the destination Uuid |
164,762 | protected void setDestUuid ( SIBUuid12 destID ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestUuid" , destID ) ; this . destID = destID ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestUuid" ) ; } | Set the destination Uuid |
164,763 | public SIBUuid8 getBusUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getBusUuid" ) ; SibTr . exit ( tc , "getBusUuid" , busID ) ; } return busID ; } | Get the bus Uuid |
164,764 | public boolean isPersistent ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isPersistent" ) ; SibTr . exit ( tc , "isPersistent" , Boolean . valueOf ( persistent ) ) ; } return persistent ; } | Get the persistence of this StreamSet |
164,765 | public SIBUuid12 getStreamID ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getStreamID" ) ; SibTr . exit ( tc , "getStreamID" , streamID ) ; } return streamID ; } | Get the stream ID for this protocol item . |
164,766 | protected void setPersistentData ( int priority , Reliability reliability , long completedPrefix ) throws SIResourceException { getSubset ( reliability ) . setPersistentData ( priority , completedPrefix ) ; } | Set the persistent data for a specific stream |
164,767 | protected long getPersistentData ( int priority , Reliability reliability ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getPersistentData" , new Object [ ] { new Integer ( priority ) , reliability } ) ; long prefix = getSubset ( reliability ) . getPersistentData ( priority ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getPersistentData" , new Long ( prefix ) ) ; return prefix ; } | Get the persistent data for a specific stream |
164,768 | private boolean isOverFileLimit ( int addition ) { if ( LogFile . UNLIMITED == getMaximumSize ( ) ) { return false ; } long newlen = this . myFile . length ( ) + addition ; return ( newlen > getMaximumSize ( ) || 0 > newlen ) ; } | Query whether the input amount will push the log file over the maximum allowed size . |
164,769 | private void renameFile ( File source , File target ) { if ( ! source . exists ( ) ) { return ; } if ( target . exists ( ) ) { target . delete ( ) ; } boolean rc = source . renameTo ( target ) ; if ( ! rc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , getFileName ( ) + ": Unable to rename " + source + " to " + target ) ; } } } | Rename the source file into the target file deleting the target if necessary . |
164,770 | private void addBackup ( ) { String newname = this . fileinfo + this . myFormat . format ( new Date ( HttpDispatcher . getApproxTime ( ) ) ) + this . extensioninfo ; File newFile = new File ( newname ) ; renameFile ( this . myFile , newFile ) ; if ( this . backups . size ( ) == getMaximumBackupFiles ( ) ) { File oldest = this . backups . removeLast ( ) ; if ( null != oldest && oldest . exists ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , getFileName ( ) + ": Purging oldest backup-> " + oldest . getName ( ) ) ; } oldest . delete ( ) ; } } this . backups . addFirst ( newFile ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , getFileName ( ) + ": number of backup files-> " + this . backups . size ( ) ) ; } } | Move the current logfile to a backup name taking care of any existing backup files according to the configured limit . |
164,771 | private void rotate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , getFileName ( ) + ": Rotating output log" ) ; } try { this . myChannel . close ( ) ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , getClass ( ) . getName ( ) + ".rotate" , "424" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , getFileName ( ) + ": Failed to close the output file; " + ioe ) ; } } try { if ( 0 < getMaximumBackupFiles ( ) ) { addBackup ( ) ; } this . myChannel = new FileOutputStream ( this . myFile , true ) . getChannel ( ) ; } catch ( SecurityException se ) { FFDCFilter . processException ( se , getClass ( ) . getName ( ) + ".rotate" , "436" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , getFileName ( ) + ": security error in rotate; " + se ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , getClass ( ) . getName ( ) + ".rotate" , "441" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , getFileName ( ) + ": error in rotate; " + t ) ; } } } | When the output file has reached it s maximum size this code will rotate the current log to a backup and get ready to start logging with a new file . |
164,772 | public static void binToHex ( byte [ ] bin , int start , int length , StringBuffer hex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "binToHex" , new Object [ ] { bin , Integer . valueOf ( start ) , Integer . valueOf ( length ) , hex } ) ; final char BIN2HEX [ ] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' } ; int binByte ; for ( int i = start ; i < start + length ; i ++ ) { binByte = bin [ i ] ; if ( binByte < 0 ) binByte += 256 ; hex . append ( BIN2HEX [ binByte / 16 ] ) ; hex . append ( BIN2HEX [ binByte % 16 ] ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "binToHex" , hex ) ; } | Converts a binary value held in a byte array into a hex string in the given StringBuffer using exactly two characters per byte of input . |
164,773 | public static String binToHex ( byte [ ] bin ) { StringBuffer hex = new StringBuffer ( ) ; binToHex ( bin , 0 , bin . length , hex ) ; return hex . toString ( ) ; } | Converts a binary value held in a byte array into a hex string . |
164,774 | public static byte [ ] hexToBin ( String hex , int start ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "hexToBin" , new Object [ ] { hex , Integer . valueOf ( start ) } ) ; int digit1 , digit2 ; int length = ( hex . length ( ) - start ) ; if ( length == 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hexToBin" ) ; return new byte [ 0 ] ; } if ( ( length < 0 ) || ( ( length % 2 ) != 0 ) ) { String nlsMsg = nls . getFormattedMessage ( "BAD_HEX_STRING_CWSIU0200" , new Object [ ] { hex } , "The hexadecimal string " + hex + " is incorrectly formatted." ) ; IllegalArgumentException e = new IllegalArgumentException ( nlsMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hexToBin" , e ) ; throw e ; } length /= 2 ; byte [ ] retval = new byte [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { digit1 = ( Character . digit ( hex . charAt ( 2 * i + start ) , 16 ) ) << 4 ; digit2 = Character . digit ( hex . charAt ( 2 * i + start + 1 ) , 16 ) ; if ( ( digit1 < 0 ) || ( digit2 < 0 ) ) { String nlsMsg = nls . getFormattedMessage ( "BAD_HEX_STRING_CWSIF0200" , new Object [ ] { hex } , "The hexadecimal string " + hex + " is incorrectly formatted." ) ; IllegalArgumentException e = new IllegalArgumentException ( nlsMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hexToBin" , e ) ; throw e ; } retval [ i ] = ( byte ) ( digit1 + digit2 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "hexToBin" ) ; return retval ; } | Converts a hex string into a byte array holding the binary value . This code is reused from MA88 . |
164,775 | public FilterCell findNextCell ( int nextValue ) { if ( nextCell == null ) { return null ; } return ( FilterCell ) ( nextCell . get ( nextValue ) ) ; } | Find the next cell for a given number which may come after this cell in the address tree . |
164,776 | static void rcvCloseProducerSess ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvCloseProducerSess" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool , "" + partOfExchange } ) ; ConversationState convState = ( ConversationState ) conversation . getAttachment ( ) ; short connectionObjectID = request . getShort ( ) ; short producerObjectID = request . getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "producerObjectID" , producerObjectID ) ; } ProducerSession producerSession = ( ( ProducerSession ) convState . getObject ( producerObjectID ) ) ; try { producerSession . close ( ) ; convState . removeObject ( producerObjectID ) ; try { conversation . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_CLOSE_PRODUCER_SESS_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvCloseProducerSess" , CommsConstants . STATICCATPRODUCER_CLOSE_01 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2024" , e ) ; } } catch ( SIException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . STATICCATPRODUCER_CLOSE_02 , conversation , requestNumber ) ; } request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvCloseProducerSess" ) ; } | Close the Synchronous Producer Session provided by the client . |
164,777 | static void rcvSendSessMsg ( CommsServerByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvSendSessMsg" ) ; final boolean optimizedTx = CommsUtils . requiresOptimizedTransaction ( conversation ) ; sendSessMsg ( request , conversation , requestNumber , partOfExchange , allocatedFromBufferPool , true , optimizedTx ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvSendSessMsg" ) ; } | Calls the internal send method that will send a message and inform the client as to the outcome . |
164,778 | RegistryEntry getRegistryEntry ( String pid ) { if ( pid == null ) { return null ; } return entryMap . get ( pid ) ; } | get the registry entry if any for the supplied pid which may be null |
164,779 | private void processReferencedTypes ( RegistryEntry pidEntry ) { for ( ExtendedAttributeDefinition ad : pidEntry . getAttributeMap ( ) . values ( ) ) { if ( ad . getType ( ) == MetaTypeFactory . PID_TYPE ) { if ( ad . getReferencePid ( ) != null ) { RegistryEntry other = getRegistryEntry ( ad . getReferencePid ( ) ) ; if ( other != null ) { PidReference ref = new PidReference ( other , pidEntry , ad . getID ( ) , true ) ; other . addReferencingEntry ( ref ) ; pidEntry . addReferencedEntry ( ref ) ; } } else if ( ad . getService ( ) != null ) { addServiceUse ( ad . getService ( ) , pidEntry ) ; } else { } } } if ( pidEntry . getObjectClassDefinition ( ) . getParentPID ( ) != null ) { RegistryEntry other = getRegistryEntry ( pidEntry . getObjectClassDefinition ( ) . getParentPID ( ) ) ; if ( other != null ) { pidEntry . addReferencingEntry ( new PidReference ( pidEntry , other , pidEntry . getChildAlias ( ) , false ) ) ; } } for ( RegistryEntry other : entryMap . values ( ) ) { if ( pidEntry . getPid ( ) . equals ( other . getObjectClassDefinition ( ) . getParentPID ( ) ) ) { other . addReferencingEntry ( new PidReference ( other , pidEntry , other . getChildAlias ( ) , false ) ) ; } for ( ExtendedAttributeDefinition ad : other . getAttributeMap ( ) . values ( ) ) { if ( ad . getType ( ) == MetaTypeFactory . PID_TYPE ) { if ( pidEntry . getPid ( ) . equals ( ad . getReferencePid ( ) ) ) { pidEntry . addReferencingEntry ( new PidReference ( pidEntry , other , ad . getID ( ) , true ) ) ; } } } } } | Keeps track of which OCDs are referenced by a PID type attribute in another OCD |
164,780 | protected final void unLock ( ObjectManagerState objectManagerState ) { synchronized ( objectManagerState . transactionUnlockSequenceLock ) { unlockSequence = objectManagerState . getNewGlobalTransactionUnlockSequence ( ) ; lockingTransaction = null ; } } | Releases the lock on the transaction . |
164,781 | protected void validateCertificate ( X509Certificate [ ] chain ) throws com . ibm . wsspi . security . wim . exception . CertificateMapFailedException { if ( chain == null || chain . length == 0 ) { throw new com . ibm . wsspi . security . wim . exception . CertificateMapFailedException ( ) ; } for ( X509Certificate cert : chain ) { if ( cert == null ) { throw new com . ibm . wsspi . security . wim . exception . CertificateMapFailedException ( ) ; } } } | Validate an X509 certificate array . |
164,782 | protected IDAndRealm separateIDAndRealm ( String inputString ) throws WIMException { String methodName = "seperateIDAndRealm" ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " " + "inputString = \"" + inputString + "\"" ) ; } String defaultRealm = getDefaultRealmName ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " " + "Default realm name = \"" + defaultRealm + "\"" ) ; } String defaultRealmDelimiter = getCoreConfiguration ( ) . getDefaultDelimiter ( ) ; Set < String > virtualRealms = getCoreConfiguration ( ) . getRealmNames ( ) ; Map < String , String > virtualRealmsDelimiter = new HashMap < String , String > ( ) ; for ( Iterator < String > itr = virtualRealms . iterator ( ) ; itr . hasNext ( ) ; ) { String virtualRealm = itr . next ( ) ; String delimiter = getCoreConfiguration ( ) . getDelimiter ( virtualRealm ) ; virtualRealmsDelimiter . put ( virtualRealm , delimiter ) ; } if ( virtualRealms . size ( ) == 0 ) { virtualRealms = new HashSet ( ) ; virtualRealms . add ( defaultRealm ) ; virtualRealmsDelimiter . put ( defaultRealm , defaultRealmDelimiter ) ; } return seperateIDAndRealm ( inputString , defaultRealm , defaultRealmDelimiter , virtualRealms , virtualRealmsDelimiter ) ; } | Separate the ID and realm from an input String . |
164,783 | public boolean isIdentifierTypeProperty ( String inputProperty ) { boolean returnValue = false ; if ( ( inputProperty != null ) && ( ( inputProperty . equals ( Service . PROP_UNIQUE_ID ) ) || ( inputProperty . equals ( Service . PROP_UNIQUE_NAME ) ) || ( inputProperty . equals ( Service . PROP_EXTERNAL_ID ) ) || ( inputProperty . equals ( Service . PROP_EXTERNAL_NAME ) ) ) ) { returnValue = true ; } return returnValue ; } | Test to see if a property is an IdentifierType property . |
164,784 | protected void createRealmDataObject ( Root inputRootObject , String inputRealm ) { List < Context > contexts = inputRootObject . getContexts ( ) ; if ( contexts != null ) { Context ctx = new Context ( ) ; ctx . setKey ( Service . VALUE_CONTEXT_REALM_KEY ) ; ctx . setValue ( inputRealm ) ; contexts . add ( ctx ) ; } } | Create a DataObject for the realm context . |
164,785 | protected void createPropertyControlDataObject ( Root inputRootDataObject , String inputProperty ) { List < Control > propertyControls = inputRootDataObject . getControls ( ) ; PropertyControl propCtrl = null ; if ( propertyControls != null ) { propCtrl = new PropertyControl ( ) ; propertyControls . add ( propCtrl ) ; } if ( propCtrl != null ) { propCtrl . getProperties ( ) . add ( inputProperty ) ; } } | Create a DataObject for the property request . |
164,786 | protected String getRealInputAttrName ( String inputAttrName , String id , boolean isUser ) { boolean isInputAttrValueDN = UniqueNameHelper . isDN ( id ) != null ; boolean isInputAttrIdentifier = isIdentifierTypeProperty ( inputAttrName ) ; if ( ! isInputAttrIdentifier && isInputAttrValueDN ) { inputAttrName = "uniqueName" ; } else if ( isInputAttrIdentifier && ! isInputAttrValueDN ) { if ( isUser ) { inputAttrName = "principalName" ; } else { inputAttrName = "cn" ; } } return inputAttrName ; } | get input securityName . |
164,787 | public String getDefaultRealmName ( ) { String returnRealm = getCoreConfiguration ( ) . getDefaultRealmName ( ) ; if ( returnRealm == null ) { returnRealm = urRealmName ; } return returnRealm ; } | Method to return the default realm |
164,788 | private final Properties loadPropertiesFile ( WsResource res ) throws IOException { Properties props = new Properties ( ) ; InputStream is = res . get ( ) ; try { props . load ( is ) ; } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Error loading properties; " + e ) ; } throw e ; } finally { if ( is != null ) try { is . close ( ) ; } catch ( IOException e ) { } } return props ; } | Load the contents of the properties file . |
164,789 | final WsResource getLTPAKeyFileResource ( WsLocationAdmin locService , String ltpaKeyFile ) { WsResource ltpaFile = locService . resolveResource ( ltpaKeyFile ) ; if ( ltpaFile != null && ltpaFile . exists ( ) ) { return ltpaFile ; } else { return null ; } } | Given the path to the LTPA key file return the WsResource for the file if the file exists . |
164,790 | void cleanupBoxedCache ( int boxedAccessor ) { for ( int i = 0 ; i < boxedCache . length ; i ++ ) if ( boxed [ i ] [ 0 ] == boxedAccessor ) boxedCache [ i ] = null ; } | Remove entries from the boxedCache after removing the entry from the main cache that they depend upon . |
164,791 | private JSON getJSON ( ) throws JSONMarshallException { if ( json == null ) { JSONSettings settings = new JSONSettings ( Include . NON_NULL ) ; json = JSONFactory . newInstance ( settings ) ; } return json ; } | Utility that returns a JSON object from a factory |
164,792 | public void setSubscriptionIDFilter ( String subscriptionId ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setSubscriptionIDFilter" , subscriptionId ) ; this . _subscriptionId = subscriptionId ; this . _destination = null ; this . _consumerDispatcherState = null ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setSubscriptionIDFilter" ) ; } | setter to create a filter based on subscriptionId |
164,793 | public void setDestinationFilter ( SIBUuid12 destination ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestinationFilter" , destination ) ; this . _destination = destination ; this . _subscriptionId = null ; this . _consumerDispatcherState = null ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setDestinationFilter" ) ; } | setter to create a filter based on destination name |
164,794 | public void setConsumerDispatcherStateFilter ( ConsumerDispatcherState consumerDispatcherState ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setConsumerDispatcherStateFilter" , consumerDispatcherState ) ; this . _consumerDispatcherState = consumerDispatcherState ; this . _subscriptionId = null ; this . _destination = null ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setConsumerDispatcherStateFilter" ) ; } | setter to create a filter based on a specific consumer dispatcher state object |
164,795 | public boolean filterMatches ( AbstractItem item ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "filterMatches" , item ) ; ConsumerDispatcherState subState = null ; if ( item instanceof DurableSubscriptionItemStream ) { try { subState = ( ( DurableSubscriptionItemStream ) item ) . getConsumerDispatcherState ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.filters.SubscriptionStateFilter.filterMatches" , "1:180:1.33.1.1" , this ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , e ) ; return false ; } if ( _subscriptionId != null ) { boolean retval = ( subState . getSubscriberID ( ) . equals ( _subscriptionId ) ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } if ( _destination != null ) { boolean retval = ( subState . getTopicSpaceUuid ( ) . equals ( _destination ) ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } if ( _consumerDispatcherState != null ) { boolean retval = ( subState == _consumerDispatcherState ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . valueOf ( retval ) ) ; return retval ; } if ( ( _destination == null ) && ( _subscriptionId == null ) && ( _consumerDispatcherState == null ) ) { if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . TRUE ) ; return true ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "filterMatches" , Boolean . FALSE ) ; return false ; } | Callback method from messagestore |
164,796 | public boolean matchesToMicros ( LibertyVersion other ) { if ( other == null ) { return true ; } return this . major == other . major && this . minor == other . minor && this . micro == other . micro ; } | Matches the major minor and micro parts of this version to the other version |
164,797 | public void putCustomizedProperty ( String key , Object obj ) { if ( key == null || obj == null ) return ; customizedProperties . put ( key , obj ) ; } | put anything here such as J2EEName |
164,798 | PartialMatch newPartialMatch ( char [ ] key , PartialMatch pm ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "newPartialMatch" , "key: " + new String ( key ) + ", pm:" + pm ) ; PartialMatch ans = new PartialMatch ( key , pm , owner ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "newPartialMatch" , ans ) ; return ans ; } | An overrideable wrapper for the internal constructor |
164,799 | void put ( PatternWrapper pattern , Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "put" , new Object [ ] { pattern , selector , object , subExpr } ) ; switch ( pattern . getState ( ) ) { case PatternWrapper . FINAL_EXACT : exactChild = owner . nextMatcher ( selector , exactChild ) ; exactChild . put ( selector , object , subExpr ) ; break ; case PatternWrapper . FINAL_MANY : if ( hasMidClauses ( pattern ) ) { ContentMatcher next = null ; MatchManyWrapper wrapper = findMatchManyWrapper ( pattern ) ; if ( wrapper != null ) next = wrapper . matcher ; ContentMatcher newNext = owner . nextMatcher ( selector , next ) ; if ( newNext != next ) { if ( matchManyChildren == null ) matchManyChildren = new ArrayList ( 3 ) ; MatchManyWrapper matchManyElement = new MatchManyWrapper ( pattern , newNext ) ; matchManyChildren . add ( matchManyElement ) ; } newNext . put ( selector , object , subExpr ) ; } else { singleMatchManyChild = owner . nextMatcher ( selector , singleMatchManyChild ) ; singleMatchManyChild . put ( selector , object , subExpr ) ; } break ; case PatternWrapper . PREFIX_CHARS : case PatternWrapper . SUFFIX_CHARS : PartialMatch pm = findOrCreate ( pattern . getChars ( ) ) ; pm . put ( pattern , selector , object , subExpr ) ; break ; case PatternWrapper . SKIP_ONE_PREFIX : case PatternWrapper . SKIP_ONE_SUFFIX : if ( matchOneChild == null ) matchOneChild = newPartialMatch ( ) ; pattern . advance ( ) ; matchOneChild . put ( pattern , selector , object , subExpr ) ; break ; case PatternWrapper . SWITCH_TO_SUFFIX : if ( suffix == null ) suffix = newPartialMatch ( ) ; pattern . advance ( ) ; suffix . put ( pattern , selector , object , subExpr ) ; break ; } if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "put" ) ; } | Put a new Pattern or part thereof into this PartialMatch or its down - chain peers |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.