RAPP Platform API
Main Page
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
ServiceControllerSync.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
5
# Copyright 2015 RAPP
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
# Authors: Konstantinos Panayiotou, Manos Tsardoulias
20
# contact: klpanagi@gmail.com, etsardou@iti.gr
21
22
23
## @file ServiceController/ServiceControllerSync.py
24
#
25
# @copyright Rapp Projecty EU 2015
26
# @author Konstantinos Panayiotou, [klpanagi@gmail.com]
27
#
28
29
30
from
ServiceControllerBase
import
*
31
32
33
34
class
ServiceControllerSync
(
ServiceControllerBase
):
35
""" Synchronous service controller class implementation. """
36
37
def
__init__
(self, service):
38
"""! Constructor
39
40
@param service Service - Service instance.
41
"""
42
super(ServiceControllerSync, self).
__init__
(service)
43
44
45
def
run_job
(self, msg, url):
46
"""! Run the service"""
47
# Unpack payload and file objects from cloud service object
48
payload = msg.req.make_payload()
49
files = msg.req.make_files()
50
51
if
self._service.persistent:
52
resp = self.
_post_persistent
(url, payload, files)
53
else
:
54
resp = self.
_post_session_once
(url, payload, files)
55
return
resp
56
RappCloud.ServiceController.ServiceControllerSync.ServiceControllerSync.run_job
def run_job
Run the service.
Definition:
ServiceControllerSync.py:45
RappCloud.ServiceController.ServiceControllerBase.ServiceControllerBase._post_persistent
def _post_persistent
Post Request using active session - persistent connection.
Definition:
ServiceControllerBase.py:163
RappCloud.ServiceController.ServiceControllerSync.ServiceControllerSync
Definition:
ServiceControllerSync.py:34
RappCloud.ServiceController.ServiceControllerBase.ServiceControllerBase
Definition:
ServiceControllerBase.py:44
RappCloud.ServiceController.ServiceControllerBase.ServiceControllerBase._post_session_once
def _post_session_once
Post Request while initiating a new session.
Definition:
ServiceControllerBase.py:151
RappCloud.ServiceController.ServiceControllerSync.ServiceControllerSync.__init__
def __init__
Constructor.
Definition:
ServiceControllerSync.py:37
python
RappCloud
ServiceController
ServiceControllerSync.py
Generated on Fri Jul 29 2016 18:45:01 for RAPP Platform API by
1.8.6