SAP CC 1.0
API 4.2 (Core)

com.highdeal.filter.hci
Class SearchFilterModel

java.lang.Object
  extended by com.highdeal.filter.hci.SearchFilterModel
All Implemented Interfaces:
XMLMarshallable
Direct Known Subclasses:
AccessSearchFilterModel, ChargeActivationSearchFilterModel, SubscriberAccountSearchFilterModel, SubscriptionSearchFilterModel, TranslationTableSearchFilterModel

public abstract class SearchFilterModel
extends java.lang.Object
implements XMLMarshallable

This abstract class represents a search filter model and aggregates all search criteria which can be used for searching entities.
This class also describes some search options which will be used by the search engine.
Those options are :


XML Schema Fragment
<xs:complexType name="SearchFilter">
     <xs:sequence>
       <xs:element ref="attributeDescription" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="specificFormula" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:attribute name="from" type="xs:string"/>
     <xs:attribute name="maxSize" type="xs:int"/> <!-- means "all" if not set -->
     <xs:attribute name="sort" type="SearchOrderType" default="noOrder"/>
     <xs:attribute name="totalCountRequired" type="xs:boolean" default="false"/> <!-- tells if the total count of items must be performed -->
     <xs:attribute name="resultType" type="ResultTypeTypeSF" default="objects"/>
   </xs:complexType>
<xs:element name="SearchFilter" type="SearchFilter" abstract="true"/>


 <!-- The search order is sorted in time so the sorting process works on OID absolute values
 because of partitioning (OID could be negative) -->
<xs:simpleType name="SearchOrderType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="asc"/> <!-- forward response result -->
     <xs:enumeration value="desc"/><!-- backward response result -->
     <xs:enumeration value="noOrder"/><!-- no sort required, more efficient -->
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="ResultTypeTypeSF">
   <xs:restriction base="xs:string">
     <xs:enumeration value="ids"/> <!-- object ids are returned -->
     <xs:enumeration value="objects"/><!--  object models are returned -->
   </xs:restriction>
 </xs:simpleType>

Field Summary
static java.lang.String ASC_ORDER
          Constant for ascending search order (value is set to "asc").
static java.lang.String DESC_ORDER
          Constant for descending search order (value is set to "desc").
static int FILTER_GROUP_BNR
           
static int FILTER_GROUP_PNR
           
static int FILTER_GROUP_PREPAID
           
static int ID_RESULT_TYPE
          Constant for "ids" result type (value is set to 1).
static int ITERATOR_MODE
          Constant for "iterator" search mode (value is set to 1).
static int LIST_MODE
          Constant for "list" search mode (value is set to 0).
static java.lang.String NO_ORDER
          Constant for no order search order (value is set to "noOrder").
static int OBJECT_RESULT_TYPE
          Constant for "objects" result type (value is set to 0).
 
Constructor Summary
SearchFilterModel(java.lang.String searchFilterName)
          Builds an empty SearchFilterModel.
 
Method Summary
 void addAttributeSelection(AttributeDescriptionModel sel)
          Adds a selection filter which port on a attribute field.
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
 void addSpecificFormula(SpecificFormulaModel formula)
          Adds a specific constraint for the search operation, regarding to the working scope.
 java.util.List<AttributeDescriptionModel> getAttributeSelectionList()
          Gets the list of constraints which must be checked for searching item.
 java.util.List<AttributeDescriptionModel> getAttributeSelectionListFromGroup(java.lang.String group)
          Gets the list of constraints which must be checked for searching item and which belong to the same group.
 int getFilterGroup()
          Returns the filter group of the searchFilterModel, default is BnR, this method is surrounded in PnR searchFilterModels.
 java.lang.String getFrom()
          Gets the from cursor.
abstract  java.util.Vector<AttributeDescriptionModel> getMainAttributeDescriptionCatalog()
          Returns the list of main attribute description on which the user can build some search criteria.
abstract  AttributeDescriptionModel getMainAttributeDescriptionFromCatalog(java.lang.String attributeName)
          Returns an empty constraint from a catalog which can be used for specifying a criteria on a main attribute (identified by its name).
 int getMaxSize()
          Gets the max.
 int getResultType()
          Gets the search result type.
 java.lang.String getSearchFilterName()
          Returns the XML element name of the current search filter.
 int getSearchMode()
          Gets the search mode which must be used with this filter.
 java.lang.String getSort()
          Gets the cursor search order.
abstract  java.util.Vector<SpecificFormulaModel> getSpecificFormulaCatalog()
          This abstract method must be implemented into each concrete filter.
