package Visual_DVM_2021.Passes.All;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import _VisualDVM.Repository.SubscriberWorkspace.SubscriberWorkspace;
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
public class CheckRemoteWorkspace extends ComponentsRepositoryPass<SubscriberWorkspace> {
    @Override
    protected boolean canStart(Object... args) throws Exception {
        target=null;
        return Global.mainModule.getAccount().CheckRegistered(Log);
    }
    @Override
    protected void ServerAction() throws Exception {
        String email = Global.mainModule.getAccount().email;
        String machineURL = Global.mainModule.getMachine().getURL();
        String login = Global.mainModule.getUser().login;
        Command(new ServerExchangeUnit_2021(ServerCode.CheckURLRegistered,
                email+"\n"+machineURL+"\n"+login));
        target = (SubscriberWorkspace) response.object;
    }
}
