Page History
Anchor | ||||
---|---|---|---|---|
|
Data Source Function List
...
Return a DataSourceName as a String.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
Return the collection of DataSets that are available in this DataSource. See the DataSet section for defining a DataSet.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
Return the connection meta-data required for this DataSource. See the MetaData section for defining Meta Data for a Data Source.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
Return true or false depending on whether authentication against the data source was successful. This can return true if this is not required.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
disconnect() is called when the connection to the connector is closed. Perform any clean up here. This function can do nothing if it is not required.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
An error message can be displayed if the connection test was not successful. The key to the Map in this case should be “ERROR”, with a description of the error stored in the Map value.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
Code Block | ||
---|---|---|
| ||
public ScheduleDefinition getScheduleDefinition() { return new ScheduleDefinition("MINUTES", null, 60); } |
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
public boolean autoRun();
autoRun is the called to perform any background tasks. This function is called based on the getScheduleDefinition(). This could be used to download and cache data locally.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
protected final byte[] loadBlob(String key);
loadBlob() will load a blob (byte[]) that was previously saved by the connector, usually in a background task. The parameter key is a unique identifier for the data to load. Blobs can only be loaded on data sources that have been saved. areBlobsAvailable() can be used to see if blob access is available.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
protected final boolean saveBlob(String key, byte[] data);
saveBlob() allows for saving a blob (byte[]) for later use. This is a way of saving data from background tasks for later use. The parameter key is the unique identifier for the data to be saved. data is the byte[] to be associated with that key. Writing null to data will delete the saved data for the specified key. Blobs can only be loaded on data sources that have been saved. areBlobsAvailable() can be used to see if blob access is available.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
Blobs can only be loaded on data sources that have been saved. areBlobsAvailable() can be used to see if blob access is available. Blob access will not be available if a connector is tested prior to being saved.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
getAttribute() allows for fetching attributes from the connection meta-data. For example, a Username may be specified for the connection through the Yellowfin UI. Using the key of the parameter, the contents of the Username meta-data field can be fetched for use when retrieving data from external APIs.
Styleclass | ||
---|---|---|
| ||
...
Anchor | ||||
---|---|---|---|---|
|
...
getSourceId() can be used to fetch the unique internal id of source that this connector is associated with. This may be helpful for segregating data by connection in some kind of external cache or database.
Styleclass | ||
---|---|---|
| ||
...
Recommendations for using saveBlob() and loadBlob()
...
If significant amounts of data are stored in the blob system, it is recommended to truncate the data after a certain period. This might mean deleting all data when it reaches a certain age, or storing less granular information for older data. For instance, store raw data for three months, daily aggregated data for one year, and weekly aggregated data for older data. To achieve this, a background job would need to re-aggregate and re-store the data.
Styleclass | ||
---|---|---|
| ||
...
Minimise Blob Size
There is significant load induced on the Yellowfin database and server when storing and loading large sized blobs. If possible, distribute stored data across multiple blobs.
...
There is no ideal size for blobs. The loading speed of blobs from the Yellowfin database will be dependent on the hardware and DBMS used. Public connectors will be used on Yellowfin installations of all sizes, so smaller, less powerful systems should be taken into consideration.
Styleclass | ||
---|---|---|
| ||
...
Application-Level Filtering & Aggregations
...
Application-level filtering is also toggled based on the capabilities of columns in the connector. If any DataSet columns (as returned by getColumns()) support native filtering (where the connector applies its own filters), then the application-level filtering will be disabled, and only connector column filters will be available. Connector filters (as returned by getFilters()) can co-exist with application-level filters.
Styleclass | ||
---|---|---|
| ||
...
Custom Error Messages
Custom messages can be returned to the Yellowfin UI if an error occurs whilst running a connector report. This can be done by throwing a ThirdPartyException() with a custom message from the connector plugin.
...
The custom error message will be shown as a standard “Oh-No” error where the report would usually be rendered. This would usually be thrown from the execute() function on a DataSet.
Styleclass | ||
---|---|---|
| ||
Section | |||||||
---|---|---|---|---|---|---|---|
|