You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by tm...@apache.org on 2023/11/11 21:28:29 UTC

(sling-org-apache-sling-distribution-journal-messages) branch master updated: SLING-12132 - Add package message metadata provider SPI (#19)

This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal-messages.git


The following commit(s) were added to refs/heads/master by this push:
     new f01a9b8  SLING-12132 - Add package message metadata provider SPI (#19)
f01a9b8 is described below

commit f01a9b84ca73204eb7300707b5b7cef9c4696ac3
Author: José Correia <37...@users.noreply.github.com>
AuthorDate: Sat Nov 11 22:28:24 2023 +0100

    SLING-12132 - Add package message metadata provider SPI (#19)
    
    
    Co-authored-by: josec <jo...@adobe.com>
---
 pom.xml                                            |  7 +++++
 .../spi/PackageMessageMetadataProvider.java        | 35 ++++++++++++++++++++++
 .../journal/messages/spi/package-info.java         | 20 +++++++++++++
 3 files changed, 62 insertions(+)

diff --git a/pom.xml b/pom.xml
index 4b48588..bf8c0aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,6 +77,13 @@
             <version>2.0.0</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.distribution.api</artifactId>
+            <version>0.7.0</version>
+            <scope>provided</scope>
+        </dependency>
+
         <!-- Test -->
         <dependency>
             <groupId>junit</groupId>
diff --git a/src/main/java/org/apache/sling/distribution/journal/messages/spi/PackageMessageMetadataProvider.java b/src/main/java/org/apache/sling/distribution/journal/messages/spi/PackageMessageMetadataProvider.java
new file mode 100644
index 0000000..45a7d1e
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/journal/messages/spi/PackageMessageMetadataProvider.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+package org.apache.sling.distribution.journal.messages.spi;
+
+import org.apache.sling.distribution.DistributionRequest;
+import org.apache.sling.distribution.journal.messages.PackageMessage;
+import org.osgi.annotation.versioning.ConsumerType;
+
+import java.util.Map;
+
+
+/**
+ * This interface can be used to provide metadata for a ${@link PackageMessage}.
+ */
+@ConsumerType
+public interface PackageMessageMetadataProvider {
+
+	Map<String,String> getMetadata(DistributionRequest request) throws Exception;
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/distribution/journal/messages/spi/package-info.java b/src/main/java/org/apache/sling/distribution/journal/messages/spi/package-info.java
new file mode 100644
index 0000000..6196104
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/journal/messages/spi/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.distribution.journal.messages.spi;
\ No newline at end of file