Class IdentityMappingResolver
java.lang.Object
com.kosdev.kos.core.service.hardware.resolvers.IdentityMappingResolver
Maps a hardware identity, such as a serial number or mac address, to a particular
board path. This can be used to link hardware to board instances even when the
standard mapper based on boardType / instanceId doesn't match or isn't sufficient.
This can be useful for prototyping, where more boards than are naturally supported
are needed. For example, consider an rfid reader that has jumpers allowing it to
specify an instanceId in the range of 0-3. This allows up to four rfid boards to
be attached using the normal board resolver. To support additional boards, the
IdentityMappingResolver can be used to map a board (via board path) to a
particular rfid reader using the identity of the reader (such as the serial number).
This is mostly useful for prototypes as mapping identities such as serial numbers is not a sustainable approach for production environments.
- Since:
- 7
- Version:
- 7
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMapping(String boardPath, String identifier) Add a new mapping between a board and identifier.Return the existing identifier mappings.voidremoveMapping(String boardPath) Remove an existing board mapping by board path.
-
Method Details
-
getMappings
Return the existing identifier mappings. A single mapping is used to map a board path- Since:
- 7
-
addMapping
Add a new mapping between a board and identifier. This will be persisted and will replacy any existing mapping for the specified board path.- Parameters:
boardPath- path of the board to mapidentifier- unique hardware identifier to map to- Since:
- 7
-
removeMapping
Remove an existing board mapping by board path.- Parameters:
boardPath- mapping to remove from the database- Since:
- 7
-