Examples of NoRecordsMatchException


Examples of org.fao.oaipmh.exceptions.NoRecordsMatchException

        }
        if (schemas.size() == 0) result.setIds(new ArrayList<Integer>());
      }

      if (result.getIds().size() == 0)
        throw new NoRecordsMatchException("No results");

      // we only need a new token if the result set is big enough
      if (result.getIds().size() > Lib.MAX_RECORDS ) {
        token = new GeonetworkResumptionToken(req,result);
        cache.storeResumptionToken(token);
      }
     
    }
    else
    {
      //result = (SearchResult) session.getProperty(Lib.SESSION_OBJECT);
      token = cache.getResumptionToken( GeonetworkResumptionToken.buildKey(req)  );
            if(Log.isDebugEnabled(Geonet.OAI_HARVESTER))
                Log.debug(Geonet.OAI_HARVESTER,"OAI ListRecords : using ResumptionToken :"+GeonetworkResumptionToken.buildKey(req));
     
      if (token  == null)
        throw new BadResumptionTokenException("No session for token : "+ GeonetworkResumptionToken.buildKey(req));

      result = token.getRes();
     
      //pos = result.parseToken(token);
      pos = GeonetworkResumptionToken.getPos(req);
    }

    ListResponse res = processRequest(req,pos,result,context);
    pos = pos + res.getSize();
   
    if (token == null && res.getSize() == 0)
      throw new NoRecordsMatchException("No results");
   
    //result.setupToken(res, pos);
    if (token != null) token.setupToken(pos);
    res.setResumptionToken(token);
View Full Code Here

Examples of org.fcrepo.oai.NoRecordsMatchException

        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() == 0) {
            throw new NoRecordsMatchException("No records match the given criteria.");
        }
        ArrayList<Object> ret = new ArrayList<Object>();
        for (int i = 0; i < l.size(); i++) {
            ObjectFields f = (ObjectFields) l.get(i);
            ret.add(new SimpleRecord(getHeader(f), getDCXML(f), s_emptySet));
View Full Code Here

Examples of org.fcrepo.oai.NoRecordsMatchException

        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() == 0) {
            throw new NoRecordsMatchException("No records match the given criteria.");
        }
        ArrayList<Object> ret = new ArrayList<Object>();
        for (int i = 0; i < l.size(); i++) {
            ObjectFields f = (ObjectFields) l.get(i);
            ret.add(new SimpleRecord(getHeader(f), getDCXML(f), s_emptySet));
View Full Code Here

Examples of org.fcrepo.oai.NoRecordsMatchException

        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() == 0) {
            throw new NoRecordsMatchException("No records match the given criteria.");
        }
        ArrayList<Object> ret = new ArrayList<Object>();
        for (int i = 0; i < l.size(); i++) {
            ObjectFields f = (ObjectFields) l.get(i);
            String identifier =
View Full Code Here

Examples of org.fcrepo.oai.NoRecordsMatchException

        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() == 0) {
            throw new NoRecordsMatchException("No records match the given criteria.");
        }
        ArrayList<Object> ret = new ArrayList<Object>();
        for (int i = 0; i < l.size(); i++) {
            ObjectFields f = (ObjectFields) l.get(i);
            String identifier =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.