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()
ArchivaIndexingContext
getId
in interface ArchivaIndexingContext
public Repository getRepository()
ArchivaIndexingContext
getRepository
in interface ArchivaIndexingContext
public StorageAsset getPath()
ArchivaIndexingContext
getPath
in interface ArchivaIndexingContext
public boolean isEmpty() throws IOException
ArchivaIndexingContext
isEmpty
in interface ArchivaIndexingContext
IOException
public void commit() throws IOException
ArchivaIndexingContext
commit
in interface ArchivaIndexingContext
IOException
public void rollback() throws IOException
ArchivaIndexingContext
rollback
in interface ArchivaIndexingContext
IOException
public void optimize() throws IOException
ArchivaIndexingContext
optimize
in interface ArchivaIndexingContext
IOException
public void close(boolean deleteFiles) throws IOException
ArchivaIndexingContext
close
in interface ArchivaIndexingContext
deleteFiles
- True, if the index files should be deleted.IOException
public void close() throws IOException
ArchivaIndexingContext
close(false)
close
in interface ArchivaIndexingContext
IOException
public boolean isOpen()
ArchivaIndexingContext
false
, after the ArchivaIndexingContext.close()
method
has been called.isOpen
in interface ArchivaIndexingContext
true
, if the close()
method has not been called, otherwise false
public void purge() throws IOException
ArchivaIndexingContext
purge
in interface ArchivaIndexingContext
IOException
public boolean supports(Class<?> clazz)
ArchivaIndexingContext
supports
in interface ArchivaIndexingContext
public <T> T getBaseContext(Class<T> clazz) throws UnsupportedOperationException
ArchivaIndexingContext
getBaseContext
in interface ArchivaIndexingContext
clazz
- the specific classUnsupportedOperationException
- if the implementation is not supportedpublic Set<String> getGroups() throws IOException
ArchivaIndexingContext
getGroups
in interface ArchivaIndexingContext
IOException
public void updateTimestamp(boolean save) throws IOException
ArchivaIndexingContext
updateTimestamp
in interface ArchivaIndexingContext
IOException
public void updateTimestamp(boolean save, ZonedDateTime time) throws IOException
ArchivaIndexingContext
updateTimestamp
in interface ArchivaIndexingContext
IOException
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.