public class MavenIndexContext extends Object implements ArchivaIndexingContext
| Modifier | Constructor and Description | 
|---|---|
| protected  | MavenIndexContext(Repository repository,
                 org.apache.maven.index.context.IndexingContext delegate) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close()Closes the context without deleting the files. | 
| void | close(boolean deleteFiles)Closes any resources, this context has open. | 
| void | commit()Writes the last changes to the index. | 
| <T> T | getBaseContext(Class<T> clazz)Returns the repository specific implementation of the index. | 
| Set<String> | getGroups()Returns the list of groups that are assigned to this index | 
| String | getId()The identifier of the context | 
| StorageAsset | getPath()The path where the index is stored. | 
| Repository | getRepository()Returns the repository this index context is associated to. | 
| boolean | isEmpty()Returns true, if the index has no entries or is not initialized. | 
| boolean | isOpen()Returns the status of this context. | 
| void | optimize()Optimizes the index | 
| void | purge()Removes all entries from the index. | 
| void | rollback()Throws away the last changes. | 
| boolean | supports(Class<?> clazz)Returns true, if this index implementation has support for the given repository specific
 implementation class. | 
| void | updateTimestamp(boolean save)Updates the timestamp of the index. | 
| void | updateTimestamp(boolean save,
               ZonedDateTime time)Updates the timestamp with the given time. | 
protected MavenIndexContext(Repository repository, org.apache.maven.index.context.IndexingContext delegate)
public String getId()
ArchivaIndexingContextgetId in interface ArchivaIndexingContextpublic Repository getRepository()
ArchivaIndexingContextgetRepository in interface ArchivaIndexingContextpublic StorageAsset getPath()
ArchivaIndexingContextgetPath in interface ArchivaIndexingContextpublic boolean isEmpty() throws IOException
ArchivaIndexingContextisEmpty in interface ArchivaIndexingContextIOExceptionpublic void commit() throws IOException
ArchivaIndexingContextcommit in interface ArchivaIndexingContextIOExceptionpublic void rollback() throws IOException
ArchivaIndexingContextrollback in interface ArchivaIndexingContextIOExceptionpublic void optimize() throws IOException
ArchivaIndexingContextoptimize in interface ArchivaIndexingContextIOExceptionpublic void close(boolean deleteFiles) throws IOException
ArchivaIndexingContextclose in interface ArchivaIndexingContextdeleteFiles - True, if the index files should be deleted.IOExceptionpublic void close() throws IOException
ArchivaIndexingContextclose(false)close in interface ArchivaIndexingContextIOExceptionpublic boolean isOpen()
ArchivaIndexingContextfalse, after the ArchivaIndexingContext.close() method
 has been called.isOpen in interface ArchivaIndexingContexttrue, if the close() method has not been called, otherwise falsepublic void purge() throws IOException
ArchivaIndexingContextpurge in interface ArchivaIndexingContextIOExceptionpublic boolean supports(Class<?> clazz)
ArchivaIndexingContextsupports in interface ArchivaIndexingContextpublic <T> T getBaseContext(Class<T> clazz) throws UnsupportedOperationException
ArchivaIndexingContextgetBaseContext in interface ArchivaIndexingContextclazz - the specific classUnsupportedOperationException - if the implementation is not supportedpublic Set<String> getGroups() throws IOException
ArchivaIndexingContextgetGroups in interface ArchivaIndexingContextIOExceptionpublic void updateTimestamp(boolean save) throws IOException
ArchivaIndexingContextupdateTimestamp in interface ArchivaIndexingContextIOExceptionpublic void updateTimestamp(boolean save, ZonedDateTime time) throws IOException
ArchivaIndexingContextupdateTimestamp in interface ArchivaIndexingContextIOExceptionCopyright © 2006–2019 The Apache Software Foundation. All rights reserved.