From 9519b653a8cef055366b0903fdd371c8f86d1206 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 19 Sep 2017 10:42:07 +0500 Subject: Implement per device Notifications --- src/org/traccar/database/CommandsManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/org/traccar/database/CommandsManager.java') diff --git a/src/org/traccar/database/CommandsManager.java b/src/org/traccar/database/CommandsManager.java index deb802b29..521a2e1d1 100644 --- a/src/org/traccar/database/CommandsManager.java +++ b/src/org/traccar/database/CommandsManager.java @@ -26,7 +26,7 @@ import org.traccar.BaseProtocol; import org.traccar.Context; import org.traccar.helper.Log; import org.traccar.model.Command; -import org.traccar.model.CommandType; +import org.traccar.model.Typed; import org.traccar.model.Position; public class CommandsManager extends ExtendedObjectManager { @@ -102,29 +102,29 @@ public class CommandsManager extends ExtendedObjectManager { return result; } - public Collection getCommandTypes(long deviceId, boolean textChannel) { - List result = new ArrayList<>(); + public Collection getCommandTypes(long deviceId, boolean textChannel) { + List result = new ArrayList<>(); Position lastPosition = Context.getIdentityManager().getLastPosition(deviceId); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); Collection commands; commands = textChannel ? protocol.getSupportedTextCommands() : protocol.getSupportedDataCommands(); for (String commandKey : commands) { - result.add(new CommandType(commandKey)); + result.add(new Typed(commandKey)); } } else { - result.add(new CommandType(Command.TYPE_CUSTOM)); + result.add(new Typed(Command.TYPE_CUSTOM)); } return result; } - public Collection getAllCommandTypes() { - List result = new ArrayList<>(); + public Collection getAllCommandTypes() { + List result = new ArrayList<>(); Field[] fields = Command.class.getDeclaredFields(); for (Field field : fields) { if (Modifier.isStatic(field.getModifiers()) && field.getName().startsWith("TYPE_")) { try { - result.add(new CommandType(field.get(null).toString())); + result.add(new Typed(field.get(null).toString())); } catch (IllegalArgumentException | IllegalAccessException error) { Log.warning(error); } -- cgit v1.2.3