public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
if (!context.getUser().hasDbaRole())
throw new XPathException(this, "user has to be a member of the dba group to call " +
"the optimize function. Calling user was " + context.getUser().getName());
RangeIndexWorker index = (RangeIndexWorker) context.getBroker().getIndexController().getWorkerByIndexId(RangeIndex.ID);
index.optimize();
return Sequence.EMPTY_SEQUENCE;
}
}