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


Java Status类代码示例

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


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

示例1: parseJabberStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
/**
 * Parses the given Jabber status to a <tt>FileTransfer</tt> interface
 * status.
 *
 * @param jabberStatus the Jabber status to parse
 * @return the parsed status
 */
private static int parseJabberStatus(Status jabberStatus)
{
    if (jabberStatus.equals(Status.complete))
        return FileTransferStatusChangeEvent.COMPLETED;
    else if (jabberStatus.equals(Status.cancelled))
        return FileTransferStatusChangeEvent.CANCELED;
    else if (jabberStatus.equals(Status.in_progress)
            || jabberStatus.equals(Status.negotiated))
        return FileTransferStatusChangeEvent.IN_PROGRESS;
    else if (jabberStatus.equals(Status.error))
        return FileTransferStatusChangeEvent.FAILED;
    else if (jabberStatus.equals(Status.refused))
        return FileTransferStatusChangeEvent.REFUSED;
    else if (jabberStatus.equals(Status.negotiating_transfer)
            || jabberStatus.equals(Status.negotiating_stream))
        return FileTransferStatusChangeEvent.PREPARING;
    else
         // FileTransfer.Status.initial
        return FileTransferStatusChangeEvent.WAITING;
}
 
开发者ID:zhaozw,项目名称:android-1,代码行数:28,代码来源:OperationSetFileTransferJabberImpl.java

