<commit_before>package org.zstack.mediator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.zstack.core.cloudbus.ReplyMessagePreSendingExtensionPoint;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.header.message.Message;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.vm.VmNicInventory;
import org.zstack.network.service.eip.APIGetEipAttachableVmNicsReply;
import org.zstack.network.service.portforwarding.APIGetPortForwardingAttachableVmNicsReply;

import javax.persistence.TypedQuery;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 */
public class EipPortForwardingAttachableMarshaler implements ReplyMessagePreSendingExtensionPoint {
    @Autowired
    private DatabaseFacade dbf;

    @Override
    public List<Class> getReplyMessageClassForPreSendingExtensionPoint() {
        List<Class> clz = new ArrayList<Class>();
        clz.add(APIGetEipAttachableVmNicsReply.class);
        clz.add(APIGetPortForwardingAttachableVmNicsReply.class);
        return clz;
    }

    @Override
    public void marshalReplyMessageBeforeSending(Message replyOrEvent, NeedReplyMessage msg) {
        if (replyOrEvent instanceof APIGetEipAttachableVmNicsReply) {
            marshal((APIGetEipAttachableVmNicsReply) replyOrEvent);
        } else if (replyOrEvent instanceof APIGetPortForwardingAttachableVmNicsReply) {
            marshal((APIGetPortForwardingAttachableVmNicsReply) replyOrEvent);
        }
    }

    @Transactional(readOnly = true)<commit_msg>Remove eip portforwarding attachable marshaler<commit_after>package org.zstack.mediator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.zstack.core.cloudbus.ReplyMessagePreSendingExtensionPoint;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.header.message.Message;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.vm.VmNicInventory;
import org.zstack.network.service.eip.APIGetEipAttachableVmNicsReply;
import org.zstack.network.service.portforwarding.APIGetPortForwardingAttachableVmNicsReply;

import javax.persistence.TypedQuery;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 */
public class EipPortForwardingAttachableMarshaler implements ReplyMessagePreSendingExtensionPoint {
    @Autowired
    private DatabaseFacade dbf;

    @Override
    public List<Class> getReplyMessageClassForPreSendingExtensionPoint() {
        List<Class> clz = new ArrayList<Class>();
        return clz;
    }

    @Override
    public void marshalReplyMessageBeforeSending(Message replyOrEvent, NeedReplyMessage msg) {
    }

    @Transactional(readOnly = true)
{'fraction_non_alphanumeric': 0.08044770898915705, 'fraction_numerical': 0.0, 'mean_word_length': 5.470588235294118, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6350789', 'n_tokens_mistral': 851, 'n_tokens_neox': 859, 'n_words': 130}