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,- java.beans.PropertyChangeListener,- java.util.EventListener
 
 public class SQLPropertyAdapter extends AbstractQueryAdapter implements java.beans.PropertyChangeListener, IQueryResponseListener, SearchablePropertyAdapter 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapterAbstractPropertyAdapter.EdtUpdateValue
 - 
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.AdapterAdapter.ValueHolder
 - 
Nested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdapterPropertyAdapter.PAType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static intMODE_EXPERTstatic intMODE_SIMPLE- 
Fields inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdapterappContext, isTargetPropertyDynamic, log, overlayOptOut, target, targetPropertyName, value, valueClass
 
- 
 - 
Constructor SummaryConstructors Constructor Description SQLPropertyAdapter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect(VisionClientContext appContext)Calls connect() on all interaction descriptorsvoiddisconnect()Calls disconnect() on all interaction descriptorsintgetAdapterMode()BindingConfigurationgetBindingConfiguration()java.lang.StringgetDatasource()QueryHoldergetDatasourceListener()QueryHoldergetEffectiveUpdateQuery()Returns the update queryQueryHolderobject.java.lang.StringgetFallbackValue()InteractionDescriptor[]getInteractions()Retrieves an array of the interactions that this adapter depends on.java.lang.String[]getKeyCols()java.lang.String[]getKeyVals()java.lang.String[]getOrderCols()QueryHoldergetPullQuery()QueryHoldergetPushQuery()Returns the update query.PropertyAdapter.PATypegetReferenceType()java.lang.String[]getSelectedCols()java.lang.StringgetTableName()voidhandleQueryReturnedError(java.lang.Exception error)voidhandleQueryReturnedNoRows()voidhandleQueryReturnedValue(java.lang.Object value)Called by the query manager when the pull query has been run successfullybooleanisPushEnabled()voidnotifyQueryRunning(boolean loading)voidpropertyChange(java.beans.PropertyChangeEvent evt)protected java.lang.ObjectregisterQuery(int updateRate, boolean runOnce)voidsetAdapterMode(int i)voidsetDatasource(java.lang.String string)voidsetDatasourceListener(QueryHolder datasourceListener)voidsetFallbackValue(java.lang.String fallbackValue)voidsetKeyCols(java.lang.String[] strings)voidsetKeyVals(java.lang.String[] keyVals)voidsetOrderCols(java.lang.String[] orderCols)voidsetPullQuery(QueryHolder holder)voidsetPushConnected(boolean b)voidsetPushEnabled(boolean enabled)voidsetPushQuery(QueryHolder holder)voidsetSelectedCols(java.lang.String[] strings)voidsetTableName(java.lang.String string)voidshutdown()If pollingMode is POLLING_RELATIVE_RATE or POLLING_ABSOLUTE_RATE, then this disconnects the SQLPropertyAdapter from the QueryManager.voidstartup()Notifies the adapter that it is becoming active, and should start any polling/threaded activities.java.lang.StringtoString()protected voidupdateTarget()Sets the target property to the value.- 
Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractQueryAdaptergetPollingConfig, getPollingMode, getUpdateRate, isSerializableDataset, restartQuery, setPollingMode, setQValue, setSerializableDataset, setUpdateRate, shutdownQuery, startupQuery
 - 
Methods inherited from class com.inductiveautomation.factorypmi.application.binding.AbstractPropertyAdaptergetQValue, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.AdaptergetTarget, isValid, setTarget
 - 
Methods inherited from interface com.inductiveautomation.factorypmi.application.gateway.IQueryResponseListenergetTargetFullPath
 - 
Methods inherited from interface com.inductiveautomation.factorypmi.application.binding.PropertyAdaptergetTargetPropertyName, setTargetPropertyName
 
- 
 
- 
- 
- 
Field Detail- 
MODE_EXPERTpublic static final int MODE_EXPERT - See Also:
- Constant Field Values
 
 - 
MODE_SIMPLEpublic static final int MODE_SIMPLE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getInteractionspublic InteractionDescriptor[] getInteractions() Description copied from interface:AdapterRetrieves an array of the interactions that this adapter depends on. An interaction descriptor describes an inter-component interaction.- Specified by:
- getInteractionsin interface- Adapter
 
 - 
getBindingConfigurationpublic BindingConfiguration getBindingConfiguration() - Specified by:
- getBindingConfigurationin interface- SearchablePropertyAdapter
 
 - 
