Class SQLPropertyAdapter
java.lang.Object
com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
com.inductiveautomation.factorypmi.application.binding.AbstractQueryAdapter
com.inductiveautomation.factorypmi.application.binding.SQLPropertyAdapter
- All Implemented Interfaces:
Adapter
,Adapter.ValueHolder
,SearchablePropertyAdapter
,PropertyAdapter
,IQueryResponseListener
,PropertyChangeListener
,EventListener
public class SQLPropertyAdapter
extends AbstractQueryAdapter
implements PropertyChangeListener, IQueryResponseListener, SearchablePropertyAdapter
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
AbstractPropertyAdapter.EdtUpdateValue
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
Adapter.ValueHolder
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdapter
PropertyAdapter.PAType
-
Field Summary
FieldsFields inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
appContext, isTargetPropertyDynamic, log, overlayOptOut, target, targetPropertyName, value, valueClass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(VisionClientContext appContext) Calls connect() on all interaction descriptorsvoid
Calls disconnect() on all interaction descriptorsint
Returns the update queryQueryHolder
object.Retrieves an array of the interactions that this adapter depends on.String[]
String[]
String[]
Returns the update query.String[]
void
void
void
handleQueryReturnedValue
(Object value) Called by the query manager when the pull query has been run successfullyboolean
void
notifyQueryRunning
(boolean loading) void
protected Object
registerQuery
(int updateRate, boolean runOnce) void
setAdapterMode
(int i) void
setDatasource
(String string) void
setDatasourceListener
(QueryHolder datasourceListener) void
setFallbackValue
(String fallbackValue) void
setKeyCols
(String[] strings) void
setKeyVals
(String[] keyVals) void
setOrderCols
(String[] orderCols) void
setPullQuery
(QueryHolder holder) void
setPushConnected
(boolean b) void
setPushEnabled
(boolean enabled) void
setPushQuery
(QueryHolder holder) void
setSelectedCols
(String[] strings) void
setTableName
(String string) void
shutdown()
If pollingMode is POLLING_RELATIVE_RATE or POLLING_ABSOLUTE_RATE, then this disconnects the SQLPropertyAdapter from the QueryManager.void
startup()
Notifies the adapter that it is becoming active, and should start any polling/threaded activities.toString()
protected void
Sets the target property to the value.Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractQueryAdapter
getPollingConfig, getPollingMode, getUpdateRate, isSerializableDataset, restartQuery, setPollingMode, setQValue, setSerializableDataset, setUpdateRate, shutdownQuery, startupQuery
Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapter
getQValue, getTarget, getTargetDesc, getTargetFullPath, getTargetPropertyName, getValueClass, handleError, handleNullToPrimitive, initLogger, isDataUsed, isDataUsed, isOverlayOptOut, isTargetPropertyDynamic, isValid, isValueClassPrimitive, setOverlayOptOut, setSetterMethodName, setTarget, setTargetPropertyDynamic, setTargetPropertyName, setValue, setValueClass, updateQuality, updateValue, useQuality
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
getTarget, isValid, setTarget
Methods inherited from interface com.inductiveautomation.factorypmi.application.gateway.IQueryResponseListener
getTargetFullPath
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdapter
getTargetPropertyName, setTargetPropertyName
-
Field Details
-
MODE_EXPERT
public static final int MODE_EXPERT- See Also:
-
MODE_SIMPLE
public static final int MODE_SIMPLE- See Also:
-
-
Constructor Details
-
SQLPropertyAdapter
public SQLPropertyAdapter()
-
-
Method Details
-
getInteractions
Description copied from interface:Adapter
Retrieves an array of the interactions that this adapter depends on. An interaction descriptor describes an inter-component interaction.- Specified by:
getInteractions
in interfaceAdapter
-
getBindingConfiguration
- Specified by:
getBindingConfiguration
in interfaceSearchablePropertyAdapter
-
connect
Description copied from class:AbstractPropertyAdapter
Calls connect() on all interaction descriptors- Specified by:
connect
in interfaceAdapter
- Overrides:
connect
in classAbstractPropertyAdapter
-
disconnect
public void disconnect()Description copied from class:AbstractPropertyAdapter
Calls disconnect() on all interaction descriptors- Specified by:
disconnect
in interfaceAdapter
- Overrides:
disconnect
in classAbstractPropertyAdapter
-
startup
public void startup()Description copied from interface:Adapter
Notifies the adapter that it is becoming active, and should start any polling/threaded activities.- Specified by:
startup
in interfaceAdapter
- Overrides:
startup
in classAbstractPropertyAdapter
-
shutdown
public void shutdown()If pollingMode is POLLING_RELATIVE_RATE or POLLING_ABSOLUTE_RATE, then this disconnects the SQLPropertyAdapter from the QueryManager. If pollingMode is POLLING_OFF, this is a noop.- Specified by:
shutdown
in interfaceAdapter
- Overrides:
shutdown
in classAbstractPropertyAdapter
-
registerQuery
- Specified by:
registerQuery
in classAbstractQueryAdapter
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
updateTarget
protected void updateTarget()Description copied from class:AbstractPropertyAdapter
Sets the target property to the value. If a problem occurs, the problem is displayed, not thrown. Note that updateValue() is probably a better bet, as it updates both value and quality.- Overrides:
updateTarget
in classAbstractPropertyAdapter
-
notifyQueryRunning
public void notifyQueryRunning(boolean loading) - Specified by:
notifyQueryRunning
in interfaceIQueryResponseListener
-
handleQueryReturnedError
- Specified by:
handleQueryReturnedError
in interfaceIQueryResponseListener
-
handleQueryReturnedNoRows
public void handleQueryReturnedNoRows()- Specified by:
handleQueryReturnedNoRows
in interfaceIQueryResponseListener
-
handleQueryReturnedValue
Called by the query manager when the pull query has been run successfully- Specified by:
handleQueryReturnedValue
in interfaceIQueryResponseListener
-
toString
- Overrides:
toString
in classAbstractPropertyAdapter
-
getPullQuery
-
setPullQuery
-
getPushQuery
Returns the update query. If the update query is a legacy query it returns that. If not the new query is returned.- Returns:
- The legacy update query if not null else the new version of update query.
-
setPushQuery
-
getEffectiveUpdateQuery
Returns the update queryQueryHolder
object.- Returns:
- the QueryHolder for the update query or null if there is none.
-
setPushConnected
public void setPushConnected(boolean b) -
isPushEnabled
public boolean isPushEnabled()- Returns:
- whether or not the update query is enabled and whether pushing is currently allowed on this property.
-
setPushEnabled
public void setPushEnabled(boolean enabled) -
getDatasource
-
setDatasource
-
getAdapterMode
public int getAdapterMode() -
getKeyCols
-
getSelectedCols
-
getTableName
-
setAdapterMode
public void setAdapterMode(int i) -
setKeyCols
-
setSelectedCols
-
setTableName
-
getFallbackValue
-
setFallbackValue
-
getReferenceType
- Specified by:
getReferenceType
in interfacePropertyAdapter
-
getKeyVals
-
setKeyVals
-
getOrderCols
-
setOrderCols
-
getDatasourceListener
-
setDatasourceListener
-