Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Custom Store

Use the Java API to create your own custom store according to your requirement. After you have created and implemented the custom classes, to add the new store to the CDD editor in TIBCO BusinessEvents Studio, perform the steps in Creating a Custom Store.

## Key Classes in the Custom store API

Few of the key Java classes, interfaces, and their key components are mentioned in the following sections. For a complete list of Java classes and interfaces for the custom store, see the com.tibco.cep.store.custom package summary.

To refer to the reference implementations of Redis as a persistent store by using the custom store API's, see reference implementations on GitHub.

### BaseStoreProvider

The `BaseStoreProvider` class acts as an entry point for the custom store implementation. Specify the fully qualified name of this class into the `class` element of `store.xml` file.

Additionally, if you have implemented the `StoreProperties` class, override the `getStoreProperties` method to return an instance of a custom implementation of the `StoreProperties` class.

### StoreProperties

You can use the `StoreProperties` class for the following:

- Set the maximum table name length. The default value is `-1` which signifies no limit.

- Set the maximum column name length. The default value is `-1` which signifies no limit.

- Implement store-specific sanitization.

### StoreDataTypeMapper

Use the `StoreDataTypeMapper` method to map store-specific data types to corresponding TIBCO BusinessEvents data types.

### StoreFilterBuilder

The `StoreFilterBuilder` class converts BQL language queries to store-specific queries. You can override this class to provide store-specific behavior. Implement this class only if you want to use TIBCO BusinessEvents query support (Query Agent) in your project.

The operators and keyword `getter` methods can be overridden to specify store-specific keywords values. If a keyword is not supported, override that specific `getter` to return `NULL`. Override the following methods if any store-specific operator needs to be used. Return `NULL` if any operator is not supported in the store.

Operator | Method | Default Value
--- | --- | ---
Equal | getOperatorEqual | =
Not Equal | getOperatorNotEqual | !=
Like | getOperatorLike | like
Greater | getOperatorGreater | >
GreaterOrEqual | getOperatorGreaterOrEqual | >=
Less Than | getOperatorLessThan | <
LessThanOrEqual | getOperatorLessThanOrEqual | <=
IN | getOperatorIN | in
OR | getOperatorOR | or
NOT | getOperatorNOT | not
WHERE | getOperatorWHERE | where

### StoreRowHolder

The `StoreRowHolder` class contains write and read data information with filters. Following are some important attributes and methods:

tableName | Specifies table name
selectList | Applicable in case of data reads. Stores the column names required as output of data reads. A null value specifies that all columns are required. The null value works like a `*` operator in a select query.
colDataMap | Stores the map of column names and column data. In case of write operations, this attribute contains column data to be written. In case of read operations, this attribute contains query parameters.
filtersDataMap | Stores the filter information for filters like `where` and `group by`. The `where` filter should be used only when `StoreRowHolder#colDataMap` is empty or null.
ttl | Stores the concept time to live value.

### StoreColumnData

The `StoreCloumnData`class contains column data information.

## Schema Generation for Custom Stores

Use the `StoreDeployment` class in the schema generation API and provide implementation of abstract methods. If you have implemented the `StoreProperties` class, override the `getStoreProperties` method to return an instance of a custom implementation of `StoreProperties` class.

Set the property `java.property.jdbcdeploy.bootstrap.keyword` file in the `be-storedeploy.tra` file at `BE_HOME/bin` for schema generation .

Subtopics

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.