package net.northking.cctp.upperComputer.driver.agent.command;

import net.northking.cctp.upperComputer.driver.agent.command.protocol.AbstractProtocolCommand;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class ActivityManagerServiceShellCommand extends AbstractProtocolCommand<String> {
    private final String[] args;

    public ActivityManagerServiceShellCommand(String... args) {
        this.args = args;
    }

    @Override
    public int getCommandId() {
        return 27;
    }

    @Override
    public void doSend(DataOutput output) throws IOException {
        output.writeInt(args.length);
        for (String arg : args) {
            sendText(output, arg);
        }
    }

    @Override
    public String buildReceive(DataInput input) throws IOException {
        return readText(input);
    }
}
