AdventNet Web NMS 4 API Specification

com.adventnet.nms.fe.common
Class ViewCriteria

java.lang.Object
  |
  +--com.adventnet.nms.fe.common.ViewCriteria
All Implemented Interfaces:
java.io.Serializable

public class ViewCriteria
extends java.lang.Object
implements java.io.Serializable

Objects of this class are used to specify various parameters that are needed for getting data through CustomSessionRemote.getData() method.

Since:
2.3
See Also:
Serializable, Serialized Form

Constructor Summary
ViewCriteria(java.lang.String userName, java.lang.String viewId)
          Creates a new ViewCriteria instance with the specified userName and viewId.
 
Method Summary
 java.util.Properties getCriteria()
          Returns the criteria used to filter the objects.
 int getFromIndex()
          Get the value of the index starting from which viewLength number of objects should be returned.
 java.lang.String getOrderbyColumn()
          Returns the name of the column by which the data should be ordered.
 java.util.Properties[] getScopeCriteria()
           
 java.util.Properties getSpecialProperties()
           
 TableColumn[] getTableColumns()
          Get the value of tableColumns.
 java.lang.String getUserName()
          Get the value of userName.
 java.lang.String getViewId()
          Get the value of viewId.
 int getViewLength()
          Get the number of objects required.
 boolean isAdjustFromIndex()
          Get the value of adjustFromIndex.
 boolean isAllProperties()
          Returns whether all properties of the objects are requested are not.
 boolean isAppendCriteria()
          Returns whether the customview's criteria should also be applied in addition to criteria set via setCriteria() method in this object.
 boolean isAscendingOrder()
          Returns whether the data should be sorted by ascending order based on orderByColumn.
 boolean isPerformOR()
          Get the value of performOR.
 boolean isTemporaryCustomView()
          Get the value of temporaryCustomView.
 void setAdjustFromIndex(boolean v)
          Set the value of adjustFromIndex.
 void setAllProperties(boolean v)
          Set the value of allProperties.
 void setAppendCriteria(boolean v)
          Sets whether the customview's criteria should also be applied in addition to criteria set via setCriteria() method in this object.
 void setAscendingOrder(boolean ascending)
          Specifies whether the data should be sorted by ascending order based on orderByColumn.
 void setCriteria(java.util.Properties criteria)
          Set the value of criteria.
 void setFromIndex(int fromIndex)
          Set the value of the index starting from which viewLength number of objects should be returned.
 void setOrderbyColumn(java.lang.String v)
          Set the name of the column by which the data should be ordered.
 void setPerformOR(boolean v)
          Set the value of performOR.
 void setScopeCriteria(java.util.Properties[] v)
          This method is for internal use to set the value of ScopeCriteria.
 void setSpecialProperties(java.util.Properties props)
           
 void setTableColumns(TableColumn[] v)
          Set the value of tableColumns.
 void setTemporaryCustomView(boolean v)
          Set the value of temporaryCustomView.
 void setUserName(java.lang.String v)
          Set the value of userName to whom this custom view belongs.
 void setViewId(java.lang.String v)
          Set the value of unique id representing the custom view.
 void setViewLength(int viewLength)
          Specifies the number of objects for which data are required.
 java.lang.String toString()
          Returns a String representation of this data structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewCriteria

public ViewCriteria(java.lang.String userName,
                    java.lang.String viewId)
             throws java.lang.IllegalArgumentException
Creates a new ViewCriteria instance with the specified userName and viewId.
Parameters:
userName - the user to whom the custom view belongs
viewId - the unique id of the custom view
Throws:
java.lang.IllegalArgumentException - if any of the parameter is null or empty.
Method Detail

getUserName

public java.lang.String getUserName()
Get the value of userName.
Returns:
value of userName.

setUserName

public void setUserName(java.lang.String v)
Set the value of userName to whom this custom view belongs.
Parameters:
v - the name of the user to whom this custom view belongs.

getViewId

public java.lang.String getViewId()
Get the value of viewId.
Returns:
value of viewId.

setViewId

public void setViewId(java.lang.String v)
Set the value of unique id representing the custom view.
Parameters:
v - Value to assign to viewId.

getViewLength

public int getViewLength()
Get the number of objects required.
Returns:
value of viewLength.

setViewLength

public void setViewLength(int viewLength)
Specifies the number of objects for which data are required. If this is specified as 0, then all objects starting from fromIndex will be returned, i.e. all objects matching the criteria fromIndex <= x < totalObjectsPresent.
Parameters:
viewLength - number of objects to be returned.

getFromIndex

public int getFromIndex()
Get the value of the index starting from which viewLength number of objects should be returned.
Returns:
value of fromIndex.

setFromIndex

public void setFromIndex(int fromIndex)
Set the value of the index starting from which viewLength number of objects should be returned. This value starts from 1.

Following are some special values.
-99 - Returns properties of last set of objects i.e. objects indexed in such a way that fromIndex = totalObjectsPresent - viewLength + 1.
0 - Returns the latest values, if the modules are implemented to give the latest values. This is same as setFromIndex(-99). If the time wise order of the data are not important for the modules, then they may return starting values. This is same as setFromIndex(1).

