/** * Creates and initialises a {@link IndexMetadata} instance based on the * parsed {@link SolrCore} * @param core the {@link SolrCore} * @param serverName the name of the server * @return the initialised {@link IndexMetadata} */ public static IndexMetadata getMetadata(SolrCore core, String serverName){ if(core == null){ return null; } IndexMetadata metadata = new IndexMetadata(); if(serverName != null){ metadata.setServerName(serverName); } metadata.setSynchronized(false); updateMetadata(metadata, core); return metadata; } /**
@Override public IndexMetadata updateIndex(String name, ArchiveInputStream ais, String archiveCoreName) throws IOException { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("The parsed index name MUST NOT be NULL nor empty!"); } IndexMetadata metadata = new IndexMetadata(); metadata.setIndexName(name); metadata.setServerName(DEFAULT_SERVER_NAME); metadata.setSynchronized(false); metadata.setState(ManagedIndexState.ACTIVE); if (archiveCoreName != null) { metadata.setArchive(archiveCoreName); } return updateCore(metadata, ais); }
/** * Creates and initialises a {@link IndexMetadata} instance based on the * parsed {@link SolrCore} * @param core the {@link SolrCore} * @param serverName the name of the server * @return the initialised {@link IndexMetadata} */ public static IndexMetadata getMetadata(SolrCore core, String serverName){ if(core == null){ return null; } IndexMetadata metadata = new IndexMetadata(); if(serverName != null){ metadata.setServerName(serverName); } metadata.setSynchronized(false); updateMetadata(metadata, core); return metadata; } /**
metadata.setSynchronized(false); metadata.setState(ManagedIndexState.ACTIVE); metadata.setArchive(resourceName);
@Override public IndexMetadata updateIndex(String indexName, ArchiveInputStream ais, String archiveCoreName) throws IOException, SAXException { if(indexName == null || indexName.isEmpty()){ throw new IllegalArgumentException("The parsed name for the index MUST NOT" + "be NULL nor empty!"); } if(ais == null){ throw new IOException("The parsed ArchiveInputStream MUST NOT be NULL!"); } IndexMetadata metadata = new IndexMetadata(); metadata.setServerName(serverName); metadata.setIndexName(indexName); metadata.setSynchronized(false); if (archiveCoreName != null) { metadata.setArchive(archiveCoreName); } try { updateCore(metadata, ais); } finally { managedCores.store(metadata); } return metadata; }
@Override public IndexMetadata updateIndex(String name, ArchiveInputStream ais, String archiveCoreName) throws IOException { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("The parsed index name MUST NOT be NULL nor empty!"); } IndexMetadata metadata = new IndexMetadata(); metadata.setIndexName(name); metadata.setServerName(DEFAULT_SERVER_NAME); metadata.setSynchronized(false); metadata.setState(ManagedIndexState.ACTIVE); if (archiveCoreName != null) { metadata.setArchive(archiveCoreName); } return updateCore(metadata, ais); }
metadata.setSynchronized(false); metadata.setState(ManagedIndexState.ACTIVE); metadata.setArchive(resourceName);
@Override public IndexMetadata updateIndex(String indexName, ArchiveInputStream ais, String archiveCoreName) throws IOException, SAXException { if(indexName == null || indexName.isEmpty()){ throw new IllegalArgumentException("The parsed name for the index MUST NOT" + "be NULL nor empty!"); } if(ais == null){ throw new IOException("The parsed ArchiveInputStream MUST NOT be NULL!"); } IndexMetadata metadata = new IndexMetadata(); metadata.setServerName(serverName); metadata.setIndexName(indexName); metadata.setSynchronized(false); if (archiveCoreName != null) { metadata.setArchive(archiveCoreName); } try { updateCore(metadata, ais); } finally { managedCores.store(metadata); } return metadata; }
public void addUninitialisedIndex(String indexName, String indexArchiveName, Boolean sync) throws IOException { IndexMetadata config = new IndexMetadata(); config = new IndexMetadata(); config.setIndexName(indexName); config.setServerName(serverName); config.setState(ManagedIndexState.UNINITIALISED); if(sync != null){ config.setSynchronized(sync); } //no need to clone, because we have created the instance updateIndexProperties(null, config, false); } public void store(IndexMetadata properties){
public void addUninitialisedIndex(String indexName, String indexArchiveName, Boolean sync) throws IOException { IndexMetadata config = new IndexMetadata(); config = new IndexMetadata(); config.setIndexName(indexName); config.setServerName(serverName); config.setState(ManagedIndexState.UNINITIALISED); if(sync != null){ config.setSynchronized(sync); } //no need to clone, because we have created the instance updateIndexProperties(null, config, false); } public void store(IndexMetadata properties){