Improved creator/state machine classes class hierarchy.
[snaps.git] / snaps / domain / creator.py
1 # Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
2 #                    and others.  All rights reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 __author__ = 'spisarski'
17
18
19 class CloudObject(object):
20     """
21     Base class for all cloud objects to create or manage
22     """
23
24     def initialize(self):
25         """
26         Method used to initialize object via queries
27         :return:
28         """
29         raise NotImplementedError('Please implement this abstract method')
30
31     def create(self):
32         """
33         Method to be called to create this cloud object. First line should
34         generally be a call to initialize()
35         :return:
36         """
37         raise NotImplementedError('Please implement this abstract method')
38
39     def clean(self):
40         """
41         Method used to delete objects on the cloud
42         :return:
43         """
44         raise NotImplementedError('Please implement this abstract method')