package net.ripe.db.whois.update.handler.validator.domain;

import com.google.common.collect.Lists;
import net.ripe.db.whois.common.dao.RpslObjectDao;
import net.ripe.db.whois.common.dao.RpslObjectInfo;
import net.ripe.db.whois.common.domain.Ipv4Resource;
import net.ripe.db.whois.common.domain.Ipv6Resource;
import net.ripe.db.whois.common.domain.attrs.Domain;
import net.ripe.db.whois.common.domain.attrs.Inet6numStatus;
import net.ripe.db.whois.common.domain.attrs.InetStatus;
import net.ripe.db.whois.common.domain.attrs.InetnumStatus;
import net.ripe.db.whois.common.iptree.*;
import net.ripe.db.whois.common.rpsl.AttributeType;
import net.ripe.db.whois.common.rpsl.ObjectType;
import net.ripe.db.whois.common.rpsl.RpslObject;
import net.ripe.db.whois.update.domain.Action;
import net.ripe.db.whois.update.domain.PreparedUpdate;
import net.ripe.db.whois.update.domain.UpdateContext;
import net.ripe.db.whois.update.domain.UpdateMessages;
import net.ripe.db.whois.update.handler.validator.BusinessRuleValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class NoDashNotationIfDsRDataValidator implements BusinessRuleValidator {


    @Autowired
    public NoDashNotationIfDsRDataValidator() {
    }

    @Override
    public List<Action> getActions() {
        return Lists.newArrayList(Action.CREATE);
    }

    @Override
    public List<ObjectType> getTypes() {
        return Lists.newArrayList(ObjectType.DOMAIN);
    }

    @Override
    public void validate(final PreparedUpdate update, final UpdateContext updateContext) {
        RpslObject domainObject = update.getUpdatedObject();
        final Domain domain = Domain.parse(domainObject.getKey());

        if(domain.getType() == Domain.Type.INADDR && domainObject.containsAttribute(AttributeType.DS_RDATA) && domain.isDashNotation()) {
            updateContext.addMessage(update, UpdateMessages.noDashNotationIfDsRData());
        }
    }
}

@@ -1271,79 +1271,8 @@
  %7B%0A%0A
-%0A    @Autowired%0A    public NoDashNotationIfDsRDataValidator() %7B%0A    %7D%0A%0A
     

Fix Spring initialization issue : @Autowired requires at least one argument in the constructor