Skip to content

Package: KapuaEntity

KapuaEntity

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.model;
14:
15: import org.eclipse.kapua.KapuaSerializable;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.model.id.KapuaIdAdapter;
18: import org.eclipse.kapua.model.xml.DateXmlAdapter;
19:
20: import javax.xml.bind.annotation.XmlElement;
21: import javax.xml.bind.annotation.XmlTransient;
22: import javax.xml.bind.annotation.XmlType;
23: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
24: import java.util.Date;
25:
26: /**
27: * {@link KapuaEntity} definition.
28: * <p>
29: * All the {@link KapuaEntity}s will be an extension of this entity.
30: *
31: * @since 1.0.0
32: */
33: @XmlType(propOrder = {
34: "id",
35: "scopeId",
36: "createdOn",
37: "createdBy"})
38: public interface KapuaEntity extends KapuaSerializable {
39:
40: @XmlTransient
41: String getType();
42:
43: /**
44: * Gets the unique {@link KapuaId}
45: *
46: * @return the unique {@link KapuaId}
47: * @since 1.0.0
48: */
49: @XmlElement(name = "id")
50: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
51: KapuaId getId();
52:
53: /**
54: * Sets the unique {@link KapuaId}
55: *
56: * @param id the unique {@link KapuaId}
57: * @since 1.0.0
58: */
59: void setId(KapuaId id);
60:
61: /**
62: * Gets the scope {@link KapuaId}
63: *
64: * @return the scope {@link KapuaId}
65: * @since 1.0.0
66: */
67: @XmlElement(name = "scopeId")
68: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
69: KapuaId getScopeId();
70:
71: /**
72: * Sets the scope {@link KapuaId}
73: *
74: * @param scopeId the scope {@link KapuaId}
75: * @since 1.0.0
76: */
77: void setScopeId(KapuaId scopeId);
78:
79: /**
80: * Gets the creation date.
81: *
82: * @return the creation date.
83: * @since 1.0.0
84: */
85: @XmlElement(name = "createdOn")
86: @XmlJavaTypeAdapter(DateXmlAdapter.class)
87: Date getCreatedOn();
88:
89: /**
90: * Gets the identity {@link KapuaId} who has created this {@link KapuaEntity}
91: *
92: * @return the identity {@link KapuaId} who has created this {@link KapuaEntity}
93: * @since 1.0.0
94: */
95: @XmlElement(name = "createdBy")
96: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
97: KapuaId getCreatedBy();
98: }