Switch to use ComponentManager for traits/components

Removed the old StateManager, CommandManager and related classes
and switched over to using ComponentManager for all device trait and
component definitions as well as device state.

Change-Id: I99b99a935ba217703d31aa523a3124cca0fa3e90
Reviewed-on: https://weave-review.googlesource.com/1788
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/src/commands/cloud_command_proxy.h b/src/commands/cloud_command_proxy.h
index ee6358f..13f4654 100644
--- a/src/commands/cloud_command_proxy.h
+++ b/src/commands/cloud_command_proxy.h
@@ -18,7 +18,7 @@
 #include "src/backoff_entry.h"
 #include "src/commands/cloud_command_update_interface.h"
 #include "src/commands/command_instance.h"
-#include "src/states/state_change_queue_interface.h"
+#include "src/component_manager.h"
 
 namespace weave {
 
@@ -33,7 +33,7 @@
  public:
   CloudCommandProxy(CommandInstance* command_instance,
                     CloudCommandUpdateInterface* cloud_command_updater,
-                    StateChangeQueueInterface* state_change_queue,
+                    ComponentManager* component_manager,
                     std::unique_ptr<BackoffEntry> backoff_entry,
                     provider::TaskRunner* task_runner);
   ~CloudCommandProxy() override = default;
@@ -46,10 +46,8 @@
   void OnStateChanged() override;
 
  private:
-  using UpdateID = StateChangeQueueInterface::UpdateID;
-  using UpdateQueueEntry =
-      std::pair<UpdateID, std::unique_ptr<base::DictionaryValue>>;
-
+  using UpdateQueueEntry = std::pair<ComponentManager::UpdateID,
+                                     std::unique_ptr<base::DictionaryValue>>;
   // Puts a command update data into the update queue, and optionally sends an
   // asynchronous request to GCD server to update the command resource, if there
   // are no pending device status updates.
@@ -68,11 +66,11 @@
   // Callback invoked by the device state change queue to notify of the
   // successful device state update. |update_id| is the ID of the state that
   // has been updated on the server.
-  void OnDeviceStateUpdated(UpdateID update_id);
+  void OnDeviceStateUpdated(ComponentManager::UpdateID update_id);
 
   CommandInstance* command_instance_;
   CloudCommandUpdateInterface* cloud_command_updater_;
-  StateChangeQueueInterface* state_change_queue_;
+  ComponentManager* component_manager_;
   provider::TaskRunner* task_runner_{nullptr};
 
   // Backoff for SendCommandUpdate() method.
@@ -87,11 +85,11 @@
   // Callback token from the state change queue for OnDeviceStateUpdated()
   // callback for ask the device state change queue to call when the state
   // is updated on the server.
-  StateChangeQueueInterface::Token callback_token_;
+  ComponentManager::Token callback_token_;
 
   // Last device state update ID that has been sent out to the server
   // successfully.
-  UpdateID last_state_update_id_{0};
+  ComponentManager::UpdateID last_state_update_id_{0};
 
   ScopedObserver<CommandInstance, CommandInstance::Observer> observer_{this};