Subversion Repositories XServices

Rev

Rev 198 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 198 Rev 199
Line 6... Line 6...
6
 
6
 
7
import javax.ws.rs.core.GenericEntity;
7
import javax.ws.rs.core.GenericEntity;
8
import javax.ws.rs.core.HttpHeaders;
8
import javax.ws.rs.core.HttpHeaders;
Line -... Line 9...
-
 
9
import javax.ws.rs.core.Response;
9
import javax.ws.rs.core.Response;
10
 
10
 
11
import lombok.extern.slf4j.Slf4j;
11
import org.apache.commons.configuration2.PropertiesConfiguration;
12
import org.apache.commons.configuration2.PropertiesConfiguration;
12
import org.apache.commons.configuration2.builder.fluent.Configurations;
13
import org.apache.commons.configuration2.builder.fluent.Configurations;
13
import org.apache.commons.configuration2.ex.ConfigurationException;
14
import org.apache.commons.configuration2.ex.ConfigurationException;
14
import org.apache.commons.jcs.JCS;
-
 
15
import org.apache.commons.jcs.access.exception.CacheException;
-
 
Line 16... Line 15...
16
import org.apache.logging.log4j.LogManager;
15
import org.apache.commons.jcs.JCS;
17
import org.apache.logging.log4j.Logger;
16
import org.apache.commons.jcs.access.exception.CacheException;
18
 
17
 
19
import net.brutex.mgmt.api.xml.Customer;
18
import net.brutex.mgmt.api.xml.Customer;
20
import net.brutex.mgmt.api.xml.DateFilter;
19
import net.brutex.mgmt.api.xml.DateFilter;
21
import net.brutex.mgmt.api.xml.Query;
20
import net.brutex.mgmt.api.xml.Query;
Line -... Line 21...
-
 
21
import net.brutex.mgmt.api.xml.Query.BOOL;
22
import net.brutex.mgmt.api.xml.Query.BOOL;
22
import net.brutex.mgmt.api.xml.StringEntity;
23
import net.brutex.mgmt.api.xml.StringEntity;
23
import net.brutex.mgmt.openair.OpenAirRestConnection;
24
import net.brutex.mgmt.openair.OpenAirRestConnection;
-
 
Line 25... Line 24...
25
 
24
 
26
public class OpenAirInfoServiceImpl implements OpenAirInfoService {
25
@Slf4j
27
	
26
public class OpenAirInfoServiceImpl implements OpenAirInfoService {
28
	static final Logger logger = LogManager.getLogger();
27
 
Line 57... Line 56...
57
		 */
56
		 */
58
		Configurations configs = new Configurations();
57
		Configurations configs = new Configurations();
59
		final PropertiesConfiguration props;
58
		final PropertiesConfiguration props;
60
		try {
59
		try {
61
			final String config = "../openair.properties";
60
			final String config = "../openair.properties";
62
			logger.debug("Loading Open Air connection details from " + this.getClass().getClassLoader().getResource("/")
61
			log.debug("Loading Open Air connection details from '{}'.", this.getClass().getClassLoader().getResource("/")
63
					+ config);
62
					+ config);
Line 64... Line 63...
64
 
63
 
Line 65... Line 64...
65
			final URL configloc = this.getClass().getClassLoader().getResource(config);
64
			final URL configloc = this.getClass().getClassLoader().getResource(config);
Line 74... Line 73...
74
 
73
 
Line 75... Line 74...
75
			final OpenAirRestConnection con;
74
			final OpenAirRestConnection con;
76
 
75
 
77
			con = new OpenAirRestConnection(JCS.getInstance("FileCache"), company, user, password);
-
 
78
			return con;
-
 
79
		} catch (CacheException e) {
-
 
80
			logger.error(e);
76
			con = new OpenAirRestConnection(JCS.getInstance("FileCache"), company, user, password);
81
			e.printStackTrace();
77
			return con;
82
		} catch (ConfigurationException e) {
78
		} catch (CacheException | ConfigurationException e) {
83
			logger.error(e);
79
			log.error(e.getMessage());
Line 84... Line 80...
84
			e.printStackTrace();
80
			e.printStackTrace();
85
		} finally {
81
		} finally {