mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Point checkin.
Augmented AVMRemote to expose lookup that can fetch deleted nodes. Minor fixup to excluder regex in avm-services-context.xml. Added excluder to LinkValidationServiceImpl. Prep to walk difference using SyncService (getting ready for incremental update of link validation tables). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5898 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*
|
||||
* Author Jon Cox <jcox@alfresco.com>
|
||||
* File UpdateHrefInfoStatus.java
|
||||
* File HrefValidationProgress.java
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
package org.alfresco.linkvalidation;
|
||||
@@ -43,10 +43,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
* call to updateHrefInfo() has completed by examining
|
||||
* the value returned by isDone().
|
||||
* <p>
|
||||
* Note: It is safest to instantiate a fresh UpdateHrefInfoStatus
|
||||
* Note: It is safest to instantiate a fresh HrefValidationProgress
|
||||
* object for every invocation of updateHrefInfo().
|
||||
*/
|
||||
public class UpdateHrefInfoStatus
|
||||
public class HrefValidationProgress
|
||||
{
|
||||
AtomicInteger webapp_update_count_;
|
||||
AtomicInteger dir_update_count_;
|
||||
@@ -54,7 +54,7 @@ public class UpdateHrefInfoStatus
|
||||
AtomicInteger url_update_count_;
|
||||
AtomicBoolean is_done_;
|
||||
|
||||
public UpdateHrefInfoStatus()
|
||||
public HrefValidationProgress()
|
||||
{
|
||||
webapp_update_count_ = new AtomicInteger();
|
||||
dir_update_count_ = new AtomicInteger();
|
@@ -66,12 +66,12 @@ public interface LinkValidationService
|
||||
* 'status' may be polled in a separate thread to
|
||||
* observe its progress.
|
||||
*/
|
||||
public void updateHrefInfo( String storeNameOrWebappPath,
|
||||
boolean incremental,
|
||||
int connectTimeout,
|
||||
int readTimeout,
|
||||
int nthreads,
|
||||
UpdateHrefInfoStatus status
|
||||
public void updateHrefInfo( String storeNameOrWebappPath,
|
||||
boolean incremental,
|
||||
int connectTimeout,
|
||||
int readTimeout,
|
||||
int nthreads,
|
||||
HrefValidationProgress progress
|
||||
)
|
||||
throws AVMNotFoundException;
|
||||
|
||||
@@ -208,9 +208,11 @@ public interface LinkValidationService
|
||||
* Don't use yet - does nothing at the moment.
|
||||
*/
|
||||
public BrokenHrefConcordanceDifference getBrokenHrefConcordanceDifference(
|
||||
int srcVersion, String srcPath,
|
||||
int dstVersion, String dstPath,
|
||||
NameMatcher excluder)
|
||||
int srcVersion,
|
||||
String srcPath,
|
||||
int dstVersion,
|
||||
String dstPath,
|
||||
HrefValidationProgress progress)
|
||||
throws AVMNotFoundException;
|
||||
}
|
||||
|
||||
|
@@ -317,6 +317,14 @@ public class AVMRemoteLocal implements AVMRemote
|
||||
return fService.lookup(version, path);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(int, java.lang.String, boolean)
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(int version, String path, boolean includeDeleted)
|
||||
{
|
||||
return fService.lookup(version, path, includeDeleted);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(org.alfresco.service.cmr.avm.AVMNodeDescriptor, java.lang.String)
|
||||
*/
|
||||
@@ -325,6 +333,14 @@ public class AVMRemoteLocal implements AVMRemote
|
||||
return fService.lookup(dir, name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(org.alfresco.service.cmr.avm.AVMNodeDescriptor, java.lang.String, boolean includeDeleted)
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name, boolean includeDeleted)
|
||||
{
|
||||
return fService.lookup(dir, name, includeDeleted);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#makePrimary(java.lang.String)
|
||||
*/
|
||||
|
@@ -704,6 +704,23 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
|
||||
fAuthService.validate(ticket);
|
||||
return fAVMService.lookup(version, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup a node identified by version ID and path; optionally,
|
||||
* if the node is deleted, its descriptor can still
|
||||
* be retrieved.
|
||||
*
|
||||
* @param version The version ID to look under.
|
||||
* @param path The simple absolute path to the parent directory.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved
|
||||
* @return An AVMNodeDescriptor, or null if the version does not exist.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, int version, String path, boolean includeDeleted)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fAVMService.lookup(version, path, includeDeleted);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a descriptor for the specified node.
|
||||
@@ -716,6 +733,25 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
|
||||
fAuthService.validate(ticket);
|
||||
return fAVMService.lookup(dir, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup a node identified by the directory that contains it, and its name;
|
||||
* optionally, the lookup can retrive the descriptor of a node even if
|
||||
* it has been deleted from its containing directory.
|
||||
*
|
||||
* @param dir The descriptor for the directory node.
|
||||
* @param name The name to lookup.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved via the lookup
|
||||
* @return The descriptor for the child, null if the child doesn't exist.
|
||||
* @throws AVMNotFoundException
|
||||
* @throws AVMWrongTypeException
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name, boolean includeDeleted)
|
||||
{
|
||||
fAuthService.validate(ticket);
|
||||
return fAVMService.lookup(dir, name, includeDeleted);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the indirection path for a node.
|
||||
|
@@ -331,6 +331,15 @@ public class AVMRemoteImpl implements AVMRemote
|
||||
return fTransport.lookup(fTicketHolder.getTicket(), version, path);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(int, java.lang.String, boolean)
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(int version, String path, boolean includeDeleted)
|
||||
{
|
||||
return fTransport.lookup(fTicketHolder.getTicket(), version, path, includeDeleted);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(org.alfresco.service.cmr.avm.AVMNodeDescriptor, java.lang.String)
|
||||
*/
|
||||
@@ -339,6 +348,15 @@ public class AVMRemoteImpl implements AVMRemote
|
||||
return fTransport.lookup(fTicketHolder.getTicket(), dir, name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#lookup(org.alfresco.service.cmr.avm.AVMNodeDescriptor, java.lang.String, boolean includeDeleted)
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name, boolean includeDeleted)
|
||||
{
|
||||
return fTransport.lookup(fTicketHolder.getTicket(), dir, name, includeDeleted);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMRemote#makePrimary(java.lang.String)
|
||||
*/
|
||||
|
@@ -253,6 +253,11 @@ public class AVMNodeDescriptor implements Serializable
|
||||
/**
|
||||
* Determines whether this node corresponds to
|
||||
* either a plain or layered file.
|
||||
* <p>
|
||||
* NOTE: A deleted file node is <em>not</em> considered a file
|
||||
* (i.e.: isFile() returns false when isDeleted() returns true).
|
||||
* Therefore, use isDeletedFile() to determine if a deleted node
|
||||
* was a file, not isFile().
|
||||
*
|
||||
* @return true if AVMNodeDescriptor is a plain or layered file,
|
||||
* otherwise false.
|
||||
@@ -289,7 +294,12 @@ public class AVMNodeDescriptor implements Serializable
|
||||
|
||||
/**
|
||||
* Determines whether this node corresponds to
|
||||
* either a plain or layered directory.
|
||||
* either a plain or layered directory.
|
||||
* <p>
|
||||
* NOTE: A deleted directory node is <em>not</em> considered a directory
|
||||
* (i.e.: isDirectory() returns false when isDeleted() returns true).
|
||||
* Therefore, use isDeletedDirectory() to determine if a deleted node
|
||||
* was a directory, not isDirectory().
|
||||
*
|
||||
* @return true if AVMNodeDescriptor is a plain or layered directory,
|
||||
* otherwise false.
|
||||
|
@@ -244,6 +244,18 @@ public interface AVMRemote
|
||||
* @return An AVMNodeDescriptor.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(int version, String path);
|
||||
|
||||
/**
|
||||
* Lookup a node identified by version ID and path; optionally,
|
||||
* if the node is deleted, its descriptor can still
|
||||
* be retrieved.
|
||||
*
|
||||
* @param version The version ID to look under.
|
||||
* @param path The simple absolute path to the parent directory.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved
|
||||
* @return An AVMNodeDescriptor, or null if the version does not exist.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(int version, String path, boolean includeDeleted);
|
||||
|
||||
/**
|
||||
* Get a descriptor for the specified node.
|
||||
@@ -252,6 +264,20 @@ public interface AVMRemote
|
||||
* @return An AVMNodeDescriptor.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name);
|
||||
|
||||
/**
|
||||
* Lookup a node identified by the directory that contains it, and its name;
|
||||
* optionally, the lookup can retrive the descriptor of a node even if
|
||||
* it has been deleted from its containing directory.
|
||||
*
|
||||
* @param dir The descriptor for the directory node.
|
||||
* @param name The name to lookup.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved via the lookup
|
||||
* @return The descriptor for the child, null if the child doesn't exist.
|
||||
* @throws AVMNotFoundException
|
||||
* @throws AVMWrongTypeException
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(AVMNodeDescriptor dir, String name, boolean includeDeleted);
|
||||
|
||||
/**
|
||||
* Get the indirection path for a node.
|
||||
|
@@ -256,6 +256,19 @@ public interface AVMRemoteTransport
|
||||
* @return An AVMNodeDescriptor.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, int version, String path);
|
||||
|
||||
/**
|
||||
* Lookup a node identified by version ID and path; optionally,
|
||||
* if the node is deleted, its descriptor can still
|
||||
* be retrieved.
|
||||
*
|
||||
* @param version The version ID to look under.
|
||||
* @param path The simple absolute path to the parent directory.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved
|
||||
* @return An AVMNodeDescriptor, or null if the version does not exist.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, int version, String path, boolean includeDeleted);
|
||||
|
||||
|
||||
/**
|
||||
* Get a descriptor for the specified node.
|
||||
@@ -264,6 +277,21 @@ public interface AVMRemoteTransport
|
||||
* @return An AVMNodeDescriptor.
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name);
|
||||
|
||||
/**
|
||||
* Lookup a node identified by the directory that contains it, and its name;
|
||||
* optionally, the lookup can retrive the descriptor of a node even if
|
||||
* it has been deleted from its containing directory.
|
||||
*
|
||||
* @param dir The descriptor for the directory node.
|
||||
* @param name The name to lookup.
|
||||
* @param includeDeleted Whether to allow a deleted node to be retrieved via the lookup
|
||||
* @return The descriptor for the child, null if the child doesn't exist.
|
||||
* @throws AVMNotFoundException
|
||||
* @throws AVMWrongTypeException
|
||||
*/
|
||||
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name, boolean includeDeleted);
|
||||
|
||||
|
||||
/**
|
||||
* Get the indirection path for a node.
|
||||
|
Reference in New Issue
Block a user