mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added configs to set poll, local, and remote timeouts separately (plus some code cleanup).
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6149 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -521,15 +521,6 @@
|
|||||||
<property name="publicAction">
|
<property name="publicAction">
|
||||||
<value>false</value>
|
<value>false</value>
|
||||||
</property>
|
</property>
|
||||||
<property name="noThreads">
|
|
||||||
<value>5</value>
|
|
||||||
</property>
|
|
||||||
<property name="connectionTimeout">
|
|
||||||
<value>10000</value>
|
|
||||||
</property>
|
|
||||||
<property name="readTimeout">
|
|
||||||
<value>30000</value>
|
|
||||||
</property>
|
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Scheduled action helper beans -->
|
<!-- Scheduled action helper beans -->
|
||||||
|
@@ -142,5 +142,14 @@
|
|||||||
<property name="retryingTransactionHelper">
|
<property name="retryingTransactionHelper">
|
||||||
<ref bean="retryingTransactionHelper"/>
|
<ref bean="retryingTransactionHelper"/>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
<!-- Poll interval to check getLatestSnapshotID (in milliseconds) -->
|
||||||
|
<property name="pollInterval" value="5000"/>
|
||||||
|
|
||||||
|
<!-- Timeouts (in milliseconds) -->
|
||||||
|
<property name="localConnectTimeout" value="10000"/>
|
||||||
|
<property name="remoteConnectTimeout" value="10000"/>
|
||||||
|
<property name="localReadTimeout" value="30000"/>
|
||||||
|
<property name="remoteReadTimeout" value="30000"/>
|
||||||
</bean>
|
</bean>
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -66,27 +66,18 @@ public class HrefDifference
|
|||||||
String dst_store_;
|
String dst_store_;
|
||||||
String src_webapp_url_base_;
|
String src_webapp_url_base_;
|
||||||
String dst_webapp_url_base_;
|
String dst_webapp_url_base_;
|
||||||
int connect_timeout_;
|
|
||||||
int read_timeout_;
|
|
||||||
int nthreads_;
|
|
||||||
|
|
||||||
HrefDifference(String href_attr,
|
HrefDifference(String href_attr,
|
||||||
String src_store,
|
String src_store,
|
||||||
String dst_store,
|
String dst_store,
|
||||||
String src_webapp_url_base,
|
String src_webapp_url_base,
|
||||||
String dst_webapp_url_base,
|
String dst_webapp_url_base)
|
||||||
int connect_timeout,
|
|
||||||
int read_timeout,
|
|
||||||
int nthreads)
|
|
||||||
{
|
{
|
||||||
href_attr_ = href_attr;
|
href_attr_ = href_attr;
|
||||||
src_store_ = src_store;
|
src_store_ = src_store;
|
||||||
dst_store_ = dst_store;
|
dst_store_ = dst_store;
|
||||||
src_webapp_url_base_ = src_webapp_url_base;
|
src_webapp_url_base_ = src_webapp_url_base;
|
||||||
dst_webapp_url_base_ = dst_webapp_url_base;
|
dst_webapp_url_base_ = dst_webapp_url_base;
|
||||||
connect_timeout_ = connect_timeout;
|
|
||||||
read_timeout_ = read_timeout_;
|
|
||||||
nthreads_ = nthreads;
|
|
||||||
|
|
||||||
href_manifest_ = new HrefManifest();
|
href_manifest_ = new HrefManifest();
|
||||||
href_status_map_ = new HrefStatusMap();
|
href_status_map_ = new HrefStatusMap();
|
||||||
@@ -104,9 +95,6 @@ public class HrefDifference
|
|||||||
String getDstStore() { return dst_store_;}
|
String getDstStore() { return dst_store_;}
|
||||||
String getSrcWebappUrlBase() { return src_webapp_url_base_; }
|
String getSrcWebappUrlBase() { return src_webapp_url_base_; }
|
||||||
String getDstWebappUrlBase() { return dst_webapp_url_base_; }
|
String getDstWebappUrlBase() { return dst_webapp_url_base_; }
|
||||||
int getConnectTimeout() { return connect_timeout_; }
|
|
||||||
int getReadTimeout() { return read_timeout_; }
|
|
||||||
int getNthreads() { return nthreads_; }
|
|
||||||
|
|
||||||
|
|
||||||
Map<String,String> getDeletedFileMd5() { return deleted_file_md5_; }
|
Map<String,String> getDeletedFileMd5() { return deleted_file_md5_; }
|
||||||
|
@@ -55,9 +55,6 @@ public class LinkValidationAction extends ActionExecuterAbstractBase
|
|||||||
public static final String PARAM_COMPARE_TO_STAGING = "compare-to-staging";
|
public static final String PARAM_COMPARE_TO_STAGING = "compare-to-staging";
|
||||||
public static final String PARAM_MONITOR = "monitor";
|
public static final String PARAM_MONITOR = "monitor";
|
||||||
|
|
||||||
private int noThreads = 5;
|
|
||||||
private int readTimeout = 30000;
|
|
||||||
private int connectionTimeout = 10000;
|
|
||||||
private LinkValidationService linkValidationService;
|
private LinkValidationService linkValidationService;
|
||||||
private AVMService avmService;
|
private AVMService avmService;
|
||||||
|
|
||||||
@@ -83,35 +80,7 @@ public class LinkValidationAction extends ActionExecuterAbstractBase
|
|||||||
this.avmService = service;
|
this.avmService = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the number of millseconds to wait for a connection
|
|
||||||
*
|
|
||||||
* @param connectionTimeout Number of milliseconds to wait for connection
|
|
||||||
*/
|
|
||||||
public void setConnectionTimeout(int connectionTimeout)
|
|
||||||
{
|
|
||||||
this.connectionTimeout = connectionTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the number of milliseconds to wait for a response
|
|
||||||
*
|
|
||||||
* @param readTimeout Number of milliseconds to wait for a response
|
|
||||||
*/
|
|
||||||
public void setReadTimeout(int readTimeout)
|
|
||||||
{
|
|
||||||
this.readTimeout = readTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the number of threads to use to gather broken links
|
|
||||||
*
|
|
||||||
* @param threads Number of threads to use to gather broken links
|
|
||||||
*/
|
|
||||||
public void setNoThreads(int threads)
|
|
||||||
{
|
|
||||||
this.noThreads = threads;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||||
@@ -183,8 +152,9 @@ public class LinkValidationAction extends ActionExecuterAbstractBase
|
|||||||
if (destWebappPath != null)
|
if (destWebappPath != null)
|
||||||
{
|
{
|
||||||
// get the object to represent the broken files
|
// get the object to represent the broken files
|
||||||
HrefDifference hdiff = this.linkValidationService.getHrefDifference(webappPath, destWebappPath,
|
HrefDifference hdiff =
|
||||||
this.connectionTimeout, this.readTimeout, this.noThreads, monitor);
|
this.linkValidationService.getHrefDifference(
|
||||||
|
webappPath, destWebappPath, monitor);
|
||||||
|
|
||||||
// get the broken files created due to deletions and new/modified files
|
// get the broken files created due to deletions and new/modified files
|
||||||
HrefManifest brokenByDelete = this.linkValidationService.getHrefManifestBrokenByDelete(hdiff);
|
HrefManifest brokenByDelete = this.linkValidationService.getHrefManifestBrokenByDelete(hdiff);
|
||||||
|
@@ -83,9 +83,6 @@ public interface LinkValidationService
|
|||||||
public HrefDifference getHrefDifference(
|
public HrefDifference getHrefDifference(
|
||||||
String srcWebappPath,
|
String srcWebappPath,
|
||||||
String dstWebappPath,
|
String dstWebappPath,
|
||||||
int connectTimeout,
|
|
||||||
int readTimeout,
|
|
||||||
int nthreads,
|
|
||||||
HrefValidationProgress progress)
|
HrefValidationProgress progress)
|
||||||
throws AVMNotFoundException,
|
throws AVMNotFoundException,
|
||||||
SocketException,
|
SocketException,
|
||||||
@@ -164,19 +161,6 @@ public interface LinkValidationService
|
|||||||
* Currently does nothing. Perhaps one day you'll be able to
|
* Currently does nothing. Perhaps one day you'll be able to
|
||||||
* turn off validation of external links.
|
* turn off validation of external links.
|
||||||
*
|
*
|
||||||
* @param connectTimeout
|
|
||||||
* Amount of time in milliseconds that this function will wait
|
|
||||||
* before declaring that the connection has failed
|
|
||||||
* (e.g.: 10000 ms).
|
|
||||||
*
|
|
||||||
* @param readTimeout
|
|
||||||
* time in milliseconds that this function will wait before
|
|
||||||
* declaring that a read on the connection has failed
|
|
||||||
* (e.g.: 30000 ms).
|
|
||||||
*
|
|
||||||
* @param nthreads
|
|
||||||
* Number of threads to use when fetching URLs (e.g.: 5)
|
|
||||||
*
|
|
||||||
* @param progress
|
* @param progress
|
||||||
* While updateHrefInfo() is a synchronous function,
|
* While updateHrefInfo() is a synchronous function,
|
||||||
* 'status' may be polled in a separate thread to
|
* 'status' may be polled in a separate thread to
|
||||||
@@ -186,9 +170,6 @@ public interface LinkValidationService
|
|||||||
public void updateHrefInfo( String path,
|
public void updateHrefInfo( String path,
|
||||||
boolean incremental,
|
boolean incremental,
|
||||||
boolean validateExternal,
|
boolean validateExternal,
|
||||||
int connectTimeout,
|
|
||||||
int readTimeout,
|
|
||||||
int nthreads,
|
|
||||||
HrefValidationProgress progress)
|
HrefValidationProgress progress)
|
||||||
throws AVMNotFoundException,
|
throws AVMNotFoundException,
|
||||||
SocketException,
|
SocketException,
|
||||||
@@ -196,88 +177,6 @@ public interface LinkValidationService
|
|||||||
LinkValidationAbortedException;
|
LinkValidationAbortedException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Merges an HrefDifference into the master href info table.
|
|
||||||
* WARNING: This function won't be part of the public interface for long.
|
|
||||||
*/
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
public void mergeHrefDiff( HrefDifference hdiff)
|
|
||||||
throws AVMNotFoundException,
|
|
||||||
SocketException,
|
|
||||||
SSLException,
|
|
||||||
LinkValidationAbortedException;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Fetches information on broken hrefs within a store name or path
|
|
||||||
* to a webapp. This function is just a convenience wrapper for calling
|
|
||||||
* getHrefConcordance with statusGTE=400 and statusLTE=599.
|
|
||||||
*/
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
public List<HrefConcordanceEntry> getBrokenHrefConcordanceEntries(
|
|
||||||
String storeNameOrWebappPath
|
|
||||||
) throws AVMNotFoundException;
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Returns information regarding the hrefs within storeNameOrWebappPath
|
|
||||||
* whose return status is greater than or equal to 'statusGTE', and
|
|
||||||
* less than or equal to 'statusLTE'. The List<HrefConcordanceEntry>
|
|
||||||
* is sorted in increasing lexicographic order by href. Within each
|
|
||||||
* HrefConcordanceEntry, the files retrieved via getLocations()
|
|
||||||
* are also sorted in increasing lexicographic order.
|
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* Example 1:<br>
|
|
||||||
* The following parameters will fetch all the broken links
|
|
||||||
* within the ROOT webapp in the staging area of the 'mysite' web project:
|
|
||||||
* <ul>
|
|
||||||
* <li> storeNameOrWebappPath="mysite:/www/avm_webapps/ROOT"
|
|
||||||
* <li> statusGTE=400
|
|
||||||
* <li> statusLTE=599
|
|
||||||
* </ul>
|
|
||||||
* <p>
|
|
||||||
* Example 2:<br>
|
|
||||||
* The following parameters will fetch all the links whose return status
|
|
||||||
* is "successful" (2xx) for all webapps contained by the staging area of
|
|
||||||
* the 'mysite' web project:
|
|
||||||
* <ul>
|
|
||||||
* <li> storeNameOrWebappPath="mysite"
|
|
||||||
* <li> statusGTE=200
|
|
||||||
* <li> statusLTE=299
|
|
||||||
* </ul>
|
|
||||||
* <p>
|
|
||||||
* Example 3:<br>
|
|
||||||
* The following parameters will fetch all the links whose return status
|
|
||||||
* is 200 (OK) within the ROOT webapp in the staging area of the 'mysite'
|
|
||||||
* web project:
|
|
||||||
* <ul>
|
|
||||||
* <li> storeNameOrWebappPath="mysite:/www/avm_webapps/ROOT"
|
|
||||||
* <li> statusGTE=200
|
|
||||||
* <li> statusLTE=200
|
|
||||||
* </ul>
|
|
||||||
* <p>
|
|
||||||
* For details regarding HTTP status codes, see:
|
|
||||||
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
public List<HrefConcordanceEntry> getHrefConcordanceEntries(
|
|
||||||
String storeNameOrWebappPath,
|
|
||||||
int statusGTE,
|
|
||||||
int statusLTE
|
|
||||||
) throws AVMNotFoundException;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Fetch all hyperlinks that rely upon the existence of the file specified
|
* Fetch all hyperlinks that rely upon the existence of the file specified
|
||||||
@@ -301,25 +200,4 @@ public interface LinkValidationService
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
public List<String> getHrefsDependentUponFile(String path);
|
public List<String> getHrefsDependentUponFile(String path);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// NEARLY OBSOLETE!
|
|
||||||
// NEARLY OBSOLETE!
|
|
||||||
// NEARLY OBSOLETE!
|
|
||||||
// NEARLY OBSOLETE!
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
public void updateHrefInfo(
|
|
||||||
String storeNameOrWebappPath, // NEARLY OBSOLETE!
|
|
||||||
boolean incremental, // NEARLY OBSOLETE!
|
|
||||||
int connectTimeout, // NEARLY OBSOLETE!
|
|
||||||
int readTimeout, // NEARLY OBSOLETE!
|
|
||||||
int nthreads, // NEARLY OBSOLETE!
|
|
||||||
HrefValidationProgress progress) // NEARLY OBSOLETE!
|
|
||||||
throws AVMNotFoundException, // NEARLY OBSOLETE!
|
|
||||||
SocketException, // NEARLY OBSOLETE!
|
|
||||||
SSLException, // NEARLY OBSOLETE!
|
|
||||||
LinkValidationAbortedException; // NEARLY OBSOLETE!
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user