当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationException类代码示例

本文整理汇总了Java中com.datastax.driver.core.exceptions.AuthenticationException的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationException类的具体用法?Java AuthenticationException怎么用?Java AuthenticationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AuthenticationException类属于com.datastax.driver.core.exceptions包,在下文中一共展示了AuthenticationException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCassandraException

import com.datastax.driver.core.exceptions.AuthenticationException; //导入依赖的package包/类
protected void checkCassandraException(Exception e) {
    _mexceptions.incr();
    if (e instanceof AlreadyExistsException ||
            e instanceof AuthenticationException ||
            e instanceof DriverException ||
            e instanceof DriverInternalError ||
            e instanceof InvalidConfigurationInQueryException ||
            e instanceof InvalidQueryException ||
            e instanceof InvalidTypeException ||
            e instanceof QueryExecutionException ||
            e instanceof QueryTimeoutException ||
            e instanceof QueryValidationException ||
            e instanceof ReadTimeoutException ||
            e instanceof SyntaxError ||
            e instanceof TraceRetrievalException ||
            e instanceof TruncateException ||
            e instanceof UnauthorizedException ||
            e instanceof UnavailableException ||
            e instanceof ReadTimeoutException ||
            e instanceof WriteTimeoutException) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }
}
 
开发者ID:hpcc-systems,项目名称:storm-cassandra-cql,代码行数:26,代码来源:CassandraCqlMapState.java

示例2: checkCassandraReachable

import com.datastax.driver.core.exceptions.AuthenticationException; //导入依赖的package包/类
private boolean checkCassandraReachable(List<ConfigIssue> issues) {
  boolean isReachable = true;
  try (Cluster validationCluster = getCluster()) {
    Session validationSession = validationCluster.connect();
    validationSession.close();
  } catch (NoHostAvailableException | AuthenticationException | IllegalStateException | StageException e) {
    isReachable = false;
    Target.Context context = getContext();
    LOG.error(Errors.CASSANDRA_05.getMessage(), e.toString(), e);
    issues.add(
        context.createConfigIssue(
        Groups.CASSANDRA.name(),
        CONTACT_NODES_LABEL,
        Errors.CASSANDRA_05, e.toString()
        )
    );
  }
  return isReachable;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:20,代码来源:CassandraTarget.java

示例3: testNoUsername

import com.datastax.driver.core.exceptions.AuthenticationException; //导入依赖的package包/类
@Test
public void testNoUsername() {
    CassandraConnection cc = new CassandraConnection();

    cc.setProperty("contactPoints", NODE_1_IP);
    cc.setProperty("sessionName", "testsession2");

    Boolean exeptionCaught=false;

    try {
        cc.testStarted();
    } catch (AuthenticationException e) {
        exeptionCaught = true;
    }
    assertTrue(exeptionCaught, "AuthenticationException did not occur.");
}
 
开发者ID:slowenthal,项目名称:jmeter-cassandra,代码行数:17,代码来源:UserPassConnectionTest.java

示例4: testShouldReturnAuthenticationError

import com.datastax.driver.core.exceptions.AuthenticationException; //导入依赖的package包/类
@Test
public void testShouldReturnAuthenticationError() throws Exception {
  String message = "Invalid password, man!";
  server.prime(when(query).then(authenticationError(message)));

  thrown.expect(AuthenticationException.class);
  thrown.expectMessage(endsWith(message));
  query();
}
 
开发者ID:datastax,项目名称:simulacron,代码行数:10,代码来源:ErrorResultIntegrationTest.java


注:本文中的com.datastax.driver.core.exceptions.AuthenticationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。