wwndesc  1.0-76
DevRole Class Reference

This class seeks to provide simple bitfield type-checking of a device in a fabric so that I can use type-specific actions in a dependent project. More...

Collaboration diagram for DevRole:

Public Member Functions

boolean isA (DevRole proto)
 return true if the device is an instance of the other. More...
 
boolean isA (int proto)
 return true if the device is an instance of the other. More...
 

Static Public Member Functions

static int max ()
 convenience accessor for this.max More...
 

Data Fields

final int value
 what bit-field is this constant?
 

Static Public Attributes

static final DevRole INITIATOR = new DevRole()
 a device that initiates a storage request: a server, or a Storage Virtualizer port that talks to backing storage
 
static final DevRole SWITCH = new DevRole()
 a device that routes/passes traffic: Switch, NPV device/back-of-rack, FCR
 
static final DevRole TARGET = new DevRole()
 a device that offers storage via >1 LUNs ; contrast a TAPE offers only one LUN
 

Private Member Functions

 DevRole ()
 create a new constant, but private to stop extensions or descendents
 

Static Private Attributes

static int max = 1
 global singleton to keep track of the max DevRole.value so far
 

Detailed Description

This class seeks to provide simple bitfield type-checking of a device in a fabric so that I can use type-specific actions in a dependent project.

By using this class to lift the assumption that all known devices are Targets, I can create additional possible matches that can be additionally checked when asked for more than default target types. This lets me later package the logic of subparts of a device (WWNN and WWPN) into the device logic itself, packaging up in a single place and avoiding needless diuplication without significantly stressing this model

See also
http://www.javaworld.com/article/2076970/core-java/create-enumerated-constants-in-java.html

Definition at line 18 of file DevRole.java.

Member Function Documentation

boolean isA ( DevRole  proto)
inline

return true if the device is an instance of the other.

For example: if (theTapeDevice.isA(TAPE)) {...}

Parameters
protodevice to compare to
Returns
whether device is an instance

Definition at line 37 of file DevRole.java.

References DevRole.value.

boolean isA ( int  proto)
inline

return true if the device is an instance of the other.

For example: if (theTapeDevice.isA(TAPE)) {...}

Parameters
protodevice to compare to
Returns
whether device is an instance

Definition at line 49 of file DevRole.java.

static int max ( )
inlinestatic

convenience accessor for this.max

Returns
DevRole::max

< report highest left-shift bit value ever created; someDevice.value == (someDevice.value & (max()-1))

Definition at line 59 of file DevRole.java.

Referenced by DevRole.DevRole().


The documentation for this class was generated from the following file: