Пример #1
0
    def reserveTimeout(self, soap_data):

        header, reserve_timeout = helper.parseRequest(soap_data)
        rt = reserve_timeout
        self.requester.reserveTimeout(header, rt.connectionId, rt.notificationId, rt.timeStamp, rt.timeoutValue, rt.originatingConnectionId, rt.originatingNSA)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #2
0
    def reserveConfirmed(self, soap_data, request_info):

        header, reservation = helper.parseRequest(soap_data)

        criteria = reservation.criteria

        # Create DTOs - this overlaps heavily with the parsing done in providerservice - unify sometime

        start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None
        end_time   = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime)   if criteria.schedule.endTime   is not None else None
        schedule   = nsa.Schedule(start_time, end_time)

        # check for service type sometime
        p2ps = criteria.serviceDefinition
        if type(p2ps) is not p2pservices.P2PServiceBaseType:
            raise ValueError('Only P2P service supported.')

        # (ERO missing)
        src_stp = helper.createSTP(p2ps.sourceSTP)
        dst_stp = helper.createSTP(p2ps.destSTP)

        if p2ps.ero:
            print('ERO parsing in reserveConfirmed not implemented yet, full path will not be available')

        sd = nsa.Point2PointService(src_stp, dst_stp, p2ps.capacity, p2ps.directionality, p2ps.symmetricPath, None)
        crt = nsa.Criteria(criteria.version, schedule, sd)

        self.requester.reserveConfirmed(header, reservation.connectionId,  reservation.globalReservationId, reservation.description, crt)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #3
0
    def reserveConfirmed(self, soap_data):

        header, reservation = helper.parseRequest(soap_data)

        criteria = reservation.criteria

        # Create DTOs - this overlaps heavily with the parsing done in providerservice - unify sometime

        start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None
        end_time   = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime)
        schedule   = nsa.Schedule(start_time, end_time)

        # check for service type sometime
        p2ps = criteria.serviceDefinition
        if type(p2ps) is not p2pservices.P2PServiceBaseType:
            raise ValueError('Only P2P service supported.')

        # (ERO missing)
        src_stp = helper.createSTP(p2ps.sourceSTP)
        dst_stp = helper.createSTP(p2ps.destSTP)

        if p2ps.ero:
            print "ERO parsing in reserveConfirmed not implemented yet, full path will not be available"

        sd = nsa.Point2PointService(src_stp, dst_stp, p2ps.capacity, p2ps.directionality, p2ps.symmetricPath, None)
        crt = nsa.Criteria(criteria.version, schedule, sd)

        self.requester.reserveConfirmed(header, reservation.connectionId,  reservation.globalReservationId, reservation.description, crt)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #4
0
    def queryRecursiveConfirmed(self, soap_data):

        header, query_result = helper.parseRequest(soap_data)

        reservations = [ queryhelper.buildQueryResult(res, header.provider_nsa, include_children=True) for res in query_result.reservations ]

        self.requester.queryRecursiveConfirmed(header, reservations)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #5
0
    def reserveTimeout(self, soap_data, request_info):

        header, reserve_timeout = helper.parseRequest(soap_data)

        rt = reserve_timeout
        timestamp = xmlhelper.parseXMLTimestamp(rt.timeStamp)
        self.requester.reserveTimeout(header, rt.connectionId, rt.notificationId, timestamp, rt.timeoutValue, rt.originatingConnectionId, rt.originatingNSA)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #6
0
    def queryRecursiveConfirmed(self, soap_data, request_info):

        header, query_result = helper.parseRequest(soap_data)

        reservations = [ queryhelper.buildQueryResult(res, header.provider_nsa, include_children=True) for res in query_result.reservations ]

        self.requester.queryRecursiveConfirmed(header, reservations)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #7
0
    def querySummaryConfirmed(self, soap_data, request_info):

        header, query_result = helper.parseRequest(soap_data)

        reservations = [ queryhelper.buildQueryResult(res, header.provider_nsa) for res in query_result.reservations ]

        self.requester.querySummaryConfirmed(header, reservations)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #8
0
    def dataPlaneStateChange(self, soap_data, request_info):

        header, data_plane_state_change = helper.parseRequest(soap_data)

        dpsc = data_plane_state_change
        dps = dpsc.dataPlaneStatus

        self.requester.dataPlaneStateChange(header, dpsc.connectionId, dpsc.notificationId, dpsc.timeStamp, (dps.active, dps.version, dps.versionConsistent) )

        return helper.createGenericRequesterAcknowledgement(header)
