예제 #1
0
파일: backend.py 프로젝트: shockjiang/rms
 def __init__(self):
     self.thread = ContentManagementBackend._thread()
     self.tmp_dir = os.path.join(get_ndnflow_path()[1], 'rms_tmp/')
     self.tmp_naming = "/{}/rms/{}".format(get_host(), 'pub_dir')
     try:
         os.makedirs(self.tmp_dir)
     except Exception, e:
         pass
예제 #2
0
 def __init__(self, host, pubFile):
     super(ContentService, self).__init__(host, ContentService.SERVICE_NAME, pubFile)
     self.ndnflow_dir = get_ndnflow_path()[1]
     self.thread = ContentService.content_service_thread()
     self.thread.start()
예제 #3
0
import urllib
import subprocess
import threading
import sys
import Queue
import os
import os.path
from binascii import hexlify, unhexlify

import pylru

import common.security as security
import common.statuscode as statuscode
import ndn_interface
from common.settings import log, get_ndnflow_path
sys.path.append(get_ndnflow_path()[0])
import ndn_flow

class SessionItem(object):
    def __init__(self, cipher):
        self.cipher = cipher
        self.seq = 0

    def session_encrypt_data(self, data):
        return self.cipher.encrypt(data)

    def session_decrypt_data(self, data):
        return self.cipher.decrypt(data)

class rmsServerBase(ndn_interface.rmsServerInterface):
    """Service base class for resources management system"""