com.tivoli.twg.engine
Class TWGDbTCPIPColumn

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGDbColumn
      extended bycom.tivoli.twg.engine.TWGDbCharColumn
          extended bycom.tivoli.twg.engine.TWGDbTCPIPColumn
All Implemented Interfaces:
java.io.Serializable

public class TWGDbTCPIPColumn
extends TWGDbCharColumn
implements java.io.Serializable

The class is new in Director v2.1. TWGDbTCPIPColumn is a container class that encapsulates a database table column where the column type is Character and the column stores TCPIP addresses .

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.tivoli.twg.engine.TWGDbCharColumn
columnDisplayValues, columnDistinctValues, columnValues, NULL
 
Constructor Summary
TWGDbTCPIPColumn(java.lang.String realName, java.lang.String tokenName, int colLength)
          Create a TCPIP column TWGDbTCPIPColumn
TWGDbTCPIPColumn(TWGDbTCPIPColumn copyCol)
          Create a TWGDbCharColumn by copying another one
 
Method Summary
 boolean compareTo(DataValue dv, TWGDbColumnFilter colFilter)
          This method is used by TWGDatabaseTable to support columns that require specialized processing for filters.
protected  TWGDbColumn createFilterColumn(java.util.Locale loc, TWGDatabaseTable table)
          Create a filter version of this column where the display name is translated.
 java.lang.String[] getDisplayValues()
          Get display values for the distinct column values which are the same as the real values because TCPIP addresses will not be translated.
protected  java.io.Serializable getDistinctValues(java.util.Locale loc, TWGDatabaseTable table)
          The method is only to be used on Director engine.
 IntValueSet getMatchingMoids(TWGFilterConstraint filterConstraint, TWGDbConnection conn, IntValueSet moids)
          TCPIP values are stored in the database as strings.
 java.lang.String[] getValues()
          Gets the array of distinct TCPIP values for this column.
protected  void insertDistinctValue(java.lang.Object value)
          This method is protected as an implementation side effect.
protected  void replaceDistinctValues(java.sql.ResultSet rs)
          This method is protected as an implementation side effect.
protected  void replaceDistinctValues(TWGStringArray newValues)
          This method is protected as an implementation side effect.
protected  void setDistinctValues(java.lang.Object vals)
          Set column distinct values
 void setDistinctValues(TWGStringArray values)
          Set the distinct values for this column to a constant set.
 void setInitialDistinctValues(TWGInteger dv)
          Set the initial distinct values for this column.
 void setInitialDistinctValues(TWGIntegerArray dv)
          Set the initial distinct values for this column.
 void sortValues(java.util.Locale loc)
          The TCPIP column can have both ip address as strings and non ip values.
 
Methods inherited from class com.tivoli.twg.engine.TWGDbCharColumn
setDefaultValue, setInitialDistinctValues, setInitialDistinctValues, setMappedColumn, toString
 
Methods inherited from class com.tivoli.twg.engine.TWGDbColumn
allowsGTLT, getColumnDefaultValue, getColumnId, getColumnlength, getColumnType, getDisplayName, getInitialDistinctValues, getKeyNum, getMetaType, getRealColumnName, getTable, getTokenColumnName, implementsFilterProcessing, isFilterColumn, isMappedColumn, queryDistinctValues, refreshDistinctIfNeeded, refreshDistinctValues, setAllowsGTLT, setColumnId, setColumnLength, setColumnNameLength, setDefaultValue, setDisplayName, setFilterColumn, setFilterProcessing, setInitialDistinctValues, setKeyNum, setMetaType, setQueryDistinctValues, setShortColumnName, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGDbTCPIPColumn

public TWGDbTCPIPColumn(java.lang.String realName,
                        java.lang.String tokenName,
                        int colLength)
Create a TCPIP column TWGDbTCPIPColumn

Parameters:
realName - -- the actual column name for the table
tokenName - -- a nickname used to refer to the column
colLength - -- the length for the column

TWGDbTCPIPColumn

public TWGDbTCPIPColumn(TWGDbTCPIPColumn copyCol)
Create a TWGDbCharColumn by copying another one

Parameters:
copyCol - -- the column to be copied
Method Detail

createFilterColumn

protected TWGDbColumn createFilterColumn(java.util.Locale loc,
                                         TWGDatabaseTable table)
Create a filter version of this column where the display name is translated. This method is to be used only in the Director engine.

Overrides:
createFilterColumn in class TWGDbCharColumn
Parameters:
loc - - the locale to use for translations
table - - the TWGDatabaseTable that this column belongs to
Returns:
a TWGDbColumn

