当前位置: 首页>>代码示例>>Java>>正文


Java XMLRPCException类代码示例

本文整理汇总了Java中de.timroes.axmlrpc.XMLRPCException的典型用法代码示例。如果您正苦于以下问题:Java XMLRPCException类的具体用法?Java XMLRPCException怎么用?Java XMLRPCException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XMLRPCException类属于de.timroes.axmlrpc包,在下文中一共展示了XMLRPCException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Login

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
private String Login(XMLRPCClient cl) throws XMLRPCException {
	@SuppressWarnings("unchecked")
	// This is what the status will be when an invalid username or password is entered
	final String badUsernameStatus = "401 Unauthorized";
	HashMap<String, Object> result;
	try {
		result = (HashMap<String, Object>) cl.call("LogIn", username, password, "english", testUser);
	}
	catch (Exception e) {
		e.printStackTrace();
		return null;
	}
	String status = (String) result.get("status");
	if (status.compareTo(badUsernameStatus) == 0) {
		return null;
	}
	return (String) result.get("token");
}
 
开发者ID:smitnich,项目名称:Subscreen,代码行数:19,代码来源:SubDownloader.java

示例2: Download

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public Boolean Download(String id, FileOutputStream out) throws XMLRPCException {
	Map<String, String> ids = new HashMap<String, String>();
	ids.put("idsubtitlefile", id);
	Object downloadResult = cl.call("DownloadSubtitles", new Object[] {token, ids});
	@SuppressWarnings("unchecked")
	Map<String, Object> dataMap = (HashMap<String, Object>) downloadResult;
	if (dataMap.get("data") instanceof Boolean) {
		return false;
	}
	Object[] tmpData = (Object[]) dataMap.get("data");
	@SuppressWarnings("unchecked")
	HashMap<String, String> trueData = (HashMap<String, String>) tmpData[0];
	String result = trueData.get("data");
	try {
		decompressGZIP(result, out);
		out.close();
	} catch (Exception e) {
		e.printStackTrace();
	}
	return true;
}
 
开发者ID:smitnich,项目名称:Subscreen,代码行数:22,代码来源:SubDownloader.java

