@ FFDCIgnore ( { EntityNotFoundException . class , Exception . class } ) private String getUniqueNameByUniqueId ( String uniqueId , boolean isAllowOperationIfReposDown , Set < String > failureRepositoryIds ) throws WIMException { final String METHODNAME = "getUniqueNameByUniqueId" ; String uniqueName = null ; boolean found = false ; int i = 0 ; Root temp = new Root ( ) ; Entity entity = new Entity ( ) ; IdentifierType id = new IdentifierType ( ) ; id . setExternalId ( uniqueId ) ; entity . setIdentifier ( id ) ; temp . getEntities ( ) . add ( entity ) ; List < String > repositoryIds = repositoryManager . getRepoIds ( ) ; while ( i < repositoryIds . size ( ) && ! found ) { try { Root returnedRoot = repositoryManager . getRepository ( repositoryIds . get ( i ) ) . get ( temp ) ; if ( returnedRoot != null ) { List < Entity > pes = returnedRoot . getEntities ( ) ; if ( pes != null ) { Entity ent = pes . get ( 0 ) ; if ( ent != null ) { IdentifierType entityId = ent . getIdentifier ( ) ; if ( entityId != null ) { uniqueName = entityId . getUniqueName ( ) ; found = true ; } } } } } catch ( EntityNotFoundException e ) { // Move on to the next repository i ++ ; } catch ( Exception e ) { if ( ! isAllowOperationIfReposDown ) { if ( e instanceof WIMException ) { throw ( WIMException ) e ; } throw new WIMException ( e ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , METHODNAME + " IGNORE: exception [" + e . getMessage ( ) + "] on repository [" + repositoryIds . get ( i ) + "]" ) ; failureRepositoryIds . add ( repositoryIds . get ( i ) ) ; // Move on to the next repository i ++ ; } } } return uniqueName ; }
Get the uniqueName based on the specified uniqueId