source: other-projects/FileTransfer-WebSocketPair/GXTWebsocketClient/src/com/example/SocketTest/client/RequestObjectBuilder.java@ 31449

Last change on this file since 31449 was 31449, checked in by davidb, 7 years ago

Adding three project folders for Nathan Kelly's 2016/2017 summer project, experimenting with Websockets for File Transfer with GWT and Sencha GXT

File size: 1.3 KB
Line 
1package com.example.SocketTest.client;
2
3import java.util.ArrayList;
4
5import org.nbk4.gwt.action.client.ActionProperty;
6import org.nbk4.gwt.action.client.ActionRequest;
7import org.nbk4.gwt.action.client.ActionTypeProperty;
8import org.nbk4.gwt.action.client.RequestType;
9
10@SuppressWarnings("serial")
11public 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}
Note: See TracBrowser for help on using the repository browser.