~elambert/gearmanij/gearman_java_library

« back to all changes in this revision

Viewing changes to src/org/gearman/common/GearmanPacket.java

  • Committer: Eric Lambert
  • Date: 2009-07-07 02:18:15 UTC
  • mfrom: (57.1.65 gearmanij-trunk)
  • Revision ID: eric.d.lambert@gmail.com-20090707021815-0xbupi72ubyoa62a
merge from trunk. ReverseWorkerTest has been ignored, it was failing claiming that certain ops were not supported, since there is duplication in the worker code, for the time being will just ignore this issue, will resolve once the worker code has been straightened out

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2009 by Eric Lambert <Eric.Lambert@sun.com>
 
3
 * Use and distribution licensed under the
 
4
 * GNU Lesser General Public License (LGPL) version 2.1.
 
5
 * See the COPYING file in the parent directory for full text.
 
6
 */
 
7
package org.gearman.common;
 
8
 
 
9
/**
 
10
 * A <tt>GearmanJobEvent</tt> represents an event that occurs in either
 
11
 * the submission of job or the execution of a job.
 
12
 *
 
13
 */
 
14
public interface GearmanPacket {
 
15
 
 
16
    public static enum DataComponentName {
 
17
        FUNCTION_NAME,
 
18
        UNIQUE_ID,
 
19
        MINUTE,
 
20
        HOUR,
 
21
        DAY_OF_MONTH,
 
22
        MONTH,
 
23
        DAY_OF_WEEK,
 
24
        EPOCH,
 
25
        JOB_HANDLE,
 
26
        OPTION,
 
27
        KNOWN_STATUS,
 
28
        RUNNING_STATUS,
 
29
        NUMERATOR,
 
30
        DENOMINATOR,
 
31
        TIME_OUT,
 
32
        DATA,
 
33
        ERROR_CODE,
 
34
        ERROR_TEXT,
 
35
        CLIENT_ID
 
36
    }
 
37
 
 
38
    /**
 
39
     * Retrieves the event type for this event.
 
40
     *
 
41
     * @return event type.
 
42
     */
 
43
    public PacketType getPacketType();
 
44
 
 
45
    public byte [] toBytes();
 
46
 
 
47
    /**
 
48
     * Retrieves the payload, if any, associated with this event.
 
49
     *
 
50
     * @return payload
 
51
     */
 
52
    public byte [] getData();
 
53
    
 
54
    public byte [] getDataComponentValue( DataComponentName component);
 
55
 
 
56
    public PacketMagic getMagic();
 
57
 
 
58
    public boolean requiresResponse();
 
59
 
 
60
}