TimerGestoreChiaviPDNDEvent.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.pdd.timers.pdnd;

  21. import java.util.HashMap;
  22. import java.util.Map;

  23. /**    
  24.  * TimerGestoreChiaviPDNDEvent
  25.  *
  26.  * @author Poli Andrea (poli@link.it)
  27.  * @author $Author$
  28.  * @version $Rev$, $Date$
  29.  */
  30. public class TimerGestoreChiaviPDNDEvent {

  31.     public static final String EVENT_TYPE_ADDED = "ADDED";
  32.     public static final String EVENT_TYPE_DELETED = "DELETED";
  33.     public static final String EVENT_TYPE_UPDATED = "UPDATED";

  34.     public static final String OBJECT_TYPE_PURPOSE = "PURPOSE";
  35.     public static final String OBJECT_TYPE_AGREEMENT = "AGREEMENT";
  36.     public static final String OBJECT_TYPE_KEY = "KEY";

  37.     /** Esempi:
  38.      *  required:
  39.         - eventId
  40.         - eventType
  41.         - objectType
  42.         - objectId
  43.       {"eventId":1,"eventType":"ADDED","objectId":{"kid":"78rnqOpnUf4iiT30mOXUsXm52X1_7J2gMXj2wxYuR-o"},"objectType":"KEY"}
  44.       {"eventId":25,"eventType":"DELETED","objectId":{"kid":"n1pcztDp9QbkulHy-ufBvTpJESFEbgNnjDjUfmt4FIA"},"objectType":"KEY"}
  45.      */
  46.     // (type:integer format:int64) This value is also used to sort the events in chronological order
  47.     private long eventId;
  48.     // (type:string) Describes the kind of the event (e.g. ADDED, DELETED, UPDATED)
  49.     private String eventType;
  50.     /** (type:undefined)  Contains the identifiers of the object involved in the event Examples:
  51.     { "agreementId" :  "007523dc-7ec8-4ce4-9e29-d70bf4eda769" }
  52.     { "kid" : "ajsdkjaskd_asjkdhaskdhj29_eueU" }
  53.      */
  54.     private Map<String, String> objectId = new HashMap<>();
  55.     // (type:string) Describes which object is involved in the event (e.g. PURPOSE, AGREEMENT, KEY)
  56.     private String objectType;



  57.     public long getEventId() {
  58.         return this.eventId;
  59.     }
  60.     public void setEventId(long eventId) {
  61.         this.eventId = eventId;
  62.     }

  63.     public String getEventType() {
  64.         return this.eventType;
  65.     }
  66.     public void setEventType(String eventType) {
  67.         this.eventType = eventType;
  68.     }

  69.     public Map<String, String> getObjectId() {
  70.         return this.objectId;
  71.     }
  72.     public void setObjectId(Map<String, String> objectId) {
  73.         this.objectId = objectId;
  74.     }
  75.     public TimerGestoreChiaviPDNDEvent putObjectIdItem(String key, String objectIdItem) {
  76.         this.objectId.put(key, objectIdItem);
  77.         return this;
  78.     }

  79.     public String getObjectType() {
  80.         return this.objectType;
  81.     }
  82.     public void setObjectType(String objectType) {
  83.         this.objectType = objectType;
  84.     }
  85. }