.setNonIndexedOnly(true)
.setQualifiers(NOT_RENAMABLE_QUALIFIERS)
.setScopes(NOT_RENAMABLE_SCOPES)
.setRootProjectId(rootProjectId);
session.select(SELECT_RESOURCES, query, new ResultHandler() {
@Override
public void handleResult(ResultContext context) {
ResourceDto resource = (ResourceDto) context.getResultObject();
doIndex(resource, mapper);
}
});
// some resources can be renamed, so index must be regenerated
// -> delete existing rows and create them again
query = ResourceIndexerQuery.create()
.setNonIndexedOnly(false)
.setQualifiers(RENAMABLE_QUALIFIERS)
.setScopes(RENAMABLE_SCOPES)
.setRootProjectId(rootProjectId);
session.select(SELECT_RESOURCES, query, new ResultHandler() {
@Override
public void handleResult(ResultContext context) {
ResourceDto resource = (ResourceDto) context.getResultObject();
mapper.deleteByResourceId(resource.getId());