connectpublic void connect(VisionClientContext appContext) Description copied from class:AbstractPropertyAdapterCalls connect() on all interaction descriptors- Specified by:
- connectin interface- Adapter
- Overrides:
- connectin class- AbstractPropertyAdapter
 
 - 
disconnectpublic void disconnect() Description copied from class:AbstractPropertyAdapterCalls disconnect() on all interaction descriptors- Specified by:
- disconnectin interface- Adapter
- Overrides:
- disconnectin class- AbstractPropertyAdapter
 
 - 
startuppublic void startup() Description copied from interface:AdapterNotifies the adapter that it is becoming active, and should start any polling/threaded activities.- Specified by:
- startupin interface- Adapter
- Overrides:
- startupin class- AbstractPropertyAdapter
 
 - 
shutdownpublic 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:
- shutdownin interface- Adapter
- Overrides:
- shutdownin class- AbstractPropertyAdapter
 
 - 
registerQueryprotected java.lang.Object registerQuery(int updateRate, boolean runOnce)- Specified by:
- registerQueryin class- AbstractQueryAdapter
 
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent evt) - Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
 
 - 
updateTargetprotected void updateTarget() Description copied from class:AbstractPropertyAdapterSets 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:
- updateTargetin class- AbstractPropertyAdapter
 
 - 
notifyQueryRunningpublic void notifyQueryRunning(boolean loading) - Specified by:
- notifyQueryRunningin interface- IQueryResponseListener
 
 - 
handleQueryReturnedErrorpublic void handleQueryReturnedError(java.lang.Exception error) - Specified by:
- handleQueryReturnedErrorin interface- IQueryResponseListener
 
 - 
handleQueryReturnedNoRowspublic void handleQueryReturnedNoRows() - Specified by:
- handleQueryReturnedNoRowsin interface- IQueryResponseListener
 
 - 
handleQueryReturnedValuepublic void handleQueryReturnedValue(java.lang.Object value) Called by the query manager when the pull query has been run successfully- Specified by:
- handleQueryReturnedValuein interface- IQueryResponseListener
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- AbstractPropertyAdapter
 
 - 
getPullQuerypublic QueryHolder getPullQuery() 
 - 
setPullQuerypublic void setPullQuery(QueryHolder holder) 
 - 
getPushQuerypublic QueryHolder 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.
 
 - 
setPushQuerypublic void setPushQuery(QueryHolder holder) 
 - 
getEffectiveUpdateQuerypublic QueryHolder getEffectiveUpdateQuery() Returns the update queryQueryHolderobject.- Returns:
- the QueryHolder for the update query or null if there is none.
 
 - 
setPushConnectedpublic void setPushConnected(boolean b) 
 - 
isPushEnabledpublic boolean isPushEnabled() - Returns:
- whether or not the update query is enabled and whether pushing is currently allowed on this property.
 
 - 
setPushEnabledpublic void setPushEnabled(boolean enabled) 
 - 
getDatasourcepublic java.lang.String getDatasource() 
 - 
setDatasourcepublic void setDatasource(java.lang.String string) 
 - 
getAdapterModepublic int getAdapterMode() 
 - 
getKeyColspublic java.lang.String[] getKeyCols() 
 - 
getSelectedColspublic java.lang.String[] getSelectedCols() 
 - 
getTableNamepublic java.lang.String getTableName() 
 - 
setAdapterModepublic void setAdapterMode(int i) 
 - 
setKeyColspublic void setKeyCols(java.lang.String[] strings) 
 - 
setSelectedColspublic void setSelectedCols(java.lang.String[] strings) 
 - 
setTableNamepublic void setTableName(java.lang.String string) 
 - 
getFallbackValuepublic java.lang.String getFallbackValue() 
 - 
setFallbackValuepublic void setFallbackValue(java.lang.String fallbackValue) 
 - 
getReferenceTypepublic PropertyAdapter.PAType getReferenceType() - Specified by:
- getReferenceTypein interface- PropertyAdapter
 
 - 
getKeyValspublic java.lang.String[] getKeyVals() 
 - 
setKeyValspublic void setKeyVals(java.lang.String[] keyVals) 
 - 
getOrderColspublic java.lang.String[] getOrderCols() 
 - 
setOrderColspublic void setOrderCols(java.lang.String[] orderCols) 
 - 
getDatasourceListenerpublic QueryHolder getDatasourceListener() 
 - 
setDatasourceListenerpublic void setDatasourceListener(QueryHolder datasourceListener) 
 
- 
 
-