Subversion Repositories XServices

Rev

Rev 168 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 168 Rev 169
Line 25... Line 25...
25
import java.text.SimpleDateFormat;
25
import java.text.SimpleDateFormat;
26
import java.util.ArrayList;
26
import java.util.ArrayList;
27
import java.util.HashMap;
27
import java.util.HashMap;
28
import java.util.List;
28
import java.util.List;
29
import java.util.Map;
29
import java.util.Map;
30
import javax.xml.stream.XMLStreamException;
-
 
31
 
-
 
32
import javax.xml.ws.BindingProvider;
-
 
Line -... Line 30...
-
 
30
 
33
 
31
import javax.xml.stream.XMLStreamException;
34
import net.brutex.emitter.util.EmitterUtil;
32
import net.brutex.emitter.util.EmitterUtil;
35
import net.brutex.sbm.sbmappservices72.AEWebservicesFaultFault;
-
 
36
import net.brutex.sbm.sbmappservices72.Sbmappservices72;
33
import net.brutex.sbm.sbmappservices72.AEWebservicesFaultFault;
37
import net.brutex.sbm.sbmappservices72.Sbmappservices72PortType;
34
import net.brutex.sbm.sbmappservices72.Sbmappservices72PortType;
38
import net.brutex.sbm.sbmappservices72.api.Auth;
35
import net.brutex.sbm.sbmappservices72.api.Auth;
39
import net.brutex.sbm.sbmappservices72.api.MultipleResponseItemOptions;
36
import net.brutex.sbm.sbmappservices72.api.MultipleResponseItemOptions;
40
import net.brutex.sbm.sbmappservices72.api.ObjectFactory;
37
import net.brutex.sbm.sbmappservices72.api.ObjectFactory;
Line 68... Line 65...
68
import org.apache.commons.configuration.PropertiesConfiguration;
65
import org.apache.commons.configuration.PropertiesConfiguration;
69
import org.apache.cxf.endpoint.Client;
66
import org.apache.cxf.endpoint.Client;
70
import org.apache.cxf.frontend.ClientProxy;
67
import org.apache.cxf.frontend.ClientProxy;
71
import org.apache.cxf.interceptor.LoggingInInterceptor;
68
import org.apache.cxf.interceptor.LoggingInInterceptor;
72
import org.apache.cxf.interceptor.LoggingOutInterceptor;
69
import org.apache.cxf.interceptor.LoggingOutInterceptor;
-
 
70
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
73
import org.apache.http.client.ClientProtocolException;
71
import org.apache.http.client.ClientProtocolException;
74
import org.apache.log4j.Logger;
72
import org.apache.log4j.Logger;
75
import org.jaxen.JaxenException;
73
import org.jaxen.JaxenException;
Line 132... Line 130...
132
	private static final String PARAM_TXN = "txn";
130
	private static final String PARAM_TXN = "txn";
133
	private static final String PARAM_REV = "rev";
131
	private static final String PARAM_REV = "rev";
134
	private static final String PARAM_CONFIG = "conf";
132
	private static final String PARAM_CONFIG = "conf";
Line 135... Line 133...
135
	
133
	
-
 
134
	//
-
 
135
	//
-
 
136
	//
-
 
137
	private static final String CACHE_SBMPORT = "sbmappservices72";
-
 
138
	
136
	//
139
	//
137
	// Member variables
140
	// Member variables
138
	//
141
	//
139
	private final String repos;
142
	private final String repos;
140
	private final String txn;
143
	private final String txn;
Line 233... Line 236...
233
				String s = String.format("Could not load a value for the key '%s' from the configuration file. This property has no default, but it is optional anyway.", key);
236
				String s = String.format("Could not load a value for the key '%s' from the configuration file. This property has no default, but it is optional anyway.", key);
234
				logger.warn(s);
237
				logger.warn(s);
235
			}
238
			}
236
			if(value == null && defaultValue!=null) {
239
			if(value == null && defaultValue!=null) {
237
				//No value, but default
240
				//No value, but default
238
				logger.debug(String.format("Using property value '%s' for key '%s'. This is the default value. The property is optional.", value, key));
241
				logger.debug(String.format("Using property value '%s' for key '%s'. This is the default value. The property is optional.", value, key));				
239
			}
242
			}
240
		}
243
		}
241
		if(logmessage==null) logmessage="";
244
		if(logmessage==null) logmessage="";
-
 
