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:28:51 UTC

[sling-org-apache-sling-distribution-api] 17/41: SLING-4153 - fixed transport API to just expose the secret

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

rombert pushed a commit to annotated tag org.apache.sling.distribution.api-0.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-api.git

commit 7e0fede271f3bb24fc924383e3e9ac4b1779cd9d
Author: Tommaso Teofili <to...@apache.org>
AuthorDate: Fri Dec 5 08:08:59 2014 +0000

    SLING-4153 - fixed transport API to just expose the secret
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1643180 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  2 +-
 .../communication/DistributionRequest.java         |  2 +-
 .../packaging/DistributionPackageExporter.java     |  2 +-
 .../TransportAuthenticationContext.java            | 40 ---------------
 .../TransportAuthenticationException.java          | 35 -------------
 .../TransportAuthenticationProvider.java           | 57 ----------------------
 .../transport/authentication/package-info.java     | 24 ---------
 7 files changed, 3 insertions(+), 159 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0a5ef8f..8cc0885 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>20</version>
     </parent>
 
     <!-- ======================================================================= -->
diff --git a/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java b/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
index 5c11434..0792999 100644
--- a/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
+++ b/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
@@ -58,7 +58,7 @@ public final class DistributionRequest {
     @Override
     public String toString() {
         return "DistributionRequest{" +
-                ", actionType=" + actionType +
+                "actionType=" + actionType +
                 ", paths=" + Arrays.toString(paths) +
                 '}';
     }
diff --git a/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java b/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
index a5e0c13..25aed24 100644
--- a/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
+++ b/src/main/java/org/apache/sling/distribution/packaging/DistributionPackageExporter.java
@@ -34,7 +34,7 @@ import org.apache.sling.distribution.communication.DistributionRequest;
  * <p/>
  * Exporting a {@link org.apache.sling.distribution.packaging.DistributionPackage} means obtaining that package by either
  * directly creating it by bundling local Sling resources together or retrieving it from a remote endpoint, e.g. by
- * executing an HTTP request to another Sling instance exposing already created packages (for remotely changed resources).
+ * executing an HTTP POST request on another Sling instance exposing already created packages (for remotely changed resources).
  */
 @ConsumerType
 public interface DistributionPackageExporter {
diff --git a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java b/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java
deleted file mode 100644
index b1e3c18..0000000
--- a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationContext.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.transport.authentication;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class TransportAuthenticationContext {
-    private final Map<String, Object> attributes = new HashMap<String, Object>();
-
-    @SuppressWarnings("unchecked")
-    public <T> T getAttribute(String name, Class<? extends T> klass) {
-        T result = null;
-        Object object = attributes.get(name);
-        if (klass.isInstance(object)) {
-            result = (T) object;
-        }
-        return result;
-    }
-
-    public <T> void addAttribute(String name, T object) {
-        attributes.put(name, object);
-    }
-}
diff --git a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java b/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java
deleted file mode 100644
index b4f7765..0000000
--- a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.transport.authentication;
-
-/**
- * Represents an error in transport authentication
- */
-@SuppressWarnings("serial")
-public class TransportAuthenticationException extends Exception {
-
-    public TransportAuthenticationException(String string) {
-        super(string);
-    }
-
-    public TransportAuthenticationException(Exception e) {
-        super(e);
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java b/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java
deleted file mode 100644
index a956dc3..0000000
--- a/src/main/java/org/apache/sling/distribution/transport/authentication/TransportAuthenticationProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.transport.authentication;
-
-import aQute.bnd.annotation.ConsumerType;
-
-/**
- * A {@link org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider} is responsible for
- * authentication of instances sending and receiving distribution items via transport algorithms
- * A {@link org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider} will authenticate
- * 'authenticables' objects of type {@link A}, producing 'authenticated' objects of type {@link T}.
- *
- */
-@ConsumerType
-public interface TransportAuthenticationProvider<A, T> {
-
-    /**
-     * Check if this provider is able to authenticate objects belonging to given 'authenticable' class.
-     *
-     * @param authenticable class of objects to be authenticated
-     * @return {@code true} if this provider can check authentication on instances of this class, {@code false}
-     * otherwise
-     */
-    boolean canAuthenticate(Class<A> authenticable);
-
-    /**
-     * Authenticate an 'authenticable' object by performing some implementation specific operation on it, and producing
-     * an 'authenticated' object to be passed back to a transport algorithm.
-     * The returned 'authenticated' object may be of the same class of the 'authenticable' object (e.g. passing an 'authenticable'
-     * http client and returning an 'authenticated' http client) or of a different class (e.g. passing an 'authenticable'
-     * jcr repository and returning an 'authenticated' jcr session).
-     *
-     * @param authenticable class of objects to be authenticated
-     * @param context       authentication context holding authentication information
-     * @return an 'authenticated' object to be used by the transport
-     * @throws TransportAuthenticationException
-     */
-    T authenticate(A authenticable, TransportAuthenticationContext context)
-            throws TransportAuthenticationException;
-
-}
diff --git a/src/main/java/org/apache/sling/distribution/transport/authentication/package-info.java b/src/main/java/org/apache/sling/distribution/transport/authentication/package-info.java
deleted file mode 100644
index de83a67..0000000
--- a/src/main/java/org/apache/sling/distribution/transport/authentication/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.
- */
-
-@Version("0.1.0")
-package org.apache.sling.distribution.transport.authentication;
-
-import aQute.bnd.annotation.Version;
-

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.