Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* ModeShape (http://www.modeshape.org)
*
* Licensed 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.modeshape.jdbc.delegate;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
import javax.jcr.RepositoryException;
import javax.jcr.nodetype.NodeType;
import javax.jcr.query.QueryResult;
import org.modeshape.jdbc.JcrDriver;
import org.modeshape.jdbc.JdbcLocalI18n;
import org.modeshape.jdbc.LocalJcrDriver.JcrContextFactory;
import org.modeshape.jdbc.rest.ModeShapeRestClient;
import org.modeshape.jdbc.rest.NodeTypes;
import org.modeshape.jdbc.rest.Repositories;
/**
* The HTTPRepositoryDelegate provides remote Repository implementation to access the Jcr layer via HTTP lookup.
*/
public class HttpRepositoryDelegate extends AbstractRepositoryDelegate {
protected static final int PROTOCOL_HTTP = 2;
public static final RepositoryDelegateFactory FACTORY = new RepositoryDelegateFactory() {
@Override
protected int determineProtocol( String url ) {
if (url.startsWith(JcrDriver.HTTP_URL_PREFIX) && url.length() > JcrDriver.HTTP_URL_PREFIX.length()) {
// This fits the pattern so far ...
return PROTOCOL_HTTP;
}
return super.determineProtocol(url);
}
@Override
protected RepositoryDelegate create( int protocol,
String url,
Properties info,
JcrContextFactory contextFactory ) {
if (protocol == PROTOCOL_HTTP) {
return new HttpRepositoryDelegate(url, info);
}
return super.create(protocol, url, info, contextFactory);
}
};
private static final String HTTP_EXAMPLE_URL = JcrDriver.HTTP_URL_PREFIX + "{hostname}:{port}/{context root}";
private AtomicReference