/** * Writes cache files, first new mail, than state to avoid client prematurely looking for * activation info. Hits nfs. */ private void updateSignalFiles(ClientHashSupport hash, CustomerState state, boolean isDeleted) { File base = getCacheBase(); int userId = hash.getUserId(); File stateFile = new File(base, hash.getStateCachePath()); if (isDeleted || state == CustomerState.READY) { deleteFileIfNeeded(stateFile, userId); } // ready state. else { byte[] stateData = STATE_DATA_CACHE.get(state); touchFile(stateFile, stateData, userId, true); } File newMailFile = new File(base, hash.getNewMailCachePath()); if (!isDeleted && state.type() == CustomerState.Type.Active) { touchFile(newMailFile, ZERO, userId, true); } else { deleteFileIfNeeded(newMailFile, userId); } if (isDeleted || state.type() != CustomerState.Type.Active) { File f = getSessionFile(hash.getLastActivationToken()); deleteFileIfNeeded(f, userId); } }