示例3: onPoll

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
@Override
public void onPoll() {
	try {
		Object[] arrayResult = (Object[]) mClient
				.call("system.listMethods");

		Log.i("XMLRPCConnection", "Listing available functions");
		for (int i = 0; i < arrayResult.length; i++) {
			Log.i("XMLRPCConnection", " " + (String) arrayResult[i]);
		}

		notifyConnectionEstablished();
		mConnected = true;
		mJustStarted = false;
		mPoller.stop();
		Log.i("XMLRPCConnection", "Stopped poller.");
	} catch (XMLRPCException e) {
	}
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:20,代码来源:XMLRPCConnection.java

示例4: call

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
/**
 * Calls the function specified by functionName in the Tribler service using
 * the connection and optional arguments
 * 
 * @param functionName
 *            The function to call
 * @param connection
 *            The XML-RPC connection to use
 * @param params
 *            The (optional) arguments of the function
 */
public void call(final String functionName,
		final XMLRPCConnection connection, final Object... params) {
	AsyncTask<Void, Void, Object> backgroundTask = new AsyncTask<Void, Void, Object>() {

		@Override
		protected Object doInBackground(Void... voidParams) {
			return connection.call(functionName, params);
		}

		protected void onPostExecute(Object result) {
			if (result instanceof XMLRPCException) {
				onFailure((XMLRPCException) result);
			} else {
				onSucces(result);
			}
		}
	};
	backgroundTask.execute();
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:31,代码来源:XMLRPCCallTask.java

示例5: getTickets

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public List<Ticket> getTickets(String strFilter) throws RemoteCallException
{
    try {
        strFilter = "max=0&" + strFilter;
        Object[] result = (Object[]) m_client.call("ticket.query", strFilter);
        List<Object> ticketIds = new ArrayList<Object>(); 
        ticketIds.addAll(Arrays.asList(result));
        List<Ticket> tickets = new ArrayList<Ticket>();
        
        for (Object id : ticketIds)
        {
            result = (Object[]) m_client.call("ticket.get", id);
            int iID = (Integer) result[0];
            HashMap<String, Object> attributes = (HashMap<String, Object>) result[3];
            List<TicketAction> actions = this.getTicketActions((Integer) id);
            
            
            tickets.add(new Ticket(iID, attributes, actions));
        }
        
        return tickets;
    } catch (XMLRPCException ex) {
        throw new RemoteCallException(ex.getClass(), "ticket.query", ex.getMessage());
    }
}
 
开发者ID:osiris86,项目名称:TracDroid,代码行数:26,代码来源:RemoteCall.java

示例6: getComponents

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public List<String> getComponents() throws RemoteCallException
{
    try {
        Object[] result = (Object[]) m_client.call("ticket.component.getAll");
        List<Object> res = new ArrayList<Object>(); 
        res.addAll(Arrays.asList(result));
        List<String> strComponents = new ArrayList<String>();
        
        for (Object objEntry : res)
        {
            strComponents.add(objEntry.toString());
        }
        
        return strComponents;
    } catch (XMLRPCException ex) {
        throw new RemoteCallException(ex.getClass(), "ticket.component.getAll", ex.getMessage());
    }
}
 
开发者ID:osiris86,项目名称:TracDroid,代码行数:19,代码来源:RemoteCall.java

示例7: getMilestones

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public List<String> getMilestones() throws RemoteCallException
{
    try {
        Object[] result = (Object[]) m_client.call("ticket.milestone.getAll");
        List<Object> res = new ArrayList<Object>(); 
        res.addAll(Arrays.asList(result));
        List<String> strMilestones = new ArrayList<String>();
        
        for (Object objEntry : res)
        {
            strMilestones.add(objEntry.toString());
        }
        
        return strMilestones;
    } catch (XMLRPCException ex) {
        throw new RemoteCallException(ex.getClass(), "ticket.milestone.getAll", ex.getMessage());
    }
}
 
开发者ID:osiris86,项目名称:TracDroid,代码行数:19,代码来源:RemoteCall.java

示例8: getWikiPage

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public String getWikiPage(String strName, int iVersion) throws RemoteCallException
{
    try {
        String strResult;
        if (iVersion == -1)
        {
            strResult = (String) m_client.call("wiki.getPageHTML", strName);
        }
        else
        {
            strResult = (String) m_client.call("wiki.getPageHTML", strName, iVersion);
        }
        
        return strResult;
    } catch (XMLRPCException ex) {
        throw new RemoteCallException(ex.getClass(), "wiki.getPageHTML", ex.getMessage());
    }
}
 
开发者ID:osiris86,项目名称:TracDroid,代码行数:19,代码来源:RemoteCall.java

示例9: runAllTests

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public static void runAllTests() throws XMLRPCException {
testVersion();
      testNetwork();
      testCpu();
      testDiskIO();
      testFs();
      testLoad();
      testMem();
      testMemSwap();
      testNow();
      testLimits();
      testProcessCount();
      testProcessList();
      testSensors();
      testSystem();
      testHardDriveTemps();
testMonitored();
testBattery();
  }
 
开发者ID:jrenner,项目名称:java-glances,代码行数:20,代码来源:Example.java

示例10: Connect

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public boolean Connect(URL url) {
	if (connected)
		return true;
	cl = new XMLRPCClient(url);
	try {
		token = Login(cl);
	} catch (XMLRPCException e) {
		System.out.println("Unable to connect to server: " + e.getMessage());
		return false;
	}
	if (token == null)
		return false;
	connected = true;
	return true;
}
 
开发者ID:smitnich,项目名称:Subscreen,代码行数:16,代码来源:SubDownloader.java

示例11: DisconnectInternal

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
private void DisconnectInternal() {
	if (!connected)
		return;
	try {
		cl.call("LogOut", token);
	} catch (XMLRPCException e) {
		System.out.println("Unable to disconnect from server: " + e.getMessage());
	}
	connected = false;
}
 
开发者ID:smitnich,项目名称:Subscreen,代码行数:11,代码来源:SubDownloader.java

示例12: deserialize

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public Object deserialize(Element content) throws XMLRPCException {
	try {
		return DATE_FORMATER.parse(XMLUtil.getOnlyTextContent(content.getChildNodes()));
	} catch (ParseException ex) {
		throw new XMLRPCException("Unable to parse given date.", ex);
	}
}
 
开发者ID:linphone,项目名称:axmlrpc,代码行数:8,代码来源:DateTimeSerializer.java

示例13: deserialize

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public Object deserialize(Element content) throws XMLRPCException {

		List<Object> list = new ArrayList<Object>();

		Element data = XMLUtil.getOnlyChildElement(content.getChildNodes());

		if(!ARRAY_DATA.equals(data.getNodeName())) {
			throw new XMLRPCException("The array must contain one data tag.");
		}

		// Deserialize every array element
		Node value;
		for(int i = 0; i < data.getChildNodes().getLength(); i++) {

			value = data.getChildNodes().item(i);

			// Strip only whitespace text elements and comments
			if(value == null || (value.getNodeType() == Node.TEXT_NODE
						&& value.getNodeValue().trim().length() <= 0)
					|| value.getNodeType() == Node.COMMENT_NODE)
				continue;

			if(value.getNodeType() != Node.ELEMENT_NODE) {
				throw new XMLRPCException("Wrong element inside of array.");
			}

			list.add(SerializerHandler.getDefault().deserialize((Element)value));

		}

		return list.toArray();
	}
 
开发者ID:linphone,项目名称:axmlrpc,代码行数:33,代码来源:ArraySerializer.java

示例14: deserialize

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public Object deserialize(Element content) throws XMLRPCException {
    String text = XMLUtil.getOnlyTextContent(content.getChildNodes());
    if (decodeStrings) {
        text = text.replaceAll("&lt;", "<").replaceAll("&amp;", "&");
    }
    return text;
}
 
开发者ID:perludem,项目名称:DPR-KITA,代码行数:8,代码来源:StringSerializer.java

示例15: deserialize

import de.timroes.axmlrpc.XMLRPCException; //导入依赖的package包/类
public Object deserialize(Element content) throws XMLRPCException {
    try {
        return DATE_FORMATER.parse(XMLUtil.getOnlyTextContent(content.getChildNodes()));
    } catch (ParseException ex) {
        throw new XMLRPCException("Unable to parse given date.", ex);
    }
}
 
开发者ID:perludem,项目名称:DPR-KITA,代码行数:8,代码来源:DateTimeSerializer.java


注:本文中的de.timroes.axmlrpc.XMLRPCException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。