本文整理汇总了Java中com.esri.ges.core.validation.ValidationException类的典型用法代码示例。如果您正苦于以下问题:Java ValidationException类的具体用法?Java ValidationException怎么用?Java ValidationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationException类属于com.esri.ges.core.validation包,在下文中一共展示了ValidationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException
{
LOG.info("validate starts.................");
super.validate();
try
{
//srIn = SpatialReference.create(inwkid);
srBuffer = SpatialReference.create(procwkid);
srOut = SpatialReference.create(outwkid);
}
catch(Exception e)
{
ValidationException ve = new ValidationException("Invalid wkid");
LOG.error(e.getMessage());
LOG.error(ve.getMessage());
throw ve;
}
LOG.info("validate ends................");
}
示例2: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException {
super.validate();
List<String> errors = new ArrayList<String>();
if (idleLimit <= 0)
errors.add(LOGGER.translate("VALIDATION_GAP_DURATION_INVALID",
definition.getName()));
if (errors.size() > 0) {
StringBuffer sb = new StringBuffer();
for (String message : errors)
sb.append(message).append("\n");
throw new ValidationException(LOGGER.translate("VALIDATION_ERROR",
this.getClass().getName(), sb.toString()));
}
}
示例3: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException {
// Validation Phase ...
super.validate();
if (bufferEventFld == null) {
if (radius == null)
throw new ValidationException("Radius is not specified.");
if (radius <= 0)
throw new ValidationException("Radius must be greater than 0.");
} else if (bufferEventFld.trim().equals("")) {
if (radius == null)
throw new ValidationException("Radius is not specified.");
if (radius <= 0)
throw new ValidationException("Radius must be greater than 0.");
}
}
示例4: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException
{
super.validate();
List<String> errors = new ArrayList<String>();
if (idleLimit <= 0)
errors.add(LOGGER.translate("VALIDATION_GAP_DURATION_INVALID", definition.getName()));
if (errors.size() > 0)
{
StringBuffer sb = new StringBuffer();
for (String message : errors)
sb.append(message).append("\n");
throw new ValidationException(LOGGER.translate("VALIDATION_ERROR", this.getClass().getName(), sb.toString()));
}
}
示例5: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException {
try
{
super.validate();
}
catch(Exception e)
{
LOG.error(e.getMessage());
}
}
示例6: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException {
super.validate();
if (zkConnect == null || zkConnect.isEmpty())
throw new ValidationException(LOGGER.translate("ZKCONNECT_VALIDATE_ERROR"));
if (bootstrap == null || bootstrap.isEmpty())
throw new ValidationException(LOGGER.translate("BOOTSTRAP_VALIDATE_ERROR"));
if (topic == null || topic.isEmpty())
throw new ValidationException(LOGGER.translate("TOPIC_VALIDATE_ERROR"));
ZkClient zkClient = new ZkClient(zkConnect, 10000, 8000, ZKStringSerializer$.MODULE$);
// Security for Kafka was added in Kafka 0.9.0.0 -> isSecureKafkaCluster = false
ZkUtils zkUtils = new ZkUtils(zkClient, new ZkConnection(zkConnect), false);
if (AdminUtils.topicExists(zkUtils, topic))
zkClient.deleteRecursive(ZkUtils.getTopicPath(topic));
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(null);
AdminUtils.createTopic(zkUtils, topic, partitions, replicas, new Properties(), RackAwareMode.Disabled$.MODULE$);
}
catch (Throwable th) {
LOGGER.error(th.getMessage(), th);
throw new ValidationException(th.getMessage());
}
finally {
Thread.currentThread().setContextClassLoader(classLoader);
}
zkClient.close();
}
示例7: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException {
super.validate();
if (zkConnect.isEmpty())
throw new ValidationException(LOGGER.translate("ZKCONNECT_VALIDATE_ERROR"));
if (topic.isEmpty())
throw new ValidationException(LOGGER.translate("TOPIC_VALIDATE_ERROR"));
if (groupId.isEmpty())
throw new ValidationException(LOGGER.translate("GROUP_ID_VALIDATE_ERROR"));
if (numThreads < 1)
throw new ValidationException(LOGGER.translate("NUM_THREADS_VALIDATE_ERROR"));
ZkClient zkClient = new ZkClient(zkConnect, 10000, 8000, ZKStringSerializer$.MODULE$);
// Security for Kafka was added in Kafka 0.9.0.0 -> isSecureKafkaCluster = false
ZkUtils zkUtils = new ZkUtils(zkClient, new ZkConnection(zkConnect), false);
Boolean topicExists = AdminUtils.topicExists(zkUtils, topic);
zkClient.close();
if (!topicExists)
throw new ValidationException(LOGGER.translate("TOPIC_VALIDATE_ERROR"));
// Init Consumer Config
Properties props = new Properties()
{
{ put("zookeeper.connect", zkConnect); }
{ put("group.id", groupId); }
{ put("zookeeper.session.timeout.ms", "400"); }
{ put("zookeeper.sync.time.ms", "200"); }
{ put("auto.commit.interval.ms", "1000"); }
};
consumerConfig = new ConsumerConfig(props);
}
示例8: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException
{
super.validate();
if (geoEventDefinitionName.isEmpty())
throw new ValidationException(LOGGER.translate("GED_EMPTY_ERROR"));
}
示例9: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException
{
if (host == null || host.isEmpty())
throw new ValidationException(LOGGER.translate("CONNECTION_HOST_VALIDATE_ERROR"));
if (port <= 0)
throw new ValidationException(LOGGER.translate("CONNECTION_PORT_VALIDATE_ERROR"));
}
示例10: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException
{
super.validate();
connectionInfo.validate();
exchange.validate();
}
示例11: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException
{
super.validate();
connectionInfo.validate();
exchange.validate();
queue.validate();
}
示例12: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public void validate() throws ValidationException
{
super.validate();
List<String> errors = new ArrayList<String>();
if (reportInterval <= 0)
errors.add(LOGGER.translate("VALIDATION_INVALID_REPORT_INTERVAL", definition.getName()));
if (errors.size() > 0)
{
StringBuffer sb = new StringBuffer();
for (String message : errors)
sb.append(message).append("\n");
throw new ValidationException(LOGGER.translate("VALIDATION_ERROR", this.getClass().getName(), sb.toString()));
}
}
示例13: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException
{
super.validate();
List<String> errors = new ArrayList<String>();
if (resultDestination == null)
errors.add("Result Destination is unknown.");
if (ResultDestination.NEW_FIELD.equals(resultDestination))
{
try
{
fieldDefinition = new DefaultFieldDefinition(fieldName, fieldType);
tag(fieldDefinition);
}
catch (Exception e)
{
errors.add(e.getMessage());
}
}
else if (ResultDestination.EXISTING_FIELD.equals(resultDestination))
if (fieldName.isEmpty())
errors.add(LOGGER.translate("VALIDATION_ERROR_FIELD_DOESNT_EXIST"));
if (errors.size() > 0)
{
StringBuffer sb = new StringBuffer();
for (String message : errors)
sb.append(message).append("\n");
throw new ValidationException(LOGGER.translate("VALIDATION_ERROR", sb.toString()));
}
}
示例14: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException {
// Validation Phase ...
super.validate();
}
示例15: validate
import com.esri.ges.core.validation.ValidationException; //导入依赖的package包/类
@Override
public synchronized void validate() throws ValidationException {
// Validation Phase ...
super.validate();
}