Search in sources :

Example 1 with ConfigContent

use of org.netxms.client.agent.config.ConfigContent in project netxms by netxms.

the class NXCSession method getConfigContent.

/**
 * Saves existing config
 *
 * @param id config id
 * @return content of requested by id configurations file
 * @throws IOException  if socket I/O error occurs
 * @throws NXCException if NetXMS server returns an error or operation was timed out
 */
public ConfigContent getConfigContent(long id) throws NXCException, IOException {
    final NXCPMessage msg = newMessage(NXCPCodes.CMD_OPEN_AGENT_CONFIG);
    msg.setFieldInt32(NXCPCodes.VID_CONFIG_ID, (int) id);
    sendMessage(msg);
    NXCPMessage response = waitForRCC(msg.getMessageId());
    ConfigContent content = new ConfigContent(id, response);
    return content;
}
Also used : ConfigContent(org.netxms.client.agent.config.ConfigContent) NXCPMessage(org.netxms.base.NXCPMessage)

Example 2 with ConfigContent

use of org.netxms.client.agent.config.ConfigContent in project netxms by netxms.

the class ServerStoredAgentConfigEditorView method createNewConfig.

/**
 * Creates new config that is sent to server on save
 */
private void createNewConfig() {
    modified = true;
    firePropertyChange(PROP_DIRTY);
    actionSave.setEnabled(true);
    ConfigListElement newElement = new ConfigListElement();
    elements.add(newElement);
    configList.setInput(elements.toArray(new ConfigListElement[elements.size()]));
    reselection = true;
    StructuredSelection selection = new StructuredSelection(newElement);
    previousSelection = selection;
    configList.setSelection(selection);
    content = new ConfigContent();
    updateContent();
}
Also used : ConfigContent(org.netxms.client.agent.config.ConfigContent) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConfigListElement(org.netxms.client.agent.config.ConfigListElement)

Aggregations

ConfigContent (org.netxms.client.agent.config.ConfigContent)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 NXCPMessage (org.netxms.base.NXCPMessage)1 ConfigListElement (org.netxms.client.agent.config.ConfigListElement)1