abstract  SpecificFormulaModel getSpecificFormulaFromCatalog(java.lang.String formCode)
          This abstract method must be implemented into each concrete filter.
 java.util.List<SpecificFormulaModel> getSpecificFormulaList()
          Gets the list of specific constraints.
 boolean isCountRequired()
          Tells if the total number of selected items must be returned.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, and of its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the tag beeing processed.
 void setAttributeSelectionList(java.util.List<AttributeDescriptionModel> sels)
          Sets the list of constraints which port on attribute fields.
 void setCountRequiredFlag(boolean flag)
          Set the flag for returning the total number of selected items.
 void setFrom(java.lang.String f)
          Gets the from cursor.
 void setMaxSize(int d)
          Sets the max.
 void setResultType(int type)
          Sets the search result type.
 void setSearchFilterName(java.lang.String name)
          Sets the the XML element name of the current search filter.
 void setSearchMode(int mode)
          Sets the search mode which must be used with this filter.
 void setSort(java.lang.String sortOrder)
          Sets the from cursor search order.
 void setSpecificFormulaList(java.util.List<SpecificFormulaModel> specifics)
          Sets the list of specific constraints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_RESULT_TYPE

public static final int OBJECT_RESULT_TYPE
Constant for "objects" result type (value is set to 0).

See Also:
Constant Field Values

ID_RESULT_TYPE

public static final int ID_RESULT_TYPE
Constant for "ids" result type (value is set to 1).

See Also:
Constant Field Values

LIST_MODE

public static final int LIST_MODE
Constant for "list" search mode (value is set to 0).

See Also:
Constant Field Values

ITERATOR_MODE

public static final int ITERATOR_MODE
Constant for "iterator" search mode (value is set to 1). Reserved for internal use. Cannot be set by an API client.

See Also:
Constant Field Values

ASC_ORDER

public static final java.lang.String ASC_ORDER
Constant for ascending search order (value is set to "asc").

See Also:
Constant Field Values

DESC_ORDER

public static final java.lang.String DESC_ORDER
Constant for descending search order (value is set to "desc").

See Also:
Constant Field Values

NO_ORDER

public static final java.lang.String NO_ORDER
Constant for no order search order (value is set to "noOrder").

See Also:
Constant Field Values

FILTER_GROUP_PNR

public static final int FILTER_GROUP_PNR
See Also:
Constant Field Values

FILTER_GROUP_BNR

public static final int FILTER_GROUP_BNR
See Also:
Constant Field Values

FILTER_GROUP_PREPAID

public static final int FILTER_GROUP_PREPAID
See Also:
Constant Field Values
Constructor Detail

SearchFilterModel

public SearchFilterModel(java.lang.String searchFilterName)
Builds an empty SearchFilterModel. This builder is mainly used through the super() pointer.

Parameters:
searchFilterName - the name of the XML element which implements this XML complex type.
Method Detail

getSearchFilterName

public java.lang.String getSearchFilterName()
Returns the XML element name of the current search filter.

Returns:
the name of the element.

setSearchFilterName

public void setSearchFilterName(java.lang.String name)
Sets the the XML element name of the current search filter.

Parameters:
name - the name to set.

getMaxSize

public int getMaxSize()
Gets the max. The max value represents the max number of results answering to the search request.

Returns:
the maxSize.

setMaxSize

public void setMaxSize(int d)
Sets the max. The max value represents the max number of results answering to the search request.

Parameters:
d - the maxSize.

getSearchMode

public int getSearchMode()
Gets the search mode which must be used with this filter. Only the listMode is available through the API (default value). THe iteratorMode is reserved for internal use.

Returns:
the searchMode which must be used with the current filter. Available values are :

setSearchMode

public void setSearchMode(int mode)
Sets the search mode which must be used with this filter. This method is reserved for internal use. Only the listMode is available through the API (default value). The iteratorMode is reserved for internal use. Set the searchMode which must be used with the current filter. Available values are :

Parameters:
mode - the search mode to set.

getResultType

public int getResultType()
Gets the search result type. Two types exist :

Returns:
the search result type - Available values are :

setResultType

public void setResultType(int type)
Sets the search result type.
Two types exist : Set the search result type.

Parameters:
type - the result type to set.

getFrom

public java.lang.String getFrom()
Gets the from cursor. The from cursor (if not null) is used as a begining index for searching items. This cursor is mainly used as following :

Returns:
the from cursor.

setFrom

public void setFrom(java.lang.String f)
Gets the from cursor. The from cursor (if not null) is used as a beginning index for searching items. This cursor is mainly used as following during a search window:

Note : the from cursor is always transmitted as a String even if the unique ID is a number. In this case, please cast it into a String value.

Parameters:
f - the from cursor. If it sets to

getSort

public java.lang.String getSort()
Gets the cursor search order. Available value are :

Returns:
the required sort order.

setSort

public void setSort(java.lang.String sortOrder)
Sets the from cursor search order. The default value is NO_ORDER. Available value are :

Note : if NO_ORDER is set, the server will decide itself what is the best order to use and sometime will use some internal ID (Object ID OID) for improving search performances.

According to search window mechanism definition (see from cursor), It is not recommended to change the the sort order into a same search window.

Parameters:
sortOrder - the order which is used for managing the cursor.

getAttributeSelectionList

public java.util.List<AttributeDescriptionModel> getAttributeSelectionList()
Gets the list of constraints which must be checked for searching item. This list contains all criteria which port on object main attribute.

