3.19.4.4.1.1 UpdateDhcpServerDelegate
The UpdateDhcpServerDelegate processing is done when the IpamOperationWithProgressParameter.OperationId is AdminOperationId.EditDhcpServer. The IpamOperationWithProgressParameter instance MUST be of type UpdateDhcpServerParameters.
This operation modifies the server-level properties of a DHCP server instance. In the following processing steps, any time a fault is generated, SetOverallStatus SHOULD be called with the fault details:
If IpamOperationWithProgressParameter is NULL or not of type UpdateDhcpServerParameters, generate an appropriate SOAP fault as specified in section 2.2.2.1. Put IpamOperationWithProgressParameter in a local variable as UpdateDhcpServerParameters.
Validate that UpdateDhcpServerParameters.Server is not NULL. If it is NULL, an appropriate SOAP fault MUST be generated.
The UpdateDhcpServerParameters.Server MUST be validated as per the processing rules listed under ValidateDhcpServer. If the validation does not succeed, an appropriate SOAP fault MUST be generated.
If UpdateDhcpServerParameters.Server is a DhcpServerV4 instance, addressfamily is initialized to InterNetwork. Otherwise the addressfamily is initialized to InterNetworkV6.
If UpdateDhcpServerParameters.Server.ModifiedProperties is empty, there are no properties to update. No further processing is required.
Compute dhcpServerExists to be a flag that indicates whether the DhcpServer information is present in the ADM_DHCPServersTable by performing a lookup in the table based on UpdateDhcpServerParameters.Server.RecordId. If the row is present, dhcpServerExists is assigned TRUE. Otherwise dhcpServerExists is assigned FALSE.
If UpdateDhcpServerParameters.Server.ModifiedProperties contains DnsNameProtectionStatus, DhcpDnsNotRequestingClientsUpdateType, DiscardDnsRecordOnLeaseDeletionStatus, DnsUpdateType, or DnsDisableDynamicPtrUpdates (if it is a DhcpServerV4 instance), perform the following updates to the ADM_DhcpServersTable:
If dhcpServerExists, update the row in ADM_DhcpServersTable for the following fields. If dhcpServerExists is FALSE, insert a new row in ADM_DhcpServersTable with the following fields:
ServerRoleRecordId is assigned UpdateDhcpServerParameters.Server.ServerRoleInfo.RecordId.
Set the following values from UpdateDhcpServerParameters.Server to the row. Based on whether the addressfamily is InterNetwork or InterNetworkV6, the appropriate fields are selected for database update:
DnsUpdateType
DiscardDnsRecordOnLeaseDeletionStatus
DhcpDnsNotRequestingClientsUpdateType
DnsNameProtectionStatus
Assign the record identifier of the newly inserted row to dhcpServer.RecordId for use with subsequent processing.
If UpdateDhcpServerParameters.Server.ModifiedProperties contains AuditLoggingStatus, the audit log setting MUST be updated to the table. Update the AuditLoggingStatus of the UpdateDhcpServerParameters.Server into the table.
If UpdateDhcpServerParameters.Server.ModifiedProperties contains DnsRegistrationCredentialDomainName, DnsRegistrationCredentialUserName, or DnsRegistrationCredentialPassword, the DNS credential user name has to be updated to the table. This consists of the values for fields DnsRegistrationCredentialDomainName and DnsRegistrationCredentialUserName.
If UpdateDhcpServerParameters.Server.ModifiedProperties contains PolicyActivationState, the policy activation status has to be updated to the table. This consists of the value for the field PolicyActivationStatus. Initialize the field with UpdateDhcpServerParameters.Server.PolicyActivationState.
If UpdateDhcpServerParameters.Server.ModifiedProperties contains AllowFilterEnabled or DenyFilterEnabled, the filter state has to be updated to the table. This consists of the values for the fields AllowFilterState and DenyFilterState. Initialize the fields with UpdateDhcpServerParameters.Server.AllowFilterEnabled and UpdateDhcpServerParameters.Server.DenyFilterEnabled.
For each entry in the UserClasses.OperationTracker, the key specifies the operation to be performed and value specifies the DhcpUserClass on which the operation is to be performed:
If Key is CollectionOperations.Add, then add the DhcpUserClass to the DhcpServer.UserClasses row in ADM_DHCPServersTable.
If Key is CollectionOperations.Set, then update the DhcpUserClass to the value already present in DhcpServer.UserClasses row in ADM_DHCPServersTable.
If the Key is CollectionOperations.Delete, then delete the DhcpUserClass specified from the DhcpServer.UserClasses row.
For each entry in the VendorClasses.OperationTracker, the key specifies the operation to be performed and value specifies the DhcpVendorClass on which the operation is to be performed:
If Key is CollectionOperations.Add, then add the DhcpVendorClass to the DhcpServer.VendorClasses row in ADM_DHCPServersTable.
If Key is CollectionOperations.Set, then update the DhcpVendorClass to the value already present in the DhcpServer.VendorClasses row in ADM_DHCPServersTable.
If the Key is CollectionOperations.Delete, then delete the DhcpVendorClass specified from the DhcpServer.VendorClasses row.
For each entry in the OptionDefinitions.OperationTracker, the key specifies the operation to be performed and value specifies the DhcpOptionDefinition on which the operation is to be performed:
If Key is CollectionOperations.Add, then add the DhcpOptionDefinition to the DhcpServer.OptionDefinitions row in ADM_DHCPServersTable.
If Key is CollectionOperations.Update, then update the DhcpOptionDefinition to the value already present in the DhcpServer.OptionDefinitions row in ADM_DHCPServersTable.
If the Key is CollectionOperations.Delete, then delete the DhcpOptionDefinition specified from the DhcpServer.OptionDefinitions row.
For each key value pair in UpdateDhcpServerParameters.Server.Options.OperationTracker, perform the following operations:
If the Key is CollectionOperations.Add or CollectionOperations.Set, add or update the DhcpOption in Value portion of the key value pair into ADM_DhcpOptionsTable as follows:
Delete the row from ADM_DhcpOptionsTable that meets the following criteria (if it already exists):
ServerRecordId is dhcpServer.RecordId
ScopeRecordId is NULL
OptionDefinitionRecordId is DhcpOption.OptionDefinition.RecordID
UserClassRecordId is DhcpOption.UserClass.RecordId
Insert a new row into ADM_DhcpOptionstable with the following values:
ServerRecordId assigned dhcpServer.RecordId.
ScopeRecordId assigned NULL.
OptionDefinitionRecordId assigned DhcpOption.OptionDefinition.RecordId.
UserClassRecordId assigned the value of DhcpOption.UserClass.RecordId.
Values assigned the value of DhcpOption.Values.
OptionOwnerType assigned the value of DhcpOption.OptionOwnerType.
If the Key is CollectionOperations.Delete, delete the DhcpOption from ADM_DhcpOptionsTable by performing a lookup based on the following values:
ServerRecordId is dhcpServer.RecordId.
ScopeRecordId is NULL.
OptionDefinitionRecordId is DhcpOption.OptionDefinition.RecordID.
UserClassRecordId is DhcpOption.UserClass.RecordId.
Call SetOverallStatus with Success and 100 percent completion.