ServiceContext context) throws Exception {
if(Log.isDebugEnabled(Geonet.OAI_HARVESTER))
Log.debug(Geonet.OAI_HARVESTER,"OAI " +this.getClass().getSimpleName()+ " execute: ");
TokenListRequest req = (TokenListRequest) request;
//UserSession session = context.getUserSession();
SearchResult result;
//String token = req.getResumptionToken();
String strToken = req.getResumptionToken();
GeonetworkResumptionToken token = null;
int pos = 0;
if ( strToken == null )
{
if(Log.isDebugEnabled(Geonet.OAI_HARVESTER))
Log.debug(Geonet.OAI_HARVESTER,"OAI " +this.getClass().getSimpleName()+ " : new request (no resumptionToken)");
Element params = new Element("request");
ISODate from = req.getFrom();
ISODate until = req.getUntil();
String set = req.getSet();
String prefix = req.getMetadataPrefix();
if (from != null)
{
String sFrom = from.isDateOnly() ? from.getDateAsString() : from.toString();
params.addContent(new Element(getDateFrom()).setText(sFrom));