All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.hycube.messaging.data.MessageReceivedCallbackEvent Maven / Gradle / Ivy

Go to download

HyCube is a distributed hash table based on a hierarchical hypercube geometry, employing a novel variable metric adopting the Steinhaus transform.

There is a newer version: 1.0.5
Show newest version
package net.hycube.messaging.data;

import net.hycube.eventprocessing.Event;
import net.hycube.eventprocessing.EventCategory;
import net.hycube.eventprocessing.ProcessEventProxy;
import net.hycube.messaging.callback.MessageReceivedCallback;

public class MessageReceivedCallbackEvent extends Event {

	public MessageReceivedCallbackEvent(long timestamp, ProcessEventProxy processEventProxy,
			MessageReceivedCallback callback, ReceivedDataMessage message, Short port) {
		super(timestamp, EventCategory.processMsgReceivedCallbackEvent, processEventProxy, createMessageReceivedCallbackEventArg(callback, message, port));
	}

	public MessageReceivedCallbackEvent(long timestamp, ProcessEventProxy processEventProxy,
			MessageReceivedCallback callback, ReceivedDataMessage message) {
		super(timestamp, EventCategory.processMsgReceivedCallbackEvent, processEventProxy, createMessageReceivedCallbackEventArg(callback, message));
	}
	
	
	
	public static Object[] createMessageReceivedCallbackEventArg(MessageReceivedCallback callback, ReceivedDataMessage message, Short port) {
		Object[] arg = new Object[] {callback, message, port};
		return arg;
	}
	
	public static Object[] createMessageReceivedCallbackEventArg(MessageReceivedCallback callback, ReceivedDataMessage message) {
		Object[] arg = new Object[] {callback, message};
		return arg;
	}
	
	public MessageReceivedCallback getMessageReceivedCallback() {
		return (MessageReceivedCallback) this.eventArgs[0];
	}
	
	public ReceivedDataMessage getMessage() {
		return (ReceivedDataMessage) this.eventArgs[1];
	}
	
	public Short getPort() {
		if (this.eventArgs.length >= 3) return (Short) this.eventArgs[2];
		else return null;
	}

	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy