public FieldSearchResult findObjects(String[] resultFields, int maxResults, FieldSearchQuery query) throws ServerException { return m_wrappedFieldSearch .findObjects(resultFields, maxResults, query); }
public FieldSearchResult resumeFindObjects(String sessionToken) throws ServerException { return m_wrappedFieldSearch.resumeFindObjects(sessionToken); }
public void update(DOReader reader) throws ServerException { m_wrappedFieldSearch.update(reader); }
public FieldSearchResult resumeFindObjects(String sessionToken) throws UnrecognizedFieldException, ObjectIntegrityException, RepositoryConfigurationException, StreamIOException, ServerException, UnknownSessionTokenException { closeAndForgetOldResults(); FieldSearchResultSQLImpl result = m_currentResults .remove(sessionToken); if (result == null) { throw new UnknownSessionTokenException("Session is expired " + "or never existed."); } return stepAndRemember(result); }
private int[] countResults(FieldSearchQuery query, int maxResultsPerPage) throws Exception { int pageCount = 0; int resultCount = 0; FieldSearchResult page = m_impl.findObjects(new String[] { "pid" }, maxResultsPerPage, query); while (page != null) { pageCount++; resultCount += page.objectFieldsList().size(); if (page.getToken() != null) { m_impl.resumeFindObjects(page.getToken()); } else { page = null; } } return new int[] { pageCount, resultCount }; }
private void updateRecord(ObjectData objectData, boolean longFields) throws ServerException { // Create a DC datastream if appropriate. DatastreamXMLMetadata dcmd = null; if (objectData.getDcPayload() != null) { dcmd = new DatastreamXMLMetadata(); dcmd.DatastreamID = "DC"; dcmd.DSCreateDT = objectData.getDcModifiedDate(); dcmd.xmlContent = objectData.getDcPayload().getBytes(); } // Create the object and populate it. BasicDigitalObject theObject = new BasicDigitalObject(); theObject.setPid(objectData.getPid()); theObject.setLabel(objectData.getLabel()); theObject.setState(objectData.getState()); theObject.setOwnerId(objectData.getOwnerId()); theObject.setCreateDate(objectData.getCreateDate()); theObject.setLastModDate(objectData.getLastModDate()); if (dcmd != null) { theObject.addDatastreamVersion(dcmd, false); } // Create the test instance. FieldSearchSQLImpl fssi = new FieldSearchSQLImpl(this.connectionPool, this.mockRepositoryReader, 50, 50, longFields); // And do the update. fssi.update(new MockDOReader(theObject)); }
private void init(int maxResults, int maxSecondsPerSession, boolean indexDCFields) throws Exception { m_repo = new MockRepositoryReader(); m_impl = new FieldSearchSQLImpl(cPool, m_repo, maxResults, maxSecondsPerSession, indexDCFields); }
public boolean delete(String pid) throws ServerException { return m_wrappedFieldSearch.delete(pid); }
throw new ModuleInitializationException( "Error while attempting to check for and create non-existing table(s): " + e.getClass().getName() + ": " + e.getMessage(), getRole(), e);
DCFields dc = new DCFields(in); dbRowValues[7] = getDbValue(dc.titles()); dbRowValues[8] = getDbValue(dc.creators()); dbRowValues[9] = getDbValue(dc.subjects()); dbRowValues[10] = getDbValue(dc.descriptions()); dbRowValues[11] = getDbValue(dc.publishers()); dbRowValues[12] = getDbValue(dc.contributors()); dbRowValues[13] = getDbValue(dc.dates()); dbRowValues[14] = getDbValue(dc.types()); dbRowValues[15] = getDbValue(dc.formats()); dbRowValues[16] = getDbValue(dc.identifiers()); dbRowValues[17] = getDbValue(dc.sources()); dbRowValues[18] = getDbValue(dc.languages()); dbRowValues[19] = getDbValue(dc.relations()); dbRowValues[20] = getDbValue(dc.coverages()); dbRowValues[21] = getDbValue(dc.rights()); logger.debug("Formulating SQL and inserting/updating WITH DC..."); SQLUtility.replaceInto(conn,
public FieldSearchResult resumeFindObjects(String sessionToken) throws UnrecognizedFieldException, ObjectIntegrityException, RepositoryConfigurationException, StreamIOException, ServerException, UnknownSessionTokenException { closeAndForgetOldResults(); FieldSearchResultSQLImpl result = m_currentResults .remove(sessionToken); if (result == null) { throw new UnknownSessionTokenException("Session is expired " + "or never existed."); } return stepAndRemember(result); }
new FieldSearchSQLImpl(cPool, doManager, maxResults,
public boolean delete(String pid) throws ServerException { return m_wrappedFieldSearch.delete(pid); }
throw new ModuleInitializationException( "Error while attempting to check for and create non-existing table(s): " + e.getClass().getName() + ": " + e.getMessage(), getRole(), e);
DCFields dc = new DCFields(in); dbRowValues[7] = getDbValue(dc.titles()); dbRowValues[8] = getDbValue(dc.creators()); dbRowValues[9] = getDbValue(dc.subjects()); dbRowValues[10] = getDbValue(dc.descriptions()); dbRowValues[11] = getDbValue(dc.publishers()); dbRowValues[12] = getDbValue(dc.contributors()); dbRowValues[13] = getDbValue(dc.dates()); dbRowValues[14] = getDbValue(dc.types()); dbRowValues[15] = getDbValue(dc.formats()); dbRowValues[16] = getDbValue(dc.identifiers()); dbRowValues[17] = getDbValue(dc.sources()); dbRowValues[18] = getDbValue(dc.languages()); dbRowValues[19] = getDbValue(dc.relations()); dbRowValues[20] = getDbValue(dc.coverages()); dbRowValues[21] = getDbValue(dc.rights()); logger.debug("Formulating SQL and inserting/updating WITH DC..."); SQLUtility.replaceInto(conn,
public FieldSearchResult findObjects(String[] resultFields, int maxResults, FieldSearchQuery query) throws UnrecognizedFieldException, ObjectIntegrityException, RepositoryConfigurationException, StreamIOException, ServerException, StorageDeviceException { closeAndForgetOldResults(); int actualMax = maxResults; if (m_maxResults < maxResults) { actualMax = m_maxResults; } try { return stepAndRemember(new FieldSearchResultSQLImpl(m_cPool, m_repoReader, resultFields, actualMax, m_maxSecondsPerSession, query)); } catch (SQLException sqle) { throw new StorageDeviceException("Error querying sql db: " + sqle.getMessage(), sqle); } }
public void update(DOReader reader) throws ServerException { m_wrappedFieldSearch.update(reader); }
new FieldSearchSQLImpl(cPool, doManager, maxResults,
public FieldSearchResult resumeFindObjects(String sessionToken) throws ServerException { return m_wrappedFieldSearch.resumeFindObjects(sessionToken); }
public FieldSearchResult findObjects(String[] resultFields, int maxResults, FieldSearchQuery query) throws ServerException { return m_wrappedFieldSearch .findObjects(resultFields, maxResults, query); }