Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 169 → Rev 170

/SVN-ALFEventEmitter/trunk/src/net/brutex/emitter/ALFEmitter.java/ALFEmitter.java
29,7 → 29,9
import java.util.Map;
 
import javax.xml.stream.XMLStreamException;
 
import net.brutex.emitter.util.EmitterUtil;
import net.brutex.emitter.util.PasswordEncrypter;
import net.brutex.sbm.sbmappservices72.AEWebservicesFaultFault;
import net.brutex.sbm.sbmappservices72.Sbmappservices72PortType;
import net.brutex.sbm.sbmappservices72.api.Auth;
98,10 → 100,12
private static final String OPTION_EVENTMANAGER_URL = "eventmanager";
private static final String OPTION_EVENTMANAGER_USER = "eventmanager.user";
private static final String OPTION_EVENTMANAGER_PASSWORD = "eventmanager.password";
private static final String OPTION_EVENTMANAGER_ENCRYPTED = "eventmanager.encrypted";
private static final String OPTION_SBM_ENDPOINT = "sbmappservices72";
private static final String OPTION_SBM_USER = "sbmuser";
private static final String OPTION_SBM_PASSWORD = "sbmpassword";
private static final String OPTION_SBM_ENCRYPTED = "sbmencrypted";
private static final String OPTION_SBM_TABLE = "querytable";
private static final String OPTION_SBM_QUERY = "query";
 
132,11 → 136,6
private static final String PARAM_CONFIG = "conf";
//
//
//
private static final String CACHE_SBMPORT = "sbmappservices72";
//
// Member variables
//
private final String repos;
151,7 → 150,7
//Member for SBM endpoint configuration
private final String endpoint;
private final String sbm_user;
private final String sbm_pass;
private String sbm_pass;
private final String querytable;
private final String query;
 
195,7 → 194,7
*
* @param key property name
* @param defaultValue default value or null
* @param isRequired wether or not this is a required option
* @param isRequired whether or not this is a required option
* @param logmessage optional log message (or null)
* @return property value
* @throws ConfigurationException
328,8 → 327,11
*/
boolean isTrace = false;
if(isWithVerification) {
boolean isEncrypted;
isEncrypted = readConfPropertyAsBoolean(OPTION_SBM_ENCRYPTED, false, false, null);
sbm_user = readConfPropertyAsString(OPTION_SBM_USER, null, true, null);
sbm_pass = readConfPropertyAsString(OPTION_SBM_PASSWORD, null, false, null);
if(isEncrypted) sbm_pass = PasswordEncrypter.decrypt(sbm_pass);
endpoint = readConfPropertyAsString(OPTION_SBM_ENDPOINT, "http://localhost/gsoap/gsoap_ssl.dll?sbmappservices72", true, null);
querytable = readConfPropertyAsString(OPTION_SBM_TABLE, null, true, null);
query = readConfPropertyAsString(OPTION_SBM_QUERY, null, false, null);
470,7 → 472,10
private void addALFSecurity() throws ConfigurationException, JaxenException {
final String eventmanager_user = readConfPropertyAsString(OPTION_EVENTMANAGER_USER, null, false, null);
final String eventmanager_pass = readConfPropertyAsString(OPTION_EVENTMANAGER_PASSWORD, null, false, null);
String eventmanager_pass = readConfPropertyAsString(OPTION_EVENTMANAGER_PASSWORD, null, false, null);
final boolean eventmanager_enc = readConfPropertyAsBoolean(OPTION_EVENTMANAGER_ENCRYPTED, false, false, null);
if(eventmanager_enc) eventmanager_pass = PasswordEncrypter.decrypt(eventmanager_pass);
AXIOMXPath path = new AXIOMXPath("//bru1:User");
OMNamespace ns = template.findNamespace(nss, null);
path.addNamespace("bru1", nss);
561,23 → 566,6
private TTItemList getTTItems(String issueid, boolean isTrace) throws MalformedURLException {
long startTime = System.currentTimeMillis();
Sbmappservices72PortType port = null;
//try {
// JCS cache = JCS.getInstance("FileCache");
 
/* -- */
// port = (Sbmappservices72PortType)cache.get(CACHE_SBMPORT);
/*
if(port==null) {
Sbmappservices72 ss = new Sbmappservices72(ClassLoader.getSystemResource("sbmappservices72.wsdl") );
port = ss.getSbmappservices72();
 
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
}
*/
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(Sbmappservices72PortType.class);
factory.setAddress(endpoint);
584,19 → 572,7
port = (Sbmappservices72PortType) factory.create();
logger.debug("Total execution of sbmappservices72 wsdl read took '"+(System.currentTimeMillis()-startTime)+"' milliseconds.");
// cache.put(CACHE_SBMPORT, port);
// cache.dispose();
// } else {
// logger.debug("sbmappservices72 port was read from cache.");
// }
//} catch (CacheException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// this.exit(1);
//}
if(isTrace) {
Client client = ClientProxy.getClient(port);
client.getInInterceptors().add(new LoggingInInterceptor());