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
CassandraAlertDao.java:
@Override
public CassandraAlert convert(CassandraStorable<String, String> source) {
if (source == null) {
throw new NullPointerException(...);
}
final CassandraAlert alert = new CassandraAlert(source.getId());
ColumnVisitor<String> visitor = new ColumnVisitorAdapter<String>() {
@Override
public void visit(BooleanColumn<String> column) {
alert.setState(column.getValue());
}
@Override
public void visit(DateColumn<String> column) {
alert.setTimestamp(column.getValue());
}
@Override
public void visit(StringColumn<String> column) {
if (AlertColumnFamily.DESC_COL_NAME.equals(column.getName())) {
alert.setDescription(column.getValue());
} else if (AlertColumnFamily.ORIGIN_COL_NAME
.equals(column.getName())) {
alert.setOrigin(column.getValue());
} else if (AlertColumnFamily.TOPIC_COL_NAME
.equals(column.getName())) {
alert.setTopicId(column.getValue());
} else if (AlertColumnFamily.SYS_ID_NAME
.equals(column.getName())) {
alert.setSysId(column.getValue());
}
}
@Override
public void visit(EnumColumn<String, ? extends Enum<?>> column) {
if (AlertColumnFamily.SEVERITY_COL_NAME
.equals(column.getName())) {
alert.setSeverity((Severity) column.getValue());
}
}
};
for(Column<String, ?> col : source.getColumns()) {
col.accept(visitor);
101