/** * Adds a new DOL descriptor instance to the descriptor instance associated with * this XMLNode * * @param descriptor the new descriptor */ public void addDescriptor(Object newDescriptor) { MapElement descriptor = (MapElement) getDescriptor(); if (descriptor==null) { throw new RuntimeException("Cannot set info on null descriptor"); } if (newDescriptor instanceof Principal) { Principal principal = (Principal) newDescriptor; if (principal.getValue(Principal.CREDENTIAL)==null) { descriptor.addPrincipal(principal); } else { descriptor.setBackendPrincipal(true); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.USER_NAME, principal.getValue(Principal.USER_NAME)); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.PASSWORD, principal.getValue(Principal.PASSWORD)); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.CREDENTIAL, principal.getValue(Principal.CREDENTIAL)); } } }
/** * Adds a new DOL descriptor instance to the descriptor instance associated with * this XMLNode * * @param descriptor the new descriptor */ public void addDescriptor(Object newDescriptor) { MapElement descriptor = (MapElement) getDescriptor(); if (descriptor==null) { throw new RuntimeException("Cannot set info on null descriptor"); } if (newDescriptor instanceof Principal) { Principal principal = (Principal) newDescriptor; if (principal.getValue(Principal.CREDENTIAL)==null) { descriptor.addPrincipal(principal); } else { descriptor.setBackendPrincipal(true); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.USER_NAME, principal.getValue(Principal.USER_NAME)); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.PASSWORD, principal.getValue(Principal.PASSWORD)); descriptor.setAttributeValue(MapElement.BACKEND_PRINCIPAL, Principal.CREDENTIAL, principal.getValue(Principal.CREDENTIAL)); } } }