Compare commits

..

56 Commits
12.2 ... 14.12

Author SHA1 Message Date
Travis CI User
6d7e3bb787 [maven-release-plugin][skip ci] prepare release 14.12 2021-10-12 17:01:05 +00:00
Nithin Nambiar
bb8d10074e ACS-1112 Upgrade the BatchProcessor counting mechanism to work with "long" Java type (#706)
* ACS-1112 update to long data type
2021-10-12 17:04:31 +01:00
alandavis
806880a86b Include the latest MariaDB and MySQL tests in PRs.
[skip ci]
2021-10-11 12:21:42 +01:00
Nithin Nambiar
e68f56270a ACS-849_incorrect_probes added db check (#692)
* ACS-849_incorrect_probes added db check
2021-10-11 12:08:43 +01:00
Travis CI User
8705d97407 [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-08 15:44:38 +00:00
Travis CI User
44e3242132 [maven-release-plugin][skip ci] prepare release 14.11 2021-10-08 15:44:36 +00:00
alandavis
8a3cdd55a7 Revert "Bump mysql-connector-java from 8.0.25 to 8.0.26 (#741)"
As tests on MySQL 5.7.23 failed - not in the PR build

This reverts commit 3b41308ecc.
2021-10-08 15:37:35 +01:00
alandavis
cff2a70b17 Use a common property for json-path as it is used in community and enterprise repo and packaging 2021-10-08 15:24:36 +01:00
dependabot[bot]
3b41308ecc Bump mysql-connector-java from 8.0.25 to 8.0.26 (#741) 2021-10-08 13:40:53 +00:00
dependabot[bot]
8a60e26ff0 Bump lombok from 1.18.20 to 1.18.22 (#742) 2021-10-08 13:38:37 +00:00
Ryan Wilson
accfc4662d Community contribution: fix spelling within permissionDefinition.xml (#469)
There were a number of locations within comments that contained incorrect spelling. [skip ci]
2021-10-08 14:30:43 +01:00
Travis CI User
1e0fcfcc14 [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-08 11:06:13 +00:00
Travis CI User
837a706514 [maven-release-plugin][skip ci] prepare release 14.10 2021-10-08 11:06:10 +00:00
dependabot[bot]
db290c98f2 Bump cmis from 1.30 to 1.31 (#711) 2021-10-08 09:58:24 +00:00
dependabot[bot]
12682ddcff Bump dependency.spring.version from 5.3.9 to 5.3.10 (#715) 2021-10-08 09:39:26 +00:00
dependabot[bot]
0ed2e9b3a7 Bump joda-time from 2.10.10 to 2.10.12 (#716) 2021-10-08 09:37:42 +00:00
dependabot[bot]
3442e91575 Bump maven-war-plugin from 3.2.2 to 3.3.2 (#719) 2021-10-08 09:34:46 +00:00
Travis CI User
59b636e0ba [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-07 18:15:14 +00:00
Travis CI User
0333fe05b5 [maven-release-plugin][skip ci] prepare release 14.9 2021-10-07 18:15:11 +00:00
alandavis
9b592bfc13 Revert "Bump mysql-connector-java from 8.0.25 to 8.0.26 (#609)"
As DbNodeServiceImplTest>BaseNodeServiceTest.testLargeStrings:1061 » AlfrescoRuntime now fails

This reverts commit 386696d58b.
2021-10-07 18:26:05 +01:00
dependabot-preview[bot]
386696d58b Bump mysql-connector-java from 8.0.25 to 8.0.26 (#609)
Bumps [mysql-connector-java](https://github.com/mysql/mysql-connector-j) from 8.0.25 to 8.0.26.
- [Release notes](https://github.com/mysql/mysql-connector-j/releases)
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/8.0/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Alan Davis <alan.davis@alfresco.com>
2021-10-07 15:23:38 +01:00
dependabot[bot]
1f243d629e Bump xmlsec from 1.5.8 to 2.2.3 (#732) 2021-10-07 14:16:40 +00:00
dependabot[bot]
dee7625998 Bump postgresql from 42.2.20 to 42.2.24 (#734) 2021-10-07 14:15:04 +00:00
dependabot[bot]
1c541281db Bump maven-javadoc-plugin from 3.3.0 to 3.3.1 (#733) 2021-10-07 14:11:08 +00:00
dependabot-preview[bot]
c991290c01 Bump dependency.slf4j.version from 1.7.30 to 1.7.32 (#611) 2021-10-07 14:01:24 +00:00
Travis CI User
9b62808ed7 [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-07 13:00:53 +00:00
Travis CI User
d4e8bba9f5 [maven-release-plugin][skip ci] prepare release 14.8 2021-10-07 13:00:50 +00:00
dependabot[bot]
5ae240c392 Bump docker-java from 3.2.11 to 3.2.12 (#735) 2021-10-07 11:31:07 +00:00
dependabot[bot]
a5b35b7d96 Bump spring-security-core from 5.5.1 to 5.5.2 (#737) 2021-10-07 11:30:32 +00:00
dependabot[bot]
d2544b7a4d Bump docker-maven-plugin from 0.34.1 to 0.37.0 (#724) 2021-10-07 11:14:27 +00:00
dependabot[bot]
b9abc05eda Bump maven-artifact from 3.8.1 to 3.8.3 (#727) 2021-10-07 11:11:15 +00:00
dependabot[bot]
04e3743f01 Bump jsoup from 1.14.2 to 1.14.3 (#730) 2021-10-07 11:08:54 +00:00
Travis CI User
745295c4ba [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-07 10:30:48 +00:00
Travis CI User
c9b08594de [maven-release-plugin][skip ci] prepare release 14.7 2021-10-07 10:30:45 +00:00
dependabot[bot]
1d8044076c Bump dependency.webscripts.version from 8.23 to 8.24 (#710) 2021-10-07 09:10:15 +00:00
dependabot[bot]
377b082ef8 Bump mariadb-java-client from 2.7.2 to 2.7.4 (#709) 2021-10-07 09:07:17 +00:00
dependabot[bot]
ad2525bf17 Bump dependency.cxf.version from 3.4.4 to 3.4.5 (#708) 2021-10-07 09:04:57 +00:00
dependabot[bot]
888b26ef72 Bump groovy from 2.5.9 to 3.0.9 (#713)
Bumps [groovy](https://github.com/apache/groovy) from 2.5.9 to 3.0.9.
- [Release notes](https://github.com/apache/groovy/releases)
- [Commits](https://github.com/apache/groovy/commits)

---
updated-dependencies:
- dependency-name: org.codehaus.groovy:groovy
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 09:51:16 +01:00
alandavis
aa4a5a6063 Try to give dependabot access to Nexus 2021-10-05 11:12:24 +01:00
dependabot-preview[bot]
7ea91ea702 Upgrade to GitHub-native Dependabot (#424)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-10-05 09:31:58 +02:00
Travis CI User
b3e8051f08 [maven-release-plugin][skip ci] prepare for next development iteration 2021-10-01 14:32:21 +00:00
Travis CI User
4ba0d3a899 [maven-release-plugin][skip ci] prepare release 14.6 2021-10-01 14:32:18 +00:00
kcichonczyk
8d78b257aa [PRODSEC-4829] Bumped versions of libraries to prevent security vulnerabilities: (#703)
* 'keycloak' version to 15.0.2
2021-10-01 14:38:58 +02:00
Travis CI User
df67011596 [maven-release-plugin][skip ci] prepare for next development iteration 2021-09-29 20:23:22 +00:00
Travis CI User
871bd40d6d [maven-release-plugin][skip ci] prepare release 14.5 2021-09-29 20:23:19 +00:00
montgolfiere
2ef97e0b23 ACS-2067: Fix probes for when DAU enabled (#700) 2021-09-29 19:32:10 +01:00
Vítor Moreira
f1d48f7aab MNT-22428: configurable unsecure jsonp callback CMIS operation (#698) (#704)
* MNT-22428: configurable unsecure jsonp callback CMIS operation

(cherry picked from commit 5807e756bd)
2021-09-29 17:44:06 +01:00
Travis CI User
b5f24f5d58 [maven-release-plugin][skip ci] prepare for next development iteration 2021-09-29 12:17:15 +00:00
Travis CI User
14668044f4 [maven-release-plugin][skip ci] prepare release 14.4 2021-09-29 12:17:12 +00:00
evasques
c5281d7f10 MNT-22600 Nodes with security marks appear unfiltered on CMIS DB queries (#702)
* Change isUnfiltered to protected so we can extend it in enterprise
* Added test method to be able to do a cmis query test

Original commit in governance-services: e4e3235328
2021-09-29 12:07:06 +01:00
Travis CI User
00565f3bc9 [maven-release-plugin][skip ci] prepare for next development iteration 2021-09-29 10:03:49 +00:00
Travis CI User
f15c4d7a8f [maven-release-plugin][skip ci] prepare release 14.3 2021-09-29 10:03:47 +00:00
Piotr Żurek
85a3c71849 MNT-22611 - Fix bulk import parameters parsing (#699) 2021-09-29 10:50:54 +02:00
Travis CI User
4db8ca16e1 [maven-release-plugin][skip ci] prepare for next development iteration 2021-09-29 04:44:40 +00:00
Travis CI User
52e71719d1 [maven-release-plugin][skip ci] prepare release 14.2 2021-09-29 04:44:37 +00:00
alandavis
507161a1d0 Get master ready for 7.2.0 development 2021-09-28 22:56:03 +01:00
57 changed files with 1236 additions and 634 deletions

181
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,181 @@
version: 2
registries:
maven-repository-artifacts-alfresco-com-nexus-content-groups-int:
type: maven-repository
url: https://artifacts.alfresco.com/nexus/content/groups/internal
username: ${{secrets.NEXUS_USERNAME}}
password: ${{secrets.NEXUS_PASSWORD}}
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "22:00"
timezone: Africa/Abidjan
open-pull-requests-limit: 99
ignore:
- dependency-name: com.google.code.gson:gson
versions:
- "> 2.8.6"
- dependency-name: io.fabric8:fabric8-maven-plugin
versions:
- "> 4.4.0"
- dependency-name: javax.servlet:javax.servlet-api
versions:
- "> 3.0.1"
- dependency-name: org.acegisecurity:acegi-security
versions:
- "> 0.8.2_patched"
- dependency-name: org.activiti:activiti-engine
versions:
- "> 5.23.0"
- dependency-name: org.activiti:activiti-engine
versions:
- ">= 7.1.a, < 7.2"
- dependency-name: org.activiti:activiti-spring
versions:
- "> 5.23.0"
- dependency-name: org.activiti:activiti-spring
versions:
- ">= 7.1.a, < 7.2"
- dependency-name: org.apache.camel:camel-activemq
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-amqp
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-direct
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-directvm
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-jackson
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-mock
versions:
- "> 3.7.1"
- dependency-name: org.apache.camel:camel-spring
versions:
- "> 3.7.1"
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-client-impl
versions:
- "> 1.0.0"
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-commons-impl
versions:
- "> 1.0.0"
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-server-bindings
versions:
- "> 1.0.0"
- dependency-name: org.apache.chemistry.opencmis:chemistry-opencmis-test-tck
versions:
- "> 1.0.0"
- dependency-name: org.freemarker:freemarker
versions:
- "> 2.3.20-alfresco-patched-20200421"
- dependency-name: org.keycloak:keycloak-adapter-core
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-adapter-spi
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-authz-client
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-common
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-core
versions:
- "> 12.0.2"
- dependency-name: org.keycloak:keycloak-servlet-adapter-spi
versions:
- "> 12.0.2"
- dependency-name: org.eclipse.jetty:jetty-server
versions:
- 9.4.38.v20210224
- dependency-name: org.alfresco.tas:cmis
versions:
- "1.28"
- dependency-name: org.springframework:spring-webmvc
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-web
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-tx
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-orm
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-test
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-jms
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-jdbc
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-expression
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-core
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-context-support
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-context
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-beans
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.springframework:spring-aop
versions:
- 5.3.4
- 5.3.5
- dependency-name: org.alfresco.tas:restapi
versions:
- "1.55"
- dependency-name: org.eclipse.jetty:jetty-security
versions:
- 11.0.1
- dependency-name: org.alfresco.aos-module:alfresco-vti-bin
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.aos-module:alfresco-aos-module-distributionzip
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.aos-module:alfresco-aos-module
versions:
- 1.4.0-M1
- dependency-name: org.alfresco.surf:spring-webscripts-api
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-webscripts:tests
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-webscripts
versions:
- "8.16"
- dependency-name: org.alfresco.surf:spring-surf-core-configservice
versions:
- "8.16"
registries:
- maven-repository-artifacts-alfresco-com-nexus-content-groups-int

View File

@@ -145,7 +145,8 @@ jobs:
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Repository - MariaDB 10.6 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
# We run tests on the latest version of MariaDB on pull requests plus the normal master and release branches - ignored on feature branches
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ ) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
before_script:
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.6 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
@@ -159,7 +160,8 @@ jobs:
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - MySQL 8 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
# We run tests on the latest version of MySQL on pull requests plus the normal master and release branches - ignored on feature branches
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ ) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
before_script:
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:8 --transaction-isolation='READ-COMMITTED'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
@@ -40,7 +40,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.26</version>
<version>1.7.32</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -82,7 +82,7 @@
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>3.2.11</version>
<version>3.2.12</version>
</dependency>
</dependencies>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<properties>

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<modules>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<developers>
@@ -93,7 +93,7 @@
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.5.0</version>
<version>${dependency.jakarta-json-path.version}</version>
</dependency>
</dependencies>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<developers>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<properties>

41
pom.xml
View File

@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -23,8 +23,8 @@
<properties>
<acs.version.major>7</acs.version.major>
<acs.version.minor>1</acs.version.minor>
<acs.version.revision>1</acs.version.revision>
<acs.version.minor>2</acs.version.minor>
<acs.version.revision>0</acs.version.revision>
<acs.version.label />
<amp.min.version>${acs.version.major}.0.0</amp.min.version>
@@ -55,13 +55,13 @@
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.13</dependency.acs-event-model.version>
<dependency.spring.version>5.3.9</dependency.spring.version>
<dependency.spring.version>5.3.10</dependency.spring.version>
<dependency.antlr.version>3.5.2</dependency.antlr.version>
<dependency.jackson.version>2.12.3</dependency.jackson.version>
<dependency.jackson-databind.version>2.12.4</dependency.jackson-databind.version>
<dependency.cxf.version>3.4.4</dependency.cxf.version>
<dependency.cxf.version>3.4.5</dependency.cxf.version>
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
<dependency.webscripts.version>8.23</dependency.webscripts.version>
<dependency.webscripts.version>8.24</dependency.webscripts.version>
<dependency.bouncycastle.version>1.69</dependency.bouncycastle.version>
<dependency.mockito-core.version>3.11.2</dependency.mockito-core.version>
<dependency.mockito-all.version>1.10.19</dependency.mockito-all.version>
@@ -73,15 +73,15 @@
<dependency.httpcore.version>4.4.14</dependency.httpcore.version>
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
<dependency.xercesImpl.version>2.12.1</dependency.xercesImpl.version>
<dependency.slf4j.version>1.7.30</dependency.slf4j.version>
<dependency.slf4j.version>1.7.32</dependency.slf4j.version>
<dependency.gytheio.version>0.12</dependency.gytheio.version>
<dependency.groovy.version>2.5.9</dependency.groovy.version>
<dependency.groovy.version>3.0.9</dependency.groovy.version>
<dependency.tika.version>1.27</dependency.tika.version>
<dependency.spring-security.version>5.5.1</dependency.spring-security.version>
<dependency.spring-security.version>5.5.2</dependency.spring-security.version>
<dependency.truezip.version>7.7.10</dependency.truezip.version>
<dependency.poi.version>4.1.2</dependency.poi.version>
<dependency.ooxml-schemas.version>1.4</dependency.ooxml-schemas.version>
<dependency.keycloak.version>13.0.1</dependency.keycloak.version>
<dependency.keycloak.version>15.0.2</dependency.keycloak.version>
<dependency.jboss.logging.version>3.4.2.Final</dependency.jboss.logging.version>
<dependency.camel.version>3.7.4</dependency.camel.version>
<dependency.activemq.version>5.16.1</dependency.activemq.version>
@@ -101,6 +101,7 @@
<dependency.jakarta-jws-api.version>2.1.0</dependency.jakarta-jws-api.version>
<dependency.jakarta-mail-api.version>1.6.5</dependency.jakarta-mail-api.version>
<dependency.jakarta-json-api.version>1.1.6</dependency.jakarta-json-api.version>
<dependency.jakarta-json-path.version>2.5.0</dependency.jakarta-json-path.version>
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
<alfresco.googledrive.version>3.2.1.3</alfresco.googledrive.version>
@@ -108,14 +109,14 @@
<alfresco.api-explorer.version>7.1.0.1</alfresco.api-explorer.version> <!-- Also in alfresco-enterprise-share -->
<alfresco.maven-plugin.version>2.2.0</alfresco.maven-plugin.version>
<dependency.postgresql.version>42.2.20</dependency.postgresql.version>
<dependency.postgresql.version>42.2.24</dependency.postgresql.version>
<dependency.mysql.version>8.0.25</dependency.mysql.version>
<dependency.mysql-image.version>8</dependency.mysql-image.version>
<dependency.mariadb.version>2.7.2</dependency.mariadb.version>
<dependency.mariadb.version>2.7.4</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.45</dependency.tas-utility.version>
<dependency.rest-assured.version>3.3.0</dependency.rest-assured.version>
<dependency.tas-restapi.version>1.64</dependency.tas-restapi.version>
<dependency.tas-cmis.version>1.30</dependency.tas-cmis.version>
<dependency.tas-cmis.version>1.31</dependency.tas-cmis.version>
<dependency.tas-email.version>1.8</dependency.tas-email.version>
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
<dependency.tas-ftp.version>1.5</dependency.tas-ftp.version>
@@ -142,7 +143,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-community-repo</url>
<tag>12.2</tag>
<tag>14.12</tag>
</scm>
<distributionManagement>
@@ -638,7 +639,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
<version>1.14.3</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
@@ -711,7 +712,7 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.10</version>
<version>2.10.12</version>
</dependency>
<!-- provided dependencies -->
@@ -850,7 +851,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -870,7 +871,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.34.1</version>
<version>0.37.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
@@ -886,12 +887,12 @@
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<version>3.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<dependencies>
@@ -47,7 +47,7 @@
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.8</version>
<version>2.2.3</version>
</dependency>
<!-- newer version, see REPO-3133 -->
<dependency>

View File

@@ -27,17 +27,14 @@ package org.alfresco.opencmis;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -48,19 +45,17 @@ import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
import javax.servlet.descriptor.JspConfigDescriptor;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.opencmis.CMISDispatcherRegistry.Binding;
import org.alfresco.opencmis.CMISDispatcherRegistry.Endpoint;
import org.alfresco.repo.tenant.TenantAdminService;
import org.alfresco.rest.framework.core.exceptions.JsonpCallbackNotAllowedException;
import org.alfresco.service.descriptor.Descriptor;
import org.alfresco.service.descriptor.DescriptorService;
import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
@@ -69,7 +64,6 @@ import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
import org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
import org.springframework.extensions.webscripts.servlet.WebScriptServletRuntime;
/**
* Dispatches OpenCMIS requests to a servlet e.g. the OpenCMIS AtomPub servlet.
@@ -90,6 +84,8 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
protected CmisVersion cmisVersion;
protected TenantAdminService tenantAdminService;
private boolean allowUnsecureCallbackJSONP;
private Set<String> nonAttachContentTypes = Collections.emptySet(); // pre-configured whitelist, eg. images & pdf
public void setTenantAdminService(TenantAdminService tenantAdminService)
@@ -151,7 +147,17 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
return this.currentDescriptor;
}
public void setAllowUnsecureCallbackJSONP(boolean allowUnsecureCallbackJSONP)
{
this.allowUnsecureCallbackJSONP = allowUnsecureCallbackJSONP;
}
public boolean isAllowUnsecureCallbackJSONP()
{
return allowUnsecureCallbackJSONP;
}
public void init()
{
Endpoint endpoint = new Endpoint(getBinding(), version);
@@ -219,12 +225,22 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
CMISHttpServletResponse httpResWrapper = getHttpResponse(res);
CMISHttpServletRequest httpReqWrapper = getHttpRequest(req);
servlet.service(httpReqWrapper, httpResWrapper);
// check for "callback" query param
if (!allowUnsecureCallbackJSONP && httpReqWrapper.getParameter("callback") != null)
{
throw new JsonpCallbackNotAllowedException();
}
servlet.service(httpReqWrapper, httpResWrapper);
}
catch(ServletException e)
{
throw new AlfrescoRuntimeException("", e);
}
catch (JsonpCallbackNotAllowedException e)
{
res.setStatus(403);
res.getWriter().append(e.getMessage());
}
}
/**

View File

@@ -23,8 +23,10 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.api.probes;
import org.alfresco.repo.admin.RepoHealthChecker;
import org.alfresco.rest.api.discovery.DiscoveryApiWebscript;
import org.alfresco.rest.api.model.Probe;
import org.alfresco.rest.framework.WebApiDescription;
@@ -35,29 +37,26 @@ import org.alfresco.rest.framework.core.exceptions.ServiceUnavailableException;
import org.alfresco.rest.framework.resource.EntityResource;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An implementation of an Entity Resource for Probes.
*/
@EntityResource(name="probes", title = "Probes")
public class ProbeEntityResource implements EntityResourceAction.ReadById<Probe>
@EntityResource(name = "probes", title = "Probes") public class ProbeEntityResource
implements EntityResourceAction.ReadById<Probe>
{
public static final String LIVE = "-live-";
public static final String READY = "-ready-";
public static final long CHECK_PERIOD = 10 * 1000; // Maximum of only one checkResult every 10 seconds.
protected static Log logger = LogFactory.getLog(ProbeEntityResource.class);;
private long nextCheckTime = 0;
private final static Logger logger = LoggerFactory.getLogger(ProbeEntityResource.class);
private final Object lock = new Object();
private final Probe liveProbe = new Probe("liveProbe: Success - Tested");
private long lastCheckTime = 0;
private Boolean checkResult;
private Boolean checking = false;
private boolean readySent;
private DiscoveryApiWebscript discovery;
private RepoHealthChecker repoHealthChecker;
public DiscoveryApiWebscript setDiscovery(DiscoveryApiWebscript discovery)
{
DiscoveryApiWebscript result = this.discovery;
@@ -65,145 +64,141 @@ public class ProbeEntityResource implements EntityResourceAction.ReadById<Probe>
return result;
}
public void setRepoHealthChecker(RepoHealthChecker repoHealthChecker)
{
this.repoHealthChecker = repoHealthChecker;
}
/**
* Returns a status code of 200 for okay. The probe contains little information for security reasons.
*
* Note: does *not* require authenticated access, so limits the amount of work performed to avoid a DDOS.
*/
@Override
@WebApiDescription(title="Get probe status", description = "Returns 200 if valid")
@WebApiParam(name = "probeName", title = "The probe's name")
@WebApiNoAuth
public Probe readById(String name, Parameters parameters)
@Override @WebApiDescription(title = "Get probe status", description = "Returns 200 if valid") @WebApiParam(name = "probeName", title = "The probe's name") @WebApiNoAuth public Probe readById(
String name, Parameters parameters)
{
boolean isLiveProbe = LIVE.equalsIgnoreCase(name);
if (!isLiveProbe && !READY.equalsIgnoreCase(name))
ProbeType probeType = ProbeType.fromString(name);
Probe probeResponse = null;
switch (probeType)
{
throw new InvalidArgumentException("Bad probe name");
case LIVE:
probeResponse = liveProbe;
break;
case READY:
String message = doReadyCheck();
probeResponse = new Probe(message);
break;
case UNKNOWN:
throw new InvalidArgumentException("Bad probe name");
}
String message = doCheckOrNothing(isLiveProbe);
return new Probe(message);
return probeResponse;
}
// We don't want to be doing checks all the time or holding monitors for a long time to avoid a DDOS.
public String doCheckOrNothing(boolean isLiveProbe)
public String doReadyCheck()
{
boolean doCheck = false;
long now = 0;
boolean result;
String message = "No test";
boolean logInfo = false;
synchronized(checking)
synchronized (lock)
{
// Initially ready needs to be false so we don't get requests and live true so the pod is not killed.
if (checkResult == null)
String message;
long now = System.currentTimeMillis();
if (checkResult == null || isAfterCheckPeriod(now))
{
result = isLiveProbe;
try
{
performReadinessCheck();
checkResult = true;
}
catch (Exception e)
{
checkResult = false;
logger.debug("Exception during readiness check", e);
}
finally
{
setLastCheckTime(now);
message = getMessage(checkResult, "Tested");
logger.info(message);
}
}
else
{
result = checkResult;
// if no check is performed, use previous check result
message = getMessage(checkResult, "No test");
logger.debug(message);
}
if (checkResult)
{
return message;
}
if (checking) // Is another thread is checking?
{
if (!readySent && result && !isLiveProbe)
{
readySent = true;
logInfo = true;
}
}
else // This thread will do a check
{
now = System.currentTimeMillis();
if (checkResult == null || nextCheckTime <= now)
{
doCheck = true;
checking = true;
}
}
throw new ServiceUnavailableException(message);
}
if (doCheck)
{
try
{
message = "Tested";
doCheck(isLiveProbe);
result = true;
}
catch (Exception e)
{
result = false;
}
finally
{
synchronized (checking)
{
checking = false;
checkResult = result;
setNextCheckTime(now);
if (result && !readySent && !isLiveProbe) // Are we initially ready
{
readySent = true;
logInfo = true;
}
else if (!result && (isLiveProbe || readySent)) // Are we sick
{
logInfo = true;
}
}
}
}
message = getMessage(isLiveProbe, result, message);
if (logInfo)
{
logger.info(message);
}
else
{
logger.debug(message);
}
if (result)
{
return message;
}
throw new ServiceUnavailableException(message);
}
private String getMessage(boolean isLiveProbe, boolean result, String message)
private String getMessage(boolean result, String message)
{
return (isLiveProbe ? "liveProbe" : "readyProbe")+": "+
(result ? "Success" : "Failure") +
" - "+message;
return "readyProbe: " + (result ? "Success" : "Failure") + " - " + message;
}
private void doCheck(boolean isLiveProbe)
private void performReadinessCheck()
{
discovery.getRepositoryInfo();
repoHealthChecker.checkDatabase();
logger.debug("All checks complete");
}
private void setNextCheckTime(long now)
private void setLastCheckTime(long time)
{
long oldValue = nextCheckTime;
if (nextCheckTime == 0)
this.lastCheckTime = time;
long nextCheckTime = lastCheckTime + CHECK_PERIOD;
logger.trace("nextCheckTime: {} (+{} secs)", nextCheckTime, ((CHECK_PERIOD) / 1000));
}
private boolean isAfterCheckPeriod(long currentTime)
{
return ((currentTime - lastCheckTime) >= CHECK_PERIOD);
}
public enum ProbeType
{
LIVE("-live-"), READY("-ready-"), UNKNOWN("");
String value;
ProbeType(String strValue)
{
nextCheckTime = (now / 60000) * 60000;
value = strValue;
}
do
public static ProbeType fromString(String text)
{
nextCheckTime += CHECK_PERIOD;
for (ProbeType p : ProbeType.values())
{
if (p.value.equalsIgnoreCase(text))
{
return p;
}
}
return UNKNOWN;
}
while (nextCheckTime <= now);
if (logger.isTraceEnabled())
public String getValue()
{
logger.trace("nextCheckTime: " + nextCheckTime + " (+" + ((nextCheckTime - oldValue) / 1000) + " secs)");
return value;
}
}
}

View File

@@ -0,0 +1,49 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.framework.core.exceptions;
/**
* JSONP callback not allowed
*
* @author Vitor Moreira
*/
public class JsonpCallbackNotAllowedException extends ApiException
{
private static final long serialVersionUID = 7198491358180044895L;
public static String DEFAULT_MESSAGE_ID = "framework.exception.JsonpCallbackNotAllowed";
public JsonpCallbackNotAllowedException()
{
super(DEFAULT_MESSAGE_ID);
}
public JsonpCallbackNotAllowedException(String msgId)
{
super(msgId);
}
}

View File

@@ -14,4 +14,6 @@ framework.exception.UnsupportedResourceOperation=The operation is unsupported
framework.exception.DeletedResource=In this version of the REST API resource {0} has been deleted
framework.exception.RequestEntityTooLarge=The file can't be uploaded because it's larger than the maximum upload size
framework.exception.InsufficientStorage=The file upload exceeds the content storage allowance
framework.exception.JsonpCallbackNotAllowed=For security reasons the callback parameter is not allowed
framework.no.stacktrace=For security reasons the stack trace is no longer displayed, but the property is kept for previous versions

View File

@@ -1070,11 +1070,12 @@
<property name="enabled" value="${system.api.discovery.enabled}" />
<property name="thumbnailService" ref="ThumbnailService" />
<property name="restApiDirectUrlConfig" ref="restApiDirectUrlConfig" />
<property name="contentService" ref="ContentService" />
<property name="contentService" ref="contentService" />
</bean>
<bean id="org.alfresco.rest.api.probes.ProbeEntityResource.get" class="org.alfresco.rest.api.probes.ProbeEntityResource">
<property name="discovery" ref="webscript.org.alfresco.api.DiscoveryApiWebscript.get" />
<property name="repoHealthChecker" ref="repoHealthChecker" />
</bean>
<!-- REST API direct access URL configuration settings -->
@@ -1138,6 +1139,7 @@
<property name="cmisVersion" value="1.1"/>
<property name="tenantAdminService" ref="tenantAdminService"/>
<property name="nonAttachContentTypes" ref="nodes.nonAttachContentTypes"/>
<property name="allowUnsecureCallbackJSONP" value="${allow.unsecure.callback.jsonp}"/>
</bean>
<bean id="webscript.org.alfresco.api.opencmis.OpenCMIS.get"

View File

@@ -26,21 +26,26 @@
package org.alfresco.rest.api.tests;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.admin.RepoHealthChecker;
import org.alfresco.rest.api.discovery.DiscoveryApiWebscript;
import org.alfresco.rest.api.probes.ProbeEntityResource;
import org.alfresco.rest.api.tests.client.HttpResponse;
import org.json.simple.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import static org.alfresco.rest.api.probes.ProbeEntityResource.*;
import static org.alfresco.rest.api.probes.ProbeEntityResource.ProbeType.LIVE;
import static org.alfresco.rest.api.probes.ProbeEntityResource.ProbeType.READY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.lenient;
/**
* V1 REST API tests for Probes (Live and Ready)
@@ -53,7 +58,6 @@ import static org.mockito.Mockito.when;
public class ProbeApiTest extends AbstractBaseApiTest
{
private static final boolean OK = true;
private static final boolean ERROR = false;
private ProbeEntityResource probe;
private DiscoveryApiWebscript origDiscovery;
@@ -64,6 +68,9 @@ public class ProbeApiTest extends AbstractBaseApiTest
@Mock
private DiscoveryApiWebscript badDiscovery;
@Mock
private RepoHealthChecker repoHealthChecker;
@Before
@Override
public void setup() throws Exception
@@ -73,7 +80,9 @@ public class ProbeApiTest extends AbstractBaseApiTest
String beanName = ProbeEntityResource.class.getCanonicalName()+".get";
probe = applicationContext.getBean(beanName, ProbeEntityResource.class);
when(badDiscovery.getRepositoryInfo()).thenThrow(AlfrescoRuntimeException.class);
lenient().when(badDiscovery.getRepositoryInfo()).thenThrow(AlfrescoRuntimeException.class);
Mockito.doNothing().when(repoHealthChecker).checkDatabase();
probe.setRepoHealthChecker(repoHealthChecker);
origDiscovery = probe.setDiscovery(badDiscovery);
}
@@ -91,7 +100,7 @@ public class ProbeApiTest extends AbstractBaseApiTest
return "public";
}
private void assertResponse(String probeName, Boolean ready, String expected, int expectedStatus) throws Exception
private void assertResponse(ProbeType probeType, Boolean ready, String expected, int expectedStatus) throws Exception
{
String[] keys = expectedStatus == 200
? new String[]{"entry", "message"}
@@ -103,7 +112,7 @@ public class ProbeApiTest extends AbstractBaseApiTest
? goodDiscovery
: badDiscovery);
HttpResponse response = getSingle(ProbeEntityResource.class, probeName, null, expectedStatus);
HttpResponse response = getSingle(ProbeEntityResource.class, probeType.getValue(), null, expectedStatus);
Object object = response.getJsonResponse();
for (String key: keys)
{
@@ -128,32 +137,29 @@ public class ProbeApiTest extends AbstractBaseApiTest
public void testProbes() throws Exception
{
// Live first
assertResponse(LIVE, ERROR, "liveProbe: Failure - Tested", 503);
assertResponse(LIVE, null, "liveProbe: Failure - No test", 503); // Need to wait 10 seconds.
assertResponse(LIVE, null, "liveProbe: Failure - No test", 503);
assertResponse(READY, null, "readyProbe: Failure - No test", 503);
assertResponse(LIVE, OK, "liveProbe: Success - Tested", 200);
assertResponse(READY, null, "readyProbe: Failure - Tested", 503);
Thread.currentThread().sleep(CHECK_PERIOD);
assertResponse(READY, OK, "readyProbe: Success - Tested", 200);
assertResponse(READY, null, "readyProbe: Success - No test", 200);
Thread.currentThread().sleep(CHECK_PERIOD);
assertResponse(LIVE, OK, "liveProbe: Success - Tested", 200);
assertResponse(LIVE, null, "liveProbe: Success - No test", 200);
assertResponse(READY, null, "readyProbe: Success - No test", 200);
assertResponse(LIVE, null, "liveProbe: Success - No test", 200);
Thread.currentThread().sleep(CHECK_PERIOD);
assertResponse(LIVE, ERROR, "liveProbe: Failure - Tested", 503);
assertResponse(LIVE, null, "liveProbe: Failure - No test", 503);
assertResponse(READY, null, "readyProbe: Failure - No test", 503);
assertResponse(READY, null, "readyProbe: Failure - Tested", 503);
// Ready first
Thread.currentThread().sleep(CHECK_PERIOD);
assertResponse(READY, OK, "readyProbe: Success - Tested", 200);
assertResponse(LIVE, null, "liveProbe: Success - No test", 200);
assertResponse(LIVE, OK, "liveProbe: Success - Tested", 200);
assertResponse(READY, null, "readyProbe: Success - No test", 200);
// check db failure
Thread.currentThread().sleep(CHECK_PERIOD);
assertResponse(READY, ERROR, "readyProbe: Failure - Tested", 503);
assertResponse(LIVE, null, "liveProbe: Failure - No test", 503);
Mockito.doThrow(AlfrescoRuntimeException.class).when(repoHealthChecker).checkDatabase();
assertResponse(READY, OK, "readyProbe: Failure - Tested", 503);
assertResponse(READY, OK, "readyProbe: Failure - No test", 503);
}
}

View File

@@ -60,8 +60,11 @@ import org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl;
import org.alfresco.cmis.client.type.AlfrescoType;
import org.alfresco.model.ContentModel;
import org.alfresco.model.RenditionModel;
import org.alfresco.opencmis.CMISDispatcher;
import org.alfresco.opencmis.CMISDispatcherRegistry.Binding;
import org.alfresco.opencmis.CMISServletDispatcher;
import org.alfresco.opencmis.PublicApiAlfrescoCmisServiceFactory;
import org.alfresco.opencmis.PublicApiBrowserCMISDispatcher;
import org.alfresco.opencmis.dictionary.CMISStrictDictionaryService;
import org.alfresco.opencmis.dictionary.QNameFilter;
import org.alfresco.opencmis.dictionary.QNameFilterImpl;
@@ -99,6 +102,7 @@ import org.alfresco.rest.api.tests.client.data.NodeRating.Aggregate;
import org.alfresco.rest.api.tests.client.data.Person;
import org.alfresco.rest.api.tests.client.data.SiteRole;
import org.alfresco.rest.api.tests.client.data.Tag;
import org.alfresco.rest.framework.core.exceptions.JsonpCallbackNotAllowedException;
import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.lock.LockType;
import org.alfresco.service.cmr.model.FileFolderService;
@@ -153,6 +157,7 @@ import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.context.ApplicationContext;
import org.springframework.extensions.surf.util.I18NUtil;
import org.springframework.extensions.surf.util.URLEncoder;
public class TestCMIS extends EnterpriseTestApi
@@ -517,6 +522,73 @@ public class TestCMIS extends EnterpriseTestApi
assertEquals(200, response.getStatusCode());
}
/**
* MNT-22428 Check the return from http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root&callback= when jsonp callback is disabled
*
* @throws Exception
*/
@Test
public void testBrowserDisabledJSONPCallback() throws Exception
{
// disables unsecure callback jsonp
final PublicApiBrowserCMISDispatcher dispatcher = ctx.getBean(PublicApiBrowserCMISDispatcher.class);
dispatcher.setAllowUnsecureCallbackJSONP(false);
final TestNetwork network1 = getTestFixture().getRandomNetwork();
Iterator<String> personIt = network1.getPersonIds().iterator();
final String personId = personIt.next();
assertNotNull(personId);
Person person = repoService.getPerson(personId);
assertNotNull(person);
publicApiClient.setRequestContext(new RequestContext(network1.getId(), personId));
// request with a callback parameter
HttpResponse response;
final Map<String, String> params = Map.of("callback", "");
response = publicApiClient.get(network1.getId() + "/public/cmis/versions/1.1/browser/root", params);
assertEquals(403, response.getStatusCode());
String exceptionMessage = I18NUtil.getMessage(JsonpCallbackNotAllowedException.DEFAULT_MESSAGE_ID, params);
assertTrue(response.getResponse().endsWith(exceptionMessage));
// request without a callback parameter
response = publicApiClient.get(network1.getId() + "/public/cmis/versions/1.1/browser/root", null);
assertEquals(200, response.getStatusCode());
}
/*
* MNT-22428 Check the return from http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser/root&callback= when jsonp callback is enabled
*
* @throws Exception
*/
@Test
public void testBrowserEnabledJSONPCallback() throws Exception
{
// enables unsecure callback jsonp
final PublicApiBrowserCMISDispatcher dispatcher = ctx.getBean(PublicApiBrowserCMISDispatcher.class);
dispatcher.setAllowUnsecureCallbackJSONP(true);
final TestNetwork network1 = getTestFixture().getRandomNetwork();
Iterator<String> personIt = network1.getPersonIds().iterator();
final String personId = personIt.next();
assertNotNull(personId);
Person person = repoService.getPerson(personId);
assertNotNull(person);
publicApiClient.setRequestContext(new RequestContext(network1.getId(), personId));
// request with a callback parameter
HttpResponse response;
final Map<String, String> params = Map.of("callback", "someFunction");
response = publicApiClient.get(network1.getId() + "/public/cmis/versions/1.1/browser/root", params);
assertEquals(200, response.getStatusCode());
// request without a callback parameter
response = publicApiClient.get(network1.getId() + "/public/cmis/versions/1.1/browser/root", null);
assertEquals(200, response.getStatusCode());
}
/**
* REPO-2041 / MNT-16236 Upload via cmis binding atom and browser files with different maxContentSize
*/

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>12.2</version>
<version>14.12</version>
</parent>
<dependencies>
@@ -191,7 +191,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.8.1</version>
<version>3.8.3</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.encryption;
import java.io.Serializable;
@@ -241,6 +241,12 @@ public class ReEncryptor implements ApplicationContextAware
return properties.size();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return properties.size();
}
@Override
public Collection<NodePropertyEntity> getNextWork()
{

View File

@@ -1959,6 +1959,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
return size;
}
@Override
public synchronized long getTotalEstimatedWorkSizeLong()
{
return size;
}
@Override
public synchronized Collection<BulkEntry> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.activities.feed;
import java.util.Collection;
@@ -427,6 +427,12 @@ public class FeedNotifierImpl implements FeedNotifier, ApplicationContextAware
return personService.countPeople();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return personService.countPeople();
}
@Override
public Collection<PersonInfo> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.activities.feed.local;
import java.util.ArrayList;
@@ -155,13 +155,25 @@ public class LocalFeedGenerator extends AbstractFeedGenerator
@Override
public int getTotalEstimatedWorkSize()
{
return (int) calculateEstimatedWorkSize();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return calculateEstimatedWorkSize();
}
private long calculateEstimatedWorkSize()
{
long size = maxSequence - minSequence + 1;
long remain = size % batchSize;
long workSize = (remain == 0) ? (size / batchSize) : (size / batchSize + 1);
return (int) workSize;
return workSize;
}
@Override
public Collection<JobSettings> getNextWork()
{

View File

@@ -0,0 +1,47 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2018 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin;
import org.alfresco.repo.domain.schema.DataSourceCheck;
/**
* A utility service to do the database and other health checks.
*/
public class RepoHealthChecker
{
private final DataSourceCheck dataSourceCheck;
public RepoHealthChecker(DataSourceCheck dataSourceCheck)
{
this.dataSourceCheck = dataSourceCheck;
}
public void checkDatabase()
{
dataSourceCheck.init();
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch;
import java.io.PrintWriter;
@@ -486,6 +486,11 @@ public abstract class AbstractPatch implements Patch, ApplicationEventPublisher
return tenants.size();
}
public long getTotalEstimatedWorkSizeLong()
{
return tenants.size();
}
@Override
public Collection<Tenant> getNextWork()
{
@@ -554,13 +559,13 @@ public abstract class AbstractPatch implements Patch, ApplicationEventPublisher
logger.debug("batch worker finished processing id:" + id);
}
if (batchProcessor.getTotalErrors() > 0)
if (batchProcessor.getTotalErrorsLong() > 0)
{
sb.append("\n" + " and failure during update of tennants total success: " + batchProcessor.getSuccessfullyProcessedEntries() + " number of errors: " +batchProcessor.getTotalErrors() + " lastError" + batchProcessor.getLastError());
sb.append("\n" + " and failure during update of tennants total success: " + batchProcessor.getSuccessfullyProcessedEntriesLong() + " number of errors: " +batchProcessor.getTotalErrorsLong() + " lastError" + batchProcessor.getLastError());
}
else
{
sb.append("\n" + " and successful batch update of " + batchProcessor.getTotalResults() + "tennants");
sb.append("\n" + " and successful batch update of " + batchProcessor.getTotalResultsLong() + "tennants");
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.ArrayList;
@@ -90,6 +90,12 @@ public class AddUnmovableAspectToSitesPatch extends AsynchronousPatch
return sites.size();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return sites.size();
}
@Override
public Collection<ChildAssociationRef> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.ArrayList;
@@ -93,6 +93,11 @@ public class AliasableAspectPatch extends AbstractPatch
return result.size();
}
public long getTotalEstimatedWorkSizeLong()
{
return result.size();
}
public Collection<NodeRef> getNextWork()
{
if(val != null)

View File

@@ -237,6 +237,12 @@ public class FixBpmPackagesPatch extends AbstractPatch
return assocCount;
}
@Override
public synchronized long getTotalEstimatedWorkSizeLong()
{
return assocCount;
}
@Override
public synchronized Collection<ChildAssociationRef> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.ArrayList;
@@ -76,6 +76,11 @@ public class ImapUnsubscribedAspectPatch extends AbstractPatch
return result.size();
}
public long getTotalEstimatedWorkSizeLong()
{
return result.size();
}
public Collection<NodeRef> getNextWork()
{
result.clear();

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch.impl;
import java.util.ArrayList;
@@ -143,6 +143,12 @@ public class RenameSiteAuthorityDisplayName extends AbstractPatch
{
return siteInfos.size();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return siteInfos.size();
}
@Override
public Collection<SiteInfo> getNextWork()

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.admin.patch.impl;
@@ -449,6 +449,12 @@ public class SurfConfigFolderPatch extends AsynchronousPatch
@Override
public synchronized int getTotalEstimatedWorkSize()
{
return (int)getTotalEstimatedWorkSizeLong();
}
@Override
public synchronized long getTotalEstimatedWorkSizeLong()
{
if (maxId == Long.MAX_VALUE)
{
@@ -459,6 +465,7 @@ public class SurfConfigFolderPatch extends AsynchronousPatch
}
}
return 0;
}
@Override

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.batch;
import java.util.Date;
@@ -50,10 +50,10 @@ public interface BatchMonitor
/**
* Gets the total number of results.
*
* @deprecated use {@link #getTotalResultsLong()} instead
* @return the total number of results
*/
public int getTotalResults();
@Deprecated public int getTotalResults();
/**
* Gets the ID of the entry being processed
@@ -64,10 +64,10 @@ public interface BatchMonitor
/**
* Gets the number of successfully processed entries.
*
* @deprecated use {@link #getSuccessfullyProcessedEntriesLong()} instead
* @return the successfully processed entries
*/
public int getSuccessfullyProcessedEntries();
@Deprecated public int getSuccessfullyProcessedEntries();
/**
* Gets the progress expressed as a percentage.
@@ -78,10 +78,10 @@ public interface BatchMonitor
/**
* Gets the total number of errors.
*
* @deprecated use {@link #getTotalErrorsLong()} instead
* @return the total number of errors
*/
public int getTotalErrors();
@Deprecated public int getTotalErrors();
/**
* Gets the stack trace of the last error.
@@ -103,4 +103,35 @@ public interface BatchMonitor
* @return the end time
*/
public Date getEndTime();
/**
* Gets the total number of results.
*
* @return the total number of results
*/
public default long getTotalResultsLong()
{
throw new UnsupportedOperationException("getTotalResultsLong need to be implemented");
}
/**
* Gets the total number of errors.
*
* @return the total number of errors
*/
public default long getTotalErrorsLong()
{
throw new UnsupportedOperationException("getTotalErrorsLong need to be implemented");
}
/**
* Gets the number of successfully processed entries.
*
* @return the successfully processed entries
*/
public default long getSuccessfullyProcessedEntriesLong()
{
throw new UnsupportedOperationException("getSuccessfullyProcessedEntriesLong need to be implemented");
}
}

View File

@@ -43,10 +43,10 @@ public interface BatchProcessWorkProvider<T>
* Instances can provide accurate answers on each call, but only if the answer can be
* provided quickly and efficiently; usually it is enough to to cache the result after
* providing an initial estimate.
*
* @deprecated use {@link #getTotalEstimatedWorkSizeLong()} instead.
* @return a total work size estimate
*/
int getTotalEstimatedWorkSize();
@Deprecated int getTotalEstimatedWorkSize();
/**
* Get the next lot of work for the batch processor. Implementations should return
@@ -58,4 +58,18 @@ public interface BatchProcessWorkProvider<T>
* if there is no more work remaining.
*/
Collection<T> getNextWork();
/**
* Get an estimate of the total number of objects that will be provided by this instance.
* Instances can provide accurate answers on each call, but only if the answer can be
* provided quickly and efficiently; usually it is enough to to cache the result after
* providing an initial estimate.
*
* @return a total work size estimate
*/
default long getTotalEstimatedWorkSizeLong()
{
throw new UnsupportedOperationException("getTotalEstimatedWorkSizeLong need to implemented");
}
}

View File

@@ -110,10 +110,10 @@ public class BatchProcessor<T> implements BatchMonitor
private String lastErrorEntryId;
/** The total number of errors. */
private int totalErrors;
private long totalErrors;
/** The number of successfully processed entries. */
private int successfullyProcessedEntries;
private long successfullyProcessedEntries;
/** The start time. */
private Date startTime;
@@ -280,7 +280,15 @@ public class BatchProcessor<T> implements BatchMonitor
/**
* {@inheritDoc}
*/
public synchronized int getSuccessfullyProcessedEntries()
@Deprecated public synchronized int getSuccessfullyProcessedEntries()
{
return Math.toIntExact(this.successfullyProcessedEntries);
}
/**
* {@inheritDoc}
*/
public synchronized long getSuccessfullyProcessedEntriesLong()
{
return this.successfullyProcessedEntries;
}
@@ -290,8 +298,8 @@ public class BatchProcessor<T> implements BatchMonitor
*/
public synchronized String getPercentComplete()
{
int totalResults = this.workProvider.getTotalEstimatedWorkSize();
int processed = this.successfullyProcessedEntries + this.totalErrors;
long totalResults = this.workProvider.getTotalEstimatedWorkSizeLong();
long processed = this.successfullyProcessedEntries + this.totalErrors;
return processed <= totalResults ? NumberFormat.getPercentInstance().format(
totalResults == 0 ? 1.0F : (float) processed / totalResults) : "Unknown";
}
@@ -299,7 +307,23 @@ public class BatchProcessor<T> implements BatchMonitor
/**
* {@inheritDoc}
*/
public synchronized int getTotalErrors()
@Deprecated public synchronized int getTotalErrors()
{
return Math.toIntExact(this.totalErrors);
}
/**
* {@inheritDoc}
*/
@Deprecated public int getTotalResults()
{
return this.workProvider.getTotalEstimatedWorkSize();
}
/**
* {@inheritDoc}
*/
public synchronized long getTotalErrorsLong()
{
return this.totalErrors;
}
@@ -307,9 +331,9 @@ public class BatchProcessor<T> implements BatchMonitor
/**
* {@inheritDoc}
*/
public int getTotalResults()
public long getTotalResultsLong()
{
return this.workProvider.getTotalEstimatedWorkSize();
return this.workProvider.getTotalEstimatedWorkSizeLong();
}
/**
@@ -340,12 +364,42 @@ public class BatchProcessor<T> implements BatchMonitor
* increased performance. If <code>false</code>, all invocations are performed in the current
* transaction. This is required if calling synchronously (e.g. in response to an authentication event in
* the same transaction).
* @deprecated use {@link #processLong(BatchProcessWorker, boolean)} instead
* @return the number of invocations
*/
@SuppressWarnings("serial")
public int process(final BatchProcessWorker<T> worker, final boolean splitTxns)
@Deprecated public int process(final BatchProcessWorker<T> worker, final boolean splitTxns)
{
int count = workProvider.getTotalEstimatedWorkSize();
return (int)process(worker, splitTxns, count);
}
/**
* Invokes the worker for each entry in the collection, managing transactions and collating success / failure
* information.
*
* @param worker
* the worker
* @param splitTxns
* Can the modifications to Alfresco be split across multiple transactions for maximum performance? If
* <code>true</code>, worker invocations are isolated in separate transactions in batches for
* increased performance. If <code>false</code>, all invocations are performed in the current
* transaction. This is required if calling synchronously (e.g. in response to an authentication event in
* the same transaction).
* @return the number of invocations
*/
@SuppressWarnings("serial")
public long processLong(final BatchProcessWorker<T> worker, final boolean splitTxns)
{
long count = workProvider.getTotalEstimatedWorkSizeLong();
return process(worker, splitTxns, count);
}
private long process(final BatchProcessWorker<T> worker, final boolean splitTxns, long count)
{
synchronized (this)
{
this.startTime = new Date();
@@ -365,27 +419,27 @@ public class BatchProcessor<T> implements BatchMonitor
// Create a thread pool executor with the specified number of threads and a finite blocking queue of jobs
ExecutorService executorService = splitTxns && this.workerThreads > 1 ?
new ThreadPoolExecutor(
this.workerThreads, this.workerThreads, 0L, TimeUnit.MILLISECONDS,
new ArrayBlockingQueue<Runnable>(this.workerThreads * this.batchSize * 10)
{
// Add blocking behaviour to work queue
@Override
public boolean offer(Runnable o)
{
try
{
put(o);
}
catch (InterruptedException e)
{
return false;
}
return true;
}
new ThreadPoolExecutor(
this.workerThreads, this.workerThreads, 0L, TimeUnit.MILLISECONDS,
new ArrayBlockingQueue<Runnable>(this.workerThreads * this.batchSize * 10)
{
// Add blocking behaviour to work queue
@Override
public boolean offer(Runnable o)
{
try
{
put(o);
}
catch (InterruptedException e)
{
return false;
}
return true;
}
},
threadFactory) : null;
},
threadFactory) : null;
try
{
Iterator<T> iterator = new WorkProviderIterator<T>(this.workProvider);
@@ -402,7 +456,7 @@ public class BatchProcessor<T> implements BatchMonitor
{
batch = new ArrayList<T>(this.batchSize);
}
if (executorService == null)
{
callback.run();
@@ -447,13 +501,12 @@ public class BatchProcessor<T> implements BatchMonitor
if (this.totalErrors > 0 && this.logger.isErrorEnabled())
{
this.logger.error(getProcessName() + ": " + this.totalErrors
+ " error(s) detected. Last error from entry \"" + this.lastErrorEntryId + "\"",
this.lastError);
+ " error(s) detected. Last error from entry \"" + this.lastErrorEntryId + "\"",
this.lastError);
}
}
}
}
/**
* Reports the current progress.
*
@@ -464,12 +517,20 @@ public class BatchProcessor<T> implements BatchMonitor
*/
private synchronized void reportProgress(boolean last)
{
int processed = this.successfullyProcessedEntries + this.totalErrors;
long processed = this.successfullyProcessedEntries + this.totalErrors;
if (processed % this.loggingInterval == 0 ^ last)
{
StringBuilder message = new StringBuilder(100).append(getProcessName()).append(": Processed ").append(
processed).append(" entries");
int totalResults = this.workProvider.getTotalEstimatedWorkSize();
long totalResults = 0;
try
{
totalResults = this.workProvider.getTotalEstimatedWorkSizeLong();
}
catch (UnsupportedOperationException uoe)
{
totalResults = this.workProvider.getTotalEstimatedWorkSize();
}
if (totalResults >= processed)
{
message.append(" out of ").append(totalResults).append(". ").append(
@@ -830,11 +891,11 @@ public class BatchProcessor<T> implements BatchMonitor
{
if (this.txnErrors > 0)
{
int processed = BatchProcessor.this.successfullyProcessedEntries + BatchProcessor.this.totalErrors;
int currentIncrement = processed % BatchProcessor.this.loggingInterval;
int newErrors = BatchProcessor.this.totalErrors + this.txnErrors;
long processed = BatchProcessor.this.successfullyProcessedEntries + BatchProcessor.this.totalErrors;
long currentIncrement = processed % BatchProcessor.this.loggingInterval;
long newErrors = BatchProcessor.this.totalErrors + this.txnErrors;
// Work out the number of logging intervals we will cross and report them
int intervals = (this.txnErrors + currentIncrement) / BatchProcessor.this.loggingInterval;
long intervals = (this.txnErrors + currentIncrement) / BatchProcessor.this.loggingInterval;
if (intervals > 0)
{
BatchProcessor.this.totalErrors += BatchProcessor.this.loggingInterval - currentIncrement;
@@ -850,11 +911,11 @@ public class BatchProcessor<T> implements BatchMonitor
if (this.txnSuccesses > 0)
{
int processed = BatchProcessor.this.successfullyProcessedEntries + BatchProcessor.this.totalErrors;
int currentIncrement = processed % BatchProcessor.this.loggingInterval;
int newSuccess = BatchProcessor.this.successfullyProcessedEntries + this.txnSuccesses;
long processed = BatchProcessor.this.successfullyProcessedEntries + BatchProcessor.this.totalErrors;
long currentIncrement = processed % BatchProcessor.this.loggingInterval;
long newSuccess = BatchProcessor.this.successfullyProcessedEntries + this.txnSuccesses;
// Work out the number of logging intervals we will cross and report them
int intervals = (this.txnSuccesses + currentIncrement) / BatchProcessor.this.loggingInterval;
long intervals = (this.txnSuccesses + currentIncrement) / BatchProcessor.this.loggingInterval;
if (intervals > 0)
{
BatchProcessor.this.successfullyProcessedEntries += BatchProcessor.this.loggingInterval

View File

@@ -1,20 +1,20 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
@@ -195,6 +195,12 @@ public class StripingFilesystemTracker extends AbstractFilesystemTracker
return count();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return count();
}
@Override
public Collection<ImportableItem> getNextWork()
{

View File

@@ -241,9 +241,14 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
@Override
public int getTotalEstimatedWorkSize()
{
int workSize = getNodesWithAspects.getWorkSize();
return workSize;
return (int)getTotalEstimatedWorkSizeLong();
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return getNodesWithAspects.getWorkSize();
}
@Override
public Collection<NodeRef> getNextWork()

View File

@@ -244,6 +244,15 @@ public class NodeArchiveServiceImpl implements NodeArchiveService
{
return 0;
}
/**
* @return Returns 0, always
*/
public synchronized long getTotalEstimatedWorkSizeLong()
{
return 0;
}
public synchronized Collection<NodeRef> getNextWork()
{
if (vmShutdownLister.isVmShuttingDown())

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.node.db;
import java.util.Collection;
@@ -240,6 +240,12 @@ public class NodeStringLengthWorker implements ApplicationContextAware
return -1;
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
return -1;
}
@Override
public Collection<NodePropertyEntity> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.security.authentication;
import java.io.Serializable;
@@ -403,6 +403,15 @@ public class UpgradePasswordHashWorker implements ApplicationContextAware, Initi
return (int)totalUserCount;
}
@Override
public long getTotalEstimatedWorkSizeLong()
{
// execute a query to get total number of user nodes in the system.
long totalUserCount = patchDAO.getCountNodesWithTypId(ContentModel.TYPE_USER);
return totalUserCount;
}
@Override
public Collection<Long> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.security.person;
import java.util.ArrayList;
@@ -320,8 +320,8 @@ public class HomeFolderProviderSynchronizer extends AbstractLifecycleBean
threadCount, peoplePerTransaction,
null,
batchLogger, 100);
processor.process(worker, true);
if (processor.getTotalErrors() > 0)
processor.processLong(worker, true);
if (processor.getTotalErrorsLong() > 0)
{
logger.info(" -- Give up after error --");
break;
@@ -874,6 +874,12 @@ public class HomeFolderProviderSynchronizer extends AbstractLifecycleBean
return size;
}
@Override
public synchronized long getTotalEstimatedWorkSizeLong()
{
return size;
}
@Override
public synchronized Collection<NodeRef> getNextWork()
{

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.tools;
import java.io.BufferedReader;
@@ -59,13 +59,13 @@ import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.VmShutdownListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Rename user tool. This tool provides minimal support for renaming users.
* See {@link #displayHelp} message for restrictions.
* <pre>
* Usage: renameUser -user username [options] oldUsername newUsername");
* renameUser -user username [options] -file filename");
/**
* Rename user tool. This tool provides minimal support for renaming users.
* See {@link #displayHelp} message for restrictions.
* <pre>
* Usage: renameUser -user username [options] oldUsername newUsername");
* renameUser -user username [options] -file filename");
* </pre>
* The csv file has a simple comma separated list, with
* a pair of usernames on each line. Comments and blank
@@ -549,6 +549,12 @@ public class RenameUser extends Tool
return size;
}
@Override
public synchronized long getTotalEstimatedWorkSizeLong()
{
return size;
}
@Override
public synchronized Collection<User> getNextWork()
{

View File

@@ -27,7 +27,7 @@
<!-- that inherit from that type. Permissions defined against aspects apply to all -->
<!-- objects or only objects that have the aspect applied. For example, the permission -->
<!-- to lock an object could apply to any object but the permission to unlock an -->
<!-- object woujld only apply to objects that have the lockable aspect. -->
<!-- object would only apply to objects that have the lockable aspect. -->
<!-- -->
<!-- =============================================== -->
@@ -42,7 +42,7 @@
<!-- -->
<!-- Permission groups are convenient groups of permissions. They may be used in -->
<!-- thier own right or as the effective set of permissions. If an authority has -->
<!-- their own right or as the effective set of permissions. If an authority has -->
<!-- all the permissions that make up a permission group they also have that -->
<!-- permission group even though it has not been explicitly granted. -->
<!-- -->
@@ -153,7 +153,7 @@
<!-- The permission to delete a node -->
<!-- -->
<!-- A node can only be deleted if there is delete permission on the node, if the -->
<!-- node is accesible via its parent, and if the node can be deleted from its -->
<!-- node is accessible via its parent, and if the node can be deleted from its -->
<!-- parent. Currently, there is no check that all the children can be deleted. -->
<!-- This check can be added but requires more work so the UI is not checking this -->
<!-- permission just to show the delete icon. -->
@@ -229,7 +229,7 @@
-->
</permission>
<!-- The permission to delte associations between nodes (not children) -->
<!-- The permission to delete associations between nodes (not children) -->
<permission name="_DeleteAssociations" expose="false" >
<grantedToGroup permissionGroup="DeleteAssociations" />
@@ -456,7 +456,7 @@
<!-- They can not be denied by the permissions set on any node. -->
<!-- -->
<!-- Admin can do anything to any ndoe -->
<!-- Admin can do anything to any node -->
<globalPermission permission="FullControl" authority="ROLE_ADMINISTRATOR"/>
<!-- For now, owners can always see, find and manipulate their stuff -->
@@ -468,7 +468,7 @@
<!-- Check in is granted to the lock owner -->
<globalPermission permission="CheckIn" authority="ROLE_LOCK_OWNER"/>
<!-- Cancel check out is granted to the locak owner -->
<!-- Cancel check out is granted to the lock owner -->
<globalPermission permission="CancelCheckOut" authority="ROLE_LOCK_OWNER"/>
</permissions>

View File

@@ -58,5 +58,8 @@
<value>path</value>
</property>
</bean>
<bean id ="repoHealthChecker" class="org.alfresco.repo.admin.RepoHealthChecker">
<constructor-arg index="0" ref="dataSourceCheck"/>
</bean>
</beans>

View File

@@ -3,7 +3,7 @@
repository.name=Main Repository
# Schema number
version.schema=15100
version.schema=16000
# Directory configuration
@@ -1308,3 +1308,6 @@ system.tempFileCleaner.maxTimeToRun=
# Property to long running migration to remove alf_server in v7+ patch.db-V7.1.0-remove-alf_server-table
system.remove-alf_server-table-from-db.ignored=true
# When using JSONP, allows unsecure usage of "callback" functions. Disabled by default for security reasons
allow.unsecure.callback.jsonp=false