From 96595050eb18cbd022107d08c3f25ff37e0bee9a Mon Sep 17 00:00:00 2001 From: ppodsednik Date: Mon, 16 Dec 2024 11:39:47 +0100 Subject: [PATCH] Refactor: make Fedora packages more clear --- .../kramerius/fedora/impl/CDKRepoModule.java | 2 +- .../impl/FedoraAccessProxyAkubraImpl.java | 7 +- .../fedora/impl/IngestingThread.java | 4 +- .../impl/KrameriusRepositoryApiProxyImpl.java | 4 +- .../kramerius/fedora/impl/OnDemandIngest.java | 4 +- .../migrations/FromK5Instance.java | 6 +- .../replications/StartIndexerPhase.java | 10 - .../cz/incad/kramerius/DeleteTreeProcess.java | 9 +- .../cz/incad/kramerius/LicenseHelper.java | 6 +- .../cz/incad/kramerius/SetLicenseProcess.java | 8 +- .../kramerius/importmets/MetsConvertor.java | 8 +- .../src/main/java/org/kramerius/Convert.java | 8 +- .../src/main/java/org/kramerius/Download.java | 6 +- .../src/main/java/org/kramerius/Import.java | 20 +- .../java/org/kramerius/ImportDuplicator.java | 8 +- .../kramerius/consistency/Consistency.java | 6 +- .../convert/ParametrizedConvert.java | 2 +- .../kramerius/replications/SecondPhase.java | 8 +- .../kramerius/replications/ThirdPhase.java | 5 +- .../consistency/ConsistencyTest.java | 8 +- .../fedora/impl/ImportDataPrepare.java | 2 +- .../kramerius/indexer/ExtendedFields.java | 2 +- .../kramerius/indexer/FedoraOperations.java | 4 +- .../kramerius/indexer/SolrOperations.java | 7 +- .../kramerius/indexer/dnnt/DnntSingleton.java | 2 +- .../indexer/fa/FedoraAccessBridge.java | 2 +- .../indexer/guice/GuiceModelInjector.java | 2 +- .../incad/migration/AkubraMigrationParts.java | 6 +- .../incad/migration/LegacyMigrationParts.java | 7 +- .../main/java/cz/incad/migration/Main.java | 2 +- .../java/cz/cas/lib/knav/ApplyMWUtils.java | 4 +- .../java/cz/cas/lib/knav/ApplyMovingWall.java | 6 +- .../lib/knav/ParametrizedApplyMovingWall.java | 6 +- .../cas/lib/knav/ProcessCriteriumContext.java | 2 +- .../services/SolrMigrationThreadsTest.java | 2 +- .../kramerius/rest/api/iiif/IiifAPI.java | 2 +- .../k5/client/pdf/AbstractPDFResource.java | 2 +- .../api/k5/client/utils/BiblioModsUtils.java | 2 +- .../client/utils/RELSEXTDecoratorUtils.java | 2 +- .../api/replication/ReplicationsResource.java | 2 +- .../kramerius/rest/apiNew/ApiResource.java | 2 +- .../rest/apiNew/admin/v70/ItemsResource.java | 4 +- .../v70/collections/CollectionsResource.java | 2 +- .../apiNew/admin/v70/collections/CutItem.java | 2 +- .../cdk/v70/resources/CDKIIIFResource.java | 2 +- .../cdk/v70/resources/CDKItemResource.java | 4 +- .../cdk/v70/resources/CDKZoomifyResource.java | 2 +- .../cdk/v70/resources/SOLRResource.java | 2 +- .../rest/apiNew/client/v70/ItemsResource.java | 2 +- .../rest/apiNew/client/v70/ZoomifyHelper.java | 2 +- .../client/v70/pdf/AbstractPDFResource.java | 1 + .../redirection/item/ProxyItemHandler.java | 9 - .../redirection/item/V5RedirectHandler.java | 2 +- .../v70/utils/RightRuntimeInformations.java | 6 +- .../kramerius/rest/oai/MetadataExport.java | 2 +- .../incad/kramerius/rest/oai/OAIEndpoint.java | 2 +- .../incad/kramerius/rest/oai/OAIRecord.java | 2 +- .../cz/incad/kramerius/rest/oai/OAIVerb.java | 2 +- .../incad/kramerius/rest/utils/IIIFUtils.java | 2 +- .../kramerius/fedora/impl/DataPrepare.java | 2 +- .../redirection/V5RedirectHandlerTest.java | 20 - .../kramerius/adapters/ProcessingIndex.java | 7 +- .../kramerius/adapters/RepositoryAccess.java | 4 +- .../impl/ProcessingIndexImplAbstract.java | 2 +- .../impl/RepositoryAccessImplAbstract.java | 4 +- ...ProcessingIndexImplByKrameriusNewApis.java | 4 +- ...RepositoryAccessImplByKrameriusDirect.java | 2 +- ...ProcessingIndexImplByKrameriusOldApis.java | 2 +- .../KrameriusRepositoryFascade.java | 2 +- .../java/cz/kramerius/searchIndex/Main.java | 2 +- .../NewIndexerProcessIndexModel.java | 6 +- .../NewIndexerProcessIndexObject.java | 6 +- .../searchIndex/SearchIndexModule.java | 2 +- .../indexer/nodes/RepositoryNodeManager.java | 2 +- .../incad/Kramerius/AbstractImageServlet.java | 2 +- .../incad/Kramerius/ActionAllowedServlet.java | 2 +- .../cz/incad/Kramerius/FeedbackServlet.java | 2 +- .../incad/Kramerius/GeneratePDFServlet.java | 2 +- .../cz/incad/Kramerius/GetFirstPageThumb.java | 2 +- .../cz/incad/Kramerius/MimeTypeServlet.java | 2 +- .../java/cz/incad/Kramerius/PrintQueue.java | 2 +- .../Kramerius/PrivateContentsServlet.java | 2 +- .../cz/incad/Kramerius/ProfilesServlet.java | 2 +- .../Kramerius/ProxyDatastreamsServlet.java | 2 +- .../Kramerius/SmallThumbnailImageServlet.java | 2 +- .../cz/incad/Kramerius/StartupServlet.java | 4 +- .../audio/servlet/AudioTracksServlet.java | 2 +- .../Kramerius/backend/guice/BaseModule.java | 5 +- .../backend/guice/GuiceConfigBean.java | 2 +- .../incad/Kramerius/imaging/IiifServlet.java | 2 +- .../imaging/ImageStreamsServlet.java | 2 +- .../Kramerius/imaging/PrintPDFServlet.java | 2 +- .../Kramerius/oai/DrKrameriusV4Writer.java | 2 +- .../cz/incad/Kramerius/oai/OaiServlet.java | 2 +- .../Kramerius/security/ServletCommand.java | 2 +- search/src/java/cz/incad/utils/XslHelper.java | 2 +- search/web/WEB-INF/web.xml | 4 +- .../urlMapping/CachingFedoraUrlManager.java | 2 +- .../document/impl/DocumentServiceImpl.java | 2 +- .../document/model/utils/DCContentUtils.java | 2 +- .../cz/incad/kramerius/fedora/RepoModule.java | 2 +- .../{ => fedora}/RepositoryAccess.java | 9 +- .../{ => impl}/AbstractRepositoryAccess.java | 16 +- .../impl/CachedRepositoryAccessImpl.java} | 13 +- .../fedora/impl/RepositoryAccessImpl.java | 239 ++++----- .../incad/kramerius/fedora/it/ITSupport.java | 0 .../om/{ => repository}/AkubraRepository.java | 65 +-- .../NotFoundInRepositoryException.java | 2 +- .../RepositoryDatastream.java | 2 +- .../{ => repository}/RepositoryException.java | 2 +- .../om/{ => repository}/RepositoryObject.java | 3 +- .../impl/AkubraDOManager.java | 3 +- .../impl/AkubraDatastream.java | 20 +- .../{ => repository}/impl/AkubraObject.java | 77 ++- .../impl/AkubraRepositoryImpl.java | 140 ++--- .../impl/HazelcastServerNode.java | 2 +- .../impl/RELSEXTSPARQLBuilder.java | 4 +- .../impl/RELSEXTSPARQLBuilderImpl.java | 4 +- .../impl/RELSEXTSPARQLBuilderListener.java | 4 +- .../om/{ => repository}/impl/res/foxml.stg | 0 .../impl/res/relsextsparql.stg | 0 .../om}/resourceindex/IResourceIndex.java | 5 +- .../resourceindex/ProcessingIndexCheck.java | 8 +- .../resourceindex/ProcessingIndexFeeder.java | 5 +- .../ProcessingIndexFeeder.java.bak | 0 .../resourceindex/ProcessingIndexRebuild.java | 496 +++++++++--------- .../ProcessingIndexRebuildFromFoxmlByPid.java | 400 +++++++------- .../resourceindex/ResourceIndexException.java | 2 +- .../resourceindex/ResourceIndexModule.java | 2 +- .../resourceindex/ResourceIndexService.java | 2 +- .../om}/resourceindex/SPARQLUtils.java | 2 +- .../om}/resourceindex/SolrResourceIndex.java | 2 +- .../om}/resourceindex/res/resource.xml | 0 .../{om/impl => utils}/AkubraUtils.java | 4 +- .../fedora/{ => utils}/EhCacheProvider.java | 2 +- .../kramerius/fedora/utils/Fedora4Utils.java | 4 +- .../fedora/utils/FedoraURLConnection.java | 2 +- .../incad/kramerius/fedora/utils/Handler.java | 2 +- .../imaging/impl/DeepZoomFlagServiceImpl.java | 8 +- .../impl/Fedora3StreamsDiscStructure.java | 2 +- .../impl/FileSystemCacheServiceImpl.java | 2 +- .../imaging/impl/TileSupportImpl.java | 2 +- .../lp/DeleteGeneratedDeepZoomCache.java | 2 +- .../imaging/lp/GenerateThumbnail.java | 8 +- .../lp/guice/GenerateDeepZoomCacheModule.java | 2 +- .../kramerius/impl/MostDesirableImpl.java | 2 +- .../pdf/commands/render/RenderPDF.java | 2 +- .../pdf/impl/FirstPagePDFServiceImpl.java | 2 +- .../pdf/impl/GeneratePDFServiceImpl.java | 1 + .../kramerius/pdf/impl/ImageFetcher.java | 2 +- .../cz/incad/kramerius/pdf/impl/STUtils.java | 2 +- .../pdf/impl/SimplePDFServiceImpl.java | 2 +- .../pdf/utils/FedoraDescribeUtils.java | 2 +- .../incad/kramerius/pdf/utils/ModsUtils.java | 2 +- .../kramerius/pdf/utils/TitlesMapUtils.java | 2 +- .../kramerius/pdf/utils/TitlesUtils.java | 2 +- .../printing/impl/PrintingServiceImpl.java | 2 +- .../processes/RemovePolicyProcess.java | 6 +- .../kramerius/processes/SetPolicyProcess.java | 6 +- .../processes/starter/ProcessStarter.java | 9 +- .../kramerius/relation/RelationUtils.java | 2 +- .../relation/impl/RelationServiceImpl.java | 5 +- .../repository/ExtractStructureHelper.java | 2 +- .../KrameriusRepositoryAccessAdapter.java | 6 +- .../security/RightCriteriumContext.java | 2 +- .../security/SecuredFedoraAccessImpl.java | 9 +- .../RightCriteriumContextFactoryImpl.java | 2 +- .../impl/RightParamEvaluatingContextImpl.java | 2 +- .../impl/criteria/BenevolentModelFilter.java | 2 +- .../impl/criteria/CoverAndContentFilter.java | 2 +- .../criteria/utils/CriteriaRELSEXTUtils.java | 2 +- .../kramerius/service/DeleteService.java | 6 +- .../service/impl/DeleteServiceImpl.java | 12 +- .../service/impl/ExportServiceImpl.java | 5 +- .../service/impl/METSServiceImpl.java | 2 +- .../service/impl/PolicyServiceImpl.java | 12 +- .../service/impl/ReplicationServiceImpl.java | 2 +- .../service/impl/SortingServiceImpl.java | 2 +- .../DatabaseStatisticsAccessLogImpl.java | 1 + .../dnnt/DNNTStatisticsAccessLogImpl.java | 1 + .../solr/SolrStatisticsAccessLogImpl.java | 2 +- .../statistics/impl/NKPLogReport.java | 2 +- .../incad/kramerius/utils/RelsExtHelper.java | 2 +- .../utils/imgs/KrameriusImageSupport.java | 2 +- .../incad/kramerius/ObjectPidsPathTest.java | 1 + .../document/DocumentServiceTest.java | 2 +- .../document/DocumentServiceTest2.java | 1 - .../document/_DocumentServiceModule.java | 2 +- .../document/_DocumentServiceTestPrepare.java | 4 +- .../model/utils/DCContentUtilsTest.java | 2 +- .../kramerius/fedora/impl/DataPrepare.java | 2 +- .../fedora/impl/FedoraAccess4xImplTest.java | 4 +- .../om/RELSEXTSPARQLBuilderImplTest.java | 3 +- .../om/impl/AkubraUtilsDateFormatTest.java | 1 + .../imaging/DeepZoomTileSupportTest.java | 2 +- .../impl/FileSystemCacheServiceImplTest.java | 2 +- .../imaging/impl/TileSupportImplTest.java | 2 +- .../pdf/impl/FirstPagePDFServiceImplTest.java | 6 +- .../pdf/utils/SimpleFedoraAccessModule.java | 2 +- .../relation/RelationGuiceModule.java | 2 +- ...cessingIndexRebuildFromFoxmlByPidTest.java | 1 + .../MockRightCriteriumContextGuiceMudule.java | 2 +- .../criteria/CoverAndContentFilterTest.java | 4 +- .../security/impl/criteria/WindowTest.java | 4 +- .../resourceindex/SPARQLUtilsTest.java | 1 + 205 files changed, 1032 insertions(+), 1103 deletions(-) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora}/RepositoryAccess.java (99%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/{ => impl}/AbstractRepositoryAccess.java (99%) rename shared/common/src/main/java/cz/incad/kramerius/{impl/CachedFedoraAccessImpl.java => fedora/impl/CachedRepositoryAccessImpl.java} (96%) delete mode 100644 shared/common/src/main/java/cz/incad/kramerius/fedora/it/ITSupport.java rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/AkubraRepository.java (70%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/NotFoundInRepositoryException.java (93%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/RepositoryDatastream.java (96%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/RepositoryException.java (97%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/RepositoryObject.java (98%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/AkubraDOManager.java (99%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/AkubraDatastream.java (74%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/AkubraObject.java (95%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/AkubraRepositoryImpl.java (96%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/HazelcastServerNode.java (97%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/RELSEXTSPARQLBuilder.java (85%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/RELSEXTSPARQLBuilderImpl.java (97%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/RELSEXTSPARQLBuilderListener.java (77%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/res/foxml.stg (100%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/om/{ => repository}/impl/res/relsextsparql.stg (100%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/IResourceIndex.java (95%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ProcessingIndexCheck.java (90%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ProcessingIndexFeeder.java (98%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ProcessingIndexFeeder.java.bak (100%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ProcessingIndexRebuild.java (94%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java (94%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ResourceIndexException.java (91%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ResourceIndexModule.java (87%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/ResourceIndexService.java (95%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/SPARQLUtils.java (96%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/SolrResourceIndex.java (99%) rename shared/common/src/main/java/cz/incad/kramerius/{ => fedora/om}/resourceindex/res/resource.xml (100%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/{om/impl => utils}/AkubraUtils.java (98%) rename shared/common/src/main/java/cz/incad/kramerius/fedora/{ => utils}/EhCacheProvider.java (92%) diff --git a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/CDKRepoModule.java b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/CDKRepoModule.java index cbf89a561f..8f2aa6ef93 100644 --- a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/CDKRepoModule.java +++ b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/CDKRepoModule.java @@ -3,7 +3,7 @@ import com.google.inject.AbstractModule; import com.google.inject.Scopes; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class CDKRepoModule extends AbstractModule { diff --git a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/FedoraAccessProxyAkubraImpl.java b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/FedoraAccessProxyAkubraImpl.java index fefb3b4419..96784f64cf 100644 --- a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/FedoraAccessProxyAkubraImpl.java +++ b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/FedoraAccessProxyAkubraImpl.java @@ -4,12 +4,11 @@ import com.google.inject.Provider; import com.google.inject.name.Named; import com.sun.jersey.api.client.Client; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.StreamHeadersObserver; -import cz.incad.kramerius.fedora.AbstractRepositoryAccess; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import cz.incad.kramerius.utils.pid.LexerException; import cz.incad.kramerius.virtualcollections.CollectionException; diff --git a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/IngestingThread.java b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/IngestingThread.java index ac36c7cd18..fbd41ffdd0 100644 --- a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/IngestingThread.java +++ b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/IngestingThread.java @@ -4,8 +4,8 @@ import com.sun.jersey.api.client.UniformInterfaceException; import com.sun.jersey.api.client.WebResource; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.fedora.utils.CDKUtils; import cz.incad.kramerius.utils.BasicAuthenticationClientFilter; import cz.incad.kramerius.utils.StringUtils; diff --git a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/KrameriusRepositoryApiProxyImpl.java b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/KrameriusRepositoryApiProxyImpl.java index 4b817d70d4..cff18e0bed 100644 --- a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/KrameriusRepositoryApiProxyImpl.java +++ b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/KrameriusRepositoryApiProxyImpl.java @@ -1,8 +1,8 @@ package cz.incad.kramerius.fedora.impl; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.service.MigrateSolrIndexException; import cz.incad.kramerius.services.cdk.K7SearchIndexChildrenSupport; import cz.incad.kramerius.utils.java.Pair; diff --git a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/OnDemandIngest.java b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/OnDemandIngest.java index ff6f2641d8..90e8d8f93d 100644 --- a/bridge/src/main/java/cz/incad/kramerius/fedora/impl/OnDemandIngest.java +++ b/bridge/src/main/java/cz/incad/kramerius/fedora/impl/OnDemandIngest.java @@ -7,8 +7,8 @@ import com.sun.jersey.api.client.WebResource; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.fedora.utils.CDKUtils; import cz.incad.kramerius.utils.BasicAuthenticationClientFilter; import cz.incad.kramerius.utils.StringUtils; diff --git a/processes/collections-backup/src/main/java/cz/inovatika/collections/migrations/FromK5Instance.java b/processes/collections-backup/src/main/java/cz/inovatika/collections/migrations/FromK5Instance.java index ce0e627b48..20944f7489 100644 --- a/processes/collections-backup/src/main/java/cz/inovatika/collections/migrations/FromK5Instance.java +++ b/processes/collections-backup/src/main/java/cz/inovatika/collections/migrations/FromK5Instance.java @@ -57,11 +57,11 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.SortingService; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/processes/data-migration/src/main/java/org/kramerius/replications/StartIndexerPhase.java b/processes/data-migration/src/main/java/org/kramerius/replications/StartIndexerPhase.java index a2351eae8c..0fa689c692 100644 --- a/processes/data-migration/src/main/java/org/kramerius/replications/StartIndexerPhase.java +++ b/processes/data-migration/src/main/java/org/kramerius/replications/StartIndexerPhase.java @@ -1,21 +1,11 @@ package org.kramerius.replications; -import com.google.inject.Guice; -import com.google.inject.Injector; -import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.impl.IndexerProcessStarter; -import cz.incad.kramerius.solr.SolrModule; -import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.conf.KConfiguration; -import org.apache.solr.client.solrj.SolrServerException; import java.io.File; -import java.io.IOException; import java.util.Arrays; import java.util.List; -import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; diff --git a/processes/dnntflag/src/main/java/cz/incad/kramerius/DeleteTreeProcess.java b/processes/dnntflag/src/main/java/cz/incad/kramerius/DeleteTreeProcess.java index 57f0c9d3cc..1812a5fdec 100644 --- a/processes/dnntflag/src/main/java/cz/incad/kramerius/DeleteTreeProcess.java +++ b/processes/dnntflag/src/main/java/cz/incad/kramerius/DeleteTreeProcess.java @@ -7,18 +7,19 @@ import cz.incad.kramerius.ProcessHelper.PidsOfDescendantsProducer; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; import cz.incad.kramerius.processes.WarningException; import cz.incad.kramerius.processes.starter.ProcessStarter; import cz.incad.kramerius.processes.utils.ProcessUtils; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.incad.kramerius.utils.Dom4jUtils; import cz.incad.kramerius.utils.RelsExtHelper; import cz.incad.kramerius.utils.conf.KConfiguration; import cz.kramerius.adapters.ProcessingIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.kramerius.searchIndex.indexer.SolrConfig; diff --git a/processes/dnntflag/src/main/java/cz/incad/kramerius/LicenseHelper.java b/processes/dnntflag/src/main/java/cz/incad/kramerius/LicenseHelper.java index 625401eb88..24ce7ea252 100644 --- a/processes/dnntflag/src/main/java/cz/incad/kramerius/LicenseHelper.java +++ b/processes/dnntflag/src/main/java/cz/incad/kramerius/LicenseHelper.java @@ -1,8 +1,8 @@ package cz.incad.kramerius; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.incad.kramerius.utils.Dom4jUtils; import cz.kramerius.adapters.ProcessingIndex; import org.dom4j.Document; diff --git a/processes/dnntflag/src/main/java/cz/incad/kramerius/SetLicenseProcess.java b/processes/dnntflag/src/main/java/cz/incad/kramerius/SetLicenseProcess.java index 8dc0b98531..7c9977b9bb 100644 --- a/processes/dnntflag/src/main/java/cz/incad/kramerius/SetLicenseProcess.java +++ b/processes/dnntflag/src/main/java/cz/incad/kramerius/SetLicenseProcess.java @@ -5,14 +5,14 @@ import com.google.inject.Key; import cz.incad.kramerius.ProcessHelper.PidsOfDescendantsProducer; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; import cz.incad.kramerius.processes.new_api.ProcessScheduler; import cz.incad.kramerius.processes.starter.ProcessStarter; import cz.incad.kramerius.processes.utils.ProcessUtils; -import cz.incad.kramerius.resourceindex.ResourceIndexException; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.Dom4jUtils; diff --git a/processes/import-mets/src/main/java/org/kramerius/importmets/MetsConvertor.java b/processes/import-mets/src/main/java/org/kramerius/importmets/MetsConvertor.java index a79bb5a00b..addb710ef0 100755 --- a/processes/import-mets/src/main/java/org/kramerius/importmets/MetsConvertor.java +++ b/processes/import-mets/src/main/java/org/kramerius/importmets/MetsConvertor.java @@ -5,12 +5,12 @@ import com.google.inject.Key; import com.google.inject.name.Names; import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.FOXMLAppendLicenseService; import cz.incad.kramerius.service.SortingService; import cz.incad.kramerius.solr.SolrModule; diff --git a/processes/import/src/main/java/org/kramerius/Convert.java b/processes/import/src/main/java/org/kramerius/Convert.java index c3bc9be731..99f927c94d 100644 --- a/processes/import/src/main/java/org/kramerius/Convert.java +++ b/processes/import/src/main/java/org/kramerius/Convert.java @@ -9,11 +9,11 @@ import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.SortingService; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/processes/import/src/main/java/org/kramerius/Download.java b/processes/import/src/main/java/org/kramerius/Download.java index 99a2dc12fc..a605eae891 100644 --- a/processes/import/src/main/java/org/kramerius/Download.java +++ b/processes/import/src/main/java/org/kramerius/Download.java @@ -7,10 +7,10 @@ import com.qbizm.kramerius.imptool.poc.Main; import com.qbizm.kramerius.imptool.poc.valueobj.ServiceException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.SortingService; import cz.incad.kramerius.service.impl.IndexerProcessStarter; import cz.incad.kramerius.solr.SolrModule; diff --git a/processes/import/src/main/java/org/kramerius/Import.java b/processes/import/src/main/java/org/kramerius/Import.java index f6b30a4b01..e3f89ee21c 100644 --- a/processes/import/src/main/java/org/kramerius/Import.java +++ b/processes/import/src/main/java/org/kramerius/Import.java @@ -9,18 +9,18 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryDatastream; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryObject; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryDatastream; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryObject; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.processes.new_api.ProcessScheduler; import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.FOXMLAppendLicenseService; import cz.incad.kramerius.service.SortingService; import cz.incad.kramerius.solr.SolrModule; @@ -570,7 +570,7 @@ public static void ingest(AkubraRepository repo, InputStream is, String filename Lock writeLock = AkubraDOManager.getWriteLock(pid); try { repo.ingestObject(obj); - } catch (cz.incad.kramerius.fedora.om.RepositoryException sfex) { + } catch (RepositoryException sfex) { if (objectExists(repo, pid)) { if (updateExisting) { log.info("Replacing existing object " + pid); @@ -586,7 +586,7 @@ public static void ingest(AkubraRepository repo, InputStream is, String filename repo.ingestObject(obj); } log.info("Ingested new object " + pid); - } catch (cz.incad.kramerius.fedora.om.RepositoryException rsfex) { + } catch (RepositoryException rsfex) { log.severe("Replace ingest SOAP fault:" + rsfex); throw new RuntimeException(rsfex); } diff --git a/processes/import/src/main/java/org/kramerius/ImportDuplicator.java b/processes/import/src/main/java/org/kramerius/ImportDuplicator.java index 9e57fb995b..eb5f55d632 100644 --- a/processes/import/src/main/java/org/kramerius/ImportDuplicator.java +++ b/processes/import/src/main/java/org/kramerius/ImportDuplicator.java @@ -30,10 +30,10 @@ import com.google.inject.name.Names; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.fedora.utils.Fedora4Utils; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import org.apache.commons.lang3.tuple.Triple; @@ -45,7 +45,7 @@ import com.qbizm.kramerius.imp.jaxb.DigitalObject; import com.qbizm.kramerius.imp.jaxb.XmlContentType; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.conf.KConfiguration; //FIXME: looks like duplicate of org.kramerius.Import, is it still used or can we remove it? Also not correctly indexing Convolutes diff --git a/processes/import/src/main/java/org/kramerius/consistency/Consistency.java b/processes/import/src/main/java/org/kramerius/consistency/Consistency.java index 1dd09bfba1..602abb26f7 100644 --- a/processes/import/src/main/java/org/kramerius/consistency/Consistency.java +++ b/processes/import/src/main/java/org/kramerius/consistency/Consistency.java @@ -26,8 +26,8 @@ import com.google.inject.name.Named; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.*; @@ -38,7 +38,7 @@ import com.google.inject.Inject; import com.google.inject.Injector; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessStackAware; diff --git a/processes/import/src/main/java/org/kramerius/convert/ParametrizedConvert.java b/processes/import/src/main/java/org/kramerius/convert/ParametrizedConvert.java index e9ef96acaa..f00f23cb29 100644 --- a/processes/import/src/main/java/org/kramerius/convert/ParametrizedConvert.java +++ b/processes/import/src/main/java/org/kramerius/convert/ParametrizedConvert.java @@ -22,7 +22,7 @@ import javax.xml.bind.JAXBException; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import org.apache.solr.client.solrj.SolrServerException; import org.kramerius.Convert; import org.xml.sax.SAXException; diff --git a/processes/import/src/main/java/org/kramerius/replications/SecondPhase.java b/processes/import/src/main/java/org/kramerius/replications/SecondPhase.java index 0139bcb9ce..7a4b373c94 100644 --- a/processes/import/src/main/java/org/kramerius/replications/SecondPhase.java +++ b/processes/import/src/main/java/org/kramerius/replications/SecondPhase.java @@ -24,12 +24,12 @@ import com.google.inject.name.Names; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.BasicAuthenticationClientFilter; diff --git a/processes/import/src/main/java/org/kramerius/replications/ThirdPhase.java b/processes/import/src/main/java/org/kramerius/replications/ThirdPhase.java index a91904cce9..d9d4c7da5e 100644 --- a/processes/import/src/main/java/org/kramerius/replications/ThirdPhase.java +++ b/processes/import/src/main/java/org/kramerius/replications/ThirdPhase.java @@ -21,15 +21,14 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.io.InputStream; import java.io.Reader; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/processes/import/src/test/java/org/kramerius/consistency/ConsistencyTest.java b/processes/import/src/test/java/org/kramerius/consistency/ConsistencyTest.java index f091913b5b..a9e200acfb 100644 --- a/processes/import/src/test/java/org/kramerius/consistency/ConsistencyTest.java +++ b/processes/import/src/test/java/org/kramerius/consistency/ConsistencyTest.java @@ -34,9 +34,9 @@ import com.google.inject.Provides; import com.google.inject.name.Named; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import junit.framework.Assert; @@ -53,7 +53,7 @@ import com.google.inject.Guice; import com.google.inject.Injector; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.SolrAccess; diff --git a/processes/import/src/test/java/org/kramerius/fedora/impl/ImportDataPrepare.java b/processes/import/src/test/java/org/kramerius/fedora/impl/ImportDataPrepare.java index f811a9bef7..93ccdd7ab8 100644 --- a/processes/import/src/test/java/org/kramerius/fedora/impl/ImportDataPrepare.java +++ b/processes/import/src/test/java/org/kramerius/fedora/impl/ImportDataPrepare.java @@ -42,7 +42,7 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.utils.IOUtils; import cz.incad.kramerius.utils.XMLUtils; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/ExtendedFields.java b/processes/indexer/src/cz/incad/kramerius/indexer/ExtendedFields.java index 796cf3356c..a0c0dca43e 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/ExtendedFields.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/ExtendedFields.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.indexer; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.indexer.date.BiblioModsDateParser; import cz.incad.kramerius.indexer.date.DateQuintet; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/FedoraOperations.java b/processes/indexer/src/cz/incad/kramerius/indexer/FedoraOperations.java index f9cd663c10..672873b4a4 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/FedoraOperations.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/FedoraOperations.java @@ -3,10 +3,10 @@ import com.google.inject.Key; import com.google.inject.name.Named; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.indexer.guice.GuiceModelInjector; -import cz.incad.kramerius.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.UTFSort; import cz.incad.kramerius.utils.XMLUtils; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/SolrOperations.java b/processes/indexer/src/cz/incad/kramerius/indexer/SolrOperations.java index 4b59d1c628..8423c1cd2e 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/SolrOperations.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/SolrOperations.java @@ -2,9 +2,10 @@ import com.google.inject.name.Named; import cz.incad.kramerius.*; -import cz.incad.kramerius.resourceindex.IResourceIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexException; -import cz.incad.kramerius.resourceindex.ResourceIndexService; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexService; import cz.incad.kramerius.utils.RESTHelper; import cz.incad.kramerius.utils.XMLUtils; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/dnnt/DnntSingleton.java b/processes/indexer/src/cz/incad/kramerius/indexer/dnnt/DnntSingleton.java index 31e40b661e..2996507b86 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/dnnt/DnntSingleton.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/dnnt/DnntSingleton.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.indexer.dnnt; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import org.w3c.dom.Document; import org.w3c.dom.Node; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/fa/FedoraAccessBridge.java b/processes/indexer/src/cz/incad/kramerius/indexer/fa/FedoraAccessBridge.java index 68eda8772e..44a719abfd 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/fa/FedoraAccessBridge.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/fa/FedoraAccessBridge.java @@ -24,7 +24,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.XMLUtils; diff --git a/processes/indexer/src/cz/incad/kramerius/indexer/guice/GuiceModelInjector.java b/processes/indexer/src/cz/incad/kramerius/indexer/guice/GuiceModelInjector.java index 5dcd83d89f..a170ce6d29 100644 --- a/processes/indexer/src/cz/incad/kramerius/indexer/guice/GuiceModelInjector.java +++ b/processes/indexer/src/cz/incad/kramerius/indexer/guice/GuiceModelInjector.java @@ -1,7 +1,7 @@ package cz.incad.kramerius.indexer.guice; import com.google.inject.*; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/processes/migration/src/main/java/cz/incad/migration/AkubraMigrationParts.java b/processes/migration/src/main/java/cz/incad/migration/AkubraMigrationParts.java index 1075d97cb4..1b19efb7e2 100644 --- a/processes/migration/src/main/java/cz/incad/migration/AkubraMigrationParts.java +++ b/processes/migration/src/main/java/cz/incad/migration/AkubraMigrationParts.java @@ -4,8 +4,8 @@ import com.google.inject.Injector; import com.qbizm.kramerius.imp.jaxb.DigitalObject; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.conf.KConfiguration; @@ -24,7 +24,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import static cz.incad.kramerius.resourceindex.ProcessingIndexRebuild.rebuildProcessingIndex; +import static cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexRebuild.rebuildProcessingIndex; import static cz.incad.migration.LegacyMigrationParts.LOG_MESSAGE_ITERATION; public enum AkubraMigrationParts { diff --git a/processes/migration/src/main/java/cz/incad/migration/LegacyMigrationParts.java b/processes/migration/src/main/java/cz/incad/migration/LegacyMigrationParts.java index fe9dc2918c..3ee1d603aa 100644 --- a/processes/migration/src/main/java/cz/incad/migration/LegacyMigrationParts.java +++ b/processes/migration/src/main/java/cz/incad/migration/LegacyMigrationParts.java @@ -3,15 +3,14 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.utils.conf.KConfiguration; import cz.incad.kramerius.utils.database.JDBCQueryTemplate; import org.akubraproject.map.IdMapper; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.io.FileUtils; -import org.apache.solr.client.solrj.SolrServerException; import org.fcrepo.common.Constants; import org.fcrepo.common.FaultException; import org.fcrepo.common.PID; @@ -35,7 +34,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import static cz.incad.kramerius.resourceindex.ProcessingIndexRebuild.rebuildProcessingIndex; +import static cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexRebuild.rebuildProcessingIndex; import static cz.incad.migration.Utils.DOMIMPL; import static cz.incad.migration.Utils.SERIALIZER; diff --git a/processes/migration/src/main/java/cz/incad/migration/Main.java b/processes/migration/src/main/java/cz/incad/migration/Main.java index 7f77b164ab..77c320af4a 100644 --- a/processes/migration/src/main/java/cz/incad/migration/Main.java +++ b/processes/migration/src/main/java/cz/incad/migration/Main.java @@ -1,6 +1,6 @@ package cz.incad.migration; -import cz.incad.kramerius.resourceindex.ProcessingIndexRebuild; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexRebuild; import cz.incad.kramerius.utils.conf.KConfiguration; import cz.kramerius.searchIndex.NewIndexerProcessIndexModel; diff --git a/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMWUtils.java b/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMWUtils.java index cb3c6a1fea..86303eb862 100644 --- a/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMWUtils.java +++ b/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMWUtils.java @@ -10,14 +10,14 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.security.EvaluatingResultState; import org.apache.commons.configuration.Configuration; import org.w3c.dom.Document; import org.w3c.dom.Element; import cz.cas.lib.knav.indexer.CollectPidForIndexing; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.ObjectModelsPath; import cz.incad.kramerius.SolrAccess; diff --git a/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMovingWall.java b/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMovingWall.java index b73ec87d22..0265af37e7 100644 --- a/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMovingWall.java +++ b/processes/mw-process/src/main/java/cz/cas/lib/knav/ApplyMovingWall.java @@ -10,12 +10,12 @@ import com.google.inject.Key; import com.google.inject.name.Names; import cz.cas.lib.knav.indexer.CollectPidForIndexing; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.security.RightCriteriumException; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/processes/mw-process/src/main/java/cz/cas/lib/knav/ParametrizedApplyMovingWall.java b/processes/mw-process/src/main/java/cz/cas/lib/knav/ParametrizedApplyMovingWall.java index 9969686a8c..db7c60b87e 100644 --- a/processes/mw-process/src/main/java/cz/cas/lib/knav/ParametrizedApplyMovingWall.java +++ b/processes/mw-process/src/main/java/cz/cas/lib/knav/ParametrizedApplyMovingWall.java @@ -9,14 +9,14 @@ import com.google.inject.Key; import com.google.inject.name.Names; import cz.cas.lib.knav.indexer.CollectPidForIndexing; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; import cz.incad.kramerius.processes.annotations.ParameterName; import cz.incad.kramerius.processes.annotations.Process; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.security.RightCriteriumException; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/processes/mw-process/src/main/java/cz/cas/lib/knav/ProcessCriteriumContext.java b/processes/mw-process/src/main/java/cz/cas/lib/knav/ProcessCriteriumContext.java index 5dc3fedbc1..d46c737a21 100644 --- a/processes/mw-process/src/main/java/cz/cas/lib/knav/ProcessCriteriumContext.java +++ b/processes/mw-process/src/main/java/cz/cas/lib/knav/ProcessCriteriumContext.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Map; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.security.*; diff --git a/processes/solr-migration/src/test/java/cz/incad/kramerius/services/SolrMigrationThreadsTest.java b/processes/solr-migration/src/test/java/cz/incad/kramerius/services/SolrMigrationThreadsTest.java index f762db4550..f4341e0d81 100644 --- a/processes/solr-migration/src/test/java/cz/incad/kramerius/services/SolrMigrationThreadsTest.java +++ b/processes/solr-migration/src/test/java/cz/incad/kramerius/services/SolrMigrationThreadsTest.java @@ -9,7 +9,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; import org.junit.Assert; import org.junit.Ignore; import org.w3c.dom.Document; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/iiif/IiifAPI.java b/rest/src/main/java/cz/incad/kramerius/rest/api/iiif/IiifAPI.java index 762682c7c8..dcc1468f32 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/api/iiif/IiifAPI.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/api/iiif/IiifAPI.java @@ -1,7 +1,7 @@ package cz.incad.kramerius.rest.api.iiif; import com.fasterxml.jackson.core.JsonProcessingException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.api.exceptions.GenericApplicationException; import cz.incad.kramerius.rest.api.k5.client.SolrMemoization; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/AbstractPDFResource.java b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/AbstractPDFResource.java index 1ff351f54e..c4ca8cb51c 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/AbstractPDFResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/pdf/AbstractPDFResource.java @@ -30,7 +30,7 @@ import com.lowagie.text.Rectangle; import cz.incad.kramerius.AbstractObjectPath; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.MostDesirable; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/BiblioModsUtils.java b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/BiblioModsUtils.java index ba838dd382..cab9de1b59 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/BiblioModsUtils.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/BiblioModsUtils.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.rest.api.k5.client.utils; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import org.w3c.dom.Document; import java.io.IOException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/RELSEXTDecoratorUtils.java b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/RELSEXTDecoratorUtils.java index 6ee60abbcb..2ab3be7a53 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/RELSEXTDecoratorUtils.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/api/k5/client/utils/RELSEXTDecoratorUtils.java @@ -21,7 +21,7 @@ import org.w3c.dom.Document; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; /** * Dedicated for getting RELS_EXT, storing it in the context and return it diff --git a/rest/src/main/java/cz/incad/kramerius/rest/api/replication/ReplicationsResource.java b/rest/src/main/java/cz/incad/kramerius/rest/api/replication/ReplicationsResource.java index 1946aaa5cd..d4d05b8f97 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/api/replication/ReplicationsResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/api/replication/ReplicationsResource.java @@ -57,7 +57,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.model.DCConent; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/ApiResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/ApiResource.java index 3cc4c9468c..1de29d70d8 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/ApiResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/ApiResource.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.rest.apiNew; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.rest.apiNew.exceptions.ApiException; import cz.incad.kramerius.rest.apiNew.exceptions.BadRequestException; import cz.incad.kramerius.rest.apiNew.exceptions.InternalErrorException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/ItemsResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/ItemsResource.java index cc06438e73..b63f84f4f5 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/ItemsResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/ItemsResource.java @@ -2,9 +2,9 @@ import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.repository.utils.Utils; -import cz.incad.kramerius.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; import cz.incad.kramerius.rest.apiNew.exceptions.BadRequestException; import cz.incad.kramerius.rest.apiNew.exceptions.ForbiddenException; import cz.incad.kramerius.rest.apiNew.exceptions.InternalErrorException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CollectionsResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CollectionsResource.java index 9609f63eec..c8f209ece6 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CollectionsResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CollectionsResource.java @@ -2,7 +2,7 @@ import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.rest.apiNew.admin.v70.AdminApiResource; import cz.incad.kramerius.rest.apiNew.admin.v70.collections.Collection.ThumbnailbStateEnum; import cz.incad.kramerius.rest.apiNew.admin.v70.collections.thumbs.ClientIIIFGenerator; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CutItem.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CutItem.java index 5edc6258ee..fa73f4753a 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CutItem.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/admin/v70/collections/CutItem.java @@ -29,7 +29,7 @@ import org.json.JSONException; import org.json.JSONObject; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; public class CutItem { diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKIIIFResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKIIIFResource.java index d852e270c4..aec75d84a0 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKIIIFResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKIIIFResource.java @@ -26,7 +26,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.IIPImagesSupport; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKItemResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKItemResource.java index a3b72c2a01..046a8bfeb0 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKItemResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKItemResource.java @@ -18,9 +18,9 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.rest.api.exceptions.ActionNotAllowed; import cz.incad.kramerius.rest.api.k5.client.item.exceptions.PIDNotFound; import cz.incad.kramerius.rest.api.k5.client.utils.PIDSupport; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKZoomifyResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKZoomifyResource.java index 7438443a77..998b798c99 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKZoomifyResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/CDKZoomifyResource.java @@ -20,7 +20,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.IIPImagesSupport; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/SOLRResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/SOLRResource.java index 67263067c0..b72c231c93 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/SOLRResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/cdk/v70/resources/SOLRResource.java @@ -34,7 +34,7 @@ import com.google.inject.name.Named; import biz.sourcecode.base64Coder.Base64Coder; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.api.replication.exceptions.ObjectNotFound; import cz.incad.kramerius.security.RightsResolver; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ItemsResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ItemsResource.java index d4ce67ea23..5ad1d3b4f8 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ItemsResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ItemsResource.java @@ -7,7 +7,7 @@ import cz.incad.kramerius.audio.AudioFormat; import cz.incad.kramerius.audio.AudioStreamForwardingHelper; import cz.incad.kramerius.audio.AudioStreamId; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.repository.ExtractStructureHelper; import cz.incad.kramerius.rest.apiNew.admin.v70.collections.CutItem; import cz.incad.kramerius.rest.apiNew.client.v70.epub.EPubFileTypes; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ZoomifyHelper.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ZoomifyHelper.java index 4406b47f22..8473405caa 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ZoomifyHelper.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/ZoomifyHelper.java @@ -2,7 +2,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.MostDesirable; import cz.incad.kramerius.imaging.DeepZoomCacheService; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/pdf/AbstractPDFResource.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/pdf/AbstractPDFResource.java index f6a957af60..a651f638ec 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/pdf/AbstractPDFResource.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/pdf/AbstractPDFResource.java @@ -9,6 +9,7 @@ import cz.incad.kramerius.document.DocumentService; import cz.incad.kramerius.document.model.AbstractPage; import cz.incad.kramerius.document.model.PreparedDocument; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.pdf.FirstPagePDFService; import cz.incad.kramerius.pdf.GeneratePDFService; import cz.incad.kramerius.pdf.OutOfRangeException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/ProxyItemHandler.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/ProxyItemHandler.java index aa4101fbbc..f51e144e26 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/ProxyItemHandler.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/ProxyItemHandler.java @@ -1,28 +1,19 @@ package cz.incad.kramerius.rest.apiNew.client.v70.redirection.item; -import java.io.ByteArrayOutputStream; import java.io.InputStream; -import java.util.Date; -import java.util.function.Consumer; import java.util.logging.Logger; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; import javax.ws.rs.core.Response; import com.sun.jersey.api.client.Client; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; import cz.incad.kramerius.rest.apiNew.admin.v70.reharvest.ReharvestManager; import cz.incad.kramerius.rest.apiNew.client.v70.libs.Instances; import cz.incad.kramerius.rest.apiNew.client.v70.redirection.ProxyHandlerException; import cz.incad.kramerius.rest.apiNew.client.v70.redirection.ProxyHandlerSupport; import cz.incad.kramerius.security.User; -import cz.incad.kramerius.utils.BasicAuthenticationClientFilter; import cz.incad.kramerius.utils.conf.KConfiguration; -import cz.incad.kramerius.utils.pid.LexerException; -import cz.incad.kramerius.utils.pid.PIDParser; /** * The class is responsible for handling requests from client diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/V5RedirectHandler.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/V5RedirectHandler.java index 40bd15b5a5..d8bb29473f 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/V5RedirectHandler.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/redirection/item/V5RedirectHandler.java @@ -25,7 +25,7 @@ import com.sun.jersey.api.client.WebResource; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.rest.apiNew.admin.v70.reharvest.ReharvestManager; import cz.incad.kramerius.rest.apiNew.client.v70.libs.Instances; import cz.incad.kramerius.rest.apiNew.client.v70.redirection.ProxyHandlerException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/utils/RightRuntimeInformations.java b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/utils/RightRuntimeInformations.java index 5972d9a74b..71ddbd9e66 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/utils/RightRuntimeInformations.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/apiNew/client/v70/utils/RightRuntimeInformations.java @@ -12,17 +12,13 @@ import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.imaging.ImageStreams; import cz.incad.kramerius.security.Right; import cz.incad.kramerius.security.RightsResolver; import cz.incad.kramerius.security.RightsReturnObject; import cz.incad.kramerius.security.SecuredActions; -import cz.incad.kramerius.security.impl.criteria.Licenses; -import cz.incad.kramerius.security.impl.criteria.LicensesGEOIPFiltered; -import cz.incad.kramerius.security.impl.criteria.LicensesIPFiltered; import cz.incad.kramerius.security.impl.criteria.ReadDNNTLabels; -import cz.incad.kramerius.security.impl.criteria.ReadDNNTLabelsIPFiltered; import cz.incad.kramerius.security.licenses.lock.ExclusiveLockMap; import cz.incad.kramerius.security.utils.LicensesCriteriaList; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/oai/MetadataExport.java b/rest/src/main/java/cz/incad/kramerius/rest/oai/MetadataExport.java index 9b6194f302..8497d541c7 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/oai/MetadataExport.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/oai/MetadataExport.java @@ -33,7 +33,7 @@ import com.google.common.base.Functions; import com.google.common.collect.Lists; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.rest.oai.metadata.DrKrameriusUtils; import cz.incad.kramerius.utils.ApplicationURL; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIEndpoint.java b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIEndpoint.java index a131860f9a..d16e060a96 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIEndpoint.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIEndpoint.java @@ -36,7 +36,7 @@ import com.google.inject.Provider; import com.sun.jersey.api.client.Client; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.rest.apiNew.ConfigManager; import cz.incad.kramerius.rest.apiNew.client.v70.ClientApiResource; import cz.incad.kramerius.rest.oai.exceptions.OAIException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIRecord.java b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIRecord.java index 1128a766c3..8a4cf343f3 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIRecord.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIRecord.java @@ -35,7 +35,7 @@ import org.w3c.dom.Element; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.utils.XMLUtils; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIVerb.java b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIVerb.java index 54628d3b53..df9b482ca6 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIVerb.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/oai/OAIVerb.java @@ -33,7 +33,7 @@ import org.w3c.dom.Element; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.apiNew.ConfigManager; import cz.incad.kramerius.rest.oai.exceptions.OAIException; diff --git a/rest/src/main/java/cz/incad/kramerius/rest/utils/IIIFUtils.java b/rest/src/main/java/cz/incad/kramerius/rest/utils/IIIFUtils.java index fad1f98170..2db4b7cf15 100644 --- a/rest/src/main/java/cz/incad/kramerius/rest/utils/IIIFUtils.java +++ b/rest/src/main/java/cz/incad/kramerius/rest/utils/IIIFUtils.java @@ -26,7 +26,7 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.config.ClientConfig; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.RelsExtHelper; public class IIIFUtils { diff --git a/rest/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java b/rest/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java index c90d50ac2d..0f11e88ad4 100644 --- a/rest/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java +++ b/rest/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java @@ -33,7 +33,7 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.utils.IOUtils; import cz.incad.kramerius.utils.XMLUtils; diff --git a/rest/src/test/java/cz/incad/kramerius/rest/apiNew/client/v60/redirection/V5RedirectHandlerTest.java b/rest/src/test/java/cz/incad/kramerius/rest/apiNew/client/v60/redirection/V5RedirectHandlerTest.java index e56c34bd8b..906516abad 100644 --- a/rest/src/test/java/cz/incad/kramerius/rest/apiNew/client/v60/redirection/V5RedirectHandlerTest.java +++ b/rest/src/test/java/cz/incad/kramerius/rest/apiNew/client/v60/redirection/V5RedirectHandlerTest.java @@ -1,25 +1,5 @@ package cz.incad.kramerius.rest.apiNew.client.v60.redirection; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; - -import javax.ws.rs.core.Response; - -import org.apache.commons.io.IOUtils; -import org.json.JSONException; -import org.json.JSONObject; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -import com.sun.jersey.api.client.Client; - -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.impl.SolrAccessImplNewIndex; -import cz.incad.kramerius.utils.pid.LexerException; -import junit.framework.TestCase; - public class V5RedirectHandlerTest { diff --git a/search-index/src/main/java/cz/kramerius/adapters/ProcessingIndex.java b/search-index/src/main/java/cz/kramerius/adapters/ProcessingIndex.java index f6999e6d93..8c02333c1d 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/ProcessingIndex.java +++ b/search-index/src/main/java/cz/kramerius/adapters/ProcessingIndex.java @@ -1,6 +1,7 @@ package cz.kramerius.adapters; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.adapters.impl.ProcessingIndexImplAbstract; import cz.kramerius.shared.Pair; @@ -13,10 +14,10 @@ * Společně s abstraktní implementací implementující dummy metodami vše * tak mohou implementace cz.kramerius.adapters.IResourceIndex používat jen vybrané metody z minulosti, přítomnosti a budoucnosti. * - * @see cz.incad.kramerius.resourceindex.IResourceIndex + * @see IResourceIndex * @see ProcessingIndexImplAbstract */ -public interface ProcessingIndex extends cz.incad.kramerius.resourceindex.IResourceIndex { +public interface ProcessingIndex extends IResourceIndex { /** * @return pids of own children (first) and foster children (second) of an object identified by pid; both lists are sorted in an order from RELS-EXT elements diff --git a/search-index/src/main/java/cz/kramerius/adapters/RepositoryAccess.java b/search-index/src/main/java/cz/kramerius/adapters/RepositoryAccess.java index c31049366e..295f1a893b 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/RepositoryAccess.java +++ b/search-index/src/main/java/cz/kramerius/adapters/RepositoryAccess.java @@ -11,10 +11,10 @@ * Společně s abstraktní implementací implementující dummy metodami vše * tak mohou implementace cz.kramerius.adapters.FedoraAccess používat jen vybrané metody z minulosti, přítomnosti a budoucnosti. * - * @see cz.incad.kramerius.RepositoryAccess + * @see cz.incad.kramerius.fedora.RepositoryAccess * @see RepositoryAccessImplAbstract */ -public interface RepositoryAccess extends cz.incad.kramerius.RepositoryAccess { +public interface RepositoryAccess extends cz.incad.kramerius.fedora.RepositoryAccess { public InputStream getFoxml(String pid) throws IOException; diff --git a/search-index/src/main/java/cz/kramerius/adapters/impl/ProcessingIndexImplAbstract.java b/search-index/src/main/java/cz/kramerius/adapters/impl/ProcessingIndexImplAbstract.java index a3f99c2a96..e8b0af684e 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/impl/ProcessingIndexImplAbstract.java +++ b/search-index/src/main/java/cz/kramerius/adapters/impl/ProcessingIndexImplAbstract.java @@ -1,7 +1,7 @@ package cz.kramerius.adapters.impl; import cz.incad.kramerius.ObjectPidsPath; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.adapters.ProcessingIndex; import cz.kramerius.shared.Pair; import org.w3c.dom.Document; diff --git a/search-index/src/main/java/cz/kramerius/adapters/impl/RepositoryAccessImplAbstract.java b/search-index/src/main/java/cz/kramerius/adapters/impl/RepositoryAccessImplAbstract.java index de6fbb3c87..694524160f 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/impl/RepositoryAccessImplAbstract.java +++ b/search-index/src/main/java/cz/kramerius/adapters/impl/RepositoryAccessImplAbstract.java @@ -4,8 +4,8 @@ import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.StreamHeadersObserver; import cz.incad.kramerius.TreeNodeProcessor; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import org.w3c.dom.Document; import org.w3c.dom.Element; diff --git a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNewApi/ProcessingIndexImplByKrameriusNewApis.java b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNewApi/ProcessingIndexImplByKrameriusNewApis.java index 45f8ad3f91..75d06c2c66 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNewApi/ProcessingIndexImplByKrameriusNewApis.java +++ b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNewApi/ProcessingIndexImplByKrameriusNewApis.java @@ -4,9 +4,9 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.repository.ExtractStructureHelper; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.shared.IoUtils; import cz.kramerius.adapters.impl.ProcessingIndexImplAbstract; import cz.kramerius.shared.Pair; diff --git a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNoApi/RepositoryAccessImplByKrameriusDirect.java b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNoApi/RepositoryAccessImplByKrameriusDirect.java index abc4a389ac..4b435d2f99 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNoApi/RepositoryAccessImplByKrameriusDirect.java +++ b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusNoApi/RepositoryAccessImplByKrameriusDirect.java @@ -1,6 +1,6 @@ package cz.kramerius.adapters.impl.krameriusNoApi; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.kramerius.adapters.impl.RepositoryAccessImplAbstract; import java.io.IOException; diff --git a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusOldApi/ProcessingIndexImplByKrameriusOldApis.java b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusOldApi/ProcessingIndexImplByKrameriusOldApis.java index 46302e7e72..52300992af 100644 --- a/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusOldApi/ProcessingIndexImplByKrameriusOldApis.java +++ b/search-index/src/main/java/cz/kramerius/adapters/impl/krameriusOldApi/ProcessingIndexImplByKrameriusOldApis.java @@ -3,7 +3,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.shared.IoUtils; import cz.kramerius.adapters.impl.ProcessingIndexImplAbstract; import cz.kramerius.shared.Pair; diff --git a/search-index/src/main/java/cz/kramerius/krameriusRepositoryAccess/KrameriusRepositoryFascade.java b/search-index/src/main/java/cz/kramerius/krameriusRepositoryAccess/KrameriusRepositoryFascade.java index e45900ba8c..a5330414b5 100644 --- a/search-index/src/main/java/cz/kramerius/krameriusRepositoryAccess/KrameriusRepositoryFascade.java +++ b/search-index/src/main/java/cz/kramerius/krameriusRepositoryAccess/KrameriusRepositoryFascade.java @@ -1,6 +1,6 @@ package cz.kramerius.krameriusRepositoryAccess; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.adapters.RepositoryAccess; import cz.kramerius.adapters.ProcessingIndex; import cz.kramerius.shared.IoUtils; diff --git a/search-index/src/main/java/cz/kramerius/searchIndex/Main.java b/search-index/src/main/java/cz/kramerius/searchIndex/Main.java index abb1720da0..8bfb2802e6 100644 --- a/search-index/src/main/java/cz/kramerius/searchIndex/Main.java +++ b/search-index/src/main/java/cz/kramerius/searchIndex/Main.java @@ -7,7 +7,7 @@ import com.google.inject.Key; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.kramerius.adapters.RepositoryAccess; diff --git a/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexModel.java b/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexModel.java index f0d7b9dfc9..5021241caf 100644 --- a/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexModel.java +++ b/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexModel.java @@ -6,11 +6,11 @@ import com.google.inject.name.Names; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.processes.States; import cz.incad.kramerius.processes.starter.ProcessStarter; import cz.incad.kramerius.processes.utils.ProcessUtils; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.java.Pair; @@ -112,7 +112,7 @@ public static void main(String[] args) throws IOException, SolrServerException, //Injector injector = Guice.createInjector(new SearchIndexModule(), new NullStatisticsModule(), new SolrModule(), new RepoModule()); - cz.incad.kramerius.RepositoryAccess rawRepository = injector.getInstance(Key.get(cz.incad.kramerius.RepositoryAccess.class, Names.named("rawFedoraAccess"))); + cz.incad.kramerius.fedora.RepositoryAccess rawRepository = injector.getInstance(Key.get(cz.incad.kramerius.fedora.RepositoryAccess.class, Names.named("rawFedoraAccess"))); RepositoryAccess repository = new RepositoryAccessImplByKrameriusDirect(rawRepository); //access to processing index through new public APIs diff --git a/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexObject.java b/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexObject.java index fd7e94b93d..4c9ec88ce1 100644 --- a/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexObject.java +++ b/search-index/src/main/java/cz/kramerius/searchIndex/NewIndexerProcessIndexObject.java @@ -7,7 +7,7 @@ import cz.incad.kramerius.fedora.RepoModule; import cz.incad.kramerius.processes.starter.ProcessStarter; import cz.incad.kramerius.processes.utils.ProcessUtils; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.kramerius.adapters.RepositoryAccess; @@ -108,11 +108,11 @@ public static void main(String[] args) throws IOException { //access to repository through java directly (injected cz.incad.kramerius.FedoraAccess) Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule(), new ResourceIndexModule()); - cz.incad.kramerius.RepositoryAccess rawRepositoryAccess = injector.getInstance(Key.get(cz.incad.kramerius.RepositoryAccess.class, Names.named("rawFedoraAccess"))); + cz.incad.kramerius.fedora.RepositoryAccess rawRepositoryAccess = injector.getInstance(Key.get(cz.incad.kramerius.fedora.RepositoryAccess.class, Names.named("rawFedoraAccess"))); //FedoraAccess repository = new RepositoryAccessImplByKrameriusDirect(rawRepositoryAccess); //Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule()); - cz.incad.kramerius.RepositoryAccess rawRepository = injector.getInstance(Key.get(cz.incad.kramerius.RepositoryAccess.class, Names.named("rawFedoraAccess"))); + cz.incad.kramerius.fedora.RepositoryAccess rawRepository = injector.getInstance(Key.get(cz.incad.kramerius.fedora.RepositoryAccess.class, Names.named("rawFedoraAccess"))); RepositoryAccess repository = new RepositoryAccessImplByKrameriusDirect(rawRepository); KrameriusRepositoryApi krameriusApiRepository = injector.getInstance(Key.get(KrameriusRepositoryApiImpl.class)); diff --git a/search-index/src/main/java/cz/kramerius/searchIndex/SearchIndexModule.java b/search-index/src/main/java/cz/kramerius/searchIndex/SearchIndexModule.java index ea333590b6..afbe444274 100644 --- a/search-index/src/main/java/cz/kramerius/searchIndex/SearchIndexModule.java +++ b/search-index/src/main/java/cz/kramerius/searchIndex/SearchIndexModule.java @@ -3,7 +3,7 @@ import com.google.inject.AbstractModule; import com.google.inject.Scopes; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; diff --git a/search-index/src/main/java/cz/kramerius/searchIndex/indexer/nodes/RepositoryNodeManager.java b/search-index/src/main/java/cz/kramerius/searchIndex/indexer/nodes/RepositoryNodeManager.java index d2fa96fdd0..3029a635fe 100644 --- a/search-index/src/main/java/cz/kramerius/searchIndex/indexer/nodes/RepositoryNodeManager.java +++ b/search-index/src/main/java/cz/kramerius/searchIndex/indexer/nodes/RepositoryNodeManager.java @@ -1,6 +1,6 @@ package cz.kramerius.searchIndex.indexer.nodes; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.kramerius.searchIndex.indexer.conversions.extraction.*; import cz.kramerius.krameriusRepositoryAccess.KrameriusRepositoryFascade; import cz.kramerius.shared.AuthorInfo; diff --git a/search/src/java/cz/incad/Kramerius/AbstractImageServlet.java b/search/src/java/cz/incad/Kramerius/AbstractImageServlet.java index 4acc5476ce..9e0f1308b0 100644 --- a/search/src/java/cz/incad/Kramerius/AbstractImageServlet.java +++ b/search/src/java/cz/incad/Kramerius/AbstractImageServlet.java @@ -1,7 +1,7 @@ package cz.incad.Kramerius; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.utils.ImageUtils; import cz.incad.kramerius.security.SecurityException; import cz.incad.kramerius.utils.FedoraUtils; diff --git a/search/src/java/cz/incad/Kramerius/ActionAllowedServlet.java b/search/src/java/cz/incad/Kramerius/ActionAllowedServlet.java index ddcd78b7b6..9921813ee3 100644 --- a/search/src/java/cz/incad/Kramerius/ActionAllowedServlet.java +++ b/search/src/java/cz/incad/Kramerius/ActionAllowedServlet.java @@ -23,7 +23,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.security.RightsResolver; diff --git a/search/src/java/cz/incad/Kramerius/FeedbackServlet.java b/search/src/java/cz/incad/Kramerius/FeedbackServlet.java index f2b6e0a90e..f9cb0084f7 100644 --- a/search/src/java/cz/incad/Kramerius/FeedbackServlet.java +++ b/search/src/java/cz/incad/Kramerius/FeedbackServlet.java @@ -11,7 +11,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.security.SecurityException; import cz.incad.kramerius.service.Mailer; import cz.incad.kramerius.service.ResourceBundleService; diff --git a/search/src/java/cz/incad/Kramerius/GeneratePDFServlet.java b/search/src/java/cz/incad/Kramerius/GeneratePDFServlet.java index e8b18c01c8..0a276739e2 100644 --- a/search/src/java/cz/incad/Kramerius/GeneratePDFServlet.java +++ b/search/src/java/cz/incad/Kramerius/GeneratePDFServlet.java @@ -31,7 +31,7 @@ import com.lowagie.text.DocumentException; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.SolrAccess; diff --git a/search/src/java/cz/incad/Kramerius/GetFirstPageThumb.java b/search/src/java/cz/incad/Kramerius/GetFirstPageThumb.java index 4647216001..756fdda3f4 100644 --- a/search/src/java/cz/incad/Kramerius/GetFirstPageThumb.java +++ b/search/src/java/cz/incad/Kramerius/GetFirstPageThumb.java @@ -5,7 +5,7 @@ package cz.incad.Kramerius; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import java.io.IOException; import java.io.PrintWriter; diff --git a/search/src/java/cz/incad/Kramerius/MimeTypeServlet.java b/search/src/java/cz/incad/Kramerius/MimeTypeServlet.java index e0efc63f98..634792a868 100644 --- a/search/src/java/cz/incad/Kramerius/MimeTypeServlet.java +++ b/search/src/java/cz/incad/Kramerius/MimeTypeServlet.java @@ -15,7 +15,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class MimeTypeServlet extends GuiceServlet { diff --git a/search/src/java/cz/incad/Kramerius/PrintQueue.java b/search/src/java/cz/incad/Kramerius/PrintQueue.java index 7343b50d66..c01093b25d 100644 --- a/search/src/java/cz/incad/Kramerius/PrintQueue.java +++ b/search/src/java/cz/incad/Kramerius/PrintQueue.java @@ -35,7 +35,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.printing.PrintingService; import cz.incad.kramerius.utils.ApplicationURL; diff --git a/search/src/java/cz/incad/Kramerius/PrivateContentsServlet.java b/search/src/java/cz/incad/Kramerius/PrivateContentsServlet.java index 1556e4ef1a..59cc3dd132 100644 --- a/search/src/java/cz/incad/Kramerius/PrivateContentsServlet.java +++ b/search/src/java/cz/incad/Kramerius/PrivateContentsServlet.java @@ -17,7 +17,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class PrivateContentsServlet extends GuiceServlet { diff --git a/search/src/java/cz/incad/Kramerius/ProfilesServlet.java b/search/src/java/cz/incad/Kramerius/ProfilesServlet.java index ca0c8a6199..b2b84b44fd 100644 --- a/search/src/java/cz/incad/Kramerius/ProfilesServlet.java +++ b/search/src/java/cz/incad/Kramerius/ProfilesServlet.java @@ -35,7 +35,7 @@ import cz.incad.Kramerius.backend.guice.GuiceServlet; import cz.incad.Kramerius.users.ProfilePrepareUtils; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.security.User; import cz.incad.kramerius.users.UserProfile; import cz.incad.kramerius.users.UserProfileManager; diff --git a/search/src/java/cz/incad/Kramerius/ProxyDatastreamsServlet.java b/search/src/java/cz/incad/Kramerius/ProxyDatastreamsServlet.java index 9ba6f86b48..73dae077aa 100644 --- a/search/src/java/cz/incad/Kramerius/ProxyDatastreamsServlet.java +++ b/search/src/java/cz/incad/Kramerius/ProxyDatastreamsServlet.java @@ -3,7 +3,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import org.apache.commons.io.IOUtils; import javax.servlet.ServletException; diff --git a/search/src/java/cz/incad/Kramerius/SmallThumbnailImageServlet.java b/search/src/java/cz/incad/Kramerius/SmallThumbnailImageServlet.java index 9ecd0bf092..399d59cfdc 100644 --- a/search/src/java/cz/incad/Kramerius/SmallThumbnailImageServlet.java +++ b/search/src/java/cz/incad/Kramerius/SmallThumbnailImageServlet.java @@ -1,6 +1,6 @@ package cz.incad.Kramerius; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.intconfig.InternalConfiguration; import cz.incad.kramerius.security.SecurityException; import cz.incad.kramerius.utils.ApplicationURL; diff --git a/search/src/java/cz/incad/Kramerius/StartupServlet.java b/search/src/java/cz/incad/Kramerius/StartupServlet.java index fb7c6fc18b..2258f91403 100644 --- a/search/src/java/cz/incad/Kramerius/StartupServlet.java +++ b/search/src/java/cz/incad/Kramerius/StartupServlet.java @@ -16,9 +16,7 @@ */ package cz.incad.Kramerius; -import java.io.IOException; import java.sql.Connection; -import java.sql.SQLException; import java.util.logging.Level; import javax.servlet.ServletConfig; @@ -31,7 +29,7 @@ import cz.incad.Kramerius.backend.guice.GuiceServlet; import cz.incad.kramerius.database.VersionDbInitializer; import cz.incad.kramerius.database.VersionService; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; import cz.incad.kramerius.pdf.GeneratePDFService; import cz.incad.kramerius.processes.database.MostDesirableDbInitializer; import cz.incad.kramerius.processes.database.ProcessDbInitializer; diff --git a/search/src/java/cz/incad/Kramerius/audio/servlet/AudioTracksServlet.java b/search/src/java/cz/incad/Kramerius/audio/servlet/AudioTracksServlet.java index b5124e8698..a4881e267b 100644 --- a/search/src/java/cz/incad/Kramerius/audio/servlet/AudioTracksServlet.java +++ b/search/src/java/cz/incad/Kramerius/audio/servlet/AudioTracksServlet.java @@ -21,7 +21,7 @@ import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.audio.XpathEvaluator; import cz.incad.kramerius.service.ResourceBundleService; import cz.incad.kramerius.service.TextsService; diff --git a/search/src/java/cz/incad/Kramerius/backend/guice/BaseModule.java b/search/src/java/cz/incad/Kramerius/backend/guice/BaseModule.java index 1ed248920b..4fc666d4bf 100644 --- a/search/src/java/cz/incad/Kramerius/backend/guice/BaseModule.java +++ b/search/src/java/cz/incad/Kramerius/backend/guice/BaseModule.java @@ -8,12 +8,13 @@ import com.google.inject.name.Names; import cz.incad.kramerius.Constants; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.MostDesirable; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.audio.CacheLifeCycleHook; import cz.incad.kramerius.audio.urlMapping.CachingFedoraUrlManager; import cz.incad.kramerius.audio.urlMapping.RepositoryUrlManager; +import cz.incad.kramerius.fedora.impl.CachedRepositoryAccessImpl; import cz.incad.kramerius.impl.*; import cz.incad.kramerius.processes.GCScheduler; import cz.incad.kramerius.processes.ProcessScheduler; @@ -52,7 +53,7 @@ public class BaseModule extends AbstractModule { @Override protected void configure() { bind(RepositoryAccess.class).annotatedWith(Names.named("securedFedoraAccess")).to(SecuredFedoraAccessImpl.class).in(Scopes.SINGLETON); - bind(RepositoryAccess.class).annotatedWith(Names.named("cachedFedoraAccess")).to(CachedFedoraAccessImpl.class).in(Scopes.SINGLETON); + bind(RepositoryAccess.class).annotatedWith(Names.named("cachedFedoraAccess")).to(CachedRepositoryAccessImpl.class).in(Scopes.SINGLETON); diff --git a/search/src/java/cz/incad/Kramerius/backend/guice/GuiceConfigBean.java b/search/src/java/cz/incad/Kramerius/backend/guice/GuiceConfigBean.java index aab5224a0b..511731af65 100644 --- a/search/src/java/cz/incad/Kramerius/backend/guice/GuiceConfigBean.java +++ b/search/src/java/cz/incad/Kramerius/backend/guice/GuiceConfigBean.java @@ -30,7 +30,7 @@ import cz.incad.kramerius.printing.guice.PrintModule; import cz.incad.kramerius.processes.guice.LongRunningProcessModule; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.rest.api.guice.IiifServletModule; import cz.incad.kramerius.security.guice.GuiceSecurityModule; import cz.incad.kramerius.security.impl.http.GuiceSecurityHTTPModule; diff --git a/search/src/java/cz/incad/Kramerius/imaging/IiifServlet.java b/search/src/java/cz/incad/Kramerius/imaging/IiifServlet.java index bd57c90cdb..ab0c1691b3 100644 --- a/search/src/java/cz/incad/Kramerius/imaging/IiifServlet.java +++ b/search/src/java/cz/incad/Kramerius/imaging/IiifServlet.java @@ -4,7 +4,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; import cz.incad.Kramerius.AbstractImageServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.rest.utils.IIIFUtils; diff --git a/search/src/java/cz/incad/Kramerius/imaging/ImageStreamsServlet.java b/search/src/java/cz/incad/Kramerius/imaging/ImageStreamsServlet.java index fce34ad27a..3da343f049 100644 --- a/search/src/java/cz/incad/Kramerius/imaging/ImageStreamsServlet.java +++ b/search/src/java/cz/incad/Kramerius/imaging/ImageStreamsServlet.java @@ -35,7 +35,7 @@ import cz.incad.Kramerius.AbstractImageServlet; import cz.incad.Kramerius.imaging.utils.FileNameUtils; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraIOException; import cz.incad.kramerius.security.SecurityException; import cz.incad.kramerius.utils.FedoraUtils; diff --git a/search/src/java/cz/incad/Kramerius/imaging/PrintPDFServlet.java b/search/src/java/cz/incad/Kramerius/imaging/PrintPDFServlet.java index 1934ea9cf6..9a9cd792fb 100644 --- a/search/src/java/cz/incad/Kramerius/imaging/PrintPDFServlet.java +++ b/search/src/java/cz/incad/Kramerius/imaging/PrintPDFServlet.java @@ -31,7 +31,7 @@ import com.lowagie.text.pdf.PdfWriter; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.imaging.ImageStreams; diff --git a/search/src/java/cz/incad/Kramerius/oai/DrKrameriusV4Writer.java b/search/src/java/cz/incad/Kramerius/oai/DrKrameriusV4Writer.java index c14e7f6009..ca35fbdb3a 100644 --- a/search/src/java/cz/incad/Kramerius/oai/DrKrameriusV4Writer.java +++ b/search/src/java/cz/incad/Kramerius/oai/DrKrameriusV4Writer.java @@ -17,7 +17,7 @@ package cz.incad.Kramerius.oai; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.KrameriusModels; import cz.incad.kramerius.relation.Relation; import cz.incad.kramerius.relation.RelationModel; diff --git a/search/src/java/cz/incad/Kramerius/oai/OaiServlet.java b/search/src/java/cz/incad/Kramerius/oai/OaiServlet.java index 85263e0cba..3f7bfe2741 100644 --- a/search/src/java/cz/incad/Kramerius/oai/OaiServlet.java +++ b/search/src/java/cz/incad/Kramerius/oai/OaiServlet.java @@ -20,7 +20,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; import cz.incad.Kramerius.backend.guice.GuiceServlet; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.KrameriusModels; import cz.incad.kramerius.relation.Relation; import cz.incad.kramerius.relation.RelationModel; diff --git a/search/src/java/cz/incad/Kramerius/security/ServletCommand.java b/search/src/java/cz/incad/Kramerius/security/ServletCommand.java index e739fb584f..0127099227 100644 --- a/search/src/java/cz/incad/Kramerius/security/ServletCommand.java +++ b/search/src/java/cz/incad/Kramerius/security/ServletCommand.java @@ -34,7 +34,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectModelsPath; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; diff --git a/search/src/java/cz/incad/utils/XslHelper.java b/search/src/java/cz/incad/utils/XslHelper.java index 2e897eb231..4b4aff0a84 100644 --- a/search/src/java/cz/incad/utils/XslHelper.java +++ b/search/src/java/cz/incad/utils/XslHelper.java @@ -2,7 +2,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.FedoraUtils; import java.io.IOException; diff --git a/search/web/WEB-INF/web.xml b/search/web/WEB-INF/web.xml index 86d71e1962..1679f72509 100644 --- a/search/web/WEB-INF/web.xml +++ b/search/web/WEB-INF/web.xml @@ -153,8 +153,8 @@ cz.incad.kramerius.users.impl.http.LoggedUserSessionListener - cz.incad.kramerius.fedora.om.impl.HazelcastServerNode - + cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode + diff --git a/shared/common/src/main/java/cz/incad/kramerius/audio/urlMapping/CachingFedoraUrlManager.java b/shared/common/src/main/java/cz/incad/kramerius/audio/urlMapping/CachingFedoraUrlManager.java index 4aefa4edfe..625dd7a5a6 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/audio/urlMapping/CachingFedoraUrlManager.java +++ b/shared/common/src/main/java/cz/incad/kramerius/audio/urlMapping/CachingFedoraUrlManager.java @@ -17,7 +17,7 @@ package cz.incad.kramerius.audio.urlMapping; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.Initializable; import cz.incad.kramerius.audio.AudioStreamId; import cz.incad.kramerius.audio.XpathEvaluator; diff --git a/shared/common/src/main/java/cz/incad/kramerius/document/impl/DocumentServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/document/impl/DocumentServiceImpl.java index 4f902190a1..d84b60149e 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/document/impl/DocumentServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/document/impl/DocumentServiceImpl.java @@ -35,7 +35,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/document/model/utils/DCContentUtils.java b/shared/common/src/main/java/cz/incad/kramerius/document/model/utils/DCContentUtils.java index 76e29891e3..7fb9ae64f8 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/document/model/utils/DCContentUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/document/model/utils/DCContentUtils.java @@ -24,7 +24,7 @@ import org.w3c.dom.Document; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.model.DCConent; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/RepoModule.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/RepoModule.java index 7c5cf684bc..d1e5a0dcbf 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/RepoModule.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/RepoModule.java @@ -4,8 +4,8 @@ import com.google.inject.Scopes; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; +import cz.incad.kramerius.fedora.utils.EhCacheProvider; import org.ehcache.CacheManager; /** diff --git a/shared/common/src/main/java/cz/incad/kramerius/RepositoryAccess.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/RepositoryAccess.java similarity index 99% rename from shared/common/src/main/java/cz/incad/kramerius/RepositoryAccess.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/RepositoryAccess.java index ad4f5ebf7a..ed2403de2a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/RepositoryAccess.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/RepositoryAccess.java @@ -14,10 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package cz.incad.kramerius; +package cz.incad.kramerius.fedora; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.ProcessSubtreeException; +import cz.incad.kramerius.StreamHeadersObserver; +import cz.incad.kramerius.TreeNodeProcessor; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.security.SecuredFedoraAccessImpl; import java.io.IOException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/AbstractRepositoryAccess.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/AbstractRepositoryAccess.java similarity index 99% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/AbstractRepositoryAccess.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/impl/AbstractRepositoryAccess.java index 6efaba8d8f..0c7487fc23 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/AbstractRepositoryAccess.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/AbstractRepositoryAccess.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora; +package cz.incad.kramerius.fedora.impl; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -25,14 +25,15 @@ import com.google.inject.name.Named; import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.fedora.om.RepositoryDatastream; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryObject; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; -import cz.incad.kramerius.fedora.om.impl.AkubraRepositoryImpl; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.repository.RepositoryDatastream; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryObject; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraRepositoryImpl; import cz.incad.kramerius.repository.utils.NamespaceRemovingVisitor; import cz.incad.kramerius.repository.utils.Utils; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import cz.incad.kramerius.utils.Dom4jUtils; import cz.incad.kramerius.utils.StringUtils; @@ -52,7 +53,6 @@ import com.google.inject.Inject; -import cz.incad.kramerius.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.ProcessSubtreeException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/impl/CachedFedoraAccessImpl.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/CachedRepositoryAccessImpl.java similarity index 96% rename from shared/common/src/main/java/cz/incad/kramerius/impl/CachedFedoraAccessImpl.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/impl/CachedRepositoryAccessImpl.java index 9f93c20567..1594db913b 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/impl/CachedFedoraAccessImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/CachedRepositoryAccessImpl.java @@ -1,8 +1,9 @@ -package cz.incad.kramerius.impl; +package cz.incad.kramerius.fedora.impl; import cz.incad.kramerius.*; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.conf.KConfiguration; import org.ehcache.Cache; @@ -31,7 +32,7 @@ * * @author Martin Rumanek */ -public class CachedFedoraAccessImpl implements RepositoryAccess, FedoraCacheAwareness { +public class CachedRepositoryAccessImpl implements RepositoryAccess, FedoraCacheAwareness { private static Cache xmlscache; private static Cache existsCache; @@ -46,8 +47,8 @@ public class CachedFedoraAccessImpl implements RepositoryAccess, FedoraCacheAwa private RepositoryAccess fedoraAccess; @Inject - public CachedFedoraAccessImpl( @Named("rawFedoraAccess") RepositoryAccess fedoraAccess, - CacheManager cacheManager) throws IOException { + public CachedRepositoryAccessImpl(@Named("rawFedoraAccess") RepositoryAccess fedoraAccess, + CacheManager cacheManager) throws IOException { this.fedoraAccess = fedoraAccess; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/RepositoryAccessImpl.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/RepositoryAccessImpl.java index dba6db88f8..052bb25a2c 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/RepositoryAccessImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/impl/RepositoryAccessImpl.java @@ -5,13 +5,12 @@ import com.qbizm.kramerius.imp.jaxb.DatastreamVersionType; import com.qbizm.kramerius.imp.jaxb.DigitalObject; import cz.incad.kramerius.StreamHeadersObserver; -import cz.incad.kramerius.fedora.AbstractRepositoryAccess; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; -import cz.incad.kramerius.fedora.om.impl.AkubraRepositoryImpl; -import cz.incad.kramerius.fedora.om.impl.AkubraUtils; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraRepositoryImpl; +import cz.incad.kramerius.fedora.utils.AkubraUtils; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.pid.LexerException; @@ -49,17 +48,7 @@ public RepositoryAccessImpl(ProcessingIndexFeeder feeder, @Nullable AggregatedAc } } - - @Override - public AkubraRepository getInternalAPI() throws RepositoryException { - return this.repository; - } - - @Override - public AkubraRepository getTransactionAwareInternalAPI() throws RepositoryException { - throw new RepositoryException("Transactions not supported in Akubra"); - } - + // ------------- TODO manager.readObjectFromStorage(pid) @Override public Document getBiblioMods(String pid) throws IOException { try { @@ -78,7 +67,6 @@ public InputStream getFullThumbnail(String pid) throws IOException { } } - @Override public InputStream getSmallThumbnail(String pid) throws IOException { try { @@ -88,11 +76,6 @@ public InputStream getSmallThumbnail(String pid) throws IOException { } } - @Override - public String getFedoraVersion() throws IOException { - return "Akubra"; - } - @Override public Document getRelsExt(String pid) throws IOException { try { @@ -103,37 +86,15 @@ public Document getRelsExt(String pid) throws IOException { } } - @Override - public Document getSmallThumbnailProfile(String pid) throws IOException { - throw new UnsupportedOperationException("unsupported"); - } - - @Override - public Document getImageFULLProfile(String pid) throws IOException { - throw new UnsupportedOperationException("unsupported"); - } - - @Override - public Document getStreamProfile(String pid, String stream) throws IOException { - throw new UnsupportedOperationException("unsupported"); - } - - - @Override - public boolean isImageFULLAvailable(String pid) throws IOException { - return super.isImageFULLAvailable(pid); - } - - @Override public InputStream getDataStream(String pid, String datastreamName) throws IOException { try { - - pid = makeSureObjectPid(pid); + + pid = makeSureObjectPid(pid); if (this.accessLog != null && this.accessLog.isReportingAccess(pid, datastreamName)) { reportAccess(pid, datastreamName); } - + DigitalObject object = manager.readObjectFromStorage(pid); if (object != null) { DatastreamVersionType stream = AkubraUtils.getLastStreamVersion(object, datastreamName); @@ -150,7 +111,6 @@ public InputStream getDataStream(String pid, String datastreamName) throws IOExc } } - @Override public Document getDC(String pid) throws IOException { try { @@ -160,18 +120,11 @@ public Document getDC(String pid) throws IOException { } } - @Override public InputStream getImageFULL(String pid) throws IOException { return getDataStream(pid, FedoraUtils.IMG_FULL_STREAM); } - - @Override - public InputStream getFedoraDataStreamsList(String pid) throws IOException { - throw new UnsupportedOperationException("this is unsupported"); - } - @Override public String getExternalStreamURL(String pid, String datastreamName) throws IOException { DigitalObject object = manager.readObjectFromStorage(pid); @@ -191,18 +144,32 @@ public String getExternalStreamURL(String pid, String datastreamName) throws IOE throw new IOException("Object not found: " + pid); } - + @Override + public String getFullThumbnailMimeType(String pid) throws IOException, XPathExpressionException { + return getMimeTypeForStream(pid, FedoraUtils.IMG_PREVIEW_STREAM); + } @Override - public Document getDataStreamXmlAsDocument(String pid, String datastreamName) throws IOException { - throw new UnsupportedOperationException("this is unsupported"); + public String getImageFULLMimeType(String pid) throws IOException, XPathExpressionException { + return getMimeTypeForStream(pid, FedoraUtils.IMG_FULL_STREAM); } @Override - public InputStream getDataStreamXml(String pid, String datastreamName) throws IOException { - throw new UnsupportedOperationException("this is unsupported"); + public String getMimeTypeForStream(String pid, String streamName) throws IOException { + DigitalObject object = manager.readObjectFromStorage(pid); + if (object != null) { + + DatastreamVersionType stream = AkubraUtils.getLastStreamVersion(object, streamName); + + if (stream != null) { + return stream.getMIMETYPE(); + } + throw new IOException("Datastream not found: " + pid + " - " + streamName); + } + throw new IOException("Object not found: " + pid); } + private Document getStream(String pid, String streamName) throws IOException { DigitalObject object = manager.readObjectFromStorage(pid); @@ -236,44 +203,6 @@ private Document getStream(String pid, String streamName) throws IOException { // throw new IOException(e); } - - - @Override - public Document getFedoraDataStreamsListAsDocument(String pid) throws IOException { - throw new UnsupportedOperationException("this is unsupported"); - } - - @Override - public String getFullThumbnailMimeType(String pid) throws IOException, XPathExpressionException { - return getMimeTypeForStream(pid, FedoraUtils.IMG_PREVIEW_STREAM); - } - - @Override - public String getImageFULLMimeType(String pid) throws IOException, XPathExpressionException { - return getMimeTypeForStream(pid, FedoraUtils.IMG_FULL_STREAM); - } - - @Override - public String getMimeTypeForStream(String pid, String streamName) throws IOException { - DigitalObject object = manager.readObjectFromStorage(pid); - if (object != null) { - - DatastreamVersionType stream = AkubraUtils.getLastStreamVersion(object, streamName); - - if (stream != null) { - return stream.getMIMETYPE(); - } - throw new IOException("Datastream not found: " + pid + " - " + streamName); - } - throw new IOException("Object not found: " + pid); - } - - - @Override - public Document getObjectProfile(String pid) throws IOException { - throw new UnsupportedOperationException("this is unsupported"); - } - @Override public String getSmallThumbnailMimeType(String pid) throws IOException, XPathExpressionException { return getMimeTypeForStream(pid, FedoraUtils.IMG_THUMB_STREAM); @@ -345,11 +274,6 @@ private Map createMap(String label) { return map; } - @Override - public boolean isFullthumbnailAvailable(String pid) throws IOException { - return this.isStreamAvailable(pid, FedoraUtils.IMG_PREVIEW_STREAM); - } - @Override public boolean isStreamAvailable(String pid, String streamName) throws IOException { try { @@ -361,17 +285,28 @@ public boolean isStreamAvailable(String pid, String streamName) throws IOExcepti } @Override - public boolean isContentAccessible(String pid) throws IOException { - return true; + public boolean isFullthumbnailAvailable(String pid) throws IOException { + return this.isStreamAvailable(pid, FedoraUtils.IMG_PREVIEW_STREAM); } @Override - public void observeStreamHeaders(String pid, String datastreamName, StreamHeadersObserver streamObserver) - throws IOException { - throw new UnsupportedOperationException("unsupported operation"); - + public InputStream getFoxml(String pid, boolean archive) throws IOException { + try { + if (archive){ + DigitalObject obj = manager.readObjectCloneFromStorage(pid); + manager.resolveArchivedDatastreams(obj); + return this.manager.marshallObject(obj); + }else { + return this.manager.retrieveObject(pid); + } + } catch (Exception e) { + throw new IOException(e); + } } + + //-------------------------------------- + @Override public boolean isObjectAvailable(String pid) throws IOException { try { @@ -381,20 +316,78 @@ public boolean isObjectAvailable(String pid) throws IOException { } } + @Override + public boolean isImageFULLAvailable(String pid) throws IOException { + return super.isImageFULLAvailable(pid); + } @Override - public InputStream getFoxml(String pid, boolean archive) throws IOException { - try { - if (archive){ - DigitalObject obj = manager.readObjectCloneFromStorage(pid); - manager.resolveArchivedDatastreams(obj); - return this.manager.marshallObject(obj); - }else { - return this.manager.retrieveObject(pid); - } - } catch (Exception e) { - throw new IOException(e); - } + public boolean isContentAccessible(String pid) throws IOException { + return true; + } + + @Override + public String getFedoraVersion() throws IOException { + return "Akubra"; + } + + @Override + public AkubraRepository getInternalAPI() throws RepositoryException { + return this.repository; + } + + @Override + public AkubraRepository getTransactionAwareInternalAPI() throws RepositoryException { + throw new RepositoryException("Transactions not supported in Akubra"); + } + + @Override + public Document getSmallThumbnailProfile(String pid) throws IOException { + throw new UnsupportedOperationException("unsupported"); + } + + @Override + public Document getImageFULLProfile(String pid) throws IOException { + throw new UnsupportedOperationException("unsupported"); + } + + @Override + public Document getStreamProfile(String pid, String stream) throws IOException { + throw new UnsupportedOperationException("unsupported"); + } + + @Override + public InputStream getFedoraDataStreamsList(String pid) throws IOException { + throw new UnsupportedOperationException("this is unsupported"); + } + + + @Override + public Document getDataStreamXmlAsDocument(String pid, String datastreamName) throws IOException { + throw new UnsupportedOperationException("this is unsupported"); + } + + @Override + public InputStream getDataStreamXml(String pid, String datastreamName) throws IOException { + throw new UnsupportedOperationException("this is unsupported"); + } + + + @Override + public Document getFedoraDataStreamsListAsDocument(String pid) throws IOException { + throw new UnsupportedOperationException("this is unsupported"); + } + + @Override + public Document getObjectProfile(String pid) throws IOException { + throw new UnsupportedOperationException("this is unsupported"); + } + + @Override + public void observeStreamHeaders(String pid, String datastreamName, StreamHeadersObserver streamObserver) + throws IOException { + throw new UnsupportedOperationException("unsupported operation"); + } @Override diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/it/ITSupport.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/it/ITSupport.java deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/AkubraRepository.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/AkubraRepository.java similarity index 70% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/AkubraRepository.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/AkubraRepository.java index 03910da29f..0d99d09e89 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/AkubraRepository.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/AkubraRepository.java @@ -15,10 +15,9 @@ * along with this program. If not, see . */ -package cz.incad.kramerius.fedora.om; +package cz.incad.kramerius.fedora.om.repository; import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; import java.io.IOException; import java.util.function.Consumer; @@ -30,36 +29,13 @@ */ public interface AkubraRepository { - /** - * Returns true if object objectExists and if it is raw kramerius object - * @param ident - * @return - * @throws RepositoryException - */ - public abstract boolean objectExists(String ident) throws RepositoryException; - - - public abstract String getBoundContext() throws RepositoryException; - - /** - * Commits current transaction - * @throws RepositoryException - */ - public abstract void commitTransaction() throws RepositoryException; - - /** - * Rolls back current transaction - * @throws RepositoryException - */ - public abstract void rollbackTransaction()throws RepositoryException; - /** * Creates an empty object or finds existing object * @param ident Identification of the object * @return * @throws RepositoryException */ - public abstract RepositoryObject createOrFindObject(String ident) throws RepositoryException; + RepositoryObject createOrFindObject(String ident) throws RepositoryException; /** * Ingest new digital object from the provided object representation @@ -67,9 +43,15 @@ public interface AkubraRepository { * @return * @throws RepositoryException */ - public abstract RepositoryObject ingestObject(DigitalObject contents) throws RepositoryException; - + RepositoryObject ingestObject(DigitalObject contents) throws RepositoryException; + /** + * Returns true if object objectExists and if it is raw kramerius object + * @param ident + * @return + * @throws RepositoryException + */ + boolean objectExists(String ident) throws RepositoryException; /** * Returns object @@ -77,14 +59,16 @@ public interface AkubraRepository { * @return * @throws RepositoryException */ - public abstract RepositoryObject getObject(String ident) throws RepositoryException; + RepositoryObject getObject(String ident) throws RepositoryException; + + void iterateObjects(Consumer consumer ) throws RepositoryException, IOException; /** * Deletes object * @param pid * @throws RepositoryException */ - public abstract void deleteObject(String pid) throws RepositoryException; + void deleteObject(String pid) throws RepositoryException; /** * Deletes object, possibly without removing relations pointing at this object (from Resource index) @@ -95,18 +79,27 @@ public interface AkubraRepository { * * @throws RepositoryException */ - public abstract void deleteObject(String pid, boolean deleteDataOfManagedDatastreams, boolean deleteRelationsWithThisAsTarget) throws RepositoryException; + void deleteObject(String pid, boolean deleteDataOfManagedDatastreams, boolean deleteRelationsWithThisAsTarget) throws RepositoryException; /** - * Returns processing index feeder - * @return + * Commits current transaction * @throws RepositoryException */ - public abstract ProcessingIndexFeeder getProcessingIndexFeeder() throws RepositoryException; - + void commitTransaction() throws RepositoryException; + /** + * Rolls back current transaction + * @throws RepositoryException + */ + void rollbackTransaction()throws RepositoryException; + // TODO public abstract String getBoundContext() throws RepositoryException; - public abstract void iterateObjects(Consumer consumer ) throws RepositoryException, IOException; + /** + * Returns processing index feeder + * @return + * @throws RepositoryException + */ + // TODO public abstract ProcessingIndexFeeder getProcessingIndexFeeder() throws RepositoryException; } diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/NotFoundInRepositoryException.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/NotFoundInRepositoryException.java similarity index 93% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/NotFoundInRepositoryException.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/NotFoundInRepositoryException.java index 10a6234884..c4a66bc695 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/NotFoundInRepositoryException.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/NotFoundInRepositoryException.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora.om; +package cz.incad.kramerius.fedora.om.repository; /** * Created by pstastny on 11/3/2017. diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryDatastream.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryDatastream.java similarity index 96% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryDatastream.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryDatastream.java index 3af78e15b7..667bf5907b 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryDatastream.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryDatastream.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora.om; +package cz.incad.kramerius.fedora.om.repository; import org.w3c.dom.Document; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryException.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryException.java similarity index 97% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryException.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryException.java index 9e1a961217..3e2cd01c42 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryException.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryException.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package cz.incad.kramerius.fedora.om; +package cz.incad.kramerius.fedora.om.repository; /** * Represents a repo operation error diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryObject.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryObject.java similarity index 98% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryObject.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryObject.java index 8214735a97..63cd2fafeb 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/RepositoryObject.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/RepositoryObject.java @@ -15,9 +15,8 @@ * along with this program. If not, see . */ -package cz.incad.kramerius.fedora.om; +package cz.incad.kramerius.fedora.om.repository; -import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Triple; import org.w3c.dom.Document; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDOManager.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDOManager.java similarity index 99% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDOManager.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDOManager.java index 5665dcec2d..7cd805f448 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDOManager.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDOManager.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; import ca.thoughtwire.lock.DistributedLockService; import com.hazelcast.client.HazelcastClient; @@ -7,6 +7,7 @@ import com.hazelcast.config.GroupConfig; import com.hazelcast.core.*; import com.qbizm.kramerius.imp.jaxb.*; +import cz.incad.kramerius.fedora.utils.AkubraUtils; import cz.incad.kramerius.utils.conf.KConfiguration; import org.akubraproject.BlobStore; import org.akubraproject.fs.FSBlobStore; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDatastream.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDatastream.java similarity index 74% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDatastream.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDatastream.java index 7c0478c454..1e91643cd2 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraDatastream.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraDatastream.java @@ -1,27 +1,15 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; import com.qbizm.kramerius.imp.jaxb.DatastreamType; -import cz.incad.kramerius.FedoraNamespaces; -import cz.incad.kramerius.fedora.om.NotFoundInRepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryDatastream; -import cz.incad.kramerius.fedora.om.RepositoryDatastream.Type; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.utils.Fedora4Utils; -import cz.incad.kramerius.utils.XMLUtils; -import org.apache.commons.io.IOUtils; +import cz.incad.kramerius.fedora.om.repository.RepositoryDatastream; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.utils.AkubraUtils; import org.w3c.dom.Document; -import org.xml.sax.SAXException; -import javax.xml.parsers.ParserConfigurationException; import java.io.*; -import java.net.URI; -import java.text.ParseException; import java.util.Date; -import java.util.List; import java.util.logging.Logger; -import static cz.incad.kramerius.fedora.utils.Fedora4Utils.endpoint; - /** * Created by pstastny on 10/13/2017. */ diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraObject.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraObject.java similarity index 95% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraObject.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraObject.java index 724cb36d41..5b0ec5ecf4 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraObject.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraObject.java @@ -14,26 +14,21 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; import com.qbizm.kramerius.imp.jaxb.*; import cz.incad.kramerius.FedoraNamespaces; -import cz.incad.kramerius.fedora.om.NotFoundInRepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryDatastream; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryObject; -import cz.incad.kramerius.fedora.utils.Fedora4Utils; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryDatastream; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryObject; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.utils.AkubraUtils; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.StringUtils; import cz.incad.kramerius.utils.XMLUtils; -import cz.incad.kramerius.utils.XMLUtils.ElementsFilter; import cz.incad.kramerius.utils.pid.PIDParser; -import org.antlr.stringtemplate.StringTemplate; -import org.antlr.stringtemplate.StringTemplateGroup; -import org.antlr.stringtemplate.language.DefaultTemplateLexer; import org.apache.commons.io.IOUtils; -import org.apache.commons.io.input.BOMInputStream; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.apache.solr.client.solrj.SolrServerException; @@ -47,11 +42,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import java.io.*; -import java.net.MalformedURLException; -import java.net.URI; import java.nio.charset.Charset; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; @@ -63,38 +54,50 @@ */ public class AkubraObject implements RepositoryObject { - public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - public static final Logger LOGGER = Logger.getLogger(AkubraObject.class.getName()); - public static final String RDF_DESCRIPTION_ELEMENT = "Description"; - public static final String RDF_CONTAINS_ELEMENT = "contains"; - public static final String RDF_TYPE_ELEMENT = "type"; - public static final String RDF_ELEMENT = "RDF"; - private AkubraDOManager manager; - private String pid; - DigitalObject digitalObject; - private ProcessingIndexFeeder feeder; + //public static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + private static final Logger LOGGER = Logger.getLogger(AkubraObject.class.getName()); + private static final String RDF_DESCRIPTION_ELEMENT = "Description"; + //public static final String RDF_CONTAINS_ELEMENT = "contains"; + //public static final String RDF_TYPE_ELEMENT = "type"; + private static final String RDF_ELEMENT = "RDF"; + //private AkubraDOManager manager; + //private String pid; + private DigitalObject digitalObject; + private AkubraRepository akubraRepository; + //private ProcessingIndexFeeder feeder; - public AkubraObject(AkubraDOManager manager, String pid, DigitalObject digitalObject, ProcessingIndexFeeder feeder) { + public AkubraObject(DigitalObject digitalObject, AkubraRepository akubraRepository) { super(); this.manager = manager; this.pid = pid; this.feeder = feeder; this.digitalObject = digitalObject; + this.akubraRepository = akubraRepository; } - - public String getPid() { - return pid; + @Override + public List getStreams() throws RepositoryException { + List list = new ArrayList<>(); + List datastreamList = digitalObject.getDatastream(); + for (DatastreamType datastreamType : datastreamList) { + list.add(new AkubraDatastream(manager, datastreamType, datastreamType.getID(), controlGroup2Type(datastreamType.getCONTROLGROUP()))); + } + return list; } - @Override public String getPath() { - return pid; + return digitalObject.getPID(); + } + + + private String getPid() { + return digitalObject.getPID(); } + private DatastreamType createDatastreamHeader(String streamId, String mimeType, String controlGroup) throws RepositoryException { List datastreamList = digitalObject.getDatastream(); Iterator iterator = datastreamList.iterator(); @@ -143,16 +146,6 @@ public RepositoryDatastream createRedirectedStream(String streamId, String url, } - @Override - public List getStreams() throws RepositoryException { - List list = new ArrayList<>(); - List datastreamList = digitalObject.getDatastream(); - for (DatastreamType datastreamType : datastreamList) { - list.add(new AkubraDatastream(manager, datastreamType, datastreamType.getID(), controlGroup2Type(datastreamType.getCONTROLGROUP()))); - } - return list; - } - private AkubraDatastream.Type controlGroup2Type(String controlGroup) { if ("E".equals(controlGroup) || "R".equals(controlGroup)) { diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraRepositoryImpl.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraRepositoryImpl.java similarity index 96% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraRepositoryImpl.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraRepositoryImpl.java index d55349650c..469a2104f1 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraRepositoryImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/AkubraRepositoryImpl.java @@ -15,15 +15,16 @@ * along with this program. If not, see . */ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; import com.qbizm.kramerius.imp.jaxb.DigitalObject; import com.qbizm.kramerius.imp.jaxb.ObjectPropertiesType; import com.qbizm.kramerius.imp.jaxb.PropertyType; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryObject; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryObject; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.utils.AkubraUtils; import org.apache.solr.client.solrj.SolrServerException; import java.io.IOException; @@ -62,29 +63,6 @@ public static final AkubraRepository build() throws RepositoryException { return new AkubraRepositoryImpl(feeder, manager); } - - /* (non-Javadoc) - * @see cz.incad.fcrepo.Repository#commitTransaction() - */ - @Override - public void commitTransaction() throws RepositoryException { - try { - //to avoid temporary inconsistency between Akubra and Processing index - this.feeder.commit(); - } catch (IOException | SolrServerException e) { - throw new RepositoryException(e); - } - } - - /* (non-Javadoc) - * @see cz.incad.fcrepo.Repository#rollbackTransaction() - */ - @Override - public void rollbackTransaction() throws RepositoryException { - throw new RepositoryException("Transactions not supported in Akubra"); - } - - /* (non-Javadoc) * @see cz.incad.fcrepo.Repository#createOrFindObject(java.lang.String) */ @@ -113,21 +91,6 @@ public RepositoryObject createOrFindObject(String ident) throws RepositoryExcept } } - private DigitalObject createEmptyDigitalObject(String pid) { - DigitalObject retval = new DigitalObject(); - retval.setPID(pid); - retval.setVERSION("1.1"); - ObjectPropertiesType objectPropertiesType = new ObjectPropertiesType(); - List propertyTypeList = objectPropertiesType.getProperty(); - propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#state", "Active")); - propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#ownerId", "fedoraAdmin")); - String currentTime = AkubraUtils.currentTimeString(); - propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#createdDate", currentTime)); - propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/view#lastModifiedDate", currentTime)); - retval.setObjectProperties(objectPropertiesType); - return retval; - } - @Override public RepositoryObject ingestObject(DigitalObject contents) throws RepositoryException { if (objectExists(contents.getPID())) { @@ -145,10 +108,33 @@ public RepositoryObject ingestObject(DigitalObject contents) throws RepositoryEx } + @Override + public boolean objectExists(String ident) throws RepositoryException { + try { + return manager.readObjectFromStorage(ident) != null; + } catch (Exception e) { + throw new RepositoryException(e); + } + } + + @Override + public RepositoryObject getObject(String ident) throws RepositoryException { + try { + DigitalObject digitalObject = this.manager.readObjectFromStorage(ident); + if (digitalObject == null) { + //otherwise later causes NPE at places like AkubraUtils.streamExists(DigitalObject object, String streamID) + throw new RepositoryException("object not consistently found in storage: " + ident); + } + AkubraObject obj = new AkubraObject(this.manager, ident, digitalObject, this.feeder); + return obj; + } catch (IOException e) { + throw new RepositoryException(e); + } + } @Override public void iterateObjects(Consumer consumer) throws RepositoryException, IOException { - /* + /* TODO Stack stack = new Stack<>(); StringBuilder builder = new StringBuilder(endpoint()).append("/").append(Fedora4Utils.DATA_PREFIX_PATH); stack.push(builder.toString()); @@ -218,21 +204,52 @@ public void deleteObject(String pid) throws RepositoryException { deleteObject(pid, true, true); } + /* (non-Javadoc) + * @see cz.incad.fcrepo.Repository#commitTransaction() + */ @Override - public ProcessingIndexFeeder getProcessingIndexFeeder() throws RepositoryException { - return this.feeder; - } - - @Override - public boolean objectExists(String ident) throws RepositoryException { + public void commitTransaction() throws RepositoryException { try { - return manager.readObjectFromStorage(ident) != null; - } catch (Exception e) { + //to avoid temporary inconsistency between Akubra and Processing index + this.feeder.commit(); + } catch (IOException | SolrServerException e) { throw new RepositoryException(e); } } - /* + /* (non-Javadoc) + * @see cz.incad.fcrepo.Repository#rollbackTransaction() + */ + @Override + public void rollbackTransaction() throws RepositoryException { + throw new RepositoryException("Transactions not supported in Akubra"); + } + + private DigitalObject createEmptyDigitalObject(String pid) { + DigitalObject retval = new DigitalObject(); + retval.setPID(pid); + retval.setVERSION("1.1"); + ObjectPropertiesType objectPropertiesType = new ObjectPropertiesType(); + List propertyTypeList = objectPropertiesType.getProperty(); + propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#state", "Active")); + propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#ownerId", "fedoraAdmin")); + String currentTime = AkubraUtils.currentTimeString(); + propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/model#createdDate", currentTime)); + propertyTypeList.add(AkubraUtils.createProperty("info:fedora/fedora-system:def/view#lastModifiedDate", currentTime)); + retval.setObjectProperties(objectPropertiesType); + return retval; + } + + /* TODO + @Override + public ProcessingIndexFeeder getProcessingIndexFeeder() throws RepositoryException { + return this.feeder; + } + + */ + + + /* TODO public static final String DELETE_LITERAL( String relation,String namespace, String value) throws IOException { StringTemplate deleteRelation = RELSEXTSPARQLBuilderImpl.SPARQL_TEMPLATES().getInstanceOf("deleteliteral_sparql"); @@ -268,23 +285,10 @@ public static final String UPDATE_INDEXING_SPARQL() throws IOException { } */ + /* TODO @Override public String getBoundContext() throws RepositoryException { throw new RepositoryException("BOUND CONTEXT not supported in Akubra"); - } + }*/ - @Override - public RepositoryObject getObject(String ident) throws RepositoryException { - try { - DigitalObject digitalObject = this.manager.readObjectFromStorage(ident); - if (digitalObject == null) { - //otherwise later causes NPE at places like AkubraUtils.streamExists(DigitalObject object, String streamID) - throw new RepositoryException("object not consistently found in storage: " + ident); - } - AkubraObject obj = new AkubraObject(this.manager, ident, digitalObject, this.feeder); - return obj; - } catch (IOException e) { - throw new RepositoryException(e); - } - } } diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/HazelcastServerNode.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/HazelcastServerNode.java similarity index 97% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/HazelcastServerNode.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/HazelcastServerNode.java index f2fb92db83..d3be57f6d6 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/HazelcastServerNode.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/HazelcastServerNode.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; import com.hazelcast.config.Config; import com.hazelcast.config.GroupConfig; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilder.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilder.java similarity index 85% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilder.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilder.java index 0ccd77bcfe..b0fde02e56 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilder.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilder.java @@ -1,6 +1,6 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderImpl.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderImpl.java similarity index 97% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderImpl.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderImpl.java index 57ff962994..0f5005b327 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderImpl.java @@ -1,6 +1,6 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.utils.StringUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderListener.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderListener.java similarity index 77% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderListener.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderListener.java index 914bf745dc..3dcd08aa2d 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/RELSEXTSPARQLBuilderListener.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/RELSEXTSPARQLBuilderListener.java @@ -1,6 +1,6 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.om.repository.impl; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; /** * Listener is able to receive information about processing RELS-EXT diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/res/foxml.stg b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/res/foxml.stg similarity index 100% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/res/foxml.stg rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/res/foxml.stg diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/res/relsextsparql.stg b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/res/relsextsparql.stg similarity index 100% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/res/relsextsparql.stg rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/repository/impl/res/relsextsparql.stg diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/IResourceIndex.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/IResourceIndex.java similarity index 95% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/IResourceIndex.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/IResourceIndex.java index 0a32593cfa..d034754b8e 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/IResourceIndex.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/IResourceIndex.java @@ -3,17 +3,14 @@ * and open the template in the editor. */ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; -import java.io.IOException; -import java.util.ArrayList; import java.util.List; import java.util.Map; import cz.incad.kramerius.ObjectPidsPath; import org.apache.commons.lang3.tuple.Pair; -import org.apache.solr.client.solrj.SolrServerException; import org.w3c.dom.Document; /** diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexCheck.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexCheck.java similarity index 90% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexCheck.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexCheck.java index f0703a62fb..8835e79ea7 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexCheck.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexCheck.java @@ -1,13 +1,13 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import org.apache.solr.client.solrj.SolrServerException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexFeeder.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexFeeder.java similarity index 98% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexFeeder.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexFeeder.java index 915249cd47..749917862c 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexFeeder.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexFeeder.java @@ -1,13 +1,10 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.utils.conf.KConfiguration; - import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; -import org.apache.commons.lang3.tuple.Triple; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexFeeder.java.bak b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexFeeder.java.bak similarity index 100% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexFeeder.java.bak rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexFeeder.java.bak diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuild.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuild.java similarity index 94% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuild.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuild.java index a92ce4a29b..50ba6bc18c 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuild.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuild.java @@ -1,248 +1,248 @@ -package cz.incad.kramerius.resourceindex; - -import com.google.inject.Guice; -import com.google.inject.Injector; -import com.google.inject.Key; -import com.google.inject.name.Names; -import com.qbizm.kramerius.imp.jaxb.DatastreamType; -import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.RepositoryAccess; -import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraObject; -import cz.incad.kramerius.fedora.om.impl.AkubraUtils; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.fedora.om.impl.RELSEXTSPARQLBuilder; -import cz.incad.kramerius.fedora.om.impl.RELSEXTSPARQLBuilderImpl; -import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.solr.SolrModule; -import cz.incad.kramerius.statistics.NullStatisticsModule; -import cz.incad.kramerius.utils.FedoraUtils; -import cz.incad.kramerius.utils.conf.KConfiguration; -import org.apache.commons.io.IOUtils; -import org.apache.solr.client.solrj.SolrServerException; -import org.xml.sax.SAXException; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.parsers.ParserConfigurationException; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.FileVisitOption; -import java.nio.file.FileVisitResult; -import java.nio.file.FileVisitor; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Deklarace procesu je v shared/common/src/main/java/cz/incad/kramerius/processes/res/lp.st (processing_rebuild) - */ -public class ProcessingIndexRebuild { - // Could be any number between 100 and 500,000. Lower the number, lower memory usage. - // If it was too low, parallelization would be less effective. - // If it was too large, memory usage would slower overall execution, due to memory management. - private static final int MAX_QUEUED_SUBMITTED_TASKS = 10000; - - public static final Logger LOGGER = Logger.getLogger(ProcessingIndexCheck.class.getName()); - - private static final Unmarshaller unmarshaller = initUnmarshaller(); - - private volatile static long counter = 0; - - - public static void main(String[] args) throws IOException, SolrServerException, RepositoryException { - if (args.length>=1 && "REBUILDPROCESSING".equalsIgnoreCase(args[0])){ - LOGGER.info("Přebudování Processing indexu"); - if (args.length >= 2 && "RUNHAZELCAST".equalsIgnoreCase(args[1])) { - HazelcastServerNode.ensureHazelcastNode(); - } - } else { - ProcessStarter.updateName("Přebudování Processing indexu"); - } - Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule()); - final RepositoryAccess fa = injector.getInstance(Key.get(RepositoryAccess.class, Names.named("rawFedoraAccess"))); - final ProcessingIndexFeeder feeder = injector.getInstance(ProcessingIndexFeeder.class); - - long start = System.currentTimeMillis(); - feeder.deleteProcessingIndex(); - Path objectStoreRoot = null; - if (KConfiguration.getInstance().getConfiguration().getBoolean("legacyfs")) { - objectStoreRoot = Paths.get(KConfiguration.getInstance().getProperty("object_store_base")); - } else { - objectStoreRoot = Paths.get(KConfiguration.getInstance().getProperty("objectStore.path")); - } - - boolean exclusiveCommit = KConfiguration.getInstance().getConfiguration().getBoolean("processingIndex.commit", false); - - - // ForkJoinPool is used to preserve parallelization. - // The default constructor of ForkJoinPool creates a pool with parallelism - // equal to Runtime.availableProcessors(), same as parallel streams. - ForkJoinPool forkJoinPool = new ForkJoinPool(); - - // Files.walkFileTree() is used because it does not store any Paths in memory, - // which makes it a more efficient solution to the problem compared to Files.walk(). - Files.walkFileTree(objectStoreRoot, - Collections.singleton(FileVisitOption.FOLLOW_LINKS), - Integer.MAX_VALUE, - new FileVisitor() { - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (!Files.isRegularFile(file)) { - return FileVisitResult.CONTINUE; - } - - if (forkJoinPool.getQueuedSubmissionCount() < MAX_QUEUED_SUBMITTED_TASKS) { - forkJoinPool.execute(() -> { - String filename = file.toString(); - try (FileInputStream inputStream = new FileInputStream(file.toFile())) { - DigitalObject digitalObject = createDigitalObject(inputStream); - rebuildProcessingIndex(feeder, digitalObject, exclusiveCommit); - } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); - } - }); - } else { - String filename = file.toString(); - try (FileInputStream inputStream = new FileInputStream(file.toFile())) { - DigitalObject digitalObject = createDigitalObject(inputStream); - rebuildProcessingIndex(feeder, digitalObject, exclusiveCommit); - } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); - } - } - - return FileVisitResult.CONTINUE; - } - - - @Override - public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { - LOGGER.log(Level.SEVERE, "Error processing file: " + file.toString(), exc); - - // This will allow the execution to continue uninterrupted, - // even in the event of encountering permission errors. - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { - if (exc != null) { - LOGGER.log(Level.SEVERE, "Error searching directory : " + dir.toString(), exc); - } - - // This will allow the execution to continue uninterrupted, - // even in the event of encountering permission errors. - return FileVisitResult.CONTINUE; - } - }); - -// Files.walk(objectStoreRoot, FileVisitOption.FOLLOW_LINKS).parallel().filter(Files::isRegularFile).forEach(path -> { -// String filename = path.toString(); -// try { -// FileInputStream inputStream = new FileInputStream(path.toFile()); -// DigitalObject digitalObject = createDigitalObject(inputStream); -// rebuildProcessingIndex(feeder, digitalObject); -// } catch (Exception ex) { -// LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); -// } -// }); - - // Wait for all tasks to finish - forkJoinPool.shutdown(); - try { - if (!forkJoinPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS)) { - LOGGER.severe("ForkJoinPool did not terminate."); - } - } catch (InterruptedException e) { - LOGGER.log(Level.SEVERE, "Interrupted while waiting for ForkJoinPool to terminate", e); - Thread.currentThread().interrupt(); - } - - LOGGER.info("Finished tree walk in " + (System.currentTimeMillis() - start) + " ms"); - - feeder.commit(); - fa.shutdown(); - } - - private static DigitalObject createDigitalObject(InputStream inputStream) { - DigitalObject obj = null; - try { - synchronized (unmarshaller) { - obj = (DigitalObject) unmarshaller.unmarshal(inputStream); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - return obj; - } - - - public static void rebuildProcessingIndex(ProcessingIndexFeeder feeder, DigitalObject digitalObject, boolean commitAfteringest ) throws RepositoryException { - try { - List datastreamList = digitalObject.getDatastream(); - for (DatastreamType datastreamType : datastreamList) { - if (FedoraUtils.RELS_EXT_STREAM.equals(datastreamType.getID())) { - InputStream streamContent = AkubraUtils.getStreamContent(AkubraUtils.getLastStreamVersion(datastreamType), null); - AkubraObject akubraObject = new AkubraObject(null, digitalObject.getPID(), digitalObject, feeder); - rebuildProcessingIndexImpl(akubraObject, streamContent); - } - } - } catch (Exception e) { - throw new RepositoryException(e); - } finally { - if (feeder != null && commitAfteringest) { - try { - feeder.commit(); - } catch (IOException e) { - throw new RuntimeException(e); - } catch (SolrServerException e) { - throw new RuntimeException(e); - } - LOGGER.info("Feeder commited."); - } - } - } - - private static void rebuildProcessingIndexImpl(AkubraObject akubraObject, InputStream content) throws RepositoryException { - try { - String s = IOUtils.toString(content, "UTF-8"); - RELSEXTSPARQLBuilder sparqlBuilder = new RELSEXTSPARQLBuilderImpl(); - sparqlBuilder.sparqlProps(s.trim(), (object, localName) -> { - akubraObject.processRELSEXTRelationAndFeedProcessingIndex(object, localName); - return object; - }); - LOGGER.info("Processed PID:" + akubraObject.getPid() + ", count:" + (++counter)); - } catch (IOException e) { - throw new RepositoryException(e); - } catch (SAXException e) { - throw new RepositoryException(e); - } catch (ParserConfigurationException e) { - throw new RepositoryException(e); - } - } - - private static Unmarshaller initUnmarshaller() { - try { - JAXBContext jaxbContext = JAXBContext.newInstance(DigitalObject.class); - return jaxbContext.createUnmarshaller(); - } catch (Exception e) { - LOGGER.log(Level.SEVERE, "Cannot init JAXB", e); - throw new RuntimeException(e); - } - } -} +package cz.incad.kramerius.fedora.om.resourceindex; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.name.Names; +import com.qbizm.kramerius.imp.jaxb.DatastreamType; +import com.qbizm.kramerius.imp.jaxb.DigitalObject; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.RepoModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraObject; +import cz.incad.kramerius.fedora.utils.AkubraUtils; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.repository.impl.RELSEXTSPARQLBuilder; +import cz.incad.kramerius.fedora.om.repository.impl.RELSEXTSPARQLBuilderImpl; +import cz.incad.kramerius.processes.starter.ProcessStarter; +import cz.incad.kramerius.solr.SolrModule; +import cz.incad.kramerius.statistics.NullStatisticsModule; +import cz.incad.kramerius.utils.FedoraUtils; +import cz.incad.kramerius.utils.conf.KConfiguration; +import org.apache.commons.io.IOUtils; +import org.apache.solr.client.solrj.SolrServerException; +import org.xml.sax.SAXException; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.ParserConfigurationException; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileVisitOption; +import java.nio.file.FileVisitResult; +import java.nio.file.FileVisitor; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Deklarace procesu je v shared/common/src/main/java/cz/incad/kramerius/processes/res/lp.st (processing_rebuild) + */ +public class ProcessingIndexRebuild { + // Could be any number between 100 and 500,000. Lower the number, lower memory usage. + // If it was too low, parallelization would be less effective. + // If it was too large, memory usage would slower overall execution, due to memory management. + private static final int MAX_QUEUED_SUBMITTED_TASKS = 10000; + + public static final Logger LOGGER = Logger.getLogger(ProcessingIndexCheck.class.getName()); + + private static final Unmarshaller unmarshaller = initUnmarshaller(); + + private volatile static long counter = 0; + + + public static void main(String[] args) throws IOException, SolrServerException, RepositoryException { + if (args.length>=1 && "REBUILDPROCESSING".equalsIgnoreCase(args[0])){ + LOGGER.info("Přebudování Processing indexu"); + if (args.length >= 2 && "RUNHAZELCAST".equalsIgnoreCase(args[1])) { + HazelcastServerNode.ensureHazelcastNode(); + } + } else { + ProcessStarter.updateName("Přebudování Processing indexu"); + } + Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule()); + final RepositoryAccess fa = injector.getInstance(Key.get(RepositoryAccess.class, Names.named("rawFedoraAccess"))); + final ProcessingIndexFeeder feeder = injector.getInstance(ProcessingIndexFeeder.class); + + long start = System.currentTimeMillis(); + feeder.deleteProcessingIndex(); + Path objectStoreRoot = null; + if (KConfiguration.getInstance().getConfiguration().getBoolean("legacyfs")) { + objectStoreRoot = Paths.get(KConfiguration.getInstance().getProperty("object_store_base")); + } else { + objectStoreRoot = Paths.get(KConfiguration.getInstance().getProperty("objectStore.path")); + } + + boolean exclusiveCommit = KConfiguration.getInstance().getConfiguration().getBoolean("processingIndex.commit", false); + + + // ForkJoinPool is used to preserve parallelization. + // The default constructor of ForkJoinPool creates a pool with parallelism + // equal to Runtime.availableProcessors(), same as parallel streams. + ForkJoinPool forkJoinPool = new ForkJoinPool(); + + // Files.walkFileTree() is used because it does not store any Paths in memory, + // which makes it a more efficient solution to the problem compared to Files.walk(). + Files.walkFileTree(objectStoreRoot, + Collections.singleton(FileVisitOption.FOLLOW_LINKS), + Integer.MAX_VALUE, + new FileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (!Files.isRegularFile(file)) { + return FileVisitResult.CONTINUE; + } + + if (forkJoinPool.getQueuedSubmissionCount() < MAX_QUEUED_SUBMITTED_TASKS) { + forkJoinPool.execute(() -> { + String filename = file.toString(); + try (FileInputStream inputStream = new FileInputStream(file.toFile())) { + DigitalObject digitalObject = createDigitalObject(inputStream); + rebuildProcessingIndex(feeder, digitalObject, exclusiveCommit); + } catch (Exception ex) { + LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); + } + }); + } else { + String filename = file.toString(); + try (FileInputStream inputStream = new FileInputStream(file.toFile())) { + DigitalObject digitalObject = createDigitalObject(inputStream); + rebuildProcessingIndex(feeder, digitalObject, exclusiveCommit); + } catch (Exception ex) { + LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); + } + } + + return FileVisitResult.CONTINUE; + } + + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { + LOGGER.log(Level.SEVERE, "Error processing file: " + file.toString(), exc); + + // This will allow the execution to continue uninterrupted, + // even in the event of encountering permission errors. + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { + if (exc != null) { + LOGGER.log(Level.SEVERE, "Error searching directory : " + dir.toString(), exc); + } + + // This will allow the execution to continue uninterrupted, + // even in the event of encountering permission errors. + return FileVisitResult.CONTINUE; + } + }); + +// Files.walk(objectStoreRoot, FileVisitOption.FOLLOW_LINKS).parallel().filter(Files::isRegularFile).forEach(path -> { +// String filename = path.toString(); +// try { +// FileInputStream inputStream = new FileInputStream(path.toFile()); +// DigitalObject digitalObject = createDigitalObject(inputStream); +// rebuildProcessingIndex(feeder, digitalObject); +// } catch (Exception ex) { +// LOGGER.log(Level.SEVERE, "Error processing file: " + filename, ex); +// } +// }); + + // Wait for all tasks to finish + forkJoinPool.shutdown(); + try { + if (!forkJoinPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS)) { + LOGGER.severe("ForkJoinPool did not terminate."); + } + } catch (InterruptedException e) { + LOGGER.log(Level.SEVERE, "Interrupted while waiting for ForkJoinPool to terminate", e); + Thread.currentThread().interrupt(); + } + + LOGGER.info("Finished tree walk in " + (System.currentTimeMillis() - start) + " ms"); + + feeder.commit(); + fa.shutdown(); + } + + private static DigitalObject createDigitalObject(InputStream inputStream) { + DigitalObject obj = null; + try { + synchronized (unmarshaller) { + obj = (DigitalObject) unmarshaller.unmarshal(inputStream); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return obj; + } + + + public static void rebuildProcessingIndex(ProcessingIndexFeeder feeder, DigitalObject digitalObject, boolean commitAfteringest ) throws RepositoryException { + try { + List datastreamList = digitalObject.getDatastream(); + for (DatastreamType datastreamType : datastreamList) { + if (FedoraUtils.RELS_EXT_STREAM.equals(datastreamType.getID())) { + InputStream streamContent = AkubraUtils.getStreamContent(AkubraUtils.getLastStreamVersion(datastreamType), null); + AkubraObject akubraObject = new AkubraObject(null, digitalObject.getPID(), digitalObject, feeder); + rebuildProcessingIndexImpl(akubraObject, streamContent); + } + } + } catch (Exception e) { + throw new RepositoryException(e); + } finally { + if (feeder != null && commitAfteringest) { + try { + feeder.commit(); + } catch (IOException e) { + throw new RuntimeException(e); + } catch (SolrServerException e) { + throw new RuntimeException(e); + } + LOGGER.info("Feeder commited."); + } + } + } + + private static void rebuildProcessingIndexImpl(AkubraObject akubraObject, InputStream content) throws RepositoryException { + try { + String s = IOUtils.toString(content, "UTF-8"); + RELSEXTSPARQLBuilder sparqlBuilder = new RELSEXTSPARQLBuilderImpl(); + sparqlBuilder.sparqlProps(s.trim(), (object, localName) -> { + akubraObject.processRELSEXTRelationAndFeedProcessingIndex(object, localName); + return object; + }); + LOGGER.info("Processed PID:" + akubraObject.getPid() + ", count:" + (++counter)); + } catch (IOException e) { + throw new RepositoryException(e); + } catch (SAXException e) { + throw new RepositoryException(e); + } catch (ParserConfigurationException e) { + throw new RepositoryException(e); + } + } + + private static Unmarshaller initUnmarshaller() { + try { + JAXBContext jaxbContext = JAXBContext.newInstance(DigitalObject.class); + return jaxbContext.createUnmarshaller(); + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Cannot init JAXB", e); + throw new RuntimeException(e); + } + } +} diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java similarity index 94% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java index a653541c36..0dacd4a744 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ProcessingIndexRebuildFromFoxmlByPid.java @@ -1,200 +1,200 @@ -package cz.incad.kramerius.resourceindex; - -import com.google.inject.Guice; -import com.google.inject.Injector; -import com.qbizm.kramerius.imp.jaxb.DatastreamType; -import com.qbizm.kramerius.imp.jaxb.DigitalObject; -import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraObject; -import cz.incad.kramerius.fedora.om.impl.AkubraUtils; -import cz.incad.kramerius.fedora.om.impl.RELSEXTSPARQLBuilder; -import cz.incad.kramerius.fedora.om.impl.RELSEXTSPARQLBuilderImpl; -import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.solr.SolrModule; -import cz.incad.kramerius.statistics.NullStatisticsModule; -import cz.incad.kramerius.utils.FedoraUtils; -import cz.incad.kramerius.utils.conf.KConfiguration; -import org.apache.commons.io.IOUtils; -import org.apache.solr.client.solrj.SolrServerException; -import org.xml.sax.SAXException; - -import javax.xml.bind.DatatypeConverter; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.parsers.ParserConfigurationException; -import java.io.*; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Deklarace procesu je v shared/common/src/main/java/cz/incad/kramerius/processes/res/lp.st (processing_rebuild_for_object) - */ -public class ProcessingIndexRebuildFromFoxmlByPid { - public static final Logger LOGGER = Logger.getLogger(ProcessingIndexRebuildFromFoxmlByPid.class.getName()); - - private final Unmarshaller unmarshaller; - private final ProcessingIndexFeeder feeder; - - private ProcessingIndexRebuildFromFoxmlByPid() { - this.unmarshaller = initUnmarshaller(); - Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule()); - this.feeder = injector.getInstance(ProcessingIndexFeeder.class); - } - - /** - * args[0] - authToken - * args[1] - pid - */ - public static void main(String[] args) throws IOException, SolrServerException, RepositoryException { - //args - /*LOGGER.info("args: " + Arrays.asList(args)); - for (String arg : args) { - System.out.println(arg); - }*/ - if (args.length < 2) { - throw new RuntimeException("Not enough arguments."); - } - int argsIndex = 0; - //token for keeping possible following processes in same batch - String authToken = args[argsIndex++]; //auth token always second, but still suboptimal solution, best would be if it was outside the scope of this as if ProcessHelper.scheduleProcess() similarly to changing name (ProcessStarter) - //process params - String pid = args[argsIndex++]; - - ProcessStarter.updateName(String.format("Aktualizace Processing indexu z FOXML pro objekt %s", pid)); - new ProcessingIndexRebuildFromFoxmlByPid().rebuildProcessingIndexFromFoxml(pid); - } - - private Unmarshaller initUnmarshaller() { - try { - JAXBContext jaxbContext = JAXBContext.newInstance(DigitalObject.class); - return jaxbContext.createUnmarshaller(); - } catch (Exception e) { - LOGGER.log(Level.SEVERE, "Cannot init JAXB", e); - throw new RuntimeException(e); - } - } - - private void rebuildProcessingIndexFromFoxml(String pid) throws IOException { - LOGGER.log(Level.INFO, "Updating processing index from FOXML of " + pid); - File foxmlFile = findFoxmlFile(pid); - LOGGER.log(Level.INFO, "FOXML file: " + foxmlFile.getAbsolutePath()); - if (!foxmlFile.exists()) { - throw new IOException("File doesn't exist: " + foxmlFile.getAbsolutePath()); - } - if (!foxmlFile.canRead()) { - throw new IOException("File can't be read: " + foxmlFile.getAbsolutePath()); - } - try { - FileInputStream inputStream = new FileInputStream(foxmlFile); - DigitalObject digitalObject = createDigitalObject(inputStream); - feeder.deleteByPid(pid); //smazat vsechny existujici vazby z objektu, ALE netyka se tech, co na objekt vedou (ty ted neprebudovavame) - rebuildProcessingIndex(feeder, digitalObject); - } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Error processing file: " + foxmlFile.getAbsolutePath(), ex); - } - } - - private File findFoxmlFile(String pid) { - try { - if (!pid.toLowerCase().startsWith("uuid:")) { //this is already checked at API endpoint level, here it's just to make sure if this class was to be called from somewhere else - throw new IllegalArgumentException("invalid pid format"); - } - String objectId = "info:fedora/" + pid.toLowerCase(); //e.g. info:fedora/uuid:912509d3-2764-4be5-9e0a-366cbacabfef - //System.out.println(objectId); - MessageDigest md = MessageDigest.getInstance("MD5"); - md.update(objectId.getBytes("UTF-8")); - String objectIdHash = DatatypeConverter.printHexBinary(md.digest()); //e.g. 7C2BDE15DDDFA29123823CB7A86BFD86 - //System.out.println(objectIdHash); - String objectPattern = KConfiguration.getInstance().getProperty("objectStore.pattern"); //e.g. ##/##/## - //System.out.println(objectPattern); - String pathSegementsFromPid = PathSegmentExtractor.extractPathSegements(objectIdHash.toLowerCase(), objectPattern); //e.g. 7c/2b/de - //System.out.println(pathSegementsFromPid); - String foxmlPath = pathSegementsFromPid + "/info%3Afedora%2Fuuid%3A" + pid.substring("uuid:".length()); //e.g. 7c/2b/de/info%3Afedora%2Fuuid%3A912509d3-2764-4be5-9e0a-366cbacabfef - //System.out.println(foxmlPath); - File objectStoreRoot = new File(KConfiguration.getInstance().getProperty("objectStore.path")); //e.g. /home/tomcat/kramerius-akubra/akubra-data/objectStore - return new File(objectStoreRoot, foxmlPath); //e.g. /home/tomcat/kramerius-akubra/akubra-data/objectStore/ - } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - - private DigitalObject createDigitalObject(InputStream inputStream) { - try { - return (DigitalObject) unmarshaller.unmarshal(inputStream); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private void rebuildProcessingIndex(ProcessingIndexFeeder feeder, DigitalObject digitalObject) throws RepositoryException { - try { - List datastreamList = digitalObject.getDatastream(); - for (DatastreamType datastreamType : datastreamList) { - if (FedoraUtils.RELS_EXT_STREAM.equals(datastreamType.getID())) { - InputStream streamContent = AkubraUtils.getStreamContent(AkubraUtils.getLastStreamVersion(datastreamType), null); - AkubraObject akubraObject = new AkubraObject(null, digitalObject.getPID(), digitalObject, feeder); - rebuildProcessingIndexImpl(akubraObject, streamContent); - } - } - } catch (Exception e) { - throw new RepositoryException(e); - } - } - - private void rebuildProcessingIndexImpl(AkubraObject akubraObject, InputStream content) throws RepositoryException { - try { - String s = IOUtils.toString(content, "UTF-8"); - RELSEXTSPARQLBuilder sparqlBuilder = new RELSEXTSPARQLBuilderImpl(); - sparqlBuilder.sparqlProps(s.trim(), (object, localName) -> { - akubraObject.processRELSEXTRelationAndFeedProcessingIndex(object, localName); - return object; - }); - LOGGER.info("Processed " + akubraObject.getPid()); - } catch (IOException e) { - throw new RepositoryException(e); - } catch (SAXException e) { - throw new RepositoryException(e); - } catch (ParserConfigurationException e) { - throw new RepositoryException(e); - } finally { - try { - this.feeder.commit(); - LOGGER.info("CALLED PROCESSING INDEX COMMIT"); - } catch (IOException e) { - throw new RuntimeException(e); - } catch (SolrServerException e) { - throw new RuntimeException(e); - } - } - } - - /** - * @see org.fcrepo.server.storage.lowlevel.akubra.HashPathIdMapper - */ - public static class PathSegmentExtractor { - public static String extractPathSegements(String string, String objectPattern) { - if (!objectPattern.matches("#+(\\/#+)*")) { - throw new RuntimeException(String.format("unsupported object pattern: %s", objectPattern)); - } - if (objectPattern.replaceAll("\\/", "").length() > string.length()) { - throw new RuntimeException(String.format("string too short for the pattern: %s, string: %s", objectPattern, string)); - } - StringBuilder builder = new StringBuilder(); - String[] placeholders = objectPattern.split("\\/"); - int startingPosition = 0; - for (int i = 0; i < placeholders.length; i++) { - String placeholder = placeholders[i]; - builder.append(string, startingPosition, startingPosition + placeholder.length()); - startingPosition += placeholder.length(); - if (placeholders.length != 1 && i != placeholders.length - 1) { - builder.append('/'); - } - } - return builder.toString(); - } - } -} +package cz.incad.kramerius.fedora.om.resourceindex; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.qbizm.kramerius.imp.jaxb.DatastreamType; +import com.qbizm.kramerius.imp.jaxb.DigitalObject; +import cz.incad.kramerius.fedora.RepoModule; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraObject; +import cz.incad.kramerius.fedora.utils.AkubraUtils; +import cz.incad.kramerius.fedora.om.repository.impl.RELSEXTSPARQLBuilder; +import cz.incad.kramerius.fedora.om.repository.impl.RELSEXTSPARQLBuilderImpl; +import cz.incad.kramerius.processes.starter.ProcessStarter; +import cz.incad.kramerius.solr.SolrModule; +import cz.incad.kramerius.statistics.NullStatisticsModule; +import cz.incad.kramerius.utils.FedoraUtils; +import cz.incad.kramerius.utils.conf.KConfiguration; +import org.apache.commons.io.IOUtils; +import org.apache.solr.client.solrj.SolrServerException; +import org.xml.sax.SAXException; + +import javax.xml.bind.DatatypeConverter; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.ParserConfigurationException; +import java.io.*; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Deklarace procesu je v shared/common/src/main/java/cz/incad/kramerius/processes/res/lp.st (processing_rebuild_for_object) + */ +public class ProcessingIndexRebuildFromFoxmlByPid { + public static final Logger LOGGER = Logger.getLogger(ProcessingIndexRebuildFromFoxmlByPid.class.getName()); + + private final Unmarshaller unmarshaller; + private final ProcessingIndexFeeder feeder; + + private ProcessingIndexRebuildFromFoxmlByPid() { + this.unmarshaller = initUnmarshaller(); + Injector injector = Guice.createInjector(new SolrModule(), new ResourceIndexModule(), new RepoModule(), new NullStatisticsModule()); + this.feeder = injector.getInstance(ProcessingIndexFeeder.class); + } + + /** + * args[0] - authToken + * args[1] - pid + */ + public static void main(String[] args) throws IOException, SolrServerException, RepositoryException { + //args + /*LOGGER.info("args: " + Arrays.asList(args)); + for (String arg : args) { + System.out.println(arg); + }*/ + if (args.length < 2) { + throw new RuntimeException("Not enough arguments."); + } + int argsIndex = 0; + //token for keeping possible following processes in same batch + String authToken = args[argsIndex++]; //auth token always second, but still suboptimal solution, best would be if it was outside the scope of this as if ProcessHelper.scheduleProcess() similarly to changing name (ProcessStarter) + //process params + String pid = args[argsIndex++]; + + ProcessStarter.updateName(String.format("Aktualizace Processing indexu z FOXML pro objekt %s", pid)); + new ProcessingIndexRebuildFromFoxmlByPid().rebuildProcessingIndexFromFoxml(pid); + } + + private Unmarshaller initUnmarshaller() { + try { + JAXBContext jaxbContext = JAXBContext.newInstance(DigitalObject.class); + return jaxbContext.createUnmarshaller(); + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Cannot init JAXB", e); + throw new RuntimeException(e); + } + } + + private void rebuildProcessingIndexFromFoxml(String pid) throws IOException { + LOGGER.log(Level.INFO, "Updating processing index from FOXML of " + pid); + File foxmlFile = findFoxmlFile(pid); + LOGGER.log(Level.INFO, "FOXML file: " + foxmlFile.getAbsolutePath()); + if (!foxmlFile.exists()) { + throw new IOException("File doesn't exist: " + foxmlFile.getAbsolutePath()); + } + if (!foxmlFile.canRead()) { + throw new IOException("File can't be read: " + foxmlFile.getAbsolutePath()); + } + try { + FileInputStream inputStream = new FileInputStream(foxmlFile); + DigitalObject digitalObject = createDigitalObject(inputStream); + feeder.deleteByPid(pid); //smazat vsechny existujici vazby z objektu, ALE netyka se tech, co na objekt vedou (ty ted neprebudovavame) + rebuildProcessingIndex(feeder, digitalObject); + } catch (Exception ex) { + LOGGER.log(Level.SEVERE, "Error processing file: " + foxmlFile.getAbsolutePath(), ex); + } + } + + private File findFoxmlFile(String pid) { + try { + if (!pid.toLowerCase().startsWith("uuid:")) { //this is already checked at API endpoint level, here it's just to make sure if this class was to be called from somewhere else + throw new IllegalArgumentException("invalid pid format"); + } + String objectId = "info:fedora/" + pid.toLowerCase(); //e.g. info:fedora/uuid:912509d3-2764-4be5-9e0a-366cbacabfef + //System.out.println(objectId); + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(objectId.getBytes("UTF-8")); + String objectIdHash = DatatypeConverter.printHexBinary(md.digest()); //e.g. 7C2BDE15DDDFA29123823CB7A86BFD86 + //System.out.println(objectIdHash); + String objectPattern = KConfiguration.getInstance().getProperty("objectStore.pattern"); //e.g. ##/##/## + //System.out.println(objectPattern); + String pathSegementsFromPid = PathSegmentExtractor.extractPathSegements(objectIdHash.toLowerCase(), objectPattern); //e.g. 7c/2b/de + //System.out.println(pathSegementsFromPid); + String foxmlPath = pathSegementsFromPid + "/info%3Afedora%2Fuuid%3A" + pid.substring("uuid:".length()); //e.g. 7c/2b/de/info%3Afedora%2Fuuid%3A912509d3-2764-4be5-9e0a-366cbacabfef + //System.out.println(foxmlPath); + File objectStoreRoot = new File(KConfiguration.getInstance().getProperty("objectStore.path")); //e.g. /home/tomcat/kramerius-akubra/akubra-data/objectStore + return new File(objectStoreRoot, foxmlPath); //e.g. /home/tomcat/kramerius-akubra/akubra-data/objectStore/ + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + private DigitalObject createDigitalObject(InputStream inputStream) { + try { + return (DigitalObject) unmarshaller.unmarshal(inputStream); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void rebuildProcessingIndex(ProcessingIndexFeeder feeder, DigitalObject digitalObject) throws RepositoryException { + try { + List datastreamList = digitalObject.getDatastream(); + for (DatastreamType datastreamType : datastreamList) { + if (FedoraUtils.RELS_EXT_STREAM.equals(datastreamType.getID())) { + InputStream streamContent = AkubraUtils.getStreamContent(AkubraUtils.getLastStreamVersion(datastreamType), null); + AkubraObject akubraObject = new AkubraObject(null, digitalObject.getPID(), digitalObject, feeder); + rebuildProcessingIndexImpl(akubraObject, streamContent); + } + } + } catch (Exception e) { + throw new RepositoryException(e); + } + } + + private void rebuildProcessingIndexImpl(AkubraObject akubraObject, InputStream content) throws RepositoryException { + try { + String s = IOUtils.toString(content, "UTF-8"); + RELSEXTSPARQLBuilder sparqlBuilder = new RELSEXTSPARQLBuilderImpl(); + sparqlBuilder.sparqlProps(s.trim(), (object, localName) -> { + akubraObject.processRELSEXTRelationAndFeedProcessingIndex(object, localName); + return object; + }); + LOGGER.info("Processed " + akubraObject.getPid()); + } catch (IOException e) { + throw new RepositoryException(e); + } catch (SAXException e) { + throw new RepositoryException(e); + } catch (ParserConfigurationException e) { + throw new RepositoryException(e); + } finally { + try { + this.feeder.commit(); + LOGGER.info("CALLED PROCESSING INDEX COMMIT"); + } catch (IOException e) { + throw new RuntimeException(e); + } catch (SolrServerException e) { + throw new RuntimeException(e); + } + } + } + + /** + * @see org.fcrepo.server.storage.lowlevel.akubra.HashPathIdMapper + */ + public static class PathSegmentExtractor { + public static String extractPathSegements(String string, String objectPattern) { + if (!objectPattern.matches("#+(\\/#+)*")) { + throw new RuntimeException(String.format("unsupported object pattern: %s", objectPattern)); + } + if (objectPattern.replaceAll("\\/", "").length() > string.length()) { + throw new RuntimeException(String.format("string too short for the pattern: %s, string: %s", objectPattern, string)); + } + StringBuilder builder = new StringBuilder(); + String[] placeholders = objectPattern.split("\\/"); + int startingPosition = 0; + for (int i = 0; i < placeholders.length; i++) { + String placeholder = placeholders[i]; + builder.append(string, startingPosition, startingPosition + placeholder.length()); + startingPosition += placeholder.length(); + if (placeholders.length != 1 && i != placeholders.length - 1) { + builder.append('/'); + } + } + return builder.toString(); + } + } +} diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexException.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexException.java similarity index 91% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexException.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexException.java index 62bebfe3c7..17a3b6a650 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexException.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexException.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; /** * Basic resource index exception diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexModule.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexModule.java similarity index 87% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexModule.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexModule.java index d28527586c..5c3f984681 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexModule.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexModule.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import com.google.inject.AbstractModule; import com.google.inject.Scopes; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexService.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexService.java similarity index 95% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexService.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexService.java index 1a64da675e..f61a8a9879 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/ResourceIndexService.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/ResourceIndexService.java @@ -3,7 +3,7 @@ * and open the template in the editor. */ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import com.google.inject.Guice; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/SPARQLUtils.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SPARQLUtils.java similarity index 96% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/SPARQLUtils.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SPARQLUtils.java index b3a4b95295..044ac9b75a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/SPARQLUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SPARQLUtils.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import java.util.ArrayList; import java.util.List; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/SolrResourceIndex.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SolrResourceIndex.java similarity index 99% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/SolrResourceIndex.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SolrResourceIndex.java index 6d65084614..0a88a499ee 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/SolrResourceIndex.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/SolrResourceIndex.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.resourceindex; +package cz.incad.kramerius.fedora.om.resourceindex; import com.google.inject.Inject; import com.google.inject.name.Named; diff --git a/shared/common/src/main/java/cz/incad/kramerius/resourceindex/res/resource.xml b/shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/res/resource.xml similarity index 100% rename from shared/common/src/main/java/cz/incad/kramerius/resourceindex/res/resource.xml rename to shared/common/src/main/java/cz/incad/kramerius/fedora/om/resourceindex/res/resource.xml diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraUtils.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/AkubraUtils.java similarity index 98% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraUtils.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/utils/AkubraUtils.java index 34636b876c..c266e9fc55 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/om/impl/AkubraUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/AkubraUtils.java @@ -1,9 +1,10 @@ -package cz.incad.kramerius.fedora.om.impl; +package cz.incad.kramerius.fedora.utils; import com.qbizm.kramerius.imp.jaxb.DatastreamType; import com.qbizm.kramerius.imp.jaxb.DatastreamVersionType; import com.qbizm.kramerius.imp.jaxb.DigitalObject; import com.qbizm.kramerius.imp.jaxb.PropertyType; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.utils.SafeSimpleDateFormat; import cz.incad.kramerius.utils.XMLUtils; import cz.incad.kramerius.utils.conf.KConfiguration; @@ -28,7 +29,6 @@ import java.nio.charset.Charset; import java.text.ParseException; import java.util.Date; -import java.util.GregorianCalendar; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/EhCacheProvider.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/EhCacheProvider.java similarity index 92% rename from shared/common/src/main/java/cz/incad/kramerius/fedora/EhCacheProvider.java rename to shared/common/src/main/java/cz/incad/kramerius/fedora/utils/EhCacheProvider.java index 0065b8beb9..4b5ba1e4b3 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/EhCacheProvider.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/EhCacheProvider.java @@ -1,4 +1,4 @@ -package cz.incad.kramerius.fedora; +package cz.incad.kramerius.fedora.utils; import com.google.inject.Provider; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Fedora4Utils.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Fedora4Utils.java index d0d1160473..16b684de5a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Fedora4Utils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Fedora4Utils.java @@ -1,8 +1,8 @@ package cz.incad.kramerius.fedora.utils; import cz.incad.kramerius.FedoraNamespaces; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.utils.StringUtils; import cz.incad.kramerius.utils.XMLUtils; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/FedoraURLConnection.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/FedoraURLConnection.java index 83a8a40937..ef7b0cfd13 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/FedoraURLConnection.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/FedoraURLConnection.java @@ -6,7 +6,7 @@ import java.net.URLConnection; import java.util.StringTokenizer; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class FedoraURLConnection extends URLConnection { diff --git a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Handler.java b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Handler.java index b53228adce..b773b393a5 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Handler.java +++ b/shared/common/src/main/java/cz/incad/kramerius/fedora/utils/Handler.java @@ -8,7 +8,7 @@ import com.google.inject.Inject; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class Handler extends URLStreamHandler { diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/DeepZoomFlagServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/DeepZoomFlagServiceImpl.java index bcef2567cf..d040ec3c95 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/DeepZoomFlagServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/DeepZoomFlagServiceImpl.java @@ -19,15 +19,15 @@ import java.io.IOException; import java.util.concurrent.locks.Lock; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.RepositoryObject; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryObject; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.fedora.utils.Fedora4Utils; import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessor; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/Fedora3StreamsDiscStructure.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/Fedora3StreamsDiscStructure.java index 00def18d73..143abc48af 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/Fedora3StreamsDiscStructure.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/Fedora3StreamsDiscStructure.java @@ -17,7 +17,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.DiscStrucutreForStore; import cz.incad.kramerius.imaging.paths.Path; import cz.incad.kramerius.imaging.paths.impl.DirPathImpl; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImpl.java index 5d04fe81c9..5a9fb9999a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImpl.java @@ -15,7 +15,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessor; import cz.incad.kramerius.imaging.DeepZoomCacheService; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/TileSupportImpl.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/TileSupportImpl.java index 1fc46d8391..c2d85a99ca 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/TileSupportImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/impl/TileSupportImpl.java @@ -11,7 +11,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.DeepZoomFullImageScaleFactor; import cz.incad.kramerius.imaging.DeepZoomTileSupport; import cz.incad.kramerius.utils.FedoraUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/DeleteGeneratedDeepZoomCache.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/DeleteGeneratedDeepZoomCache.java index 2deab80b1a..8a9dd74681 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/DeleteGeneratedDeepZoomCache.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/DeleteGeneratedDeepZoomCache.java @@ -29,7 +29,7 @@ import com.google.inject.Key; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessor; import cz.incad.kramerius.imaging.DiscStrucutreForStore; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/GenerateThumbnail.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/GenerateThumbnail.java index 4f2aace0bb..fbe05c2623 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/GenerateThumbnail.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/GenerateThumbnail.java @@ -18,12 +18,12 @@ import com.google.inject.Key; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessor; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.imaging.DeepZoomTileSupport; import cz.incad.kramerius.imaging.DiscStrucutreForStore; import cz.incad.kramerius.imaging.lp.guice.Fedora3Module; diff --git a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/guice/GenerateDeepZoomCacheModule.java b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/guice/GenerateDeepZoomCacheModule.java index 5c58a35c68..21ae3b9bba 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/guice/GenerateDeepZoomCacheModule.java +++ b/shared/common/src/main/java/cz/incad/kramerius/imaging/lp/guice/GenerateDeepZoomCacheModule.java @@ -4,7 +4,7 @@ import com.google.inject.Scopes; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; import cz.incad.kramerius.imaging.DeepZoomCacheService; import cz.incad.kramerius.imaging.DeepZoomFlagService; diff --git a/shared/common/src/main/java/cz/incad/kramerius/impl/MostDesirableImpl.java b/shared/common/src/main/java/cz/incad/kramerius/impl/MostDesirableImpl.java index 8e049e6c5f..d417362608 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/impl/MostDesirableImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/impl/MostDesirableImpl.java @@ -16,7 +16,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.MostDesirable; import cz.incad.kramerius.utils.conf.KConfiguration; import cz.incad.kramerius.utils.database.JDBCQueryTemplate; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/commands/render/RenderPDF.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/commands/render/RenderPDF.java index 81eb0fe7b8..d67678cf21 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/commands/render/RenderPDF.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/commands/render/RenderPDF.java @@ -42,7 +42,7 @@ import com.lowagie.text.pdf.PdfWriter; import com.lowagie.text.pdf.draw.LineSeparator; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.pdf.commands.AbstractITextCommand.Hyphenation; import cz.incad.kramerius.pdf.commands.ITextCommand; import cz.incad.kramerius.pdf.commands.ITextCommandProcessListener; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImpl.java index 96988ca38e..488f5233d1 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImpl.java @@ -48,7 +48,7 @@ import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfWriter; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.model.AbstractPage; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/GeneratePDFServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/GeneratePDFServiceImpl.java index 6bace68c85..79e79f4b54 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/GeneratePDFServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/GeneratePDFServiceImpl.java @@ -10,6 +10,7 @@ import cz.incad.kramerius.*; import cz.incad.kramerius.document.DocumentService; import cz.incad.kramerius.document.model.*; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.ImageStreams; import cz.incad.kramerius.pdf.Break; import cz.incad.kramerius.pdf.GeneratePDFService; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/ImageFetcher.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/ImageFetcher.java index 9c6061fd68..12d7539a47 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/ImageFetcher.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/ImageFetcher.java @@ -7,7 +7,7 @@ import javax.xml.xpath.XPathExpressionException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.ImageStreams; import cz.incad.kramerius.utils.imgs.ImageMimeType; import cz.incad.kramerius.utils.imgs.KrameriusImageSupport; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/STUtils.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/STUtils.java index 7a4bfccf33..7f9a56dc25 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/STUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/STUtils.java @@ -18,7 +18,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.utils.IOUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/SimplePDFServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/SimplePDFServiceImpl.java index 6960828e75..a355d11bc6 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/SimplePDFServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/impl/SimplePDFServiceImpl.java @@ -29,7 +29,7 @@ import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfWriter; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.DocumentService; import cz.incad.kramerius.document.model.AbstractPage; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/FedoraDescribeUtils.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/FedoraDescribeUtils.java index 59427eea36..cab1c90e8d 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/FedoraDescribeUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/FedoraDescribeUtils.java @@ -22,7 +22,7 @@ import org.w3c.dom.Document; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; public class FedoraDescribeUtils { diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/ModsUtils.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/ModsUtils.java index f31823db63..7b25828adb 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/ModsUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/ModsUtils.java @@ -32,7 +32,7 @@ import org.w3c.dom.NodeList; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.FedoraNamespaces; diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesMapUtils.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesMapUtils.java index 52076a81ff..2dea1dd1f7 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesMapUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesMapUtils.java @@ -22,7 +22,7 @@ import org.w3c.dom.Document; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.DCUtils; public class TitlesMapUtils { diff --git a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesUtils.java b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesUtils.java index 6ad645619a..2b21b568b2 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/pdf/utils/TitlesUtils.java @@ -26,7 +26,7 @@ import org.antlr.stringtemplate.StringTemplate; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; diff --git a/shared/common/src/main/java/cz/incad/kramerius/printing/impl/PrintingServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/printing/impl/PrintingServiceImpl.java index 7b7275588e..f702130c20 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/printing/impl/PrintingServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/printing/impl/PrintingServiceImpl.java @@ -64,7 +64,7 @@ import com.google.inject.name.Named; import com.lowagie.text.DocumentException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.SolrAccess; diff --git a/shared/common/src/main/java/cz/incad/kramerius/processes/RemovePolicyProcess.java b/shared/common/src/main/java/cz/incad/kramerius/processes/RemovePolicyProcess.java index 5f1d1afd3e..c67be11992 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/processes/RemovePolicyProcess.java +++ b/shared/common/src/main/java/cz/incad/kramerius/processes/RemovePolicyProcess.java @@ -4,11 +4,11 @@ import com.google.inject.Injector; import com.google.inject.Key; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.processes.new_api.ProcessScheduler; import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.Dom4jUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/processes/SetPolicyProcess.java b/shared/common/src/main/java/cz/incad/kramerius/processes/SetPolicyProcess.java index a8eef9e5a4..62c9a73c24 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/processes/SetPolicyProcess.java +++ b/shared/common/src/main/java/cz/incad/kramerius/processes/SetPolicyProcess.java @@ -4,11 +4,11 @@ import com.google.inject.Injector; import com.google.inject.Key; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.processes.new_api.ProcessScheduler; import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.Dom4jUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/processes/starter/ProcessStarter.java b/shared/common/src/main/java/cz/incad/kramerius/processes/starter/ProcessStarter.java index 7861bc6799..8c711115ed 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/processes/starter/ProcessStarter.java +++ b/shared/common/src/main/java/cz/incad/kramerius/processes/starter/ProcessStarter.java @@ -36,14 +36,7 @@ import java.util.Properties; import java.util.logging.Level; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; -import cz.incad.kramerius.processes.States; -import cz.incad.kramerius.processes.WarningException; -import cz.incad.kramerius.processes.annotations.ParameterName; -import cz.incad.kramerius.processes.annotations.Process; -import cz.incad.kramerius.processes.logging.LoggingLoader; -import cz.incad.kramerius.processes.utils.ProcessUtils; -import cz.incad.kramerius.utils.IPAddressUtils; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; /** * Process starting point diff --git a/shared/common/src/main/java/cz/incad/kramerius/relation/RelationUtils.java b/shared/common/src/main/java/cz/incad/kramerius/relation/RelationUtils.java index acf5f3c4e4..aaa6bdd87b 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/relation/RelationUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/relation/RelationUtils.java @@ -17,7 +17,7 @@ package cz.incad.kramerius.relation; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.KrameriusModels; import cz.incad.kramerius.relation.impl.RelationModelImpl; import cz.incad.kramerius.utils.XMLUtils; diff --git a/shared/common/src/main/java/cz/incad/kramerius/relation/impl/RelationServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/relation/impl/RelationServiceImpl.java index 61b3fbf930..7924cd5f01 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/relation/impl/RelationServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/relation/impl/RelationServiceImpl.java @@ -20,8 +20,9 @@ import com.google.inject.Inject; import com.google.inject.name.Named; import cz.incad.kramerius.*; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; import cz.incad.kramerius.relation.Relation; import cz.incad.kramerius.relation.RelationModel; import cz.incad.kramerius.relation.RelationService; diff --git a/shared/common/src/main/java/cz/incad/kramerius/repository/ExtractStructureHelper.java b/shared/common/src/main/java/cz/incad/kramerius/repository/ExtractStructureHelper.java index bc2ed59b80..9682c22394 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/repository/ExtractStructureHelper.java +++ b/shared/common/src/main/java/cz/incad/kramerius/repository/ExtractStructureHelper.java @@ -17,7 +17,7 @@ import org.json.JSONArray; import org.json.JSONObject; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.utils.java.Pair; // helper utility used for extracting structure information diff --git a/shared/common/src/main/java/cz/incad/kramerius/repository/KrameriusRepositoryAccessAdapter.java b/shared/common/src/main/java/cz/incad/kramerius/repository/KrameriusRepositoryAccessAdapter.java index e5838fcd7f..5fe897a16a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/repository/KrameriusRepositoryAccessAdapter.java +++ b/shared/common/src/main/java/cz/incad/kramerius/repository/KrameriusRepositoryAccessAdapter.java @@ -1,9 +1,9 @@ package cz.incad.kramerius.repository; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.repository.utils.Utils; -import cz.incad.kramerius.resourceindex.IResourceIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import org.dom4j.Document; import java.io.IOException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/RightCriteriumContext.java b/shared/common/src/main/java/cz/incad/kramerius/security/RightCriteriumContext.java index ceb23a232d..22aba59a8e 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/RightCriteriumContext.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/RightCriteriumContext.java @@ -18,7 +18,7 @@ import java.util.Map; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.security.licenses.lock.ExclusiveLockMaps; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/SecuredFedoraAccessImpl.java b/shared/common/src/main/java/cz/incad/kramerius/security/SecuredFedoraAccessImpl.java index 5bea2ba070..2a91d1aa7a 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/SecuredFedoraAccessImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/SecuredFedoraAccessImpl.java @@ -19,11 +19,12 @@ import com.google.inject.Inject; import com.google.inject.name.Named; import cz.incad.kramerius.*; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.RepositoryAccess; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.imaging.DiscStrucutreForStore; -import cz.incad.kramerius.resourceindex.IResourceIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import cz.incad.kramerius.utils.FedoraUtils; import cz.incad.kramerius.utils.conf.KConfiguration; import org.w3c.dom.Document; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightCriteriumContextFactoryImpl.java b/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightCriteriumContextFactoryImpl.java index 44c17a37fc..eb0f2415ac 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightCriteriumContextFactoryImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightCriteriumContextFactoryImpl.java @@ -19,7 +19,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.security.*; import cz.incad.kramerius.security.licenses.lock.ExclusiveLockMaps; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightParamEvaluatingContextImpl.java b/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightParamEvaluatingContextImpl.java index 3bf39139c6..29c6b66941 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightParamEvaluatingContextImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/impl/RightParamEvaluatingContextImpl.java @@ -22,7 +22,7 @@ import cz.incad.kramerius.security.*; import cz.incad.kramerius.security.licenses.lock.ExclusiveLockMaps; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/BenevolentModelFilter.java b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/BenevolentModelFilter.java index ac04dac039..c27ebcbf0b 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/BenevolentModelFilter.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/BenevolentModelFilter.java @@ -20,7 +20,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.security.*; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilter.java b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilter.java index 105c29d44b..6ea2fb069d 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilter.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilter.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.security.impl.criteria; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.security.*; diff --git a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/utils/CriteriaRELSEXTUtils.java b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/utils/CriteriaRELSEXTUtils.java index 0d474ff466..df24ae1b42 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/utils/CriteriaRELSEXTUtils.java +++ b/shared/common/src/main/java/cz/incad/kramerius/security/impl/criteria/utils/CriteriaRELSEXTUtils.java @@ -1,6 +1,6 @@ package cz.incad.kramerius.security.impl.criteria.utils; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.security.EvaluatingResultState; import cz.incad.kramerius.security.RightCriteriumContext; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/DeleteService.java b/shared/common/src/main/java/cz/incad/kramerius/service/DeleteService.java index a5cdb41c6b..c62cd239d0 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/DeleteService.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/DeleteService.java @@ -1,8 +1,8 @@ package cz.incad.kramerius.service; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; import org.apache.solr.client.solrj.SolrServerException; import java.io.IOException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/DeleteServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/DeleteServiceImpl.java index 6d6c2c5d05..9d0822737e 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/DeleteServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/DeleteServiceImpl.java @@ -8,20 +8,20 @@ import com.google.inject.Key; import com.google.inject.name.Named; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.model.DCConent; import cz.incad.kramerius.document.model.utils.DCContentUtils; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import cz.incad.kramerius.fedora.utils.Fedora4Utils; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; import cz.incad.kramerius.processes.starter.ProcessStarter; -import cz.incad.kramerius.resourceindex.IResourceIndex; -import cz.incad.kramerius.resourceindex.ResourceIndexException; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.resourceindex.IResourceIndex; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexException; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.service.DeleteService; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/ExportServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/ExportServiceImpl.java index c849b04f44..4468cc601e 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/ExportServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/ExportServiceImpl.java @@ -3,10 +3,11 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.impl.SolrAccessImplNewIndex; import cz.incad.kramerius.service.ExportService; import cz.incad.kramerius.utils.IOUtils; @@ -176,7 +177,7 @@ private void store(File exportDirectory, String name, InputStream is) { */ public static void main(String[] args) throws IOException, TransformerException, SAXException, ParserConfigurationException { LOGGER.info("Export service: " + Arrays.toString(args)); - com.google.inject.Injector injector = com.google.inject.Guice.createInjector(new cz.incad.kramerius.solr.SolrModule(), new cz.incad.kramerius.resourceindex.ResourceIndexModule(), new cz.incad.kramerius.fedora.RepoModule(), new cz.incad.kramerius.statistics.NullStatisticsModule()); + com.google.inject.Injector injector = com.google.inject.Guice.createInjector(new cz.incad.kramerius.solr.SolrModule(), new ResourceIndexModule(), new cz.incad.kramerius.fedora.RepoModule(), new cz.incad.kramerius.statistics.NullStatisticsModule()); RepositoryAccess fa = injector.getInstance(com.google.inject.Key.get(RepositoryAccess.class, com.google.inject.name.Names.named("rawFedoraAccess"))); Boolean exportParents = null; if (args.length > 1) { diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/METSServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/METSServiceImpl.java index d8a59861f0..8986d99bd9 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/METSServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/METSServiceImpl.java @@ -7,7 +7,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.service.METSService; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/PolicyServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/PolicyServiceImpl.java index 371ff642f7..3e4568ee31 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/PolicyServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/PolicyServiceImpl.java @@ -26,11 +26,11 @@ import com.google.inject.name.Names; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.fedora.RepoModule; -import cz.incad.kramerius.fedora.om.AkubraRepository; -import cz.incad.kramerius.fedora.om.RepositoryDatastream; -import cz.incad.kramerius.fedora.om.RepositoryException; -import cz.incad.kramerius.fedora.om.impl.AkubraDOManager; -import cz.incad.kramerius.resourceindex.ResourceIndexModule; +import cz.incad.kramerius.fedora.om.repository.AkubraRepository; +import cz.incad.kramerius.fedora.om.repository.RepositoryDatastream; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; +import cz.incad.kramerius.fedora.om.repository.impl.AkubraDOManager; +import cz.incad.kramerius.fedora.om.resourceindex.ResourceIndexModule; import cz.incad.kramerius.solr.SolrModule; import cz.incad.kramerius.statistics.NullStatisticsModule; import cz.incad.kramerius.utils.FedoraUtils; @@ -46,7 +46,7 @@ import com.google.inject.Inject; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.processes.starter.ProcessStarter; import cz.incad.kramerius.service.PolicyService; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/ReplicationServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/ReplicationServiceImpl.java index 04306ccd80..74ec77a27c 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/ReplicationServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/ReplicationServiceImpl.java @@ -35,7 +35,7 @@ import com.google.inject.Injector; import com.google.inject.name.Named; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/service/impl/SortingServiceImpl.java b/shared/common/src/main/java/cz/incad/kramerius/service/impl/SortingServiceImpl.java index a4b57e9ad3..d3847746d0 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/service/impl/SortingServiceImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/service/impl/SortingServiceImpl.java @@ -20,7 +20,7 @@ import com.google.inject.name.Named; import com.ibm.icu.text.Collator; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.KrameriusModels; import cz.incad.kramerius.relation.Relation; diff --git a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/database/DatabaseStatisticsAccessLogImpl.java b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/database/DatabaseStatisticsAccessLogImpl.java index dc1f22152b..714ee94551 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/database/DatabaseStatisticsAccessLogImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/database/DatabaseStatisticsAccessLogImpl.java @@ -39,6 +39,7 @@ import cz.incad.kramerius.*; import cz.incad.kramerius.database.VersionService; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.security.RightsReturnObject; import cz.incad.kramerius.security.impl.criteria.utils.CriteriaLicenseUtils; import cz.incad.kramerius.statistics.accesslogs.AbstractStatisticsAccessLog; diff --git a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/dnnt/DNNTStatisticsAccessLogImpl.java b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/dnnt/DNNTStatisticsAccessLogImpl.java index ead4bab18d..1f6959f869 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/dnnt/DNNTStatisticsAccessLogImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/dnnt/DNNTStatisticsAccessLogImpl.java @@ -4,6 +4,7 @@ import com.google.inject.Provider; import com.google.inject.name.Named; import cz.incad.kramerius.*; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.pdf.utils.ModsUtils; import cz.incad.kramerius.security.RightsReturnObject; import cz.incad.kramerius.security.SpecialObjects; diff --git a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/solr/SolrStatisticsAccessLogImpl.java b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/solr/SolrStatisticsAccessLogImpl.java index c756375cdb..d9553d76fd 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/solr/SolrStatisticsAccessLogImpl.java +++ b/shared/common/src/main/java/cz/incad/kramerius/statistics/accesslogs/solr/SolrStatisticsAccessLogImpl.java @@ -43,7 +43,7 @@ import com.google.inject.name.Named; import com.sun.jersey.api.client.Client; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectModelsPath; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; diff --git a/shared/common/src/main/java/cz/incad/kramerius/statistics/impl/NKPLogReport.java b/shared/common/src/main/java/cz/incad/kramerius/statistics/impl/NKPLogReport.java index c962924210..c85add0dc1 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/statistics/impl/NKPLogReport.java +++ b/shared/common/src/main/java/cz/incad/kramerius/statistics/impl/NKPLogReport.java @@ -29,7 +29,7 @@ import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.WebResource; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.database.VersionService; import cz.incad.kramerius.statistics.ReportedAction; diff --git a/shared/common/src/main/java/cz/incad/kramerius/utils/RelsExtHelper.java b/shared/common/src/main/java/cz/incad/kramerius/utils/RelsExtHelper.java index 17f9dab80a..d61ea790a2 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/utils/RelsExtHelper.java +++ b/shared/common/src/main/java/cz/incad/kramerius/utils/RelsExtHelper.java @@ -37,7 +37,7 @@ import org.w3c.dom.Element; import org.w3c.dom.Text; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.FedoraNamespaceContext; import cz.incad.kramerius.FedoraNamespaces; import cz.incad.kramerius.utils.pid.LexerException; diff --git a/shared/common/src/main/java/cz/incad/kramerius/utils/imgs/KrameriusImageSupport.java b/shared/common/src/main/java/cz/incad/kramerius/utils/imgs/KrameriusImageSupport.java index 75a3c26ff2..c524aec150 100644 --- a/shared/common/src/main/java/cz/incad/kramerius/utils/imgs/KrameriusImageSupport.java +++ b/shared/common/src/main/java/cz/incad/kramerius/utils/imgs/KrameriusImageSupport.java @@ -5,7 +5,7 @@ import com.lizardtech.djvu.DjVuPage; import com.lizardtech.djvubean.DjVuImage; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.utils.Handler; import cz.incad.kramerius.utils.IOUtils; import cz.incad.kramerius.utils.conf.KConfiguration; diff --git a/shared/common/src/test/java/cz/incad/kramerius/ObjectPidsPathTest.java b/shared/common/src/test/java/cz/incad/kramerius/ObjectPidsPathTest.java index c49d078922..0cc552b9ac 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/ObjectPidsPathTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/ObjectPidsPathTest.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.List; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.XMLUtils; import org.easymock.EasyMock; import org.json.JSONException; diff --git a/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest.java b/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest.java index a3170fcd69..20d5c6d611 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest.java @@ -27,7 +27,7 @@ import com.google.inject.Key; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.utils.FedoraUtils; import junit.framework.Assert; diff --git a/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest2.java b/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest2.java index bd73fc45c6..06b16d90d0 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest2.java +++ b/shared/common/src/test/java/cz/incad/kramerius/document/DocumentServiceTest2.java @@ -5,7 +5,6 @@ import javax.xml.parsers.ParserConfigurationException; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; import junit.framework.Assert; import org.junit.Ignore; diff --git a/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceModule.java b/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceModule.java index a44038e9fd..7a3efd637b 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceModule.java +++ b/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceModule.java @@ -6,7 +6,7 @@ import com.google.inject.Provides; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.document.impl.DocumentServiceImpl; import cz.incad.kramerius.service.ResourceBundleService; diff --git a/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceTestPrepare.java b/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceTestPrepare.java index 596e3f46f0..bd27166423 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceTestPrepare.java +++ b/shared/common/src/test/java/cz/incad/kramerius/document/_DocumentServiceTestPrepare.java @@ -15,8 +15,8 @@ import javax.xml.parsers.ParserConfigurationException; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import org.apache.commons.configuration.Configuration; diff --git a/shared/common/src/test/java/cz/incad/kramerius/document/model/utils/DCContentUtilsTest.java b/shared/common/src/test/java/cz/incad/kramerius/document/model/utils/DCContentUtilsTest.java index 3347678c10..f03864d36b 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/document/model/utils/DCContentUtilsTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/document/model/utils/DCContentUtilsTest.java @@ -31,7 +31,7 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.utils.XMLUtils; diff --git a/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java b/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java index 43de508e83..f81d506f23 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java +++ b/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/DataPrepare.java @@ -33,7 +33,7 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.utils.IOUtils; import cz.incad.kramerius.utils.XMLUtils; diff --git a/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/FedoraAccess4xImplTest.java b/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/FedoraAccess4xImplTest.java index 185c343b81..d1c93425de 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/FedoraAccess4xImplTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/fedora/impl/FedoraAccess4xImplTest.java @@ -2,8 +2,8 @@ import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.TreeNodeProcessor; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import cz.incad.kramerius.utils.pid.LexerException; import junit.framework.Assert; diff --git a/shared/common/src/test/java/cz/incad/kramerius/fedora/om/RELSEXTSPARQLBuilderImplTest.java b/shared/common/src/test/java/cz/incad/kramerius/fedora/om/RELSEXTSPARQLBuilderImplTest.java index 703e113fe0..a02dbc91dd 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/fedora/om/RELSEXTSPARQLBuilderImplTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/fedora/om/RELSEXTSPARQLBuilderImplTest.java @@ -1,6 +1,7 @@ package cz.incad.kramerius.fedora.om; -import cz.incad.kramerius.fedora.om.impl.RELSEXTSPARQLBuilderImpl; +import cz.incad.kramerius.fedora.om.repository.impl.RELSEXTSPARQLBuilderImpl; +import cz.incad.kramerius.fedora.om.repository.RepositoryException; import junit.framework.TestCase; import org.apache.commons.io.IOUtils; import org.junit.Assert; diff --git a/shared/common/src/test/java/cz/incad/kramerius/fedora/om/impl/AkubraUtilsDateFormatTest.java b/shared/common/src/test/java/cz/incad/kramerius/fedora/om/impl/AkubraUtilsDateFormatTest.java index 1b832986a3..0c9cc94696 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/fedora/om/impl/AkubraUtilsDateFormatTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/fedora/om/impl/AkubraUtilsDateFormatTest.java @@ -1,5 +1,6 @@ package cz.incad.kramerius.fedora.om.impl; +import cz.incad.kramerius.fedora.utils.AkubraUtils; import cz.incad.kramerius.utils.SafeSimpleDateFormat; import org.junit.Test; diff --git a/shared/common/src/test/java/cz/incad/kramerius/imaging/DeepZoomTileSupportTest.java b/shared/common/src/test/java/cz/incad/kramerius/imaging/DeepZoomTileSupportTest.java index 80fc4b7ac9..2a49cce5de 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/imaging/DeepZoomTileSupportTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/imaging/DeepZoomTileSupportTest.java @@ -15,7 +15,7 @@ import com.google.inject.name.Names; import cz.incad.kramerius.AbstractGuiceTestCase; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.impl.TileSupportImpl; @Ignore diff --git a/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImplTest.java b/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImplTest.java index a063dc1712..0ba829cace 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImplTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/FileSystemCacheServiceImplTest.java @@ -52,7 +52,7 @@ import com.google.inject.name.Names; import cz.incad.kramerius.AbstractGuiceTestCase; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.fedora.impl.DataPrepare; import cz.incad.kramerius.imaging.DeepZoomCacheService; diff --git a/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/TileSupportImplTest.java b/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/TileSupportImplTest.java index 01547ec3a0..4ebe5bf901 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/TileSupportImplTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/imaging/impl/TileSupportImplTest.java @@ -33,7 +33,7 @@ import com.google.inject.name.Names; import cz.incad.kramerius.AbstractGuiceTestCase; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.imaging.DeepZoomTileSupport; /** diff --git a/shared/common/src/test/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImplTest.java b/shared/common/src/test/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImplTest.java index 45547a419d..cce9e3c435 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImplTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/pdf/impl/FirstPagePDFServiceImplTest.java @@ -34,8 +34,8 @@ import javax.xml.xpath.XPathExpressionException; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import junit.framework.Assert; @@ -57,7 +57,7 @@ import com.google.inject.name.Names; import com.lowagie.text.DocumentException; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.ObjectPidsPath; import cz.incad.kramerius.ProcessSubtreeException; import cz.incad.kramerius.SolrAccess; diff --git a/shared/common/src/test/java/cz/incad/kramerius/pdf/utils/SimpleFedoraAccessModule.java b/shared/common/src/test/java/cz/incad/kramerius/pdf/utils/SimpleFedoraAccessModule.java index 96a1b0ca65..47718fbff1 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/pdf/utils/SimpleFedoraAccessModule.java +++ b/shared/common/src/test/java/cz/incad/kramerius/pdf/utils/SimpleFedoraAccessModule.java @@ -18,7 +18,7 @@ import com.google.inject.AbstractModule; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; public class SimpleFedoraAccessModule extends AbstractModule { diff --git a/shared/common/src/test/java/cz/incad/kramerius/relation/RelationGuiceModule.java b/shared/common/src/test/java/cz/incad/kramerius/relation/RelationGuiceModule.java index 0ced4491e5..dabf0522f3 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/relation/RelationGuiceModule.java +++ b/shared/common/src/test/java/cz/incad/kramerius/relation/RelationGuiceModule.java @@ -20,7 +20,7 @@ import com.google.inject.AbstractModule; import com.google.inject.Scopes; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.relation.impl.RelationServiceImpl; import org.easymock.EasyMock; diff --git a/shared/common/src/test/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPidTest.java b/shared/common/src/test/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPidTest.java index 1d642d1821..ef1210b844 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPidTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/resourceindex/ProcessingIndexRebuildFromFoxmlByPidTest.java @@ -1,5 +1,6 @@ package cz.incad.kramerius.resourceindex; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexRebuildFromFoxmlByPid; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/shared/common/src/test/java/cz/incad/kramerius/security/guice/MockRightCriteriumContextGuiceMudule.java b/shared/common/src/test/java/cz/incad/kramerius/security/guice/MockRightCriteriumContextGuiceMudule.java index 5f7a8563a0..aa3819addb 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/security/guice/MockRightCriteriumContextGuiceMudule.java +++ b/shared/common/src/test/java/cz/incad/kramerius/security/guice/MockRightCriteriumContextGuiceMudule.java @@ -21,7 +21,7 @@ import com.google.inject.AbstractModule; import com.google.inject.name.Names; -import cz.incad.kramerius.RepositoryAccess; +import cz.incad.kramerius.fedora.RepositoryAccess; import cz.incad.kramerius.SolrAccess; public class MockRightCriteriumContextGuiceMudule extends AbstractModule { diff --git a/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilterTest.java b/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilterTest.java index b982ab79f7..0488331014 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilterTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/CoverAndContentFilterTest.java @@ -15,8 +15,8 @@ import cz.incad.kramerius.SolrAccess; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.security.EvaluatingResultState; import cz.incad.kramerius.security.RightCriteriumContext; import cz.incad.kramerius.security.RightCriteriumException; diff --git a/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/WindowTest.java b/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/WindowTest.java index e36fea5730..4fc0fceac3 100644 --- a/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/WindowTest.java +++ b/shared/common/src/test/java/cz/incad/kramerius/security/impl/criteria/WindowTest.java @@ -10,8 +10,8 @@ import javax.xml.parsers.ParserConfigurationException; import cz.incad.kramerius.fedora.impl.RepositoryAccessImpl; -import cz.incad.kramerius.fedora.om.impl.HazelcastServerNode; -import cz.incad.kramerius.resourceindex.ProcessingIndexFeeder; +import cz.incad.kramerius.fedora.om.repository.impl.HazelcastServerNode; +import cz.incad.kramerius.fedora.om.resourceindex.ProcessingIndexFeeder; import cz.incad.kramerius.security.EvaluatingResultState; import cz.incad.kramerius.statistics.accesslogs.AggregatedAccessLogs; import junit.framework.Assert; diff --git a/shared/common/src/test/resources/cz/incad/kramerius/resourceindex/SPARQLUtilsTest.java b/shared/common/src/test/resources/cz/incad/kramerius/resourceindex/SPARQLUtilsTest.java index 3c1d768eab..37958d4fe4 100644 --- a/shared/common/src/test/resources/cz/incad/kramerius/resourceindex/SPARQLUtilsTest.java +++ b/shared/common/src/test/resources/cz/incad/kramerius/resourceindex/SPARQLUtilsTest.java @@ -7,6 +7,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; +import cz.incad.kramerius.fedora.om.resourceindex.SPARQLUtils; import org.w3c.dom.Document; import org.xml.sax.SAXException;