+ //
+ // PRIVATE METHODS
+ //
+
+ /**
+ * Checks the given new list of own identities for added or removed own
+ * identities, as compared to {@link #currentOwnIdentities}.
+ *
+ * @param newOwnIdentities
+ * The new own identities
+ */
+ private void checkOwnIdentities(Map<String, OwnIdentity> newOwnIdentities) {
+ synchronized (syncObject) {
+
+ /* find removed own identities: */
+ for (OwnIdentity oldOwnIdentity : currentOwnIdentities.values()) {
+ if (!newOwnIdentities.containsKey(oldOwnIdentity.getId())) {
+ identityListenerManager.fireOwnIdentityRemoved(oldOwnIdentity);
+ }
+ }
+
+ /* find added own identities. */
+ for (OwnIdentity currentOwnIdentity : newOwnIdentities.values()) {
+ if (!currentOwnIdentities.containsKey(currentOwnIdentity.getId())) {
+ identityListenerManager.fireOwnIdentityAdded(currentOwnIdentity);
+ }
+ }
+
+ currentOwnIdentities.clear();
+ currentOwnIdentities.putAll(newOwnIdentities);
+ }
+ }
+