diff --git a/config/alfresco/action-services-context.xml b/config/alfresco/action-services-context.xml index 4acaba3192..de0f73bfc2 100644 --- a/config/alfresco/action-services-context.xml +++ b/config/alfresco/action-services-context.xml @@ -1,514 +1,514 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - alfresco.messages.action-service - alfresco.messages.action-config - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {http://www.alfresco.org/model/content/1.0}content - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {http://www.alfresco.org/model/content/1.0}content - - - - - - - - - - - - - - {http://www.alfresco.org/model/content/1.0}content - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${mail.header} - - - ${mail.from.default} - - - - - - false - - - - - - - - - - - - - - - - - - - - - - {http://www.alfresco.org/model/content/1.0}content - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - ${spaces.store} - - - /${spaces.company_home.childname} - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - false - - - - - - - - - - - - false - - - - - - - - - false - - - - - - - - - false - - - - - - - - - false - - - - - - - - - false - - - - - - - - - - - - false - - - - - - - - - - - - - - - false - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alfresco.messages.action-service + alfresco.messages.action-config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {http://www.alfresco.org/model/content/1.0}content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {http://www.alfresco.org/model/content/1.0}content + + + + + + + + + + + + + + {http://www.alfresco.org/model/content/1.0}content + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${mail.header} + + + ${mail.from.default} + + + + + + false + + + + + + + + + + + + + + + + + + + + + + {http://www.alfresco.org/model/content/1.0}content + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + ${spaces.store} + + + /${spaces.company_home.childname} + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + false + + + + + + + + + false + + + + + + + + + false + + + + + + + + + false + + + + + + + + + + + + false + + + + + + + + + + + + + + + false + @@ -521,33 +521,24 @@ false - - 5 - - - 10000 - - - 30000 - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/config/alfresco/linkvalidation-service-context.xml b/config/alfresco/linkvalidation-service-context.xml index b1b8a59b59..6be1e071f1 100644 --- a/config/alfresco/linkvalidation-service-context.xml +++ b/config/alfresco/linkvalidation-service-context.xml @@ -142,5 +142,14 @@ + + + + + + + + + diff --git a/source/java/org/alfresco/linkvalidation/HrefDifference.java b/source/java/org/alfresco/linkvalidation/HrefDifference.java index 301b5a891c..1b2f365b3c 100644 --- a/source/java/org/alfresco/linkvalidation/HrefDifference.java +++ b/source/java/org/alfresco/linkvalidation/HrefDifference.java @@ -66,47 +66,35 @@ public class HrefDifference String dst_store_; String src_webapp_url_base_; String dst_webapp_url_base_; - int connect_timeout_; - int read_timeout_; - int nthreads_; HrefDifference(String href_attr, String src_store, String dst_store, String src_webapp_url_base, - String dst_webapp_url_base, - int connect_timeout, - int read_timeout, - int nthreads) + String dst_webapp_url_base) { - href_attr_ = href_attr; - src_store_ = src_store; - dst_store_ = dst_store; - src_webapp_url_base_ = src_webapp_url_base; - dst_webapp_url_base_ = dst_webapp_url_base; - connect_timeout_ = connect_timeout; - read_timeout_ = read_timeout_; - nthreads_ = nthreads; + href_attr_ = href_attr; + src_store_ = src_store; + dst_store_ = dst_store; + src_webapp_url_base_ = src_webapp_url_base; + dst_webapp_url_base_ = dst_webapp_url_base; - href_manifest_ = new HrefManifest(); - href_status_map_ = new HrefStatusMap(); - - broken_manifest_map_ = new HashMap>(); - deleted_file_md5_ = new HashMap(); + href_manifest_ = new HrefManifest(); + href_status_map_ = new HrefStatusMap(); + + broken_manifest_map_ = new HashMap>(); + deleted_file_md5_ = new HashMap(); } public HrefManifest getHrefManifest() { return href_manifest_; } public HrefStatusMap getHrefStatusMap() { return href_status_map_; } - String getHrefAttr() { return href_attr_;} - String getSrcStore() { return src_store_;} - String getDstStore() { return dst_store_;} - String getSrcWebappUrlBase() { return src_webapp_url_base_; } - String getDstWebappUrlBase() { return dst_webapp_url_base_; } - int getConnectTimeout() { return connect_timeout_; } - int getReadTimeout() { return read_timeout_; } - int getNthreads() { return nthreads_; } + String getHrefAttr() { return href_attr_;} + String getSrcStore() { return src_store_;} + String getDstStore() { return dst_store_;} + String getSrcWebappUrlBase() { return src_webapp_url_base_; } + String getDstWebappUrlBase() { return dst_webapp_url_base_; } Map getDeletedFileMd5() { return deleted_file_md5_; } diff --git a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java index 3b3d5461e9..a95eea56e2 100644 --- a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java +++ b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java @@ -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_MONITOR = "monitor"; - private int noThreads = 5; - private int readTimeout = 30000; - private int connectionTimeout = 10000; private LinkValidationService linkValidationService; private AVMService avmService; @@ -83,35 +80,7 @@ public class LinkValidationAction extends ActionExecuterAbstractBase 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 protected void addParameterDefinitions(List paramList) @@ -183,8 +152,9 @@ public class LinkValidationAction extends ActionExecuterAbstractBase if (destWebappPath != null) { // get the object to represent the broken files - HrefDifference hdiff = this.linkValidationService.getHrefDifference(webappPath, destWebappPath, - this.connectionTimeout, this.readTimeout, this.noThreads, monitor); + HrefDifference hdiff = + this.linkValidationService.getHrefDifference( + webappPath, destWebappPath, monitor); // get the broken files created due to deletions and new/modified files HrefManifest brokenByDelete = this.linkValidationService.getHrefManifestBrokenByDelete(hdiff); diff --git a/source/java/org/alfresco/linkvalidation/LinkValidationService.java b/source/java/org/alfresco/linkvalidation/LinkValidationService.java index cd76038490..448882e996 100644 --- a/source/java/org/alfresco/linkvalidation/LinkValidationService.java +++ b/source/java/org/alfresco/linkvalidation/LinkValidationService.java @@ -83,9 +83,6 @@ public interface LinkValidationService public HrefDifference getHrefDifference( String srcWebappPath, String dstWebappPath, - int connectTimeout, - int readTimeout, - int nthreads, HrefValidationProgress progress) throws AVMNotFoundException, SocketException, @@ -164,19 +161,6 @@ public interface LinkValidationService * Currently does nothing. Perhaps one day you'll be able to * 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 * While updateHrefInfo() is a synchronous function, * 'status' may be polled in a separate thread to @@ -186,9 +170,6 @@ public interface LinkValidationService public void updateHrefInfo( String path, boolean incremental, boolean validateExternal, - int connectTimeout, - int readTimeout, - int nthreads, HrefValidationProgress progress) throws AVMNotFoundException, SocketException, @@ -196,88 +177,6 @@ public interface LinkValidationService 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 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 - * is sorted in increasing lexicographic order by href. Within each - * HrefConcordanceEntry, the files retrieved via getLocations() - * are also sorted in increasing lexicographic order. - * - *

- * Example 1:
- * The following parameters will fetch all the broken links - * within the ROOT webapp in the staging area of the 'mysite' web project: - *

    - *
  • storeNameOrWebappPath="mysite:/www/avm_webapps/ROOT" - *
  • statusGTE=400 - *
  • statusLTE=599 - *
- *

- * Example 2:
- * 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: - *

    - *
  • storeNameOrWebappPath="mysite" - *
  • statusGTE=200 - *
  • statusLTE=299 - *
- *

- * Example 3:
- * 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: - *

    - *
  • storeNameOrWebappPath="mysite:/www/avm_webapps/ROOT" - *
  • statusGTE=200 - *
  • statusLTE=200 - *
- *

- * For details regarding HTTP status codes, see: - * http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html - * - */ - //------------------------------------------------------------------------- - public List getHrefConcordanceEntries( - String storeNameOrWebappPath, - int statusGTE, - int statusLTE - ) throws AVMNotFoundException; - - - //------------------------------------------------------------------------- /** * Fetch all hyperlinks that rely upon the existence of the file specified @@ -301,25 +200,4 @@ public interface LinkValidationService //------------------------------------------------------------------------- public List 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! }