@Override public void onSubmit() { try { getConfig().storeConfig(); fp.info("Configuration saved"); } catch (IOException e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(e.getLocalizedMessage()); fp.error(e.getLocalizedMessage()); } } };
@Override public void onSubmit() { try { getConfig().storeConfig(); fp.info("Configuration saved"); } catch (IOException e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(e.getLocalizedMessage()); fp.error(e.getLocalizedMessage()); } } };
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { final boolean switchTo = !Boolean.parseBoolean(toggleInfo.getModel().getObject()); final ApplicationContext ctx = getGeoServerApplication().getApplicationContext(); ctx.publishEvent(new ToggleEvent(switchTo, type)); // getConfig().putConfiguration(configKey, // Boolean.toString(switchTo)); if (switchTo) { fp.info("The " + type + " toggle is now ENABLED"); } else { fp.warn("The " + type + " toggle is now DISABLED no event will be posted/received to/from the broker"); fp.info("Note that the " + type + " is still registered to the topic destination"); } toggleInfo.getModel().setObject(Boolean.toString(switchTo)); target.addComponent(toggleInfo); target.addComponent(fp); } };
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { final boolean switchTo = !Boolean.parseBoolean(toggleInfo.getModel().getObject()); final ApplicationContext ctx = getGeoServerApplication().getApplicationContext(); ctx.publishEvent(new ToggleEvent(switchTo, type)); // getConfig().putConfiguration(configKey, // Boolean.toString(switchTo)); if (switchTo) { fp.info("The " + type + " toggle is now ENABLED"); } else { fp.warn("The " + type + " toggle is now DISABLED no event will be posted/received to/from the broker"); fp.info("Note that the " + type + " is still registered to the topic destination"); } toggleInfo.getModel().setObject(Boolean.toString(switchTo)); target.addComponent(toggleInfo); target.addComponent(fp); } };
fp.info("Disconnecting..."); if (c.disconnect()) { fp.info("Succesfully un-registered from the destination topic"); fp.warn("You will (probably) loose next incoming events from other instances!!! (depending on how you have configured the broker)"); connectionInfo.getModel().setObject( fp.info("Connecting..."); if (c.connect()) { fp.info("Now GeoServer is registered with the destination"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.enabled.toString());
fp.info("Disconnecting..."); if (c.disconnect()) { fp.info("Succesfully un-registered from the destination topic"); fp.warn("You will (probably) loose next incoming events from other instances!!! (depending on how you have configured the broker)"); connectionInfo.getModel().setObject( fp.info("Connecting..."); if (c.connect()) { fp.info("Now GeoServer is registered with the destination"); connectionInfo.getModel().setObject( ConnectionConfigurationStatus.enabled.toString());
@Override protected void onClick(AjaxRequestTarget target) { RemoteInfo remoteInfo = getModelObject(); String location = remoteInfo.getURL(); String username = remoteInfo.getUserName(); String pwd = remoteInfo.getPassword(); try { Ref head = RepositoryManager.pingRemote(location, username, pwd); String headTarget; if (head instanceof SymRef) { headTarget = ((SymRef) head).getTarget(); } else { headTarget = head.getObjectId().toString(); } pingFeedbackPanel.info("Connection suceeded. HEAD is at " + headTarget); } catch (Exception e) { pingFeedbackPanel.error(e.getMessage()); } target.add(pingFeedbackPanel); } }