mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Extract dbus client command handling
This commit is contained in:
parent
d0d3e20713
commit
a7db3a5610
3 changed files with 198 additions and 136 deletions
43
src/main/java/org/asamk/signal/commands/CommandHandler.java
Normal file
43
src/main/java/org/asamk/signal/commands/CommandHandler.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package org.asamk.signal.commands;
|
||||
|
||||
import net.sourceforge.argparse4j.inf.Namespace;
|
||||
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
import org.asamk.signal.manager.MultiAccountManager;
|
||||
import org.asamk.signal.manager.ProvisioningManager;
|
||||
import org.asamk.signal.manager.RegistrationManager;
|
||||
import org.asamk.signal.output.OutputWriter;
|
||||
|
||||
public class CommandHandler {
|
||||
|
||||
final Namespace ns;
|
||||
final OutputWriter outputWriter;
|
||||
|
||||
public CommandHandler(final Namespace ns, final OutputWriter outputWriter) {
|
||||
this.ns = ns;
|
||||
this.outputWriter = outputWriter;
|
||||
}
|
||||
|
||||
public void handleProvisioningCommand(
|
||||
final ProvisioningCommand command, final ProvisioningManager provisioningManager
|
||||
) throws CommandException {
|
||||
command.handleCommand(ns, provisioningManager, outputWriter);
|
||||
}
|
||||
|
||||
public void handleRegistrationCommand(
|
||||
final RegistrationCommand command, final RegistrationManager registrationManager
|
||||
) throws CommandException {
|
||||
command.handleCommand(ns, registrationManager);
|
||||
}
|
||||
|
||||
public void handleLocalCommand(final LocalCommand command, final Manager manager) throws CommandException {
|
||||
command.handleCommand(ns, manager, outputWriter);
|
||||
}
|
||||
|
||||
public void handleMultiLocalCommand(
|
||||
final MultiLocalCommand command, MultiAccountManager multiAccountManager
|
||||
) throws CommandException {
|
||||
command.handleCommand(ns, multiAccountManager, outputWriter);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue