package com.example.SocketTest.client; import java.util.ArrayList; import org.nbk4.gwt.action.client.ActionProperty; import org.nbk4.gwt.action.client.ActionRequest; import org.nbk4.gwt.action.client.ActionTypeProperty; import org.nbk4.gwt.action.client.RequestType; @SuppressWarnings("serial") public class RequestObjectBuilder extends ActionRequest { public static ActionRequest GenerateProcessFileRequest(int chunkSize, int totalSize, String location) { ArrayList actionProperties = new ArrayList(); actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_LOCATION_STRING, 0, location)); actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_CHUNK_SIZE, 1, Integer.toString(chunkSize))); actionProperties.add(new ActionProperty(ActionTypeProperty.FILE_COPY_LIMIT, 2, Integer.toString(totalSize))); ActionRequest AR = new ActionRequest(RequestType.PROCESS_FILE, -1, actionProperties); return AR; } public static ActionRequest GenerateResponseRequest(int selected, long ID) { ArrayList actionProperties = new ArrayList(); actionProperties.add(new ActionProperty(ActionTypeProperty.BUTTON_PRESS, selected, "")); ActionRequest AR = new ActionRequest(RequestType.RESPONSE_ALERT_WINDOW, ID, actionProperties); return AR; } }