1818package it .reply .orchestrator .dto .policies ;
1919
2020import com .fasterxml .jackson .annotation .JsonProperty ;
21-
2221import it .reply .orchestrator .utils .ToscaConstants .Policies .Types ;
23-
2422import java .util .ArrayList ;
2523import java .util .List ;
2624import java .util .Objects ;
2725import java .util .Set ;
28-
2926import javax .validation .constraints .NotNull ;
30-
3127import lombok .EqualsAndHashCode ;
3228import lombok .Getter ;
3329import lombok .Setter ;
3430import lombok .ToString ;
35-
3631import org .checkerframework .checker .nullness .qual .NonNull ;
32+ import org .checkerframework .checker .nullness .qual .Nullable ;
3733
3834@ Getter
3935@ Setter
@@ -46,6 +42,10 @@ public class SlaPlacementPolicy extends GenericToscaPolicy {
4642 @ NotNull
4743 private String slaId ;
4844
45+ @ Nullable
46+ @ JsonProperty ("region" )
47+ private String slaRegion ;
48+
4949 @ JsonProperty ("services_id" )
5050 @ NonNull
5151 @ NotNull
@@ -71,11 +71,31 @@ protected SlaPlacementPolicy(
7171 servicesId = new ArrayList <>();
7272 }
7373
74+ protected SlaPlacementPolicy (
75+ @ NonNull String type ,
76+ @ NonNull Set <String > targets ,
77+ @ NonNull String slaId ,
78+ String slaRegion
79+ ) {
80+ super (type , targets );
81+ this .slaId = Objects .requireNonNull (slaId );
82+ servicesId = new ArrayList <>();
83+ this .slaRegion = slaRegion ;
84+ }
85+
7486 public SlaPlacementPolicy (
7587 @ NonNull Set <String > targets ,
7688 @ NonNull String slaId
7789 ) {
7890 this (Types .SLA_PLACEMENT , targets , slaId );
7991 }
8092
93+ public SlaPlacementPolicy (
94+ @ NonNull Set <String > targets ,
95+ @ NonNull String slaId ,
96+ String slaRegion
97+ ) {
98+ this (Types .SLA_PLACEMENT , targets , slaId , slaRegion );
99+ }
100+
81101}
0 commit comments