This page gives a brief tutorial on writing PerfSonar UI plugin for Java.
In the first step it should be clear that UI plugin is a simple jar file with specific interfaces implemented by java files in that jar . This jar file should be placed in folder PerfsonarUI-vX.XX/bin/ext, so when PerfSonar App is loaded it searches for jars and load them as a plugin
The java class which is made should implement IPerfsonarTab, it would add a new tab in UI when the application startsNow, you have got a new tab, whats next ???
You have two panes to work on. On both sides you can add things from Swing and other Java components.
Looking at the consistency the left pane is used to explore information from services i.e. to query and select the MA to gather data
On the right hand we can add components like JFree charts to add graphs or may be calender to get relevant date data.
Coming on to technical details of the panes that is how to add components in right and left pane.
IPerfsonarTab has functions which would add components on right and left pane
- PluginMainPanel createMainComponent(java.awt.Component parentComponent)
- Creates the window at the right in PerfsonarTaskPane, which is to be displayed as another tab in PerfSonarApp.
javax.swing.JComponent[] createDetailsComponent(java.awt.Component parentComponent)
- If not null will be displayed at the left pane, just below the actions.
So far so good. Now coming on how to get data from MA, so that it could be displayed in widgets.
- SmartMARequest is the class that handles request creation and sending.
- It can also aggregate requests if configured to do so, send them in parallel or sequentially.
- Can handle requests that need different XML schema.
- The request is accessible via IPerfsonarTab.getRequest()
- IPerfsonarTab.setRequest(org.perfsonar.perfsonarui.SmartMARequest)
This page gives a touch of PerfSonar UI API. It is the compendium of what the API is about, but for more clarifications and detail overview visit PerfSonar UI documentation.