Skip to content

Package: DomainRegistryService

DomainRegistryService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.authorization.domain;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.model.query.KapuaQuery;
18: import org.eclipse.kapua.service.KapuaEntityService;
19:
20: /**
21: * {@link Domain} service definition.
22: *
23: * @since 1.0.0
24: */
25: public interface DomainRegistryService extends KapuaEntityService<Domain, DomainCreator> {
26:
27: /**
28: * Creates a new {@link Domain} based on the parameters provided in the {@link DomainCreator}.<br>
29: * {@link Domain} must have a unique name.
30: *
31: * @param domainCreator The creator object from which to create the {@link Domain}.
32: * @return The created {@link Domain}
33: * @throws KapuaException When there is an oeror22
34: * @since 1.0.0
35: */
36: @Override
37: Domain create(DomainCreator domainCreator) throws KapuaException;
38:
39: /**
40: * Finds the {@link Domain} by scope identifier and {@link Domain} id.
41: *
42: * @param scopeId The scope id in which to search.
43: * @param domainId The {@link Domain} id to search.
44: * @return The {@link Domain} found or {@code null} if no entity was found.
45: * @throws KapuaException
46: * @since 1.0.0
47: */
48: @Override
49: Domain find(KapuaId scopeId, KapuaId domainId) throws KapuaException;
50:
51: /**
52: * Returns the {@link DomainListResult} with elements matching the provided query.
53: *
54: * @param query The {@link DomainQuery} used to filter results.
55: * @return The {@link DomainListResult} with elements matching the query parameter.
56: * @throws KapuaException
57: * @since 1.0.0
58: */
59: @Override
60: DomainListResult query(KapuaQuery query) throws KapuaException;
61:
62: /**
63: * Returns the count of the {@link Domain} elements matching the provided query.
64: *
65: * @param query The {@link DomainQuery} used to filter results.
66: * @return The count of the {@link Domain} elements matching the provided query.
67: * @throws KapuaException
68: * @since 1.0.0
69: */
70: @Override
71: long count(KapuaQuery query) throws KapuaException;
72:
73: /**
74: * Delete the {@link Domain} by scope id and {@link Domain} id.
75: *
76: * @param scopeId The scope id in which to delete.
77: * @param roleId The {@link Domain} id to delete.
78: * @throws KapuaException
79: * @since 1.0.0
80: */
81: @Override
82: void delete(KapuaId scopeId, KapuaId roleId) throws KapuaException;
83:
84: Domain findByName(String domainName) throws KapuaException;
85:
86: }