/*******************************************************************************
 * Copyright (c) 2024-2025 R3944Realms. All rights reserved.
 * <p>
 * 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
 * <p>
 *     http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * 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.
 ******************************************************************************/

package com.r3944realms.dg_lab.manager;

import com.r3944realms.dg_lab.api.manager.IDGLabManager;
import com.r3944realms.dg_lab.api.manager.Status;
import com.r3944realms.dg_lab.websocket.PowerBoxWSServer;
import com.r3944realms.dg_lab.api.websocket.message.Message;
import com.r3944realms.dg_lab.websocket.sharedData.ServerPowerBoxSharedData;

/**
 * The type Dgpb server manager.
 */
public class DGPBServerManager implements IDGLabManager {
    /**
     * The Server.
     */
    protected final PowerBoxWSServer server;

    /**
     * Instantiates a new Dgpb server manager.
     *
     * @param server the server
     */
    public DGPBServerManager(PowerBoxWSServer server) {
        this.server = server;
    }
    @Override
    public void start() {
        server.start();
    }

    @Override
    public void stop() {
        server.stop();
    }

    @Override
    public Status getStatus() {
        return server.getStatus();
    }

    @Override
    public void setStatus(Status status) {
        server.setStatus(status);
    }

    @Override
    public ServerPowerBoxSharedData getSharedData() {
        return server.getSharedData();
    }

    /**
     * Send.
     *
     * @param connectId the connect id
     * @param message   the message
     */
    public void send(String connectId, Message message) {
        server.send(connectId, message);
    }

    /**
     * Sets port.
     *
     * @param port the port
     */
    public void setPort(int port) {
        server.setPort(port);
    }
}
