protected void HandleResolverChanged(Guid id, CreateScopeResolverInformation resolverInfo) { TScope scope = GetScopeById(id); var resolver = _resolverManager.InitializeResolver(resolverInfo); scope.SetResolver(resolver); }
public void CheckIfScopeResolverIsValid(Guid scopeId, CreateScopeResolverInformation resolverInformation) { CheckIfScopeExistsById(scopeId); if (resolverInformation == null) { throw new ScopeException(DHCPv4ScopeExceptionReasons.NoInput); } if (_resolverManager.IsResolverInformationValid(resolverInformation) == false) { throw new ScopeException(DHCPv4ScopeExceptionReasons.InvalidResolver); } return; }
public Boolean CheckIfScopeResolverHasChanged(Guid scopeId, CreateScopeResolverInformation resolverInformation) { CheckIfScopeExistsById(scopeId); var scope = GetScopeById(scopeId); var resolver = _resolverManager.InitializeResolver(resolverInformation); if (scope.Resolver.GetType() != resolver.GetType()) { return(true); } var existingValues = scope.Resolver.GetValues(); var newValues = resolver.GetValues(); if (existingValues.Count != newValues.Count) { return(true); } var uniqueKeys = existingValues.Keys.Union(newValues.Keys).Distinct(); if (uniqueKeys.Count() != existingValues.Keys.Count) { return(true); } foreach (var item in existingValues) { var newValue = newValues[item.Key]; if (newValue != item.Value) { return(true); } } return(false); }
public IEnumerable <CreateScopeResolverInformation> ExtractResolverCreateModels(CreateScopeResolverInformation item, ISerializer serializer) { String rawvalue = item.PropertiesAndValues[_innerResolverName]; IEnumerable <CreateScopeResolverInformation> result = serializer.Deserialze <IEnumerable <CreateScopeResolverInformation> >(rawvalue); return(result); }
public abstract Boolean UpdateScopeResolver(Guid scopeId, CreateScopeResolverInformation resolverInformation);