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.EdtUpdateValueNested classes/interfaces inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
Adapter.ValueHolderNested 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 TypeMethodDescriptionvoidconnect(VisionClientContext appContext) Calls connect() on all interaction descriptorsvoidCalls disconnect() on all interaction descriptorsintReturns the update queryQueryHolderobject.Retrieves an array of the interactions that this adapter depends on.String[]String[]String[]Returns the update query.String[]voidvoidvoidhandleQueryReturnedValue(Object value) Called by the query manager when the pull query has been run successfullybooleanvoidnotifyQueryRunning(boolean loading) voidprotected ObjectregisterQuery(int updateRate, boolean runOnce) voidsetAdapterMode(int i) voidsetDatasource(String string) voidsetDatasourceListener(QueryHolder datasourceListener) voidsetFallbackValue(String fallbackValue) voidsetKeyCols(String[] strings) voidsetKeyVals(String[] keyVals) voidsetOrderCols(String[] orderCols) voidsetPullQuery(QueryHolder holder) voidsetPushConnected(boolean b) voidsetPushEnabled(boolean enabled) voidsetPushQuery(QueryHolder holder) voidsetSelectedCols(String[] strings) voidsetTableName(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.toString()protected voidSets 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, startupQueryMethods 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, useQualityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.factorypmi.application.binding.Adapter
getTarget, isValid, setTargetMethods inherited from interface com.inductiveautomation.factorypmi.application.gateway.IQueryResponseListener
getTargetFullPathMethods 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:AdapterRetrieves an array of the interactions that this adapter depends on. An interaction descriptor describes an inter-component interaction.- Specified by:
getInteractionsin interfaceAdapter
-
getBindingConfiguration
- Specified by:
getBindingConfigurationin interfaceSearchablePropertyAdapter
-
connect
Description copied from class:AbstractPropertyAdapterCalls connect() on all interaction descriptors- Specified by:
connectin interfaceAdapter- Overrides:
connectin classAbstractPropertyAdapter
-
disconnect
public void disconnect()Description copied from class:AbstractPropertyAdapterCalls disconnect() on all interaction descriptors- Specified by:
disconnectin interfaceAdapter- Overrides:
disconnectin classAbstractPropertyAdapter
-
startup
public void startup()Description copied from interface:AdapterNotifies the adapter that it is becoming active, and should start any polling/threaded activities.- Specified by:
startupin interfaceAdapter- Overrides:
startupin 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:
shutdownin interfaceAdapter- Overrides:
shutdownin classAbstractPropertyAdapter
-
registerQuery
- Specified by:
registerQueryin classAbstractQueryAdapter
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
updateTarget
protected 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 classAbstractPropertyAdapter
-
notifyQueryRunning
public void notifyQueryRunning(boolean loading) - Specified by:
notifyQueryRunningin interfaceIQueryResponseListener
-
handleQueryReturnedError
- Specified by:
handleQueryReturnedErrorin interfaceIQueryResponseListener
-
handleQueryReturnedNoRows
public void handleQueryReturnedNoRows()- Specified by:
handleQueryReturnedNoRowsin interfaceIQueryResponseListener
-
handleQueryReturnedValue
Called by the query manager when the pull query has been run successfully- Specified by:
handleQueryReturnedValuein interfaceIQueryResponseListener
-
toString
- Overrides:
toStringin 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 queryQueryHolderobject.- 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:
getReferenceTypein interfacePropertyAdapter
-
getKeyVals
-
setKeyVals
-
getOrderCols
-
setOrderCols
-
getDatasourceListener
-
setDatasourceListener
-