package org.esupportail.smsuapi.services.remote;

import org.esupportail.commons.services.application.ApplicationService;
import org.esupportail.commons.services.logging.Logger;
import org.esupportail.commons.services.logging.LoggerImpl;
import org.esupportail.commons.services.remote.AbstractIpProtectedWebService;
import org.esupportail.commons.utils.Assert;
import org.esupportail.smsuapi.domain.DomainService;

/**
 * @author xphp8691
 *
 */
public class TestConnexionImpl extends AbstractIpProtectedWebService implements TestConnexion {
	
	/**
	 * The serialization id.
	 */
	private static final long serialVersionUID = -1L;
	
	/**
	 * The application service.
	 */
	private ApplicationService applicationService;
	
	/**
	 * The domain service.
	 */
	private DomainService domainService;
	
	/**
	 * A logger.
	 */
	@SuppressWarnings("unused")
	private final Logger logger = new LoggerImpl(this.getClass());
	
	
	/**
	 * 
	 */
	public TestConnexionImpl() {
		super();
	}

	/**
	 * @see org.esupportail.commons.services.remote.AbstractIpProtectedWebService#afterPropertiesSet()
	 */
	@Override
	public void afterPropertiesSet() {
		super.afterPropertiesSet();
		Assert.notNull(applicationService, 
				"property applicationService of class " + this.getClass().getName() 
				+ " can not be null");
		Assert.notNull(domainService, 
				"property domainService of class " + this.getClass().getName() 
				+ " can not be null");
	}
	
	
	/**
	 * @see org.esupportail.smsuapi.services.remote.TestConnexion#testConnexion()
	 */
	public String testConnexion() {
		// TODO Auto-generated method stub
		return domainService.testConnexion();
	}

	public ApplicationService getApplicationService() {
		return applicationService;
	}

	public void setApplicationService(final ApplicationService applicationService) {
		this.applicationService = applicationService;
	}

	public DomainService getDomainService() {
		return domainService;
	}

	public void setDomainService(final DomainService domainService) {
		this.domainService = domainService;
	}
	
	
}

@@ -352,22 +352,81 @@
 s.utils.
-Ass
+NotNull;%0D%0Aimport org.esupportail.commons.utils.AnnotationsCheck
 er
-t
 ;%0D%0Aimpor
@@ -740,32 +740,41 @@
 ervice.%0D%0A%09 */%0D%0A%09
+@NotNull 
 private Applicat
@@ -838,32 +838,41 @@
 ervice.%0D%0A%09 */%0D%0A%09
+@NotNull 
 private DomainSe
@@ -1291,273 +1291,36 @@
 %0A%09%09A
-ssert.notNull(applicationService, %0D%0A%09%09%09%09%22property applicationService of class %22 + this.getClass().getName() %0D%0A%09%09%09%09+ %22 can not be null%22);%0D%0A%09%09Assert.notNull(domainService, %0D%0A%09%09%09%09%22property domainService of class %22 + this.getClass().getName() %0D%0A%09%09%09%09+ %22 can not be null%22
+nnotationsChecker.check(this
 );%0D%0A

add simple @NotNull annotation and AnnotationsChecker.check + use it