blob: c31d2d7f402d606f2a66c8c3e4640ea4856993f1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2020 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
******************************************************************************/
package org.eclipse.apogy.addons.mqtt.impl;
import java.util.Iterator;
import org.eclipse.apogy.addons.mqtt.MQTTBrokerConnectionInfo;
public class MQTTBrokerConnectionInfoRegistryCustomImpl extends MQTTBrokerConnectionInfoRegistryImpl
{
protected MQTTBrokerConnectionInfoRegistryCustomImpl()
{
super();
// DEBUG
/*
MQTTBrokerConnectionInfo LEAD = ApogyAddonsMQTTFactory.eINSTANCE.createMQTTBrokerConnectionInfo();
LEAD.setName("LEAD");
LEAD.setBrokerHostName("ssl://b-4771c47f-7a1d-4243-8d4b-b658029df748-1.mq.ca-central-1.amazonaws.com");
LEAD.setPort(8883);
LEAD.setUserName("user");
getBrokersConnnectionInfo().add(LEAD);
*/
}
@Override
public MQTTBrokerConnectionInfo getMQTTBrokerConnectionInfoByName(String name)
{
MQTTBrokerConnectionInfo result = null;
Iterator<MQTTBrokerConnectionInfo> it = getBrokersConnnectionInfo().iterator();
while(it.hasNext() && result == null)
{
MQTTBrokerConnectionInfo info = it.next();
if(info.getName().compareTo(name) == 0)
{
result = info;
}
}
return result;
}
}