1 19 20 package com.sslexplorer.core; 21 22 import com.sslexplorer.boot.PropertyDefinition; 23 import com.sslexplorer.properties.PropertyChangeEvent; 24 25 26 31 public class DefaultCoreListener implements CoreListener { 32 33 public void coreEvent(CoreEvent evt) { 34 if (evt instanceof PropertyChangeEvent) { 35 PropertyChangeEvent pce = (PropertyChangeEvent) evt; 36 StringBuffer buf = new StringBuffer ("Property "); 37 buf.append(pce.getDefinition().getName()); 38 if (pce.getDefinition().getType() == PropertyDefinition.TYPE_PASSWORD) { 39 buf.append(" changed"); 40 } else { 41 buf.append(" from "); 42 buf.append(pce.getOldValue()); 43 buf.append(" to "); 44 buf.append(pce.getNewValue()); 45 } 46 if (pce.getSessionInfo() != null) { 47 buf.append(" (by user "); 48 buf.append(pce.getSessionInfo().getUser().getPrincipalName()); 49 buf.append(" )"); 50 } 51 if (CoreServlet.log.isInfoEnabled()) 52 CoreServlet.log.info(buf.toString()); 53 if(pce.getDefinition().isRestartRequired()) { 54 CoreUtil.addMultipleGlobalWarning(GlobalWarning.MANAGEMENT_USERS, 55 new BundleActionMessage("properties", "event.configurationChangeRestartRequired.warning")); 56 } 57 } else if (evt.getId() >= CoreEventConstants.KEYSTORE_CREATED && evt.getId() <= CoreEventConstants.KEYSTORE_PKCS12_KEY_KEY_IMPORTED 58 && evt.getSessionInfo() != null) { 59 CoreUtil.addMultipleGlobalWarning(GlobalWarning.MANAGEMENT_USERS, 60 new BundleActionMessage("properties", "event.configurationChangeRestartRequired.warning")); 61 } 62 } 63 } | Popular Tags |