本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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");
}
}
示例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");
}
}
示例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.");
}
}
}
示例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");
}
}
示例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);
}
}
示例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;
}
示例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");}
}
示例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");}
}
示例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/");}
}
示例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");}
}
示例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");}
}
示例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);
}