Пример #9
0
    def dataPlaneStateChange(self, soap_data):

        header, data_plane_state_change = helper.parseRequest(soap_data)

        dpsc = data_plane_state_change
        dps = dpsc.dataPlaneStatus

        self.requester.dataPlaneStateChange(header, dpsc.connectionId, dpsc.notificationId, dpsc.timeStamp, (dps.active, dps.version, dps.versionConsistent) )

        return helper.createGenericRequesterAcknowledgement(header)
Пример #10
0
    def querySummaryConfirmed(self, soap_data):

        header, query_result = helper.parseRequest(soap_data)

        reservations = [
            queryhelper.buildQueryResult(res, header.provider_nsa)
            for res in query_result.reservations
        ]

        self.requester.querySummaryConfirmed(header, reservations)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #11
0
    def errorEvent(self, soap_data, request_info):

        header, error_event = helper.parseRequest(soap_data)

        #connection_id, notification_id, timestamp, event, info, service_ex = 
        ee = error_event
        if ee.serviceException:
            se = ee.serviceException
            service_ex = (se.nsaId, se.connectionId, se.errorId, se.text, se.variables, se.childException)
        else:
            service_ex = None

        self.requester.errorEvent(header, ee.connectionId, ee.notificationId, ee.timeStamp, ee.event, ee.additionalInfo, service_ex)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #12
0
    def errorEvent(self, soap_data):

        header, error_event = helper.parseRequest(soap_data)

        #connection_id, notification_id, timestamp, event, info, service_ex = 
        ee = error_event
        if ee.serviceException:
            se = ee.serviceException
            service_ex = (se.nsaId, se.connectionId, se.errorId, se.text, se.variables, se.childException)
        else:
            service_ex = None

        self.requester.errorEvent(header, ee.connectionId, ee.notificationId, ee.timeStamp, ee.event, ee.additionalInfo, service_ex)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #13
0
    def error(self, soap_data, request_info):

        header, error = helper.parseRequest(soap_data)
        se = error.serviceException
        # service exception fields, we are not quite there yet...
        # nsaId  # NsaIdType -> anyURI
        # connectionId  # ConnectionIdType -> string
        # serviceType  # string
        # errorId  # string
        # text  # string
        # variables  # [ TypeValuePairType ]
        # childException  # [ ServiceException ]
        variables = [ (tvp.type, tvp.value) for tvp in se.variables ]
        child_ex = None

        self.requester.error(header, se.nsaId, se.connectionId, se.serviceType, se.errorId, se.text, variables, child_ex)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #14
0
    def error(self, soap_data):

        header, error = helper.parseRequest(soap_data)
        se = error.serviceException
        # service exception fields, we are not quite there yet...
        # nsaId  # NsaIdType -> anyURI
        # connectionId  # ConnectionIdType -> string
        # serviceType  # string
        # errorId  # string
        # text  # string
        # variables  # [ TypeValuePairType ]
        # childException  # [ ServiceException ]
        variables = [ (tvp.type, tvp.value) for tvp in se.variables ]
        child_ex = None

        self.requester.error(header, se.nsaId, se.connectionId, se.serviceType, se.errorId, se.text, variables, child_ex)

        return helper.createGenericRequesterAcknowledgement(header)
Пример #15
0
 def provisionConfirmed(self, soap_data, request_info):
     header, generic_confirm = helper.parseRequest(soap_data)
     self.requester.provisionConfirmed(header, generic_confirm.connectionId)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #16
0
 def terminateFailed(self, soap_data):
     header, connection_id, cs, err = self._parseGenericFailure(soap_data)
     self.requester.terminateFailed(header, connection_id, cs, err)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #17
0
 def terminateConfirmed(self, soap_data):
     header, generic_confirm = helper.parseRequest(soap_data)
     self.requester.terminateConfirmed(header, generic_confirm.connectionId)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #18
0
 def terminateConfirmed(self, soap_data):
     header, generic_confirm = helper.parseRequest(soap_data)
     self.requester.terminateConfirmed(header, generic_confirm.connectionId)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #19
0
 def reserveFailed(self, soap_data):
     header, connection_id, cs, err = self._parseGenericFailure(soap_data)
     self.requester.reserveFailed(header, connection_id, cs, err)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #20
0
 def reserveCommitFailed(self, soap_data, request_info):
     header, connection_id, cs, err = self._parseGenericFailure(soap_data)
     self.requester.reserveCommitFailed(header, connection_id, cs, err)
     return helper.createGenericRequesterAcknowledgement(header)
Пример #21
0
 def provisionConfirmed(self, soap_data, request_info):
     header, generic_confirm = helper.parseRequest(soap_data)
     self.requester.provisionConfirmed(header, generic_confirm.connectionId)
     return helper.createGenericRequesterAcknowledgement(header)