Search in sources :

Example 1 with CancelDelegationTokenResponseProto

use of org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelDelegationTokenResponseProto in project ozone by apache.

the class OzoneManagerProtocolClientSideTranslatorPB method cancelDelegationToken.

/**
 * Cancel an existing delegation token.
 *
 * @param token delegation token
 */
@Override
public void cancelDelegationToken(Token<OzoneTokenIdentifier> token) throws OMException {
    CancelDelegationTokenRequestProto req = CancelDelegationTokenRequestProto.newBuilder().setToken(OMPBHelper.convertToTokenProto(token)).build();
    OMRequest omRequest = createOMRequest(Type.CancelDelegationToken).setCancelDelegationTokenRequest(req).build();
    final CancelDelegationTokenResponseProto resp;
    try {
        handleError(submitRequest(omRequest));
    } catch (IOException e) {
        if (e instanceof OMException) {
            throw (OMException) e;
        }
        throw new OMException("Cancel delegation token failed.", e, TOKEN_ERROR_OTHER);
    }
}
Also used : OMRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest) CancelDelegationTokenRequestProto(org.apache.hadoop.ozone.security.proto.SecurityProtos.CancelDelegationTokenRequestProto) IOException(java.io.IOException) CancelDelegationTokenResponseProto(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelDelegationTokenResponseProto) OMException(org.apache.hadoop.ozone.om.exceptions.OMException)

Aggregations

IOException (java.io.IOException)1 OMException (org.apache.hadoop.ozone.om.exceptions.OMException)1 CancelDelegationTokenResponseProto (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.CancelDelegationTokenResponseProto)1 OMRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.OMRequest)1 CancelDelegationTokenRequestProto (org.apache.hadoop.ozone.security.proto.SecurityProtos.CancelDelegationTokenRequestProto)1