SL-GMS Enterprise RTView Customization

com.sl.gmsjrtviewds
Class GmsRtViewDsConnInfo

java.lang.Object
  extended by com.sl.gmsjrtview.GmsRtViewDataObject
      extended by com.sl.gmsjrtviewds.GmsRtViewDsConnInfo
All Implemented Interfaces:
com.sl.gmsjrt.GmsDataObjectType, com.sl.gmsjrtview.GmsRtViewDataObjectType

public class GmsRtViewDsConnInfo
extends com.sl.gmsjrtview.GmsRtViewDataObject

The GmsRtViewDsConnInfo class contains the information to create a named connection to a datasource.

To customize this class for a given application, add named fields to the Exemplar to hold the information needed. ConnInfo objects, with their custom fields, are created and edited via the Application Options dialog.


Field Summary
 
Fields inherited from class com.sl.gmsjrtview.GmsRtViewDataObject
name
 
Constructor Summary
GmsRtViewDsConnInfo(java.lang.String name, GmsRtViewDs owner)
          Create a ConnInfo object with the specified parameters.
 
Method Summary
 boolean addField(java.lang.String name)
          Add a new field to the object.
 boolean addField(java.lang.String name, java.lang.String dialogFieldType)
          Add a new field to the object and specifies the user interface element that will be used to represent the field in a dialog.
 boolean addScrambledField(java.lang.String name)
          Add a new scrambled field to the object.
 boolean addScrambledField(java.lang.String name, java.lang.String dialogFieldType)
          Add a new scrambled field to the object and specifies the user interface element that will be used to represent the field in a dialog.
