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

org.headlessintrace.client.connection.Callback Maven / Gradle / Ivy

package org.headlessintrace.client.connection;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * This class is designed for just this test.
 * It collects a list of all status messages. CONNECTED, DISCONNECTED, etc...
 * I could imagine keeping a timestamped non-test list of connections for history, to show the end user what has been happening recently.
 * @author e0018740
 *
 */
public class Callback extends DefaultCallback {
	private List m_connectStates = new CopyOnWriteArrayList();
	private List m_listMessages = new ArrayList();
	public List getMessages() {
		return m_listMessages;
	}
	@Override
	public void setConnectionStatusMsg(String msg) {
		getMessages().add(msg);
		
	}
	
	@Override
	public void setConnectState(ConnectState state) {
		getConnectStates().add(state);
	}
	public List getConnectStates() {
		return m_connectStates;
	}
	@Override
	public ConnectState getConnectState() {
		return m_connectStates.get(m_connectStates.size()-1);
	}
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy