public Version3( String securityName, String authProtocol, String authPassphrase, String privProtocol, String privPassphrase, String engineId, String contextEngineId, String contextName) { this.securityName = SnmpUtils.createOctetString(securityName); if (!StringUtils.isEmpty(authProtocol)) { if (authProtocol.equals("MD5")) this.authProtocol = AuthMD5.ID; else if (authProtocol.equals("SHA")) this.authProtocol = AuthSHA.ID; else throw new IllegalArgumentException("Authentication protocol unsupported: " + authProtocol); } this.authPassphrase = SnmpUtils.createOctetString(authPassphrase); if (!StringUtils.isEmpty(privProtocol)) { if (privProtocol.equals("DES")) this.privProtocol = PrivDES.ID; else if ((privProtocol.equals("AES128")) || (privProtocol.equals("AES"))) this.privProtocol = PrivAES128.ID; else if (privProtocol.equals("AES192")) this.privProtocol = PrivAES192.ID; else if (privProtocol.equals("AES256")) this.privProtocol = PrivAES256.ID; else throw new IllegalArgumentException("Privacy protocol " + privProtocol + " not supported"); } this.privPassphrase = SnmpUtils.createOctetString(privPassphrase); this.engineId = SnmpUtils.createOctetString(engineId); this.contextEngineId = SnmpUtils.createOctetString(contextEngineId); this.contextName = SnmpUtils.createOctetString(contextName); }
@MethodFilter public DwrResponseI18n saveSimpleCompoundComponent( String viewComponentId, String name, String backgroundColour, List<KeyValuePair> childPointIds) { DwrResponseI18n response = new DwrResponseI18n(); validateCompoundComponent(response, name); String leadPointId = null; for (KeyValuePair kvp : childPointIds) { if (SimpleCompoundComponent.LEAD_POINT.equals(kvp.getKey())) { leadPointId = kvp.getValue(); break; } } if (StringUtils.parseInt(leadPointId, 0) <= 0) response.addContextualMessage( "compoundPointSelect" + SimpleCompoundComponent.LEAD_POINT, "dsEdit.validate.required"); if (!response.getHasMessages()) { SimpleCompoundComponent c = (SimpleCompoundComponent) getViewComponent(viewComponentId); c.setName(name); c.setBackgroundColour(backgroundColour); saveCompoundPoints(c, childPointIds); } return response; }
@MethodFilter public DwrResponseI18n saveScriptComponent(String viewComponentId, String script) { DwrResponseI18n response = new DwrResponseI18n(); // Validate if (StringUtils.isEmpty(script)) response.addContextualMessage( "graphicRendererScriptScript", "viewEdit.graphic.missingScript"); if (!response.getHasMessages()) { ScriptComponent c = (ScriptComponent) getViewComponent(viewComponentId); c.setScript(script); resetPointComponent(c); } return response; }
private void executeCommand(String command) { if (StringUtils.isEmpty(command)) return; ProcessWorkItem.queueProcess(command); }
private void validateCompoundComponent(DwrResponseI18n response, String name) { if (StringUtils.isEmpty(name)) response.addContextualMessage("compoundName", "dsEdit.validate.required"); }