/** * Returns a delegation token for the current user. If renewer is set, this renewer * can renew the token. */ public DelegationToken getDelegationToken(String renewer) throws RecordServiceException, IOException { try { return new DelegationToken(plannerClient_.GetDelegationToken(USER, renewer)); } catch (TRecordServiceException e) { throw new RecordServiceException(e); } catch (TException e) { throw new IOException("Could not get delegation token.", e); } }
/** * Cancels the token. */ public void cancelDelegationToken(DelegationToken token) throws RecordServiceException, IOException { try { plannerClient_.CancelDelegationToken(token.toThrift()); } catch (TRecordServiceException e) { throw new RecordServiceException(e); } catch (TException e) { throw new IOException("Could not cancel delegation token.", e); } }
/** * Serializes a token to TDelegationToken. */ public static DelegationToken toDelegationToken(Token<DelegationTokenIdentifier> t) throws IOException { if (t == null) return null; return new DelegationToken( encodeAsString(t.getIdentifier()), encodeAsString(t.getPassword()), t.encodeToUrlString().getBytes()); }
/** * Renews the token. */ public void renewDelegationToken(DelegationToken token) throws RecordServiceException, IOException { try { plannerClient_.RenewDelegationToken(token.toThrift()); } catch (TRecordServiceException e) { throw new RecordServiceException(e); } catch (TException e) { throw new IOException("Could not renew delegation token.", e); } }