Parameters:
fromIndex - Value to assign to fromIndex.

getOrderbyColumn

public java.lang.String getOrderbyColumn()
Returns the name of the column by which the data should be ordered.
Returns:
value of column by which the data should be sort.

setOrderbyColumn

public void setOrderbyColumn(java.lang.String v)
Set the name of the column by which the data should be ordered.
Parameters:
column - name of the column by which the data should be sort.

getCriteria

public java.util.Properties getCriteria()
Returns the criteria used to filter the objects.
Returns:
value of criteria.

setCriteria

public void setCriteria(java.util.Properties criteria)
Set the value of criteria. Objects matching this criteria will only be returned.

If this is not null, then getData() will return objects matching this criteria overriding the criteria set to the custom view while creating it.

Parameters:
criteria - Value to assign to criteria.

isAllProperties

public boolean isAllProperties()
Returns whether all properties of the objects are requested are not.
Returns:
true if all properties of the objects are required, false otherwise.

setAllProperties

public void setAllProperties(boolean v)
Set the value of allProperties. If this is set to true, then all properties of objects matching the criteria will be returned irrespective of TableColumn assigned to the custom view. In Topology module, this will return all properties only if "type" criteria is set i.e. criteria should have some pattern for "type" property of ManagedObject. This type criteria is used to find the tables that are related to that type.

Note:Please make sure the criteria, you are giving retrieves less number of objects & queries less number of tables. If not this may take very long time & large amount of memory.

Parameters:
v - Value to assign to allProperties.

isPerformOR

public boolean isPerformOR()
Get the value of performOR.
Returns:
value of performOR.

setPerformOR

public void setPerformOR(boolean v)
Set the value of performOR. When set to true, getData() will return objects matching any of the Properties with OR criteria, when set to false, getData() will return objects matching all the matching Properties passed.
This value will be considered only if some criteria is set to this object.
Parameters:
v - Value to assign to performOR.

isAdjustFromIndex

public boolean isAdjustFromIndex()
Get the value of adjustFromIndex.
Returns:
value of adjustFromIndex.

setAdjustFromIndex

public void setAdjustFromIndex(boolean v)
Set the value of adjustFromIndex. This value is set as true if fromIndex is to be adjusted to a valid value in case it is wrong. Setting the value to true will avoid CustomViewException in case the fromIndex is greater than the total in the view. In such a case the fromIndex will be adjusted and ViewData with new fromIndex will be made available.
Parameters:
v - Value to assign to adjustFromIndex.

isAppendCriteria

public boolean isAppendCriteria()
Returns whether the customview's criteria should also be applied in addition to criteria set via setCriteria() method in this object. If false, only criteria will be used while getData. If true, then both customview's criteria and criteria will be used.
Returns:
true if customview's criteria should also be applied, false otherwise.

setAppendCriteria

public void setAppendCriteria(boolean v)
Sets whether the customview's criteria should also be applied in addition to criteria set via setCriteria() method in this object. If false, only criteria will be used while getData. If true, then both customview's criteria and criteria will be used.
Parameters:
v - true if customview's criteria should also be applied, false otherwise.

isAscendingOrder

public boolean isAscendingOrder()
Returns whether the data should be sorted by ascending order based on orderByColumn.
Returns:
true if data should be sorted in ascending order based on orderByColumn, false otherwise.

setAscendingOrder

public void setAscendingOrder(boolean ascending)
Specifies whether the data should be sorted by ascending order based on orderByColumn.
Parameters:
ascending - true if data should be sorted in ascending order based on orderByColumn, false otherwise.
Returns:
true if data should be sorted in ascending order based on orderByColumn, false otherwise.

getTableColumns

public TableColumn[] getTableColumns()
Get the value of tableColumns.
Returns:
value of tableColumns.

setTableColumns

public void setTableColumns(TableColumn[] v)
Set the value of tableColumns.
Parameters:
v - Value to assign to tableColumns.

isTemporaryCustomView

public boolean isTemporaryCustomView()
Get the value of temporaryCustomView.
Returns:
value of temporaryCustomView.

setTemporaryCustomView

public void setTemporaryCustomView(boolean v)
Set the value of temporaryCustomView.
Parameters:
v - Value to assign to temporaryCustomView.

getScopeCriteria

public java.util.Properties[] getScopeCriteria()

setScopeCriteria

public void setScopeCriteria(java.util.Properties[] v)
This method is for internal use to set the value of ScopeCriteria. Users are not entertained to use this method to set the scope criteria
Parameters:
v - Value to assign to ScopeCriteria.

toString

public java.lang.String toString()
Returns a String representation of this data structure. Returns a String containing values of all elements of this object.
Overrides:
toString in class java.lang.Object

getSpecialProperties

public java.util.Properties getSpecialProperties()

setSpecialProperties

public void setSpecialProperties(java.util.Properties props)

AdventNet Web NMS 4 API Specification