getDistinctValues

protected java.io.Serializable getDistinctValues(java.util.Locale loc,
                                                 TWGDatabaseTable table)
The method is only to be used on Director engine. Get column distinct values

Overrides:
getDistinctValues in class TWGDbCharColumn
Parameters:
loc - - Locale
table - - a TWGDatabaseTable instance. The column is in the table.
Returns:
String[] containing column distinct values

setDistinctValues

protected void setDistinctValues(java.lang.Object vals)
Set column distinct values

Overrides:
setDistinctValues in class TWGDbCharColumn

replaceDistinctValues

protected void replaceDistinctValues(java.sql.ResultSet rs)
                              throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Replace the saved list of distinct values with a new set from a database query.

Overrides:
replaceDistinctValues in class TWGDbCharColumn
Parameters:
rs - - The query ResultSet.
Throws:
- - TWGDbException
TWGDbException

replaceDistinctValues

protected void replaceDistinctValues(TWGStringArray newValues)
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Replace the saved list of distinct values with a new set

Overrides:
replaceDistinctValues in class TWGDbCharColumn
Parameters:
newValues - - The String containing the new values
See Also:
StringValueSet

sortValues

public void sortValues(java.util.Locale loc)
The TCPIP column can have both ip address as strings and non ip values. The sort will convert the ip address into its integer equivalent ( actually a long because int is signed in Java ). and sort the address. All non ip strings are then also sorted and placed at the end of the list. The distinct values are stored in a TWGStringArray because the order of insertion is maintained. A LocalizedStringSortSet and locale specific collator is then used on the non ip strings to sort in the specified locale. The distinct values are then put into the same order as the display values. This method is protected as an implementation side effect. Do not call or change. The interface will be changed later.

Overrides:
sortValues in class TWGDbCharColumn
Parameters:
loc - - locale to sort in.

getValues

public java.lang.String[] getValues()
Gets the array of distinct TCPIP values for this column.

Overrides:
getValues in class TWGDbCharColumn
Returns:
a String array of distinct values /*

getDisplayValues

public java.lang.String[] getDisplayValues()
Get display values for the distinct column values which are the same as the real values because TCPIP addresses will not be translated.

Overrides:
getDisplayValues in class TWGDbCharColumn
Returns:
a String array of the display values for the column values

insertDistinctValue

protected void insertDistinctValue(java.lang.Object value)
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Insert a distinct TCPIP value into the list of distinct values.

Overrides:
insertDistinctValue in class TWGDbCharColumn
Parameters:
value - - The TCPIP value to be inserted as an string.

setDistinctValues

public void setDistinctValues(TWGStringArray values)
Set the distinct values for this column to a constant set. The distinct values are used when displaying column values for selection (for example when defining dynamic groups). The only distinct values used will be those provided in the set of values. No refresh from actual database column contents will be done for this column if this method was called.

This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table

Overrides:
setDistinctValues in class TWGDbCharColumn
Parameters:
values - - The String array containing the constant distinct values
See Also:
StringValueSet

setInitialDistinctValues

public void setInitialDistinctValues(TWGInteger dv)
Set the initial distinct values for this column. These values will always be displayed in the dynamic filter builder.

Parameters:
dv - - TWGString datavalue

setInitialDistinctValues

public void setInitialDistinctValues(TWGIntegerArray dv)
Set the initial distinct values for this column. These values will always be displayed in the dynamic filter builder.

Parameters:
dv - - TWGStringArray datavalue

getMatchingMoids

public IntValueSet getMatchingMoids(TWGFilterConstraint filterConstraint,
                                    TWGDbConnection conn,
                                    IntValueSet moids)
TCPIP values are stored in the database as strings. The filter queries created as an SQL statement does not return the correct results. This method is used to convert the TCPIP addresses stored in the database to the integer equivalent and the filter logic is applied here.

Overrides:
getMatchingMoids in class TWGDbColumn
Parameters:
conn - - database connection to use.
filterConstraint - - the filter constraint.
moids - - this is the list of moids to check. If the list is null then check against all moids.
Returns:
- return the list of moids that match the filter constraint.

compareTo

public boolean compareTo(DataValue dv,
                         TWGDbColumnFilter colFilter)
This method is used by TWGDatabaseTable to support columns that require specialized processing for filters. This method is only used in the case when the operator is ALL_FOR_SAME_ADDRESS

Overrides:
compareTo in class TWGDbColumn
Parameters:
dv - - the data value to compare
colFilter - - the column filter to compare to
Returns:
- the boolean value of the comparision