dk.i1.diameter.node
Class Capability

Object
  extended by dk.i1.diameter.node.Capability

public class Capability
extends Object

A bag of supported/allowed applications. A Capability instance is used by the Node class to announce this node's capabilities in terms of supported/allowed authentication/authorization/accounting applications, vendor-specific applications and vendor-IDs. It is also used by the Node to catch messages that belong to applications that have not been announced or is being sent to peers that do not support it.

An application is set of message commands with defined semantics. Examples are NASREQ (mostly dial-up sessions), MOBILEIP (mobile IPv4/IPv6 and asociated roaming), EAP (extensible authentication). Each aplication can be used for authentication/authorization, accounting, or both. Each diameter message identifies which application it belongs to. Messages belonging to applications that have not been negotiated are rejected. Special rules applies to the "common" application (low-level diameter control message) and peers that announce the "relay" application.

The announced vendor-IDs can be used for implementing tweaks in areas not fully specified in the application specification.

ProtocolConstants contains definitions for some of the standard applications (DIAMETER_APPLICATION_....)

A hypothetical node that supports NASREQ and EAP could create the capability set like this:

Capability cap = new Capability();
cap.addSupportedVendor(a vendor-id);
cap.addSupportedVendor(another vendor-id);
cap.addAuthApp(ProtocolConstants.DIAMETER_APPLICATION_NASREQ);
cap.addAcctApp(ProtocolConstants.DIAMETER_APPLICATION_NASREQ);
cap.addAuthApp(ProtocolConstants.DIAMETER_APPLICATION_EAP);
 
A hypothetical node that only supports a vendor-specific accounting extension could create the capability set like this:
static final int our_vendor_id = ...;
static final int our_application_id = ...;
Capability cap = new Capability();
cap.addSupportedVendor(our_vendor_id);
cap.addVendorAcctApp(our_vendor_id,our_application_id);


Constructor Summary
Capability()
          Constructor.
Capability(Capability c)
          Copy-Constructor (deep copy).
 
Method Summary
 void addAcctApp(int app)
           
 void addAuthApp(int app)
           
 void addSupportedVendor(int vendor_id)
           
 void addVendorAcctApp(int vendor_id, int app)
           
 void addVendorAuthApp(int vendor_id, int app)
           
 boolean isAllowedAcctApp(int app)
          Returns if the specified application is an allowed auth-application.
 boolean isAllowedAcctApp(int vendor_id, int app)
          Returns if the specified vendor-specific application is an allowed auth-application.
 boolean isAllowedAuthApp(int app)
          Returns if the specified application is an allowed auth-application.
 boolean isAllowedAuthApp(int vendor_id, int app)
          Returns if the specified vendor-specific application is an allowed auth-application.
 boolean isEmpty()
          Returns if no applications are allowed/supported
 boolean isSupportedVendor(int vendor_id)
          Returns if the specified vendor ID is supported
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Capability

public Capability()
Constructor. The instance is initialized to be empty.


Capability

public Capability(Capability c)
Copy-Constructor (deep copy).

Method Detail

isSupportedVendor

public boolean isSupportedVendor(int vendor_id)
Returns if the specified vendor ID is supported


isAllowedAuthApp

public boolean isAllowedAuthApp(int app)
Returns if the specified application is an allowed auth-application. If the application "relay" is listen, then the auth-application is always allowed.


isAllowedAcctApp

public boolean isAllowedAcctApp(int app)
Returns if the specified application is an allowed auth-application. If the application "relay" is listen, then the auth-application is always allowed.


isAllowedAuthApp

public boolean isAllowedAuthApp(int vendor_id,
                                int app)
Returns if the specified vendor-specific application is an allowed auth-application.


isAllowedAcctApp

public boolean isAllowedAcctApp(int vendor_id,
                                int app)
Returns if the specified vendor-specific application is an allowed auth-application.


addSupportedVendor

public void addSupportedVendor(int vendor_id)

addAuthApp

public void addAuthApp(int app)

addAcctApp

public void addAcctApp(int app)

addVendorAuthApp

public void addVendorAuthApp(int vendor_id,
                             int app)

addVendorAcctApp

public void addVendorAcctApp(int vendor_id,
                             int app)

isEmpty

public boolean isEmpty()
Returns if no applications are allowed/supported