You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2020/10/12 12:00:50 UTC

[sling-org-apache-sling-graphql-core] branch master updated: SLING-9813 - Remove scripted SlingDataFetcher support

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

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git


The following commit(s) were added to refs/heads/master by this push:
     new da3e424  SLING-9813 - Remove scripted SlingDataFetcher support
da3e424 is described below

commit da3e424e59f2964d8b87501360356f536d9483e7
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Mon Oct 12 14:00:26 2020 +0200

    SLING-9813 - Remove scripted SlingDataFetcher support
    
    * removed two more unused classes
---
 .../graphql/core/engine/SlingGraphQLException.java | 32 ---------------
 .../graphql/core/engine/SlingScriptWrapper.java    | 46 ----------------------
 2 files changed, 78 deletions(-)

diff --git a/src/main/java/org/apache/sling/graphql/core/engine/SlingGraphQLException.java b/src/main/java/org/apache/sling/graphql/core/engine/SlingGraphQLException.java
deleted file mode 100644
index 9e213f1..0000000
--- a/src/main/java/org/apache/sling/graphql/core/engine/SlingGraphQLException.java
+++ /dev/null
@@ -1,32 +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.graphql.core.engine;
-
-public class SlingGraphQLException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    public SlingGraphQLException(String reason, Throwable cause) {
-        super(reason, cause);
-    }
-
-    public SlingGraphQLException(String reason) {
-        super(reason);
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/graphql/core/engine/SlingScriptWrapper.java b/src/main/java/org/apache/sling/graphql/core/engine/SlingScriptWrapper.java
deleted file mode 100644
index 1413e84..0000000
--- a/src/main/java/org/apache/sling/graphql/core/engine/SlingScriptWrapper.java
+++ /dev/null
@@ -1,46 +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.graphql.core.engine;
-
-import org.apache.sling.api.scripting.SlingBindings;
-import org.apache.sling.api.scripting.SlingScript;
-import org.apache.sling.graphql.api.SlingDataFetcher;
-import org.apache.sling.graphql.api.SlingDataFetcherEnvironment;
-
-class SlingScriptWrapper implements SlingDataFetcher<Object> {
-
-    private final SlingScript script;
-
-    public static final String RESOURCE = "resource";
-    public static final String ENVIRONMENT = "environment";
-
-    SlingScriptWrapper(SlingScript script) {
-        this.script = script;
-    }
-    
-    @Override
-    public Object get(SlingDataFetcherEnvironment env) throws Exception {
-        final SlingBindings b = new SlingBindings();
-        b.put(ENVIRONMENT, env);
-        b.put(RESOURCE, env.getCurrentResource());
-        return script.eval(b);
-    }
-}
\ No newline at end of file