/*-
 * ~~~~~~licensing~~~~~~
 * system-api
 * ==========
 * Copyright (C) 2020 - 2021 EmDev LLC
 * ==========
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ~~~~~~/licensing~~~~~~
 */
package ru.entaxy.esb.system.jpa;

import ru.entaxy.esb.system.jpa.entity.ExportAllowed;
import ru.entaxy.esb.system.jpa.entity.System;
import ru.entaxy.esb.system.management.bundle.jpa.entity.BundleEntity;

import java.util.Date;
import java.util.List;
import java.util.Optional;

/**
 * Simple interface systemRegistry service.
 */
public interface SystemService {

    List<System> getSystemList();

    List<System> getFullSystemListByOriginIsEmpty();

    List<System> getFullSystemListByPermissionBySubject(String uuid);

    List<System> getFullSystemListByPermissionByObject(String uuid);

    List<System> getFullSystemListByNotOrigin();

    System get(long id);

    System getByUuid(String uuid);

    System getByName(String name);

    Optional<System> fetch(long id);

    Optional<System> fetchByUuid(String uuid);

    Optional<System> fetchByName(String name);

    System create(System system);

    System setBundleEntity(System system, BundleEntity bundleEntity);

    System saveOrUpdate(System system);

    ExportAllowed addExportAllowed(System system, String exportAllowed);

    System saveOrUpdate(String systemName, String uuid, String description, Date createDate, Date editDate,
                        String createdBy, String editedBy, String version, String type);

    void remove(long id);

    void remove(System system);

    void removeExportAllowed(System system, String esbName);

}
