1 31 package org.objectweb.proactive.ext.security; 32 33 import java.io.Serializable ; 34 import java.security.cert.X509Certificate ; 35 36 37 43 public class EntityVirtualNode extends Entity implements Serializable { 44 protected String virtualNodeName; 45 46 public EntityVirtualNode() {} 47 48 51 public EntityVirtualNode(String name, X509Certificate application, 52 X509Certificate certificate) { 53 super(); 54 virtualNodeName = name; 55 if (application == null ) { 56 System.out.println("APPPLICATION CERTITIFACATE IS NULLL"); 57 throw new RuntimeException (); 58 } 59 if (name == null ) { 60 System.out.println("APPPLICATION Name IS NULLL"); 61 throw new RuntimeException (); 62 } 63 64 System.out.println("VIRTUAL NODE ENTITY CONSTRUCTOR " + application.getSubjectDN()); 65 this.applicationCertificate = application; 66 } 68 69 74 public String getName() { 75 return virtualNodeName; 76 } 77 78 public String toString() { 79 String s = null; 80 s = virtualNodeName; 81 s += applicationCertificate.getSubjectDN().getName() +" |||| "; 82 return s ; 84 } 85 86 public boolean equals(Entity e) { 87 if (e instanceof EntityVirtualNode) { 88 if (applicationCertificate == null) { 89 90 logger.debug("applicationCErtificate null"); 91 return false; 92 } 93 if (((EntityVirtualNode) e).getApplicationCertificate() == null) { 95 logger.debug("distant applicationCErtificate null"); 96 return false; 97 } 98 100 return this.virtualNodeName.equals(((EntityVirtualNode) e).virtualNodeName) && e.getApplicationCertificate().equals(applicationCertificate); 101 } 102 return false; 103 } 104 105 106 107 108 } 109 | Popular Tags |