org.apache.hadoop.hdfs.protocol.datatransfer
Class TrustedChannelResolver

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.datatransfer.TrustedChannelResolver
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
WhitelistBasedTrustedChannelResolver

public class TrustedChannelResolver
extends Object
implements org.apache.hadoop.conf.Configurable

Class used to indicate whether a channel is trusted or not. The default implementation is to return false indicating that the channel is not trusted. This class can be overridden to provide custom logic to determine whether a channel is trusted or not. The custom class can be specified via configuration.


Constructor Summary
TrustedChannelResolver()
           
 
Method Summary
 org.apache.hadoop.conf.Configuration getConf()
           
static TrustedChannelResolver getInstance(org.apache.hadoop.conf.Configuration conf)
          Returns an instance of TrustedChannelResolver.
 boolean isTrusted()
          Return boolean value indicating whether a channel is trusted or not from a client's perspective.
 boolean isTrusted(InetAddress peerAddress)
          Identify boolean value indicating whether a channel is trusted or not.
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustedChannelResolver

public TrustedChannelResolver()
Method Detail

getInstance

public static TrustedChannelResolver getInstance(org.apache.hadoop.conf.Configuration conf)
Returns an instance of TrustedChannelResolver. Looks up the configuration to see if there is custom class specified.

Parameters:
conf -
Returns:
TrustedChannelResolver

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

isTrusted

public boolean isTrusted()
Return boolean value indicating whether a channel is trusted or not from a client's perspective.

Returns:
true if the channel is trusted and false otherwise.

isTrusted

public boolean isTrusted(InetAddress peerAddress)
Identify boolean value indicating whether a channel is trusted or not.

Parameters:
peerAddress - address of the peer
Returns:
true if the channel is trusted and false otherwise.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.