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


Java QualityOfProtection类代码示例

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


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

示例1: data

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> data() {
  Collection<Object[]> params = new ArrayList<Object[]>();
  for (QualityOfProtection qop : QualityOfProtection.values()) {
    params.add(new Object[]{ new QualityOfProtection[]{qop},qop, null });
  }
  params.add(new Object[]{ new QualityOfProtection[]{
      QualityOfProtection.PRIVACY,QualityOfProtection.AUTHENTICATION },
      QualityOfProtection.PRIVACY, null});
  params.add(new Object[]{ new QualityOfProtection[]{
      QualityOfProtection.PRIVACY,QualityOfProtection.AUTHENTICATION },
      QualityOfProtection.AUTHENTICATION ,
      "org.apache.hadoop.ipc.TestSaslRPC$AuthSaslPropertiesResolver" });

  return params;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:17,代码来源:TestSaslRPC.java

示例2: getSaslProperties

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
static Map<String, String> getSaslProperties(Configuration conf) {
  Map<String, String> saslProps =new TreeMap<String, String>();
  String[] qop = conf.getStrings(HADOOP_RPC_PROTECTION_NON_WHITELIST,
      QualityOfProtection.PRIVACY.toString());

  for (int i=0; i < qop.length; i++) {
    qop[i] = QualityOfProtection.valueOf(
        StringUtils.toUpperCase(qop[i])).getSaslQop();
  }

  saslProps.put(Sasl.QOP, StringUtils.join(",", qop));
  saslProps.put(Sasl.SERVER_AUTH, "true");

  return saslProps;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:16,代码来源:WhitelistBasedResolver.java

示例3: setConf

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
@Override
public void setConf(Configuration conf) {
  this.conf = conf;
  properties = new TreeMap<String,String>();
  String[] qop = conf.getTrimmedStrings(
      CommonConfigurationKeysPublic.HADOOP_RPC_PROTECTION,
      QualityOfProtection.AUTHENTICATION.toString());
  for (int i=0; i < qop.length; i++) {
    qop[i] = QualityOfProtection.valueOf(
        StringUtils.toUpperCase(qop[i])).getSaslQop();
  }
  properties.put(Sasl.QOP, StringUtils.join(",", qop));
  properties.put(Sasl.SERVER_AUTH, "true");
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:15,代码来源:SaslPropertiesResolver.java

示例4: TestSaslRPC

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
public TestSaslRPC(QualityOfProtection[] qop,
    QualityOfProtection expectedQop,
    String saslPropertiesResolver) {
  this.qop=qop;
  this.expectedQop = expectedQop;
  this.saslPropertiesResolver = saslPropertiesResolver;
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:8,代码来源:TestSaslRPC.java

示例5: getQOPNames

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
static String getQOPNames (QualityOfProtection[] qops){
  StringBuilder sb = new StringBuilder();
  int i = 0;
  for (QualityOfProtection qop:qops){
   sb.append(org.apache.hadoop.util.StringUtils.toLowerCase(qop.name()));
   if (++i < qops.length){
     sb.append(",");
   }
  }
  return sb.toString();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:TestSaslRPC.java

示例6: createSaslPropertiesForEncryption

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
/**
 * Creates SASL properties required for an encrypted SASL negotiation.
 *
 * @param encryptionAlgorithm to use for SASL negotation
 * @return properties of encrypted SASL negotiation
 */
public static Map<String, String> createSaslPropertiesForEncryption(
    String encryptionAlgorithm) {
  Map<String, String> saslProps = Maps.newHashMapWithExpectedSize(3);
  saslProps.put(Sasl.QOP, QualityOfProtection.PRIVACY.getSaslQop());
  saslProps.put(Sasl.SERVER_AUTH, "true");
  saslProps.put("com.sun.security.sasl.digest.cipher", encryptionAlgorithm);
  return saslProps;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:DataTransferSaslUtil.java

示例7: getSaslProperties

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
static Map<String, String> getSaslProperties(Configuration conf) {
  Map<String, String> saslProps =new TreeMap<String, String>();
  String[] qop = conf.getStrings(HADOOP_RPC_PROTECTION_NON_WHITELIST,
      QualityOfProtection.PRIVACY.toString());

  for (int i=0; i < qop.length; i++) {
    qop[i] = QualityOfProtection.valueOf(qop[i].toUpperCase()).getSaslQop();
  }

  saslProps.put(Sasl.QOP, StringUtils.join(",", qop));
  saslProps.put(Sasl.SERVER_AUTH, "true");

  return saslProps;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:15,代码来源:WhitelistBasedResolver.java

示例8: setConf

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
@Override
public void setConf(Configuration conf) {
  this.conf = conf;
  properties = new TreeMap<String,String>();
  String[] qop = conf.getTrimmedStrings(
      CommonConfigurationKeysPublic.HADOOP_RPC_PROTECTION,
      QualityOfProtection.AUTHENTICATION.toString());
  for (int i=0; i < qop.length; i++) {
    qop[i] = QualityOfProtection.valueOf(qop[i].toUpperCase()).getSaslQop();
  }
  properties.put(Sasl.QOP, StringUtils.join(",", qop));
  properties.put(Sasl.SERVER_AUTH, "true");
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:14,代码来源:SaslPropertiesResolver.java

示例9: getQOPNames

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
static String getQOPNames (QualityOfProtection[] qops){
  StringBuilder sb = new StringBuilder();
  int i = 0;
  for (QualityOfProtection qop:qops){
   sb.append(qop.name().toLowerCase());
   if (++i < qops.length){
     sb.append(",");
   }
  }
  return sb.toString();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:12,代码来源:TestSaslRPC.java

示例10: data

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> data() {
  Collection<Object[]> params = new ArrayList<Object[]>();
  for (QualityOfProtection qop : QualityOfProtection.values()) {
    params.add(new Object[]{ qop });
  }
  return params;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:9,代码来源:TestSaslRPC.java

示例11: doDigestRpc

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
private void doDigestRpc(Server server, TestTokenSecretManager sm)
    throws Exception {
  final UserGroupInformation current = UserGroupInformation.getCurrentUser();
  addr = NetUtils.getConnectAddress(server);
  TestTokenIdentifier tokenId = new TestTokenIdentifier(new Text(current
      .getUserName()));
  Token<TestTokenIdentifier> token = new Token<TestTokenIdentifier>(tokenId, sm);
  SecurityUtil.setTokenService(token, addr);
  current.addToken(token);

  TestRpcService proxy = null;
  try {
    proxy = getClient(addr, conf);
    AuthMethod authMethod = convert(
        proxy.getAuthMethod(null, newEmptyRequest()));
    assertEquals(TOKEN, authMethod);
    //QOP must be auth
    assertEquals(expectedQop.saslQop,
                 RPC.getConnectionIdForProxy(proxy).getSaslQop());
    int n = 0;
    for (Connection connection : server.getConnections()) {
      // only qop auth should dispose of the sasl server
      boolean hasServer = (connection.saslServer != null);
      assertTrue("qop:" + expectedQop + " hasServer:" + hasServer,
          (expectedQop == QualityOfProtection.AUTHENTICATION) ^ hasServer);
      n++;
    }
    assertTrue(n > 0);
    proxy.ping(null, newEmptyRequest());
  } finally {
    stop(server, proxy);
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:34,代码来源:TestSaslRPC.java

示例12: createSaslPropertiesForEncryption

import org.apache.hadoop.security.SaslRpcServer.QualityOfProtection; //导入依赖的package包/类
private static Map<String, String> createSaslPropertiesForEncryption(String encryptionAlgorithm) {
  Map<String, String> saslProps = Maps.newHashMapWithExpectedSize(3);
  saslProps.put(Sasl.QOP, QualityOfProtection.PRIVACY.getSaslQop());
  saslProps.put(Sasl.SERVER_AUTH, "true");
  saslProps.put("com.sun.security.sasl.digest.cipher", encryptionAlgorithm);
  return saslProps;
}
 
开发者ID:apache,项目名称:hbase,代码行数:8,代码来源:FanOutOneBlockAsyncDFSOutputSaslHelper.java


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