You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2024/02/11 12:23:36 UTC

(jackrabbit) 01/01: JCR-5026: standalone: remove remote repository support (RMI and JNDI)

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

reschke pushed a commit to branch JCR-5026
in repository https://gitbox.apache.org/repos/asf/jackrabbit.git

commit 2f137b968ad3fd5d7107a1a72d5d0972ff5e6402
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Sun Feb 11 13:23:16 2024 +0100

    JCR-5026: standalone: remove remote repository support (RMI and JNDI)
---
 .../standalone/cli/ext/ConnectToJNDIServer.java    | 73 ----------------------
 .../standalone/cli/ext/ConnectToRmiServer.java     | 69 --------------------
 .../apache/jackrabbit/standalone/cli/command.xml   |  6 --
 3 files changed, 148 deletions(-)

diff --git a/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToJNDIServer.java b/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToJNDIServer.java
deleted file mode 100644
index f7b3cebed..000000000
--- a/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToJNDIServer.java
+++ /dev/null
@@ -1,73 +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.jackrabbit.standalone.cli.ext;
-
-import javax.jcr.Repository;
-import javax.naming.InitialContext;
-
-import org.apache.commons.chain.Command;
-import org.apache.commons.chain.Context;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.rmi.client.ClientAdapterFactory;
-import org.apache.jackrabbit.rmi.remote.RemoteRepository;
-import org.apache.jackrabbit.standalone.cli.CommandHelper;
-
-/**
-* @deprecated RMI support is deprecated and will be removed in a future version of Jackrabbit; see <a href=https://issues.apache.org/jira/browse/JCR-4972 target=_blank>Jira ticket JCR-4972</a> for more information.
-* Connect to a JCR-RMI server
-*/
-@Deprecated(forRemoval = true)
-public class ConnectToJNDIServer implements Command {
-	/** logger */
-	private static Log log = LogFactory.getLog(ConnectToJNDIServer.class);
-
-	// ---------------------------- < keys >
-	/** url key */
-	private String urlKey = "url";
-
-	/**
-	 * {@inheritDoc}
-	 */
-	public boolean execute(Context ctx) throws Exception {
-		String url = (String) ctx.get(this.urlKey);
-		if (log.isDebugEnabled()) {
-			log.debug("connecting to jndi server at " + url);
-		}
-		InitialContext iCtx = new InitialContext();
-		ClientAdapterFactory adapter = new ClientAdapterFactory();
-		RemoteRepository remote = (RemoteRepository) iCtx.lookup(url);
-		Repository repo = adapter.getRepository(remote);
-		CommandHelper.setRepository(ctx, repo, "jndi " + url);
-		return false;
-	}
-
-	/**
-	 * @return the url key
-	 */
-	public String getUrlKey() {
-		return urlKey;
-	}
-
-	/**
-	 * @param urlKey
-	 *            the url key to set
-	 */
-	public void setUrlKey(String urlKey) {
-		this.urlKey = urlKey;
-	}
-}
diff --git a/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToRmiServer.java b/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToRmiServer.java
deleted file mode 100644
index 6ba205e13..000000000
--- a/jackrabbit-standalone-components/src/main/java/org/apache/jackrabbit/standalone/cli/ext/ConnectToRmiServer.java
+++ /dev/null
@@ -1,69 +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.jackrabbit.standalone.cli.ext;
-
-import javax.jcr.Repository;
-
-import org.apache.commons.chain.Command;
-import org.apache.commons.chain.Context;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.rmi.client.ClientRepositoryFactory;
-import org.apache.jackrabbit.standalone.cli.CommandHelper;
-
-/**
- * @deprecated RMI support is deprecated and will be removed in a future version of Jackrabbit; see <a href=https://issues.apache.org/jira/browse/JCR-4972 target=_blank>Jira ticket JCR-4972</a> for more information.
- * Connect to a JCR-RMI server
- */
-@Deprecated(forRemoval = true)
-public class ConnectToRmiServer implements Command {
-    /** logger */
-    private static Log log = LogFactory.getLog(ConnectToRmiServer.class);
-
-    // ---------------------------- < keys >
-    /** url key */
-    private String urlKey = "url";
-
-    /**
-     * {@inheritDoc}
-     */
-    public boolean execute(Context ctx) throws Exception {
-        String url = (String) ctx.get(this.urlKey);
-        if (log.isDebugEnabled()) {
-            log.debug("connecting to jcr-rmi server at " + url);
-        }
-        ClientRepositoryFactory factory = new ClientRepositoryFactory();
-        Repository repository = factory.getRepository(url);
-        CommandHelper.setRepository(ctx, repository, "jcr-rmi " + url);
-        return false;
-    }
-
-    /**
-     * @return the url key
-     */
-    public String getUrlKey() {
-        return urlKey;
-    }
-
-    /**
-     * @param urlKey
-     *            the url key to set
-     */
-    public void setUrlKey(String urlKey) {
-        this.urlKey = urlKey;
-    }
-}
diff --git a/jackrabbit-standalone-components/src/main/resources/org/apache/jackrabbit/standalone/cli/command.xml b/jackrabbit-standalone-components/src/main/resources/org/apache/jackrabbit/standalone/cli/command.xml
index 959990e3f..6a226719c 100644
--- a/jackrabbit-standalone-components/src/main/resources/org/apache/jackrabbit/standalone/cli/command.xml
+++ b/jackrabbit-standalone-components/src/main/resources/org/apache/jackrabbit/standalone/cli/command.xml
@@ -54,12 +54,6 @@
 		<command name="collectProperties"
 			className="org.apache.jackrabbit.standalone.cli.collect.CollectProperties"/>
 
-		<command name="connectToRmiServer"
-			className="org.apache.jackrabbit.standalone.cli.ext.ConnectToRmiServer"/>
-
-		<command name="connectToJndiServer"
-			className="org.apache.jackrabbit.standalone.cli.ext.ConnectToJNDIServer"/>
-			
 		<command name="copy"
 			className="org.apache.jackrabbit.standalone.cli.core.Copy"/>