gateway: Ensure required interfaces are implemented

... using the built-in abc module.

Change-Id: I70a5ddde1f235bdd208997c3012aa0e8588b32e2
This commit is contained in:
Takashi Kajinami 2024-02-11 16:41:27 +09:00
parent f1e59923ee
commit 43c038adf4
1 changed files with 9 additions and 6 deletions

View File

@ -14,10 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import abc
from storlets.gateway.common.stob import StorletRequest
class StorletGatewayBase(object):
class StorletGatewayBase(object, metaclass=abc.ABCMeta):
request_class = StorletRequest
@ -27,14 +29,15 @@ class StorletGatewayBase(object):
self.scope = scope
@classmethod
@abc.abstractmethod
def validate_storlet_registration(cls, params, obj):
raise NotImplementedError("Not implemented: "
"validate_storlet_registration")
pass
@classmethod
@abc.abstractmethod
def validate_dependency_registration(cls, params, obj):
raise NotImplementedError("Not implemented: "
"validate_dependency_registration")
pass
@abc.abstractmethod
def invocation_flow(self, sreq, extra_sources=None):
raise NotImplementedError("Not implemented: invocation_flow")
pass