From b1a971eedb18a11af2cdc70ba5f8004bae89defd Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 30 May 2022 11:16:05 -0700 Subject: Remove unused interface --- .../java/org/traccar/database/DeviceManager.java | 4 +--- .../java/org/traccar/database/GroupsManager.java | 20 +--------------- .../org/traccar/database/ManagableObjects.java | 27 ---------------------- .../org/traccar/database/SimpleObjectManager.java | 5 +--- 4 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 src/main/java/org/traccar/database/ManagableObjects.java (limited to 'src/main/java/org/traccar/database') diff --git a/src/main/java/org/traccar/database/DeviceManager.java b/src/main/java/org/traccar/database/DeviceManager.java index a9b8454eb..a14fd7022 100644 --- a/src/main/java/org/traccar/database/DeviceManager.java +++ b/src/main/java/org/traccar/database/DeviceManager.java @@ -38,7 +38,7 @@ import org.traccar.model.Position; import org.traccar.model.Server; import org.traccar.storage.StorageException; -public class DeviceManager extends BaseObjectManager implements IdentityManager, ManagableObjects { +public class DeviceManager extends BaseObjectManager implements IdentityManager { private static final Logger LOGGER = LoggerFactory.getLogger(DeviceManager.class); @@ -162,7 +162,6 @@ public class DeviceManager extends BaseObjectManager implements Identity return Context.getPermissionsManager().getDevicePermissions(userId); } - @Override public Set getUserItems(long userId) { if (Context.getPermissionsManager() != null) { Set result = new HashSet<>(); @@ -186,7 +185,6 @@ public class DeviceManager extends BaseObjectManager implements Identity return result; } - @Override public Set getManagedItems(long userId) { Set result = new HashSet<>(getUserItems(userId)); for (long managedUserId : Context.getUsersManager().getUserItems(userId)) { diff --git a/src/main/java/org/traccar/database/GroupsManager.java b/src/main/java/org/traccar/database/GroupsManager.java index dafddc0cc..9322dd80a 100644 --- a/src/main/java/org/traccar/database/GroupsManager.java +++ b/src/main/java/org/traccar/database/GroupsManager.java @@ -23,7 +23,7 @@ import org.traccar.Context; import org.traccar.model.Group; import org.traccar.storage.StorageException; -public class GroupsManager extends BaseObjectManager implements ManagableObjects { +public class GroupsManager extends BaseObjectManager { public GroupsManager(DataManager dataManager) { super(dataManager, Group.class); @@ -62,22 +62,4 @@ public class GroupsManager extends BaseObjectManager implements Managable super.updateItem(group); } - @Override - public Set getUserItems(long userId) { - if (Context.getPermissionsManager() != null) { - return Context.getPermissionsManager().getGroupPermissions(userId); - } else { - return new HashSet<>(); - } - } - - @Override - public Set getManagedItems(long userId) { - Set result = getUserItems(userId); - for (long managedUserId : Context.getUsersManager().getUserItems(userId)) { - result.addAll(getUserItems(managedUserId)); - } - return result; - } - } diff --git a/src/main/java/org/traccar/database/ManagableObjects.java b/src/main/java/org/traccar/database/ManagableObjects.java deleted file mode 100644 index ec9549493..000000000 --- a/src/main/java/org/traccar/database/ManagableObjects.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.traccar.database; - -import java.util.Set; - -public interface ManagableObjects { - - Set getUserItems(long userId); - - Set getManagedItems(long userId); - -} diff --git a/src/main/java/org/traccar/database/SimpleObjectManager.java b/src/main/java/org/traccar/database/SimpleObjectManager.java index 78701720f..74bbc054f 100644 --- a/src/main/java/org/traccar/database/SimpleObjectManager.java +++ b/src/main/java/org/traccar/database/SimpleObjectManager.java @@ -29,8 +29,7 @@ import org.traccar.model.Permission; import org.traccar.model.User; import org.traccar.storage.StorageException; -public abstract class SimpleObjectManager extends BaseObjectManager - implements ManagableObjects { +public abstract class SimpleObjectManager extends BaseObjectManager { private static final Logger LOGGER = LoggerFactory.getLogger(SimpleObjectManager.class); @@ -40,7 +39,6 @@ public abstract class SimpleObjectManager extends BaseObjec super(dataManager, baseClass); } - @Override public final Set getUserItems(long userId) { try { readLock(); @@ -55,7 +53,6 @@ public abstract class SimpleObjectManager extends BaseObjec } } - @Override public Set getManagedItems(long userId) { Set result = getUserItems(userId); for (long managedUserId : Context.getUsersManager().getUserItems(userId)) { -- cgit v1.2.3