SDN Controller Programming Guide

iv
4 Sample Application ················································································································································ 106
Application Description ··············································································································································· 106
Creating Application Development Workspace······································································································· 106
Creating Application Directory Structure·········································································································· 107
Creating Configuration Files ······························································································································ 108
Creating Module Directory Structure ················································································································ 113
Application Generator (Automatic Workspace Creation)······················································································· 114
Creating Eclipse Projects ············································································································································· 115
Updating Project Dependencies ································································································································· 115
Building Application ···················································································································································· 115
Installing Application ··················································································································································· 116
Application Code ························································································································································ 119
Defining Model Objects ····································································································································· 119
Creating Domain Service (Business Logic) ······································································································· 124
Creating REST API ··············································································································································· 137
Creating RSdoc ··················································································································································· 160
Creating GUI ······················································································································································· 165
Using SDN Controller Services ·························································································································· 176
5 Testing Applications ················································································································································ 194
Unit Testing ··································································································································································· 194
Remote Debugging with Eclipse ································································································································· 197
6 Built-In Applications ················································································································································· 203
Device Node Manager ··············································································································································· 203
Services published by Node Manager Service ······························································································· 203
Link Discovery ······························································································································································ 204
Topology Manager ······················································································································································ 206
Appendix A ································································································································································· 208
Eclipse ··········································································································································································· 208
Importing Java Projects ······································································································································· 208
Setting M2_REPO Classpath Variable ·············································································································· 211
Installing Eclipse Plug-ins ···································································································································· 211
Eclipse Perspectives ············································································································································ 213
Attaching Source Files when Debugging ········································································································· 213
Appendix B ·································································································································································· 216
Troubleshooting ···························································································································································· 216
Maven Cannot Download Required Libraries·································································································· 216
Path Errors in Eclipse Projects after Importing ·································································································· 217
Bibliography ································································································································································ 219