diff --git a/src/lib/cloud-provider.js b/src/lib/cloud-provider.js index b2c5002870bfebad5ea7630a9d7c817a605b74bf..0b7c380b10e3e947cd98bb9983a7fb732cfabafd 100644 --- a/src/lib/cloud-provider.js +++ b/src/lib/cloud-provider.js @@ -99,6 +99,26 @@ class CloudProvider { this.writeToServer('set', name, value); } + /** + * Closes the connection to the web socket and clears the cloud + * provider of references related to the cloud data project. + */ + requestCloseConnection () { + this.connection.close(); + this.clear(); + } + + /** + * Clear this provider of references related to the project + * and current state. + */ + clear () { + this.connection = null; + this.vm = null; + this.username = null; + this.projectId = null; + } + } export default CloudProvider;