1 | package com.example.SocketTest.client;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 |
|
---|
5 | import org.nbk4.gwt.action.client.ActionProperty;
|
---|
6 | import org.nbk4.gwt.action.client.ActionRequest;
|
---|
7 | import org.nbk4.gwt.action.client.ActionTypeProperty;
|
---|
8 | import org.nbk4.gwt.action.client.RequestType;
|
---|
9 |
|
---|
10 | @SuppressWarnings("serial")
|
---|
11 | public class RequestObjectBuilder extends ActionRequest {
|
---|
12 | public static ActionRequest GenerateProcessFileRequest(int chunkSize, int totalSize, String location) {
|
---|
13 | ArrayList<ActionProperty> actionProperties = new ArrayList<ActionProperty>();
|
---|
14 |
|
---|
15 | actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_LOCATION_STRING, 0, location));
|
---|
16 | actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_CHUNK_SIZE, 1, Integer.toString(chunkSize)));
|
---|
17 | actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_COPY_LIMIT, 2, Integer.toString(totalSize)));
|
---|
18 |
|
---|
19 | ActionRequest AR = new ActionRequest(RequestType.PROCESS_FILE, -1, actionProperties);
|
---|
20 |
|
---|
21 | return AR;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public static ActionRequest GenerateResponseRequest(int selected, long ID) {
|
---|
25 | ArrayList<ActionProperty> actionProperties = new ArrayList<ActionProperty>();
|
---|
26 |
|
---|
27 | actionProperties.add(new ActionProperty(ActionTypeProperty.BUTTON_PRESS, selected, ""));
|
---|
28 |
|
---|
29 | ActionRequest AR = new ActionRequest(RequestType.RESPONSE_ALERT_WINDOW, ID, actionProperties);
|
---|
30 |
|
---|
31 | return AR;
|
---|
32 | }
|
---|
33 | }
|
---|