use of org.netxms.client.objects.MobileDevice in project netxms by netxms.
the class SelectInternalParamDlg method fillParameterList.
/**
* Fill parameter list
*/
protected void fillParameterList() {
ArrayList<AgentParameter> list = new ArrayList<AgentParameter>(10);
// Internal parameters common for all nodes
// $NON-NLS-1$
list.add(new AgentParameter("ChildStatus(*)", Messages.get().SelectInternalParamDlg_DCI_ChildObjectStatus, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("ConditionStatus(*)", Messages.get().SelectInternalParamDlg_DCI_ConditionStatus, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Dummy", Messages.get().SelectInternalParamDlg_DCI_Dummy, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Status", Messages.get().SelectInternalParamDlg_DCI_Status, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("PingTime", Messages.get().SelectInternalParamDlg_PingTime_PrimaryIP, DataType.UINT32));
// $NON-NLS-1$
list.add(new AgentParameter("PingTime(*)", Messages.get().SelectInternalParamDlg_PingTime_Instance, DataType.UINT32));
if ((object instanceof Template) || (object instanceof AbstractNode)) {
// $NON-NLS-1$
list.add(new AgentParameter("Net.IP.NextHop(*)", Messages.get().SelectInternalParamDlg_DCI_NextHop, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("NetSvc.ResponseTime(*)", "Network service {instance} response time", DataType.UINT32));
// $NON-NLS-1$
list.add(new AgentParameter("ReceivedSNMPTraps", "Total SNMP traps received", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("ReceivedSyslogMessages", "Total syslog messages received", DataType.UINT64));
}
if ((object instanceof Template) || ((object instanceof AbstractNode) && ((AbstractNode) object).hasAgent())) {
// $NON-NLS-1$
list.add(new AgentParameter("AgentStatus", Messages.get().SelectInternalParamDlg_DCI_AgentStatus, DataType.INT32));
}
if ((object instanceof Template) || ((object instanceof AbstractNode) && ((AbstractNode) object).isManagementServer())) {
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDBWriterQueueSize", Messages.get().SelectInternalParamDlg_DCI_AvgDBWriterQueue, DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDBWriterQueueSize.IData", "Database writer's request queue (DCI data) for last minute", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDBWriterQueueSize.Other", "Database writer's request queue (other queries) for last minute", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDBWriterQueueSize.RawData", "Database writer's request queue (raw DCI data) for last minute", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDCIQueuingTime", Messages.get().SelectInternalParamDlg_DCI_AvgDCIQueueTime, DataType.UINT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageDCPollerQueueSize", Messages.get().SelectInternalParamDlg_DCI_AvgDCQueue, DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageSyslogProcessingQueueSize", Messages.get().SelectInternalParamDlg_SyslogProcessingQueue, DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.AverageSyslogWriterQueueSize", Messages.get().SelectInternalParamDlg_SyslogWriterQueue, DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DB.Queries.Failed", "Failed DB queries", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DB.Queries.LongRunning", "Long running DB queries", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DB.Queries.NonSelect", "Non-SELECT DB queries", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DB.Queries.Select", "SELECT DB queries", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DB.Queries.Total", "Total DB queries", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DBWriter.Requests.IData", "DB writer requests (DCI data)", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DBWriter.Requests.Other", "DB writer requests (other queries)", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.DBWriter.Requests.RawData", "DB writer requests (raw DCI data)", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ReceivedSNMPTraps", "SNMP traps received since server start", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ReceivedSyslogMessages", "Syslog messages received since server start", DataType.UINT64));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.ActiveRequests(*)", "Thread pool {instance}: active requests", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.CurrSize(*)", "Thread pool {instance}: current size", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.Load(*)", "Thread pool {instance}: current load", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.LoadAverage(*)", "Thread pool {instance}: load average (1 minute)", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.LoadAverage5(*)", "Thread pool {instance}: load average (5 minutes)", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.LoadAverage15(*)", "Thread pool {instance}: load average (15 minutes)", DataType.FLOAT));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.MaxSize(*)", "Thread pool {instance}: maximum size", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.MinSize(*)", "Thread pool {instance}: minimum size", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.ScheduledRequests(*)", "Thread pool {instance}: scheduled requests", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.ThreadPool.Usage(*)", "Thread pool {instance}: usage", DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("Server.TotalEventsProcessed", Messages.get().SelectInternalParamDlg_DCI_TotalEventsProcessed, DataType.UINT32));
}
if ((object instanceof Template) || (object instanceof MobileDevice)) {
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.BatteryLevel", Messages.get().SelectInternalParamDlg_DCI_BatteryLevel, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.DeviceId", Messages.get().SelectInternalParamDlg_DCI_DeviceID, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.LastReportTime", Messages.get().SelectInternalParamDlg_DCI_LastReportTime, DataType.INT64));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.Model", Messages.get().SelectInternalParamDlg_DCI_Model, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.OS.Name", Messages.get().SelectInternalParamDlg_DCI_OSName, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.OS.Version", Messages.get().SelectInternalParamDlg_DCI_OSVersion, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.SerialNumber", Messages.get().SelectInternalParamDlg_DCI_SerialNumber, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.Vendor", Messages.get().SelectInternalParamDlg_DCI_Vendor, DataType.STRING));
// $NON-NLS-1$
list.add(new AgentParameter("MobileDevice.UserId", Messages.get().SelectInternalParamDlg_DCI_UserID, DataType.STRING));
}
if ((object instanceof Template) || ((object instanceof AbstractNode) && ((AbstractNode) object).isWirelessController())) {
// $NON-NLS-1$
list.add(new AgentParameter("WirelessController.AdoptedAPCount", Messages.get().SelectInternalParamDlg_AdoptedAPs, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("WirelessController.TotalAPCount", Messages.get().SelectInternalParamDlg_TotalAPs, DataType.INT32));
// $NON-NLS-1$
list.add(new AgentParameter("WirelessController.UnadoptedAPCount", Messages.get().SelectInternalParamDlg_UnadoptedAPs, DataType.INT32));
}
viewer.setInput(list.toArray());
}
use of org.netxms.client.objects.MobileDevice in project netxms by netxms.
the class SelectDciDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
IDialogSettings settings = Activator.getDefault().getDialogSettings();
Composite dialogArea = (Composite) super.createDialogArea(parent);
dialogArea.setLayout(new FillLayout());
if (fixedNode == 0) {
splitter = new SashForm(dialogArea, SWT.HORIZONTAL);
objectTree = new ObjectTree(splitter, SWT.BORDER, ObjectTree.NONE, null, ObjectSelectionDialog.createNodeSelectionFilter(true), true, false);
// $NON-NLS-1$
String text = settings.get("SelectDciDialog.Filter");
if (text != null)
objectTree.setFilter(text);
}
dciList = new DciList(null, (fixedNode == 0) ? splitter : dialogArea, SWT.BORDER, null, "SelectDciDialog.dciList", dcObjectType, allowSingleSelection ? SWT.NONE : SWT.MULTI, // $NON-NLS-1$
allowNoValueObjects);
dciList.setDcObjectType(dcObjectType);
dciList.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
if (fixedNode == 0) {
try {
int[] weights = new int[2];
// $NON-NLS-1$
weights[0] = settings.getInt("SelectDciDialog.weight1");
// $NON-NLS-1$
weights[1] = settings.getInt("SelectDciDialog.weight2");
splitter.setWeights(weights);
} catch (NumberFormatException e) {
splitter.setWeights(new int[] { 30, 70 });
}
objectTree.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
AbstractObject object = objectTree.getFirstSelectedObject2();
if ((object != null) && ((object instanceof AbstractNode) || (object instanceof MobileDevice) || (object instanceof Cluster) || (allowTemplateItems && (object instanceof Template) || (object instanceof Sensor)))) {
dciList.setNode(object);
} else {
dciList.setNode(null);
}
}
});
objectTree.setFocus();
} else {
dciList.setNode(((NXCSession) ConsoleSharedData.getSession()).findObjectById(fixedNode));
}
return dialogArea;
}
use of org.netxms.client.objects.MobileDevice in project netxms by netxms.
the class DashboardsDynamicMenu method fill.
/* (non-Javadoc)
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
*/
@Override
public void fill(Menu menu, int index) {
final Object selection = evalService.getCurrentState().getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
if ((selection == null) || !(selection instanceof IStructuredSelection))
return;
final AbstractObject object = (AbstractObject) ((IStructuredSelection) selection).getFirstElement();
if (!(object instanceof Container) && !(object instanceof Cluster) && !(object instanceof Node) && !(object instanceof MobileDevice) && !(object instanceof ServiceRoot) && !(object instanceof Subnet) && !(object instanceof Zone) && !(object instanceof Condition) && !(object instanceof EntireNetwork) && !(object instanceof Sensor))
return;
List<AbstractObject> dashboards = object.getDashboards(true);
if (dashboards.isEmpty())
return;
Collections.sort(dashboards, new Comparator<AbstractObject>() {
@Override
public int compare(AbstractObject o1, AbstractObject o2) {
return o1.getObjectName().compareToIgnoreCase(o2.getObjectName());
}
});
final Menu dashboardsMenu = new Menu(menu);
for (AbstractObject d : dashboards) {
final MenuItem item = new MenuItem(dashboardsMenu, SWT.PUSH);
item.setText(d.getObjectName());
item.setData(d.getObjectId());
item.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
try {
window.getActivePage().showView(DashboardView.ID, item.getData().toString(), IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException ex) {
MessageDialogHelper.openError(window.getShell(), Messages.get().OpenDashboard_Error, Messages.get().OpenDashboard_ErrorText + ex.getMessage());
}
}
});
}
MenuItem dashboardsMenuItem = new MenuItem(menu, SWT.CASCADE, index);
dashboardsMenuItem.setText(Messages.get().DashboardsDynamicMenu_Dashboards);
dashboardsMenuItem.setMenu(dashboardsMenu);
}
use of org.netxms.client.objects.MobileDevice in project netxms by netxms.
the class ObjectBrowser method registerActionValidators.
/**
* Register object action validators
*/
private void registerActionValidators() {
List<ActionValidatorData> list = new ArrayList<ActionValidatorData>();
// Read all registered extensions and create validators
final IExtensionRegistry reg = Platform.getExtensionRegistry();
// $NON-NLS-1$
IConfigurationElement[] elements = reg.getConfigurationElementsFor("org.netxms.ui.eclipse.objectbrowser.objectActionValidators");
for (int i = 0; i < elements.length; i++) {
try {
final ActionValidatorData v = new ActionValidatorData();
// $NON-NLS-1$
v.validator = (ObjectActionValidator) elements[i].createExecutableExtension("class");
// $NON-NLS-1$
v.priority = safeParseInt(elements[i].getAttribute("priority"));
list.add(v);
} catch (CoreException e) {
e.printStackTrace();
}
}
// Sort handlers by priority
Collections.sort(list, new Comparator<ActionValidatorData>() {
@Override
public int compare(ActionValidatorData arg0, ActionValidatorData arg1) {
return arg0.priority - arg1.priority;
}
});
actionValidators = new ObjectActionValidator[list.size() + 1];
int i = 0;
for (ActionValidatorData v : list) actionValidators[i++] = v.validator;
// Default validator
actionValidators[i] = new ObjectActionValidator() {
@Override
public int isValidSelectionForMove(SubtreeType subtree, AbstractObject currentObject, AbstractObject parentObject) {
switch(subtree) {
case INFRASTRUCTURE:
return ((currentObject instanceof Node) || (currentObject instanceof Cluster) || (currentObject instanceof Subnet) || (currentObject instanceof Condition) || (currentObject instanceof Rack) || (currentObject instanceof MobileDevice) || (currentObject instanceof Container) || (currentObject instanceof Sensor)) && ((parentObject instanceof Container) || (parentObject instanceof ServiceRoot)) ? APPROVE : REJECT;
case TEMPLATES:
return ((currentObject instanceof Template) || (currentObject instanceof TemplateGroup)) && ((parentObject instanceof TemplateGroup) || (parentObject instanceof TemplateRoot)) ? APPROVE : REJECT;
case BUSINESS_SERVICES:
return (currentObject instanceof BusinessService) && ((parentObject instanceof BusinessService) || (parentObject instanceof BusinessServiceRoot)) ? APPROVE : REJECT;
case MAPS:
return ((currentObject instanceof NetworkMap) || (currentObject instanceof NetworkMapGroup)) && ((parentObject instanceof NetworkMapGroup) || (parentObject instanceof NetworkMapRoot)) ? APPROVE : REJECT;
case DASHBOARDS:
return (((currentObject instanceof Dashboard) || (currentObject instanceof DashboardGroup)) && ((parentObject instanceof DashboardRoot) || (parentObject instanceof DashboardGroup) || (parentObject instanceof Dashboard))) ? APPROVE : REJECT;
case POLICIES:
return ((currentObject instanceof AgentPolicy) || (currentObject instanceof PolicyGroup)) && ((parentObject instanceof PolicyGroup) || (parentObject instanceof PolicyRoot)) ? APPROVE : REJECT;
default:
return REJECT;
}
}
};
}
use of org.netxms.client.objects.MobileDevice in project netxms by netxms.
the class BindObjectTo method selectionChanged.
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
if ((selection instanceof IStructuredSelection) && (((IStructuredSelection) selection).size() > 0)) {
objects = new HashSet<Long>();
for (Object o : ((IStructuredSelection) selection).toList()) {
if ((o instanceof AbstractNode) || (o instanceof Subnet) || (o instanceof MobileDevice) || (o instanceof Rack) || (o instanceof Cluster) || (o instanceof Sensor))
objects.add(((AbstractObject) o).getObjectId());
}
} else {
action.setEnabled(false);
objects = null;
}
}
Aggregations