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


Java GetSASLRequest类代码示例

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


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

示例1: sendSaslPacket

import org.apache.zookeeper.proto.GetSASLRequest; //导入依赖的package包/类
private void sendSaslPacket(byte[] saslToken, ClientCnxn cnxn)
  throws SaslException{
    if (LOG.isDebugEnabled()) {
        LOG.debug("ClientCnxn:sendSaslPacket:length="+saslToken.length);
    }

    GetSASLRequest request = new GetSASLRequest();
    request.setToken(saslToken);
    SetSASLResponse response = new SetSASLResponse();
    ServerSaslResponseCallback cb = new ServerSaslResponseCallback();

    try {
        cnxn.sendPacket(request,response,cb, ZooDefs.OpCode.sasl);
    } catch (IOException e) {
        throw new SaslException("Failed to send SASL packet to server.",
            e);
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:19,代码来源:ZooKeeperSaslClient.java

示例2: checkType

import org.apache.zookeeper.proto.GetSASLRequest; //导入依赖的package包/类
private EventType checkType(Record response) {

        if (response == null) {
            return EventType.other;
        } else if (response instanceof ConnectRequest) {
            return EventType.write;
        } else if (response instanceof CreateRequest) {
            return EventType.write;
        } else if (response instanceof DeleteRequest) {
            return EventType.write;
        } else if (response instanceof SetDataRequest) {
            return EventType.write;
        } else if (response instanceof SetACLRequest) {
            return EventType.write;
        } else if (response instanceof SetMaxChildrenRequest) {
            return EventType.write;
        } else if (response instanceof SetSASLRequest) {
            return EventType.write;
        } else if (response instanceof SetWatches) {
            return EventType.write;
        } else if (response instanceof SyncRequest) {
            return EventType.write;
        } else if (response instanceof ExistsRequest) {
            return EventType.read;
        } else if (response instanceof GetDataRequest) {
            return EventType.read;
        } else if (response instanceof GetMaxChildrenRequest) {
            return EventType.read;
        } else if (response instanceof GetACLRequest) {
            return EventType.read;
        } else if (response instanceof GetChildrenRequest) {
            return EventType.read;
        } else if (response instanceof GetChildren2Request) {
            return EventType.read;
        } else if (response instanceof GetSASLRequest) {
            return EventType.read;
        } else {
            return EventType.other;
        }
    }
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:41,代码来源:ClientCnxnAspect.java


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