public int hashCode() { int result = NULL_HASH_CODE; String name = getName(); if (name != null) { result += name.hashCode(); } if (password != null) { result += password.hashCode(); } return result; }
public int hashCode() { int result = NULL_HASH_CODE; String name = getName(); if (name != null) { result += name.hashCode(); } if (password != null) { result += password.hashCode(); } return result; }
public static Subject createSubject(ManagedConnectionFactory mcf, final ResourcePrincipal prin) { final Subject tempSubject = new Subject(); if (prin != null) { String password = prin.getPassword(); if (password != null) { final PasswordCredential pc = new PasswordCredential(prin.getName(), password.toCharArray()); pc.setManagedConnectionFactory(mcf); AccessController.doPrivileged(new PrivilegedAction() { public Object run() { tempSubject.getPrincipals().add(prin); tempSubject.getPrivateCredentials().add(pc); return null; } }); } } return tempSubject; }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for the descriptor * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, ResourcePrincipal rpDescriptor) { Node principalNode = super.writeDescriptor(parent, nodeName, null); appendTextChild(principalNode, RuntimeTagNames.NAME, rpDescriptor.getName()); appendTextChild(principalNode, RuntimeTagNames.PASSWORD, rpDescriptor.getPassword()); return principalNode; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for the descriptor * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, ResourcePrincipal rpDescriptor) { Node principalNode = super.writeDescriptor(parent, nodeName, null); appendTextChild(principalNode, RuntimeTagNames.NAME, rpDescriptor.getName()); appendTextChild(principalNode, RuntimeTagNames.PASSWORD, rpDescriptor.getPassword()); return principalNode; } }