dk.i1.diameter.node
Class DefaultNodeValidator
Object
dk.i1.diameter.node.DefaultNodeValidator
- All Implemented Interfaces:
- NodeValidator
public class DefaultNodeValidator
- extends Object
- implements NodeValidator
Default node validator.
This node validator knows all nodes and always allows any capabilities.
It does this by not implementing any policy at all, blindly trusting peers
that they are who they claim to be and they are allowed to process the
applications they announce.
- Since:
- 0.9.4
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultNodeValidator
public DefaultNodeValidator()
authenticateNode
public NodeValidator.AuthenticationResult authenticateNode(String node_id,
Object obj)
- "authenticates" peer.
Always claims to know any peer.
- Specified by:
authenticateNode
in interface NodeValidator
- Parameters:
node_id
- The orogin-host-id of the peer.obj
- An object describing the transport connection. For TCP transport connections this is a socket channel. For SCTP transport connections it is a RelevantSCTPAuthInfo
instance.
authorizeNode
public Capability authorizeNode(String node_id,
NodeSettings settings,
Capability reported_capabilities)
- "authorizes" the capabilities claimed by a peer.
This implementation returns the simple intersection of the peers reported capabilities and our own capabilities.
Implemented as return Capability.calculateIntersection(settings.capabilities(), reported_capabilities);
- Specified by:
authorizeNode
in interface NodeValidator
- Parameters:
node_id
- The origin-host-id of the peer.settings
- The settings of the node (as passed to its constructor)reported_capabilities
- The capability set the peer reported it supports.