245
		if(key.contains("password") && value!=null ) {
-
 
246
			logger.debug(String.format("Using property value '%s' for key '%s'. %s", "******", key, logmessage));
-
 
247
		} else {
242
		if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'. %s", value, key, logmessage));
248
			if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'. %s", value, key, logmessage));
-
 
249
		}
243
		return value;
250
		return value;
244
	}
251
	}
Line 245... Line 252...
245
	
252
	
Line 398... Line 405...
398
				StringWriter out = new StringWriter();
405
				StringWriter out = new StringWriter();
399
				template.getParent().serialize(out);
406
				template.getParent().serialize(out);
400
				out.flush();
407
				out.flush();
Line 401... Line 408...
401
				
408
				
402
				resultxml =  out.getBuffer().toString();
409
				resultxml =  out.getBuffer().toString();
Line 403... Line 410...
403
				logger.debug("ALFEvent result:\n"+resultxml);
410
				if(isTrace) logger.debug("ALFEvent result:\n"+resultxml);
404
		
411
		
405
			} else {
412
			} else {
Line 550... Line 557...
550
			return true;			
557
			return true;			
551
	}
558
	}
Line 552... Line 559...
552
		
559
		
553
		
-
 
554
		private TTItemList getTTItems(String issueid, boolean isTrace) throws MalformedURLException {
560
		
-
 
561
		private TTItemList getTTItems(String issueid, boolean isTrace) throws MalformedURLException {
-
 
562
			long startTime = System.currentTimeMillis();
-
 
563
			Sbmappservices72PortType port = null;
-
 
564
			//try {
555
			
565
			//	JCS cache = JCS.getInstance("FileCache");
-
 
566
 
-
 
567
				/* -- */
-
 
568
			//	port = (Sbmappservices72PortType)cache.get(CACHE_SBMPORT);
556
			long startTime = System.currentTimeMillis();
569
			/*
-
 
570
				if(port==null) {
-
 
571
					Sbmappservices72 ss = new Sbmappservices72(ClassLoader.getSystemResource("sbmappservices72.wsdl") );
-
 
572
					
557
			/* -- */
573
					port = ss.getSbmappservices72();
-
 
574
 
-
 
575
					
-
 
576
					BindingProvider bindingProvider = (BindingProvider) port;
-
 
577
			        bindingProvider.getRequestContext().put(
-
 
578
			        BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
-
 
579
				}
-
 
580
				*/
-
 
581
		    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
-
 
582
		    factory.setServiceClass(Sbmappservices72PortType.class);
558
			Sbmappservices72 ss = new Sbmappservices72(ClassLoader.getSystemResource("sbmappservices72.wsdl") );
583
		    factory.setAddress(endpoint);
-
 
584
		    port = (Sbmappservices72PortType) factory.create();
-
 
585
		    logger.debug("Total execution of sbmappservices72 wsdl read took '"+(System.currentTimeMillis()-startTime)+"' milliseconds.");
-
 
586
		 
-
 
587
			        
-
 
588
			//		cache.put(CACHE_SBMPORT, port);
559
						
589
			//		cache.dispose();
-
 
590
			//	} else {
-
 
591
			//		logger.debug("sbmappservices72 port was read from cache.");
-
 
592
			//	}
-
 
593
				
-
 
594
			//} catch (CacheException e1) {
-
 
595
			//	// TODO Auto-generated catch block
-
 
596
			//	e1.printStackTrace();
Line 560... Line -...
560
			logger.debug("Total execution of sbmappservices72 wsdl read took '"+(System.currentTimeMillis()-startTime)+"' milliseconds.");
-
 
561
			Sbmappservices72PortType port = ss.getSbmappservices72();
597
			//	this.exit(1);
-
 
598
			//}
562
			
599
			
563
			Client client = ClientProxy.getClient(port);
600
			if(isTrace) {
564
			if(isTrace) {
601
				Client client = ClientProxy.getClient(port);
565
		        client.getInInterceptors().add(new LoggingInInterceptor());
-
 
566
		        client.getOutInterceptors().add(new LoggingOutInterceptor());
-
 
567
			}
-
 
-
 
602
		        client.getInInterceptors().add(new LoggingInInterceptor());
568
			BindingProvider bindingProvider = (BindingProvider) port;
603
		        client.getOutInterceptors().add(new LoggingOutInterceptor());
569
	        bindingProvider.getRequestContext().put(
604
			}
Line 570... Line 605...
570
	        BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
605
 
571
	        /* -- */
606
	        /* -- */