public boolean isConflict(DataSourceDefinitionDescriptor other) { return (getName().equals(other.getName())) && !( DOLUtils.equals(getClassName(), other.getClassName()) && DOLUtils.equals(getServerName(), other.getServerName()) && getPortNumber() == other.getPortNumber() && DOLUtils.equals(getDatabaseName(), other.getDatabaseName()) && DOLUtils.equals(getUrl(), other.getUrl()) && DOLUtils.equals(getUser(), other.getUser()) && DOLUtils.equals(getPassword(), other.getPassword()) && properties.equals(other.properties) && getLoginTimeout() == other.getLoginTimeout() && isTransactional() == other.isTransactional() && getIsolationLevel() == other.getIsolationLevel() && getInitialPoolSize() == other.getInitialPoolSize() && getMinPoolSize() == other.getMinPoolSize() && getMaxPoolSize() == other.getMaxPoolSize() && getMaxIdleTime() == other.getMaxIdleTime() && getMaxStatements() == other.getMaxStatements() ); } }
boolean isConflict(DataSourceDefinitionDescriptor other) { return (getName().equals(other.getName())) && !( DOLUtils.equals(getClassName(), other.getClassName()) && DOLUtils.equals(getServerName(), other.getServerName()) && getPortNumber() == other.getPortNumber() && DOLUtils.equals(getDatabaseName(), other.getDatabaseName()) && DOLUtils.equals(getUrl(), other.getUrl()) && DOLUtils.equals(getUser(), other.getUser()) && DOLUtils.equals(getPassword(), other.getPassword()) && properties.equals(other.properties) && getLoginTimeout() == other.getLoginTimeout() && isTransactional() == other.isTransactional() && getIsolationLevel() == other.getIsolationLevel() && getInitialPoolSize() == other.getInitialPoolSize() && getMinPoolSize() == other.getMinPoolSize() && getMaxPoolSize() == other.getMaxPoolSize() && getMaxIdleTime() == other.getMaxIdleTime() && getMaxStatements() == other.getMaxStatements() ); } }
public Node writeDescriptor(Node parent, String nodeName, DataSourceDefinitionDescriptor dataSourceDesc) { Node node = appendChild(parent, nodeName); appendTextChild(node, TagNames.DATA_SOURCE_DESCRIPTION, dataSourceDesc.getDescription()); appendTextChild(node, TagNames.DATA_SOURCE_NAME, dataSourceDesc.getName()); appendTextChild(node, TagNames.DATA_SOURCE_CLASS_NAME, dataSourceDesc.getClassName()); appendTextChild(node, TagNames.DATA_SOURCE_SERVER_NAME, dataSourceDesc.getServerName()); appendTextChild(node, TagNames.DATA_SOURCE_PORT_NUMBER, dataSourceDesc.getPortNumber()); appendTextChild(node, TagNames.DATA_SOURCE_DATABASE_NAME, dataSourceDesc.getDatabaseName()); appendTextChild(node, TagNames.DATA_SOURCE_URL, dataSourceDesc.getUrl()); appendTextChild(node, TagNames.DATA_SOURCE_USER, dataSourceDesc.getUser()); appendTextChild(node, TagNames.DATA_SOURCE_PASSWORD, dataSourceDesc.getPassword()); ResourcePropertyNode propertyNode = new ResourcePropertyNode(); propertyNode.writeDescriptor(node, dataSourceDesc); appendTextChild(node, TagNames.DATA_SOURCE_LOGIN_TIMEOUT, String.valueOf(dataSourceDesc.getLoginTimeout())); appendTextChild(node, TagNames.DATA_SOURCE_TRANSACTIONAL, String.valueOf(dataSourceDesc.isTransactional())); //DD specified Enumeration values are String //Annotation uses integer values and hence this mapping is needed String isolationLevelString = dataSourceDesc.getIsolationLevelString(); if(isolationLevelString != null){ appendTextChild(node, TagNames.DATA_SOURCE_ISOLATION_LEVEL, isolationLevelString); } appendTextChild(node, TagNames.DATA_SOURCE_INITIAL_POOL_SIZE, dataSourceDesc.getInitialPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MAX_POOL_SIZE, dataSourceDesc.getMaxPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MIN_POOL_SIZE, dataSourceDesc.getMinPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MAX_IDLE_TIME, String.valueOf(dataSourceDesc.getMaxIdleTime())); appendTextChild(node, TagNames.DATA_SOURCE_MAX_STATEMENTS, dataSourceDesc.getMaxStatements()); return node; }
if (desc.getUser() == null) { if (defn.user() != null && !defn.user().equals("")) { desc.setUser(defn.user());
public Node writeDescriptor(Node parent, String nodeName, DataSourceDefinitionDescriptor dataSourceDesc) { Node node = appendChild(parent, nodeName); appendTextChild(node, TagNames.DATA_SOURCE_DESCRIPTION, dataSourceDesc.getDescription()); appendTextChild(node, TagNames.DATA_SOURCE_NAME, dataSourceDesc.getName()); appendTextChild(node, TagNames.DATA_SOURCE_CLASS_NAME, dataSourceDesc.getClassName()); appendTextChild(node, TagNames.DATA_SOURCE_SERVER_NAME, dataSourceDesc.getServerName()); appendTextChild(node, TagNames.DATA_SOURCE_PORT_NUMBER, dataSourceDesc.getPortNumber()); appendTextChild(node, TagNames.DATA_SOURCE_DATABASE_NAME, dataSourceDesc.getDatabaseName()); appendTextChild(node, TagNames.DATA_SOURCE_URL, dataSourceDesc.getUrl()); appendTextChild(node, TagNames.DATA_SOURCE_USER, dataSourceDesc.getUser()); appendTextChild(node, TagNames.DATA_SOURCE_PASSWORD, dataSourceDesc.getPassword()); DataSourcePropertyNode propertyNode = new DataSourcePropertyNode(); propertyNode.writeDescriptor(node, dataSourceDesc); appendTextChild(node, TagNames.DATA_SOURCE_LOGIN_TIMEOUT, String.valueOf(dataSourceDesc.getLoginTimeout())); appendTextChild(node, TagNames.DATA_SOURCE_TRANSACTIONAL, String.valueOf(dataSourceDesc.isTransactional())); //DD specified Enumeration values are String //Annotation uses integer values and hence this mapping is needed String isolationLevelString = dataSourceDesc.getIsolationLevelString(); if(isolationLevelString != null){ appendTextChild(node, TagNames.DATA_SOURCE_ISOLATION_LEVEL, isolationLevelString); } appendTextChild(node, TagNames.DATA_SOURCE_INITIAL_POOL_SIZE, dataSourceDesc.getInitialPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MAX_POOL_SIZE, dataSourceDesc.getMaxPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MIN_POOL_SIZE, dataSourceDesc.getMinPoolSize()); appendTextChild(node, TagNames.DATA_SOURCE_MAX_IDLE_TIME, String.valueOf(dataSourceDesc.getMaxIdleTime())); appendTextChild(node, TagNames.DATA_SOURCE_MAX_STATEMENTS, dataSourceDesc.getMaxStatements()); return node; }