|
Milyn-Tinak Version 0.6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.milyn.device.ident.IdentSet
Device Identification Set.
Represents a set of identification units for a specific device. An identification set exists per device. When talking in terms of the "device-ident" XML representation this class represents thedevice
element. The attribute rules on which this class operates are easily
explained in relation to this XML definition but the same rules would apply if the objects
in this object model are popluated from a different data source e.g. a database.
Matching is based on a number of criteria and is defined through the match attribute
on the device identification definition. match
defines combinations
of identification units that result in a positive match for the device. "all",
"*" and "any" are predefined and reserved where "all" is the default and "any"
and "*" are equivalent. match
may also contain a list of identification
unit "id" attribute value combinations. Match "id" combinations are separated by the pipe
character "|". A combination can be built from one or more id attribute values
from the contained identification units (separated by commas). If an identification unit
doesn't have an "id" attribute value set a pseudo id value will be assigned based on it's
index in the identification set (base 1 index).
XML Examples:
<device name="xxx"> <http-req-header name="AAA" value="aaa" /> <http-req-param name="BBB" value="bbb" /> </device>2. A positive match on any of the identification units result in a positive match on the device. match="*" is equivalent to match="any".
<device name="xxx" match="any"> <http-req-header name="AAA" value="aaa" /> <http-req-param name="BBB" value="bbb" /> </device>3. A positive match on identification units (1) or (2 and 3) or (3 and 4) result in a poitive match on the device.
<device name="xxx" match="1|2,3|3,4"> <http-req-header id="1" name="AAA" value="aaa" /> <http-req-header id="2" name="BBB" value="bbb" /> <http-req-header id="3" name="CCC" value="ccc" /> <http-req-param id="4" name="DDD" value="ddd" /> </device>
Constructor Summary | |
IdentSet()
|
Method Summary | |
void |
addIdentUnit(IdentUnit unit)
Add the identification unit to this device identification set. |
java.lang.String[][] |
getComboIdMatrix()
Get the device combinations sets. |
java.lang.String |
getDeviceName()
Get the device this identifier set represents. |
boolean |
isMatch(Request request)
Is this device definition a match based on the supplied device request |
void |
prepare()
Prepare the identifications set for device matching. |
void |
setDeviceName(java.lang.String name)
Set the device this identifier set represents. |
void |
setMatch(java.lang.String match)
Set the match combinatiosn string for the device identification set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IdentSet()
Method Detail |
public void setDeviceName(java.lang.String name)
name
- The device name.public java.lang.String getDeviceName()
public void setMatch(java.lang.String match)
match
- The match combinatation String.public boolean isMatch(Request request)
request
- The device request.
public java.lang.String[][] getComboIdMatrix()
public void addIdentUnit(IdentUnit unit)
unit
- The device identification unit to be added.public void prepare()
|
Milyn-Tinak Version 0.6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |