diff --git a/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java b/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java index 58501c095ee..b1aee50580f 100644 --- a/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java +++ b/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/URBridge.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2020 IBM Corporation and others. + * Copyright (c) 2012, 2022 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -222,7 +222,7 @@ private void setMapping() { * * @return */ - + @SuppressWarnings("unchecked") public void initialize(Map configProps) throws WIMException { try { reposId = (String) configProps.get(KEY_ID); @@ -287,7 +287,7 @@ public void initialize(Map configProps) throws WIMException { * should have only 1 baseEntry * * @param configProps Map containing the configuration information - * for the baseEntries. + * for the baseEntries. * @throws WIMException Exception is thrown if no baseEntry is set. */ private void setBaseEntry(Map configProps) throws WIMException { @@ -340,7 +340,7 @@ private void setCustomProperties(List> propList) throws WIME * @param configProps map containing the configuration information. * * @throws WIMException throw when there is not a mapping for a user - * or not a mapping for a group. + * or not a mapping for a group. */ private void setConfigEntityMapping(Map configProps) throws WIMException { List entityTypes = getSupportedEntityTypes(); @@ -384,11 +384,11 @@ private List getSupportedEntityTypes() { * Get the information about Users and Groups from the underlying User Registry * * @param root Input object containing set identifiers of objects to be fetched, - * and optionally control objects. + * and optionally control objects. * * @throws WIMException improper control objects are in the input datagraph, - * invalid properties are in a propertyControl object,or the underlying - * user registry throws an exception. + * invalid properties are in a propertyControl object,or the underlying + * user registry throws an exception. * * @return A Root object containing the required Person(s) or Group(s) * @@ -520,7 +520,7 @@ public String buildRDN(String value) { * Get the attributes requested for the entity. * * @param controlObject the control object containing the attributes. - * @param type the type of object the attributes are requested for. Group or Person. + * @param type the type of object the attributes are requested for. Group or Person. */ private List getAttributes(PropertyControl control, String type) throws WIMException { List attrList = new ArrayList(10); @@ -708,7 +708,7 @@ private String[] getEntityTypeFromUniqueName(String secName, List entity } } else { if (entityType.contains(personAccountType) || noSpecificEntityType) { - List resultList = searchUsers(secName, 1).getList(); + List resultList = searchUsers(secName, 1).getList(); if (resultList.size() > 0) { typeList.add(personAccountType); @@ -1278,26 +1278,6 @@ public Root update(Root root) throws WIMException { WIMMessageHelper.generateMsgParms(reposId))); } - /** - * @param returnRoot - */ - private boolean isURBridgeResult(Root returnRoot) { - // Check if there is a valid response - if (returnRoot != null && !returnRoot.getEntities().isEmpty()) { - // Determine if the return object to check if the context was set. - List contexts = returnRoot.getContexts(); - for (Context context : contexts) { - String key = context.getKey(); - - if (key != null && SchemaConstantsInternal.IS_URBRIDGE_RESULT.equals(key)) { - if ("true".equalsIgnoreCase((String) context.getValue())) - return true; - } - } - } - return false; - } - /** * Is the entity in this realm? * @@ -1309,29 +1289,35 @@ public boolean isEntityInRealm(String uniqueName) { if (isSafRegistry()) { try { - return userRegistry.isValidUser(uniqueName); + if (userRegistry.isValidUser(uniqueName)) { + return true; + } } catch (Exception e) { /* Ignore. */ } try { - return userRegistry.isValidGroup(uniqueName); + if (userRegistry.isValidGroup(uniqueName)) { + return true; + } } catch (Exception e) { /* Ignore. */ } } else { try { SearchResult result = userRegistry.getUsers(uniqueName, 1); - if (result != null && result.getList().size() > 0) + if (result != null && result.getList().size() > 0) { return true; + } } catch (Exception e) { /* Ignore. */ } try { SearchResult result = userRegistry.getGroups(uniqueName, 1); - if (result != null && result.getList().size() > 0) + if (result != null && result.getList().size() > 0) { return true; + } } catch (Exception e) { /* Ignore. */ }