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


Java TokenSelector类代码示例

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


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

示例1: getServerToken

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
/**
 * Try to locate the required token for the server.
 * 
 * @param authType of the SASL client
 * @return Token for server, or null if no token available
 * @throws IOException - token selector cannot be instantiated
 */
private Token<?> getServerToken(SaslAuth authType) throws IOException {
  TokenInfo tokenInfo = SecurityUtil.getTokenInfo(protocol, conf);
  LOG.debug("Get token info proto:" + protocol + " info:" + tokenInfo);
  if (tokenInfo == null) { // protocol has no support for tokens
    return null;
  }
  TokenSelector<?> tokenSelector = null;
  try {
    tokenSelector = tokenInfo.value().newInstance();
  } catch (InstantiationException | IllegalAccessException e) {
    throw new IOException(e.toString(), e);
  }
  return tokenSelector.selectToken(
      SecurityUtil.buildTokenService(serverAddr), ugi.getTokens());
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:23,代码来源:SaslRpcClient.java

示例2: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(ContainerManagementProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return NMTokenSelector.class;
    }
  };

}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:ContainerManagerSecurityInfo.java

示例3: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol.equals(ApplicationMasterProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return AMRMTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:SchedulerSecurityInfo.java

示例4: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(ApplicationClientProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return RMDelegationTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ClientRMSecurityInfo.java

示例5: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(ApplicationHistoryProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return TimelineDelegationTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ClientTimelineSecurityInfo.java

示例6: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(LocalizationProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      LOG.debug("Using localizerTokenSecurityInfo");
      return LocalizerTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:LocalizerSecurityInfo.java

示例7: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientToAMTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestClientToAMTokens.java

示例8: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol.equals(MRClientProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientToAMTokenSelector.class;
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:MRClientSecurityInfo.java

示例9: getTokenInfo

import org.apache.hadoop.security.token.TokenSelector; //导入依赖的package包/类
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(HSClientProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientHSTokenSelector.class;
    }
  };  }
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:ClientHSSecurityInfo.java


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