protected static java.util.LinkedHashMap copyFieldAttrs(java.util.LinkedHashMap exemplarFieldAttrs)
          Copy field attrs
 boolean equals(java.lang.Object o)
          Compares this ConnInfo object to the specified object.
 java.lang.String getConnString()
          Returns a string representation of the ConnInfo object.
 java.lang.String getDataField(java.lang.String fieldName)
          Return a String containing the value of the named field.
 java.util.List getFieldChoices(java.lang.String fieldName)
          Return a List of possible values for the named field when displayed in a dialog.
 java.util.List getFieldNames()
          Return a List containing the names of all defined fields.
 java.lang.String getFieldSubstitutionValue(java.lang.String fieldName)
          Return the value of the named field with available substitutions applied.
 DialogFieldState getFieldUIState(java.lang.String fieldName)
          Return a DialogFieldState value representing the user interface state of the named field when displayed in a dialog.
 DataFieldValidity getFieldValidity(java.lang.String fieldName)
          Return a DataFieldValidity value representing the validity of the value in the named field.
 java.lang.String getFieldValue(java.lang.String fieldName)
          Return a String containing the value of the named field.
 GmsRtViewDs getOwner()
          Returns the datasource owning this ConnInfo object.
 long getRetryDelay()
          Gets the amount of time to delay when retrying a connection attempt.
 int hashCode()
          Returns a hash code for this ConnInfo object.
 boolean isConnected()
          Tests if this connection is connected.
 boolean isRetryDelayed()
          Tests if there is a nonzero retry delay time.
 boolean isScrambledField(java.lang.String name)
          Test if the named field a scrambled field.
 void setDisconnected()
          Marks this connInfo object as disconnected.
 void setFieldChoices(java.lang.String fieldName, java.util.Set choices)
          Set the possible values for the named field when displayed in a dialog.
 void setFieldUIState(java.lang.String fieldName, DialogFieldState state)
          Set the user interface state of the named field when displayed in a dialog.
 void setFieldValidity(java.lang.String fieldName, DataFieldValidity validity)
          Set the validity of the value in the named field.
 boolean setFieldValue(java.lang.String fieldName, java.lang.String fieldValue)
          Set the value of the named field.
 void setRetryDelay(long retryDelay)
          Sets the (amount of time to delay when retrying a connection attempt.
 
Methods inherited from class com.sl.gmsjrtview.GmsRtViewDataObject
addListener, applyDataToListener, applyDataToListeners, getColumnNames, getColumnNames, getData, getDataField, getListeners, getName, getVarNames, isEmpty, removeListener, removeListener, toString, updateDataField
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GmsRtViewDsConnInfo

public GmsRtViewDsConnInfo(java.lang.String name,
                           GmsRtViewDs owner)
Create a ConnInfo object with the specified parameters.

Parameters:
name - the name of the connection. This is used in the Attach to Data dialog.
Method Detail

equals

public boolean equals(java.lang.Object o)
Compares this ConnInfo object to the specified object. The result is true if and only if the argument is not null and is a ConnInfo object with the same name as this object.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to compare this ConnInfo object against.
Returns:
true if the ConnInfo objects are equal; false otherwise

getConnString

public java.lang.String getConnString()
Returns a string representation of the ConnInfo object.

Returns:
String representation of the ConnInfo object.

getOwner

public GmsRtViewDs getOwner()
Returns the datasource owning this ConnInfo object.

Returns:
the datasource owning this object

getRetryDelay

public final long getRetryDelay()
Gets the amount of time to delay when retrying a connection attempt.

Returns:
the retry delay time in in milliseconds.

hashCode

public int hashCode()
Returns a hash code for this ConnInfo object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

isConnected

public final boolean isConnected()
Tests if this connection is connected.

Returns:
true if this connection is connected.

isRetryDelayed

public final boolean isRetryDelayed()
Tests if there is a nonzero retry delay time.

Returns:
true if there is a nonzero retry delay time.

setDisconnected

public final void setDisconnected()
Marks this connInfo object as disconnected. This may be called by the user in the event of a connection disconnect during updateData - or elsewhere to ensure a new attemptConnect() call to re-establish the connection.


setFieldValue

public boolean setFieldValue(java.lang.String fieldName,
                             java.lang.String fieldValue)
Set the value of the named field.

Parameters:
fieldName - the name of the field
fieldValue - the value of the field
Returns:
flag indicating whether the operation was successful

setRetryDelay

public final void setRetryDelay(long retryDelay)
Sets the (amount of time to delay when retrying a connection attempt.

Parameters:
retryDelay - the retry delay time in in milliseconds.

addField

public boolean addField(java.lang.String name)
Add a new field to the object.

Parameters:
name - the name of the field
Returns:
true if the field was successfully added.

addField

public boolean addField(java.lang.String name,
                        java.lang.String dialogFieldType)
Add a new field to the object and specifies the user interface element that will be used to represent the field in a dialog.

Parameters:
name - the name of the field.
dialogFieldType - how the field will be displayed in a dialog.
Returns:
true if the field was successfully added.

addScrambledField

public boolean addScrambledField(java.lang.String name)
Add a new scrambled field to the object.

Parameters:
name - The name of the field to add.
Returns:
true if the field was successfully added.

addScrambledField

public boolean addScrambledField(java.lang.String name,
                                 java.lang.String dialogFieldType)
Add a new scrambled field to the object and specifies the user interface element that will be used to represent the field in a dialog.

Parameters:
name - The name of the field
dialogFieldType - how the field will be displayed in a dialog.
Returns:
true if the field was successfully added.

copyFieldAttrs

protected static java.util.LinkedHashMap copyFieldAttrs(java.util.LinkedHashMap exemplarFieldAttrs)
Copy field attrs

Parameters:
exemplarFieldAttrs -
Returns:
populated copy of fieldAttrs

getDataField

public java.lang.String getDataField(java.lang.String fieldName)
Return a String containing the value of the named field.

Specified by:
getDataField in interface com.sl.gmsjrt.GmsDataObjectType
Overrides:
getDataField in class com.sl.gmsjrtview.GmsRtViewDataObject
Parameters:
fieldName - the name of the field
Returns:
the value of the named field

getFieldChoices

public java.util.List getFieldChoices(java.lang.String fieldName)
Return a List of possible values for the named field when displayed in a dialog.

Parameters:
fieldName - the name of the field to return
Returns:
a List of possible values for the named field

getFieldNames

public java.util.List getFieldNames()
Return a List containing the names of all defined fields.

Returns:
List of all field names.

getFieldSubstitutionValue

public java.lang.String getFieldSubstitutionValue(java.lang.String fieldName)
Return the value of the named field with available substitutions applied.

Parameters:
fieldName - the name of the field to return
Returns:
the value of the named field with available substitutions applied

getFieldUIState

public DialogFieldState getFieldUIState(java.lang.String fieldName)
Return a DialogFieldState value representing the user interface state of the named field when displayed in a dialog.

Parameters:
fieldName - the name of the field to return
Returns:
a DialogFieldState value representing the user interface state of the named field:
  • DialogFieldState.HIDDEN
  • DialogFieldState.DISABLED
  • DialogFieldState.ENABLED
  • DialogFieldState.EDITABLE
  • DialogFieldState.UNKNOWN

getFieldValidity

public DataFieldValidity getFieldValidity(java.lang.String fieldName)
Return a DataFieldValidity value representing the validity of the value in the named field.

Parameters:
fieldName - the name of the field to return
Returns:
a DataFieldValidity value representing the validity of the value of the named field:
  • DataFieldValidity.GOOD
  • DataFieldValidity.BAD
  • DataFieldValidity.NOTREQ
  • DataFieldValidity.UNKNOWN

getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName)
Return a String containing the value of the named field.

Parameters:
fieldName - the name of the field
Returns:
the value of the named field

isScrambledField

public boolean isScrambledField(java.lang.String name)
Test if the named field a scrambled field.

Parameters:
name - The name of the field
Returns:
true if the named field a scrambled field

setFieldChoices

public void setFieldChoices(java.lang.String fieldName,
                            java.util.Set choices)
Set the possible values for the named field when displayed in a dialog.

Parameters:
fieldName - the name of the field to return
choices - a List of possible values for the named field

setFieldUIState

public void setFieldUIState(java.lang.String fieldName,
                            DialogFieldState state)
Set the user interface state of the named field when displayed in a dialog.

Parameters:
fieldName - the name of the field to return
state - a DialogFieldState value representing the user interface state of the named field:
  • DialogFieldState.HIDDEN
  • DialogFieldState.DISABLED
  • DialogFieldState.ENABLED
  • DialogFieldState.EDITABLE

setFieldValidity

public void setFieldValidity(java.lang.String fieldName,
                             DataFieldValidity validity)
Set the validity of the value in the named field.

Parameters:
fieldName - the name of the field to return
validity - a DataFieldValidity value representing the validity of the value of the named field:
  • DataFieldValidity.GOOD
  • DataFieldValidity.BAD
  • DataFieldValidity.NOTREQ
  • DataFieldValidity.UNKNOWN

SL-GMS Enterprise RTView Customization

Copyright 2009 Sherrill-Lubinski Corporation, 240 Tamal Vista Blvd
Corte Madera, CA 94925, U.S.A. All Rights Reserved