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 12388d58c65807513947c3a24773f6c37ab0d2b4
Author: Marius Petria <[email protected]>
AuthorDate: Wed Nov 26 13:08:10 2014 +0000

    SLING-4153: hiding authorization strategy and request time
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/distribution/api@1641803
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../DistributionRequestAuthorizationException.java | 28 ---------------
 .../DistributionRequestAuthorizationStrategy.java  | 42 ----------------------
 .../communication/DistributionRequest.java         | 12 -------
 3 files changed, 82 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
 
b/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
deleted file mode 100644
index 65dd507..0000000
--- 
a/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationException.java
+++ /dev/null
@@ -1,28 +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.agent;
-
-/**
- * An {@link Exception} representing failed authorization in execution of a 
certain {@link org.apache.sling.distribution.communication.DistributionRequest}
- */
-public class DistributionRequestAuthorizationException extends Exception {
-    public DistributionRequestAuthorizationException(String message) {
-        super(message);
-    }
-}
diff --git 
a/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
 
b/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
deleted file mode 100644
index 791076e..0000000
--- 
a/src/main/java/org/apache/sling/distribution/agent/DistributionRequestAuthorizationStrategy.java
+++ /dev/null
@@ -1,42 +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.agent;
-
-import javax.annotation.Nonnull;
-
-import aQute.bnd.annotation.ConsumerType;
-import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.distribution.communication.DistributionRequest;
-
-/**
- * Strategy for authorizing requests
- */
-@ConsumerType
-public interface DistributionRequestAuthorizationStrategy {
-
-    /**
-     * @param resourceResolver   a {@link 
org.apache.sling.api.resource.ResourceResolver} representing the calling 'user'
-     * @param distributionRequest a request bringing metadata for getting 
{@link org.apache.sling.distribution.packaging.DistributionPackage}s
-     *                           to be exported
-     * @throws DistributionRequestAuthorizationException if the {@link 
org.apache.sling.api.resource.ResourceResolver} is
-     *                                                  not authorized to 
execute the given {@link 
org.apache.sling.distribution.communication.DistributionRequest}
-     */
-    void checkPermission(@Nonnull ResourceResolver resourceResolver, @Nonnull 
DistributionRequest distributionRequest) throws 
DistributionRequestAuthorizationException;
-
-}
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 05811f8..5c11434 100644
--- 
a/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
+++ 
b/src/main/java/org/apache/sling/distribution/communication/DistributionRequest.java
@@ -27,28 +27,17 @@ import java.util.Arrays;
  */
 public final class DistributionRequest {
 
-    private final long time;
 
     private final DistributionRequestType actionType;
 
     private final String[] paths;
 
     public DistributionRequest(@Nonnull DistributionRequestType actionType, 
@Nonnull String... paths) {
-        this.time = System.currentTimeMillis();
         this.actionType = actionType;
         this.paths = paths;
     }
 
     /**
-     * get the time this distribution request was created as a {@code long} 
returned by {@code System#currentTimeMillis}.
-     *
-     * @return the distribution request creation time as returned by {@code 
System#currentTimeMillis}
-     */
-    public long getTime() {
-        return time;
-    }
-
-    /**
      * get the {@link DistributionRequestType} associated with this request
      *
      * @return the type of actionType for request as a {@link 
DistributionRequestType}
@@ -69,7 +58,6 @@ public final class DistributionRequest {
     @Override
     public String toString() {
         return "DistributionRequest{" +
-                "time=" + time +
                 ", actionType=" + actionType +
                 ", paths=" + Arrays.toString(paths) +
                 '}';

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to