Search in sources :

Example 1 with GetDelegationTokenResponseProto

use of org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProto in project hadoop by apache.

the class ClientNamenodeProtocolServerSideTranslatorPB method getDelegationToken.

@Override
public GetDelegationTokenResponseProto getDelegationToken(RpcController controller, GetDelegationTokenRequestProto req) throws ServiceException {
    try {
        Token<DelegationTokenIdentifier> token = server.getDelegationToken(new Text(req.getRenewer()));
        GetDelegationTokenResponseProto.Builder rspBuilder = GetDelegationTokenResponseProto.newBuilder();
        if (token != null) {
            rspBuilder.setToken(PBHelperClient.convert(token));
        }
        return rspBuilder.build();
    } catch (IOException e) {
        throw new ServiceException(e);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) DelegationTokenIdentifier(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier) GetDelegationTokenResponseProto(org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProto) Text(org.apache.hadoop.io.Text) IOException(java.io.IOException)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 IOException (java.io.IOException)1 DelegationTokenIdentifier (org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier)1 Text (org.apache.hadoop.io.Text)1 GetDelegationTokenResponseProto (org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProto)1