return;
}
Node nameNode = attributes.getNamedItem(WORK_SECURITY_MAP_NAME);
Resource workSecurityMapResource = new Resource(org.glassfish.resources.api.Resource.CONNECTOR_WORK_SECURITY_MAP);
if(nameNode != null){
String name = nameNode.getNodeValue();
workSecurityMapResource.setAttribute(WORK_SECURITY_MAP_NAME, name);
}
Node raNameNode = attributes.getNamedItem(WORK_SECURITY_MAP_RA_NAME);
if(raNameNode != null) {
workSecurityMapResource.setAttribute(WORK_SECURITY_MAP_RA_NAME, raNameNode.getNodeValue());
}
NodeList children = node.getChildNodes();
if(children != null){
for(int i=0; i<children.getLength();i++){
Node child = children.item(i);
String nodeName = child.getNodeName();
if(nodeName.equals(WORK_SECURITY_MAP_GROUP_MAP)){
Properties groupMaps = new Properties();
NamedNodeMap childAttributes = child.getAttributes();
if(childAttributes != null){
Node eisGroup = childAttributes.getNamedItem(WORK_SECURITY_MAP_EIS_GROUP);
Node mappedGroup = childAttributes.getNamedItem(WORK_SECURITY_MAP_MAPPED_GROUP);
if(eisGroup != null && mappedGroup != null){
String eisGroupValue = eisGroup.getNodeValue();
String serverGroupValue = mappedGroup.getNodeValue();
if(eisGroupValue != null && serverGroupValue != null){
groupMaps.put(eisGroupValue, serverGroupValue);
}
}
workSecurityMapResource.setAttribute(WORK_SECURITY_MAP_GROUP_MAP, groupMaps);
}
}else if(nodeName.equals(WORK_SECURITY_MAP_PRINCIPAL_MAP)){
Properties principalMaps = new Properties();
NamedNodeMap childAttributes = child.getAttributes();
if(childAttributes != null){
Node eisPrincipal = childAttributes.getNamedItem(WORK_SECURITY_MAP_EIS_PRINCIPAL);
Node mappedPrincipal = childAttributes.getNamedItem(WORK_SECURITY_MAP_MAPPED_PRINCIPAL);
if(eisPrincipal != null && mappedPrincipal != null){
String eisPrincipalValue = eisPrincipal.getNodeValue();
String serverPrincipalValue = mappedPrincipal.getNodeValue();
if(eisPrincipalValue != null && serverPrincipalValue != null){
principalMaps.put(eisPrincipalValue, serverPrincipalValue);
}
}
workSecurityMapResource.setAttribute(WORK_SECURITY_MAP_PRINCIPAL_MAP, principalMaps);
}
}
}
}
vResources.add(workSecurityMapResource);