void revertLoad(final LoadKey loadKey) { ROOT_LOGGER.trace("reverting load of KeyStore"); keyStore.revert(loadKey.loadKey); synched = loadKey.modifiedTime; trackingKeyStore.setModified(loadKey.modified); }
void save() throws OperationFailedException { if (resolvedPath == null) { throw ROOT_LOGGER.cantSaveWithoutFile(path); } ROOT_LOGGER.tracef("saving KeyStore to the file [%s]", resolvedPath); try (FileOutputStream fos = new FileOutputStream(resolvedPath)) { keyStore.store(fos, resolvePassword()); synched = System.currentTimeMillis(); trackingKeyStore.setModified(false); } catch (Exception e) { throw ROOT_LOGGER.unableToCompleteOperation(e, e.getLocalizedMessage()); } }
LoadKey load() throws OperationFailedException { try { ROOT_LOGGER.tracef("reloading KeyStore from file [%s]", resolvedPath); AtomicLoadKeyStore.LoadKey loadKey = load(keyStore); long originalSynced = synched; synched = System.currentTimeMillis(); boolean originalModified = trackingKeyStore.isModified(); trackingKeyStore.setModified(false); return new LoadKey(loadKey, originalSynced, originalModified); } catch (Exception e) { throw ROOT_LOGGER.unableToCompleteOperation(e, e.getLocalizedMessage()); } }