Skip to content

Commit

Permalink
:fix: revised Domain declarations, domain's service name is no longer…
Browse files Browse the repository at this point in the history
… included in the equality comparison, as it has no effect at all (and could be removed completely as a property)

Signed-off-by: dseurotech <[email protected]>
  • Loading branch information
dseurotech committed Jan 18, 2024
1 parent 0558991 commit f603fc8
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ protected void configureModule() {
bind(DataPopulatorRunner.class).in(Singleton.class);
}

@ProvidesIntoSet
public Domain brokerDomain() {
return new DomainEntry(Domains.BROKER, "org.eclipse.kapua.broker.BrokerService", false, Actions.connect);
}

@ProvidesIntoSet
public Domain eventStoreDomain() {
return new DomainEntry(Domains.EVENT_STORE, EventStoreService.class.getName(), false, Actions.read, Actions.delete, Actions.write);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ public boolean equals(Object object) {
if (!getActions().equals(that.getActions())) {
return false;
}
return getServiceName() != null ? getServiceName().equals(that.getServiceName()) : that.getServiceName() == null;
return true;
}

@Override
public int hashCode() {
int result = getName() != null ? getName().hashCode() : 0;
result = 31 * result + (getGroupable() ? 1 : 0);
result = 31 * result + getActions().hashCode();
result = 31 * result + (getServiceName() != null ? getServiceName().hashCode() : 0);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Eurotech - initial API and implementation
*******************************************************************************/
package org.eclipse.kapua.service.authentication;

import com.google.inject.multibindings.ProvidesIntoSet;
import org.eclipse.kapua.commons.core.AbstractKapuaModule;
import org.eclipse.kapua.commons.model.domains.Domains;
import org.eclipse.kapua.model.domain.Actions;
import org.eclipse.kapua.model.domain.Domain;
import org.eclipse.kapua.model.domain.DomainEntry;

public class AuthenticationModule extends AbstractKapuaModule {
@Override
protected void configureModule() {
}

@ProvidesIntoSet
public Domain brokerDomain() {
return new DomainEntry(Domains.BROKER, "org.eclipse.kapua.broker.BrokerService", false, Actions.connect);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected void configureModule() {

@ProvidesIntoSet
public Domain deviceManagementRegistryDomain() {
return new DomainEntry(Domains.DEVICE_MANAGEMENT_REGISTRY, DeviceManagementRegistryManagerService.class.getName(), false, Actions.execute, Actions.read, Actions.write);
return new DomainEntry(Domains.DEVICE_MANAGEMENT_REGISTRY, DeviceManagementRegistryManagerService.class.getName(), false, Actions.delete, Actions.read, Actions.write);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void configureModule() {

@ProvidesIntoSet
public Domain schedulerDomain() {
return new DomainEntry(Domains.SCHEDULER, "org.eclipse.kapua.service.scheduler.SchedulerService", false, Actions.read, Actions.delete, Actions.write, Actions.execute);
return new DomainEntry(Domains.SCHEDULER, "org.eclipse.kapua.service.scheduler.SchedulerService", false, Actions.read, Actions.delete, Actions.write);
}

@Provides
Expand Down

0 comments on commit f603fc8

Please sign in to comment.