Example usage for org.apache.hadoop.hdfs.web.resources DelegationParam DelegationParam

List of usage examples for org.apache.hadoop.hdfs.web.resources DelegationParam DelegationParam

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.web.resources DelegationParam DelegationParam.

Prototype

public DelegationParam(final String str) 

Source Link

Document

Constructor.

Usage

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

private Param<?, ?>[] getAuthParameters(final HttpOpParam.Op op) throws IOException {
    List<Param<?, ?>> authParams = Lists.newArrayList();
    // Skip adding delegation token for token operations because these
    // operations require authentication.
    Token<?> token = null;//  w ww. java  2s  .  c  om
    if (!op.getRequireAuth()) {
        token = getDelegationToken();
    }
    if (token != null) {
        authParams.add(new DelegationParam(token.encodeToUrlString()));
    } else {

        authParams.add(new UserParam(kerberosIdentity.getPrincipalShortName()));
    }
    return authParams.toArray(new Param<?, ?>[0]);
}