Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addressSpace: AddressSpacePrivate,
inputArguments: VariantLike[],
context: SessionContext
) {
// --- possible StatusCodes:
//
// Bad_SubscriptionIdInvalid See Part 4 for the description of this result code
// Bad_RefreshInProgress See Table 74 for the description of this result code
// Bad_UserAccessDenied The Method was not called in the context of the Session
// that owns the Subscription
//
// istanbul ignore next
if (addressSpace._condition_refresh_in_progress) {
// a refresh operation is already in progress....
return StatusCodes.BadRefreshInProgress;
}
addressSpace._condition_refresh_in_progress = true;
const server = context.object.addressSpace.rootFolder.objects.server;
assert(server instanceof UAObject);
const refreshStartEventType = addressSpace.findEventType("RefreshStartEventType");
const refreshEndEventType = addressSpace.findEventType("RefreshEndEventType");
assert(refreshStartEventType instanceof UAObjectType);
assert(refreshEndEventType instanceof UAObjectType);
server.raiseEvent(refreshStartEventType, {});
// todo : resend retained conditions
function _perform_condition_refresh(addressSpace, inputArguments, context) {
// --- possible StatusCodes:
//
// Bad_SubscriptionIdInvalid See Part 4 for the description of this result code
// Bad_RefreshInProgress See Table 74 for the description of this result code
// Bad_UserAccessDenied The Method was not called in the context of the Session
// that owns the Subscription
//
// istanbul ignore next
if (addressSpace._condition_refresh_in_progress) {
// a refresh operation is already in progress....
return StatusCodes.BadRefreshInProgress;
}
addressSpace._condition_refresh_in_progress = true;
const server = context.object.addressSpace.rootFolder.objects.server;
assert(server instanceof UAObject);
const refreshStartEventType = addressSpace.findEventType("RefreshStartEventType");
const refreshEndEventType = addressSpace.findEventType("RefreshEndEventType");
assert(refreshStartEventType instanceof UAObjectType);
assert(refreshEndEventType instanceof UAObjectType);
server.raiseEvent(refreshStartEventType, {});
// todo : resend retained conditions