use of org.netxms.client.topology.WirelessStation in project netxms by netxms.
the class NXCSession method getWirelessStations.
/**
* Get list of wireless stations registered at given wireless controller.
*
* @param nodeId controller node ID
* @return list of wireless stations
* @throws IOException if socket or file I/O error occurs
* @throws NXCException if NetXMS server returns an error or operation was timed out
*/
public List<WirelessStation> getWirelessStations(long nodeId) throws IOException, NXCException {
final NXCPMessage msg = newMessage(NXCPCodes.CMD_GET_WIRELESS_STATIONS);
msg.setFieldInt32(NXCPCodes.VID_OBJECT_ID, (int) nodeId);
sendMessage(msg);
final NXCPMessage response = waitForRCC(msg.getMessageId());
int count = response.getFieldAsInt32(NXCPCodes.VID_NUM_ELEMENTS);
List<WirelessStation> stations = new ArrayList<WirelessStation>(count);
long varId = NXCPCodes.VID_ELEMENT_LIST_BASE;
for (int i = 0; i < count; i++) {
stations.add(new WirelessStation(response, varId));
varId += 10;
}
return stations;
}
use of org.netxms.client.topology.WirelessStation in project netxms by netxms.
the class WirelessStationComparator method compare.
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
WirelessStation ws1 = (WirelessStation) e1;
WirelessStation ws2 = (WirelessStation) e2;
int result;
switch(// $NON-NLS-1$
(Integer) ((SortableTableViewer) viewer).getTable().getSortColumn().getData("ID")) {
case WirelessStations.COLUMN_MAC_ADDRESS:
result = ws1.getMacAddress().compareTo(ws2.getMacAddress());
break;
case WirelessStations.COLUMN_IP_ADDRESS:
result = ComparatorHelper.compareInetAddresses(ws1.getIpAddress(), ws2.getIpAddress());
break;
case WirelessStations.COLUMN_NODE_NAME:
result = session.getObjectName(ws1.getNodeObjectId()).compareToIgnoreCase(session.getObjectName(ws2.getNodeObjectId()));
break;
case WirelessStations.COLUMN_ACCESS_POINT:
result = session.getObjectName(ws1.getAccessPointId()).compareToIgnoreCase(session.getObjectName(ws2.getAccessPointId()));
break;
case WirelessStations.COLUMN_SSID:
result = ws1.getSsid().compareToIgnoreCase(ws2.getSsid());
break;
case WirelessStations.COLUMN_RADIO:
result = ws1.getRadioInterface().compareToIgnoreCase(ws2.getRadioInterface());
break;
default:
result = 0;
break;
}
return (((SortableTableViewer) viewer).getTable().getSortDirection() == SWT.UP) ? result : -result;
}
Aggregations