/** * validates the values of the IndexProperties * @throws IOException */ private void validate(boolean store) throws IOException { if(isSynchronized() && getIndexArchives().isEmpty()){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where Synchronized=true and no Index-Archives are defined!"); } ManagedIndexState state = getState(); if(state == null){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexMetadata without the required key '"+STATE+ "' set to one of the values '"+ Arrays.toString(ManagedIndexState.values())+"'!"); } if(isActive()){ if(getDirectory() == null){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where Active=true and no Directory is defined!"); } } String name = getIndexName(); if(name == null || name.isEmpty()){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where the required key '"+ INDEX_NAME+"' is not defined or empty!"); } }
/** * validates the values of the IndexProperties * @throws IOException */ private void validate(boolean store) throws IOException { if(isSynchronized() && getIndexArchives().isEmpty()){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where Synchronized=true and no Index-Archives are defined!"); } ManagedIndexState state = getState(); if(state == null){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexMetadata without the required key '"+STATE+ "' set to one of the values '"+ Arrays.toString(ManagedIndexState.values())+"'!"); } if(isActive()){ if(getDirectory() == null){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where Active=true and no Directory is defined!"); } } String name = getIndexName(); if(name == null || name.isEmpty()){ throw new IOException("Unable to "+(store?"store":"read")+ " IndexPropertis where the required key '"+ INDEX_NAME+"' is not defined or empty!"); } }
indexUpdateDaemon.update(ManagedIndexState.ACTIVE,metadata, ais); keepTracking = keepTracking || metadata.isSynchronized(); } else { //currently used Archive is of higher priority as keepTracking = keepTracking || metadata.isSynchronized();
indexUpdateDaemon.update(ManagedIndexState.ACTIVE,metadata, ais); keepTracking = keepTracking || metadata.isSynchronized(); } else { //currently used Archive is of higher priority as keepTracking = keepTracking || metadata.isSynchronized();
/** * @param indexName */ public void addTracking(IndexMetadata metadata) { if(metadata != null){ //may be removed in the meantime if(!(metadata.isActive() || metadata.isInactive()) || metadata.isSynchronized()){ String archive = metadata.getArchive(); boolean found = false; //only track higher priority files as the current for(String indexArchive : metadata.getIndexArchives()){ if(!found){ if(indexArchive.equals(archive)){ found = true; } tracker.add(this, indexArchive, IndexMetadata.toStringMap(metadata)); } // else higher priority archive present -> no tracking } } //else (active || inactive) and not syncronized -> no tracking } }; /**
/** * @param indexName */ public void addTracking(IndexMetadata metadata) { if(metadata != null){ //may be removed in the meantime if(!(metadata.isActive() || metadata.isInactive()) || metadata.isSynchronized()){ String archive = metadata.getArchive(); boolean found = false; //only track higher priority files as the current for(String indexArchive : metadata.getIndexArchives()){ if(!found){ if(indexArchive.equals(archive)){ found = true; } tracker.add(this, indexArchive, IndexMetadata.toStringMap(metadata)); } // else higher priority archive present -> no tracking } } //else (active || inactive) and not syncronized -> no tracking } }; /**
if(metadata != null){ //may be removed in the meantime String currentArchive = metadata.getArchive(); boolean inSync = metadata.isSynchronized(); if(resource.equals(currentArchive)){ //current archive may be null
if(metadata != null){ //may be removed in the meantime String currentArchive = metadata.getArchive(); boolean inSync = metadata.isSynchronized(); if(resource.equals(currentArchive)){ //current archive may be null