/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type {@link * Protos.Event.Type#MESSAGE MESSAGE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.AgentID#getValue() value} of the {@link * Protos.Event.Message#getAgentId() agentId} to be set on the {@link Protos.Event.Message * Message}. * @param executorId The {@link org.apache.mesos.v1.Protos.ExecutorID#getValue() value} of the * {@link Protos.Event.Message#getExecutorId() executorId} to be set on the {@link * Protos.Event.Message Message}. * @param data The {@link Protos.Event.Message#getData() data} to be set on the {@link * Protos.Event.Message Message}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge * Acknowledge}. */ @NotNull public static Protos.Event message( @NotNull final String agentId, @NotNull final String executorId, @NotNull final ByteString data) { return message( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), data); }
/** * Utility method to more succinctly construct an {@link Protos.Event Event} of type {@link * Protos.Event.Type#UPDATE UPDATE}. * * @param agentId The {@link org.apache.mesos.v1.Protos.TaskStatus#getAgentId() agentId} to be set * on the {@link org.apache.mesos.v1.Protos.TaskStatus TaskStatus}. * @param executorId The {@link org.apache.mesos.v1.Protos.TaskStatus#getExecutorId() executorId} * to be set on the {@link org.apache.mesos.v1.Protos.TaskStatus TaskStatus}. * @param taskId The {@link org.apache.mesos.v1.Protos.TaskStatus#getTaskId() taskId} to be set on * the {@link org.apache.mesos.v1.Protos.TaskStatus TaskStatus}. * @param state The {@link org.apache.mesos.v1.Protos.TaskState TaskState} to be set on the {@link * org.apache.mesos.v1.Protos.TaskStatus TaskStatus}. * @param uuid The {@link org.apache.mesos.v1.Protos.TaskStatus#getUuid() uuid} to be set on the * {@link org.apache.mesos.v1.Protos.TaskStatus TaskStatus}. * @return A {@link Protos.Call Call} with a configured {@link Protos.Call.Acknowledge * Acknowledge}. */ @NotNull public static Protos.Event update( @NotNull final String agentId, @NotNull final String executorId, @NotNull final String taskId, @NotNull final org.apache.mesos.v1.Protos.TaskState state, @Nullable final ByteString uuid) { return update( org.apache.mesos.v1.Protos.AgentID.newBuilder().setValue(agentId).build(), org.apache.mesos.v1.Protos.ExecutorID.newBuilder().setValue(executorId).build(), org.apache.mesos.v1.Protos.TaskID.newBuilder().setValue(taskId).build(), state, uuid); }