You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:43:02 UTC
[sling-org-apache-sling-installer-hc] annotated tag
org.apache.sling.installer.hc-1.0.0 created (now 3e60c67)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git.
at 3e60c67 (tag)
tagging 544077cdb24a5b786ff26aafc3e9b2755e5b91bd (commit)
by Oliver Lietz
on Thu Mar 2 07:41:21 2017 +0000
- Log -----------------------------------------------------------------
org.apache.sling.installer.hc-1.0.0
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new d3dcf75 SLING-5888 new hc module for making sure that bundles/configurations have been successfully installed by the OSGi installer
new f1c6fbc fix typo
new 8d1afb4 SLING-5888 fix emitted warnings and only count those configurations/bundles which have been actually checked
new 4f4ee4e SLING-5888 - clearer (I think) log messages
new b88f07d fix typo
new 17a39bd shorten description for URL prefixes, add tag installer
new 6837d8e use Sling Parent 29, fix SCM URLs, add missing scopes
new 9c858e9 [maven-release-plugin] prepare release org.apache.sling.installer.hc-1.0.0
new 544077c [maven-release-plugin] copy for tag org.apache.sling.installer.hc-1.0.0
The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].
[sling-org-apache-sling-installer-hc] 05/09: fix typo
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit b88f07dac9fe31e3b789395f3f12af394a475e71
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Mar 1 16:17:20 2017 +0000
fix typo
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1784983 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
index 3fd4f99..e423664 100644
--- a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -95,7 +95,7 @@ public class OsgiInstallerHealthCheck implements HealthCheck {
}
hcLog.info("Checked {} OSGi bundles and {} configurations.", numCheckedBundles, numCheckedConfigurations);
if (hcLog.getAggregateStatus().ordinal() >= Result.Status.WARN.ordinal()) {
- hcLog.info("Refer to the OSGI installer's documentation page at {} for further details on how to fix those issues.", DOCUMENTATION_URL);
+ hcLog.info("Refer to the OSGi installer's documentation page at {} for further details on how to fix those issues.", DOCUMENTATION_URL);
}
return new Result(hcLog);
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 08/09: [maven-release-plugin]
prepare release org.apache.sling.installer.hc-1.0.0
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 9c858e93d3f51da84eac323dbe5396b613ca4d05
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 2 07:41:05 2017 +0000
[maven-release-plugin] prepare release org.apache.sling.installer.hc-1.0.0
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1785081 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index 09c081b..f671577 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,8 +9,7 @@
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
-<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/maven-v4_0_0.xsd">
+<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -21,7 +20,7 @@
</parent>
<artifactId>org.apache.sling.installer.hc</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0</version>
<packaging>bundle</packaging>
<name>Apache Sling Installer Health Checks</name>
@@ -30,9 +29,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/installer/hc</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/installer/hc</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/installer/hc</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.installer.hc-1.0.0</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.installer.hc-1.0.0</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.installer.hc-1.0.0</url>
</scm>
<!-- make compile with java 7 -->
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 04/09: SLING-5888 - clearer
(I think) log messages
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 4f4ee4e13afcfc59258900222611f09a5f47b41f
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Aug 22 06:53:52 2016 +0000
SLING-5888 - clearer (I think) log messages
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1757111 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
index f1eaa95..3fd4f99 100644
--- a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -118,13 +118,13 @@ public class OsgiInstallerHealthCheck implements HealthCheck {
switch (resourceType) {
case InstallableResource.TYPE_CONFIG:
if (!checkConfigurations) {
- LOG.debug("Skip resource '{}' as it is a configuration", resource.getEntityId());
+ LOG.debug("Skip resource '{}', configuration checks are disabled", resource.getEntityId());
return "";
}
break;
case InstallableResource.TYPE_BUNDLE:
if (!checkBundles) {
- LOG.debug("Skip resource '{}' as it is a bundle", resource.getEntityId());
+ LOG.debug("Skip resource '{}', bundle checks are disabled", resource.getEntityId());
return "";
}
break;
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 07/09: use Sling Parent 29,
fix SCM URLs, add missing scopes
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 6837d8e31a55433e974e637bdbcbb06f58f733ef
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 2 07:28:50 2017 +0000
use Sling Parent 29, fix SCM URLs, add missing scopes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1785075 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index df07ccc..09c081b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,7 +16,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>28</version>
+ <version>29</version>
<relativePath />
</parent>
@@ -26,13 +26,13 @@
<name>Apache Sling Installer Health Checks</name>
<description>
- Provides Sling health checks related to the Sling Installer.
+ Provides Sling Health Checks related to the Sling Installer.
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/installer/healthcheck</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/installer/healthcheck</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/installer/healthcheck</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/installer/hc</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/installer/hc</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/installer/hc</url>
</scm>
<!-- make compile with java 7 -->
@@ -58,10 +58,12 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
@@ -86,6 +88,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 06/09: shorten description
for URL prefixes, add tag installer
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 17a39bda0a232f7148316d3216cdc4bb43b83245
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 2 07:19:10 2017 +0000
shorten description for URL prefixes, add tag installer
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1785074 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/sling/installer/hc/OsgiInstallerHealthCheck.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
index e423664..ab7abb4 100644
--- a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -37,7 +37,14 @@ import org.osgi.service.cm.ConfigurationAdmin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@SlingHealthCheck(name = OsgiInstallerHealthCheck.HC_NAME, description = "Checks that all OSGi configurations/bundles are successfully installed by the OSGi Installer (and are not skipped for some reason).", tags = "osgi")
+@SlingHealthCheck(
+ name = OsgiInstallerHealthCheck.HC_NAME,
+ description = "Checks that all OSGi configurations/bundles are successfully installed by the OSGi Installer (and are not skipped for some reason).",
+ tags = {
+ "installer",
+ "osgi"
+ }
+)
public class OsgiInstallerHealthCheck implements HealthCheck {
protected static final String HC_NAME = "OSGi Installer Health Check";
@@ -48,7 +55,7 @@ public class OsgiInstallerHealthCheck implements HealthCheck {
private static final String DEFAULT_URL_PREFIX = "jcrinstall:/apps/";
- @Property(label = "URL Prefixes to consider", description = "Only those OSGi configurations/bundles whose location are starting with one of the given URL prefixes are checked (whether they are installed correctly). Open /system/console/osgi-installer for a list of valid prefixes. The bundles/configs with those prefixes are asserted to be successfully installed under all circumstances!", cardinality = 1, value = DEFAULT_URL_PREFIX)
+ @Property(label = "URL Prefixes to consider", description = "Only those OSGi configurations/bundles whose location are starting with one of the given URL prefixes are checked (whether they are installed correctly). Open /system/console/osgi-installer for a list of valid prefixes.", cardinality = 1, value = DEFAULT_URL_PREFIX)
static final String PROP_URL_PREFIXES = "urlPrefixes";
@Property(label = "Check Bundles", description = "If enabled bundles are checked (restricted to the ones matching one of the prefixes)", boolValue = true)
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 02/09: fix typo
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit f1c6fbcc502ea076edd816c20157fc9d5d557ef4
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Aug 17 11:33:39 2016 +0000
fix typo
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1756619 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
index 3a7b578..d718030 100644
--- a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -95,7 +95,7 @@ public class OsgiInstallerHealthCheck implements HealthCheck {
}
hcLog.info("Checked {} OSGi bundles and {} configurations.", numCheckedBundles, numCheckedConfigurations);
if (hcLog.getAggregateStatus().ordinal() >= Result.Status.WARN.ordinal()) {
- hcLog.info("Refer to the OSGI installers documentation page at {} for further details on how to fix those issues.", DOCUMENTATION_URL);
+ hcLog.info("Refer to the OSGI installer's documentation page at {} for further details on how to fix those issues.", DOCUMENTATION_URL);
}
return new Result(hcLog);
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 09/09: [maven-release-plugin]
copy for tag org.apache.sling.installer.hc-1.0.0
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 544077cdb24a5b786ff26aafc3e9b2755e5b91bd
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 2 07:41:21 2017 +0000
[maven-release-plugin] copy for tag org.apache.sling.installer.hc-1.0.0
git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.installer.hc-1.0.0@1785082 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 01/09: SLING-5888 new hc
module for making sure that bundles/configurations have been successfully
installed by the OSGi installer
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit d3dcf757419f31b45357eb373a1498303dd4e0eb
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Aug 17 11:13:19 2016 +0000
SLING-5888 new hc module for making sure that bundles/configurations have been successfully installed by the OSGi installer
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1756614 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 108 +++++++++++++
.../installer/hc/OsgiInstallerHealthCheck.java | 169 +++++++++++++++++++++
2 files changed, 277 insertions(+)
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..df07ccc
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>28</version>
+ <relativePath />
+ </parent>
+
+ <artifactId>org.apache.sling.installer.hc</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>Apache Sling Installer Health Checks</name>
+ <description>
+ Provides Sling health checks related to the Sling Installer.
+ </description>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/installer/healthcheck</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/installer/healthcheck</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/installer/healthcheck</url>
+ </scm>
+
+ <!-- make compile with java 7 -->
+ <properties>
+ <sling.java.version>7</sling.java.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.osgi</artifactId>
+ <version>2.2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- reference old API bundle to generate broader import ranges making
+ this HC bundle compliant with older versions as well -->
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.installer.api</artifactId>
+ <version>1.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.hc.core</artifactId>
+ <version>1.0.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.hc.annotations</artifactId>
+ <version>1.0.4</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
new file mode 100644
index 0000000..3a7b578
--- /dev/null
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The SF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+package org.apache.sling.installer.hc;
+
+import java.util.Map;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.hc.annotations.SlingHealthCheck;
+import org.apache.sling.hc.api.HealthCheck;
+import org.apache.sling.hc.api.Result;
+import org.apache.sling.hc.util.FormattingResultLog;
+import org.apache.sling.installer.api.InstallableResource;
+import org.apache.sling.installer.api.info.InfoProvider;
+import org.apache.sling.installer.api.info.InstallationState;
+import org.apache.sling.installer.api.info.Resource;
+import org.apache.sling.installer.api.info.ResourceGroup;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SlingHealthCheck(name = OsgiInstallerHealthCheck.HC_NAME, description = "Checks that all OSGi configurations/bundles are successfully installed by the OSGi Installer (and are not skipped for some reason).", tags = "osgi")
+public class OsgiInstallerHealthCheck implements HealthCheck {
+ protected static final String HC_NAME = "OSGi Installer Health Check";
+
+ @Reference
+ private InfoProvider infoProvider;
+
+ private static final Logger LOG = LoggerFactory.getLogger(OsgiInstallerHealthCheck.class);
+
+ private static final String DEFAULT_URL_PREFIX = "jcrinstall:/apps/";
+
+ @Property(label = "URL Prefixes to consider", description = "Only those OSGi configurations/bundles whose location are starting with one of the given URL prefixes are checked (whether they are installed correctly). Open /system/console/osgi-installer for a list of valid prefixes. The bundles/configs with those prefixes are asserted to be successfully installed under all circumstances!", cardinality = 1, value = DEFAULT_URL_PREFIX)
+ static final String PROP_URL_PREFIXES = "urlPrefixes";
+
+ @Property(label = "Check Bundles", description = "If enabled bundles are checked (restricted to the ones matching one of the prefixes)", boolValue = true)
+ static final String PROP_CHECK_BUNDLES = "checkBundles";
+
+ @Property(label = "Check Configurations", description = "If enabled configurations are checked (restricted to the ones matching one of the prefixes)", boolValue = true)
+ static final String PROP_CHECK_CONFIGURATIONS = "checkConfigurations";
+
+ private String[] urlPrefixes;
+ private boolean checkBundles;
+ private boolean checkConfigurations;
+
+ private final static String DOCUMENTATION_URL = "https://sling.apache.org/documentation/bundles/osgi-installer.html#health-check";
+
+ @Reference
+ private ConfigurationAdmin configurationAdmin;
+
+ @Activate
+ public void activate(Map<String, ?> properties) {
+ urlPrefixes = PropertiesUtil.toStringArray(properties.get(PROP_URL_PREFIXES),
+ new String[] { DEFAULT_URL_PREFIX });
+ checkBundles = PropertiesUtil.toBoolean(properties.get(PROP_CHECK_BUNDLES), true);
+ checkConfigurations = PropertiesUtil.toBoolean(properties.get(PROP_CHECK_CONFIGURATIONS), true);
+ }
+
+ @Override
+ public Result execute() {
+ InstallationState installationState = infoProvider.getInstallationState();
+ FormattingResultLog hcLog = new FormattingResultLog();
+
+ int numCheckedConfigurations = 0;
+ int numCheckedBundles = 0;
+ // go through all resource groups of the OSGi Installer
+ for (final ResourceGroup group : installationState.getInstalledResources()) {
+ String type = evaluateGroup(group, hcLog);
+ switch (type) {
+ case InstallableResource.TYPE_CONFIG:
+ numCheckedConfigurations++;
+ break;
+ case InstallableResource.TYPE_BUNDLE:
+ numCheckedBundles++;
+ break;
+ }
+ }
+ hcLog.info("Checked {} OSGi bundles and {} configurations.", numCheckedBundles, numCheckedConfigurations);
+ if (hcLog.getAggregateStatus().ordinal() >= Result.Status.WARN.ordinal()) {
+ hcLog.info("Refer to the OSGI installers documentation page at {} for further details on how to fix those issues.", DOCUMENTATION_URL);
+ }
+ return new Result(hcLog);
+ }
+
+ /**
+ * @param group
+ * the resource group to evaluate
+ * @param hcLog
+ * the log to fill during the health check
+ * @return the type of resources in this group ("bundle" or "config") or empty string, if the group was not
+ * considered by this health check
+ */
+ private String evaluateGroup(ResourceGroup group, FormattingResultLog hcLog) {
+ Resource invalidResource = null;
+ String resourceType = "";
+ // go through all resources within the given group
+ for (Resource resource : group.getResources()) {
+ // check for the correct type
+ resourceType = resource.getType();
+ switch (resourceType) {
+ case InstallableResource.TYPE_CONFIG:
+ if (!checkConfigurations) {
+ LOG.debug("Skip resource '{}' as it is a configuration", resource.getEntityId());
+ return "";
+ }
+ break;
+ case InstallableResource.TYPE_BUNDLE:
+ if (!checkBundles) {
+ LOG.debug("Skip resource '{}' as it is a bundle", resource.getEntityId());
+ return "";
+ }
+ break;
+ default:
+ LOG.debug("Skip resource '{}' as it is neither a bundle nor a configuration but a {}",
+ resource.getEntityId(), resourceType);
+ return "";
+ }
+ if (StringUtils.startsWithAny(resource.getURL(), urlPrefixes)) {
+ switch (resource.getState()) {
+ case IGNORED: // means a considered resource was found and it is invalid
+ // still the other resources need to be evaluated
+ case INSTALL:
+ if (invalidResource == null) {
+ invalidResource = resource;
+ }
+ break;
+ default:
+ // means a considered resource was found and it is valid
+ // no need to evaluate other resources from this group
+ return resourceType;
+ }
+ } else {
+ LOG.debug("Skipping resource '{}' as its URL is not starting with any of these prefixes'{}'", resource,
+ StringUtils.join(urlPrefixes, ","));
+ }
+ }
+ if (invalidResource != null) {
+ if (resourceType.equals(InstallableResource.TYPE_CONFIG)) {
+ hcLog.critical(
+ "The installer state of the OSGi configuration resource '{}' is {}, probably because a later version of that bundle is already installed!",
+ invalidResource, invalidResource.getState());
+ } else {
+ hcLog.critical(
+ "The installer state of the OSGi bundle resource '{}' is {}, config might have been manually overwritten!",
+ invalidResource, invalidResource.getState());
+ }
+ }
+ return resourceType;
+ }
+
+}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-installer-hc] 03/09: SLING-5888 fix emitted
warnings and only count those configurations/bundles which have been
actually checked
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.hc-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-hc.git
commit 8d1afb41bdb76206d2086d80ec47160facb749f4
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Aug 18 13:02:46 2016 +0000
SLING-5888 fix emitted warnings and only count those configurations/bundles which have been actually checked
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/hc@1756774 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
index d718030..f1eaa95 100644
--- a/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
+++ b/src/main/java/org/apache/sling/installer/hc/OsgiInstallerHealthCheck.java
@@ -155,15 +155,18 @@ public class OsgiInstallerHealthCheck implements HealthCheck {
if (invalidResource != null) {
if (resourceType.equals(InstallableResource.TYPE_CONFIG)) {
hcLog.critical(
- "The installer state of the OSGi configuration resource '{}' is {}, probably because a later version of that bundle is already installed!",
+ "The installer state of the OSGi configuration resource '{}' is {}, config might have been manually overwritten!",
invalidResource, invalidResource.getState());
} else {
hcLog.critical(
- "The installer state of the OSGi bundle resource '{}' is {}, config might have been manually overwritten!",
+ "The installer state of the OSGi bundle resource '{}' is {}, probably because a later or the same version of that bundle is already installed!",
invalidResource, invalidResource.getState());
}
+ return resourceType;
+ } else {
+ return ""; // do not count this group, as only non-considered resources have been in there
}
- return resourceType;
+
}
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.