idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
160,400
|
private String getCallerUniqueName ( ) throws WIMApplicationException { String uniqueName = null ; Subject subject = null ; WSCredential cred = null ; try { /* Get the subject */ if ( ( subject = WSSubject . getRunAsSubject ( ) ) == null ) { subject = WSSubject . getCallerSubject ( ) ; } /* Get the credential */ if ( subject != null ) { Iterator < WSCredential > iter = subject . getPublicCredentials ( WSCredential . class ) . iterator ( ) ; if ( iter . hasNext ( ) ) { cred = iter . next ( ) ; } } /* Get the unique name */ if ( cred == null ) return null ; else uniqueName = cred . getUniqueSecurityName ( ) ; } //throw exception in case there is some issue while retrieving authentication details from subject catch ( Exception excp ) { excp . getMessage ( ) ; return null ; } //return unique name obtained from subject return uniqueName ; }
|
Helper function returns the caller s unique name . Created to use for logging the calls to clear cache with clearAll mode .
| 214
| 24
|
160,401
|
private Entity createEntityFromLdapEntry ( Object parentDO , String propName , LdapEntry ldapEntry , List < String > propNames ) throws WIMException { final String METHODNAME = "createEntityFromLdapEntry" ; String outEntityType = ldapEntry . getType ( ) ; Entity outEntity = null ; // For changed entities, when change type is delete, it is possible that // the type of entity (which maps to the LDAP entry's objectclass is not // available. if ( outEntityType != null ) { if ( outEntityType . equalsIgnoreCase ( SchemaConstants . DO_PERSON ) ) outEntity = new Person ( ) ; else if ( outEntityType . equalsIgnoreCase ( SchemaConstants . DO_PERSON_ACCOUNT ) ) outEntity = new PersonAccount ( ) ; else if ( outEntityType . equalsIgnoreCase ( SchemaConstants . DO_GROUP ) ) outEntity = new Group ( ) ; else outEntity = new Entity ( ) ; } else { outEntity = new Entity ( ) ; } if ( parentDO instanceof Root ) { if ( SchemaConstants . DO_ENTITIES . equalsIgnoreCase ( propName ) ) ( ( Root ) parentDO ) . getEntities ( ) . add ( outEntity ) ; } else if ( parentDO instanceof Entity ) { if ( SchemaConstants . DO_GROUP . equalsIgnoreCase ( propName ) ) { /* * May get back plain entities if objectclass for group entity and * group filters don't match up identically. */ if ( outEntity instanceof Group ) { ( ( Entity ) parentDO ) . getGroups ( ) . add ( ( Group ) outEntity ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " Expected group entity. Group will excluded from group membership. Entity is " + outEntity , ldapEntry ) ; } } } else if ( SchemaConstants . DO_MEMBERS . equalsIgnoreCase ( propName ) ) { ( ( Group ) parentDO ) . getMembers ( ) . add ( outEntity ) ; } else if ( SchemaConstants . DO_CHILDREN . equalsIgnoreCase ( propName ) ) { ( ( Entity ) parentDO ) . getChildren ( ) . add ( outEntity ) ; } } IdentifierType outId = new IdentifierType ( ) ; outEntity . setIdentifier ( outId ) ; outId . setUniqueName ( ldapEntry . getUniqueName ( ) ) ; outId . setExternalId ( ldapEntry . getExtId ( ) ) ; outId . setExternalName ( ldapEntry . getDN ( ) ) ; outId . setRepositoryId ( reposId ) ; String changeType = ldapEntry . getChangeType ( ) ; if ( changeType != null ) { outEntity . setChangeType ( changeType ) ; if ( SchemaConstants . CHANGETYPE_DELETE . equals ( changeType ) == false ) { populateEntity ( outEntity , propNames , ldapEntry . getAttributes ( ) ) ; } } else { populateEntity ( outEntity , propNames , ldapEntry . getAttributes ( ) ) ; } return outEntity ; }
|
Create an Entity object corresponding to the LdapEntry object returned by the LdapConnection object .
| 723
| 21
|
160,402
|
@ Trivial private String getString ( boolean isOctet , Object ldapValue ) { if ( isOctet ) { return LdapHelper . getOctetString ( ( byte [ ] ) ldapValue ) ; } else { return ldapValue . toString ( ) ; } }
|
Convert the value into an appropriate string value .
| 66
| 10
|
160,403
|
private String getDateString ( Object ldapValue ) throws WIMSystemException { return String . valueOf ( getDateString ( ldapValue , false ) ) ; }
|
Convert the value into an appropriate date string value .
| 38
| 11
|
160,404
|
@ Trivial private IdentifierType createIdentiferFromLdapEntry ( LdapEntry ldapEntry ) throws WIMException { IdentifierType outId = new IdentifierType ( ) ; outId . setUniqueName ( ldapEntry . getUniqueName ( ) ) ; outId . setExternalId ( ldapEntry . getExtId ( ) ) ; outId . setExternalName ( ldapEntry . getDN ( ) ) ; outId . setRepositoryId ( reposId ) ; return outId ; }
|
Create an IdentifierType object for the LdapEntry .
| 118
| 13
|
160,405
|
@ SuppressWarnings ( "unchecked" ) private void setPropertyValue ( Entity entity , Attribute attr , String propName , LdapAttribute ldapAttr ) throws WIMException { String dataType = entity . getDataType ( propName ) ; boolean isMany = entity . isMultiValuedProperty ( propName ) ; String syntax = LDAP_ATTR_SYNTAX_STRING ; if ( ldapAttr != null ) { syntax = ldapAttr . getSyntax ( ) ; if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "ldapAttr " + ldapAttr + " syntax is " + syntax ) ; } } try { if ( isMany ) { for ( NamingEnumeration < ? > enu = attr . getAll ( ) ; enu . hasMoreElements ( ) ; ) { Object ldapValue = enu . nextElement ( ) ; if ( ldapValue != null ) { entity . set ( propName , processPropertyValue ( entity , propName , dataType , syntax , ldapValue ) ) ; } } } else { Object ldapValue = attr . get ( ) ; if ( ldapValue != null ) { entity . set ( propName , processPropertyValue ( entity , propName , dataType , syntax , ldapValue ) ) ; } } } catch ( NamingException e ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unexpected on " + propName + " with dataType " + dataType , e ) ; } String msg = Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ; throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , msg , e ) ; } catch ( ClassCastException ce ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Failed to cast property " + propName + " to " + dataType , ce ) ; } if ( tc . isErrorEnabled ( ) ) Tr . error ( tc , WIMMessageKey . INVALID_PROPERTY_DATA_TYPE , WIMMessageHelper . generateMsgParms ( propName ) ) ; } catch ( ArrayStoreException ae ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unexpected on " + propName + " with dataType " + dataType , ae ) ; } if ( tc . isErrorEnabled ( ) ) Tr . error ( tc , WIMMessageKey . INVALID_PROPERTY_DATA_TYPE , WIMMessageHelper . generateMsgParms ( propName ) ) ; } }
|
Set the appropriate value for the specified property .
| 620
| 9
|
160,406
|
private Object processPropertyValue ( Entity entity , String propName , final String dataType , final String syntax , Object ldapValue ) throws WIMException { if ( DATA_TYPE_STRING . equals ( dataType ) ) { boolean octet = LDAP_ATTR_SYNTAX_OCTETSTRING . equalsIgnoreCase ( syntax ) ; return getString ( octet , ldapValue ) ; } else if ( DATA_TYPE_DATE_TIME . equals ( dataType ) ) { return getDateString ( ldapValue ) ; } else if ( DATA_TYPE_DATE . equals ( dataType ) ) { return getDateObject ( ldapValue ) ; } else if ( DATA_TYPE_INT . equals ( dataType ) ) { return Integer . parseInt ( ldapValue . toString ( ) ) ; } else if ( DATA_TYPE_IDENTIFIER_TYPE . equals ( dataType ) ) { try { String stringValue = ( String ) ldapValue ; LdapEntry ldapEntry = iLdapConn . getEntityByIdentifier ( stringValue , null , null , null , null , false , false ) ; return createIdentiferFromLdapEntry ( ldapEntry ) ; } catch ( WIMException we ) { if ( WIMMessageKey . LDAP_ENTRY_NOT_FOUND . equalsIgnoreCase ( we . getMessageKey ( ) ) ) { String msg = Tr . formatMessage ( tc , WIMMessageKey . INVALID_PROPERTY_VALUE , WIMMessageHelper . generateMsgParms ( propName , entity . getIdentifier ( ) . getExternalName ( ) ) ) ; throw new WIMSystemException ( WIMMessageKey . INVALID_PROPERTY_VALUE , msg ) ; } else { throw we ; } } } else if ( DATA_TYPE_BASE_64_BINARY . equals ( dataType ) ) { return ldapValue ; } else if ( DATA_TYPE_LANG_TYPE . equals ( dataType ) ) { LangType lang = new LangType ( ) ; lang . setValue ( String . valueOf ( ldapValue ) ) ; return lang ; } else if ( DATA_TYPE_BOOLEAN . equals ( dataType ) ) { return Boolean . parseBoolean ( ldapValue . toString ( ) ) ; } else if ( DATA_TYPE_LONG . equals ( dataType ) ) { //PI05723 return Long . parseLong ( ldapValue . toString ( ) ) ; } else { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Datatype for " + propName + " was null, process without casting" ) ; } return ldapValue ; } }
|
Process the value of a property .
| 608
| 7
|
160,407
|
private void getGroups ( Entity entity , LdapEntry ldapEntry , GroupMembershipControl grpMbrshipCtrl ) throws WIMException { if ( grpMbrshipCtrl == null ) { return ; } int level = grpMbrshipCtrl . getLevel ( ) ; List < String > propNames = grpMbrshipCtrl . getProperties ( ) ; String [ ] bases = null ; List < String > searchBases = grpMbrshipCtrl . getSearchBases ( ) ; int size = searchBases . size ( ) ; String [ ] grpBases = iLdapConfigMgr . getGroupSearchBases ( ) ; if ( size == 0 ) { // New:: Default search bases to top level nodes if no group level search bases are defined if ( grpBases . length != 0 ) bases = grpBases ; else bases = iLdapConfigMgr . getTopLdapNodes ( ) ; } else { List < String > baseList = new ArrayList < String > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { String uName = searchBases . get ( i ) ; String dn = getDN ( uName , null , null , true , false ) ; baseList . add ( dn ) ; } bases = baseList . toArray ( new String [ 0 ] ) ; } bases = NodeHelper . getTopNodes ( bases ) ; if ( iLdapConfigMgr . getMembershipAttribute ( ) != null ) { if ( iLdapConfigMgr . isRacf ( ) ) getGroupsByMembershipRacf ( entity , ldapEntry , bases , level , propNames , null ) ; else { getGroupsByMembership ( entity , ldapEntry , bases , level , propNames , null ) ; } } else { // If operational attribute "ibm-allGroups" is specified in groupMemberIdMap, then get groups using operational attr "ibm-allGroups" if ( LdapConstants . IDS_LDAP_SERVER . equalsIgnoreCase ( iLdapConfigMgr . getLdapType ( ) ) && iLdapConfigMgr . isLdapOperationalAttributeSet ( ) ) getGroupsByOperationalAttribute ( entity , ldapEntry , bases , level , propNames ) ; else { getGroupsByMember ( entity , ldapEntry , bases , level , propNames , null ) ; } } }
|
Method to get the Groups for the given entity .
| 556
| 10
|
160,408
|
private List < String > getDynamicMembers ( Attribute groupMemberURLs ) throws WIMException { final String METHODNAME = "getDynamicMembers" ; List < String > memberDNs = new ArrayList < String > ( ) ; if ( groupMemberURLs != null ) { try { for ( NamingEnumeration < ? > enu = groupMemberURLs . getAll ( ) ; enu . hasMoreElements ( ) ; ) { String ldapurlStr = ( String ) ( enu . nextElement ( ) ) ; if ( ldapurlStr != null ) { LdapURL ldapURL = new LdapURL ( ldapurlStr ) ; if ( ldapURL . parsedOK ( ) ) { int searchScope = SearchControls . OBJECT_SCOPE ; String scopeBuf = ldapURL . get_scope ( ) ; if ( scopeBuf != null ) { if ( scopeBuf . compareToIgnoreCase ( "base" ) == 0 ) { searchScope = SearchControls . OBJECT_SCOPE ; } else if ( scopeBuf . compareToIgnoreCase ( "one" ) == 0 ) { searchScope = SearchControls . ONELEVEL_SCOPE ; } else if ( scopeBuf . compareToIgnoreCase ( "sub" ) == 0 ) { searchScope = SearchControls . SUBTREE_SCOPE ; } } String searchFilter = ldapURL . get_filter ( ) ; if ( searchFilter == null ) { searchFilter = "(objectClass=*)" ; } String searchBase = ldapURL . get_dn ( ) ; String [ ] attributesToReturn = ldapURL . get_attributes ( ) ; for ( NamingEnumeration < ? > nenu = iLdapConn . search ( searchBase , searchFilter , searchScope , attributesToReturn ) ; nenu . hasMoreElements ( ) ; ) { javax . naming . directory . SearchResult thisEntry = ( javax . naming . directory . SearchResult ) nenu . nextElement ( ) ; if ( thisEntry == null ) { continue ; } String dynaMbrDN = LdapHelper . prepareDN ( thisEntry . getName ( ) , searchBase ) ; memberDNs . add ( dynaMbrDN ) ; } } } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , METHODNAME + " LDAP URL=null." ) ; } } } } catch ( NamingException e ) { throw new WIMSystemException ( WIMMessageKey . NAMING_EXCEPTION , Tr . formatMessage ( tc , WIMMessageKey . NAMING_EXCEPTION , WIMMessageHelper . generateMsgParms ( e . toString ( true ) ) ) ) ; } } return memberDNs ; }
|
Method to get the list of dynamic members from the given Group Member URL .
| 627
| 15
|
160,409
|
private void getDescendants ( Entity entity , LdapEntry ldapEntry , DescendantControl descCtrl ) throws WIMException { if ( descCtrl == null ) { return ; } List < String > propNames = descCtrl . getProperties ( ) ; int level = descCtrl . getLevel ( ) ; List < String > descTypes = getEntityTypes ( descCtrl ) ; String [ ] bases = getBases ( descCtrl , descTypes ) ; boolean treeView = descCtrl . isSetTreeView ( ) ; int scope = SearchControls . ONELEVEL_SCOPE ; if ( level == 0 && ! treeView ) { scope = SearchControls . SUBTREE_SCOPE ; } Set < String > descToDo = new HashSet < String > ( ) ; Map < String , Entity > descendants = new HashMap < String , Entity > ( ) ; Set < LdapEntry > descEntries = iLdapConn . searchEntities ( ldapEntry . getDN ( ) , "objectClass=*" , null , scope , descTypes , propNames , false , false ) ; for ( LdapEntry descEntry : descEntries ) { String descType = descEntry . getType ( ) ; String descDn = descEntry . getDN ( ) ; Entity descendant = null ; if ( LdapHelper . isUnderBases ( descDn , bases ) && descTypes . contains ( descType ) ) { descendant = createEntityFromLdapEntry ( entity , SchemaConstants . DO_CHILDREN , descEntry , propNames ) ; } else if ( treeView ) { descendant = createEntityFromLdapEntry ( entity , SchemaConstants . DO_CHILDREN , descEntry , null ) ; } if ( treeView ) { descToDo . add ( descDn ) ; descendants . put ( descDn , descendant ) ; } } if ( treeView ) { while ( descToDo . size ( ) > 0 ) { Set < String > nextDescs = new HashSet < String > ( ) ; for ( String dn : descToDo ) { Entity parent = descendants . get ( dn ) ; descEntries = iLdapConn . searchEntities ( dn , "objectClass=*" , null , scope , descTypes , propNames , false , false ) ; for ( LdapEntry descEntry : descEntries ) { String descType = descEntry . getType ( ) ; String descDn = descEntry . getDN ( ) ; Entity descendant = null ; if ( descTypes . contains ( descType ) ) { descendant = createEntityFromLdapEntry ( parent , SchemaConstants . DO_CHILDREN , descEntry , propNames ) ; } else if ( treeView ) { descendant = createEntityFromLdapEntry ( parent , SchemaConstants . DO_CHILDREN , descEntry , null ) ; } if ( ! descToDo . contains ( descDn ) ) { nextDescs . add ( descDn ) ; descendants . put ( descDn , descendant ) ; } } } descToDo = nextDescs ; } } }
|
Method to get the list of descendants .
| 688
| 8
|
160,410
|
private void getAncestors ( Entity entity , LdapEntry ldapEntry , AncestorControl ancesCtrl ) throws WIMException { if ( ancesCtrl == null ) { return ; } List < String > propNames = ancesCtrl . getProperties ( ) ; int level = ancesCtrl . getLevel ( ) ; List < String > ancesTypes = getEntityTypes ( ancesCtrl ) ; String [ ] bases = getBases ( ancesCtrl , ancesTypes ) ; String dn = ldapEntry . getDN ( ) ; List < String > ancestorDns = iLdapConn . getAncestorDNs ( dn , level ) ; Entity parentEntity = entity ; for ( int i = 0 ; i < ancestorDns . size ( ) ; i ++ ) { String ancesDn = ancestorDns . get ( i ) ; if ( ancesDn . length ( ) == 0 ) { continue ; } if ( LdapHelper . isUnderBases ( ancesDn , bases ) ) { LdapEntry ancesEntry = iLdapConn . getEntityByIdentifier ( ancesDn , null , null , ancesTypes , propNames , false , false ) ; String ancesType = ancesEntry . getType ( ) ; Entity ancestor = null ; if ( ancesTypes . contains ( ancesType ) ) { ancestor = createEntityFromLdapEntry ( parentEntity , SchemaConstants . DO_PARENT , ancesEntry , propNames ) ; } else { ancestor = createEntityFromLdapEntry ( parentEntity , SchemaConstants . DO_PARENT , ancesEntry , null ) ; } parentEntity = ancestor ; } } }
|
Method to get the ancestors of the given entity .
| 375
| 10
|
160,411
|
public static Set < String > getSpecifiedRealms ( Root root ) { Set < String > result = new HashSet < String > ( ) ; List < Context > contexts = root . getContexts ( ) ; for ( Context context : contexts ) { String key = context . getKey ( ) ; if ( key != null && key . equals ( SchemaConstants . PROP_REALM ) ) { String value = ( String ) context . getValue ( ) ; result . add ( value ) ; } } return result ; }
|
return the specified realms from the root object of the input data graph
| 113
| 13
|
160,412
|
public static String getContextProperty ( Root root , String propertyName ) { String result = "" ; List < Context > contexts = root . getContexts ( ) ; for ( Context context : contexts ) { String key = context . getKey ( ) ; if ( key != null && key . equals ( propertyName ) ) { result = ( String ) context . getValue ( ) ; break ; } } return result ; }
|
return the customProperty from the root object of the input data graph
| 87
| 13
|
160,413
|
private boolean isEntitySearchBaseConfigured ( List < String > mbrTypes ) { String METHODNAME = "isEntitySearchBaseConfigured(mbrTypes)" ; boolean isConfigured = false ; if ( mbrTypes != null ) { for ( String mbrType : mbrTypes ) { LdapEntity ldapEntity = iLdapConfigMgr . getLdapEntity ( mbrType ) ; if ( ldapEntity != null && ldapEntity . isSearchBaseConfigured ( ) ) { isConfigured = true ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " Search base is explicitly configured for " + mbrType + ": " + ldapEntity . getSearchBaseList ( ) ) ; } } } return isConfigured ; }
|
Checks if a search base is configured for the entity types .
| 180
| 13
|
160,414
|
private List < LdapEntry > deleteAll ( LdapEntry ldapEntry , boolean delDescendant ) throws WIMException { String dn = ldapEntry . getDN ( ) ; List < LdapEntry > delEntries = new ArrayList < LdapEntry > ( ) ; List < LdapEntry > descs = getDescendants ( dn , SearchControls . ONELEVEL_SCOPE ) ; if ( descs . size ( ) > 0 ) { if ( delDescendant ) { for ( int i = 0 ; i < descs . size ( ) ; i ++ ) { LdapEntry descEntry = descs . get ( i ) ; delEntries . addAll ( deleteAll ( descEntry , true ) ) ; } } else { throw new EntityHasDescendantsException ( WIMMessageKey . ENTITY_HAS_DESCENDENTS , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_HAS_DESCENDENTS , WIMMessageHelper . generateMsgParms ( dn ) ) ) ; } } /* Call the preexit function */ deletePreExit ( dn ) ; List < String > grpList = getGroups ( dn ) ; iLdapConn . getContextManager ( ) . destroySubcontext ( dn ) ; delEntries . add ( ldapEntry ) ; for ( int i = 0 ; i < grpList . size ( ) ; i ++ ) { String grpDN = grpList . get ( i ) ; iLdapConn . invalidateAttributes ( grpDN , null , null ) ; } return delEntries ; }
|
Delete the descendants of the specified ldap entry .
| 360
| 11
|
160,415
|
private List < LdapEntry > getDescendants ( String DN , int level ) throws WIMException { int scope = SearchControls . ONELEVEL_SCOPE ; if ( level == 0 ) { scope = SearchControls . SUBTREE_SCOPE ; } List < LdapEntry > descendants = new ArrayList < LdapEntry > ( ) ; Set < LdapEntry > ldapEntries = iLdapConn . searchEntities ( DN , "objectClass=*" , null , scope , null , null , false , false ) ; for ( Iterator < LdapEntry > iter = ldapEntries . iterator ( ) ; iter . hasNext ( ) ; ) { LdapEntry entry = iter . next ( ) ; descendants . add ( entry ) ; } return descendants ; }
|
Get all the descendants of the given DN .
| 179
| 9
|
160,416
|
private List < String > getGroups ( String dn ) throws WIMException { List < String > grpList = new ArrayList < String > ( ) ; String filter = iLdapConfigMgr . getGroupMemberFilter ( dn ) ; String [ ] searchBases = iLdapConfigMgr . getGroupSearchBases ( ) ; for ( int i = 0 ; i < searchBases . length ; i ++ ) { String searchBase = searchBases [ i ] ; NamingEnumeration < SearchResult > nenu = iLdapConn . search ( searchBase , filter , SearchControls . SUBTREE_SCOPE , LDAP_ATTR_OBJECTCLASS_ARRAY ) ; while ( nenu . hasMoreElements ( ) ) { SearchResult thisEntry = nenu . nextElement ( ) ; if ( thisEntry == null ) { continue ; } String entryName = thisEntry . getName ( ) ; if ( entryName == null || entryName . trim ( ) . length ( ) == 0 ) { continue ; } grpList . add ( LdapHelper . prepareDN ( entryName , searchBase ) ) ; } } return grpList ; }
|
Get the groups that contain the specified DN as its member .
| 267
| 12
|
160,417
|
private void updateGroupMember ( String oldDN , String newDN ) throws WIMException { if ( ! iLdapConfigMgr . updateGroupMembership ( ) ) { return ; } String filter = iLdapConfigMgr . getGroupMemberFilter ( oldDN ) ; String [ ] mbrAttrs = iLdapConfigMgr . getMemberAttributes ( ) ; Map < String , ModificationItem [ ] > mbrAttrMap = new HashMap < String , ModificationItem [ ] > ( mbrAttrs . length ) ; for ( int i = 0 ; i < mbrAttrs . length ; i ++ ) { String mbrAttr = mbrAttrs [ i ] ; ModificationItem removeAttr = new ModificationItem ( DirContext . REMOVE_ATTRIBUTE , new BasicAttribute ( mbrAttr , oldDN ) ) ; ModificationItem [ ] modifAttrs = null ; if ( newDN != null ) { ModificationItem addAttr = new ModificationItem ( DirContext . ADD_ATTRIBUTE , new BasicAttribute ( mbrAttr , newDN ) ) ; modifAttrs = new ModificationItem [ 2 ] ; modifAttrs [ 0 ] = addAttr ; modifAttrs [ 1 ] = removeAttr ; } else { modifAttrs = new ModificationItem [ 1 ] ; modifAttrs [ 0 ] = removeAttr ; } mbrAttrMap . put ( mbrAttr . toLowerCase ( ) , modifAttrs ) ; } String [ ] searchBases = iLdapConfigMgr . getGroupSearchBases ( ) ; for ( int i = 0 ; i < searchBases . length ; i ++ ) { String searchBase = searchBases [ i ] ; NamingEnumeration < SearchResult > nenu = iLdapConn . search ( searchBase , filter , SearchControls . SUBTREE_SCOPE , LDAP_ATTR_OBJECTCLASS_ARRAY ) ; while ( nenu . hasMoreElements ( ) ) { SearchResult thisEntry = nenu . nextElement ( ) ; if ( thisEntry == null ) { continue ; } String entryName = thisEntry . getName ( ) ; if ( entryName == null || entryName . trim ( ) . length ( ) == 0 ) { continue ; } String DN = LdapHelper . prepareDN ( entryName , searchBase ) ; Attributes attrs = thisEntry . getAttributes ( ) ; String [ ] thisMbrAttrs = iLdapConfigMgr . getMemberAttribute ( attrs . get ( LDAP_ATTR_OBJECTCLASS ) ) ; if ( thisMbrAttrs != null ) { for ( int j = 0 ; j < thisMbrAttrs . length ; j ++ ) { ModificationItem [ ] attrsTobeModify = mbrAttrMap . get ( thisMbrAttrs [ j ] . toLowerCase ( ) ) ; if ( attrsTobeModify != null ) { try { iLdapConn . modifyAttributes ( DN , attrsTobeModify ) ; } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Updating group " + DN + " for " + oldDN + " failed due to: " + e . toString ( ) ) ; } } } } } } } }
|
Update the Group member
| 756
| 4
|
160,418
|
private AuditUtilityTask getTask ( String taskName ) { AuditUtilityTask task = null ; for ( AuditUtilityTask availTask : tasks ) { if ( availTask . getTaskName ( ) . equals ( taskName ) ) { task = availTask ; } } return task ; }
|
Given a task name return the corresponding AuditUtilityTask .
| 62
| 12
|
160,419
|
static int objectType ( Object value ) { if ( value instanceof String ) return STRING ; else if ( value instanceof Boolean ) // was BooleanValue return BOOLEAN ; else if ( value instanceof Number ) //was NumericValue // NumericValue types are ordered INT..DOUBLE starting at zero. Selector types are // ordered INT..DOUBLE starting at Selector.INT. return EvaluatorImpl . getType ( ( Number ) value ) + Selector . INT ; // was ((NumericValue) value).type() else if ( value instanceof Serializable ) return OBJECT ; else return INVALID ; }
|
Determine Selector type code of a Literal value according to its class . Used by the Literal constructor and by the Evaluator
| 136
| 29
|
160,420
|
private Cookie convertHttpCookie ( HttpCookie cookie ) { Cookie rc = new Cookie ( cookie . getName ( ) , cookie . getValue ( ) ) ; rc . setVersion ( cookie . getVersion ( ) ) ; if ( null != cookie . getPath ( ) ) { rc . setPath ( cookie . getPath ( ) ) ; } if ( null != cookie . getDomain ( ) ) { rc . setDomain ( cookie . getDomain ( ) ) ; } rc . setMaxAge ( cookie . getMaxAge ( ) ) ; rc . setSecure ( cookie . isSecure ( ) ) ; return rc ; }
|
Convert the transport cookie to a J2EE cookie .
| 132
| 12
|
160,421
|
private static ResponseSwitch getResponseSwitch ( Object response ) { // unwrap the response until we find a ResponseSwitch while ( response != null ) { if ( response instanceof ResponseSwitch ) { // found return ( ResponseSwitch ) response ; } if ( response instanceof ServletResponseWrapper ) { // unwrap response = ( ( ServletResponseWrapper ) response ) . getResponse ( ) ; } // no more possibilities to find a ResponseSwitch break ; } return null ; // not found }
|
Trys to obtain a ResponseSwitch from the Response .
| 102
| 11
|
160,422
|
private static ResponseSwitch createResponseSwitch ( Object response ) { if ( response instanceof HttpServletResponse ) { return new HttpServletResponseSwitch ( ( HttpServletResponse ) response ) ; } else if ( response instanceof ServletResponse ) { return new ServletResponseSwitch ( ( ServletResponse ) response ) ; } return null ; }
|
Try to create a ResponseSwitch for this response .
| 75
| 10
|
160,423
|
private void updateFederatedManagerService ( ) { if ( ! activated ) { return ; } if ( profileManager . getReference ( ) != null ) { Tr . info ( tc , "FEDERATED_MANAGER_SERVICE_READY" ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Some required federated manager services are not available." ) ; } } }
|
Federated Manager is ready when all of these required services have been registered .
| 104
| 16
|
160,424
|
private SSLConfig parseSSLConfig ( Map < String , Object > properties , boolean reinitialize ) throws Exception { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "parseSSLConfig: " + properties . get ( LibertyConstants . KEY_ID ) , properties ) ; SSLConfig rc = parseSecureSocketLayer ( properties , reinitialize ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "parseSSLConfig" ) ; return rc ; }
|
Helper method to build the SSLConfig properties from the SSLConfig model object .
| 127
| 15
|
160,425
|
public synchronized SSLConfig getSSLConfig ( String alias ) throws IllegalArgumentException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getSSLConfig: " + alias ) ; SSLConfig rc = null ; if ( alias == null || alias . equals ( "" ) ) { rc = getDefaultSSLConfig ( ) ; } else { // sslConfigMap is not yet populated!!! rc = sslConfigMap . get ( alias ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getSSLConfig" , rc ) ; return rc ; }
|
Finds an SSLConfig from the Map given an alias .
| 149
| 12
|
160,426
|
public synchronized void loadGlobalProperties ( Map < String , Object > map ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "loadGlobalProperties" ) ; // clear before reloading. globalConfigProperties . clear ( ) ; for ( Entry < String , Object > prop : map . entrySet ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Setting global property: " + prop . getKey ( ) + "=" + prop . getValue ( ) ) ; } globalConfigProperties . setProperty ( prop . getKey ( ) , ( String ) prop . getValue ( ) ) ; } // Check for dynamic outbound and default config conflicts String outboundDefaultAlias = getGlobalProperty ( LibertyConstants . SSLPROP_OUTBOUND_DEFAULT_ALIAS ) ; if ( outboundDefaultAlias != null && isTransportSecurityEnabled ( ) ) outboundSSL . checkDefaultConflict ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "loadGlobalProperties" ) ; }
|
Helper method for loading global properties .
| 269
| 7
|
160,427
|
@ Trivial private void set ( Class < ? > builderCls , Object builder , String propName , Object value ) throws IntrospectionException , IllegalArgumentException , IllegalAccessException , InvocationTargetException { try { Class < ? > cls = COUCHDB_CLIENT_OPTIONS_TYPES . get ( propName ) ; // setter methods are just propName, not setPropName. Method method = builderCls . getMethod ( propName , cls ) ; // even though we told the config service that some of these props are Integers, they // get converted to longs. Need // to convert them back to int so that our .invoke(..) method doesn't blow up. if ( cls . equals ( int . class ) && value instanceof Long ) { value = ( ( Long ) value ) . intValue ( ) ; } if ( propName . equals ( "password" ) ) { SerializableProtectedString password = ( SerializableProtectedString ) value ; String pwdStr = password == null ? null : String . valueOf ( password . getChars ( ) ) ; value = PasswordUtil . getCryptoAlgorithm ( pwdStr ) == null ? pwdStr : PasswordUtil . decode ( pwdStr ) ; } method . invoke ( builder , value ) ; return ; } catch ( Throwable x ) { if ( x instanceof InvocationTargetException ) x = x . getCause ( ) ; IllegalArgumentException failure = ignoreWarnOrFail ( x , IllegalArgumentException . class , "CWKKD0010.prop.error" , propName , COUCHDB , id , x ) ; if ( failure != null ) { FFDCFilter . processException ( failure , getClass ( ) . getName ( ) , "394" , this , new Object [ ] { value == null ? null : value . getClass ( ) , value } ) ; throw failure ; } } }
|
Configure a couchdb option .
| 419
| 7
|
160,428
|
private void configureJMSConnectionFactories ( List < JMSConnectionFactory > jmsConnFactories ) { Map < String , ConfigItem < JMSConnectionFactory > > jmsCfConfigItemMap = configurator . getConfigItemMap ( JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) ) ; for ( JMSConnectionFactory jmsConnFactory : jmsConnFactories ) { String name = jmsConnFactory . getName ( ) ; if ( name == null ) { continue ; } ConfigItem < JMSConnectionFactory > existedCF = jmsCfConfigItemMap . get ( name ) ; if ( existedCF == null ) { jmsCfConfigItemMap . put ( name , createConfigItem ( jmsConnFactory , JMS_CF_COMPARATOR ) ) ; webAppConfiguration . addRef ( JNDIEnvironmentRefType . JMSConnectionFactory , jmsConnFactory ) ; } else { if ( existedCF . getSource ( ) == ConfigSource . WEB_XML && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "{0}.{1} with value {2} is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored" , JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) , "name" , existedCF . getValue ( ) , name , configurator . getLibraryURI ( ) ) ; } } else if ( existedCF . getSource ( ) == ConfigSource . WEB_FRAGMENT && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT && ! existedCF . compareValue ( jmsConnFactory ) ) { configurator . addErrorMessage ( nls . getFormattedMessage ( "CONFLICT_JMS_CONNECTION_FACTORY_REFERENCE_BETWEEN_WEB_FRAGMENT_XML" , new Object [ ] { name , existedCF . getLibraryURI ( ) , this . configurator . getLibraryURI ( ) } , "Two " + JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) + " configurations with the same name {0} found in the web-fragment.xml of {1} and {2}." ) ) ; } } } }
|
To configure JMS ConnectionFactory
| 556
| 6
|
160,429
|
private void configureJMSDestinations ( List < JMSDestination > jmsDestinations ) { Map < String , ConfigItem < JMSDestination > > jmsDestinationConfigItemMap = configurator . getConfigItemMap ( JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) ) ; for ( JMSDestination jmsDestination : jmsDestinations ) { String name = jmsDestination . getName ( ) ; if ( name == null ) { continue ; } ConfigItem < JMSDestination > existedCF = jmsDestinationConfigItemMap . get ( name ) ; if ( existedCF == null ) { jmsDestinationConfigItemMap . put ( name , createConfigItem ( jmsDestination , JMS_DESTINATION_COMPARATOR ) ) ; webAppConfiguration . addRef ( JNDIEnvironmentRefType . JMSDestination , jmsDestination ) ; } else { if ( existedCF . getSource ( ) == ConfigSource . WEB_XML && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "{0}.{1} with value {2} is configured in web.xml, the value {3} from web-fragment.xml in {4} is ignored" , JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) , "name" , existedCF . getValue ( ) , name , configurator . getLibraryURI ( ) ) ; } } else if ( existedCF . getSource ( ) == ConfigSource . WEB_FRAGMENT && configurator . getConfigSource ( ) == ConfigSource . WEB_FRAGMENT && ! existedCF . compareValue ( jmsDestination ) ) { configurator . addErrorMessage ( nls . getFormattedMessage ( "CONFLICT_JMS_DESTINATION_REFERENCE_BETWEEN_WEB_FRAGMENT_XML" , new Object [ ] { name , existedCF . getLibraryURI ( ) , this . configurator . getLibraryURI ( ) } , "Two " + JNDIEnvironmentRefType . JMSConnectionFactory . getXMLElementName ( ) + " configurations with the same name {0} found in the web-fragment.xml of {1} and {2}." ) ) ; } } } }
|
To configure JMS Destinations
| 553
| 6
|
160,430
|
public static final RequestType getRequestType ( ExternalContext externalContext ) { //Stuff is laid out strangely in this class in order to optimize //performance. We want to do as few instanceof's as possible so //things are laid out according to the expected frequency of the //various requests occurring. if ( _PORTLET_10_SUPPORTED || _PORTLET_20_SUPPORTED ) { if ( _PORTLET_CONTEXT_CLASS . isInstance ( externalContext . getContext ( ) ) ) { //We are inside of a portlet container Object request = externalContext . getRequest ( ) ; if ( _PORTLET_RENDER_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . RENDER ; } if ( _PORTLET_RESOURCE_REQUEST_CLASS != null ) { if ( _PORTLET_ACTION_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . ACTION ; } //We are in a JSR-286 container if ( _PORTLET_RESOURCE_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . RESOURCE ; } return RequestType . EVENT ; } return RequestType . ACTION ; } } return RequestType . SERVLET ; }
|
Returns the requestType of this ExternalContext .
| 266
| 9
|
160,431
|
public static final RequestType getRequestType ( Object context , Object request ) { //Stuff is laid out strangely in this class in order to optimize //performance. We want to do as few instanceof's as possible so //things are laid out according to the expected frequency of the //various requests occurring. if ( _PORTLET_10_SUPPORTED || _PORTLET_20_SUPPORTED ) { if ( _PORTLET_CONFIG_CLASS . isInstance ( context ) || _PORTLET_CONTEXT_CLASS . isInstance ( context ) ) { //We are inside of a portlet container if ( _PORTLET_RENDER_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . RENDER ; } if ( _PORTLET_RESOURCE_REQUEST_CLASS != null ) { if ( _PORTLET_ACTION_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . ACTION ; } //We are in a JSR-286 container if ( _PORTLET_RESOURCE_REQUEST_CLASS . isInstance ( request ) ) { return RequestType . RESOURCE ; } return RequestType . EVENT ; } return RequestType . ACTION ; } } return RequestType . SERVLET ; }
|
This method is used when a ExternalContext object is not available like in TomahawkFacesContextFactory .
| 265
| 22
|
160,432
|
public static InputStream getRequestInputStream ( ExternalContext ec ) throws IOException { RequestType type = getRequestType ( ec ) ; if ( type . isRequestFromClient ( ) ) { Object req = ec . getRequest ( ) ; if ( type . isPortlet ( ) ) { return ( InputStream ) _runMethod ( req , "getPortletInputStream" ) ; } else { return ( ( ServletRequest ) ec . getRequest ( ) ) . getInputStream ( ) ; } } return null ; }
|
Returns the request input stream if one is available
| 111
| 9
|
160,433
|
private static Object _runMethod ( Object obj , String methodName ) { try { Method sessionIdMethod = obj . getClass ( ) . getMethod ( methodName ) ; return sessionIdMethod . invoke ( obj ) ; } catch ( Exception e ) { return null ; } }
|
Runs a method on an object and returns the result
| 58
| 11
|
160,434
|
public static HttpServletResponse getHttpServletResponse ( Object response ) { // unwrap the response until we find a HttpServletResponse while ( response != null ) { if ( response instanceof HttpServletResponse ) { // found return ( HttpServletResponse ) response ; } if ( response instanceof ServletResponseWrapper ) { // unwrap response = ( ( ServletResponseWrapper ) response ) . getResponse ( ) ; } // no more possibilities to find a HttpServletResponse break ; } return null ; // not found }
|
Trys to obtain a HttpServletResponse from the Response . Note that this method also trys to unwrap any ServletResponseWrapper in order to retrieve a valid HttpServletResponse .
| 119
| 42
|
160,435
|
public String addSymbol ( String symbol ) { // search for identical symbol int bucket = hash ( symbol ) % fTableSize ; int length = symbol . length ( ) ; OUTER : for ( Entry entry = fBuckets [ bucket ] ; entry != null ; entry = entry . next ) { if ( length == entry . characters . length ) { for ( int i = 0 ; i < length ; i ++ ) { if ( symbol . charAt ( i ) != entry . characters [ i ] ) { continue OUTER ; } } return entry . symbol ; } } // create new entry Entry entry = new Entry ( symbol , fBuckets [ bucket ] ) ; fBuckets [ bucket ] = entry ; return entry . symbol ; }
|
Adds the specified symbol to the symbol table and returns a reference to the unique symbol . If the symbol already exists the previous symbol reference is returned instead in order guarantee that symbol references remain unique .
| 157
| 38
|
160,436
|
static XARecoveryWrapper deserialize ( byte [ ] serializedWrapper ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deserialize" ) ; XARecoveryWrapper wrapper = null ; try { final ByteArrayInputStream bis = new ByteArrayInputStream ( serializedWrapper ) ; final ObjectInputStream oin = new ObjectInputStream ( bis ) ; wrapper = ( XARecoveryWrapper ) oin . readObject ( ) ; oin . close ( ) ; } catch ( ClassNotFoundException e ) { FFDCFilter . processException ( e , "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.deserialize" , "298" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Unable to deserialize an object from byte stream" , e ) ; String notfound = e . getMessage ( ) ; final int index = notfound . indexOf ( ":" ) ; notfound = notfound . substring ( index + 1 ) ; Tr . error ( tc , "WTRN0002_UNABLE_TO_FIND_RESOURCE_CLASS" , notfound ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.deserialize" , "306" ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Unable to deserialize an object from byte stream" , t ) ; Tr . error ( tc , "WTRN0040_OBJECT_DESERIALIZE_FAILED" , t ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deserialize" , wrapper ) ; return wrapper ; }
|
which classloader is passed in and which is on the thread .
| 405
| 13
|
160,437
|
private String [ ] canonicalise ( final String [ ] xaResInfoClasspath ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "canonicalise" , xaResInfoClasspath ) ; final String [ ] result ; if ( xaResInfoClasspath != null ) { final ArrayList < String > al = new ArrayList < String > ( ) ; for ( final String pathElement : xaResInfoClasspath ) { if ( pathElement != null ) { String cp ; try { cp = ( String ) TMHelper . runAsSystem ( new PrivilegedExceptionAction < String > ( ) { public String run ( ) throws Exception { String path = ( new File ( pathElement ) ) . getCanonicalPath ( ) ; //@D656080A if ( ! ( new File ( path ) ) . exists ( ) ) path = null ; //@D656080A return path ; //@D656080C } } ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.canonicalise" , "512" , this ) ; // can't do much else than .... cp = pathElement ; } if ( cp != null ) al . add ( cp ) ; // @D656080C } } if ( al . size ( ) > 0 ) // @D656080A { // @D656080A result = al . toArray ( new String [ al . size ( ) ] ) ; } // @D656080A else // @D656080A { // @D656080A result = null ; // @D656080A } // @D656080A } else { result = null ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "canonicalise" , result ) ; return result ; }
|
Canonicalise inbound paths so they can be compared with paths held in the classloaders
| 418
| 20
|
160,438
|
@ Override public void localTransactionCommitted ( ConnectionEvent event ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "localTransactionCommitted" ) ; } if ( event . getId ( ) == ConnectionEvent . LOCAL_TRANSACTION_COMMITTED ) { if ( mcWrapper . involvedInTransaction ( ) ) { /* * The ManagedConnection is associated with a transaction. * Delist the ManagedConnection from the transaction and * postpone release of the connection until transaction finishes. */ TranWrapper wrapper = null ; try { wrapper = mcWrapper . getCurrentTranWrapper ( ) ; wrapper . delist ( ) ; } catch ( ResourceException e ) { // Can't delist, something went wrong. // Destroy the connection(s) so it can't cause any future problems. FFDCFilter . processException ( e , "com.ibm.ejs.j2c.ConnectionEventListener.localTransactionCommitted" , "316" , "this" ) ; // add datasource name to message Tr . error ( tc , "DELIST_FAILED_J2CA0073" , "localTransactionCommitted" , e , mcWrapper . gConfigProps . cfName ) ; // Moved event.getSource() inside of catch block for performance reasons ManagedConnection mc = null ; try { mc = ( ManagedConnection ) event . getSource ( ) ; } catch ( ClassCastException cce ) { Tr . error ( tc , "GET_SOURCE_CLASS_CAST_EXCP_J2CA0098" , cce ) ; throw new IllegalStateException ( "ClassCastException occurred attempting to cast event.getSource to ManagedConnection" ) ; } ConnectionEvent errorEvent = new ConnectionEvent ( mc , ConnectionEvent . CONNECTION_ERROR_OCCURRED ) ; this . connectionErrorOccurred ( errorEvent ) ; RuntimeException rte = new IllegalStateException ( e . getMessage ( ) ) ; throw rte ; } } else { // if we are not involved in a transaction, then we are likely running with NO transaction // context on the thread. This case currently needs to be supported because // servlets can spin their own threads which would not have context. // Note: it is very rare that users do this. All other occurances are // considered to be an error. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "localTransactionCommitted" , "no transaction context, return without delisting" ) ; } return ; } } else { // Connection Event passed in doesn't match the method called. // This should never happen unless there is an error in the ResourceAdapter. processBadEvent ( "localTransactionCommitted" , ConnectionEvent . LOCAL_TRANSACTION_COMMITTED , event ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "localTransactionCommitted" ) ; } return ; }
|
This method is called by a resource adapter when a CCI local transation commit is called by the application on a connection . If the MC is associated with a UOW delist its corresponding transaction wrapper .
| 675
| 41
|
160,439
|
public boolean hasObjectWithPrefix ( NamingConstants . JavaColonNamespace namespace , String name ) throws NamingException { if ( namespace == NamingConstants . JavaColonNamespace . COMP ) { return hasObjectWithPrefix ( compLock , compBindings , name ) ; } if ( namespace == NamingConstants . JavaColonNamespace . COMP_ENV ) { return hasObjectWithPrefix ( compLock , compEnvBindings , name ) ; } if ( namespace == this . namespace ) { return hasObjectWithPrefix ( nonCompEnvLock , nonCompBindings , name ) ; } return false ; }
|
Returns true if a JNDI subcontext exists .
| 140
| 11
|
160,440
|
public Collection < ? extends NameClassPair > listInstances ( NamingConstants . JavaColonNamespace namespace , String contextName ) throws NamingException { if ( namespace == NamingConstants . JavaColonNamespace . COMP ) { return listInstances ( compLock , compBindings , contextName ) ; } if ( namespace == NamingConstants . JavaColonNamespace . COMP_ENV ) { return listInstances ( compLock , compEnvBindings , contextName ) ; } if ( namespace == this . namespace ) { return listInstances ( nonCompEnvLock , nonCompBindings , contextName ) ; } return Collections . emptyList ( ) ; }
|
Lists the contents of a JNDI subcontext .
| 149
| 12
|
160,441
|
private synchronized void disableDeferredReferenceData ( ) { deferredReferenceDataEnabled = false ; if ( parent != null && deferredReferenceDatas != null ) { parent . removeDeferredReferenceData ( this ) ; deferredReferenceDatas = null ; } }
|
Unregister this scope data with its parent if necessary for deferred reference data processing .
| 52
| 16
|
160,442
|
public synchronized void addDeferredReferenceData ( DeferredReferenceData refData ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "addDeferredReferenceData" , "this=" + this , refData ) ; } if ( deferredReferenceDatas == null ) { deferredReferenceDatas = new LinkedHashMap < DeferredReferenceData , Boolean > ( ) ; if ( parent != null && deferredReferenceDataEnabled ) { parent . addDeferredReferenceData ( this ) ; } } deferredReferenceDatas . put ( refData , null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "addDeferredReferenceData" ) ; } }
|
Add a child deferred reference data to this scope .
| 172
| 10
|
160,443
|
public synchronized void removeDeferredReferenceData ( DeferredReferenceData refData ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "removeDeferredReferenceData" , "this=" + this , refData ) ; } if ( deferredReferenceDatas != null ) { deferredReferenceDatas . remove ( refData ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "removeDeferredReferenceData" ) ; } }
|
Remove a child deferred reference data to this scope .
| 125
| 10
|
160,444
|
@ Override public boolean processDeferredReferenceData ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processDeferredReferenceData" , "this=" + this ) ; } Map < DeferredReferenceData , Boolean > deferredReferenceDatas ; synchronized ( this ) { deferredReferenceDatas = this . deferredReferenceDatas ; this . deferredReferenceDatas = null ; if ( parent != null ) { parent . removeDeferredReferenceData ( this ) ; } } boolean any = false ; if ( deferredReferenceDatas != null ) { for ( DeferredReferenceData refData : deferredReferenceDatas . keySet ( ) ) { try { any |= refData . processDeferredReferenceData ( ) ; } catch ( InjectionException ex ) { // We're processing all references in an attempt to locate // non-java:comp references, so we don't care about failures // (erroneous or conflicting metadata). Any exception that // is thrown will be rethrown by ReferenceContext.process // when the component is actually used. ex . getClass ( ) ; // findbugs } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "processDeferredReferenceData" , any ) ; } return any ; }
|
Process all child reference datas .
| 293
| 6
|
160,445
|
@ SuppressWarnings ( "unused" ) private static void releaseRenderer ( ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "releaseRenderer rendererMap -> " + delegateRendererMap . toString ( ) ) ; } ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "releaseRenderer classLoader -> " + classLoader . toString ( ) ) ; log . finest ( "releaseRenderer renderer -> " + delegateRendererMap . get ( classLoader ) ) ; } delegateRendererMap . remove ( classLoader ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "releaseRenderer renderMap -> " + delegateRendererMap . toString ( ) ) ; } }
|
The idea of this method is to be called from AbstractFacesInitializer .
| 208
| 16
|
160,446
|
public static String generateNonce ( int length ) { if ( length < 0 ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Negative length provided. Will default to nonce of length " + NONCE_LENGTH ) ; } length = NONCE_LENGTH ; } StringBuilder randomString = new StringBuilder ( ) ; SecureRandom r = new SecureRandom ( ) ; for ( int i = 0 ; i < length ; i ++ ) { int index = r . nextInt ( chars . length ) ; randomString . append ( chars [ index ] ) ; } return randomString . toString ( ) ; }
|
Generates a random string with the specified length .
| 138
| 10
|
160,447
|
public Subject authenticate ( CallbackHandler callbackHandler , Subject subject ) throws WSLoginFailedException , CredentialException { if ( callbackHandler == null ) { throw new WSLoginFailedException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "JAAS_LOGIN_NO_CALLBACK_HANDLER" , new Object [ ] { } , "CWWKS1170E: The login on the client application failed because the CallbackHandler implementation is null. Ensure a valid CallbackHandler implementation is specified either in the LoginContext constructor or in the client application's deployment descriptor." ) ) ; } CallbackHandlerAuthenticationData cAuthData = new CallbackHandlerAuthenticationData ( callbackHandler ) ; AuthenticationData authenticationData = null ; try { authenticationData = cAuthData . createAuthenticationData ( ) ; } catch ( IOException e ) { throw new WSLoginFailedException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "JAAS_LOGIN_UNEXPECTED_EXCEPTION" , new Object [ ] { e . getLocalizedMessage ( ) } , "CWWKS1172E: The login on the client application failed because of an unexpected exception. Review the logs to understand the cause of the exception. The exception is: " + e . getLocalizedMessage ( ) ) ) ; } catch ( UnsupportedCallbackException e ) { throw new WSLoginFailedException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "JAAS_LOGIN_UNEXPECTED_EXCEPTION" , new Object [ ] { e . getLocalizedMessage ( ) } , "CWWKS1172E: The login on the client application failed because of an unexpected exception. Review the logs to understand the cause of the exception. The exception is: " + e . getLocalizedMessage ( ) ) ) ; } return createBasicAuthSubject ( authenticationData , subject ) ; }
|
Authenticating on the client will only create a dummy basic auth subject and does not truly authenticate anything . This subject is sent to the server ove CSIv2 where the real authentication happens .
| 472
| 38
|
160,448
|
protected Subject createBasicAuthSubject ( AuthenticationData authenticationData , Subject subject ) throws WSLoginFailedException , CredentialException { Subject basicAuthSubject = subject != null ? subject : new Subject ( ) ; String loginRealm = ( String ) authenticationData . get ( AuthenticationData . REALM ) ; String username = ( String ) authenticationData . get ( AuthenticationData . USERNAME ) ; String password = getPassword ( ( char [ ] ) authenticationData . get ( AuthenticationData . PASSWORD ) ) ; if ( username == null || username . isEmpty ( ) || password == null || password . isEmpty ( ) ) { throw new WSLoginFailedException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "JAAS_LOGIN_MISSING_CREDENTIALS" , new Object [ ] { } , "CWWKS1171E: The login on the client application failed because the user name or password is null. Ensure the CallbackHandler implementation is gathering the necessary credentials." ) ) ; } CredentialsService credentialsService = credentialsServiceRef . getServiceWithException ( ) ; credentialsService . setBasicAuthCredential ( basicAuthSubject , loginRealm , username , password ) ; Principal principal = new WSPrincipal ( username , null , WSPrincipal . AUTH_METHOD_BASIC ) ; basicAuthSubject . getPrincipals ( ) . add ( principal ) ; return basicAuthSubject ; }
|
Create the basic auth subject using the given authentication data
| 331
| 10
|
160,449
|
static RLSSuspendTokenManager getInstance ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getInstance" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getInstance" , _instance ) ; return _instance ; }
|
Returns the single instance of the RLSSuspendTokenManager
| 64
| 12
|
160,450
|
RLSSuspendToken registerSuspend ( int timeout ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerSuspend" , new Integer ( timeout ) ) ; // Generate the suspend token // RLSSuspendToken token = new RLSSuspendTokenImpl(); RLSSuspendToken token = Configuration . getRecoveryLogComponent ( ) . createRLSSuspendToken ( null ) ; // Alarm reference Alarm alarm = null ; // For a timeout value greater than zero, we create an alarm // A zero timeout value indicates that this suspend operation will // never timeout, hence no alarm is required if ( timeout > 0 ) { // Create an alarm // alarm = AlarmManager.createNonDeferrable(((long)timeout) * 1000L, this, token); alarm = Configuration . getAlarmManager ( ) . scheduleAlarm ( timeout * 1000L , this , token ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Alarm has been created for this suspend call" , alarm ) ; } synchronized ( _tokenMap ) { // Register the token and the alarm with the token map // bearing in mind that this alarm could be null _tokenMap . put ( token , alarm ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerSuspend" , token ) ; // Return the generated token return token ; }
|
Registers that a suspend call has been made on the RecoveryLogService and generates a unique RLSSuspendToken which must be passed in to registerResume to cancel this suspend operation
| 305
| 37
|
160,451
|
void registerResume ( RLSSuspendToken token ) throws RLSInvalidSuspendTokenException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerResume" , token ) ; if ( token != null && _tokenMap . containsKey ( token ) ) { // Cast the token to its actual type // RLSSuspendTokenImpl tokenImpl = (RLSSuspendTokenImpl) token; synchronized ( _tokenMap ) { // Remove the token and any associated alarm from the map Alarm alarm = ( Alarm ) _tokenMap . remove ( token /*tokenImpl*/ ) ; // This suspend token is still active - check if // it has an alarm associated with it, and if so, cancel if ( alarm != null ) { alarm . cancel ( ) ; } } } else { // Supplied token is null or could not be found in token map if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Throw RLSInvalidSuspendTokenException - suspend token is not recognised" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerResume" , "RLSInvalidSuspendTokenException" ) ; throw new RLSInvalidSuspendTokenException ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerResume" ) ; }
|
Cancels the suspend request that returned the matching RLSSuspendToken . The suspend call s alarm if there is one will also be cancelled
| 294
| 29
|
160,452
|
boolean isResumable ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isResumable" ) ; boolean isResumable = true ; synchronized ( _tokenMap ) { if ( ! _tokenMap . isEmpty ( ) ) { isResumable = false ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isResumable" , new Boolean ( isResumable ) ) ; return isResumable ; }
|
Returns true if there are no tokens in the map indicating that no active suspends exist .
| 110
| 18
|
160,453
|
public static String formatUniqueName ( String uniqueName ) throws InvalidUniqueNameException { String validName = getValidUniqueName ( uniqueName ) ; if ( validName == null ) { if ( tc . isErrorEnabled ( ) ) { Tr . error ( tc , WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , WIMMessageHelper . generateMsgParms ( uniqueName ) ) ; } throw new InvalidUniqueNameException ( WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , Tr . formatMessage ( tc , WIMMessageKey . INVALID_UNIQUE_NAME_SYNTAX , WIMMessageHelper . generateMsgParms ( uniqueName ) ) ) ; } else { return validName ; } }
|
Formats the specified entity unique name and also check it using the LDAP DN syntax rule . The formatting including remove
| 170
| 23
|
160,454
|
public static String constructUniqueName ( String [ ] RDNs , Entity entity , String parentDN , boolean throwExc ) throws WIMException { boolean found = false ; String uniqueName = null ; String missingPropName = null ; for ( int i = 0 ; i < RDNs . length ; i ++ ) { String [ ] localRDNs = getRDNs ( RDNs [ i ] ) ; int size = localRDNs . length ; String [ ] RDNValues = new String [ size ] ; boolean findValue = true ; for ( int j = 0 ; j < size && findValue ; j ++ ) { String thisRDN = localRDNs [ j ] ; String thisRDNValue = String . valueOf ( entity . get ( thisRDN ) ) ; if ( thisRDNValue == null || "null" . equalsIgnoreCase ( thisRDNValue ) ) { findValue = false ; missingPropName = thisRDN ; } else if ( thisRDNValue . trim ( ) . length ( ) == 0 ) { String qualifiedEntityType = entity . getTypeName ( ) ; throw new InvalidPropertyValueException ( WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , Tr . formatMessage ( tc , WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , WIMMessageHelper . generateMsgParms ( thisRDN , qualifiedEntityType ) ) ) ; } else { RDNValues [ j ] = thisRDNValue ; } } if ( findValue ) { if ( ! found ) { uniqueName = constructUniqueName ( localRDNs , RDNValues , parentDN ) ; found = true ; } else if ( throwExc ) { String qualifiedEntityType = entity . getTypeName ( ) ; throw new InvalidUniqueNameException ( WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , Tr . formatMessage ( tc , WIMMessageKey . CAN_NOT_CONSTRUCT_UNIQUE_NAME , WIMMessageHelper . generateMsgParms ( RDNs [ i ] , qualifiedEntityType ) ) ) ; } } } if ( missingPropName != null && ! found && throwExc ) { throw new MissingMandatoryPropertyException ( WIMMessageKey . MISSING_MANDATORY_PROPERTY , Tr . formatMessage ( tc , WIMMessageKey . MISSING_MANDATORY_PROPERTY , WIMMessageHelper . generateMsgParms ( missingPropName ) ) ) ; } return uniqueName ; }
|
Returns the unique name based on the input value .
| 540
| 10
|
160,455
|
private static String escapeAttributeValue ( String value ) { final String escapees = ",=+<>#;\"\\" ; char [ ] chars = value . toCharArray ( ) ; StringBuffer buf = new StringBuffer ( 2 * value . length ( ) ) ; // Find leading and trailing whitespace. int lead ; // index of first char that is not leading whitespace for ( lead = 0 ; lead < chars . length ; lead ++ ) { if ( ! isWhitespace ( chars [ lead ] ) ) { break ; } } int trail ; // index of last char that is not trailing whitespace for ( trail = chars . length - 1 ; trail >= 0 ; trail -- ) { if ( ! isWhitespace ( chars [ trail ] ) ) { break ; } } for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( ( i < lead ) || ( i > trail ) || ( escapees . indexOf ( c ) >= 0 ) ) { buf . append ( ' ' ) ; } buf . append ( c ) ; } return new String ( buf ) ; }
|
Given the value of an attribute returns a string suitable for inclusion in a DN .
| 243
| 16
|
160,456
|
public static String unescapeSpaces ( String in ) { char [ ] chars = in . toCharArray ( ) ; int end = chars . length ; StringBuffer out = new StringBuffer ( in . length ( ) ) ; for ( int i = 0 ; i < end ; i ++ ) { /* * Remove any backslashes that precede spaces. */ boolean isSlashSpace = ( chars [ i ] == ' ' ) && ( i + 1 < end ) && ( chars [ i + 1 ] == ' ' ) ; if ( isSlashSpace ) { boolean isStart = ( i > 0 ) && ( chars [ i - 1 ] == ' ' ) ; boolean isEnd = ( i + 2 >= end ) || ( ( i + 2 < end ) && ( chars [ i + 2 ] == ' ' ) ) ; if ( ! isStart && ! isEnd ) { ++ i ; } } out . append ( chars [ i ] ) ; } return new String ( out ) ; }
|
Replace any unnecessary escaped spaces from the input DN .
| 210
| 11
|
160,457
|
public static String getChildText ( Element elem , String childTagName ) { NodeList nodeList = elem . getElementsByTagName ( childTagName ) ; int len = nodeList . getLength ( ) ; if ( len == 0 ) { return null ; } return getElementText ( ( Element ) nodeList . item ( len - 1 ) ) ; }
|
Return content of child element with given tag name . If more than one children with this name are present the content of the last element is returned .
| 79
| 29
|
160,458
|
public static List getChildTextList ( Element elem , String childTagName ) { NodeList nodeList = elem . getElementsByTagName ( childTagName ) ; int len = nodeList . getLength ( ) ; if ( len == 0 ) { return Collections . EMPTY_LIST ; } List list = new ArrayList ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { list . add ( getElementText ( ( Element ) nodeList . item ( i ) ) ) ; } return list ; }
|
Return list of content Strings of all child elements with given tag name .
| 116
| 15
|
160,459
|
@ Override public void sendNackMessage ( SIBUuid8 upstream , SIBUuid12 destUuid , SIBUuid8 busUuid , long startTick , long endTick , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendNackMessage" , new Object [ ] { new Long ( startTick ) , new Long ( endTick ) } ) ; ControlNack nackMsg = createControlNackMessage ( priority , reliability , stream ) ; nackMsg . setStartTick ( startTick ) ; nackMsg . setEndTick ( endTick ) ; if ( upstream == null ) { upstream = _originStreamMap . get ( stream ) ; } // Send this to MPIO // Send Nack messages at message priority +2 _mpio . sendToMe ( upstream , priority + 2 , nackMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendNackMessage " ) ; }
|
Called by one of our input stream data structures when we don t have any info for a tick and need to nack upstream .
| 266
| 27
|
160,460
|
private void processAckExpected ( ControlAckExpected ackExpMsg ) throws SIResourceException { // This is called by a PubSubOutputHandler when it finds Unknown // ticks in it's own stream and need the InputStream to resend them if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processAckExpected" , ackExpMsg ) ; // The upstream cellule for this stream is stored in the originStreamMap // unless we were the originator. SIBUuid12 streamID = ackExpMsg . getGuaranteedStreamUUID ( ) ; int priority = ackExpMsg . getPriority ( ) . intValue ( ) ; Reliability reliability = ackExpMsg . getReliability ( ) ; if ( _internalInputStreamManager . hasStream ( streamID , priority , reliability ) ) { _internalInputStreamManager . processAckExpected ( ackExpMsg ) ; } else { _targetStreamManager . handleAckExpectedMessage ( ackExpMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processAckExpected" ) ; }
|
Process an AckExpected message .
| 277
| 7
|
160,461
|
private long processNackWithReturnValue ( ControlNack nackMsg ) throws SIResourceException { // This is called by a PubSubOutputHandler when it finds Unknown // ticks in it's own stream and need the InputStream to resend them if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processNackWithReturnValue" , nackMsg ) ; long returnValue = - 1 ; // The upstream cellule for this stream is stored in the originStreamMap // unless we were the originator. SIBUuid12 stream = nackMsg . getGuaranteedStreamUUID ( ) ; if ( _sourceStreamManager . hasStream ( stream ) ) { // 242139: Currently we get back to here for every processNack // that the InternalOutputStream handles. This is an error but // a harmles one. For now the fix is to avoid throwing an exception // as the InternalOutputstream has in fact satisfied the Nack correctly. // The longer term fix is to writeCombined range into the IOS not just the // value if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Ignoring processNack on sourceStream at PubSubInputHandler" ) ; returnValue = _sourceStreamManager . getStreamSet ( ) . getStream ( nackMsg . getPriority ( ) , nackMsg . getReliability ( ) ) . getCompletedPrefix ( ) ; } else { // Else we are an IME // send nacks if necessary _internalInputStreamManager . processNack ( nackMsg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processNackWithReturnValue" , new Long ( returnValue ) ) ; return returnValue ; }
|
Process a nack from a PubSubOutputHandler .
| 414
| 11
|
160,462
|
private void remotePut ( MessageItem msg , SIBUuid8 sourceMEUuid ) throws SIResourceException , SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remotePut" , new Object [ ] { msg , sourceMEUuid } ) ; // Update the origin map if this is a new stream. // This unsynchronized update is ok until multiple paths // are possible (in which case there could be a race // for the same stream on this method). SIBUuid12 stream = msg . getMessage ( ) . getGuaranteedStreamUUID ( ) ; if ( ! _originStreamMap . containsKey ( stream ) ) _originStreamMap . put ( stream , sourceMEUuid ) ; // First get matches // Match Consumers is only called for PubSub targets. MessageProcessorSearchResults searchResults = matchMessage ( msg ) ; String topic = msg . getMessage ( ) . getDiscriminator ( ) ; //First the remote to remote case (forwarding) HashMap allPubSubOutputHandlers = _destination . getAllPubSubOutputHandlers ( ) ; List matchingPubsubOutputHandlers = searchResults . getPubSubOutputHandlers ( topic ) ; // Check to see if we have any Neighbours if ( allPubSubOutputHandlers != null && allPubSubOutputHandlers . size ( ) > 0 ) { remoteToRemotePut ( msg , allPubSubOutputHandlers , matchingPubsubOutputHandlers ) ; } // Calling getAllPubSubOutputHandlers() locks the handlers // so now we have finished we need to unlock _destination . unlockPubsubOutputHandlers ( ) ; // Now handle remote to local case // If there are any ConsumerDispatchers we will need to save the // list in the Targetstream with the message Set consumerDispatchers = searchResults . getConsumerDispatchers ( topic ) ; // Check to see if we have any matching Neighbours if ( consumerDispatchers != null && consumerDispatchers . size ( ) > 0 ) { // Add the list of consumerDispatchers to the MessageItem // as we will need it in DeliverOrdered messages msg . setSearchResults ( searchResults ) ; // This will add the message to the TargetStream remoteToLocalPut ( msg ) ; } else { // This will add Silence to the TargetStream remoteToLocalPutSilence ( msg ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remotePut" ) ; }
|
The remote put method is driven when the producer is remote to this PubSub Input handler .
| 570
| 18
|
160,463
|
protected void remoteToLocalPutSilence ( MessageItem msgItem ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remoteToLocalPutSilence" , new Object [ ] { msgItem } ) ; // Write Silence to the targetStream instead // If the targetStream does not exist this will just return _targetStreamManager . handleSilence ( msgItem ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remoteToLocalPutSilence" ) ; }
|
This is a put message that has oringinated from another ME When there are no matching local consumers we need to write Silence into the stream instead
| 142
| 29
|
160,464
|
private MessageProcessorSearchResults matchMessage ( MessageItem msg ) throws SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "matchMessage" , new Object [ ] { msg } ) ; //Extract the message from the MessageItem JsMessage jsMsg = msg . getMessage ( ) ; // Match Consumers is only called for PubSub targets. TopicAuthorization topicAuth = _messageProcessor . getDiscriminatorAccessChecker ( ) ; MessageProcessorSearchResults searchResults = new MessageProcessorSearchResults ( topicAuth ) ; // Defect 382250, set the unlockCount from MsgStore into the message // in the case where the message is being redelivered. int redelCount = msg . guessRedeliveredCount ( ) ; if ( redelCount > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Set deliverycount into message: " + redelCount ) ; jsMsg . setDeliveryCount ( redelCount ) ; } // Get the matching consumers from the matchspace _matchspace . retrieveMatchingOutputHandlers ( _destination , jsMsg . getDiscriminator ( ) , ( MatchSpaceKey ) jsMsg , searchResults ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "matchMessage" , new Object [ ] { searchResults } ) ; return searchResults ; }
|
Returns a list of matching OutputHandlers for a particular message . Note that this method takes a MessageProcessorSearchResults object from a pool . This object must be returned by the caller when it is finished with .
| 345
| 43
|
160,465
|
private boolean restoreFanOut ( MessageItemReference ref , boolean commitInsert ) throws SIDiscriminatorSyntaxException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "restoreFanOut" , new Object [ ] { ref , new Boolean ( commitInsert ) } ) ; boolean keepReference = true ; MessageItem msg = null ; try { msg = ( MessageItem ) ref . getReferredItem ( ) ; } catch ( MessageStoreException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubInputHandler.restoreFanOut" , "1:2102:1.329.1.1" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "restoreFanOut" , e ) ; throw new SIResourceException ( e ) ; } //Find matching output handlers MessageProcessorSearchResults searchResults = matchMessage ( msg ) ; String topic = msg . getMessage ( ) . getDiscriminator ( ) ; // cycle through the Neighbouring ME's List matchingPubsubOutputHandlers = searchResults . getPubSubOutputHandlers ( topic ) ; // Check to see if we have any matching Neighbours if ( matchingPubsubOutputHandlers != null && matchingPubsubOutputHandlers . size ( ) > 0 ) { HashMap allPubSubOutputHandlers = _destination . getAllPubSubOutputHandlers ( ) ; try { Iterator itr = allPubSubOutputHandlers . values ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { PubSubOutputHandler handler = ( PubSubOutputHandler ) itr . next ( ) ; if ( handler . okToForward ( msg ) ) { if ( matchingPubsubOutputHandlers . contains ( handler ) ) { // Put the message to the Neighbour. handler . putInsert ( msg , commitInsert ) ; } else { // Put Completed into stream // Set "create" to true in case this is the first time // this stream has seen a tick. handler . putSilence ( msg ) ; } } //else //{ // defect 260440: // 601 used to now remove this OH from // the set of matching outputhandlers, but it is cheaper // instead to merely repeat the 'okToForward' check later on //} } } finally { // unlock as the getAllPubSubOutputHandlers locks it. _destination . unlockPubsubOutputHandlers ( ) ; } } else // no matching Neighbours, mark itemReference to be removed from referenceStream { keepReference = false ; } // If we have OutputHandlers to deliver this to, and ref is indoubt, // then we keep searchResults for use in the eventPostAdd() callback if ( keepReference && ! commitInsert ) { ref . setSearchResults ( searchResults ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "restoreFanOut" ) ; return keepReference ; }
|
Restore fan out of the given message to subscribers .
| 706
| 11
|
160,466
|
private MessageItemReference addProxyReference ( MessageItem msg , MessageProcessorSearchResults matchingPubsubOutputHandlers , TransactionCommon tran ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addProxyReference" , new Object [ ] { msg , tran } ) ; MessageItemReference ref = new MessageItemReference ( msg ) ; // This ensures that the persitence of the MessageItem cannot be downgaded // by the consumerDispatcher because we have remote subscribers. msg . addPersistentRef ( ) ; ref . setSearchResults ( matchingPubsubOutputHandlers ) ; try { ref . registerMessageEventListener ( MessageEvents . POST_COMMIT_ADD , this ) ; ref . registerMessageEventListener ( MessageEvents . POST_ROLLBACK_ADD , this ) ; Transaction msTran = _messageProcessor . resolveAndEnlistMsgStoreTransaction ( tran ) ; _proxyReferenceStream . add ( ref , msTran ) ; } catch ( OutOfCacheSpace e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" , "SIResourceException" ) ; throw new SIResourceException ( e ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PubSubInputHandler.addProxyReference" , "1:2315:1.329.1.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubInputHandler" , "1:2322:1.329.1.1" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PubSubInputHandler" , "1:2332:1.329.1.1" , e } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addProxyReference" ) ; return ref ; }
|
Add a msg reference to the proxy subscription reference stream .
| 616
| 11
|
160,467
|
public void setPropertiesInMessage ( JsMessage jsMsg , SIBUuid12 destinationUuid , SIBUuid12 producerConnectionUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setPropertiesInMessage" , new Object [ ] { jsMsg , destinationUuid , producerConnectionUuid } ) ; SIMPUtils . setGuaranteedDeliveryProperties ( jsMsg , _messageProcessor . getMessagingEngineUuid ( ) , null , null , null , destinationUuid , ProtocolType . PUBSUBINPUT , GDConfig . PROTOCOL_VERSION ) ; if ( jsMsg . getConnectionUuid ( ) == null ) { //defect 278038: //The producerSession will have set this in the msgItem for pub sub //destinations. However, the field may not have been set in the //jsMsg if the msg was not persisted before this point. //Since the message is going off the box, we have no choice but to set it now. jsMsg . setConnectionUuid ( producerConnectionUuid ) ; } //NOTE: the 'bus' field is not set in this method as it should //only be set once the message has been stored if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setPropertiesInMessage" ) ; }
|
Sets properties in the message that are common to both links and non - links .
| 315
| 17
|
160,468
|
@ Override public void validate ( ) { //validate the parameters String target = getTargetName ( ) ; if ( value ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "bulkhead.parameter.invalid.value.CWMFT5016E" , "value " , value ( ) , target ) ) ; } //validate the parameters if ( waitingTaskQueue ( ) < 1 ) { throw new FaultToleranceDefinitionException ( Tr . formatMessage ( tc , "bulkhead.parameter.invalid.value.CWMFT5016E" , "waitingTaskQueue" , waitingTaskQueue ( ) , target ) ) ; } }
|
Validate Bulkhead configure and make sure the value and waitingTaskQueue must be greater than or equal to 1 .
| 152
| 23
|
160,469
|
public void updateCacheSizes ( long max , long current ) { final String methodName = "updateCacheSizes()" ; if ( tc . isDebugEnabled ( ) && null != _maxInMemoryCacheEntryCount && null != _inMemoryCacheEntryCount ) { if ( max != _maxInMemoryCacheEntryCount . getCount ( ) && _inMemoryCacheEntryCount . getCount ( ) != current ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " max=" + max + " current=" + current + " enable=" + this . _enable , this ) ; } if ( _enable ) { if ( _maxInMemoryCacheEntryCount != null ) _maxInMemoryCacheEntryCount . setCount ( max ) ; if ( _inMemoryCacheEntryCount != null ) _inMemoryCacheEntryCount . setCount ( current ) ; } }
|
Updates statistics using two supplied arguments - maxInMemoryCacheSize and currentInMemoryCacheSize .
| 190
| 20
|
160,470
|
public void onCacheHit ( String template , int locality ) { final String methodName = "onCacheHit()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " locality=" + locality + " enable=" + csm . _enable + " parentEnable=" + _enable + " " + this ) ; switch ( locality ) { case REMOTE : if ( csm . _enable ) { if ( csm . _remoteHitCount != null ) { csm . _remoteHitCount . increment ( ) ; } if ( csm . _inMemoryAndDiskCacheEntryCount != null ) { csm . _inMemoryAndDiskCacheEntryCount . increment ( ) ; } if ( csm . _remoteCreationCount != null ) { csm . _remoteCreationCount . increment ( ) ; } } break ; case MEMORY : if ( csm . _enable && csm . _hitsInMemoryCount != null ) csm . _hitsInMemoryCount . increment ( ) ; break ; case DISK : if ( _csmDisk != null && _csmDisk . _enable && _csmDisk . _hitsOnDisk != null ) { _csmDisk . _hitsOnDisk . increment ( ) ; } if ( csm . _enable && csm . _hitsOnDiskCount != null ) csm . _hitsOnDiskCount . increment ( ) ; break ; default : if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " Error - Unrecognized locality " + locality + " cacheName=" + _sCacheName ) ; break ; } return ; }
|
Updates statistics for the cache hit case .
| 403
| 9
|
160,471
|
public void onCacheMiss ( String template , int locality ) { final String methodName = "onCacheMiss()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " locality=" + locality + " enable=" + csm . _enable + " " + this ) ; if ( csm . _enable && csm . _missCount != null ) csm . _missCount . increment ( ) ; return ; }
|
Updates statistics for the cache miss case .
| 141
| 9
|
160,472
|
public void onEntryCreation ( String template , int source ) { final String methodName = "onEntryCreation()" ; CacheStatsModule csm = null ; if ( ( csm = getCSM ( template ) ) == null ) { return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + " cacheName=" + _sCacheName + " template=" + template + " source=" + source + " enable=" + csm . _enable + " " + this ) ; if ( csm . _enable ) { if ( source == REMOTE ) { if ( csm . _remoteCreationCount != null ) csm . _remoteCreationCount . increment ( ) ; } if ( csm . _inMemoryAndDiskCacheEntryCount != null ) csm . _inMemoryAndDiskCacheEntryCount . increment ( ) ; } return ; }
|
Updates statistics for the cache entry creation case .
| 192
| 10
|
160,473
|
private static void applyElement ( Annotated member , Schema property ) { final XmlElementWrapper wrapper = member . getAnnotation ( XmlElementWrapper . class ) ; if ( wrapper != null ) { final XML xml = getXml ( property ) ; xml . setWrapped ( true ) ; // No need to set the xml name if the name provided by xmlelementwrapper annotation is ##default or equal to the property name | https://github.com/swagger-api/swagger-core/pull/2050 if ( ! "##default" . equals ( wrapper . name ( ) ) && ! wrapper . name ( ) . isEmpty ( ) && ! wrapper . name ( ) . equals ( ( ( SchemaImpl ) property ) . getName ( ) ) ) { xml . setName ( wrapper . name ( ) ) ; } } else { final XmlElement element = member . getAnnotation ( XmlElement . class ) ; if ( element != null ) { setName ( element . namespace ( ) , element . name ( ) , property ) ; } } }
|
Puts definitions for XML element .
| 232
| 7
|
160,474
|
private static void applyAttribute ( Annotated member , Schema property ) { final XmlAttribute attribute = member . getAnnotation ( XmlAttribute . class ) ; if ( attribute != null ) { final XML xml = getXml ( property ) ; xml . setAttribute ( true ) ; setName ( attribute . namespace ( ) , attribute . name ( ) , property ) ; } }
|
Puts definitions for XML attribute .
| 81
| 7
|
160,475
|
private static boolean setName ( String ns , String name , Schema property ) { boolean apply = false ; final String cleanName = StringUtils . trimToNull ( name ) ; final String useName ; if ( ! isEmpty ( cleanName ) && ! cleanName . equals ( ( ( SchemaImpl ) property ) . getName ( ) ) ) { useName = cleanName ; apply = true ; } else { useName = null ; } final String cleanNS = StringUtils . trimToNull ( ns ) ; final String useNS ; if ( ! isEmpty ( cleanNS ) ) { useNS = cleanNS ; apply = true ; } else { useNS = null ; } // Set everything or nothing if ( apply ) { getXml ( property ) . name ( useName ) . namespace ( useNS ) ; } return apply ; }
|
Puts name space and name for XML node or attribute .
| 179
| 12
|
160,476
|
private static boolean isAttributeAllowed ( Schema property ) { if ( property . getType ( ) == SchemaType . ARRAY || property . getType ( ) == SchemaType . OBJECT ) { return false ; } if ( ! StringUtils . isBlank ( property . getRef ( ) ) ) { return false ; } return true ; }
|
Checks whether the passed property can be represented as node attribute .
| 76
| 13
|
160,477
|
public static Attribute getInstance ( Object o ) { if ( o == null || o instanceof Attribute ) { return ( Attribute ) o ; } if ( o instanceof ASN1Sequence ) { return new Attribute ( ( ASN1Sequence ) o ) ; } throw new IllegalArgumentException ( "unknown object in factory" ) ; }
|
return an Attribute object from the given object .
| 76
| 10
|
160,478
|
synchronized void unregister ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unregister" , this ) ; } if ( registration != null ) { registration . unregister ( ) ; registration = null ; } }
|
Remove the service registration Package private .
| 66
| 7
|
160,479
|
@ Override public void printStackTrace ( PrintWriter p ) { if ( wrapped == null ) { p . println ( "none" ) ; } else { StackTraceElement [ ] stackElements = getStackTraceEliminatingDuplicateFrames ( ) ; // format and print p . println ( wrapped ) ; for ( int i = 0 ; i < stackElements . length ; i ++ ) { StackTraceElement stackTraceElement = stackElements [ i ] ; final String toString = printStackTraceElement ( stackTraceElement ) ; p . println ( "\t" + toString ) ; } TruncatableThrowable cause = getCause ( ) ; // We know the cause will be truncatable, so not much extra work to do here // There's a super-class method we could call, but it's private :( if ( cause != null ) { // Non-internationalised string in what we're trying to imitate if ( cause . isIntermediateCausesStripped ( ) ) { p . print ( "Caused by (repeated) ... : " ) ; } else { p . print ( CAUSED_BY ) ; } cause . printStackTrace ( p ) ; } } }
|
This method will print a trimmed stack trace to stderr .
| 265
| 13
|
160,480
|
public StackTraceElement [ ] getStackTraceEliminatingDuplicateFrames ( ) { // If this isn't a cause, there can't be any duplicate frames, so proceed no further if ( parentFrames == null ) { return getStackTrace ( ) ; } if ( noduplicatesStackTrace == null ) { List < StackTraceElement > list = new ArrayList < StackTraceElement > ( ) ; // Only put the comment saying there are other classes in the stack if there actually are, // and if this isn't a 'cause' exception StackTraceElement [ ] stackElements = getStackTrace ( ) ; // Now do a second trimming, if necessary, to eliminate any duplication in 'caused by' traces int numberToInclude = countNonDuplicatedFrames ( parentFrames , stackElements ) ; for ( int i = 0 ; i < numberToInclude ; i ++ ) { list . add ( stackElements [ i ] ) ; } // Only put the comment saying there are other classes in the stack if there actually are boolean duplicateFramesRemoved = numberToInclude < stackElements . length ; if ( duplicateFramesRemoved ) { // Use shonky eyecatchers since we can't subclass StackTraceElement list . add ( new StackTraceElement ( "... " + ( stackElements . length - numberToInclude ) + " more" , DUPLICATE_FRAMES_EYECATCHER , null , 0 ) ) ; } noduplicatesStackTrace = list . toArray ( new StackTraceElement [ 0 ] ) ; } return noduplicatesStackTrace . clone ( ) ; }
|
Useful for exceptions which are the causes of other exceptions . Gets the stack frames but not only does it eliminate internal classes it eliminates frames which are redundant with the parent exception . In the case where the exception is not a cause it returns a normal exception . If duplicate frames are stripped it will add an
| 357
| 60
|
160,481
|
public void record ( CircuitBreakerStateImpl . CircuitBreakerResult result ) { boolean isFailure = ( result == FAILURE ) ; if ( resultCount < size ) { // Window is not yet full resultCount ++ ; } else { // Window is full, roll off the oldest result boolean oldestResultIsFailure = results . get ( nextResultIndex ) ; if ( oldestResultIsFailure ) { failures -- ; } } results . set ( nextResultIndex , isFailure ) ; if ( isFailure ) { failures ++ ; } nextResultIndex ++ ; if ( nextResultIndex >= size ) { nextResultIndex = 0 ; } }
|
Record a result in the rolling window
| 132
| 7
|
160,482
|
protected MetadataViewKey deriveViewKey ( FacesContext facesContext , UIViewRoot root ) { MetadataViewKey viewKey ; if ( ! facesContext . getResourceLibraryContracts ( ) . isEmpty ( ) ) { String [ ] contracts = new String [ facesContext . getResourceLibraryContracts ( ) . size ( ) ] ; contracts = facesContext . getResourceLibraryContracts ( ) . toArray ( contracts ) ; viewKey = new MetadataViewKeyImpl ( root . getViewId ( ) , root . getRenderKitId ( ) , root . getLocale ( ) , contracts ) ; } else { viewKey = new MetadataViewKeyImpl ( root . getViewId ( ) , root . getRenderKitId ( ) , root . getLocale ( ) ) ; } return viewKey ; }
|
Generates an unique key according to the metadata information stored in the passed UIViewRoot instance that can affect the way how the view is generated . By default the view params are the viewId the locale the renderKit and the contracts associated to the view .
| 174
| 52
|
160,483
|
public void modified ( List < String > newSources ) { if ( collectorMgr == null || isInit == false ) { this . sourcesList = newSources ; return ; } try { //Old sources ArrayList < String > oldSources = new ArrayList < String > ( sourcesList ) ; //Sources to remove -> In Old Sources, the difference between oldSource and newSource ArrayList < String > sourcesToRemove = new ArrayList < String > ( oldSources ) ; sourcesToRemove . removeAll ( newSources ) ; collectorMgr . unsubscribe ( this , convertToSourceIDList ( sourcesToRemove ) ) ; //Sources to Add -> In New Sources, the difference bewteen newSource and oldSource ArrayList < String > sourcesToAdd = new ArrayList < String > ( newSources ) ; sourcesToAdd . removeAll ( oldSources ) ; collectorMgr . subscribe ( this , convertToSourceIDList ( sourcesToAdd ) ) ; sourcesList = newSources ; //new master sourcesList } catch ( Exception e ) { e . printStackTrace ( ) ; } }
|
Without osgi this modified method is called explicility from the update method in JsonTrService
| 229
| 20
|
160,484
|
public void writingState ( ) { if ( ! this . writtenState ) { this . writtenState = true ; this . writtenStateWithoutWrapper = false ; this . fast = new FastWriter ( this . initialSize ) ; this . out = this . fast ; } }
|
Mark that state is about to be written . Contrary to what you d expect we cannot and should not assume that this location is really going to have state ; it is perfectly legit to have a ResponseWriter that filters out content and ignores an attempt to write out state at this point . So we have to check after the fact to see if there really are state markers .
| 57
| 73
|
160,485
|
@ Reference ( name = "extensionProvider" , service = ExtensionProvider . class , policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected void registerExtensionProvider ( ExtensionProvider provider ) { LibertyApplicationBusFactory . getInstance ( ) . registerExtensionProvider ( provider ) ; }
|
Register a new extension provier
| 72
| 6
|
160,486
|
@ Trivial private String dumpMap ( Map < String , String [ ] > m ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( " --- request parameters: ---\n" ) ; Iterator < String > it = m . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String key = it . next ( ) ; String [ ] values = m . get ( key ) ; sb . append ( key + ": " ) ; for ( String s : values ) { sb . append ( "[" + s + "] " ) ; } sb . append ( "\n" ) ; } return sb . toString ( ) ; }
|
dump parameter map for trace .
| 153
| 6
|
160,487
|
private void forwardMessage ( AbstractMessage aMessage , SIBUuid8 targetMEUuid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "forwardMessage" , new Object [ ] { aMessage , targetMEUuid } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && UserTrace . tc_mt . isDebugEnabled ( ) && ! aMessage . isControlMessage ( ) ) { JsMessage jsMsg = ( JsMessage ) aMessage ; JsDestinationAddress routingDestination = jsMsg . getRoutingDestination ( ) ; if ( routingDestination != null ) { String destId = routingDestination . getDestinationName ( ) ; boolean temporary = false ; if ( destId . startsWith ( SIMPConstants . TEMPORARY_PUBSUB_DESTINATION_PREFIX ) ) temporary = true ; UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , destId , temporary ) ; } else { DestinationHandler dest = _destinationManager . getDestinationInternal ( aMessage . getGuaranteedTargetDestinationDefinitionUUID ( ) , false ) ; if ( dest != null ) UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , dest . getName ( ) , dest . isTemporary ( ) ) ; else UserTrace . forwardJSMessage ( jsMsg , targetMEUuid , jsMsg . getGuaranteedTargetDestinationDefinitionUUID ( ) . toString ( ) , false ) ; } } // Send this to MPIO _mpio . sendToMe ( targetMEUuid , aMessage . getPriority ( ) . intValue ( ) , aMessage ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "forwardMessage" ) ; }
|
Forwards a message onto a foreign bus
| 422
| 8
|
160,488
|
SIMPMessage getAttachedMessage ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getAttachedMessage" , this ) ; SIMPMessage msg = null ; //check if there really is a message attached if ( _msgAttached ) { // If the message wasn't locked when it was attached (we are a forwardScanning // consumer) we need to go and look for it now. if ( _msgOnItemStream && ! _msgLocked ) { // Attempt to lock the attached message on the itemstream msg = getEligibleMsgLocked ( null ) ; } else msg = _attachedMessage ; //show that there is no longer an attached message available _msgAttached = false ; _msgLocked = false ; _attachedMessage = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getAttachedMessage" , msg ) ; //simply return the attached message (if there is one) return msg ; }
|
If a message has been attached to this LCP detach it and return it
| 247
| 15
|
160,489
|
private boolean checkReceiveAllowed ( ) throws SISessionUnavailableException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkReceiveAllowed" ) ; boolean allowed = _destinationAttachedTo . isReceiveAllowed ( ) ; if ( ! allowed ) { // Register that LCP stopped for Receive Allowed _stoppedForReceiveAllowed = true ; // Stop LCP for Receive Allowed if ( ! _stopped ) { internalStop ( ) ; } } else { // Register that LCP not stopped for Receive Allowed _stoppedForReceiveAllowed = false ; // Start LCP if no reason to be stopped if ( ( _stopped ) && ( ! _stoppedByRequest ) ) { internalStart ( false ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveAllowed" , Boolean . valueOf ( allowed ) ) ; return allowed ; }
|
Checks the destination allows receive
| 242
| 6
|
160,490
|
private void checkReceiveState ( ) throws SIIncorrectCallException , SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkReceiveState" ) ; // Only valid if the consumer session is still open checkNotClosed ( ) ; //if there is an AsynchConsumerCallback registered, throw an exception if ( _asynchConsumerRegistered ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" , "asynchConsumerRegistered == true " ) ; throw new SIIncorrectCallException ( nls . getFormattedMessage ( "RECEIVE_USAGE_ERROR_CWSIP0171" , new Object [ ] { _consumerDispatcher . getDestination ( ) . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } // If we already have the waiting bit set it implies another // thread is sat waiting in a receive for this consumer (we release // the consumer lock while waiting so this is possible). else if ( _waiting ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "RECEIVE_USAGE_ERROR_CWSIP0178" , new Object [ ] { _consumerDispatcher . getDestination ( ) . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" , "receive already in progress" ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkReceiveState" ) ; }
|
Checks the state for the synchronous consumer
| 433
| 9
|
160,491
|
protected void waitingNotify ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "waitingNotify" ) ; this . lock ( ) ; try { if ( _waiting ) _waiter . signal ( ) ; } finally { this . unlock ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "waitingNotify" ) ; }
|
Wakeup our thread if we re waiting on a receive . This method is normally called as part of remoteDurable when we need to resubmit a get because a previous get caused a noLocal discard .
| 115
| 43
|
160,492
|
private SIMPMessage retrieveMsgLocked ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "retrieveMsgLocked" , new Object [ ] { this } ) ; SIMPMessage msg = null ; // Look in the Cd's ItenStream for the next available message try { msg = _consumerKey . getMessageLocked ( ) ; if ( msg != null ) msg . eventLocked ( ) ; } catch ( MessageStoreException e ) { // MessageStoreException shouldn't occur so FFDC. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.retrieveMsgLocked" , "1:2101:1.22.5.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint" , "1:2108:1.22.5.1" , SIMPUtils . getStackTrace ( e ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMsgLocked" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint" , "1:2119:1.22.5.1" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMsgLocked" , msg ) ; //return the locked message return msg ; }
|
Attempt to retrieve a message from the CD s itemStream in a locked state .
| 460
| 16
|
160,493
|
private void checkParams ( int maxActiveMessages , long messageLockExpiry , int maxBatchSize ) throws SIIncorrectCallException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkParams" , new Object [ ] { Integer . valueOf ( maxActiveMessages ) , Long . valueOf ( messageLockExpiry ) , Integer . valueOf ( maxBatchSize ) } ) ; if ( maxActiveMessages < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException maxActiveMessages < 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0141" , new Object [ ] { Integer . valueOf ( maxActiveMessages ) } , null ) ) ; } if ( messageLockExpiry < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException messageLockExpiry < 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0142" , new Object [ ] { Long . valueOf ( messageLockExpiry ) } , null ) ) ; } if ( maxBatchSize <= 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" , "SIIncorrectCallException maxBatchSize <= 0" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "REG_ASYNCH_CONSUMER_ERROR_CWSIR0143" , new Object [ ] { Integer . valueOf ( maxBatchSize ) } , null ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkParams" ) ; }
|
Checks that the maxBatchSize is > 0 Checks that messasgeLockExpiry > = 0 Checks that maxActiveMessages > = 0
| 517
| 32
|
160,494
|
public boolean isClosed ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isClosed" , this ) ; SibTr . exit ( tc , "isClosed" , Boolean . valueOf ( _closed ) ) ; } return _closed ; }
|
Returns true if this LCP is closed .
| 77
| 9
|
160,495
|
@ Override public void start ( boolean deliverImmediately ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "start" , new Object [ ] { Boolean . valueOf ( deliverImmediately ) , this } ) ; // Register that LCP has been stopped by a request to stop _stoppedByRequest = false ; // Run the private method internalStart ( deliverImmediately ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "start" ) ; }
|
Start this LCP . If there are any synchronous receives waiting wake them up If there is a AsynchConsumerCallback registered look on the QP for messages for asynch delivery . If deliverImmediately is set this Thread is used to deliver any initial messages rather than starting up a new Thread .
| 141
| 62
|
160,496
|
@ Override public void checkForMessages ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkForMessages" , this ) ; try { //start a new thread to run the callback _messageProcessor . startNewThread ( new AsynchThread ( this , false ) ) ; } catch ( InterruptedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.JSLocalConsumerPoint.checkForMessages" , "1:3881:1.22.5.1" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkForMessages" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkForMessages" ) ; }
|
Spin off a thread that checks for any stored messages . This is called by a consumerKeyGroup to try to kick a group back into life after a stopped member detaches and makes the group ready again .
| 235
| 42
|
160,497
|
@ Override public void unlockAll ( ) throws SISessionUnavailableException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAll" , this ) ; synchronized ( _asynchConsumerBusyLock ) { this . lock ( ) ; try { // Only valid if the consumer session is still open checkNotClosed ( ) ; try { // Unlock the messages (take this lock to ensure we don't have a problem // getting it if we need it to re-deliver the unlocked messages to ourselves) _allLockedMessages . unlockAll ( ) ; } catch ( SIMPMessageNotLockedException e ) { // No FFDC code needed // This exception has occurred beause someone has deleted the // message(s). Ignore this exception as it is unlocked anyway } } finally { this . unlock ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" ) ; }
|
Unlock all messages which have been locked to this LCP but not consumed
| 238
| 15
|
160,498
|
private void setBaseRecoverability ( Reliability unrecoverableReliability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBaseRecoverability" , new Object [ ] { this , unrecoverableReliability } ) ; setUnrecoverability ( unrecoverableReliability ) ; _baseUnrecoverableOptions = _unrecoverableOptions ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBaseRecoverability" ) ; }
|
Set the consumerSession s recoverability
| 136
| 7
|
160,499
|
private void resetBaseUnrecoverability ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetBaseUnrecoverability" , this ) ; _unrecoverableOptions = _baseUnrecoverableOptions ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetBaseUnrecoverability" ) ; }
|
Restore the original unrecoverability of the session
| 107
| 10
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.