當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlRpcClientConfigImpl.setBasicUserName方法代碼示例

本文整理匯總了Java中org.apache.xmlrpc.client.XmlRpcClientConfigImpl.setBasicUserName方法的典型用法代碼示例。如果您正苦於以下問題:Java XmlRpcClientConfigImpl.setBasicUserName方法的具體用法?Java XmlRpcClientConfigImpl.setBasicUserName怎麽用?Java XmlRpcClientConfigImpl.setBasicUserName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.xmlrpc.client.XmlRpcClientConfigImpl的用法示例。


在下文中一共展示了XmlRpcClientConfigImpl.setBasicUserName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRpcClient

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public org.apache.xmlrpc.client.XmlRpcClient getRpcClient(String url, String login, String password) throws MalformedURLException {
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    config.setServerURL(new URL(url));
    if (login != null) {
        config.setBasicUserName(login);
    }
    if (password != null) {
        config.setBasicPassword(password);
    }

    if (keyStoreComponent != null && keyStoreName != null && keyAlias != null) {
        return new XmlRpcClient(config, keyStoreComponent, keyStoreName, keyAlias);
    } else {
        return new XmlRpcClient(config);
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:17,代碼來源:AbstractXmlRpcTestCase.java

示例2: createXmlRpcClient

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
private XmlRpcClient createXmlRpcClient() {
	// create client configuration
	XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
	try {
		config.setServerURL(new URL(url));
	} catch (MalformedURLException e) {
		e.printStackTrace();
		Starter.die("could not parse URL");
	}
	config.setBasicUserName(username);
	config.setBasicPassword(password);
	
	// ignore self-signed certificate errors
	if (url.startsWith("https")) {
		disableCertCheck();
	}
	
	XmlRpcClient client = new XmlRpcClient();
	client.setConfig(config);
	
	return client;
}
 
開發者ID:mathisdt,項目名稱:hibiscus-watcher,代碼行數:23,代碼來源:Fetcher.java

示例3: buildConfig

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
/**
 * Builds XmlRpcClientConfig from {@link eionet.webq.dto.CdrRequest}.
 *
 * @param parameters parameters
 * @return config
 */
private XmlRpcClientConfig buildConfig(CdrRequest parameters) {
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    config.setServerURL(createUrlFromString(parameters.getEnvelopeUrl()));
    if (parameters.isAuthorizationSet()) {
        if (StringUtils.isNotEmpty(parameters.getUserName())) {
            config.setBasicUserName(parameters.getUserName());
            config.setBasicPassword(parameters.getPassword());
        } else {
            KnownHost knownHost = knownHostsService.getKnownHost(parameters.getEnvelopeUrl());
            if (knownHost != null) {
                config.setBasicUserName(knownHost.getKey());
                config.setBasicPassword(knownHost.getTicket());
            }
        }
    }
    return config;
}
 
開發者ID:eea,項目名稱:eionet.webq,代碼行數:24,代碼來源:CDREnvelopeServiceImpl.java

示例4: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public static void initializeRPC(String user, String password,String port){
    try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
        configuration.setBasicPassword(password);
        configuration.setBasicUserName(user);
        configuration.setServerURL(new URL("http://"+user+":"+password+"@"+MainRepository.host+
                                    ":"+port+"/"));
        client = new XmlRpcClient();
        client.setConfig(configuration);
        System.out.println("Client initialized: "+client);
        if(!isCE()){
            CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE,applet,
                                "Warning", "CE is not running, please start CE in "+
                                            "order for Twister Framework to run properly");
            return;
        }
        
        loadPlugin("ControlPanel");
    }
    catch(Exception e){
        e.printStackTrace();
        System.out.println("Could not conect to "+
                        MainRepository.host+" :"+port+
                        "for RPC client initialization");
    }
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:26,代碼來源:MainRepository.java

示例5: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC() {
	try {
		XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
		configuration.setServerURL(new URL("http://"
				+ variables.get("host") + ":"
				+ variables.get("centralengineport")));
		configuration.setBasicPassword(variables.get("password"));
           configuration.setBasicUserName(variables.get("user"));
		client = new XmlRpcClient();
		client.setConfig(configuration);
		System.out.println("Client initialized: " + client);
	} catch (Exception e) {
		System.out.println("Could not conect to " + variables.get("host")
				+ " :" + variables.get("centralengineport")
				+ "for RPC client initialization");
	}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:18,代碼來源:ServiceConsole.java

示例6: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC() {
	try {
		XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
		configuration.setServerURL(new URL("http://"+variables.get("host")+
				":"+variables.get("centralengineport")));
		configuration.setBasicPassword(variables.get("password"));
        configuration.setBasicUserName(variables.get("user"));
		client = new XmlRpcClient();
		client.setConfig(configuration);
		System.out.println("Client initialized: " + client);
	} catch (Exception e) {
		if(variables!=null && 
		   variables.get("host")!=null &&
		   variables.get("centralengineport")!=null){
			System.out.println("Could not conect to " + variables.get("host")
					+ variables.get("centralengineport"));
		} else {
			System.out.println("Could not connect and initialize RPC connection to server."+
							   "Configuration variables might not be properly set.");
		}
		
	}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:24,代碼來源:PacketSnifferPlugin.java

示例7: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC(){
System.out.println(this.variables.get("host"));
System.out.println(this.variables.get("centralengineport"));
try{			
	XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
	
	configuration.setServerURL(new URL("http://"+this.variables.get("host")+
			":"+this.variables.get("centralengineport")));
	configuration.setBasicPassword(variables.get("password"));
       configuration.setBasicUserName(variables.get("user"));
	client = new XmlRpcClient();
	client.setConfig(configuration);
	System.out.println("Client initialized: "+client);
	}
catch(Exception e){
	System.out.println("Could not conect to "+
this.variables.get("host")+" :"+this.variables.get("centralengineport")+
"for RPC client initialization");
	}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:21,代碼來源:JiraPlugin.java

示例8: call

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
protected <X> X call(String username, String password, String path, String methodName, Object... args) {
    try {
        URL url = new URL(getTestBoot().getSettings().getFathomUrl() + StringUtils.removeStart(path, "/"));
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setBasicUserName(username);
        config.setBasicPassword(password);
        config.setServerURL(url);
        XmlRpcClient xmlrpc = new XmlRpcClient();
        xmlrpc.setConfig(config);
        Object x = xmlrpc.execute(methodName, args);
        return (X) x;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:gitblit,項目名稱:fathom,代碼行數:16,代碼來源:XmlRpcIntegrationTest.java

示例9: initTransaction

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
private XmlRpcClient initTransaction() throws MalformedURLException
{
	XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
	// Authentification
	config.setBasicUserName(username);
	config.setBasicPassword(password);
	config.setServerURL(new URL(xmlRpcService));
	XmlRpcClient client = new XmlRpcClient();
	client.setConfig(config);
	client.setTypeFactory(new CustomTypeFactory(client));
	return client;
}
 
開發者ID:unistra,項目名稱:fsp,代碼行數:13,代碼來源:XmlRpc.java

示例10: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC(){
	try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
       configuration.setServerURL(new URL("http://"+variables.get("host")+
                                   ":"+variables.get("centralengineport")));
       configuration.setBasicPassword(variables.get("password"));
       configuration.setBasicUserName(variables.get("user"));
       client = new XmlRpcClient();
       client.setConfig(configuration);
       System.out.println("Client initialized: "+client);}
	catch(Exception e){System.out.println("Could not conect to "+
                       variables.get("host")+" :"+variables.get("centralengineport")+
                       "for RPC client initialization");}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:14,代碼來源:UserManagement.java

示例11: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC(){
	try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
       configuration.setServerURL(new URL("http://"+variables.get("host")+
                                   ":"+variables.get("centralengineport")));
       configuration.setBasicPassword(variables.get("password"));
       configuration.setBasicUserName(variables.get("user"));
       client = new XmlRpcClient();
       client.setConfig(configuration);
       System.out.println("Client initialized: "+client);}
   catch(Exception e){System.out.println("Could not conect to "+
                       variables.get("host")+" :"+variables.get("centralengineport")+
                       "for RPC client initialization");}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:14,代碼來源:GITPlugin.java

示例12: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC(){
	try{
		XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
        configuration.setServerURL(new URL("http://"+variables.get("host")+":88/"));
        configuration.setBasicPassword(variables.get("password"));
        configuration.setBasicUserName(variables.get("user"));
        client = new XmlRpcClient();
        client.setConfig(configuration);
        System.out.println("Client initialized: "+client);}
	catch(Exception e){System.out.println("Could not conect to "+
                       variables.get("host")+" :88/");}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:13,代碼來源:Scheduler.java

示例13: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public void initializeRPC(){
    try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
        configuration.setServerURL(new URL("http://"+RunnerRepository.host+
                                    ":"+RunnerRepository.getCentralEnginePort()+"/ra/"));
        configuration.setEnabledForExtensions(true);
        configuration.setBasicPassword(RunnerRepository.password);
        configuration.setBasicUserName(RunnerRepository.user);
        client = new XmlRpcClient();
        client.setConfig(configuration);
        System.out.println("XMLRPC Client for testbed initialized: "+client);}
    catch(Exception e){System.out.println("Could not conect to "+
                        RunnerRepository.host+" :"+RunnerRepository.getCentralEnginePort()+"/ra/"+
                        "for RPC client initialization");}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:15,代碼來源:TB.java

示例14: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public static void initializeRPC(){
    try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
        configuration.setBasicPassword(password);
        configuration.setBasicUserName(user);
        configuration.setServerURL(new URL("http://"+user+":"+password+"@"+RunnerRepository.host+
                                    ":"+RunnerRepository.getCentralEnginePort()+"/"));
        client = new XmlRpcClient();
        client.setConfig(configuration);
        System.out.println("Client initialized: "+client);}
    catch(Exception e){System.out.println("Could not conect to "+
                        RunnerRepository.host+" :"+RunnerRepository.getCentralEnginePort()+
                        "for RPC client initialization");}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:14,代碼來源:RunnerRepository.java

示例15: WindowsConfiguratorClient

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; //導入方法依賴的package包/類
public WindowsConfiguratorClient() throws WindowsConfiguratorException
{
    ILogger logger = LoggerFactory.getLoggerInstance();
    
    IConfig config = ConfigFactory.getInstance();
    
    String tmp = config.getProperty("Win_Configurator_URI");
    if (tmp == null)
    {
        logger.error("The address of the Windows Configurator service has not been configured. " +
                "Check the property 'Win_Configurator_URI' is set to a valid URI.");
        throw new WindowsConfiguratorException("Windows Configurator URI not configured.");
    }
    
    XmlRpcClientConfigImpl xmlRpcConf = new XmlRpcClientConfigImpl();
    try
    {
        xmlRpcConf.setServerURL(new URL(tmp));
    }
    catch (MalformedURLException e)
    {
        logger.error("The configured address of the Windows Configurator is not a valid URL. Check the "
                + "property 'Win_Configurator_URI' is set to a valid URI.");
        throw new WindowsConfiguratorException(e);
    }
    
    xmlRpcConf.setReplyTimeout(120000);
    xmlRpcConf.setConnectionTimeout(2000);
    
    if ((tmp = config.getProperty("Win_Configurator_Auth_Username")) != null)
    {
        xmlRpcConf.setBasicUserName(tmp);
        xmlRpcConf.setBasicPassword(config.getProperty("Win_Configurator_Auth_Password"));
    }                
            
    this.client = new XmlRpcClient();        
    this.client.setConfig(xmlRpcConf);
}
 
開發者ID:sahara-labs,項目名稱:rig-client-commons,代碼行數:39,代碼來源:WindowsConfiguratorClient.java


注:本文中的org.apache.xmlrpc.client.XmlRpcClientConfigImpl.setBasicUserName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。