
package org.osc.core.broker.service;

import javax.persistence.EntityManager;

import org.osc.core.broker.service.api.CheckNetworkSettingsServiceApi;
import org.osc.core.broker.service.persistence.DistributedApplianceInstanceEntityMgr;
import org.osc.core.broker.service.request.Request;
import org.osc.core.broker.service.response.CheckNetworkSettingResponse;
import org.osgi.service.component.annotations.Component;

@Component
public class CheckNetworkSettingsService extends ServiceDispatcher<Request, CheckNetworkSettingResponse>
        implements CheckNetworkSettingsServiceApi {

    @Override
    public CheckNetworkSettingResponse exec(Request request, EntityManager em) throws Exception {
        CheckNetworkSettingResponse response = new CheckNetworkSettingResponse();
        response.setHasDeployedInstances(DistributedApplianceInstanceEntityMgr.doesDAIExist(em));
        return response;
    }

}
