mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-09 15:17:24 -05:00
467 Alias List Update On Alias Delete/Change (#470)
* Updates playlist to fully clean aliases from the alias list when deleted and to perform a delete and re-add on any alias that changes, to ensure that the alias list is kept fully up to date. Removed site id as an alias identifier. Add support for converting ltr-net uid's to talkgroups in playlist updater and updated playlist to version 3 to ensure anyone using current codebase will have their playlists fully updated. Moved MIN, UniqueID and Site ID to the legacy package and updated label descriptions to signify that they are no longer supported.
This commit is contained in:
@@ -383,15 +383,15 @@
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.1/dcd31de68a90e41e336f6b7afce0d39285c433d7/j2objc-annotations-1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: com.jidesoft:jide-oss:3.4.3">
|
||||
<library name="Gradle: com.jidesoft:jide-oss:3.6.18">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.4.3/207ac43eebd7923f7791529d53ea8809719abae2/jide-oss-3.4.3.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/2a0b8ef9ed1f18607b70f1e627d862fb8e595373/jide-oss-3.6.18.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.4.3/3116cd87d8627faaf20398284df2f213134cda24/jide-oss-3.4.3-javadoc.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/814e47763c22729f665a4232da421824831ea734/jide-oss-3.6.18-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.4.3/403b99170d6e679bcf9218b44fb986991da327a/jide-oss-3.4.3-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jidesoft/jide-oss/3.6.18/b9cadcf869c0bdd032756228315252516856ad56/jide-oss-3.6.18-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: com.miglayout:miglayout-core:5.0">
|
||||
@@ -476,15 +476,15 @@
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.axis/axis/1.4/442ab1fe3e66b6d5c916ae3f203fbfa618515f1c/axis-1.4-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.apache.commons:commons-lang3:3.7">
|
||||
<library name="Gradle: org.apache.commons:commons-lang3:3.8.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.7/557edd918fd41f9260963583ebf5a61a43a6b423/commons-lang3-3.7.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/6505a72a097d9270f7a9e7bf42c4238283247755/commons-lang3-3.8.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.7/8d6fb4d39bedef08da171550c73b5d84e8c1125/commons-lang3-3.7-javadoc.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/e7e19f37a0e712862967e39558b888fb59ee5b6a/commons-lang3-3.8.1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.7/e7e36219edde1c66c93495a75490d8f526c377cb/commons-lang3-3.7-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/e9748d7783594da3735ad9724390a10e7cebc01d/commons-lang3-3.8.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.apache.commons:commons-math3:3.5">
|
||||
@@ -619,82 +619,75 @@
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.25/962153db4a9ea71b79d047dfd1b2a0d80d8f4739/slf4j-api-1.7.25-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:darwin-x86-64:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/298ccebd5e648b2de2eb9246b0973ddda1c0ef3f/libusb4java-1.2.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/1fdaa8ec7cfad158be58fbc8e2867d05f2b5fe63/libusb4java-1.3.0-darwin-x86-64.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-arm:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-aarch64:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/aa5b1be4bdb52dc9c86c08f09d7aad0a43b425c7/libusb4java-1.2.0-linux-arm.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/bb5924dfb86c27ca5d91ccc975c11da2caa3c82d/libusb4java-1.3.0-linux-aarch64.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-arm:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/dfd709cb29ecd4dfee551b3dea27f4acb3c13253/libusb4java-1.2.0-linux-x86.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/504de50cc979b1f19b76ba1154d298632ff1be4e/libusb4java-1.3.0-linux-arm.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86_64:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86-64:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/949ddf102f3311110643f4c6ca507b977cd675f5/libusb4java-1.2.0-linux-x86_64.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/9514c818fc97f831277873f082dcefd5394045e4/libusb4java-1.3.0-linux-x86-64.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:osx-x86:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:linux-x86:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/98179e848d2b83f9f909d80979230ed8397d3f5b/libusb4java-1.2.0-osx-x86.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/7abf7240bcd7c26cb1ea5265eec5e6d703b71b4e/libusb4java-1.3.0-linux-x86.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:osx-x86_64:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:win32-x86-64:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/ca639c580e2d635dd945fe44efce6854ce113274/libusb4java-1.2.0-osx-x86_64.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/8cd521a203404d65f4bc59c2a8a38eb4dcd302da/libusb4java-1.3.0-win32-x86-64.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:windows-x86:1.2.0">
|
||||
<library name="Gradle: org.usb4java:libusb4java:win32-x86:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/ece89016955c79221555d5e452cf5aa7c5e2d209/libusb4java-1.2.0-windows-x86.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.3.0/9cb97c4b8317d8dae0401f80438fde5bfd910b2c/libusb4java-1.3.0-win32-x86.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:libusb4java:windows-x86_64:1.2.0">
|
||||
<library name="Gradle: org.usb4java:usb4java-javax:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/libusb4java/1.2.0/2cb4cc4df02e0b5fbf2867491c8eee2ee7f19f87/libusb4java-1.2.0-windows-x86_64.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:usb4java-javax:1.2.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.2.0/c862d0f32a08d50afb8fb7c83a30c1deb6e7a444/usb4java-javax-1.2.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/b68f4617513a61e889fbf81926daba9c9accc96d/usb4java-javax-1.3.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.2.0/eed54c5a29ecf1978ee1a06006d641656ba9451e/usb4java-javax-1.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/76268e0268e00cace559a5d3284b065d64044a76/usb4java-javax-1.3.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.2.0/5649a42176194350c3e8f1eae04fc6a3142dc1b6/usb4java-javax-1.2.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java-javax/1.3.0/684ff71e8ca72e5536116390909dd37fcb590690/usb4java-javax-1.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.usb4java:usb4java:1.2.0">
|
||||
<library name="Gradle: org.usb4java:usb4java:1.3.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.2.0/d83b8dd04afc03ee740ac61817fadb21affe9e9c/usb4java-1.2.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/2d5487fdf303642d480b199a9da0c5a0d2bb0e82/usb4java-1.3.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.2.0/58dd077c6eace3e49d9857720ce8526ca680bad2/usb4java-1.2.0-javadoc.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/e688082c68718dfbd6f566beb2eebf31cc225036/usb4java-1.3.0-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.2.0/7f5450599d865fa88aa6e91d0fe92bc69c0993b6/usb4java-1.2.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.usb4java/usb4java/1.3.0/e6f73cf21dbbc0ecf85417f311e13d8eb278d14a/usb4java-1.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: pl.edu.icm:JLargeArrays:1.6">
|
||||
|
||||
14
sdrtrunk.iml
14
sdrtrunk.iml
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/images" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/config" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="imports" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -31,8 +31,7 @@ import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
public class AliasEditor extends Editor<Alias>
|
||||
implements ActionListener, Listener<AliasEvent>
|
||||
public class AliasEditor extends Editor<Alias> implements ActionListener, Listener<AliasEvent>
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -45,22 +45,22 @@ import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupIDEditor;
|
||||
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
||||
import io.github.dsheirer.alias.id.lojack.LoJackIDEditor;
|
||||
import io.github.dsheirer.alias.id.mobileID.MINEditor;
|
||||
import io.github.dsheirer.alias.id.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.legacy.mobileID.MINEditor;
|
||||
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.priority.Priority;
|
||||
import io.github.dsheirer.alias.id.priority.PriorityEditor;
|
||||
import io.github.dsheirer.alias.id.record.Record;
|
||||
import io.github.dsheirer.alias.id.record.RecordEditor;
|
||||
import io.github.dsheirer.alias.id.siteID.SiteID;
|
||||
import io.github.dsheirer.alias.id.siteID.SiteIDEditor;
|
||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteIDEditor;
|
||||
import io.github.dsheirer.alias.id.status.StatusID;
|
||||
import io.github.dsheirer.alias.id.status.StatusIDEditor;
|
||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupEditor;
|
||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRangeEditor;
|
||||
import io.github.dsheirer.alias.id.uniqueID.UniqueID;
|
||||
import io.github.dsheirer.alias.id.uniqueID.UniqueIDEditor;
|
||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueIDEditor;
|
||||
import io.github.dsheirer.audio.broadcast.BroadcastModel;
|
||||
import io.github.dsheirer.gui.editor.Editor;
|
||||
import io.github.dsheirer.gui.editor.EmptyEditor;
|
||||
|
||||
@@ -21,15 +21,12 @@ package io.github.dsheirer.alias;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
import io.github.dsheirer.alias.id.WildcardID;
|
||||
import io.github.dsheirer.alias.id.broadcast.BroadcastChannel;
|
||||
import io.github.dsheirer.alias.id.esn.Esn;
|
||||
import io.github.dsheirer.alias.id.priority.Priority;
|
||||
import io.github.dsheirer.alias.id.siteID.SiteID;
|
||||
import io.github.dsheirer.alias.id.status.StatusID;
|
||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||
import io.github.dsheirer.alias.id.uniqueID.UniqueID;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||
import io.github.dsheirer.identifier.esn.ESNIdentifier;
|
||||
@@ -42,8 +39,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
@@ -51,19 +48,10 @@ import java.util.TreeMap;
|
||||
public class AliasList implements Listener<AliasEvent>
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(AliasList.class);
|
||||
public static final String WILDCARD = "*";
|
||||
|
||||
private Map<String,Alias> mESN = new HashMap<>();
|
||||
private Map<String,Alias> mSiteID = new HashMap<>();
|
||||
private Map<Integer,Alias> mStatus = new HashMap<>();
|
||||
private Map<Integer,Alias> mUniqueID = new HashMap<>();
|
||||
|
||||
private List<WildcardID> mESNWildcards = new ArrayList<>();
|
||||
private List<WildcardID> mSiteWildcards = new ArrayList<>();
|
||||
private boolean mHasAliasActions = false;
|
||||
|
||||
private Map<Protocol,TalkgroupAliasList> mTalkgroupProtocolMap = new HashMap<>();
|
||||
|
||||
private Map<String,Alias> mESNMap = new HashMap<>();
|
||||
private Map<Integer,Alias> mStatusMap = new HashMap<>();
|
||||
private boolean mHasAliasActions = false;
|
||||
private String mName;
|
||||
|
||||
/**
|
||||
@@ -136,45 +124,13 @@ public class AliasList implements Listener<AliasEvent>
|
||||
case ESN:
|
||||
String esn = ((Esn) id).getEsn();
|
||||
|
||||
if(esn != null)
|
||||
if(esn != null && !esn.isEmpty())
|
||||
{
|
||||
if(esn.contains(WILDCARD))
|
||||
{
|
||||
mESNWildcards.add(new WildcardID(esn));
|
||||
Collections.sort(mESNWildcards);
|
||||
}
|
||||
|
||||
mESN.put(esn, alias);
|
||||
}
|
||||
break;
|
||||
case LTR_NET_UID:
|
||||
mUniqueID.put(((UniqueID) id).getUid(), alias);
|
||||
break;
|
||||
case SITE:
|
||||
String siteID = ((SiteID) id).getSite();
|
||||
|
||||
if(siteID != null)
|
||||
{
|
||||
if(siteID.contains(WILDCARD))
|
||||
{
|
||||
mSiteWildcards.add(new WildcardID(siteID));
|
||||
Collections.sort(mSiteWildcards);
|
||||
}
|
||||
|
||||
mSiteID.put(siteID, alias);
|
||||
mESNMap.put(esn.toLowerCase(), alias);
|
||||
}
|
||||
break;
|
||||
case STATUS:
|
||||
mStatus.put(((StatusID) id).getStatus(), alias);
|
||||
break;
|
||||
case BROADCAST_CHANNEL:
|
||||
case NON_RECORDABLE:
|
||||
case RECORD:
|
||||
case PRIORITY:
|
||||
//We don't maintain lookups for these items
|
||||
break;
|
||||
default:
|
||||
mLog.warn("Unrecognized Alias ID Type:" + id.getType().name() + " - can't ADD to lookup table");
|
||||
mStatusMap.put(((StatusID) id).getStatus(), alias);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -190,155 +146,13 @@ public class AliasList implements Listener<AliasEvent>
|
||||
*/
|
||||
public void removeAlias(Alias alias)
|
||||
{
|
||||
if(alias != null)
|
||||
for(TalkgroupAliasList talkgroupAliasList: mTalkgroupProtocolMap.values())
|
||||
{
|
||||
for(AliasID aliasID : alias.getId())
|
||||
{
|
||||
removeAliasID(aliasID, alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeWildcard(String value, List<WildcardID> wildcards)
|
||||
{
|
||||
if(value != null)
|
||||
{
|
||||
for(WildcardID wildcardID : wildcards)
|
||||
{
|
||||
if(wildcardID.value().equals(value))
|
||||
{
|
||||
wildcards.remove(wildcardID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the alias and alias identifier from internal mappings.
|
||||
*/
|
||||
private void removeAliasID(AliasID id, Alias alias)
|
||||
{
|
||||
if(id.isValid())
|
||||
{
|
||||
switch(id.getType())
|
||||
{
|
||||
case TALKGROUP:
|
||||
Talkgroup talkgroup = (Talkgroup)id;
|
||||
|
||||
TalkgroupAliasList talkgroupAliasList = mTalkgroupProtocolMap.get(talkgroup.getProtocol());
|
||||
|
||||
if(talkgroupAliasList != null)
|
||||
{
|
||||
talkgroupAliasList.remove(talkgroup);
|
||||
}
|
||||
break;
|
||||
case TALKGROUP_RANGE:
|
||||
TalkgroupRange talkgroupRange = (TalkgroupRange)id;
|
||||
|
||||
TalkgroupAliasList talkgroupRangeAliasList = mTalkgroupProtocolMap.get(talkgroupRange.getProtocol());
|
||||
|
||||
if(talkgroupRangeAliasList != null)
|
||||
{
|
||||
talkgroupRangeAliasList.remove(talkgroupRange);
|
||||
}
|
||||
break;
|
||||
case ESN:
|
||||
String esn = ((Esn) id).getEsn();
|
||||
|
||||
if(esn != null)
|
||||
{
|
||||
if(esn.contains(WILDCARD))
|
||||
{
|
||||
removeWildcard(esn, mESNWildcards);
|
||||
}
|
||||
}
|
||||
|
||||
mESN.remove(esn);
|
||||
break;
|
||||
case LTR_NET_UID:
|
||||
mUniqueID.remove(((UniqueID) id).getUid());
|
||||
break;
|
||||
case SITE:
|
||||
mSiteID.remove(((SiteID) id).getSite());
|
||||
break;
|
||||
case STATUS:
|
||||
mStatus.remove(((StatusID) id).getStatus());
|
||||
break;
|
||||
case NON_RECORDABLE:
|
||||
case PRIORITY:
|
||||
case BROADCAST_CHANNEL:
|
||||
//We don't maintain lookups for these items
|
||||
break;
|
||||
default:
|
||||
mLog.warn("Unrecognized Alias ID Type:" + id.getType().name() + " - can't REMOVE from lookup table");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first matching regex wildcard from the list of wildcards that matches the
|
||||
* identifier.
|
||||
*
|
||||
* @param id to match
|
||||
* @param wildcards to match against
|
||||
* @return matching wildcard ID or null
|
||||
*/
|
||||
private String getWildcardMatch(String id, List<WildcardID> wildcards)
|
||||
{
|
||||
if(id != null)
|
||||
{
|
||||
for(WildcardID wildcard : wildcards)
|
||||
{
|
||||
if(wildcard.matches(id))
|
||||
{
|
||||
return wildcard.value();
|
||||
}
|
||||
}
|
||||
talkgroupAliasList.remove(alias);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup alias by site ID
|
||||
*/
|
||||
public Alias getSiteID(String siteID)
|
||||
{
|
||||
Alias alias = null;
|
||||
|
||||
if(siteID != null)
|
||||
{
|
||||
alias = mSiteID.get(siteID);
|
||||
|
||||
if(alias == null)
|
||||
{
|
||||
String wildcard = getWildcardMatch(siteID, mSiteWildcards);
|
||||
|
||||
if(wildcard != null)
|
||||
{
|
||||
alias = mSiteID.get(wildcard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup alias by status ID
|
||||
*/
|
||||
public Alias getStatus(int status)
|
||||
{
|
||||
return mStatus.get(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup alias by Unique ID (UID)
|
||||
*/
|
||||
public Alias getUniqueID(int uniqueID)
|
||||
{
|
||||
return mUniqueID.get(uniqueID);
|
||||
remove(alias, mStatusMap);
|
||||
remove(alias, mESNMap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,17 +164,7 @@ public class AliasList implements Listener<AliasEvent>
|
||||
|
||||
if(esn != null)
|
||||
{
|
||||
alias = mESN.get(esn);
|
||||
|
||||
if(alias == null)
|
||||
{
|
||||
String wildcard = getWildcardMatch(esn, mESNWildcards);
|
||||
|
||||
if(wildcard != null)
|
||||
{
|
||||
alias = mESN.get(wildcard);
|
||||
}
|
||||
}
|
||||
alias = mESNMap.get(esn);
|
||||
}
|
||||
|
||||
return alias;
|
||||
@@ -412,6 +216,7 @@ public class AliasList implements Listener<AliasEvent>
|
||||
case CHANGE:
|
||||
if(alias.getList() != null && getName().equalsIgnoreCase(alias.getList()))
|
||||
{
|
||||
removeAlias(alias);
|
||||
addAlias(alias);
|
||||
}
|
||||
break;
|
||||
@@ -588,6 +393,23 @@ public class AliasList implements Listener<AliasEvent>
|
||||
return channels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the alias (as a value) from the specified map
|
||||
*/
|
||||
public static void remove(Alias alias, Map map)
|
||||
{
|
||||
Iterator<Map.Entry> it = map.entrySet().iterator();
|
||||
|
||||
while(it.hasNext())
|
||||
{
|
||||
if(it.next().getKey().equals(alias))
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Listing of talkgroups and ranges for a specific protocol
|
||||
*/
|
||||
@@ -639,5 +461,14 @@ public class AliasList implements Listener<AliasEvent>
|
||||
{
|
||||
mTalkgroupRangeMap.remove(talkgroupRange);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the alias from all internal maps
|
||||
*/
|
||||
public void remove(Alias alias)
|
||||
{
|
||||
AliasList.remove(alias, mTalkgroupAliasMap);
|
||||
AliasList.remove(alias, mTalkgroupRangeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327ID;
|
||||
import io.github.dsheirer.alias.id.legacy.nonrecordable.NonRecordable;
|
||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
||||
import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID;
|
||||
import io.github.dsheirer.alias.id.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.priority.Priority;
|
||||
import io.github.dsheirer.alias.id.record.Record;
|
||||
import io.github.dsheirer.alias.id.siteID.SiteID;
|
||||
import io.github.dsheirer.alias.id.legacy.siteID.SiteID;
|
||||
import io.github.dsheirer.alias.id.status.StatusID;
|
||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||
import io.github.dsheirer.alias.id.talkgroup.TalkgroupRange;
|
||||
import io.github.dsheirer.alias.id.uniqueID.UniqueID;
|
||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
||||
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
|
||||
@JsonSubTypes({
|
||||
|
||||
@@ -125,11 +125,7 @@ public class AliasIdentifierEditor extends Editor<Alias>
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.TALKGROUP));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.TALKGROUP_RANGE));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.ESN));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.LOJACK));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.LTR_NET_UID));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.MDC1200));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.MIN));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.SITE));
|
||||
// menu.add(new AddAliasIdentifierItem(AliasIDType.LOJACK));
|
||||
menu.add(new AddAliasIdentifierItem(AliasIDType.STATUS));
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.mobileID;
|
||||
package io.github.dsheirer.alias.id.legacy.mobileID;
|
||||
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.mobileID;
|
||||
package io.github.dsheirer.alias.id.legacy.mobileID;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
@@ -52,7 +52,7 @@ public class Min extends AliasID
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "MIN: " + (mMin != null ? mMin : "(empty)") + (isValid() ? "" : " **NOT VALID**");
|
||||
return "MIN: " + (mMin != null ? mMin : "(empty)") + (isValid() ? "" : " **INVALID - USE TALKGROUP INSTEAD");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.siteID;
|
||||
package io.github.dsheirer.alias.id.legacy.siteID;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.siteID;
|
||||
package io.github.dsheirer.alias.id.legacy.siteID;
|
||||
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
||||
@@ -59,7 +59,7 @@ public class LegacyTalkgroupID extends AliasID
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("Legacy Talkgroup:").append(mTalkgroup).append(" *Disabled - Please Convert");
|
||||
sb.append("Legacy Talkgroup:").append(mTalkgroup).append(" *Disabled - Please use Talkgroup instead");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.uniqueID;
|
||||
package io.github.dsheirer.alias.id.legacy.uniqueID;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
@@ -48,7 +48,7 @@ public class UniqueID extends AliasID
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "UniqueID: " + mUid;
|
||||
return "UniqueID: " + mUid + " **INVALID - USE TALKGROUP INSTEAD";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.alias.id.uniqueID;
|
||||
package io.github.dsheirer.alias.id.legacy.uniqueID;
|
||||
|
||||
import io.github.dsheirer.alias.id.AliasID;
|
||||
import io.github.dsheirer.gui.editor.DocumentListenerEditor;
|
||||
@@ -37,7 +37,7 @@ import io.github.dsheirer.message.MessageDirection;
|
||||
import io.github.dsheirer.module.decode.DecoderType;
|
||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||
import io.github.dsheirer.module.decode.ltrnet.channel.LtrNetChannel;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.LtrNetMessage;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.isw.IswCallEnd;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.isw.IswCallStart;
|
||||
@@ -82,7 +82,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
private SiteId mCurrentSite;
|
||||
private int mCurrentChannelNumber;
|
||||
private Set<LTRTalkgroup> mTalkgroups = new TreeSet<>();
|
||||
private Set<UniqueIdentifier> mUniqueIdentifiers = new TreeSet<>();
|
||||
private Set<LtrNetRadioIdentifier> mLtrNetRadioIdentifiers = new TreeSet<>();
|
||||
private Set<ESNIdentifier> mESNIdentifiers = new TreeSet<>();
|
||||
private DecodeEvent mCurrentCallEvent;
|
||||
private LTRTalkgroup mCurrentCallTalkgroup;
|
||||
@@ -121,7 +121,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
mCurrentSite = null;
|
||||
mCurrentChannelNumber = 0;
|
||||
mTalkgroups.clear();
|
||||
mUniqueIdentifiers.clear();
|
||||
mLtrNetRadioIdentifiers.clear();
|
||||
mESNIdentifiers.clear();
|
||||
resetState();
|
||||
}
|
||||
@@ -388,7 +388,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
{
|
||||
IswUniqueId iswUniqueId = (IswUniqueId)message;
|
||||
getIdentifierCollection().update(iswUniqueId.getUniqueID());
|
||||
mUniqueIdentifiers.add(iswUniqueId.getUniqueID());
|
||||
mLtrNetRadioIdentifiers.add(iswUniqueId.getUniqueID());
|
||||
updateCurrentCallIdentifiers();
|
||||
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.DATA));
|
||||
}
|
||||
@@ -462,7 +462,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
if(message instanceof RegistrationAccept)
|
||||
{
|
||||
RegistrationAccept registrationAccept = (RegistrationAccept)message;
|
||||
mUniqueIdentifiers.add(registrationAccept.getUniqueID());
|
||||
mLtrNetRadioIdentifiers.add(registrationAccept.getUniqueID());
|
||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
||||
ic.remove(IdentifierClass.USER);
|
||||
ic.update(message.getIdentifiers());
|
||||
@@ -580,18 +580,18 @@ public class LTRNetDecoderState extends DecoderState
|
||||
|
||||
sb.append("\nActive Radio Unique IDs\n");
|
||||
|
||||
if(mUniqueIdentifiers.isEmpty())
|
||||
if(mLtrNetRadioIdentifiers.isEmpty())
|
||||
{
|
||||
sb.append(" None\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
List<UniqueIdentifier> uniqueIdentifiers = new ArrayList<>(mUniqueIdentifiers);
|
||||
Collections.sort(uniqueIdentifiers, Comparator.comparingInt(Identifier::getValue));
|
||||
List<LtrNetRadioIdentifier> ltrNetRadioIdentifiers = new ArrayList<>(mLtrNetRadioIdentifiers);
|
||||
Collections.sort(ltrNetRadioIdentifiers, Comparator.comparingInt(Identifier::getValue));
|
||||
|
||||
for(UniqueIdentifier uniqueIdentifier: uniqueIdentifiers)
|
||||
for(LtrNetRadioIdentifier ltrNetRadioIdentifier : ltrNetRadioIdentifiers)
|
||||
{
|
||||
sb.append(" ").append(uniqueIdentifier).append("\n");
|
||||
sb.append(" ").append(ltrNetRadioIdentifier).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,20 +20,18 @@
|
||||
|
||||
package io.github.dsheirer.module.decode.ltrnet.identifier;
|
||||
|
||||
import io.github.dsheirer.identifier.Form;
|
||||
import io.github.dsheirer.identifier.IdentifierClass;
|
||||
import io.github.dsheirer.identifier.Role;
|
||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
|
||||
import io.github.dsheirer.protocol.Protocol;
|
||||
|
||||
/**
|
||||
* Unique ID or radio ID for LTR-Net radios is a 16-bit logical network radio identifier value.
|
||||
*/
|
||||
public class UniqueIdentifier extends IntegerIdentifier implements Comparable<UniqueIdentifier>
|
||||
public class LtrNetRadioIdentifier extends TalkgroupIdentifier implements Comparable<LtrNetRadioIdentifier>
|
||||
{
|
||||
public UniqueIdentifier(int value, Role role)
|
||||
public LtrNetRadioIdentifier(int value, Role role)
|
||||
{
|
||||
super(value, IdentifierClass.USER, Form.UNIQUE_ID, role);
|
||||
super(value, role, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,21 +43,21 @@ public class UniqueIdentifier extends IntegerIdentifier implements Comparable<Un
|
||||
/**
|
||||
* Creates a unique identifier for the FROM radio role
|
||||
*/
|
||||
public static UniqueIdentifier createFrom(int value)
|
||||
public static LtrNetRadioIdentifier createFrom(int value)
|
||||
{
|
||||
return new UniqueIdentifier(value, Role.FROM);
|
||||
return new LtrNetRadioIdentifier(value, Role.FROM);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a unique identifier for the TO radio role
|
||||
*/
|
||||
public static UniqueIdentifier createTo(int value)
|
||||
public static LtrNetRadioIdentifier createTo(int value)
|
||||
{
|
||||
return new UniqueIdentifier(value, Role.TO);
|
||||
return new LtrNetRadioIdentifier(value, Role.TO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(UniqueIdentifier o)
|
||||
public int compareTo(LtrNetRadioIdentifier o)
|
||||
{
|
||||
return getValue().compareTo(o.getValue());
|
||||
}
|
||||
@@ -22,7 +22,7 @@ package io.github.dsheirer.module.decode.ltrnet.message.isw;
|
||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class IswUniqueId extends LtrNetIswMessage
|
||||
{
|
||||
private UniqueIdentifier mUniqueIdentifier;
|
||||
private LtrNetRadioIdentifier mLtrNetRadioIdentifier;
|
||||
private List<Identifier> mIdentifiers;
|
||||
|
||||
/**
|
||||
@@ -50,14 +50,14 @@ public class IswUniqueId extends LtrNetIswMessage
|
||||
return LtrNetMessageType.ISW_UNIQUE_ID;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getUniqueID()
|
||||
public LtrNetRadioIdentifier getUniqueID()
|
||||
{
|
||||
if(mUniqueIdentifier == null)
|
||||
if(mLtrNetRadioIdentifier == null)
|
||||
{
|
||||
mUniqueIdentifier = UniqueIdentifier.createFrom(getMessage().getInt(SIXTEEN_BITS));
|
||||
mLtrNetRadioIdentifier = LtrNetRadioIdentifier.createFrom(getMessage().getInt(SIXTEEN_BITS));
|
||||
}
|
||||
|
||||
return mUniqueIdentifier;
|
||||
return mLtrNetRadioIdentifier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ package io.github.dsheirer.module.decode.ltrnet.message.osw;
|
||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
public class RegistrationAccept extends LtrNetOswMessage
|
||||
{
|
||||
private UniqueIdentifier mUniqueIdentifier;
|
||||
private LtrNetRadioIdentifier mLtrNetRadioIdentifier;
|
||||
private List<Identifier> mIdentifiers;
|
||||
|
||||
/**
|
||||
@@ -49,14 +49,14 @@ public class RegistrationAccept extends LtrNetOswMessage
|
||||
return LtrNetMessageType.OSW_REGISTRATION_ACCEPT;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getUniqueID()
|
||||
public LtrNetRadioIdentifier getUniqueID()
|
||||
{
|
||||
if(mUniqueIdentifier == null)
|
||||
if(mLtrNetRadioIdentifier == null)
|
||||
{
|
||||
mUniqueIdentifier = UniqueIdentifier.createTo(getMessage().getInt(SIXTEEN_BITS));
|
||||
mLtrNetRadioIdentifier = LtrNetRadioIdentifier.createTo(getMessage().getInt(SIXTEEN_BITS));
|
||||
}
|
||||
|
||||
return mUniqueIdentifier;
|
||||
return mLtrNetRadioIdentifier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PlaylistManager implements Listener<ChannelEvent>
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(PlaylistManager.class);
|
||||
|
||||
public static final int PLAYLIST_CURRENT_VERSION = 2;
|
||||
public static final int PLAYLIST_CURRENT_VERSION = 3;
|
||||
|
||||
private AliasModel mAliasModel;
|
||||
private BroadcastModel mBroadcastModel;
|
||||
|
||||
@@ -27,8 +27,9 @@ import io.github.dsheirer.alias.id.legacy.fleetsync.FleetsyncID;
|
||||
import io.github.dsheirer.alias.id.legacy.mdc.MDC1200ID;
|
||||
import io.github.dsheirer.alias.id.legacy.mpt1327.MPT1327ID;
|
||||
import io.github.dsheirer.alias.id.legacy.talkgroup.LegacyTalkgroupID;
|
||||
import io.github.dsheirer.alias.id.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.legacy.mobileID.Min;
|
||||
import io.github.dsheirer.alias.id.talkgroup.Talkgroup;
|
||||
import io.github.dsheirer.alias.id.legacy.uniqueID.UniqueID;
|
||||
import io.github.dsheirer.controller.channel.Channel;
|
||||
import io.github.dsheirer.module.log.EventLogType;
|
||||
import io.github.dsheirer.module.log.config.EventLogConfiguration;
|
||||
@@ -77,10 +78,12 @@ public class PlaylistUpdater
|
||||
switch(playlist.getVersion())
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
mLog.info("Updating playlist from version [1] to version [" + PlaylistManager.PLAYLIST_CURRENT_VERSION + "]");
|
||||
removeVersion1AudioRecordType(playlist);
|
||||
removeVersion1BinaryMessageLogger(playlist);
|
||||
removeVersion1NonRecordableAliasIdentifiers(playlist);
|
||||
removeVersion1SiteIdentifiers(playlist);
|
||||
updateVersion1Talkgroups(playlist);
|
||||
updated = true;
|
||||
break;
|
||||
@@ -184,7 +187,34 @@ public class PlaylistUpdater
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts legacy version 1talkgroups to the new talkgroup format. Previously, each protocol had a talkgroup
|
||||
* Removes site identifiers from all aliases. These are no longer supported
|
||||
*/
|
||||
private static void removeVersion1SiteIdentifiers(PlaylistV2 playlist)
|
||||
{
|
||||
int removed = 0;
|
||||
|
||||
for(Alias alias : playlist.getAliases())
|
||||
{
|
||||
Iterator<AliasID> it = alias.getId().iterator();
|
||||
|
||||
while(it.hasNext())
|
||||
{
|
||||
if(it.next().getType() == AliasIDType.SITE)
|
||||
{
|
||||
it.remove();
|
||||
removed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(removed > 0)
|
||||
{
|
||||
mLog.info("Removed [" + removed + "] site identifiers from aliases");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts legacy version 1 talkgroups to the new talkgroup format. Previously, each protocol had a talkgroup
|
||||
* flavor and now there is a generic talkgroup identifier with a protocol specifier.
|
||||
*
|
||||
* @param playlist to update
|
||||
@@ -426,6 +456,12 @@ public class PlaylistUpdater
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LTR_NET_UID:
|
||||
int uid = ((UniqueID)next).getUid();
|
||||
toAdd.add(new Talkgroup(Protocol.LTR_NET, uid));
|
||||
it.remove();
|
||||
updated++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user