The boolean conjunction operator (AND) is applied between each list element. In addition, the same operator will be applied between the last element of this list and the first element of the specific constraint list (see specificFormula) .

A search criteria is expressed through a AttributeDescriptionModel . Indeed an attribute description model, describes the attribute (name, type, default value) and aggregates some constraints which must be checked by the attribute. In this case, those constraints are some good candidates to express search criteria.

Available contraint types are :

Returns:
a list of AttributeDescriptionModel .

setAttributeSelectionList

public void setAttributeSelectionList(java.util.List<AttributeDescriptionModel> sels)
Sets the list of constraints which port on attribute fields. See getAttributeSelectionList() for more info.

Parameters:
sels - a list of AttributeDescriptionModel.

getAttributeSelectionListFromGroup

public java.util.List<AttributeDescriptionModel> getAttributeSelectionListFromGroup(java.lang.String group)
Gets the list of constraints which must be checked for searching item and which belong to the same group.

It exists 4 groups for qualifying an attribute :


addAttributeSelection

public void addAttributeSelection(AttributeDescriptionModel sel)
Adds a selection filter which port on a attribute field.

Parameters:
sel - the selection which must be added into the list.

getSpecificFormulaList

public java.util.List<SpecificFormulaModel> getSpecificFormulaList()
Gets the list of specific constraints.

As some searchable items can be specific, the specific formula allows the user to complete the list of criteria with predefined specific constraints which cannot be expressed by an AttributeDescriptionModel.

Returns:
a list of SpecificFormulaModel.

setSpecificFormulaList

public void setSpecificFormulaList(java.util.List<SpecificFormulaModel> specifics)
Sets the list of specific constraints. See getSpecificFormulaList() for more info.

Parameters:
specifics - a list of SpecificFormulaModel.

addSpecificFormula

public void addSpecificFormula(SpecificFormulaModel formula)
Adds a specific constraint for the search operation, regarding to the working scope. See getSpecificFormulaList() for more info.

Parameters:
formula - the specific constraint which must be added into the specific constraint list.

setCountRequiredFlag

public void setCountRequiredFlag(boolean flag)
Set the flag for returning the total number of selected items.

Parameters:
flag - If set to true, le result will constain the total item count which match the constraints. If it sets to false, totalCount will be set to -1. See totalCount into SearchResult.

isCountRequired

public boolean isCountRequired()
Tells if the total number of selected items must be returned. See setCountRequiredFlag() for more info.

Returns:
true id the total item count must be returned. False otherwise.

getFilterGroup

public int getFilterGroup()
Returns the filter group of the searchFilterModel, default is BnR, this method is surrounded in PnR searchFilterModels.

Returns:
filter group

getSpecificFormulaFromCatalog

public abstract SpecificFormulaModel getSpecificFormulaFromCatalog(java.lang.String formCode)
This abstract method must be implemented into each concrete filter. It returns a specific formula from the catalog according to its name. See getSpecificFormulaList() for more info;

Parameters:
formCode - the code which identifies the specific formula.
Returns:
the targeted specific formula. Null the formula doesn't exist.

getSpecificFormulaCatalog

public abstract java.util.Vector<SpecificFormulaModel> getSpecificFormulaCatalog()
This abstract method must be implemented into each concrete filter. It returns the catalog of available specific formula for the current search filter. See getSpecificFormulaList() for more info;

Returns:
a list of SpecificFormulaModel.

getMainAttributeDescriptionFromCatalog

public abstract AttributeDescriptionModel getMainAttributeDescriptionFromCatalog(java.lang.String attributeName)
Returns an empty constraint from a catalog which can be used for specifying a criteria on a main attribute (identified by its name).

In main concrete filter, it exists some main attributes on which constraint can port on. The main difference between main attribute group and other attribute groups (additional, parameter, counter) is that those attribute are predefined. So we can establish the catalog of the main attribute for a concrete search filter, for whih it will be possible to build some search criteria.

This abstract method allows to retrieve a predefined constraint on a main attribute which belongs to the main attribute catalog.

Parameters:
attributeName - the name of the attribute. Please consult related concrete class for more info.
Returns:
the related attribute description model or null if the specified attribute name doesn't match any catalog attribute.

getMainAttributeDescriptionCatalog

public abstract java.util.Vector<AttributeDescriptionModel> getMainAttributeDescriptionCatalog()
Returns the list of main attribute description on which the user can build some search criteria. See getMainAttributeDescriptionFromCatalog() for more info.

Returns:
a list of AttributeDescriptionModel which are related to main attributes of the concrete search filter.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the tag beeing processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - the XML attributes of the current tag.

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the objects, the child represents the marshallable object to be added into the content tree.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - the name of tag for the child.
child - the child to be added.

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - the character data to be added.

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, and of its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - the XML output to marshall the object into.

SAP CC 1.0
API 4.2 (Core)


API Reference - July 2009

SAP Convergent Charging 1.0 (build R4.2.1.35.0.0)
CONVERGENT CHARGING 4.2

(c) Copyright 2009 SAP AG. All rights reserved.