/** * Get a new <code>TUGIContainingTransport</code> instance, or reuse the * existing one if a <code>TUGIContainingTransport</code> has already been * created before using the given <code>TTransport</code> as an underlying * transport. This ensures that a given underlying transport instance * receives the same <code>TUGIContainingTransport</code>. */ @Override public TUGIContainingTransport getTransport(TTransport trans) { // UGI information is not available at connection setup time, it will be set later // via set_ugi() rpc. TUGIContainingTransport tugiTrans = transMap.get(trans); if (tugiTrans == null) { tugiTrans = new TUGIContainingTransport(trans); TUGIContainingTransport prev = transMap.putIfAbsent(trans, tugiTrans); if (prev != null) { return prev; } } return tugiTrans; } }
@Override public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) throws TokenStoreException{ try { return (Boolean)invokeOnRawStore("removeToken", new Object[] { TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier)}, String.class); } catch (IOException e) { throw new TokenStoreException(e); } }
private String getTokenPath(DelegationTokenIdentifier tokenIdentifier) { try { return rootNode + NODE_TOKENS + "/" + TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier); } catch (IOException ex) { throw new TokenStoreException("Failed to encode token identifier", ex); } }
/** * Discard a current delegation token. * @param tokenStrForm the token in string form */ public static void cancelDelegationToken(String tokenStrForm ) throws IOException { saslServer.cancelDelegationToken(tokenStrForm); } /**
@Override public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) { String tokenPath = getTokenPath(tokenIdentifier); zkDelete(tokenPath); return true; }
private char[] getPassword(DelegationTokenIdentifier tokenid) throws InvalidToken { return encodePassword(secretManager.retrievePassword(tokenid)); }
private char[] getPassword(DelegationTokenIdentifier tokenid) throws InvalidToken { return encodePassword(secretManager.retrievePassword(tokenid)); }
@Override public String run() throws IOException { return secretManager.getDelegationToken(renewer); } });
/** * Get a new delegation token. * @param renewer the designated renewer * @param token_signature an identifier that is set as the service on the generated token */ public static String getDelegationToken(String renewer, String token_signature )throws IOException { return saslServer.getDelegationToken(renewer, token_signature); }
@Override public List<ACL> getAclForPath(String path) { return getDefaultAcl(); } };
@Override public Server createServer(String keytabFile, String principalConf) throws TTransportException { return new Server(keytabFile, principalConf); }
/** * Wrap a TProcessor in such a way that, before processing any RPC, it * assumes the UserGroupInformation of the user authenticated by * the SASL transport. */ @Override public TProcessor wrapProcessor(TProcessor processor) { return new TUGIAssumingProcessor(processor, secretManager, true); }
/** * Wrap a TProcessor in such a way that, before processing any RPC, it * assumes the UserGroupInformation of the user authenticated by * the SASL transport. */ public TProcessor wrapProcessor(TProcessor processor) { return new TUGIAssumingProcessor(processor, secretManager, true); }
@Override public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) throws TokenStoreException{ try { return (Boolean)invokeOnRawStore("removeToken", new Object[] { TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier)}, String.class); } catch (IOException e) { throw new TokenStoreException(e); } }
private String getTokenPath(DelegationTokenIdentifier tokenIdentifier) { try { return rootNode + NODE_TOKENS + "/" + TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier); } catch (IOException ex) { throw new TokenStoreException("Failed to encode token identifier", ex); } }
/** * Discard a current delegation token. * * @param tokenStrForm * the token in string form */ public static void cancelDelegationToken(String tokenStrForm ) throws IOException { saslServer.cancelDelegationToken(tokenStrForm); }
@Override public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) { String tokenPath = getTokenPath(tokenIdentifier); zkDelete(tokenPath); return true; }
@Override public boolean removeToken(DelegationTokenIdentifier tokenIdentifier) throws TokenStoreException{ try { boolean result = (Boolean)invokeOnRawStore("removeToken", new Object[] { TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier)}, String.class); if (LOG.isTraceEnabled()) { LOG.trace("removeToken: tokenIdentifier = " + tokenIdentifier + ", removed = " + result); } return result; } catch (IOException e) { throw new TokenStoreException(e); } }
private String getTokenPath(DelegationTokenIdentifier tokenIdentifier) { try { return rootNode + NODE_TOKENS + "/" + TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier); } catch (IOException ex) { throw new TokenStoreException("Failed to encode token identifier", ex); } }
private String getTokenPath(DelegationTokenIdentifier tokenIdentifier) { try { return rootNode + NODE_TOKENS + "/" + TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier); } catch (IOException ex) { throw new TokenStoreException("Failed to encode token identifier", ex); } }