// ****************************************************************
@Override
public long put(long priority, int delaySeconds, int timeToRun, byte[] data) {
if (data == null) {
throw new BeanstalkException("null data");
}
if (priority > MAX_PRIORITY) {
throw new BeanstalkException("invalid priority");
}
long jobId = -1;
Request request = new Request("put " + priority + " " + delaySeconds + " " + timeToRun + " " + data.length,
new String[] { "INSERTED", "BURIED" }, new String[] { "JOB_TOO_BIG" }, data, ExpectedResponse.None);
Response response = getProtocolHandler().processRequest(request);
if (response != null && response.getStatus().equals("JOB_TOO_BIG")) {
BeanstalkException be = new BeanstalkException(response.getStatus());
throw be;
}
if (response != null && response.isMatchOk()) {
jobId = Long.parseLong(response.getReponse());
}