Milyn-Tinak Version 0.6.1

org.milyn.device.ident
Class IdentSet

java.lang.Object
  extended byorg.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:

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.


Milyn-Tinak Version 0.6.1