/** * Performs the operation. * * @return The {@link IndexInfo} of the dropped index. */ @Override protected IndexInfo _call() { checkArgument(treeRefSpec != null, "Tree ref spec not provided."); final NodeRef typeTreeRef = IndexUtils.resolveTypeTreeRef(context(), treeRefSpec); checkArgument(typeTreeRef != null, "Can't find feature tree '%s'", treeRefSpec); String treeName = typeTreeRef.path(); List<IndexInfo> indexInfos = IndexUtils.resolveIndexInfo(indexDatabase(), treeName, attributeName); checkState(!indexInfos.isEmpty(), "A matching index could not be found."); checkState(indexInfos.size() == 1, "Multiple indexes were found for the specified tree, please specify the attribute."); IndexInfo indexInfo = indexInfos.get(0); boolean dropped = indexDatabase().dropIndex(indexInfo); checkState(dropped, "Unable to drop the index from the database, it may have already been dropped."); return indexInfo; } }
/** * Performs the operation. * * @return The {@link IndexInfo} of the dropped index. */ @Override protected IndexInfo _call() { checkArgument(treeRefSpec != null, "Tree ref spec not provided."); final NodeRef typeTreeRef = IndexUtils.resolveTypeTreeRef(context(), treeRefSpec); checkArgument(typeTreeRef != null, "Can't find feature tree '%s'", treeRefSpec); String treeName = typeTreeRef.path(); List<IndexInfo> indexInfos = IndexUtils.resolveIndexInfo(indexDatabase(), treeName, attributeName); checkState(!indexInfos.isEmpty(), "A matching index could not be found."); checkState(indexInfos.size() == 1, "Multiple indexes were found for the specified tree, please specify the attribute."); IndexInfo indexInfo = indexInfos.get(0); boolean dropped = indexDatabase().dropIndex(indexInfo); checkState(dropped, "Unable to drop the index from the database, it may have already been dropped."); return indexInfo; } }