@Service(value="davResourceFactory#archiva") public class ArchivaDavResourceFactory extends Object implements org.apache.jackrabbit.webdav.DavResourceFactory, Auditable
Modifier and Type | Class and Description |
---|---|
private static class |
ArchivaDavResourceFactory.LogicalResource |
Modifier and Type | Field and Description |
---|---|
private org.springframework.context.ApplicationContext |
applicationContext |
private ArchivaConfiguration |
archivaConfiguration |
private List<AuditListener> |
auditListeners |
private org.codehaus.plexus.digest.ChecksumFile |
checksum |
private RepositoryProxyConnectors |
connectors |
private org.codehaus.plexus.digest.Digester |
digestMd5 |
private org.codehaus.plexus.digest.Digester |
digestSha1 |
private FileLockManager |
fileLockManager |
private static String |
HTTP_PUT_METHOD |
private org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator |
httpAuth |
private IndexMerger |
indexMerger |
private org.apache.jackrabbit.webdav.lock.LockManager |
lockManager
Lock Manager - use simple implementation from JackRabbit
|
private org.slf4j.Logger |
log |
private ManagedRepositoryAdmin |
managedRepositoryAdmin |
private MetadataTools |
metadataTools |
private MimeTypes |
mimeTypes |
private static String |
PROXIED_SUFFIX |
private RemoteRepositoryAdmin |
remoteRepositoryAdmin |
private RepositoryContentFactory |
repositoryFactory |
private RepositoryRequest |
repositoryRequest |
private RepositorySearch |
repositorySearch |
private RepositoryArchivaTaskScheduler |
scheduler |
private ServletAuthenticator |
servletAuth |
Constructor and Description |
---|
ArchivaDavResourceFactory(org.springframework.context.ApplicationContext applicationContext,
PlexusSisuBridge plexusSisuBridge,
ArchivaConfiguration archivaConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
addAuditListener(AuditListener listener)
Add an AuditListener.
|
private String |
addHrefPrefix(String contextPath,
String path) |
protected File |
buildMergedIndexDirectory(List<String> repositories,
String activePrincipal,
org.apache.jackrabbit.webdav.DavServletRequest request,
RepositoryGroupConfiguration repositoryGroupConfiguration) |
private ArchivaDavResourceLocator |
checkLocatorIsInstanceOfRepositoryLocator(org.apache.jackrabbit.webdav.DavResourceLocator locator) |
void |
clearAuditListeners()
Remove all registered
AuditListener objects. |
private void |
createChecksumFile(String path,
org.codehaus.plexus.digest.Digester digester) |
org.apache.jackrabbit.webdav.DavResource |
createResource(org.apache.jackrabbit.webdav.DavResourceLocator locator,
org.apache.jackrabbit.webdav.DavServletRequest request,
org.apache.jackrabbit.webdav.DavServletResponse response) |
org.apache.jackrabbit.webdav.DavResource |
createResource(org.apache.jackrabbit.webdav.DavResourceLocator locator,
org.apache.jackrabbit.webdav.DavSession davSession) |
private String |
evaluatePathWithVersion(ArchivaDavResourceLocator archivaLocator,
ManagedRepositoryContent managedRepositoryContent,
String contextPath) |
private boolean |
fetchContentFromProxies(ManagedRepositoryContent managedRepository,
org.apache.jackrabbit.webdav.DavServletRequest request,
ArchivaDavResourceFactory.LogicalResource resource) |
protected String |
getActivePrincipal(org.apache.jackrabbit.webdav.DavServletRequest request) |
private String |
getLogicalResource(ArchivaDavResourceLocator archivaLocator,
ManagedRepository managedRepository,
boolean useOrigResourcePath) |
ManagedRepositoryAdmin |
getManagedRepositoryAdmin() |
RemoteRepositoryAdmin |
getRemoteRepositoryAdmin() |
private org.apache.jackrabbit.webdav.DavResource |
getResourceFromGroup(org.apache.jackrabbit.webdav.DavServletRequest request,
List<String> repositories,
ArchivaDavResourceLocator locator,
RepositoryGroupConfiguration repositoryGroupConfiguration) |
void |
initialize() |
private boolean |
isAllowedToContinue(org.apache.jackrabbit.webdav.DavServletRequest request,
List<String> repositories,
String activePrincipal)
Check if the current user is authorized to access any of the repos
|
protected boolean |
isAuthorized(org.apache.jackrabbit.webdav.DavServletRequest request,
String repositoryId) |
private boolean |
isProjectReference(String requestedResource) |
private org.apache.jackrabbit.webdav.DavResource |
processRepository(org.apache.jackrabbit.webdav.DavServletRequest request,
ArchivaDavResourceLocator archivaLocator,
String activePrincipal,
ManagedRepositoryContent managedRepositoryContent,
ManagedRepository managedRepository) |
private org.apache.jackrabbit.webdav.DavResource |
processRepositoryGroup(org.apache.jackrabbit.webdav.DavServletRequest request,
ArchivaDavResourceLocator archivaLocator,
List<String> repositories,
String activePrincipal,
List<String> resourcesInAbsolutePath,
RepositoryGroupConfiguration repoGroupConfig) |
void |
removeAuditListener(AuditListener listener)
Remove an AuditListener.
|
void |
setArchivaConfiguration(ArchivaConfiguration archivaConfiguration) |
void |
setConnectors(RepositoryProxyConnectors connectors) |
private void |
setHeaders(org.apache.jackrabbit.webdav.DavServletResponse response,
org.apache.jackrabbit.webdav.DavResourceLocator locator,
org.apache.jackrabbit.webdav.DavResource resource,
boolean group) |
void |
setHttpAuth(org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator httpAuth) |
void |
setManagedRepositoryAdmin(ManagedRepositoryAdmin managedRepositoryAdmin) |
void |
setRemoteRepositoryAdmin(RemoteRepositoryAdmin remoteRepositoryAdmin) |
void |
setRepositoryFactory(RepositoryContentFactory repositoryFactory) |
void |
setRepositoryRequest(RepositoryRequest repositoryRequest) |
void |
setScheduler(RepositoryArchivaTaskScheduler scheduler) |
void |
setServletAuth(ServletAuthenticator servletAuth) |
private void |
triggerAuditEvent(String remoteIP,
String repositoryId,
String resource,
String action,
String principal) |
private File |
writeMergedMetadataToFile(ArchivaRepositoryMetadata mergedMetadata,
String outputFilename) |
private static final String PROXIED_SUFFIX
private static final String HTTP_PUT_METHOD
private org.slf4j.Logger log
@Inject private List<AuditListener> auditListeners
@Inject private RepositoryContentFactory repositoryFactory
private RepositoryRequest repositoryRequest
@Inject @Named(value="repositoryProxyConnectors#default") private RepositoryProxyConnectors connectors
@Inject private MetadataTools metadataTools
private ArchivaConfiguration archivaConfiguration
@Inject private ServletAuthenticator servletAuth
@Inject @Named(value="httpAuthenticator#basic") private org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator httpAuth
@Inject private RemoteRepositoryAdmin remoteRepositoryAdmin
@Inject private ManagedRepositoryAdmin managedRepositoryAdmin
@Inject private IndexMerger indexMerger
@Inject private RepositorySearch repositorySearch
private final org.apache.jackrabbit.webdav.lock.LockManager lockManager
private org.codehaus.plexus.digest.ChecksumFile checksum
private org.codehaus.plexus.digest.Digester digestSha1
private org.codehaus.plexus.digest.Digester digestMd5
@Inject @Named(value="archivaTaskScheduler#repository") private RepositoryArchivaTaskScheduler scheduler
@Inject @Named(value="fileLockManager#default") private FileLockManager fileLockManager
private org.springframework.context.ApplicationContext applicationContext
@Inject public ArchivaDavResourceFactory(org.springframework.context.ApplicationContext applicationContext, PlexusSisuBridge plexusSisuBridge, ArchivaConfiguration archivaConfiguration) throws PlexusSisuBridgeException
PlexusSisuBridgeException
@PostConstruct public void initialize()
public org.apache.jackrabbit.webdav.DavResource createResource(org.apache.jackrabbit.webdav.DavResourceLocator locator, org.apache.jackrabbit.webdav.DavServletRequest request, org.apache.jackrabbit.webdav.DavServletResponse response) throws org.apache.jackrabbit.webdav.DavException
createResource
in interface org.apache.jackrabbit.webdav.DavResourceFactory
org.apache.jackrabbit.webdav.DavException
private org.apache.jackrabbit.webdav.DavResource processRepositoryGroup(org.apache.jackrabbit.webdav.DavServletRequest request, ArchivaDavResourceLocator archivaLocator, List<String> repositories, String activePrincipal, List<String> resourcesInAbsolutePath, RepositoryGroupConfiguration repoGroupConfig) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
private String getLogicalResource(ArchivaDavResourceLocator archivaLocator, ManagedRepository managedRepository, boolean useOrigResourcePath)
private String evaluatePathWithVersion(ArchivaDavResourceLocator archivaLocator, ManagedRepositoryContent managedRepositoryContent, String contextPath) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
private org.apache.jackrabbit.webdav.DavResource processRepository(org.apache.jackrabbit.webdav.DavServletRequest request, ArchivaDavResourceLocator archivaLocator, String activePrincipal, ManagedRepositoryContent managedRepositoryContent, ManagedRepository managedRepository) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
public org.apache.jackrabbit.webdav.DavResource createResource(org.apache.jackrabbit.webdav.DavResourceLocator locator, org.apache.jackrabbit.webdav.DavSession davSession) throws org.apache.jackrabbit.webdav.DavException
createResource
in interface org.apache.jackrabbit.webdav.DavResourceFactory
org.apache.jackrabbit.webdav.DavException
private boolean fetchContentFromProxies(ManagedRepositoryContent managedRepository, org.apache.jackrabbit.webdav.DavServletRequest request, ArchivaDavResourceFactory.LogicalResource resource) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
private void triggerAuditEvent(String remoteIP, String repositoryId, String resource, String action, String principal)
public void addAuditListener(AuditListener listener)
Auditable
addAuditListener
in interface Auditable
listener
- the listener to add.public void clearAuditListeners()
Auditable
AuditListener
objects.clearAuditListeners
in interface Auditable
public void removeAuditListener(AuditListener listener)
Auditable
removeAuditListener
in interface Auditable
listener
- the listener to remove.private void setHeaders(org.apache.jackrabbit.webdav.DavServletResponse response, org.apache.jackrabbit.webdav.DavResourceLocator locator, org.apache.jackrabbit.webdav.DavResource resource, boolean group)
private ArchivaDavResourceLocator checkLocatorIsInstanceOfRepositoryLocator(org.apache.jackrabbit.webdav.DavResourceLocator locator) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
private String addHrefPrefix(String contextPath, String path)
protected boolean isAuthorized(org.apache.jackrabbit.webdav.DavServletRequest request, String repositoryId) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
private org.apache.jackrabbit.webdav.DavResource getResourceFromGroup(org.apache.jackrabbit.webdav.DavServletRequest request, List<String> repositories, ArchivaDavResourceLocator locator, RepositoryGroupConfiguration repositoryGroupConfiguration) throws org.apache.jackrabbit.webdav.DavException, RepositoryAdminException
org.apache.jackrabbit.webdav.DavException
RepositoryAdminException
protected String getActivePrincipal(org.apache.jackrabbit.webdav.DavServletRequest request)
private boolean isAllowedToContinue(org.apache.jackrabbit.webdav.DavServletRequest request, List<String> repositories, String activePrincipal)
request
- repositories
- activePrincipal
- private File writeMergedMetadataToFile(ArchivaRepositoryMetadata mergedMetadata, String outputFilename) throws RepositoryMetadataException, org.codehaus.plexus.digest.DigesterException, IOException
RepositoryMetadataException
org.codehaus.plexus.digest.DigesterException
IOException
private void createChecksumFile(String path, org.codehaus.plexus.digest.Digester digester) throws org.codehaus.plexus.digest.DigesterException, IOException
org.codehaus.plexus.digest.DigesterException
IOException
private boolean isProjectReference(String requestedResource)
protected File buildMergedIndexDirectory(List<String> repositories, String activePrincipal, org.apache.jackrabbit.webdav.DavServletRequest request, RepositoryGroupConfiguration repositoryGroupConfiguration) throws org.apache.jackrabbit.webdav.DavException
org.apache.jackrabbit.webdav.DavException
public void setServletAuth(ServletAuthenticator servletAuth)
public void setHttpAuth(org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator httpAuth)
public void setScheduler(RepositoryArchivaTaskScheduler scheduler)
public void setArchivaConfiguration(ArchivaConfiguration archivaConfiguration)
public void setRepositoryFactory(RepositoryContentFactory repositoryFactory)
public void setRepositoryRequest(RepositoryRequest repositoryRequest)
public void setConnectors(RepositoryProxyConnectors connectors)
public RemoteRepositoryAdmin getRemoteRepositoryAdmin()
public void setRemoteRepositoryAdmin(RemoteRepositoryAdmin remoteRepositoryAdmin)
public ManagedRepositoryAdmin getManagedRepositoryAdmin()
public void setManagedRepositoryAdmin(ManagedRepositoryAdmin managedRepositoryAdmin)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.