|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.comm.PortmapDatabase
Manages storage and look up of portmapping elements.This is the Database stores
CommPortIdentiers
and the portmapping information used to manage their selection and naming.A method is provided to parse the portmap.properties file, converting it into internal database format. Numerous methods are provided for cross-referencing and locating portmapping information that has been assimilated from portmap properties.
Format of portmap.properties file.
Field Summary | |
private static java.util.Vector |
commPortIdentifiers
|
private static java.util.Vector |
portMapEntries
|
Constructor Summary | |
(package private) |
PortmapDatabase()
|
Method Summary | |
static void |
add(CommPortIdentifier cpi)
Add a new CommPortIdentifier to the database |
static void |
add(PortmapEntry pme)
Add portmapping vector entry to database. |
static java.lang.String |
DTUnameToTerminalId(java.lang.String dtuName)
Find the terminalID a given DTUname maps to. |
static void |
dump()
Dump each portmapping entry in database as a string to stdout |
static java.util.Enumeration |
elements()
Return contents of port map database. |
static java.util.Enumeration |
findByALNpath(java.lang.String alnPath)
Locate all the port map entries that refer to a particular ALN path. |
static java.util.Enumeration |
findByEquivName(java.lang.String equatedName)
Locate all the port map entries that refer to a particular target name. |
static PortmapEntry |
findByLogicalName(Alias alias)
Locate a portmap entry via an aliased value. |
static PortmapEntry |
findByLogicalName(java.lang.String aliasName)
Locate a port map entry by it's logical name alias |
static java.util.Enumeration |
findDTUnameRefs(java.lang.String dtuname)
Locate all the port map entries that refer to a particular DTU name. |
static java.util.Enumeration |
findDTUspecificALNs()
Locate all session-local ALN aliases |
static java.util.Enumeration |
findSessionLocalALNs()
Locate all session-local ALN aliases |
static java.util.Enumeration |
getCommPortIdentifiers()
Get current list of CommPortIdentifiers |
static void |
loadPortmapFile(java.lang.String portMapFilename)
Builds portmapping database based on contents of portmap.properties file. |
static java.lang.String |
terminalIdToDTUname(java.lang.String terminalId)
Find the DTU name a given terminal ID maps to. |
static java.lang.String |
translatePortname(java.lang.String portName)
Translate a port specification as an alias. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.util.Vector portMapEntries
private static java.util.Vector commPortIdentifiers
Constructor Detail |
PortmapDatabase()
Method Detail |
public static void loadPortmapFile(java.lang.String portMapFilename) throws java.io.IOException
File format:
- DTU alias
Assigns a logical name to a DTU terminal ID. All other references to a specific DTU in the portmap.properties
file must refer to a DTU alias to make it easier to identify and replace DTUs. These must be defined in the portmap.properties somewhere in the file previous to where DTUs are refreenced. Direct reference of DTU terminal ID's is not allowed except for DTU aliases to enforce clarity and make it easier to rename or replace DTUs.DTU Alias = Sun Ray DTU terminal IDExamples:
Teller1_DTU = 02:5f:39:93:ab:92
Kiosk_DTU = IEEE802.5abc2309fc29- DTU Specific
Logical name only appears in CommPortIdentifier port list if javax.comm is running in a session on specified DTU (terminal id)logical name = DTU Alias : path to comm. portExamples:
Hallway_Printer = Hallway_DTU:utprt2
retina_scanner = entrance:utcom1- Session independent
Logical name only appears in port list if not running in a Sun Ray session. The logical name replaces the physical path name in theCommPortIdentifier
list.logical name = path to comm. port
Examples:
central_printer = /dev/printers/0
Big_LED_display = /dev/term/a- Hidden (Session independent)
Physical port name is hidden (for non-Sun Ray sessions)[hide] path to comm. portExamples:
[hide] /dev/cua/a
[hide] /dev/cua/b- Session local ALN
ALNs are "Automatic Logical Names" which are used to map to ports on Sun Ray dongles without having to know the device pathEach ALN corresponds to RS-232 ports on attached USB dongle of DTU hosting local session. If the session moves to a new DTU, (javax.comm throws and exception on previous connection), when the comm. ports are re-enumerated, that session will see the corresponding ports on the dongle of the new DTU. This also faciliates DTU swapping.
utcom1, utcom2, ... utprt1, utprt2, ...
Examples:
local_printer = utprt1
cashdrawer = utcom1- DTU Specific ALN
ALNs are "Automatic Logical Names" which are used to map to ports on Sun Ray dongles without having to know the device pathEach ALN corresponds to RS-232 ports on attached USB dongle on the specified DTU. This allows devices on DTUS to be shared but requires root privilege, and implies a privileged daemon to manage the port for the local applications.
dtu_alias.utcom1, dtu_alias.utcom2, ... dtu_alias.utprt1, dtu_alias.utprt2, ...Examples:
Charlies_printer = Charlies_DTU:utprt1
teller1_cashdrawer = teller1:utcom4
portMapFilename
- Path to
portmap.properties file
java.io.IOException
com.sun.comm
public static java.lang.String translatePortname(java.lang.String portName) throws java.io.IOException
This method is called during the CommPort.open() routine to attempt
translating the device name path passed to open via the portmapping
database (based on
portmap.properties).
If the translation fails
for any reason, the original untranslated name is passed back to
CommPort.open() which will then attempt to do a native OS open
of whichever was returned, the callers original argument, or the
translated argument, and will throw an exception if the final
argument is invalid.
portName
- Original port name specified by the caller
translation is attempted on.
java.io.IOException
public static void add(CommPortIdentifier cpi)
CommPortIdentifier
to the database
cpi
- - the CommPortIdentifier to add.public static void add(PortmapEntry pme)
pme
- PortmapEntry
to add to databasepublic static java.util.Enumeration getCommPortIdentifiers()
CommPortIdentifiers
CommPortIdentifiers
public static java.util.Enumeration elements()
Enumeration
of port map database entries.public static void dump()
public static java.lang.String DTUnameToTerminalId(java.lang.String dtuName)
dtuName
- to match on.
public static java.lang.String terminalIdToDTUname(java.lang.String terminalId)
terminalId
- to match on.
public static PortmapEntry findByLogicalName(Alias alias)
(implicitly handles wildcard matching).
alias
- Alias The alias to search forpublic static PortmapEntry findByLogicalName(java.lang.String aliasName)
aliasName
- String The logical name alias to search for.
public static java.util.Enumeration findByEquivName(java.lang.String equatedName)
equatedName
- String Target name to match on.
public static java.util.Enumeration findByALNpath(java.lang.String alnPath)
alnPath
- String ALN path to match on.
public static java.util.Enumeration findDTUnameRefs(java.lang.String dtuname)
dtuname
- String Target DTU name to match on.
public static java.util.Enumeration findSessionLocalALNs()
public static java.util.Enumeration findDTUspecificALNs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |