@Override public void validate() throws ValidateException { if (this.driverClass != null && (this.connectionUrl == null || this.connectionUrl.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.CONNECTION_URL.getLocalName(), this.getClass().getCanonicalName())); if ((this.driverClass == null || this.driverClass.trim().length() == 0) && (this.dataSourceClass == null || this.dataSourceClass.trim().length() == 0) && (this.driver == null || this.driver.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.DRIVER_CLASS.getLocalName(), this.getClass().getCanonicalName())); }
for (Property connectionProperty : dataSourceNode.get(CONNECTION_PROPERTIES.getName()).asPropertyList()) { writeProperty(writer, dataSourceNode, connectionProperty.getName(), connectionProperty .getValue().get("value").asString(), DataSource.Tag.CONNECTION_PROPERTY.getLocalName()); if (poolRequired) { writer.writeStartElement(isXADataSource ? XaDataSource.Tag.XA_POOL.getLocalName() : DataSource.Tag.POOL .getLocalName()); MIN_POOL_SIZE.marshallAsElement(dataSourceNode, writer); INITIAL_POOL_SIZE.marshallAsElement(dataSourceNode, writer); REAUTHPLUGIN_PROPERTIES.isMarshallable(dataSourceNode); if (securityRequired) { writer.writeStartElement(DataSource.Tag.SECURITY.getLocalName()); USERNAME.marshallAsElement(dataSourceNode, writer); PASSWORD.marshallAsElement(dataSourceNode, writer); EXCEPTION_SORTER_PROPERTIES.isMarshallable(dataSourceNode); if (validationRequired) { writer.writeStartElement(DataSource.Tag.VALIDATION.getLocalName()); if (dataSourceNode.hasDefined(VALID_CONNECTION_CHECKER_CLASSNAME.getName())) { writer.writeStartElement(Validation.Tag.VALID_CONNECTION_CHECKER.getLocalName()); XA_RESOURCE_TIMEOUT.isMarshallable(dataSourceNode); if (timeoutRequired) { writer.writeStartElement(DataSource.Tag.TIMEOUT.getLocalName()); SET_TX_QUERY_TIMEOUT.marshallAsElement(dataSourceNode, writer); BLOCKING_TIMEOUT_WAIT_MILLIS.marshallAsElement(dataSourceNode, writer); writer.writeStartElement(DataSource.Tag.STATEMENT.getLocalName());
@Override public void validate() throws ValidateException { if (this.driverClass != null && (this.connectionUrl == null || this.connectionUrl.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.CONNECTION_URL.getLocalName(), this.getClass().getCanonicalName())); if ((this.driverClass == null || this.driverClass.trim().length() == 0) && (this.dataSourceClass == null || this.dataSourceClass.trim().length() == 0) && (this.driver == null || this.driver.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.DRIVER_CLASS.getLocalName(), this.getClass().getCanonicalName())); }
for (Property connectionProperty : dataSourceNode.get(CONNECTION_PROPERTIES.getName()).asPropertyList()) { writeProperty(writer, dataSourceNode, connectionProperty.getName(), connectionProperty .getValue().get("value").asString(), DataSource.Tag.CONNECTION_PROPERTY.getLocalName()); if (poolRequired) { writer.writeStartElement(isXADataSource ? XaDataSource.Tag.XA_POOL.getLocalName() : DataSource.Tag.POOL .getLocalName()); MIN_POOL_SIZE.marshallAsElement(dataSourceNode, writer); INITIAL_POOL_SIZE.marshallAsElement(dataSourceNode, writer); REAUTHPLUGIN_PROPERTIES.isMarshallable(dataSourceNode); if (securityRequired) { writer.writeStartElement(DataSource.Tag.SECURITY.getLocalName()); USERNAME.marshallAsElement(dataSourceNode, writer); PASSWORD.marshallAsElement(dataSourceNode, writer); EXCEPTION_SORTER_PROPERTIES.isMarshallable(dataSourceNode); if (validationRequired) { writer.writeStartElement(DataSource.Tag.VALIDATION.getLocalName()); if (dataSourceNode.hasDefined(VALID_CONNECTION_CHECKER_CLASSNAME.getName())) { writer.writeStartElement(Validation.Tag.VALID_CONNECTION_CHECKER.getLocalName()); XA_RESOURCE_TIMEOUT.isMarshallable(dataSourceNode); if (timeoutRequired) { writer.writeStartElement(DataSource.Tag.TIMEOUT.getLocalName()); SET_TX_QUERY_TIMEOUT.marshallAsElement(dataSourceNode, writer); BLOCKING_TIMEOUT_WAIT_MILLIS.marshallAsElement(dataSourceNode, writer); writer.writeStartElement(DataSource.Tag.STATEMENT.getLocalName());
/** * {@inheritDoc} */ public void validate() throws ValidateException { if (this.driverClass != null && (this.connectionUrl == null || this.connectionUrl.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.CONNECTION_URL.getLocalName(), this.getClass().getCanonicalName())); if ((this.driverClass == null || this.driverClass.trim().length() == 0) && (this.dataSourceClass == null || this.dataSourceClass.trim().length() == 0) && (this.driver == null || this.driver.trim().length() == 0)) throw new ValidateException(bundle.requiredElementMissing(Tag.DRIVER_CLASS.getLocalName(), this.getClass().getCanonicalName())); }