Add Id to Trigger

Currently, Trigger is using Name as unique identifier. By adding Id, we
can be compliant with redfish specification:
- Id will be used as unique identifier
- Name will be used as human readable, non-unique name

AddTrigger dbus method is now requiring both id and name. Each of them
can be passed as empty string and the service will fill them with
correct values. If only id is an empty string, name will be used to
generate its value.

Dbus object path and persistent storage filename are now be based on id,
instead of name.

Added validation for AddTrigger:
- correct characters in id
- max id length

Added Name property for Trigger object, which can be modified from dbus.

Testing done:
- Unit test added and passing
- Trigger was added using dbus, without errors
- Id generation is working properly
- Name property is accessible and writable from dbus

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Ibb553586eaf51943044c93a35bc0725e6ef67ce9
diff --git a/src/trigger.hpp b/src/trigger.hpp
index 904f520..e1874e7 100644
--- a/src/trigger.hpp
+++ b/src/trigger.hpp
@@ -16,7 +16,7 @@
   public:
     Trigger(boost::asio::io_context& ioc,
             const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
-            const std::string& name,
+            const std::string& id, const std::string& name,
             const std::vector<std::string>& triggerActions,
             const std::vector<std::string>& reportNames,
             const std::vector<LabeledSensorInfo>& LabeledSensorsInfoIn,
@@ -30,9 +30,9 @@
     Trigger& operator=(const Trigger&) = delete;
     Trigger& operator=(Trigger&&) = delete;
 
-    std::string getName() const override
+    std::string getId() const override
     {
-        return name;
+        return id;
     }
 
     std::string getPath() const override
@@ -43,9 +43,10 @@
     bool storeConfiguration() const;
 
   private:
-    const std::string name;
+    std::string id;
+    std::string name;
     std::vector<std::string> triggerActions;
-    const std::string path;
+    std::string path;
     bool persistent = false;
     std::vector<std::string> reportNames;
     std::vector<LabeledSensorInfo> labeledSensorsInfo;