public MailSessionDescriptor getDescriptor() { if (descriptor == null) { descriptor = new MailSessionDescriptor(); } return descriptor; } }
public boolean equals(Object object) { if (object instanceof MailSessionDescriptor) { MailSessionDescriptor reference = (MailSessionDescriptor) object; return getJavaName(this.getName()).equals(getJavaName(reference.getName())); } return false; }
public boolean isConflict(MailSessionDescriptor other) { return (getName().equals(other.getName())) && !( DOLUtils.equals(getUser(), other.getUser()) && DOLUtils.equals(getPassword(), other.getPassword()) && DOLUtils.equals(getFrom(), other.getFrom()) && DOLUtils.equals(getHost(), other.getHost()) && DOLUtils.equals(getPassword(), other.getPassword()) && DOLUtils.equals(getStoreProtocol(), other.getStoreProtocol()) && DOLUtils.equals(getTransportProtocol(), other.getTransportProtocol()) && DOLUtils.equals(getDescription(), other.getDescription()) && properties.equals(other.properties) ); } }
public int hashCode() { int result = 17; result = 37 * result + getName().hashCode(); return result; }
public Node writeDescriptor(Node node, Descriptor desc) { Properties properties = null; if (desc instanceof MailSessionDescriptor) { properties = ((MailSessionDescriptor) desc).getProperties(); } else if (desc instanceof ConnectionFactoryDefinitionDescriptor) { properties = ((ConnectionFactoryDefinitionDescriptor) desc).getProperties(); } else if (desc instanceof DataSourceDefinitionDescriptor) { properties = ((DataSourceDefinitionDescriptor) desc).getProperties(); } else if (desc instanceof JMSConnectionFactoryDefinitionDescriptor) { properties = ((JMSConnectionFactoryDefinitionDescriptor) desc).getProperties(); } else if (desc instanceof JMSDestinationDefinitionDescriptor) { properties = ((JMSDestinationDefinitionDescriptor) desc).getProperties(); } if (properties != null) { Set keys = properties.keySet(); for (Object key : keys) { String name = (String) key; String value = (String) properties.get(name); Node propertyNode = appendChild(node, TagNames.RESOURCE_PROPERTY); appendTextChild(propertyNode, TagNames.RESOURCE_PROPERTY_NAME, name); appendTextChild(propertyNode, TagNames.RESOURCE_PROPERTY_VALUE, value); } } return node; }
public Node writeDescriptor(Node parent, String nodeName, MailSessionDescriptor mailSessionDesc) { Node node = appendChild(parent, nodeName); appendTextChild(node, TagNames.MAIL_SESSION_NAME, mailSessionDesc.getName()); appendTextChild(node, TagNames.MAIL_SESSION_STORE_PROTOCOL, mailSessionDesc.getStoreProtocol()); appendTextChild(node, TagNames.MAIL_SESSION_TRANSPORT_PROTOCOL, mailSessionDesc.getTransportProtocol()); appendTextChild(node, TagNames.MAIL_SESSION_HOST, mailSessionDesc.getHost()); appendTextChild(node, TagNames.MAIL_SESSION_USER, mailSessionDesc.getUser()); appendTextChild(node, TagNames.MAIL_SESSION_PASSWORD, mailSessionDesc.getPassword()); appendTextChild(node, TagNames.MAIL_SESSION_FROM, mailSessionDesc.getFrom()); ResourcePropertyNode propertyNode = new ResourcePropertyNode(); propertyNode.writeDescriptor(node, mailSessionDesc); return node; }