Overview | Package | Class | Tree | Deprecated | Index | Help
| Milyn-Tinak Version 0.6.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.milyn.device.ident
Class IdentSet

    java.lang.Object
      org.milyn.device.ident.IdentSet

public class IdentSet
extends java.lang.Object

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 the `device` 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:

1. Same as match="all". Only a positive match on all the identification units result in a positive match on the device. This is the default.

          <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>

Author:
  Tom Fennelly

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

### IdentSet

    public IdentSet()

Method Detail

### setDeviceName

    public void setDeviceName(java.lang.String name)

  Set the device this identifier set represents.

  Parameters:
    `name` - The device name.

### getDeviceName

    public java.lang.String getDeviceName()

  Get the device this identifier set represents.

  Returns:
    The device name.

### setMatch

    public void setMatch(java.lang.String match)

  Set the match combinatiosn string for the device identification set.

  Parameters:
    `match` - The match combinatation String.

### isMatch

    public boolean isMatch(Request request)

  Is this device definition a match based on the supplied device request

  Parameters:
    `request` - The device request.
  Returns:
    true If the device definition is a match, otherwise false.

### getComboIdMatrix

    public java.lang.String[][] getComboIdMatrix()

  Get the device combinations sets.

  Returns:
    2D array of match combinations.

### addIdentUnit

    public void addIdentUnit(IdentUnit unit)

  Add the identification unit to this device identification set.

  Parameters:
    `unit` - The device identification unit to be added.

### prepare

    public void prepare()

  Prepare the identifications set for device matching.

  This method must be called before attempting to perform any match operations.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Milyn-Tinak Version 0.6.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD