idx
int64 0
165k
| question
stringlengths 73
5.81k
| target
stringlengths 5
918
|
---|---|---|
162,100 | Object insertByLeftShift ( int ix , Object new1 ) { Object old1 = leftMostKey ( ) ; leftShift ( ix ) ; _nodeKey [ ix ] = new1 ; if ( midPoint ( ) > rightMostIndex ( ) ) _nodeKey [ midPoint ( ) ] = rightMostKey ( ) ; return old1 ; } | Insert a new key by overlaying the left - most key shifting other keys left and inserting the new key at the appropriate insert point . |
162,101 | private void leftShift ( int ix ) { for ( int j = 0 ; j < ix ; j ++ ) _nodeKey [ j ] = _nodeKey [ j + 1 ] ; } | Open up a slot in a node by shifting the keys left . |
162,102 | Object insertByRightShift ( int ix , Object new1 ) { Object old1 = null ; if ( isFull ( ) ) { old1 = rightMostKey ( ) ; rightMove ( ix + 1 ) ; _nodeKey [ ix + 1 ] = new1 ; } else { rightShift ( ix + 1 ) ; _nodeKey [ ix + 1 ] = new1 ; _population ++ ; if ( midPoint ( ) > rightMostIndex ( ) ) _nodeKey [ midPoint ( ) ] = rightMostKey ( ) ; } return old1 ; } | Insert a new key by shifting keys right . |
162,103 | Object addRightMostKey ( Object new1 ) { Object old1 = null ; if ( isFull ( ) ) { old1 = rightMostKey ( ) ; _nodeKey [ rightMostIndex ( ) ] = new1 ; } else { _population ++ ; _nodeKey [ rightMostIndex ( ) ] = new1 ; if ( midPoint ( ) > rightMostIndex ( ) ) _nodeKey [ midPoint ( ) ] = rightMostKey ( ) ; } return old1 ; } | Add the right - most key to the node . |
162,104 | void fillFromRight ( ) { int gapWid = width ( ) - population ( ) ; int gidx = population ( ) ; GBSNode p = rightChild ( ) ; for ( int j = 0 ; j < gapWid ; j ++ ) _nodeKey [ j + gidx ] = p . _nodeKey [ j ] ; int delta = gapWid ; if ( p . _population < delta ) delta = p . _population ; _population += delta ; p . _population -= delta ; for ( int j = 0 ; j < gidx ; j ++ ) p . _nodeKey [ j ] = p . _nodeKey [ j + gapWid ] ; } | Fill a node with new keys from the right side . |
162,105 | GBSNode rightMostChild ( ) { GBSNode q = this ; GBSNode p = rightChild ( ) ; while ( p != null ) { q = p ; p = p . rightChild ( ) ; } return q ; } | Find the right - most child of a node by following the paths of all of the right - most children all the way to the bottom of the tree . |
162,106 | private void rightShift ( int ix ) { for ( int j = rightMostIndex ( ) ; j >= ix ; j -- ) _nodeKey [ j + 1 ] = _nodeKey [ j ] ; } | Open up a slot for a new key by shifting keys right to make room . |
162,107 | private void rightMove ( int ix ) { for ( int j = rightMostIndex ( ) - 1 ; j >= ix ; j -- ) _nodeKey [ j + 1 ] = _nodeKey [ j ] ; } | Open up a slot for a new key by shifting keys right to make room and overlaying the right - most key . |
162,108 | void overlayLeftShift ( int ix ) { for ( int j = ix ; j < rightMostIndex ( ) ; j ++ ) _nodeKey [ j ] = _nodeKey [ j + 1 ] ; } | Overlay a key to be deleted by moving keys left . |
162,109 | private void overlayRightShift ( int ix ) { for ( int j = ix ; j > 0 ; j -- ) _nodeKey [ j ] = _nodeKey [ j - 1 ] ; } | Overlay a key to be deleted by moving keys right . |
162,110 | GBSNode lowerPredecessor ( NodeStack stack ) { GBSNode r = leftChild ( ) ; GBSNode lastr = r ; if ( r != null ) stack . push ( NodeStack . PROCESS_CURRENT , this ) ; while ( r != null ) { if ( r . rightChild ( ) != null ) stack . push ( NodeStack . DONE_VISITS , r ) ; lastr = r ; r = r . rightChild ( ) ; } return lastr ; } | Find the lower predecessor of this node . |
162,111 | public boolean validate ( ) { boolean correct = true ; if ( population ( ) > 1 ) { java . util . Comparator comp = index ( ) . insertComparator ( ) ; int xcc = 0 ; for ( int i = 0 ; i < population ( ) - 1 ; i ++ ) { xcc = comp . compare ( _nodeKey [ i ] , _nodeKey [ i + 1 ] ) ; if ( ! ( xcc < 0 ) ) { System . out . println ( "Entry " + i + " not less than entry " + i + 1 ) ; correct = false ; } } } return correct ; } | Used by test code to make sure that all of the keys within a node are in the correct collating sequence . |
162,112 | public Set < String > getExtensionClasses ( ) { Set < String > serviceClazzes = new HashSet < > ( ) ; if ( getType ( ) == ArchiveType . WEB_MODULE ) { Resource webInfClassesMetaInfServicesEntry = getResource ( CDIUtils . WEB_INF_CLASSES_META_INF_SERVICES_CDI_EXTENSION ) ; serviceClazzes . addAll ( CDIUtils . parseServiceSPIExtensionFile ( webInfClassesMetaInfServicesEntry ) ) ; } Resource metaInfServicesEntry = getResource ( CDIUtils . META_INF_SERVICES_CDI_EXTENSION ) ; serviceClazzes . addAll ( CDIUtils . parseServiceSPIExtensionFile ( metaInfServicesEntry ) ) ; return serviceClazzes ; } | Get hold of the extension class names from the file of META - INF \ services \ javax . enterprise . inject . spi . Extension |
162,113 | public BeanDiscoveryMode getBeanDiscoveryMode ( CDIRuntime cdiRuntime , BeansXml beansXml ) { BeanDiscoveryMode mode = BeanDiscoveryMode . ANNOTATED ; if ( beansXml != null ) { mode = beansXml . getBeanDiscoveryMode ( ) ; } else if ( cdiRuntime . isImplicitBeanArchivesScanningDisabled ( this ) ) { mode = BeanDiscoveryMode . NONE ; } return mode ; } | Determine the bean deployment archive scanning mode If there is a beans . xml the bean discovery mode will be used . If there is no beans . xml the mode will be annotated unless the enableImplicitBeanArchives is configured as false via the server . xml . If there is no beans . xml and the enableImplicitBeanArchives attribute on cdi12 is configured to false the scanning mode is none . |
162,114 | public static void teardownClass ( ) throws Exception { try { if ( libertyServer != null ) { libertyServer . stopServer ( "CWIML4537E" ) ; } } finally { if ( ds != null ) { ds . shutDown ( true ) ; } } libertyServer . deleteFileFromLibertyInstallRoot ( "lib/features/internalfeatures/securitylibertyinternals-1.0.mf" ) ; } | Tear down the test . |
162,115 | private static void setupLibertyServer ( ) throws Exception { LDAPUtils . addLDAPVariables ( libertyServer ) ; Log . info ( c , "setUp" , "Starting the server... (will wait for userRegistry servlet to start)" ) ; libertyServer . copyFileToLibertyInstallRoot ( "lib/features" , "internalfeatures/securitylibertyinternals-1.0.mf" ) ; libertyServer . addInstalledAppForValidation ( "userRegistry" ) ; libertyServer . startServer ( c . getName ( ) + ".log" ) ; assertNotNull ( "Application userRegistry does not appear to have started." , libertyServer . waitForStringInLog ( "CWWKZ0001I:.*userRegistry" ) ) ; assertNotNull ( "Security service did not report it was ready" , libertyServer . waitForStringInLog ( "CWWKS0008I" ) ) ; assertNotNull ( "Server did not came up" , libertyServer . waitForStringInLog ( "CWWKF0011I" ) ) ; Log . info ( c , "setUp" , "Creating servlet connection the server" ) ; servlet = new UserRegistryServletConnection ( libertyServer . getHostname ( ) , libertyServer . getHttpDefaultPort ( ) ) ; if ( servlet . getRealm ( ) == null ) { Thread . sleep ( 5000 ) ; servlet . getRealm ( ) ; } emptyConfiguration = libertyServer . getServerConfiguration ( ) ; } | Setup the Liberty server . This server will start with very basic configuration . The tests will configure the server dynamically . |
162,116 | private static void setupldapServer ( ) throws Exception { ds = new InMemoryLDAPServer ( SUB_DN ) ; Entry entry = new Entry ( SUB_DN ) ; entry . addAttribute ( "objectclass" , "top" ) ; entry . addAttribute ( "objectclass" , "domain" ) ; ds . add ( entry ) ; entry = new Entry ( "ou=Test,o=ibm,c=us" ) ; entry . addAttribute ( "objectclass" , "organizationalunit" ) ; entry . addAttribute ( "ou" , "Test" ) ; ds . add ( entry ) ; entry = new Entry ( USER_BASE_DN ) ; entry . addAttribute ( "objectclass" , "organizationalunit" ) ; entry . addAttribute ( "ou" , "Test" ) ; entry . addAttribute ( "ou" , "TestUsers" ) ; ds . add ( entry ) ; entry = new Entry ( BAD_USER_BASE_DN ) ; entry . addAttribute ( "objectclass" , "organizationalunit" ) ; entry . addAttribute ( "ou" , "BadUsers" ) ; ds . add ( entry ) ; entry = new Entry ( "ou=Dev,o=ibm,c=us" ) ; entry . addAttribute ( "objectclass" , "organizationalunit" ) ; entry . addAttribute ( "ou" , "Dev" ) ; ds . add ( entry ) ; entry = new Entry ( GROUP_BASE_DN ) ; entry . addAttribute ( "objectclass" , "organizationalunit" ) ; entry . addAttribute ( "ou" , "Dev" ) ; entry . addAttribute ( "ou" , "DevGroups" ) ; ds . add ( entry ) ; entry = new Entry ( USER_DN ) ; entry . addAttribute ( "objectclass" , "inetorgperson" ) ; entry . addAttribute ( "uid" , USER ) ; entry . addAttribute ( "sn" , USER ) ; entry . addAttribute ( "cn" , USER ) ; entry . addAttribute ( "userPassword" , "password" ) ; ds . add ( entry ) ; entry = new Entry ( BAD_USER_DN ) ; entry . addAttribute ( "objectclass" , "inetorgperson" ) ; entry . addAttribute ( "uid" , BAD_USER ) ; entry . addAttribute ( "sn" , BAD_USER ) ; entry . addAttribute ( "cn" , BAD_USER ) ; entry . addAttribute ( "userPassword" , "password" ) ; ds . add ( entry ) ; entry = new Entry ( GROUP_DN ) ; entry . addAttribute ( "objectclass" , "groupofnames" ) ; entry . addAttribute ( "cn" , GROUP ) ; entry . addAttribute ( "member" , USER_DN ) ; entry . addAttribute ( "member" , BAD_USER_DN ) ; ds . add ( entry ) ; } | Configure the embedded LDAP server . |
162,117 | private Object syncGetValueFromBucket ( FastSyncHashBucket hb , int key , boolean remove ) { FastSyncHashEntry e = null ; FastSyncHashEntry last = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "syncGetValueFromBucket: key, remove " + key + " " + remove ) ; } synchronized ( hb ) { e = hb . root ; while ( e != null ) { if ( e . key == key ) { if ( remove ) { if ( last == null ) { hb . root = e . next ; } else { last . next = e . next ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "syncGetValueFromBucket: found value in bucket" ) ; } return e . value ; } last = e ; e = e . next ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "syncGetValueFromBucket-returned null" ) ; } return null ; } | Internal get from the table which is partially synchronized at the hash bucket level . |
162,118 | public Object put ( int key , Object value ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "put" ) ; } if ( value == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "value == null" ) ; } throw new NullPointerException ( "Missing value" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "key " + key ) ; } FastSyncHashBucket bucket = getBucket ( key ) ; Object retVal = syncGetValueFromBucket ( bucket , key , false ) ; if ( retVal != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "put: key is already defined in bucket...returning value from bucket and new key value will be discarded." ) ; return retVal ; } FastSyncHashEntry e = new FastSyncHashEntry ( key , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "put: put new key and value into bucket" ) ; } return syncPutIntoBucket ( bucket , e ) ; } | Put into the table if does not exist . |
162,119 | private Object syncPutIntoBucket ( FastSyncHashBucket hb , FastSyncHashEntry newEntry ) { FastSyncHashEntry e = null ; FastSyncHashEntry last = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "syncPutIntoBucket" ) ; } synchronized ( hb ) { e = hb . root ; while ( e != null ) { if ( e . key == newEntry . key ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "syncPutIntoBucket: key/hash pair is already in the bucket" ) ; } return e . value ; } last = e ; e = e . next ; } if ( last == null ) { if ( hb . root == null ) { hb . root = newEntry ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "syncPutIntoBucket: Adding new entry at the beginning (root)" ) ; } return newEntry . value ; } last = hb . root ; while ( last . next != null ) { last = last . next ; } } last . next = newEntry ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "syncPutIntoBucket: Adding new entry at the end" ) ; } return newEntry . value ; } } | Put synchronized into bucket . |
162,120 | public Object [ ] getAllEntryValues ( ) { List < Object > values = new ArrayList < Object > ( ) ; FastSyncHashBucket hb = null ; FastSyncHashEntry e = null ; for ( int i = 0 ; i < xVar ; i ++ ) { for ( int j = 0 ; j < yVar ; j ++ ) { hb = mainTable [ i ] [ j ] ; synchronized ( hb ) { e = hb . root ; while ( e != null ) { values . add ( e . value ) ; e = e . next ; } } } } return values . toArray ( ) ; } | This routine returns a snapshot of all the values in the hash table . |
162,121 | void removeSession ( JmsSessionImpl sess ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeSession" , sess ) ; synchronized ( stateLock ) { boolean res = sessions . remove ( sess ) ; unusedOrderingContexts . add ( sess . getOrderingContext ( ) ) ; if ( ! res && TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "session not found in list" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeSession" ) ; } | This method is used to remove a Session from the list of sessions held by the Connection . |
162,122 | protected int getState ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getState" ) ; int tempState ; synchronized ( stateLock ) { tempState = state ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getState" , state ) ; return tempState ; } | Returns the state . |
162,123 | protected void setState ( int newState ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setState" , newState ) ; synchronized ( stateLock ) { if ( ( newState == JmsInternalConstants . CLOSED ) || ( newState == JmsInternalConstants . STOPPED ) || ( newState == JmsInternalConstants . STARTED ) ) { state = newState ; stateLock . notifyAll ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setState" ) ; } | Sets the state . |
162,124 | protected void checkClosed ( ) throws JMSException { if ( getState ( ) == CLOSED ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "This Connection is closed." ) ; throw ( javax . jms . IllegalStateException ) JmsErrorUtils . newThrowable ( javax . jms . IllegalStateException . class , "CONNECTION_CLOSED_CWSIA0021" , null , tc ) ; } } | This method is called at the beginning of every method that should not work if the Connection has been closed . It prevents further execution by throwing a JMSException with a suitable I m closed message . |
162,125 | protected void fixClientID ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "fixClientID" ) ; synchronized ( stateLock ) { clientIDFixed = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "fixClientID" ) ; } | This method is called in order to mark that the clientID may not now change . |
162,126 | void unfixClientID ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unfixClientID" ) ; synchronized ( stateLock ) { clientIDFixed = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unfixClientID" ) ; } | This method is called in order to mark that the clientID may now change . |
162,127 | protected JmsJcaSession createJcaSession ( boolean transacted ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createJcaSession" , transacted ) ; JmsJcaSession jcaSess = null ; if ( jcaConnection != null ) { try { jcaSess = jcaConnection . createSession ( transacted ) ; } catch ( Exception e ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "JCA_CREATE_SESS_CWSIA0024" , null , e , "JmsConnectionImpl.createSession#1" , this , tc ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "jcaConnection is null, returning null jcaSess" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createJcaSession" , jcaSess ) ; return jcaSess ; } | Create a JCA Session . If this Connection contains a JCA Connection then use it to create a JCA Session . |
162,128 | protected void addTemporaryDestination ( JmsTemporaryDestinationInternal tempDest ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addTemporaryDestination" , System . identityHashCode ( tempDest ) ) ; synchronized ( temporaryDestinations ) { temporaryDestinations . add ( tempDest ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addTemporaryDestination" ) ; } | Add a TemporaryDestination to the list of temporary destinations created by sessions under this connection |
162,129 | protected void removeTemporaryDestination ( JmsTemporaryDestinationInternal tempDest ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeTemporaryDestination" , System . identityHashCode ( tempDest ) ) ; synchronized ( temporaryDestinations ) { temporaryDestinations . remove ( tempDest ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeTemporaryDestination" ) ; } | Remove a TemporaryDestination from the list of temporary destinations created by sessions under this connection |
162,130 | public OrderingContext allocateOrderingContext ( ) throws SIConnectionDroppedException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "allocateOrderingContext" ) ; OrderingContext oc = null ; synchronized ( stateLock ) { while ( oc == null && ! unusedOrderingContexts . isEmpty ( ) ) { oc = unusedOrderingContexts . remove ( 0 ) ; if ( oc . isProxyConnectionClosed ( ) ) { oc = null ; } } if ( oc == null ) { oc = coreConnection . createOrderingContext ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "allocateOrderingContext" , oc ) ; return oc ; } | Called by each session when it is created to get an ordering context for that session . |
162,131 | private static void initExceptionThreadPool ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initExceptionThreadPool" ) ; synchronized ( exceptionTPCreateSync ) { if ( exceptionThreadPool == null ) { int maxThreads = Integer . parseInt ( ApiJmsConstants . EXCEPTION_MAXTHREADS_DEFAULT_INT ) ; String maxThreadsStr = RuntimeInfo . getProperty ( ApiJmsConstants . EXCEPTION_MAXTHREADS_NAME_INT , ApiJmsConstants . EXCEPTION_MAXTHREADS_DEFAULT_INT ) ; try { maxThreads = Integer . parseInt ( maxThreadsStr ) ; } catch ( NumberFormatException e ) { SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , ApiJmsConstants . EXCEPTION_MAXTHREADS_NAME_INT + ": " + Integer . toString ( maxThreads ) ) ; exceptionThreadPool = new ThreadPool ( ApiJmsConstants . EXCEPTION_THREADPOOL_NAME_INT , 0 , maxThreads ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initExceptionThreadPool" ) ; } | PK59962 Ensure the existence of a single thread pool within the process |
162,132 | private void addClientId ( String clientId ) { if ( clientId == null ) return ; ConcurrentHashMap < String , Integer > clientIdTable = JmsFactoryFactoryImpl . getClientIdTable ( ) ; if ( clientIdTable . containsKey ( clientId ) ) { clientIdTable . put ( clientId , clientIdTable . get ( clientId ) . intValue ( ) + 1 ) ; } else { clientIdTable . put ( clientId , 1 ) ; } } | If there is no entry for the given Client Id in the clientIdTable then add it with count as 1 . If its already exists then just increment the counter value by 1 . |
162,133 | private void removeClientId ( String clientId ) { if ( clientId == null ) return ; ConcurrentHashMap < String , Integer > clientIdTable = JmsFactoryFactoryImpl . getClientIdTable ( ) ; if ( clientIdTable . containsKey ( clientId ) ) { int referenceCount = clientIdTable . get ( clientId ) . intValue ( ) ; if ( referenceCount == 1 ) { clientIdTable . remove ( clientId ) ; } else { clientIdTable . put ( clientId , clientIdTable . get ( clientId ) . intValue ( ) - 1 ) ; } } } | To remove the client id from client table . Whenever this method is called the counter of respective HashMap entry is decremented by one . If the count reaches 0 then that entry wil be removed from the clientIdTable . |
162,134 | public void initializeForAroundConstruct ( ManagedObjectContext managedObjectContext , Object [ ] interceptors , InterceptorProxy [ ] proxies ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "initializeForAroundConstruct : context = " + managedObjectContext + " interceptors = " + Arrays . toString ( interceptors ) + ", proxies = " + Arrays . toString ( proxies ) ) ; ivBean = null ; ivManagedObjectContext = managedObjectContext ; ivInterceptors = interceptors ; ivInterceptorProxies = proxies ; ivTimer = null ; } | Initialize a InvocationContext for AroundConstruct with an array of interceptor instances created for this bean instance and the interceptor proxies . |
162,135 | public Object doAroundInvoke ( InterceptorProxy [ ] proxies , Method businessMethod , Object [ ] parameters , EJSDeployedSupport s ) throws Exception { ivMethod = businessMethod ; ivParameters = parameters ; ivEJSDeployedSupport = s ; ivInterceptorProxies = proxies ; ivIsAroundConstruct = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doAroundInvoke for business method: " + ivMethod . getName ( ) ) ; } try { return doAroundInterceptor ( ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "doAroundInvoke for business method: " + ivMethod . getName ( ) ) ; } ivMethod = null ; ivParameters = null ; } } | Invoke each AroundInvoke interceptor methods for a specified business method of an EJB being invoked . |
162,136 | private Object doAroundInterceptor ( ) throws Exception { ivNextIndex = 0 ; ivNumberOfInterceptors = ivInterceptorProxies == null ? 0 : ivInterceptorProxies . length ; ivParametersModified = false ; return proceed ( ) ; } | Invoke each AroundInvoke or AroundConstruct interceptor methods |
162,137 | public void doLifeCycle ( InterceptorProxy [ ] proxies , EJBModuleMetaDataImpl mmd ) { ivMethod = null ; ivParameters = null ; ivInterceptorProxies = proxies ; ivNumberOfInterceptors = ivInterceptorProxies . length ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doLifeCycle, number of interceptors = " + ivNumberOfInterceptors ) ; } if ( ivNumberOfInterceptors > 0 ) { ivNextIndex = 0 ; try { proceed ( ) ; } catch ( Throwable t ) { lifeCycleExceptionHandler ( t , mmd ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "doLifeCycle" ) ; } } } } | d450431 - add appExceptionMap parameter . |
162,138 | private void lifeCycleExceptionHandler ( Throwable t , EJBModuleMetaDataImpl mmd ) { if ( t instanceof RuntimeException ) { RuntimeException rtex = ( RuntimeException ) t ; if ( mmd . getApplicationExceptionRollback ( rtex ) != null ) { InterceptorProxy w = ivInterceptorProxies [ ivNextIndex - 1 ] ; String lifeCycle = w . getMethodGenericString ( ) ; EJBException ex = ExceptionUtil . EJBException ( lifeCycle + " is not allowed to throw an application exception" , rtex ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "lifeCycleExceptionHandler throwing EJBException" , ex ) ; } throw ex ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "lifeCycleExceptionHandler is rethrowing RuntimeException " + "from lifecycle callback method: " + t , t ) ; } throw rtex ; } } else if ( t instanceof Error ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "lifeCycleExceptionHandler is rethrowing Error from " + "lifecycle callback method: " + t , t ) ; } throw ( Error ) t ; } else { InterceptorProxy w = ivInterceptorProxies [ ivNextIndex - 1 ] ; String lifeCycle = w . getMethodGenericString ( ) ; EJBException ex = ExceptionUtil . EJBException ( lifeCycle + " is not allowed to throw a checked exception" , t ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "lifeCycleExceptionHandler throwing EJBException" , ex ) ; } throw ex ; } } | d450431 - ensure runtime exception is not an application exception . |
162,139 | private void throwUndeclaredExceptionCause ( Throwable undeclaredException ) throws Exception { Throwable cause = undeclaredException . getCause ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "proceed unwrappering " + undeclaredException . getClass ( ) . getSimpleName ( ) + " : " + cause , cause ) ; if ( cause instanceof UndeclaredThrowableException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "proceed unwrappering " + cause . getClass ( ) . getSimpleName ( ) + " : " + cause , cause . getCause ( ) ) ; cause = cause . getCause ( ) ; } if ( cause instanceof RuntimeException ) { throw ( RuntimeException ) cause ; } else if ( cause instanceof Error ) { throw ( Error ) cause ; } else { throw ( Exception ) cause ; } } | Since some interceptor methods cannot throw Exception but the target method on the bean can throw application exceptions this method may be used to unwrap the application exception from either an InvocationTargetException or UndeclaredThrowableException . |
162,140 | protected void setCredentialProvider ( ServiceReference < CredentialProvider > ref ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Resetting unauthenticatedSubject as new CredentialProvider has been set" ) ; } synchronized ( unauthenticatedSubjectLock ) { unauthenticatedSubject = null ; } } | When CredentialProviders come and go reset the unauthenticated subject . |
162,141 | @ FFDCIgnore ( Exception . class ) public Subject getUnauthenticatedSubject ( ) { if ( unauthenticatedSubject == null ) { CredentialsService cs = credentialsServiceRef . getService ( ) ; String unauthenticatedUserid = cs . getUnauthenticatedUserid ( ) ; try { Subject subject = new Subject ( ) ; Hashtable < String , Object > hashtable = new Hashtable < String , Object > ( ) ; hashtable . put ( AttributeNameConstants . WSCREDENTIAL_SECURITYNAME , unauthenticatedUserid ) ; hashtable . put ( AttributeNameConstants . WSCREDENTIAL_UNIQUEID , AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , getUserRegistryRealm ( ) , unauthenticatedUserid ) ) ; subject . getPublicCredentials ( ) . add ( hashtable ) ; SecurityService securityService = securityServiceRef . getService ( ) ; AuthenticationService authenticationService = securityService . getAuthenticationService ( ) ; Subject tempUnauthenticatedSubject = authenticationService . authenticate ( JaasLoginConfigConstants . SYSTEM_UNAUTHENTICATED , subject ) ; tempUnauthenticatedSubject . setReadOnly ( ) ; synchronized ( unauthenticatedSubjectLock ) { if ( unauthenticatedSubject == null ) { unauthenticatedSubject = tempUnauthenticatedSubject ; } } } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Internal error creating UNAUTHENTICATED subject." , e ) ; } } } return unauthenticatedSubject ; } | Return the unauthenticated subject . If we don t already have one create it . |
162,142 | public void setClientAlias ( String alias ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setClientAlias" , new Object [ ] { alias } ) ; if ( ! ks . containsAlias ( alias ) ) { String keyFileName = config . getProperty ( Constants . SSLPROP_KEY_STORE ) ; String tokenLibraryFile = config . getProperty ( Constants . SSLPROP_TOKEN_LIBRARY ) ; String location = keyFileName != null ? keyFileName : tokenLibraryFile ; String message = TraceNLSHelper . getInstance ( ) . getFormattedMessage ( "ssl.client.alias.not.found.CWPKI0023E" , new Object [ ] { alias , location } , "Client alias " + alias + " not found in keystore." ) ; Tr . error ( tc , "ssl.client.alias.not.found.CWPKI0023E" , new Object [ ] { alias , location } ) ; throw new IllegalArgumentException ( message ) ; } this . clientAlias = alias ; if ( customKM != null && customKM instanceof KeyManagerExtendedInfo ) ( ( KeyManagerExtendedInfo ) customKM ) . setKeyStoreClientAlias ( alias ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setClientAlias" ) ; } | Set the client alias value for the given slot number . |
162,143 | public String chooseClientAlias ( String keyType , Principal [ ] issuers ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "chooseClientAlias" , new Object [ ] { keyType , issuers } ) ; Map < String , Object > connectionInfo = JSSEHelper . getInstance ( ) . getOutboundConnectionInfo ( ) ; if ( connectionInfo != null && Constants . ENDPOINT_IIOP . equals ( connectionInfo . get ( Constants . CONNECTION_INFO_ENDPOINT_NAME ) ) && ! SSLConfigManager . getInstance ( ) . isClientAuthenticationEnabled ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias: null" ) ; return null ; } else if ( clientAlias != null && ! clientAlias . equals ( "" ) ) { String [ ] list = km . getClientAliases ( keyType , issuers ) ; if ( list != null ) { boolean found = false ; for ( int i = 0 ; i < list . length && ! found ; i ++ ) { if ( clientAlias . equalsIgnoreCase ( list [ i ] ) ) found = true ; } if ( found ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias" , new Object [ ] { clientAlias } ) ; if ( ks . getType ( ) != null && ( ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCERACFKS ) || ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCECCARACFKS ) || ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCEHYBRIDRACFKS ) ) ) { return clientAlias ; } return clientAlias . toLowerCase ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias (default)" , new Object [ ] { clientAlias } ) ; return clientAlias ; } else { String [ ] keyArray = new String [ ] { keyType } ; String alias = km . chooseClientAlias ( keyArray , issuers , null ) ; if ( ks . getType ( ) != null && ( ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCERACFKS ) && ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCECCARACFKS ) && ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCEHYBRIDRACFKS ) ) ) { if ( alias != null ) { alias = alias . toLowerCase ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias (from JSSE)" , new Object [ ] { alias } ) ; return alias ; } } | Choose a client alias . |
162,144 | public String chooseEngineServerAlias ( String keyType , Principal [ ] issuers , SSLEngine engine ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "chooseEngineServerAlias" , new Object [ ] { keyType , issuers , engine } ) ; String rc = null ; if ( null != customKM && customKM instanceof X509ExtendedKeyManager ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "chooseEngineServerAlias, using customKM -> " + customKM . getClass ( ) . getName ( ) ) ; rc = ( ( X509ExtendedKeyManager ) customKM ) . chooseEngineServerAlias ( keyType , issuers , engine ) ; } else { rc = chooseServerAlias ( keyType , issuers ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseEngineServerAlias: " + rc ) ; return rc ; } | Handshakes that use the SSLEngine and not an SSLSocket require this method from the extended X509KeyManager . |
162,145 | public X509KeyManager getX509KeyManager ( ) { if ( customKM != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getX509KeyManager -> " + customKM . getClass ( ) . getName ( ) ) ; return customKM ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getX509KeyManager -> " + km . getClass ( ) . getName ( ) ) ; return km ; } | Get the appropriate X509KeyManager for this instance . |
162,146 | protected static void getAlpnResult ( SSLEngine engine , SSLConnectionLink link ) { alpnNegotiator . tryToRemoveAlpnNegotiator ( link . getAlpnNegotiator ( ) , engine , link ) ; } | This must be called after the SSL handshake has completed . If an ALPN protocol was selected by the available provider that protocol will be set on the SSLConnectionLink . Also additional cleanup will be done for some ALPN providers . |
162,147 | void metadataProcessingInitialize ( ComponentNameSpaceConfiguration nameSpaceConfig ) { ivContext = ( InjectionProcessorContext ) nameSpaceConfig . getInjectionProcessorContext ( ) ; ivNameSpaceConfig = nameSpaceConfig ; ivCheckAppConfig = nameSpaceConfig . isCheckApplicationConfiguration ( ) ; } | d730349 . 1 |
162,148 | protected void mergeError ( Object oldValue , Object newValue , boolean xml , String elementName , boolean property , String key ) throws InjectionConfigurationException { JNDIEnvironmentRefType refType = getJNDIEnvironmentRefType ( ) ; String component = ivNameSpaceConfig . getDisplayName ( ) ; String module = ivNameSpaceConfig . getModuleName ( ) ; String application = ivNameSpaceConfig . getApplicationName ( ) ; String jndiName = getJndiName ( ) ; if ( xml ) { Tr . error ( tc , "CONFLICTING_XML_VALUES_CWNEN0052E" , component , module , application , elementName , refType . getXMLElementName ( ) , refType . getNameXMLElementName ( ) , jndiName , oldValue , newValue ) ; } else { Tr . error ( tc , "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E" , component , module , application , elementName , '@' + refType . getAnnotationShortName ( ) , refType . getNameAnnotationElementName ( ) , jndiName , oldValue , newValue ) ; } String exMsg ; if ( xml ) { exMsg = "The " + component + " component in the " + module + " module of the " + application + " application has conflicting configuration data in the XML" + " deployment descriptor. Conflicting " + elementName + " element values exist for multiple " + refType . getXMLElementName ( ) + " elements with the same " + refType . getNameXMLElementName ( ) + " element value : " + jndiName + ". The conflicting " + elementName + " element values are " + oldValue + " and " + newValue + "." ; } else { exMsg = "The " + component + " component in the " + module + " module of the " + application + " application has conflicting configuration data" + " in source code annotations. Conflicting " + elementName + " attribute values exist for multiple @" + refType . getAnnotationShortName ( ) + " annotations with the same " + refType . getNameAnnotationElementName ( ) + " attribute value : " + jndiName + ". The conflicting " + elementName + " attribute values are " + oldValue + " and " + newValue + "." ; } throw new InjectionConfigurationException ( exMsg ) ; } | Indication that an error has occurred while merging an attribute value . |
162,149 | protected Boolean mergeAnnotationBoolean ( Boolean oldValue , boolean oldValueXML , boolean newValue , String elementName , boolean defaultValue ) throws InjectionConfigurationException { if ( newValue == defaultValue || oldValueXML ) { return oldValue ; } if ( isComplete ( ) ) { mergeError ( oldValue , newValue , false , elementName , false , elementName ) ; return oldValue ; } return newValue ; } | Merges the value of a boolean annotation value . |
162,150 | protected Integer mergeAnnotationInteger ( Integer oldValue , boolean oldValueXML , int newValue , String elementName , int defaultValue , Map < Integer , String > valueNames ) throws InjectionConfigurationException { if ( newValue == defaultValue ) { return oldValue ; } if ( oldValueXML ) { return oldValue ; } if ( oldValue == null ? isComplete ( ) : ! oldValue . equals ( newValue ) ) { Object oldValueName = valueNames == null ? oldValue : valueNames . get ( oldValue ) ; Object newValueName = valueNames == null ? newValue : valueNames . get ( newValue ) ; mergeError ( oldValueName , newValueName , false , elementName , false , elementName ) ; return oldValue ; } return newValue ; } | Merges the value of an integer annotation value . |
162,151 | protected < T > T mergeAnnotationValue ( T oldValue , boolean oldValueXML , T newValue , String elementName , T defaultValue ) throws InjectionConfigurationException { if ( newValue . equals ( defaultValue ) || oldValueXML ) { return oldValue ; } if ( oldValue == null ? isComplete ( ) : ! newValue . equals ( oldValue ) ) { mergeError ( oldValue , newValue , false , elementName , false , elementName ) ; return oldValue ; } return newValue ; } | Merges the value of a String or Enum annotation value . |
162,152 | protected < T > T mergeXMLValue ( T oldValue , T newValue , String elementName , String key , Map < T , String > valueNames ) throws InjectionConfigurationException { if ( newValue == null ) { return oldValue ; } if ( oldValue != null && ! newValue . equals ( oldValue ) ) { Object oldValueName = valueNames == null ? oldValue : valueNames . get ( oldValue ) ; Object newValueName = valueNames == null ? newValue : valueNames . get ( newValue ) ; mergeError ( oldValueName , newValueName , true , elementName , false , key ) ; return oldValue ; } return newValue ; } | Merges a value specified in XML . |
162,153 | protected Map < String , String > mergeXMLProperties ( Map < String , String > oldProperties , Set < String > oldXMLProperties , List < Property > properties ) throws InjectionConfigurationException { if ( ! properties . isEmpty ( ) ) { if ( oldProperties == null ) { oldProperties = new HashMap < String , String > ( ) ; } for ( Property property : properties ) { String name = property . getName ( ) ; String newValue = property . getValue ( ) ; Object oldValue = oldProperties . put ( name , newValue ) ; if ( oldValue != null && ! newValue . equals ( oldValue ) ) { mergeError ( oldValue , newValue , true , name + " property" , true , name ) ; continue ; } oldXMLProperties . add ( name ) ; } } return oldProperties ; } | Merges the properties specified in XML . |
162,154 | protected static < K , V > void addOrRemoveProperty ( Map < K , V > props , K key , V value ) { if ( value == null ) { props . remove ( key ) ; } else { props . put ( key , value ) ; } } | Add the specified property if the value is non - null or remove it from the map if it is null . |
162,155 | public Reference createDefinitionReference ( String bindingName , String type , Map < String , Object > properties ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Map < String , Object > traceProps = properties ; if ( traceProps . containsKey ( "password" ) ) { traceProps = new HashMap < String , Object > ( properties ) ; traceProps . put ( "password" , "********" ) ; } Tr . entry ( tc , "createDefinitionReference: bindingName=" + bindingName + ", type=" + type , traceProps ) ; } Reference ref ; try { InternalInjectionEngine injectionEngine = ( InternalInjectionEngine ) InjectionEngineAccessor . getInstance ( ) ; ref = injectionEngine . createDefinitionReference ( ivNameSpaceConfig , ivInjectionScope , getJndiName ( ) , bindingName , type , properties ) ; } catch ( Exception ex ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createDefinitionReference" , ex ) ; throw new InjectionException ( ex ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createDefinitionReference" , ref ) ; return ref ; } | Create a Reference to a resource definition . |
162,156 | public void setObjects ( Object injectionObject , Reference bindingObject ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setObjects" , injectionObject , bindingObjectToString ( bindingObject ) ) ; ivInjectedObject = injectionObject ; if ( bindingObject != null ) { ivBindingObject = bindingObject ; ivObjectFactoryClassName = bindingObject . getFactoryClassName ( ) ; if ( ivObjectFactoryClassName == null ) { throw new IllegalArgumentException ( "expected non-null getFactoryClassName" ) ; } } else { ivBindingObject = injectionObject ; } } | Sets the object to use for injection and the Reference to use for binding . Usually the injection object is null . |
162,157 | public void setReferenceObject ( Reference bindingObject , Class < ? extends ObjectFactory > objectFactory ) throws InjectionException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setReferenceObject" , bindingObjectToString ( bindingObject ) , objectFactory ) ; ivInjectedObject = null ; ivBindingObject = bindingObject ; ivObjectFactoryClass = objectFactory ; ivObjectFactoryClassName = objectFactory . getName ( ) ; } | F623 - 841 . 1 |
162,158 | protected Object getInjectionObjectInstance ( Object targetObject , InjectionTargetContext targetContext ) throws Exception { ObjectFactory objectFactory = ivObjectFactory ; InjectionObjectFactory injObjFactory = ivInjectionObjectFactory ; if ( objectFactory == null ) { try { InternalInjectionEngine ie = InjectionEngineAccessor . getInternalInstance ( ) ; objectFactory = ie . getObjectFactory ( ivObjectFactoryClassName , ivObjectFactoryClass ) ; if ( objectFactory instanceof InjectionObjectFactory ) { injObjFactory = ( InjectionObjectFactory ) objectFactory ; ivInjectionObjectFactory = injObjFactory ; } ivObjectFactory = objectFactory ; } catch ( Throwable ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getInjectionObjectInstance" , ex ) ; Tr . error ( tc , "OBJECT_FACTORY_CLASS_FAILED_TO_LOAD_CWNEN0024E" , ivObjectFactoryClassName ) ; throw new InjectionException ( ex . toString ( ) , ex ) ; } } if ( injObjFactory != null ) { return injObjFactory . getInjectionObjectInstance ( ( Reference ) getBindingObject ( ) , targetObject , targetContext ) ; } return objectFactory . getObjectInstance ( getBindingObject ( ) , null , null , null ) ; } | F48603 . 4 |
162,159 | public final void setJndiName ( String jndiName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) && jndiName . length ( ) != 0 ) Tr . debug ( tc , "setJndiName: " + jndiName ) ; ivJndiName = InjectionScope . normalize ( jndiName ) ; } | d367834 . 14 Ends |
162,160 | public void setInjectionClassType ( Class < ? > injectionClassType ) throws InjectionException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInjectionClassType: " + injectionClassType ) ; if ( ivInjectionClassType == null || ivInjectionClassType == Object . class ) { ivInjectionClassType = injectionClassType ; } else { if ( ivInjectionClassType . isAssignableFrom ( injectionClassType ) ) { ivInjectionClassType = injectionClassType ; } else { if ( ! injectionClassType . isAssignableFrom ( ivInjectionClassType ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "WARNING: Class " + injectionClassType + " is not assignable from " + ivInjectionClassType ) ; } } } } | Set the InjectionClassType to be most fine grained injection target Class type . |
162,161 | public void setInjectionClassTypeName ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setInjectionClassType: " + name ) ; if ( ivInjectionClassTypeName != null ) { throw new IllegalStateException ( "duplicate reference data for " + getJndiName ( ) ) ; } ivInjectionClassTypeName = name ; } | Sets the injection class type name . When class names are specified in XML rather than annotation sub - classes must call this method or override getInjectionClassTypeName in order to support callers of the injection engine that do not have a class loader . |
162,162 | public static boolean isClassesCompatible ( Class < ? > memberClass , Class < ? > injectClass ) { if ( memberClass . isAssignableFrom ( injectClass ) ) return true ; if ( injectClass . isAssignableFrom ( memberClass ) ) return true ; return getPrimitiveClass ( memberClass ) == getPrimitiveClass ( injectClass ) ; } | Test if the input two classes are auto - boxing compatible . |
162,163 | public static Class < ? > mostSpecificClass ( Class < ? > classOne , Class < ? > classTwo ) { if ( classOne . isAssignableFrom ( classTwo ) ) { return classTwo ; } else if ( classTwo . isAssignableFrom ( classOne ) ) { return classOne ; } return null ; } | Returns the most most specific class to the caller . If the two classes are not compatible a null is returned . |
162,164 | public static String toStringSecure ( Annotation ann ) { Class < ? > annType = ann . annotationType ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( '@' ) . append ( annType . getName ( ) ) . append ( '(' ) ; boolean any = false ; for ( Method m : annType . getMethods ( ) ) { Object defaultValue = m . getDefaultValue ( ) ; if ( defaultValue != null ) { String name = m . getName ( ) ; Object value ; try { value = m . invoke ( ann ) ; if ( name . equals ( "password" ) && ! defaultValue . equals ( value ) ) { value = "********" ; } else if ( value instanceof Object [ ] ) { value = Arrays . toString ( ( Object [ ] ) value ) ; } else { value = String . valueOf ( value ) ; } } catch ( Throwable t ) { value = "<" + t + ">" ; } if ( any ) { sb . append ( ", " ) ; } else { any = true ; } sb . append ( name ) . append ( '=' ) . append ( value ) ; } } return sb . append ( ')' ) . toString ( ) ; } | Convert an annotation to a string but mask members named password . |
162,165 | @ FFDCIgnore ( Exception . class ) protected int overQualLastAccessTimeUpdate ( BackedSession sess , long nowTime ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; String id = sess . getId ( ) ; int updateCount ; try { if ( trace && tc . isDebugEnabled ( ) ) tcInvoke ( tcSessionMetaCache , "get" , id ) ; synchronized ( sess ) { ArrayList < ? > oldValue = sessionMetaCache . get ( id ) ; if ( trace && tc . isDebugEnabled ( ) ) tcReturn ( tcSessionMetaCache , "get" , oldValue ) ; SessionInfo sessionInfo = oldValue == null ? null : new SessionInfo ( oldValue ) . clone ( ) ; long curAccessTime = sess . getCurrentAccessTime ( ) ; if ( sessionInfo == null || sessionInfo . getLastAccess ( ) != curAccessTime ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "session current access time: " + curAccessTime ) ; updateCount = 0 ; } else if ( sessionInfo . getLastAccess ( ) >= nowTime ) { updateCount = 1 ; } else { sessionInfo . setLastAccess ( nowTime ) ; ArrayList < ? > newValue = sessionInfo . getArrayList ( ) ; if ( trace && tc . isDebugEnabled ( ) ) tcInvoke ( tcSessionMetaCache , "replace" , id , oldValue , newValue ) ; boolean replaced = sessionMetaCache . replace ( id , oldValue , newValue ) ; if ( trace && tc . isDebugEnabled ( ) ) tcReturn ( tcSessionMetaCache , "replace" , replaced ) ; if ( replaced ) { sess . updateLastAccessTime ( nowTime ) ; updateCount = 1 ; } else { updateCount = 0 ; } } } } catch ( Exception ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.session.store.cache.CacheHashMap.overQualLastAccessTimeUpdate" , "859" , this , new Object [ ] { sess } ) ; Tr . error ( tc , "ERROR_CACHE_ACCESS" , ex ) ; throw new RuntimeException ( Tr . formatMessage ( tc , "INTERNAL_SERVER_ERROR" ) ) ; } return updateCount ; } | Attempts to update the last access time ensuring the old value matches . This verifies that the copy we have in cache is still valid . |
162,166 | public static String typeToString ( MediaType type , List < String > ignoreParams ) { if ( type == null ) { throw new IllegalArgumentException ( "MediaType parameter is null" ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( type . getType ( ) ) . append ( '/' ) . append ( type . getSubtype ( ) ) ; Map < String , String > params = type . getParameters ( ) ; if ( params != null ) { for ( Iterator < Map . Entry < String , String > > iter = params . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry < String , String > entry = iter . next ( ) ; if ( ignoreParams != null && ignoreParams . contains ( entry . getKey ( ) ) ) { continue ; } sb . append ( ';' ) . append ( entry . getKey ( ) ) . append ( '=' ) . append ( entry . getValue ( ) ) ; } } return sb . toString ( ) ; } | to the implementation |
162,167 | private static void createHandshakeInstance ( ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createHandshakeInstance" ) ; try { instance = Class . forName ( MfpConstants . COMP_HANDSHAKE_CLASS ) . newInstance ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.CompHandshakeFactory.createHandshakeInstance" , "88" ) ; SibTr . error ( tc , "UNABLE_TO_CREATE_COMPHANDSHAKE_CWSIF0051" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createHandshakeInstance" ) ; } | Create the singleton ComponentHandshake instance . |
162,168 | synchronized void setProperties ( Map < Object , Object > m ) throws ChannelFactoryPropertyIgnoredException { this . myProperties = m ; if ( cf != null ) { cf . updateProperties ( m ) ; } } | internally set the properties associated with this object |
162,169 | synchronized void setProperty ( Object key , Object value ) throws ChannelFactoryPropertyIgnoredException { if ( null == key ) { throw new ChannelFactoryPropertyIgnoredException ( "Ignored channel factory property key of null" ) ; } if ( myProperties == null ) { this . myProperties = new HashMap < Object , Object > ( ) ; } this . myProperties . put ( key , value ) ; if ( cf != null ) { cf . updateProperties ( myProperties ) ; } } | Iternally set a property associated with this object |
162,170 | synchronized void setChannelFactory ( ChannelFactory factory ) throws ChannelFactoryException { if ( factory != null && cf != null ) { throw new ChannelFactoryException ( "ChannelFactory already exists" ) ; } this . cf = factory ; } | Internally set the channel factory in this data object . |
162,171 | public void dissociate ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "dissociate" ) ; } if ( WSSecurityHelper . isServerSecurityEnabled ( ) ) { J2CSecurityHelper . removeRunAsSubject ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "dissociate" ) ; } } | This method is called by the WorkProxy class to dissociate the inflown SecurityContext from the workmanager thread after it has run the work By the time this method is called the WSSubject . doAs method call would have exited and the runAs subject would be dissociated . So all that is left to do here is to clear the ThreadLocal variable that is set with the runAs subject in the associate method . |
162,172 | public static void validateStatusAtInstanceRestart ( long jobInstanceId , Properties restartJobParameters ) throws JobRestartException , JobExecutionAlreadyCompleteException { IPersistenceManagerService iPers = ServicesManagerStaticAnchor . getServicesManager ( ) . getPersistenceManagerService ( ) ; WSJobInstance jobInstance = iPers . getJobInstance ( jobInstanceId ) ; Helper helper = new Helper ( jobInstance , restartJobParameters ) ; if ( ! StringUtils . isEmpty ( jobInstance . getJobXml ( ) ) ) { helper . validateRestartableFalseJobsDoNotRestart ( ) ; } helper . validateJobInstanceFailedOrStopped ( ) ; } | validates job is restart - able validates the jobInstance is in failed or stopped |
162,173 | protected void write ( WriteableLogRecord logRecord ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "write" , new Object [ ] { logRecord , this } ) ; byte [ ] data = this . getData ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing '" + data . length + "' bytes " + RLSUtils . toHexString ( data , RLSUtils . MAX_DISPLAY_BYTES ) ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing length field" ) ; logRecord . putInt ( data . length ) ; if ( _storageMode == MultiScopeRecoveryLog . FILE_BACKED ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Updaing data location references" ) ; _filePosition = logRecord . position ( ) ; _logRecord = logRecord ; _data = null ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing data field" ) ; logRecord . put ( data ) ; if ( ! _written ) { _rus . payloadWritten ( _dataSize + HEADER_SIZE ) ; } _written = true ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "write" ) ; } | Instructs this DataItem to write its data to the given WriteableLogRecord . The write involves writing the length of the data as an int followed by the data itself . The data is written at the log record s current position . |
162,174 | protected byte [ ] getData ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getData" , this ) ; byte [ ] data = _data ; if ( data != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Cached data located" ) ; } else { if ( _storageMode == MultiScopeRecoveryLog . FILE_BACKED ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "No cached data located. Attempting data retreival" ) ; if ( _filePosition != UNWRITTEN ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Retrieving " + _dataSize + " bytes of data @ position " + _filePosition ) ; _logRecord . position ( _filePosition ) ; data = new byte [ _dataSize ] ; _logRecord . get ( data ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Unable to retrieve data as file position is not set" ) ; } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "No cached data located" ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getData" , new Object [ ] { new Integer ( data . length ) , RLSUtils . toHexString ( data , RLSUtils . MAX_DISPLAY_BYTES ) } ) ; return data ; } | Returns the data encapsulated by this DataItem instance . If this DataItem is memory back the in memory copy of the data is always returned . If the DataItem is file backed and it has been written to disk the data is retrieved from disk and then returned . |
162,175 | private UserRegistry getActiveUserRegistry ( ) throws WSSecurityException { final String METHOD = "getUserRegistry" ; UserRegistry activeUserRegistry = null ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " securityServiceRef " + securityServiceRef ) ; } SecurityService ss = securityServiceRef . getService ( ) ; if ( ss == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " No SecurityService, returning null" ) ; } } else { UserRegistryService urs = ss . getUserRegistryService ( ) ; if ( urs == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " No UserRegistryService, returning null" ) ; } } else { if ( urs . isUserRegistryConfigured ( ) ) { com . ibm . ws . security . registry . UserRegistry userRegistry = urs . getUserRegistry ( ) ; activeUserRegistry = urs . getExternalUserRegistry ( userRegistry ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHOD + " Security enabled but no registry configured" ) ; } } } } } catch ( RegistryException e ) { String msg = "getUserRegistryWrapper failed due to an internal error: " + e . getMessage ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg , e ) ; } throw new WSSecurityException ( msg , e ) ; } return activeUserRegistry ; } | Returns the active UserRegistry . If the active user registry is an instance of com . ibm . ws . security . registry . UserRegistry then it will be wrapped . Otherwise if the active user registry is an instance of CustomUserRegistryWrapper then the underlying com . ibm . websphere . security . UserRegistry will be returned . |
162,176 | public synchronized UserTransaction getUserTransaction ( ) { if ( state == PRE_CREATE ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Incorrect state: " + getStateName ( state ) ) ; throw new IllegalStateException ( getStateName ( state ) ) ; } return UserTransactionWrapper . INSTANCE ; } | Get user transaction object that bean can use to demarcate transactions . |
162,177 | public Map < String , Object > getContextData ( ) { if ( state == PRE_CREATE || state == DESTROYED ) { IllegalStateException ise ; ise = new IllegalStateException ( "SessionBean: getContextData " + "not allowed from state = " + getStateName ( state ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getContextData: " + ise ) ; throw ise ; } return super . getContextData ( ) ; } | F743 - 21028 |
162,178 | protected void canBeRemoved ( ) throws RemoveException { ContainerTx tx = container . getCurrentContainerTx ( ) ; if ( tx == null ) { return ; } if ( tx . isTransactionGlobal ( ) && tx . ivRemoveBeanO != this ) { throw new RemoveException ( "Cannot remove session bean " + "within a transaction." ) ; } } | Checks if beanO can be removed . Throws RemoveException if cannot be removed . |
162,179 | private static String toKey ( String name , String filter , SearchControls cons ) { int length = name . length ( ) + filter . length ( ) + 100 ; StringBuffer key = new StringBuffer ( length ) ; key . append ( name ) ; key . append ( "|" ) ; key . append ( filter ) ; key . append ( "|" ) ; key . append ( cons . getSearchScope ( ) ) ; key . append ( "|" ) ; key . append ( cons . getCountLimit ( ) ) ; key . append ( "|" ) ; key . append ( cons . getTimeLimit ( ) ) ; String [ ] attrIds = cons . getReturningAttributes ( ) ; if ( attrIds != null ) { for ( int i = 0 ; i < attrIds . length ; i ++ ) { key . append ( "|" ) ; key . append ( attrIds [ i ] ) ; } } return key . toString ( ) ; } | Returns a hash key for the name|filter|cons tuple used in the search query - results cache . |
162,180 | private static String toKey ( String name , String filterExpr , Object [ ] filterArgs , SearchControls cons ) { int length = name . length ( ) + filterExpr . length ( ) + filterArgs . length + 200 ; StringBuffer key = new StringBuffer ( length ) ; key . append ( name ) ; key . append ( "|" ) ; key . append ( filterExpr ) ; String [ ] attrIds = cons . getReturningAttributes ( ) ; for ( int i = 0 ; i < filterArgs . length ; i ++ ) { key . append ( "|" ) ; key . append ( filterArgs [ i ] ) ; } if ( attrIds != null ) { for ( int i = 0 ; i < attrIds . length ; i ++ ) { key . append ( "|" ) ; key . append ( attrIds [ i ] ) ; } } return key . toString ( ) ; } | Returns a hash key for the name|filterExpr|filterArgs|cons tuple used in the search query - results cache . |
162,181 | public NameParser getNameParser ( ) throws WIMException { if ( iNameParser == null ) { TimedDirContext ctx = iContextManager . getDirContext ( ) ; try { try { iNameParser = ctx . getNameParser ( "" ) ; } catch ( NamingException e ) { if ( ! ContextManager . isConnectionException ( e ) ) { throw e ; } ctx = iContextManager . reCreateDirContext ( ctx , e . toString ( ) ) ; iNameParser = ctx . getNameParser ( "" ) ; } } catch ( NamingException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) , e ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } finally { iContextManager . releaseDirContext ( ctx ) ; } } return iNameParser ; } | Retrieves the parser associated with the root context . |
162,182 | private void initializeCaches ( Map < String , Object > configProps ) { final String METHODNAME = "initializeCaches(DataObject)" ; iAttrsCacheName = iReposId + "/" + iAttrsCacheName ; iSearchResultsCacheName = iReposId + "/" + iSearchResultsCacheName ; List < Map < String , Object > > cacheConfigs = Nester . nest ( CACHE_CONFIG , configProps ) ; Map < String , Object > attrCacheConfig = null ; Map < String , Object > searchResultsCacheConfig = null ; if ( ! cacheConfigs . isEmpty ( ) ) { Map < String , Object > cacheConfig = cacheConfigs . get ( 0 ) ; Map < String , List < Map < String , Object > > > cacheInfo = Nester . nest ( cacheConfig , ATTRIBUTES_CACHE_CONFIG , SEARCH_CACHE_CONFIG ) ; List < Map < String , Object > > attrList = cacheInfo . get ( ATTRIBUTES_CACHE_CONFIG ) ; if ( ! attrList . isEmpty ( ) ) { attrCacheConfig = attrList . get ( 0 ) ; } List < Map < String , Object > > searchList = cacheInfo . get ( SEARCH_CACHE_CONFIG ) ; if ( ! searchList . isEmpty ( ) ) { searchResultsCacheConfig = searchList . get ( 0 ) ; } if ( attrCacheConfig != null ) { iAttrsCacheEnabled = ( Boolean ) attrCacheConfig . get ( CONFIG_PROP_ENABLED ) ; if ( iAttrsCacheEnabled ) { iAttrsCacheSize = ( Integer ) attrCacheConfig . get ( CONFIG_PROP_CACHE_SIZE ) ; iAttrsCacheTimeOut = ( Long ) attrCacheConfig . get ( CONFIG_PROP_CACHE_TIME_OUT ) ; iAttrsSizeLmit = ( Integer ) attrCacheConfig . get ( CONFIG_PROP_ATTRIBUTE_SIZE_LIMIT ) ; } } if ( searchResultsCacheConfig != null ) { iSearchResultsCacheEnabled = ( Boolean ) searchResultsCacheConfig . get ( CONFIG_PROP_ENABLED ) ; if ( iSearchResultsCacheEnabled ) { iSearchResultsCacheSize = ( Integer ) searchResultsCacheConfig . get ( CONFIG_PROP_CACHE_SIZE ) ; iSearchResultsCacheTimeOut = ( Long ) searchResultsCacheConfig . get ( CONFIG_PROP_CACHE_TIME_OUT ) ; iSearchResultSizeLmit = ( Integer ) searchResultsCacheConfig . get ( CONFIG_PROP_SEARCH_RESULTS_SIZE_LIMIT ) ; } } } if ( iAttrsCacheEnabled ) { createAttributesCache ( ) ; if ( iAttrsCache == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Attributes Cache: " + iAttrsCacheName + " is not available because cache is not available yet." ) ; } } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Attributes Cache: " + iAttrsCacheName + " is disabled." ) ; } } if ( iSearchResultsCacheEnabled ) { createSearchResultsCache ( ) ; if ( iSearchResultsCache == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Search Results Cache: " + iSearchResultsCacheName + " is not available because cache is not available yet." ) ; } } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Search Results Cache: " + iSearchResultsCacheName + " is disabled." ) ; } } } | Initialize search and attribute caches . |
162,183 | private void createSearchResultsCache ( ) { final String METHODNAME = "createSearchResultsCache" ; if ( iSearchResultsCacheEnabled ) { if ( FactoryManager . getCacheUtil ( ) . isCacheAvailable ( ) ) { iSearchResultsCache = FactoryManager . getCacheUtil ( ) . initialize ( "SearchResultsCache" , iSearchResultsCacheSize , iSearchResultsCacheSize , iSearchResultsCacheTimeOut ) ; if ( iSearchResultsCache != null ) { if ( tc . isDebugEnabled ( ) ) { StringBuilder strBuf = new StringBuilder ( METHODNAME ) ; strBuf . append ( " \nSearch Results Cache: " ) . append ( iSearchResultsCacheName ) . append ( " is enabled:\n" ) ; strBuf . append ( "\tCacheSize: " ) . append ( iSearchResultsCacheSize ) . append ( "\n" ) ; strBuf . append ( "\tCacheTimeOut: " ) . append ( iSearchResultsCacheTimeOut ) . append ( "\n" ) ; strBuf . append ( "\tCacheResultSizeLimit: " ) . append ( iSearchResultSizeLmit ) . append ( "\n" ) ; Tr . debug ( tc , strBuf . toString ( ) ) ; } } } } } | Method to create the search results cache if configured . |
162,184 | private void createAttributesCache ( ) { final String METHODNAME = "createAttributesCache" ; if ( iAttrsCacheEnabled ) { if ( FactoryManager . getCacheUtil ( ) . isCacheAvailable ( ) ) { iAttrsCache = FactoryManager . getCacheUtil ( ) . initialize ( "AttributesCache" , iAttrsCacheSize , iAttrsCacheSize , iAttrsCacheTimeOut ) ; if ( iAttrsCache != null ) { if ( tc . isDebugEnabled ( ) ) { StringBuilder strBuf = new StringBuilder ( METHODNAME ) ; strBuf . append ( " \nAttributes Cache: " ) . append ( iAttrsCacheName ) . append ( " is enabled:\n" ) ; strBuf . append ( "\tCacheSize: " ) . append ( iAttrsCacheSize ) . append ( "\n" ) ; strBuf . append ( "\tCacheTimeOut: " ) . append ( iAttrsCacheTimeOut ) . append ( "\n" ) ; strBuf . append ( "\tCacheSizeLimit: " ) . append ( iAttrsSizeLmit ) . append ( "\n" ) ; Tr . debug ( tc , strBuf . toString ( ) ) ; } } } } } | Method to create the attributes cache if configured . |
162,185 | public void invalidateAttributes ( String DN , String extId , String uniqueName ) { final String METHODNAME = "invalidateAttributes(String, String, String)" ; if ( getAttributesCache ( ) != null ) { if ( DN != null ) { getAttributesCache ( ) . invalidate ( toKey ( DN ) ) ; } if ( extId != null ) { getAttributesCache ( ) . invalidate ( extId ) ; } if ( uniqueName != null ) { getAttributesCache ( ) . invalidate ( toKey ( uniqueName ) ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " " + iAttrsCacheName + " size: " + getAttributesCache ( ) . size ( ) ) ; } } } | Method to invalidate the specified entry from the attributes cache . One or all parameters can be set in a single call . If all parameters are null then this operation no - ops . |
162,186 | public LdapEntry getEntityByIdentifier ( IdentifierType id , List < String > inEntityTypes , List < String > propNames , boolean getMbrshipAttr , boolean getMbrAttr ) throws WIMException { return getEntityByIdentifier ( id . getExternalName ( ) , id . getExternalId ( ) , id . getUniqueName ( ) , inEntityTypes , propNames , getMbrshipAttr , getMbrAttr ) ; } | Get an LDAP entity by an identifier . |
162,187 | public LdapEntry getEntityByIdentifier ( String dn , String extId , String uniqueName , List < String > inEntityTypes , List < String > propNames , boolean getMbrshipAttr , boolean getMbrAttr ) throws WIMException { String [ ] attrIds = iLdapConfigMgr . getAttributeNames ( inEntityTypes , propNames , getMbrshipAttr , getMbrAttr ) ; Attributes attrs = null ; if ( dn == null && ! iLdapConfigMgr . needTranslateRDN ( ) ) { dn = iLdapConfigMgr . switchToLdapNode ( uniqueName ) ; } if ( dn != null ) { attrs = checkAttributesCache ( dn , attrIds ) ; } else if ( extId != null ) { if ( iLdapConfigMgr . isAnyExtIdDN ( ) ) { dn = LdapHelper . getValidDN ( extId ) ; if ( dn != null ) { attrs = checkAttributesCache ( dn , attrIds ) ; } else if ( uniqueName != null ) { attrs = getAttributesByUniqueName ( uniqueName , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } else { String msg = Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( null ) ) ; throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , msg ) ; } } else { attrs = getAttributesByUniqueName ( extId , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } } else if ( uniqueName != null ) { attrs = getAttributesByUniqueName ( uniqueName , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } else { String msg = Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( null ) ) ; throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , msg ) ; } String entityType = iLdapConfigMgr . getEntityType ( attrs , uniqueName , dn , extId , inEntityTypes ) ; uniqueName = getUniqueName ( dn , entityType , attrs ) ; if ( extId == null ) { extId = iLdapConfigMgr . getExtIdFromAttributes ( dn , entityType , attrs ) ; } LdapEntry ldapEntry = new LdapEntry ( dn , extId , uniqueName , entityType , attrs ) ; return ldapEntry ; } | Get an LDAP entity by an identifier . One of dn extId or uniqueName must be non - null . |
162,188 | private String getUniqueName ( String dn , String entityType , Attributes attrs ) throws WIMException { final String METHODNAME = "getUniqueName" ; String uniqueName = null ; dn = iLdapConfigMgr . switchToNode ( dn ) ; if ( iLdapConfigMgr . needTranslateRDN ( ) && iLdapConfigMgr . needTranslateRDN ( entityType ) ) { try { if ( entityType != null ) { LdapEntity ldapEntity = iLdapConfigMgr . getLdapEntity ( entityType ) ; if ( ldapEntity != null ) { String [ ] rdnName = LdapHelper . getRDNAttributes ( dn ) ; String [ ] [ ] rdnWIMProps = ldapEntity . getWIMRDNProperties ( ) ; String [ ] [ ] rdnWIMAttrs = ldapEntity . getWIMRDNAttributes ( ) ; String [ ] [ ] rdnAttrs = ldapEntity . getRDNAttributes ( ) ; Attribute [ ] rdnAttributes = new Attribute [ rdnWIMProps . length ] ; String [ ] rdnAttrValues = new String [ rdnWIMProps . length ] ; for ( int i = 0 ; i < rdnAttrs . length ; i ++ ) { String [ ] rdnAttr = rdnAttrs [ i ] ; boolean isRDN = true ; for ( int j = 0 ; j < rdnAttr . length ; j ++ ) { if ( ! rdnAttr [ j ] . equalsIgnoreCase ( rdnName [ j ] ) ) { isRDN = false ; } } if ( isRDN ) { String [ ] rdnWIMProp = rdnWIMProps [ i ] ; String [ ] rdnWIMAttr = rdnWIMAttrs [ i ] ; boolean retrieveRDNs = false ; if ( attrs == null ) { retrieveRDNs = true ; } else { for ( int k = 0 ; k < rdnWIMAttr . length ; k ++ ) { if ( attrs . get ( rdnWIMAttr [ k ] ) == null ) { retrieveRDNs = true ; break ; } } } if ( retrieveRDNs ) { attrs = getAttributes ( dn , rdnWIMAttr ) ; } for ( int k = 0 ; k < rdnWIMAttr . length ; k ++ ) { rdnAttributes [ k ] = attrs . get ( rdnWIMAttr [ k ] ) ; if ( rdnAttributes [ k ] != null ) { rdnAttrValues [ k ] = ( String ) rdnAttributes [ k ] . get ( ) ; } } uniqueName = LdapHelper . replaceRDN ( dn , rdnWIMProp , rdnAttrValues ) ; } } } } } catch ( NamingException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } } if ( uniqueName == null ) { uniqueName = dn ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Translated uniqueName: " + uniqueName ) ; } } return uniqueName ; } | Get the unique name for the specified distinguished name . |
162,189 | @ FFDCIgnore ( { NamingException . class , NameNotFoundException . class } ) private Attributes getAttributes ( String name , String [ ] attrIds ) throws WIMException { Attributes attributes = null ; if ( iLdapConfigMgr . getUseEncodingInSearchExpression ( ) != null ) name = LdapHelper . encodeAttribute ( name , iLdapConfigMgr . getUseEncodingInSearchExpression ( ) ) ; if ( iAttrRangeStep > 0 ) { attributes = getRangeAttributes ( name , attrIds ) ; } else { TimedDirContext ctx = iContextManager . getDirContext ( ) ; try { try { if ( attrIds . length > 0 ) { attributes = ctx . getAttributes ( new LdapName ( name ) , attrIds ) ; } else { attributes = new BasicAttributes ( ) ; } } catch ( NamingException e ) { if ( ! ContextManager . isConnectionException ( e ) ) { throw e ; } ctx = iContextManager . reCreateDirContext ( ctx , e . toString ( ) ) ; if ( attrIds . length > 0 ) { attributes = ctx . getAttributes ( new LdapName ( name ) , attrIds ) ; } else { attributes = new BasicAttributes ( ) ; } } } catch ( NameNotFoundException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . LDAP_ENTRY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( name , e . toString ( true ) ) ) ; throw new EntityNotFoundException ( WIMMessageKey . LDAP_ENTRY_NOT_FOUND , msg , e ) ; } catch ( NamingException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } finally { iContextManager . releaseDirContext ( ctx ) ; } } return attributes ; } | Get the specified attributes for the distinguished name . |
162,190 | public Attributes checkAttributesCache ( String name , String [ ] attrIds ) throws WIMException { final String METHODNAME = "checkAttributesCache" ; Attributes attributes = null ; if ( getAttributesCache ( ) != null ) { String key = toKey ( name ) ; Object cached = getAttributesCache ( ) . get ( key ) ; if ( cached != null && ( cached instanceof Attributes ) ) { List < String > missAttrIdList = new ArrayList < String > ( attrIds . length ) ; Attributes cachedAttrs = ( Attributes ) cached ; attributes = new BasicAttributes ( true ) ; for ( int i = 0 ; i < attrIds . length ; i ++ ) { Attribute attr = LdapHelper . getIngoreCaseAttribute ( cachedAttrs , attrIds [ i ] ) ; if ( attr != null ) { attributes . put ( attr ) ; } else { missAttrIdList . add ( attrIds [ i ] ) ; } } if ( missAttrIdList . size ( ) > 0 ) { String [ ] missAttrIds = missAttrIdList . toArray ( new String [ 0 ] ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Miss cache: " + key + " " + WIMTraceHelper . printObjectArray ( missAttrIds ) ) ; } Attributes missAttrs = getAttributes ( name , missAttrIds ) ; addAttributes ( missAttrs , attributes ) ; updateAttributesCache ( key , missAttrs , cachedAttrs , missAttrIds ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Hit cache: " + key ) ; } } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Miss cache: " + key ) ; } attributes = getAttributes ( name , attrIds ) ; updateAttributesCache ( key , attributes , null , attrIds ) ; } } else { attributes = getAttributes ( name , attrIds ) ; } return attributes ; } | Check the attributes cache for the attributes on the distinguished name . If any of the attributes are missing a call to the LDAP server will be made to retrieve them . |
162,191 | private void updateAttributesCache ( String uniqueNameKey , String dn , Attributes newAttrs , String [ ] attrIds ) { final String METHODNAME = "updateAttributesCache(key,dn,newAttrs)" ; getAttributesCache ( ) . put ( uniqueNameKey , dn , 1 , iAttrsCacheTimeOut , 0 , null ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Update " + iAttrsCacheName + "(size: " + getAttributesCache ( ) . size ( ) + ")\n" + uniqueNameKey + ": " + dn ) ; } String dnKey = toKey ( dn ) ; Object cached = getAttributesCache ( ) . get ( dnKey ) ; Attributes cachedAttrs = null ; if ( cached != null && cached instanceof Attributes ) { cachedAttrs = ( Attributes ) cached ; } updateAttributesCache ( dnKey , newAttrs , cachedAttrs , attrIds ) ; } | Update the attributes cache by adding a mapping of the unique name to distinguished name and mapping the distinguished name to the updated attributes . |
162,192 | private void updateAttributesCache ( String key , Attributes missAttrs , Attributes cachedAttrs , String [ ] missAttrIds ) { final String METHODNAME = "updateAttributesCache(key,missAttrs,cachedAttrs,missAttrIds)" ; if ( missAttrIds != null ) { boolean newattr = false ; if ( missAttrIds . length > 0 ) { if ( cachedAttrs != null ) { cachedAttrs = ( Attributes ) cachedAttrs . clone ( ) ; } else { cachedAttrs = new BasicAttributes ( true ) ; newattr = true ; } for ( int i = 0 ; i < missAttrIds . length ; i ++ ) { boolean findAttr = false ; for ( NamingEnumeration < ? > neu = missAttrs . getAll ( ) ; neu . hasMoreElements ( ) ; ) { Attribute attr = ( Attribute ) neu . nextElement ( ) ; if ( attr . getID ( ) . equalsIgnoreCase ( missAttrIds [ i ] ) ) { findAttr = true ; if ( ! ( iAttrsSizeLmit > 0 && attr . size ( ) > iAttrsSizeLmit ) ) { cachedAttrs . put ( attr ) ; } break ; } else { int pos = attr . getID ( ) . indexOf ( ";" ) ; if ( pos > 0 && missAttrIds [ i ] . equalsIgnoreCase ( attr . getID ( ) . substring ( 0 , pos ) ) ) { findAttr = true ; if ( ! ( iAttrsSizeLmit > 0 && attr . size ( ) > iAttrsSizeLmit ) ) { cachedAttrs . put ( attr ) ; } break ; } } } if ( ! findAttr ) { Attribute nullAttr = new BasicAttribute ( missAttrIds [ i ] , null ) ; cachedAttrs . put ( nullAttr ) ; } } if ( newattr ) { getAttributesCache ( ) . put ( key , cachedAttrs , 1 , iAttrsCacheTimeOut , 0 , null ) ; } else { getAttributesCache ( ) . put ( key , cachedAttrs ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Update " + iAttrsCacheName + "(size: " + getAttributesCache ( ) . size ( ) + " newEntry: " + newattr + ")\n" + key + ": " + cachedAttrs ) ; } } } else { updateAttributesCache ( key , missAttrs , cachedAttrs ) ; } } | Update the cached attributes for the specified key . Only attribute IDs that are in the missAttrIds array will be added into the cached attributes . |
162,193 | private void updateAttributesCache ( String key , Attributes missAttrs , Attributes cachedAttrs ) { final String METHODNAME = "updateAttributeCache(key,missAttrs,cachedAttrs)" ; if ( missAttrs . size ( ) > 0 ) { boolean newAttr = false ; if ( cachedAttrs != null ) { cachedAttrs = ( Attributes ) cachedAttrs . clone ( ) ; } else { cachedAttrs = new BasicAttributes ( true ) ; newAttr = true ; } for ( NamingEnumeration < ? > neu = missAttrs . getAll ( ) ; neu . hasMoreElements ( ) ; ) { Attribute attr = ( Attribute ) neu . nextElement ( ) ; if ( ! ( iAttrsSizeLmit > 0 && attr . size ( ) > iAttrsSizeLmit ) ) { cachedAttrs . put ( attr ) ; } } if ( newAttr ) { getAttributesCache ( ) . put ( key , cachedAttrs , 1 , iAttrsCacheTimeOut , 0 , null ) ; } else { getAttributesCache ( ) . put ( key , cachedAttrs ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Update " + iAttrsCacheName + "(size: " + getAttributesCache ( ) . size ( ) + " newEntry: " + newAttr + ")\n" + key + ": " + cachedAttrs ) ; } } } | Update the attributes cache for the specified key . |
162,194 | private NamingEnumeration < SearchResult > checkSearchCache ( String name , String filterExpr , Object [ ] filterArgs , SearchControls cons ) throws WIMException { final String METHODNAME = "checkSearchCache" ; NamingEnumeration < SearchResult > neu = null ; if ( getSearchResultsCache ( ) != null ) { String key = null ; if ( filterArgs == null ) { key = toKey ( name , filterExpr , cons ) ; } else { key = toKey ( name , filterExpr , filterArgs , cons ) ; } CachedNamingEnumeration cached = ( CachedNamingEnumeration ) getSearchResultsCache ( ) . get ( key ) ; if ( cached == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Miss cache: " + key ) ; } neu = search ( name , filterExpr , filterArgs , cons , null ) ; String [ ] reqAttrIds = cons . getReturningAttributes ( ) ; neu = updateSearchCache ( name , key , neu , reqAttrIds ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Hit cache: " + key ) ; } neu = ( CachedNamingEnumeration ) cached . clone ( ) ; } } else { neu = search ( name , filterExpr , filterArgs , cons , null ) ; } return neu ; } | Check the search cache for previously performed searches . If the result is not cached query the LDAP server . |
162,195 | @ FFDCIgnore ( NamingException . class ) private NamingEnumeration < SearchResult > updateSearchCache ( String searchBase , String key , NamingEnumeration < SearchResult > neu , String [ ] reqAttrIds ) throws WIMSystemException { final String METHODNAME = "updateSearchCache" ; CachedNamingEnumeration clone1 = new CachedNamingEnumeration ( ) ; CachedNamingEnumeration clone2 = new CachedNamingEnumeration ( ) ; int count = cloneSearchResults ( neu , clone1 , clone2 ) ; if ( iSearchResultSizeLmit == 0 || count < iSearchResultSizeLmit ) { getSearchResultsCache ( ) . put ( key , clone2 , 1 , iSearchResultsCacheTimeOut , 0 , null ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " Update " + iSearchResultsCacheName + "(size: " + getSearchResultsCache ( ) . size ( ) + ")\n" + key ) ; if ( getAttributesCache ( ) != null ) { try { count = 0 ; while ( clone2 . hasMore ( ) ) { SearchResult result = clone2 . nextElement ( ) ; String dnKey = LdapHelper . prepareDN ( result . getName ( ) , searchBase ) ; Object cached = getAttributesCache ( ) . get ( dnKey ) ; Attributes cachedAttrs = null ; if ( cached != null && cached instanceof Attributes ) { cachedAttrs = ( Attributes ) cached ; } updateAttributesCache ( dnKey , result . getAttributes ( ) , cachedAttrs , reqAttrIds ) ; if ( ++ count > 20 ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " attribute cache updated with " + ( count - 1 ) + " entries. skipping rest." ) ; break ; } } } catch ( NamingException e ) { } } } return clone1 ; } | Update the search cache with search results . |
162,196 | public Map < String , LdapEntry > getDynamicGroups ( String bases [ ] , List < String > propNames , boolean getMbrshipAttr ) throws WIMException { Map < String , LdapEntry > dynaGrps = new HashMap < String , LdapEntry > ( ) ; String [ ] attrIds = iLdapConfigMgr . getAttributeNames ( iLdapConfigMgr . getGroupTypes ( ) , propNames , getMbrshipAttr , false ) ; String [ ] dynaMbrAttrNames = iLdapConfigMgr . getDynamicMemberAttributes ( ) ; String [ ] temp = attrIds ; attrIds = new String [ temp . length + dynaMbrAttrNames . length ] ; System . arraycopy ( temp , 0 , attrIds , 0 , temp . length ) ; System . arraycopy ( dynaMbrAttrNames , 0 , attrIds , temp . length , dynaMbrAttrNames . length ) ; String dynaGrpFitler = iLdapConfigMgr . getDynamicGroupFilter ( ) ; for ( int i = 0 , n = bases . length ; i < n ; i ++ ) { String base = bases [ i ] ; for ( NamingEnumeration < SearchResult > urls = search ( base , dynaGrpFitler , SearchControls . SUBTREE_SCOPE , attrIds ) ; urls . hasMoreElements ( ) ; ) { javax . naming . directory . SearchResult thisEntry = urls . nextElement ( ) ; if ( thisEntry == null ) { continue ; } String entryName = thisEntry . getName ( ) ; if ( entryName == null || entryName . trim ( ) . length ( ) == 0 ) { continue ; } String dn = LdapHelper . prepareDN ( entryName , base ) ; javax . naming . directory . Attributes attrs = thisEntry . getAttributes ( ) ; String extId = iLdapConfigMgr . getExtIdFromAttributes ( dn , SchemaConstants . DO_GROUP , attrs ) ; String uniqueName = getUniqueName ( dn , SchemaConstants . DO_GROUP , attrs ) ; LdapEntry ldapEntry = new LdapEntry ( dn , extId , uniqueName , SchemaConstants . DO_GROUP , attrs ) ; dynaGrps . put ( ldapEntry . getDN ( ) , ldapEntry ) ; } } return dynaGrps ; } | Get dynamic groups . |
162,197 | public boolean isMemberInURLQuery ( LdapURL [ ] urls , String dn ) throws WIMException { boolean result = false ; String [ ] attrIds = { } ; String rdn = LdapHelper . getRDN ( dn ) ; if ( urls != null ) { for ( int i = 0 ; i < urls . length ; i ++ ) { LdapURL ldapURL = urls [ i ] ; if ( ldapURL . parsedOK ( ) ) { String searchBase = ldapURL . get_dn ( ) ; if ( LdapHelper . isUnderBases ( dn , searchBase ) ) { int searchScope = ldapURL . get_searchScope ( ) ; String searchFilter = ldapURL . get_filter ( ) ; if ( searchScope == SearchControls . SUBTREE_SCOPE ) { if ( searchFilter == null ) { result = true ; break ; } else { NamingEnumeration < SearchResult > nenu = search ( dn , searchFilter , SearchControls . SUBTREE_SCOPE , attrIds ) ; if ( nenu . hasMoreElements ( ) ) { result = true ; break ; } } } else { if ( searchFilter == null ) { searchFilter = rdn ; } else { searchFilter = "(&(" + searchFilter + ")(" + rdn + "))" ; } NamingEnumeration < SearchResult > nenu = search ( searchBase , searchFilter , searchScope , attrIds ) ; if ( nenu . hasMoreElements ( ) ) { SearchResult thisEntry = nenu . nextElement ( ) ; if ( thisEntry == null ) { continue ; } String returnedDN = LdapHelper . prepareDN ( thisEntry . getName ( ) , searchBase ) ; if ( dn . equalsIgnoreCase ( returnedDN ) ) { result = true ; break ; } } } } } } } return result ; } | Determine whether the distinguished name is in the LDAP URL query . |
162,198 | public SearchResult searchByOperationalAttribute ( String dn , String filter , List < String > inEntityTypes , List < String > propNames , String oprAttribute ) throws WIMException { String inEntityType = null ; List < String > supportedProps = propNames ; if ( inEntityTypes != null && inEntityTypes . size ( ) > 0 ) { inEntityType = inEntityTypes . get ( 0 ) ; supportedProps = iLdapConfigMgr . getSupportedProperties ( inEntityType , propNames ) ; } String [ ] attrIds = iLdapConfigMgr . getAttributeNames ( inEntityTypes , supportedProps , false , false ) ; attrIds = Arrays . copyOf ( attrIds , attrIds . length + 1 ) ; attrIds [ attrIds . length - 1 ] = oprAttribute ; NamingEnumeration < SearchResult > neu = null ; neu = search ( dn , filter , SearchControls . OBJECT_SCOPE , attrIds , iCountLimit , iTimeLimit ) ; if ( neu != null ) { try { if ( neu . hasMore ( ) ) { return neu . next ( ) ; } } catch ( NamingException e ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } } return null ; } | Search using operational attribute specified in the parameter . |
162,199 | private String getBinaryAttributes ( ) { StringBuffer binaryAttrNamesBuffer = new StringBuffer ( ) ; Map < String , LdapAttribute > attrMap = iLdapConfigMgr . getAttributes ( ) ; for ( String attrName : attrMap . keySet ( ) ) { LdapAttribute attr = attrMap . get ( attrName ) ; if ( LdapConstants . LDAP_ATTR_SYNTAX_OCTETSTRING . equalsIgnoreCase ( attr . getSyntax ( ) ) ) { binaryAttrNamesBuffer . append ( attr . getName ( ) ) . append ( " " ) ; } } return binaryAttrNamesBuffer . toString ( ) . trim ( ) ; } | Get the list of configure binary attributes . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.