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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def terminateConfirmed(self, soap_data): header, generic_confirm = helper.parseRequest(soap_data) self.requester.terminateConfirmed(header, generic_confirm.connectionId) return helper.createGenericRequesterAcknowledgement(header)
def terminateConfirmed(self, soap_data): header, generic_confirm = helper.parseRequest(soap_data) self.requester.terminateConfirmed(header, generic_confirm.connectionId) return helper.createGenericRequesterAcknowledgement(header)
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)
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)
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)