All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.usf.inspect.naming.ContextSourceWrapper Maven / Gradle / Ivy

Go to download

INtegrated System Performance Evaluation and Communication Tracking core libray

There is a newer version: 0.0.18
Show newest version
package org.usf.inspect.naming;

import static org.usf.inspect.naming.DirContextTracker.connect;

import javax.naming.directory.DirContext;

import org.springframework.ldap.NamingException;
import org.springframework.ldap.core.ContextSource;

import lombok.RequiredArgsConstructor;
import lombok.experimental.Delegate;

/**
 * 
 * @author u$f
 *
 */
@RequiredArgsConstructor
public final class ContextSourceWrapper implements ContextSource  {

	@Delegate
	private final ContextSource contextSource;

	public DirContext getReadOnlyContext() throws NamingException {
		return connect(contextSource::getReadOnlyContext);
	}

	public DirContext getReadWriteContext() throws NamingException {
		return connect(contextSource::getReadWriteContext);
	}
	
	public static ContextSourceWrapper wrap(ContextSource contextSource) {
		return new ContextSourceWrapper(contextSource);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy