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


Java XmlRpcClient.setConfig方法代碼示例

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


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

示例1: registerUser

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public boolean registerUser(String user, String password) throws Exception {

        XmlRpcClientConfigImpl xmlConfig = new XmlRpcClientConfigImpl();
        xmlConfig.setServerURL(new URL(config.getProperty(SYSTEM_XMPP_BACKEND_SERVER_URL)));
        XmlRpcClient client = new XmlRpcClient();
        client.setConfig(xmlConfig);

        Map<String, Object> params = new HashMap<>();
        params.put(USER, user);
        params.put(PASSWORD, password);
        params.put(SERVER,  config.getProperty(SYSTEM_XMPP_DOMAIN));

        List<Object> register_params = new ArrayList<>();
        register_params.add(params);

        Object result = client.execute(CREATE_ACCOUNT, register_params);

        return true;
    }
 
開發者ID:nkasvosve,項目名稱:beyondj,代碼行數:20,代碼來源:XmppService.java

示例2: createXmlRpcClient

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的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: getXmlClient

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
private XmlRpcClient getXmlClient() {
    XmlRpcClient client = new XmlRpcClient();

    URL url;
    try {
        url = new URL("http://" + _ip + ":" + _port.toString());
        _config.setTimeZone(TimeZone.getTimeZone("UTC"));
        _config.setServerURL(url);
        _config.setReplyTimeout(0); // disable, we use asyncexecute to control timeout
        _config.setConnectionTimeout(6000);
        _config.setBasicUserName(_username);
        _config.setBasicPassword(_password);
        client.setConfig(_config);
    } catch (MalformedURLException e) {
        throw new CloudRuntimeException(e.getMessage());
    }

    return client;
}
 
開發者ID:apache,項目名稱:cloudstack,代碼行數:20,代碼來源:Connection.java

示例4: login

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
/**
 * login
 */
public SatelliteConnection login() {
    if (logger == null) {
        logger = new PrintStream(System.out);
    }

    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    config.setServerURL(configuration.getRpcUrl());
    config.setEnabledForExtensions(true);

    if (configuration.isSSL()) {
        initializeSSLContext();
    }

    client = new XmlRpcClient();
    client.setConfig(config);

    auth = call("auth.login", configuration.getUser(), configuration.getPassword());

    return this;
}
 
開發者ID:dstraub,項目名稱:satellite-plugin,代碼行數:24,代碼來源:SatelliteConnection.java

示例5: executeTests

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static Object executeTests(String server, Map<String, String> map) {
   	Object result = null;
	
	try{
		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setServerURL(new URL(server));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);
       	
           result = client.execute("executeTestCase", new Object[] {map});
       }
       catch ( Exception ex ) {
       	ex.printStackTrace();
       }
	return result;
}
 
開發者ID:ahn,項目名稱:mideaas,代碼行數:17,代碼來源:XmlRpcContact.java

示例6: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setEnabledForExtensions(true);
		config.setServerURL(new URL("http://127.0.0.1:" + Constants.XMLRPC_PORT));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);

		Object[] params = new Object[] { Constants.USER, Constants.REQUESTID, "-4573748213815439639"};
																			// strFileId

		long startTotal = System.currentTimeMillis();
		String strResponse = (String) client.execute("XmlRpcSyncHandler.deleteMetadataFile", params);

		System.out.println("Response --> " + Constants.PrettyPrintJson(strResponse));

		long totalTime = System.currentTimeMillis() - startTotal;
		System.out.println("Total level time --> " + totalTime + " ms");
	}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:20,代碼來源:ApiDeleteMetadataFile.java

示例7: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setEnabledForExtensions(true);
		config.setServerURL(new URL("http://127.0.0.1:" + Constants.XMLRPC_PORT));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);

		Object[] params = new Object[] { Constants.USER, Constants.REQUESTID, "887611628764801051", "2"};
																			// strFileId, strVersion

		long startTotal = System.currentTimeMillis();
		String strResponse = (String) client.execute("XmlRpcSyncHandler.restoreMetadata", params);

		System.out.println("Response --> " + Constants.PrettyPrintJson(strResponse));

		long totalTime = System.currentTimeMillis() - startTotal;
		System.out.println("Total level time --> " + totalTime + " ms");
	}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:20,代碼來源:ApiRestoreMetadata.java

示例8: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setEnabledForExtensions(true);
		config.setServerURL(new URL("http://127.0.0.1:" + Constants.XMLRPC_PORT));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);

		String[] chunks = new String[] {"1111", "2222", "3333"};
		Object[] params = new Object[] { Constants.USER, Constants.REQUESTID, "test.txt", "", "", "111111", "10", "Text", chunks};
																			// strFileName, strParentId, strOverwrite, strChecksum, strFileSize,
																			// strMimetype, strChunks

		long startTotal = System.currentTimeMillis();
		String strResponse = (String) client.execute("XmlRpcSyncHandler.putMetadataFile", params);

		System.out.println("Response --> " + Constants.PrettyPrintJson(strResponse));

		long totalTime = System.currentTimeMillis() - startTotal;
		System.out.println("Total level time --> " + totalTime + " ms");
	}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:22,代碼來源:ApiPutMetadataFile.java

示例9: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setEnabledForExtensions(true);
		config.setServerURL(new URL("http://127.0.0.1:" + Constants.XMLRPC_PORT));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);
		
		String strUserId = "159a1286-33df-4453-bf80-cff4af0d97b0";
		String strItemId = "100";
		String strIncludeList = "true";
		String strIncludeDeleted = "true";
		String strIncludeChunks = "true";
		String strVersion = "null";
		
		Object[] params = new Object[] { strUserId, strItemId, strIncludeList, strIncludeDeleted, strIncludeChunks, strVersion};

		long startTotal = System.currentTimeMillis();
		String strResponse = (String) client.execute("XmlRpcSyncHandler.getMetadata", params);

		System.out.println("Response --> " + Constants.PrettyPrintJson(strResponse));

		long totalTime = System.currentTimeMillis() - startTotal;
		System.out.println("Total level time --> " + totalTime + " ms");
	}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:26,代碼來源:ApiGetMetadata.java

示例10: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		config.setEnabledForExtensions(true);
		config.setServerURL(new URL("http://127.0.0.1:" + Constants.XMLRPC_PORT));
		XmlRpcClient client = new XmlRpcClient();
		client.setConfig(config);

		Object[] params = new Object[] { Constants.USER, Constants.REQUESTID, "hola5", null};
																			// strFolderName, strParentId

		long startTotal = System.currentTimeMillis();
		String strResponse = (String) client.execute("XmlRpcSyncHandler.putMetadataFolder", params);

		System.out.println("Response --> " + Constants.PrettyPrintJson(strResponse));

		long totalTime = System.currentTimeMillis() - startTotal;
		System.out.println("Total level time --> " + totalTime + " ms");
	}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:20,代碼來源:ApiPutMetadataFolder.java

示例11: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的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

示例12: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String [] args){
	try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
    	configuration.setServerURL(new URL("http://11.126.32.14:88/"));
    	XmlRpcClient client = new XmlRpcClient();
    	client.setConfig(configuration);
    	Scheduler sch = new Scheduler();
    	sch.setRPC(client);
    	sch.init(null, null, null, null,null);
		JFrame f = new JFrame();
		f.add(sch.getContent());
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setBounds(100,100,900,700);
    	System.out.println("Client initialized: "+client);
	}
	catch(Exception e){System.out.println("Could not conect to "+
					"http://11.126.32.14:88 for RPC client initialization");
					e.printStackTrace();
	}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:21,代碼來源:Scheduler.java

示例13: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的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

示例14: initializeRPC

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的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

示例15: main

import org.apache.xmlrpc.client.XmlRpcClient; //導入方法依賴的package包/類
public static void main(String [] args){
	try{XmlRpcClientConfigImpl configuration = new XmlRpcClientConfigImpl();
    	configuration.setServerURL(new URL("http://11.126.32.14:88/"));
    	XmlRpcClient client = new XmlRpcClient();
    	client.setConfig(configuration);
    	Scheduler sch = new Scheduler();
    	sch.setRPC(client);
    	sch.init(null, null, null, null);
		JFrame f = new JFrame();
		f.add(sch.getContent());
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setBounds(100,100,900,700);
    	System.out.println("Client initialized: "+client);
	}
	catch(Exception e){System.out.println("Could not conect to "+
					"http://11.126.32.14:88 for RPC client initialization");
					e.printStackTrace();
	}
}
 
開發者ID:twister,項目名稱:twister.github.io,代碼行數:21,代碼來源:Scheduler.java


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