@@ -0,0 +1,1369 @@
+/*%0A * Copyright %C2%A9 2015 John H Uckele. All rights reserved.%0A */%0A%0Apackage io.vivarium.client.task;%0A%0Aimport java.nio.channels.NotYetConnectedException;%0A%0Aimport org.java_websocket.handshake.ServerHandshake;%0A%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0A%0Aimport io.vivarium.client.TaskClient;%0Aimport io.vivarium.net.jobs.Job;%0Aimport io.vivarium.net.messages.CreateJob;%0A%0Apublic class CreateJobTask extends Task%0A%7B%0A    private Job _job;%0A%0A    public CreateJobTask(Job job)%0A    %7B%0A        _job = job;%0A    %7D%0A%0A    @Override%0A    public void onOpen(TaskClient client, ServerHandshake handshakedata)%0A    %7B%0A        try%0A        %7B%0A            CreateJob message = new CreateJob(_job);%0A            client.send(client.getMapper().writeValueAsString(message));%0A        %7D%0A        catch (NotYetConnectedException %7C JsonProcessingException e)%0A        %7B%0A            // TODO Auto-generated catch block%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void onMessage(TaskClient client, String message)%0A    %7B%0A        // No reply expected%0A        // TODO: We should get an ack, and if we don't get the ack we should resend a CreateJob message periodically.%0A    %7D%0A%0A    @Override%0A    public void onClose(TaskClient client, int code, String reason, boolean remote)%0A    %7B%0A    %7D%0A%0A    @Override%0A    public void onError(TaskClient client, Exception ex)%0A    %7B%0A    %7D%0A%7D%0A

Create Job task for TaskClient