diff options
author | Abyss777 <abyss@fox5.ru> | 2017-09-19 10:42:07 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-09-19 14:46:54 +0500 |
commit | 9519b653a8cef055366b0903fdd371c8f86d1206 (patch) | |
tree | 330fe6bb9ee1fe45330979f16f16e204e1437447 /src/org/traccar/database/CommandsManager.java | |
parent | c82fd979ad17ecfb7dd8f3e366c067b66f4cdabc (diff) | |
download | trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.gz trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.bz2 trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.zip |
Implement per device Notifications
Diffstat (limited to 'src/org/traccar/database/CommandsManager.java')
-rw-r--r-- | src/org/traccar/database/CommandsManager.java | 16 |
1 files changed, 8 insertions, 8 deletions
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<Command> { @@ -102,29 +102,29 @@ public class CommandsManager extends ExtendedObjectManager<Command> { return result; } - public Collection<CommandType> getCommandTypes(long deviceId, boolean textChannel) { - List<CommandType> result = new ArrayList<>(); + public Collection<Typed> getCommandTypes(long deviceId, boolean textChannel) { + List<Typed> result = new ArrayList<>(); Position lastPosition = Context.getIdentityManager().getLastPosition(deviceId); if (lastPosition != null) { BaseProtocol protocol = Context.getServerManager().getProtocol(lastPosition.getProtocol()); Collection<String> 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<CommandType> getAllCommandTypes() { - List<CommandType> result = new ArrayList<>(); + public Collection<Typed> getAllCommandTypes() { + List<Typed> 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); } |