Fixed Node subscription

This commit is contained in:
Daniel Poustka 2020-12-26 10:22:36 +01:00
parent 22369d7b70
commit bd5c5f1a98

View File

@ -1,9 +1,11 @@
package cz.cvut.fel.sit.omo.foodchain.factory; package cz.cvut.fel.sit.omo.foodchain.factory;
import cz.cvut.fel.sit.omo.foodchain.FoodChain; import cz.cvut.fel.sit.omo.foodchain.FoodChain;
import cz.cvut.fel.sit.omo.foodchain.channel.ChannelSubscriptionType;
import cz.cvut.fel.sit.omo.foodchain.node.*; import cz.cvut.fel.sit.omo.foodchain.node.*;
import cz.cvut.fel.sit.omo.foodchain.parser.ParserResultElement; import cz.cvut.fel.sit.omo.foodchain.parser.ParserResultElement;
import cz.cvut.fel.sit.omo.foodchain.pool.ChannelPool; import cz.cvut.fel.sit.omo.foodchain.pool.ChannelPool;
import cz.cvut.fel.sit.omo.foodchain.product.ProductType;
import java.util.Objects; import java.util.Objects;
@ -68,8 +70,10 @@ public class NodeFactory
for (String s : subs) for (String s : subs)
{ {
String[] el = s.split(" ");
ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance(); ChannelPool temp = FoodChain.getFactoryManager().getPoolDatabaseInstance().getChannelPoolInstance();
// n.subscribeToChannel(temp.findByType(s)); //TODO String to enum n.subscribeToChannel(temp.findByType(ProductType.valueOf(el[0])), ChannelSubscriptionType.valueOf(el[1]));
} }
return n; return n;