/** * Stops tracking for Archive files of this specific index * @param metadata */ public void removeTracking(IndexMetadata metadata){ if(metadata != null){ for(String indexArchive : metadata.getIndexArchives()){ //check if this archive is still used by an other index if(managedCores.getIndexNames(indexArchive).isEmpty()){ tracker.remove(this, indexArchive); } } } }
/** * Stops tracking for Archive files of this specific index * @param metadata */ public void removeTracking(IndexMetadata metadata){ if(metadata != null){ for(String indexArchive : metadata.getIndexArchives()){ //check if this archive is still used by an other index if(managedCores.getIndexNames(indexArchive).isEmpty()){ tracker.remove(this, indexArchive); } } } }
for(String archiveName : entry.getValue().getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(archiveName); if(indexes == null){
for(String archiveName : entry.getValue().getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(archiveName); if(indexes == null){
/** * 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!"); } }
for(String indexArchive : oldMetadata.getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(indexArchive); if(indexes.remove(name) && indexes.isEmpty()){ for(String indexArchive : properties.getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(indexArchive); if(indexes == null){
for(String indexArchive : oldMetadata.getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(indexArchive); if(indexes.remove(name) && indexes.isEmpty()){ for(String indexArchive : properties.getIndexArchives()){ Collection<String> indexes = archiveName2CoreName.get(indexArchive); if(indexes == null){
/** * @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 } }; /**
IndexMetadata metadata = managedCores.getIndexMetadata(indexName); if(metadata != null){ //the core might be deleted in the meantime List<String> archives = metadata.getIndexArchives(); String currentArchive = metadata.getArchive(); if(currentArchive == null ||
/** * @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 } }; /**
IndexMetadata metadata = managedCores.getIndexMetadata(indexName); if(metadata != null){ //the core might be deleted in the meantime List<String> archives = metadata.getIndexArchives(); String currentArchive = metadata.getArchive(); if(currentArchive == null ||
for(String archive : metadata.getIndexArchives()){ if(!archive.equals(resource)) { if(currentArchive == null){
for(String archive : metadata.getIndexArchives()){ if(!archive.equals(resource)) { if(currentArchive == null){