Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
1 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
package gov.va.med.ewv.model.response;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import org.springframework.web.multipart.MultipartFile;
import gov.va.med.domain.ewv.EwvReferences;
/**
* This is the Response object that is used to return back the Result of
* calling the File Upload "api/v1/fileupload" RESTful Web Service. The
* actual RESTFul Web Service will place in its Response Body a JSON formatted
* version of an instance of this class.
*
* @author
DNS
*
*/
public class EwdPdfReferencesFileUploadResponse {
/**
* Contains the list of Successful File Uploads. Success in this context means that
* the File Upload record's file contents were successfully uploaded into the server
* and its PDF Reference information was successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*/
private List<HashMap<String, String>> successfulFileUploadsList = new ArrayList<HashMap<String, String>>();
/**
* Contains the list of EwvReferences objects that were inserted successfully into the
* database and whose file contents were successfully uploaded into the server. Each
* EwvReferences object refers to the PDF Reference of the file that was successfully
* uploaded and contains the information for that PDF Reference that was successfully
* inserted into the database.
*
* There is a one-to-one element correspondence between the "successfulFileUploadsList" and the
* "ewvReferencesList". For each successful File Upload in the "successfulFileUploadsList", there
* is a corresponding EwvReferences object in the "ewvReferencesList". So, the n'th element in the
* "successfulFileUploadsList" corresponds to the n'th element in the "ewvReferencesList". The n'th
* successful File Upload mentioned in the "successfulFileUploadsList" successfully had the
* corresponding PDF Reference information in the n'th element of the "ewvReferencesList"
* inserted successfully into the database. This would even include the unique GUID that was generated
* for the EwvReferences record that was generated into the database.
*/
private List<EwvReferences> ewvReferencesList = new ArrayList<EwvReferences>();
/**
* Contains the list of Un-Successful (i.e,, Failed) File Uploads. Failure in this context means that
* the File Upload record's file contents were NOT successfully uploaded into the server
* and/or its PDF Reference information was NOT successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*/
private List<HashMap<String, String>> unSuccessfulFileUploadsList = new ArrayList<HashMap<String, String>>();
/**
* Contains the list of Error Messages describing the reason why each failed File Upload in the
* "unSuccessfulFileUploadsList" failed.
*
* There is a one-to-one element correspondence between the "unSuccessfulFileUploadsList" and the
* "errorMessagesList". For each un-successful File Upload in the "unSuccessfulFileUploadsList", there
* is a corresponding Error Message string in the "errorMessagesList". So, the n'th element in the
* "unSuccessfulFileUploadsList" corresponds to the n'th element in the "errorMessagesList" describing
* why the file upload mentioned in the n'th element of the "unSuccessfulFileUploadsList" failed.
*/
private List<String> errorMessagesList = new ArrayList<String>();
/**
* Constructor.
*/
public EwdPdfReferencesFileUploadResponse() { }
/**
* Gets the list of Successful File Uploads. Success in this context means that
* the File Upload record's file contents were successfully uploaded into the server
* and its PDF Reference information was successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*
* @return - the list of Successful File Uploads
*/
public List<HashMap<String, String>> getSuccessfulFileUploadsList() {
return successfulFileUploadsList;
}
/**
* Gets the list of EwvReferences objects that were inserted successfully into the
* database and whose file contents were successfully uploaded into the server. Each
* EwvReferences object refers to the PDF Reference of the file that was successfully
* uploaded and contains the information for that PDF Reference that was successfully
* inserted into the database.
*
* @return - the list of EwvReferences objects that were inserted successfully into the
* database and whose file contents were successfully loaded into the server
*/
public List<EwvReferences> getEwvReferencesList() {
return ewvReferencesList;
}
/**
* Gets . Failure in this context means that
* the File Upload record's file contents were NOT successfully uploaded into the server
* and/or its PDF Reference information was NOT successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*
* @return - the list of Un-Successful (i.e,, Failed) File Uploads
*/
public List<HashMap<String, String>> getUnSuccessfulFileUploadsList() {
return unSuccessfulFileUploadsList;
}
/**
* Gets the list of Error Messages describing the reason why each failed File Upload in the
* "unSuccessfulFileUploadsList" failed.
*
* @return - the list of Error Messages describing the reason why each failed File Upload in the
* "unSuccessfulFileUploadsList" failed.
*/
public List<String> getErrorMessagesList() {
return errorMessagesList;
}
/**
* Sets list of Successful File Uploads. Success in this context means that
* the File Upload record's file contents were successfully uploaded into the server
* and its PDF Reference information was successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*
* @param successfulFileUploadsList - the list of Successful File Uploads
*/
public void setSuccessfulFileUploadsList(List<HashMap<String, String>> successfulFileUploadsList) {
if (successfulFileUploadsList != null) {
this.successfulFileUploadsList = successfulFileUploadsList;
}
}
/**
* Sets the list of EwvReferences objects that were inserted successfully into the
* database and whose file contents were successfully uploaded into the server. Each
* EwvReferences object refers to the PDF Reference of the file that was successfully
* uploaded and contains the information for that PDF Reference that was successfully
* inserted into the database.
*
* @param ewvReferencesList - the list of EwvReferences objects
*/
public void setEwvReferencesList(List <EwvReferences> ewvReferencesList) {
if (ewvReferencesList != null) {
this.ewvReferencesList = ewvReferencesList;
}
}
/**
* Sets the list of Un-Successful (i.e,, Failed) File Uploads. Failure in this context means that
* the File Upload record's file contents were NOT successfully uploaded into the server
* and/or its PDF Reference information was NOT successfully inserted into the database.
*
* Each File Upload record is a HashMap object that contains the following
* properties/values:
* 1) "name"
* 2) "originalName"
* 3) "contentType"
* 4) "empty"
* 5) "size"
*
* @param unSuccessfulFileUploadsList - the list of Un-Successful (i.e,, Failed) File Uploads
*/
public void setUnSuccessfulFileUploadsList(List<HashMap<String, String>> unSuccessfulFileUploadsList) {
if (unSuccessfulFileUploadsList != null) {
this.unSuccessfulFileUploadsList = unSuccessfulFileUploadsList;
}
}
/**
* Sets the list of Error Messages describing the reason why each failed File Upload in the
* "unSuccessfulFileUploadsList" failed.
*
* @param errorMessagesList - list of Error Messages describing the reason why each failed
* File Upload in the "unSuccessfulFileUploadsList" failed
*/
public void setErrorMessagesList(List<String> errorMessagesList) {
if (errorMessagesList != null) {
this.errorMessagesList = errorMessagesList;
}
}
/**
* Inserts a File Upload record information into the "successfulFileUploadsList"
* whose File Upload was successful.
*
* @param multipartFile - the File Upload information to insert; none inserted if this
* input parameter is NULL
*/
public void addSuccessfulFileUpload(MultipartFile multipartFile) {
if (multipartFile != null) {
HashMap<String, String> aMultipartFile = new HashMap<String, String>();
aMultipartFile.put("name", multipartFile.getName());
aMultipartFile.put("originalName", multipartFile.getOriginalFilename());
aMultipartFile.put("contentType", multipartFile.getContentType());
aMultipartFile.put("empty", Boolean.toString(multipartFile.isEmpty()));
aMultipartFile.put("size", Long.toString(multipartFile.getSize()));
successfulFileUploadsList.add(aMultipartFile);
}
}
/**
* Inserts an EwvReference object into the "ewvReferencesList" that was successfully
* inserted into the database and whose File Upload was successful. Each
* EwvReferences object refers to the PDF Reference of the file that was successfully
* uploaded and contains the information for that PDF Reference that was successfully
* inserted into the database.
*
* @param ewvReferences - the EwvReference object to insert; none inserted if this
* input parameter is NULL
*/
public void addEwvReferences(EwvReferences ewvReferences) {
if (ewvReferences != null) {
ewvReferencesList.add(ewvReferences);
}
}
/**
* Inserts a File Upload record information into the "unSuccessfulFileUploadsList"
* whose File Upload was NOT successful.
*
* @param multipartFile - the File Upload information to insert; none inserted if this
* input parameter is NULL
*/
public void addUnSuccessfulFileUploadsList(MultipartFile multipartFile) {
if (multipartFile != null) {
HashMap<String, String> aMultipartFile = new HashMap<String, String>();
aMultipartFile.put("name", multipartFile.getName());
aMultipartFile.put("originalName", multipartFile.getOriginalFilename());
aMultipartFile.put("contentType", multipartFile.getContentType());
aMultipartFile.put("empty", Boolean.toString(multipartFile.isEmpty()));
aMultipartFile.put("size", Long.toString(multipartFile.getSize()));
unSuccessfulFileUploadsList.add(aMultipartFile);
}
}
/**
* Inserts an Error Message string into the "errorMessagesList" describing the reason
* why a failed File Upload in the "unSuccessfulFileUploadsList" failed.
*
* @param errorMessage - the Error Message string to insert; none inserted if this
* input parameter is NULL or is an empty string
*/
public void addErrorMessage(String errorMessage) {
if (errorMessage != null && !errorMessage.isEmpty()) {
errorMessagesList.add(errorMessage);
}
}
}