Coverage for d7a/sp/session.py: 90%

10 statements  

« prev     ^ index     » next       coverage.py v7.5.0, created at 2024-05-24 08:03 +0200

1# 

2# Copyright (c) 2015-2021 University of Antwerp, Aloxy NV. 

3# 

4# This file is part of pyd7a. 

5# See https://github.com/Sub-IoT/pyd7a for further info. 

6# 

7# Licensed under the Apache License, Version 2.0 (the "License"); 

8# you may not use this file except in compliance with the License. 

9# You may obtain a copy of the License at 

10# 

11# http://www.apache.org/licenses/LICENSE-2.0 

12# 

13# Unless required by applicable law or agreed to in writing, software 

14# distributed under the License is distributed on an "AS IS" BASIS, 

15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

16# See the License for the specific language governing permissions and 

17# limitations under the License. 

18# 

19 

20# author: Christophe VG <contact@christophe.vg> 

21# class implementation of (FIFO) configuration 

22 

23# TODO can be removed? 

24class States(object): 

25 IDLE = 0 # Inactive Session 

26 DORMANT = 1 # The group of Requests needs to be executed within a timeout  

27 # period, which has not expired. After completion of the  

28 # period, the Dormant Session is transformed into Pending  

29 # Session. 

30 PENDING = 2 # The group of Requests needs to be executed as soon as  

31 # possible. 

32 ACTIVE = 3 # The Session is being currently executed using the D7A  

33 # Session Protocol. 

34 DONE = 4 # Terminated Session 

35 

36 ALL = [ IDLE, DORMANT, PENDING, ACTIVE, DONE ] 

37 

38 @staticmethod 

39 def SCHEMA(): 

40 return { "type": "integer", "allowed" : States.ALL }