示例2: TransferProgress

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public TransferProgress(TransferHandle handle, String fileName, long fileSize, Status newStatus, long amountWritten, 
		double progress, double transferRate, boolean outgoing) {

	this.handle = handle;
	this.fileName = fileName;
	this.fileSize = fileSize;
	this.newStatus = newStatus;
	this.amountWritten = amountWritten;
	this.progress = progress;
	this.transferRate = transferRate;
	this.outgoing = outgoing;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:13,代码来源:TransferProgress.java

示例3: TransferData

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public TransferData(DeploymentID destinationID, DeploymentID listenerID, Status status, File file, long id,
		long inactivityTimeout, int queuePosition, boolean receiveProgressUpdate, boolean isIncoming) {
	
	this.destinationID = destinationID;
	this.listenerID = listenerID;
	this.status = status;
	this.file = file;
	this.id = id;
	this.inactivityTimeout = inactivityTimeout;
	this.queuePosition = queuePosition;
	this.receiveProgressUpdate = receiveProgressUpdate;
	this.isIncoming = isIncoming;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:14,代码来源:TransferData.java

示例4: TransferDataMatcher

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public TransferDataMatcher(DeploymentID destinationID, DeploymentID listenerID, Status status, File file, 
		int queuePosition, boolean isIncoming) {
	Collection<TransferData> transferDatas = new ArrayList<TransferData>();
	transferDatas.add(new TransferData(destinationID, listenerID, status, file, 0, 0,
			queuePosition, true, isIncoming));
	
	this.transferDatas = transferDatas;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:9,代码来源:TransferDataMatcher.java

示例5: testGetAnsweredTransfer

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
@Test
public void testGetAnsweredTransfer() throws Exception {
	module = deployMonitorUtil.createAndStartApplication(module);
	
	SenderClass senderObject = new SenderClass();
	module.deploy(SenderClass.OBJECT_NAME, senderObject);
	
	DeploymentID destinationID = testGetFileTransfersUtil.getObjectDeployment(module, SenderClass.OBJECT_NAME).getDeploymentID();
	DeploymentID listenerID = testGetFileTransfersUtil.getObjectDeployment(module, SenderClass.OBJECT_NAME).getDeploymentID();
	
	OutgoingTransferHandle handle = new OutgoingTransferHandle(TRANSFER_FILE_LOG_NAME, 
			new File(TRANSFER_FILE), "", destinationID);
	
	Message message = new Message(listenerID, destinationID, "sendFile");
	message.addParameter(OutgoingTransferHandle.class, handle);

	module.deliverMessage(message);
	
	//expect send start transfer msg to FileTransfer
	module.getServiceConsumer().consumeMessage();

	module.getFileTransferConsumer().consumeMessage();
	
	testGetFileTransfersUtil.getFileTransfers(module, destinationID, 
			listenerID, null, new File(TRANSFER_FILE), 0, false);
	
	TestableFileTransferProcessor fileTransferProcessor = (TestableFileTransferProcessor) module.getFileTransferProcessor();
	fileTransferProcessor.setOutgoingTransferStatus(handle, Status.initial);
	
	testGetFileTransfersUtil.getFileTransfers(module, destinationID, 
			listenerID, Status.initial, new File(TRANSFER_FILE), 0, false);
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:33,代码来源:TestGetFileTransfers.java

示例6: getFileTransfers

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public void getFileTransfers(Module application, DeploymentID destinationID, DeploymentID listenerID, Status status, File file,
		int queuePosition, boolean isIncoming) {
	CommuneMonitor monitor = getMonitorController(application);
	
	CommuneMonitorClient client = EasyMock.createMock(CommuneMonitorClient.class);
	
	client.hereAreFileTransfers(TransferDataMatcher.eqMatcher(destinationID, listenerID, status, file, queuePosition, isIncoming));
	
	EasyMock.replay(client);
	monitor.getFileTransfers(client);
	EasyMock.verify(client);		
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:13,代码来源:TestGetFileTransfersUtil.java

示例7: transDone

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public void transDone(Context context, String toUser, final Uri uri,
MsgType msgType, String path, final Status status);
 
开发者ID:ikantech,项目名称:yiim_v2,代码行数:3,代码来源:FileUpload.java

示例8: sendFile

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
/**
	 * 发送文件
	 * 
	 * @param connection
	 * @param user
	 * @param toUserName
	 * @param file
	 */
	public static void sendFile(final Context context,
			final Connection connection, final String toUser, final Uri uri,
			final String filePath, final MsgType msgType) {
		new Thread() {
			public void run() {
				XMPPConnection.DEBUG_ENABLED = true;
				// AccountManager accountManager;
				try {
					// accountManager = connection.getAccountManager();
					Presence pre = connection.getRoster().getPresence(toUser);
					if (pre.getType() != Presence.Type.unavailable) {
						if (connection.isConnected()) {
							Log.d(TAG, "connection con");
						}
						// 创建文件传输管理器
//						ServiceDiscoveryManager sdm = ServiceDiscoveryManager
//								.getInstanceFor(connection);
//						if (sdm == null)
//							sdm = new ServiceDiscoveryManager(connection);
						
						FileTransferManager manager = new FileTransferManager(
								connection);
						// 创建输出的文件传输
						OutgoingFileTransfer transfer = manager
								.createOutgoingFileTransfer(pre.getFrom());
						// 发送文件
						transfer.sendFile(new File(filePath),
								msgType.toString());
						while (!transfer.isDone()) {
							if (transfer.getStatus() == FileTransfer.Status.in_progress) {
								// 可以调用transfer.getProgress();获得传输的进度 
								// Log.d(TAG,
								// "send status:" + transfer.getStatus());
								// Log.d(TAG,
								// "send progress:"
								// + transfer.getProgress());
								if (mFileUploadListener != null) {
									mFileUploadListener.transProgress(context,
											uri, filePath,
											transfer.getProgress());
								}
							}
						}
						// YiLog.getInstance().i("send file error: %s",
						// transfer.);
						Log.d(TAG, "send status 1 " + transfer.getStatus());
						if (transfer.isDone()) {
							if (mFileUploadListener != null) {
								mFileUploadListener.transDone(context, toUser,
										uri, msgType, filePath,
										transfer.getStatus());
							}
						}
					}
				} catch (Exception e) {
					Log.d(TAG, "send exception");
					if (mFileUploadListener != null) {
						mFileUploadListener.transDone(context, toUser, uri,
								msgType, filePath, Status.error);
					}
				}
			}
		}.start();
	}
 
开发者ID:ikantech,项目名称:yiim_v2,代码行数:73,代码来源:FileUpload.java

示例9: getNewStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public Status getNewStatus() {
	return this.newStatus;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:TransferProgress.java

示例10: getCurrentStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public Status getCurrentStatus() {
	return this.currentStatus;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:AbstractTransfer.java

示例11: setCurrentStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public void setCurrentStatus(Status currentStatus) {
	this.currentStatus = currentStatus;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:AbstractTransfer.java

示例12: setOutgoingTransferStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public void setOutgoingTransferStatus(OutgoingTransferHandle handle, Status newStatus) {
	OutgoingTransfer transfer = getTransferManager().getOutgoingManager().getTransfer(handle);
	transfer.setCurrentStatus(newStatus);
	transfer.updateStatus();
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:6,代码来源:TestableFileTransferProcessor.java

示例13: getStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public Status getStatus() {
	return status;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:TransferData.java

示例14: setStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
public void setStatus(Status status) {
	this.status = status;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:TransferData.java

示例15: equalsStatus

import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; //导入依赖的package包/类
private boolean equalsStatus(Status status, Status otherStatus) {
	return status == null ? otherStatus == null : status.equals(otherStatus);
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:4,代码来源:TransferDataMatcher.java


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