Skip to content

Package: DomainCreator

DomainCreator

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.model.KapuaEntityCreator;
16: import org.eclipse.kapua.model.domain.Actions;
17: import org.eclipse.kapua.service.authorization.permission.Permission;
18:
19: import javax.xml.bind.annotation.XmlAccessType;
20: import javax.xml.bind.annotation.XmlAccessorType;
21: import javax.xml.bind.annotation.XmlRootElement;
22: import java.util.Set;
23:
24: /**
25: * {@link DomainCreator} definition.<br>
26: * <p>
27: * It is used to create a new {@link Domain} with {@link Actions} associated
28: *
29: * @since 1.0.0
30: */
31: @XmlRootElement(name = "domainCreator")
32: @XmlAccessorType(XmlAccessType.PROPERTY)
33: public interface DomainCreator extends KapuaEntityCreator<Domain> { // org.eclipse.kapua.model.domain.Domain {
34:
35: String getName();
36:
37: String getServiceName();
38:
39: Set<Actions> getActions();
40:
41: boolean getGroupable();
42:
43: /**
44: * Sets the {@link Domain} name.
45: *
46: * @param name The {@link Domain} name.
47: * @since 1.0.0
48: */
49: void setName(String name);
50:
51: /**
52: * Sets the {@link Domain} service name.
53: *
54: * @param serviceName The {@link Domain} name.
55: * @since 1.0.0
56: */
57: void setServiceName(String serviceName);
58:
59: /**
60: * Sets the set of {@link Actions} available in the {@link Domain}.<br>
61: * It up to the implementation class to make a clone of the set or use the given set.
62: *
63: * @param actions The set of {@link Actions}.
64: * @since 1.0.0
65: */
66: void setActions(Set<Actions> actions);
67:
68: /**
69: * Sets whether or not this {@link Domain} is group-able or not.
70: * This determines if the {@link org.eclipse.kapua.service.authorization.permission.Permission} in this {@link Domain} can have a {@link org.eclipse.kapua.service.authorization.group.Group} or not.
71: * This is related to the {@link org.eclipse.kapua.service.authorization.group.Groupable} property of a {@link KapuaEntityCreator}.
72: *
73: * @param groupable {@code true} if the {@link org.eclipse.kapua.service.authorization.permission.Permission} on this {@link Domain} can have the {@link Permission#getGroupId()} property set, {@code false} otherwise.
74: * @since 0.3.1
75: */
76: void setGroupable(boolean groupable);
77:
78: }