Reference Guide
Table Of Contents
- 1 Introduction
- 2 Establishing Your Test and Development Environments
- 3 Developing Applications
- Introduction
- Authentication
- REST API
- Audit Logging
- Alert Logging
- Configuration
- High Availability
- OpenFlow
- Metrics Framework
- GUI
- SKI Framework - Overview
- SKI Framework - Navigation Tree
- SKI Framework - Hash Navigation
- SKI Framework - View Life-Cycle
- SKI Framework - Live Reference Application
- UI Extension
- Introduction
- Controller Teaming
- Distributed Coordination Service
- Persistence
- Backup and Restore
- Device Driver Framework
- 4 Application Security
- 5 Including Debian Packages with Applications
- 6 Sample Application
- Application Description
- Creating Application Development Workspace
- Application Generator (Automatic Workspace Creation)
- Creating Eclipse Projects
- Updating Project Dependencies
- Building the Application
- Installing the Application
- Application Code
- 7 Testing Applications
- 8 Built-In Applications
- Appendix A
- Appendix B
- Bibliography
}
return alert;
}
getColumnDecoder()
getColumnDecoder–This method takes a column as argument and returns the data type of that
column to the caller. This is required for reading the columns in correct format.
CassandraAlertDao.java:
@Override
protected ColumnDecoder<String, ?> getColumnDecoder(
ColumnName<String, ?> columnName) {
if (columnName == null) {
throw new NullPointerException(...);
}
if (AlertColumnFamily.SEVERITY_COL_NAME.equals(columnName)) {
return AlertColumnFamily.SEV_DECODER;
} else if (AlertColumnFamily.TIMESTAMP_COL_NAME.equals(columnName)) {
return DateColumnDecoder.getInstance();
} else if (AlertColumnFamily.DESC_COL_NAME.equals(columnName) ||
AlertColumnFamily.ORIGIN_COL_NAME.equals(columnName) ||
AlertColumnFamily.TOPIC_COL_NAME.equals(columnName) ||
AlertColumnFamily.SYS_ID_NAME.equals(columnName)) {
return StringColumnDecoder.getInstance();
} else if (AlertColumnFamily.STATE_COL_NAME.equals(columnName)) {
return BooleanColumnDecoder.getInstance();
}
return null;
}
createStorableInstance()
This method converts the DTO into a storable format. Storable format is the one which underlying
database client code understands. More on this in the next section.
CassandraAlertDao.java:
@Override
protected CassandraStorable<String, String>
createStorableInstance(CassandraAlert transportable) {
CassandraStorable<String, String> storable =
new CassandraStorable<String, String> (
transportable.uid(), transportable.getSysId());
storable.setColumn(new StringColumn<String>(
AlertColumnFamily.SYS_ID_NAME, transportable.getSysId()));
storable.setColumn(new StringColumn<String>(
102