wwndesc
1.0-76
|
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...
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 | |
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
Definition at line 18 of file DevRole.java.
|
inline |
return true if the device is an instance of the other.
For example: if (theTapeDevice.isA(TAPE)) {...}
proto | device to compare to |
Definition at line 37 of file DevRole.java.
References DevRole.value.
|
inline |
return true if the device is an instance of the other.
For example: if (theTapeDevice.isA(TAPE)) {...}
proto | device to compare to |
Definition at line 49 of file DevRole.java.
|
inlinestatic |
convenience accessor for this.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().