BEA Systems, Inc.

com.bea.rfid.workflow.epcis
Class AggregationReconciler

java.lang.Object
  extended by com.bea.rfid.workflow.epcis.AggregationReconciler

public class AggregationReconciler
extends Object

Compares an aggregation with its manifest (expected elements in an aggregation). The comparison result is based on the properties, like percentage children match required, specified on the reconciler instance.

This implementation assumes single threaded operation and is not synchronized. If multiple threads access this concurrently, it must be synchronized externally.


Field Summary
static String EPC_ID_PATTERN_PREFIX
           
static String EPC_ID_URI_PREFIX
           
static String EPC_RAW_URI_PREFIX
           
static String EPC_TAG_PATTERN_PREFIX
           
static String EPC_TAG_URI_PREFIX
           
 
Constructor Summary
AggregationReconciler(double childPercentageMatch, boolean allowExtraChildren, boolean matchEPCParent, boolean matchNonEPCParent)
          Constructor.
 
Method Summary
 double getChildPercentMatch()
          Returns the percentage of child entries that must be found to produce an output of true for children matched result.
 boolean isAllowExtraChildren()
          Returns boolean value that indicates if extra children in input aggregation should result in matched children value of false.
 boolean isMatchEPCParent()
          Returns true if parent value in aggregation should be compared when the expected parent is an EPC value.
 boolean isMatchNonEPCParent()
          Returns true if parent value in aggregation should be compared when the expected parent is not an EPC value.
 ReconciliationResult reconcile(com.connecterra.epcis.api.AggregationEvent aggregation, Manifest manifest)
          Reconciles the given aggregation with the given manifest and returns the result.
 void setAllowExtraChildren(boolean allowExtraChildren)
          Specifies if extra child entries in input aggregations should be ignored and produce matched children output of value true.
 void setChildPercentMatch(double childPercentMatch)
          Specifies the percentage of child entries that must be found to produce an output of true for children matched result.
 void setMatchEPCParent(boolean matchEPCParent)
          Specifies if the parent value in aggregations should be compared when the expected parent is an EPC.
 void setMatchNonEPCParent(boolean matchNonEPCParent)
          Specifies if the parent value in aggregations should be compared when the expected parent is not an EPC.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPC_ID_PATTERN_PREFIX

public static final String EPC_ID_PATTERN_PREFIX
See Also:
Constant Field Values

EPC_TAG_PATTERN_PREFIX

public static final String EPC_TAG_PATTERN_PREFIX
See Also:
Constant Field Values

EPC_ID_URI_PREFIX

public static final String EPC_ID_URI_PREFIX
See Also:
Constant Field Values

EPC_TAG_URI_PREFIX

public static final String EPC_TAG_URI_PREFIX
See Also:
Constant Field Values

EPC_RAW_URI_PREFIX

public static final String EPC_RAW_URI_PREFIX
See Also:
Constant Field Values
Constructor Detail

AggregationReconciler

public AggregationReconciler(double childPercentageMatch,
                             boolean allowExtraChildren,
                             boolean matchEPCParent,
                             boolean matchNonEPCParent)
Constructor.

Parameters:
childPercentageMatch - double specifying what percentage of children must be matched to produce true output for matched children result
allowExtraChildren - if this is true, extra children tag will still produce true output for matched children result. If this is false, detection of extra children will produce false output for matched children result.
matchEPCParent - specifies if parent must be matched when the expected parent is an EPC URI
matchNonEPCParent - specifies if parent must be matched when the expected parent is not an EPC value
Method Detail

reconcile

public ReconciliationResult reconcile(com.connecterra.epcis.api.AggregationEvent aggregation,
                                      Manifest manifest)
                               throws com.connecterra.ale.epc.EPCException,
                                      URISyntaxException,
                                      com.connecterra.epcis.api.EPCISException,
                                      com.connecterra.ale.epc.EPCDecodeException
Reconciles the given aggregation with the given manifest and returns the result.

Parameters:
aggregation - aggregation event that must be matched
manifest - manifest to match the aggreation with
Returns:
reconciliation output with all the result values of the comparison
Throws:
com.connecterra.ale.epc.EPCException - if the manifest or aggregation contains invalid EPC values
URISyntaxException - if the manifest or aggregation contains invalid URIs
com.connecterra.ale.epc.EPCDecodeException - if the manifest or aggregation contains EPCs with incorrect fields
com.connecterra.epcis.api.EPCISException - if the input aggregation event is not valid

isAllowExtraChildren

public boolean isAllowExtraChildren()
Returns boolean value that indicates if extra children in input aggregation should result in matched children value of false. If this is true, extra child entries will be ignored.

Returns:
boolean value that indicates if extra children in input aggregation should result in matched children value of false

setAllowExtraChildren

public void setAllowExtraChildren(boolean allowExtraChildren)
Specifies if extra child entries in input aggregations should be ignored and produce matched children output of value true.

Parameters:
allowExtraChildren - specify true if extra child entries is not considered an error and should produce output of true for matched children; false otherwise.

isMatchEPCParent

public boolean isMatchEPCParent()
Returns true if parent value in aggregation should be compared when the expected parent is an EPC value. Returns false if parent should not be compared for EPC parent.

Returns:
true if parent value in aggregation should be compared when the expected parent is an EPC value; false otherwise

setMatchEPCParent

public void setMatchEPCParent(boolean matchEPCParent)
Specifies if the parent value in aggregations should be compared when the expected parent is an EPC.

Parameters:
matchEPCParent - specify true if parent value must be compared when expected parent is an EPC; false otherwise

isMatchNonEPCParent

public boolean isMatchNonEPCParent()
Returns true if parent value in aggregation should be compared when the expected parent is not an EPC value. Returns false otherwise.

Returns:
true if parent value in aggregation should be compared when the expected parent is not an EPC value; false otherwise

setMatchNonEPCParent

public void setMatchNonEPCParent(boolean matchNonEPCParent)
Specifies if the parent value in aggregations should be compared when the expected parent is not an EPC.

Parameters:
matchNonEPCParent - specify true if parent value must be compared when expected parent is not an EPC; false otherwise

getChildPercentMatch

public double getChildPercentMatch()
Returns the percentage of child entries that must be found to produce an output of true for children matched result.

Returns:
the percentage of child entries that must be found to produce an output of true for children matched result

setChildPercentMatch

public void setChildPercentMatch(double childPercentMatch)
Specifies the percentage of child entries that must be found to produce an output of true for children matched result.

Parameters:
childPercentMatch - the percentage of child entries that must be found to produce an output of true for children matched result

Documentation is available at
${DOCSWEBROOT}
Copyright 2007 BEA Systems Inc.