Revision ee77dbf1 src/gr/grnet/pithos/web/client/rest/HeadRequest.java
b/src/gr/grnet/pithos/web/client/rest/HeadRequest.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
package gr.grnet.pithos.web.client.rest; |
37 | 37 |
|
38 |
import gr.grnet.pithos.web.client.Pithos; |
|
38 | 39 |
import gr.grnet.pithos.web.client.Resource; |
39 | 40 |
|
40 | 41 |
import java.util.HashMap; |
... | ... | |
51 | 52 |
|
52 | 53 |
protected static final int MAX_RETRIES = 3; |
53 | 54 |
|
55 |
private final Pithos app; |
|
56 |
|
|
54 | 57 |
protected int retries = 0; |
55 | 58 |
|
56 | 59 |
protected Class<T> aClass; |
... | ... | |
73 | 76 |
|
74 | 77 |
public abstract void onError(Throwable t); |
75 | 78 |
|
76 |
public HeadRequest(Class<T> aClass, String api, String owner, String path, int okCode, T result) { |
|
79 |
public HeadRequest(Pithos app, Class<T> aClass, String api, String owner, String path, int okCode, T result) { |
|
80 |
this.app = app; |
|
77 | 81 |
this.aClass = aClass; |
78 | 82 |
this.api = api; |
79 | 83 |
this.owner = owner; |
... | ... | |
82 | 86 |
this.result = result; |
83 | 87 |
} |
84 | 88 |
|
85 |
public HeadRequest(Class<T> aClass, String api, String owner, String path) { |
|
86 |
this(aClass, api, owner, path, Response.SC_NO_CONTENT, null); |
|
89 |
public HeadRequest(Pithos app, Class<T> aClass, String api, String owner, String path) {
|
|
90 |
this(app, aClass, api, owner, path, Response.SC_NO_CONTENT, null);
|
|
87 | 91 |
} |
88 | 92 |
|
89 |
public HeadRequest(Class<T> aClass, String api, String owner, String path, T result) { |
|
90 |
this(aClass, api, owner, path, Response.SC_NO_CONTENT, result); |
|
93 |
public HeadRequest(Pithos app, Class<T> aClass, String api, String owner, String path, T result) {
|
|
94 |
this(app, aClass, api, owner, path, Response.SC_NO_CONTENT, result);
|
|
91 | 95 |
} |
92 | 96 |
|
93 | 97 |
@Override |
... | ... | |
109 | 113 |
|
110 | 114 |
@Override |
111 | 115 |
public T deserialize(Response response) { |
112 |
return Resource.createFromResponse(aClass, owner, response, result); |
|
116 |
return Resource.createFromResponse(app, aClass, owner, response, result);
|
|
113 | 117 |
} |
114 | 118 |
|
115 | 119 |
@Override |
Also available in: Unified diff