com.sendsafely.BasePackage Maven / Gradle / Ivy
package com.sendsafely;
import java.util.Date;
import java.util.List;
import com.sendsafely.enums.PackageState;
import com.sendsafely.enums.PackageStatus;
/**
* A Java Bean containing information about a package.
* Only the Getters should be used from this object, since the server will populate the object.
* Updating the setters will not change any state on the server and should be avoided.
*
*/
public class BasePackage {
private String packageId;
private String packageDescriptor;
private String packageCode;
private String serverSecret;
private String keyCode;
private List files;
private List approverList;
private boolean needsApproval;
private PackageState state;
private PackageStatus status;
private int life;
private String rootDirectoryId;
private boolean isWorkspace;
private Date packageTimestamp;
private String packageOwner = "";
private String packageParentId;
private boolean allowReplyAll;
private boolean packageContainsMessage;
/**
* @returnType String
* @description The package ID used to identify a given package
* @return The package ID
*/
public String getPackageId() {
return packageId;
}
/**
* @description Set internally by the API.
* @param packageId
*/
public void setPackageId(String packageId) {
this.packageId = packageId;
}
/**
* @returnType String
* @description Get the server secret. The server secret is unique to a package and is used as part of the encryption key.
* @return The server secret
*/
public String getServerSecret() {
return serverSecret;
}
/**
* @description Set internally by the API.
* @param server secret
*/
public void setServerSecret(String serverSecret) {
this.serverSecret = serverSecret;
}
/**
* @returnType String
* @description The package code is used in the link, sent out to the recipients. It will uniquely identify a package.
* @return the package code
*/
public String getPackageCode() {
return packageCode;
}
/**
* @description Set internally by the API.
* @param packageCode
*/
public void setPackageCode(String packageCode) {
this.packageCode = packageCode;
}
/**
* @returnType String
* @description The key code is generated by the Java API when a new package is created. It must be passed into the API when a new file is uploaded and when the package is finalized. The key code is unique for every package.
* @return
*/
public String getKeyCode() {
return this.keyCode;
}
/**
* @description Set internally by the API.
* @param keyCode
*/
public void setKeyCode(String keyCode) {
this.keyCode = keyCode;
}
/**
* @description Get all files that are currently associated with the package
* @returnType List
* @return A list of Files.
*/
public List getFiles() {
return files;
}
/**
* @description Set internally by the API.
* @param files
*/
public void setFiles(List files) {
this.files = files;
}
/**
* @description Returns a list of all potential approvers for the package.
* @returnType List
* @return A list of string type approvers.
*/
public List getApproverList() {
return approverList;
}
/**
* @description Set internally by the API.
* @param approverList
*/
public void setApproverList(List approverList) {
this.approverList = approverList;
}
/**
* @description Returns true if the package needs approval, false otherwise.
* @returnType boolean
* @return A boolean representing that the package needs approval.
*/
public boolean getNeedsApproval() {
return needsApproval;
}
/**
* @description Set internally by the API.
* @param needsApproval
*/
public void setNeedsApproval(boolean needsApproval) {
this.needsApproval = needsApproval;
}
/**
* @description Returns the current state of the package.
* @returnType PackageState
* @return The package state.
*/
public PackageState getState() {
return state;
}
/**
* @description Set internally by the API.
* @param state
*/
public void setState(PackageState state) {
this.state = state;
}
/**
* @description Returns the current state of the package.
* @returnType PackageStatus
* @return The package status.
*/
public PackageStatus getStatus() {
return status;
}
/**
* @description Set internally by the API.
* @param status
*/
public void setStatus(PackageStatus status) {
this.status = status;
}
/**
* @description Get the number of days the final package will be available for before it expires.
* @returnType int
* @return the int representing the package life.
*/
public int getLife() {
return life;
}
/**
* @description Set internally by the API.
* @param life
*/
public void setLife(int life) {
this.life = life;
}
/**
* @returnType String
* @return
*/
public String getRootDirectoryId() {
return rootDirectoryId;
}
public void setRootDirectoryId(String rootDirectoryId) {
this.rootDirectoryId = rootDirectoryId;
}
/**
* @returnType String
* @return
*/
public String getPackageDescriptor() {
return packageDescriptor;
}
public void setPackageDescriptor(String packageDescriptor) {
this.packageDescriptor = packageDescriptor;
}
/**
* @returnType boolean
* @return
*/
public boolean getIsWorkspace() {
return isWorkspace;
}
public void setIsWorkspace(boolean isWorkspace) {
this.isWorkspace = isWorkspace;
}
/**
* @returnType Date
* @return
*/
public Date getPackageTimestamp() {
return packageTimestamp;
}
public void setPackageTimestamp(Date packageTimestamp) {
this.packageTimestamp = packageTimestamp;
}
/**
* @returnType String
* @return
*/
public String getPackageOwner() {
return packageOwner;
}
public void setPackageOwner(String packageOwner) {
if(packageOwner == null){
this.packageOwner = "";
}else{
this.packageOwner = packageOwner;
}
}
public String getPackageParentId() {
return packageParentId;
}
public void setPackageParentId(String packageParentId) {
this.packageParentId = packageParentId;
}
/**
* @description Returns boolean flag if the allowReplyAll flag is set on the package.
* @returnType boolean
* @return Flag representing the value of allow reply all.
*/
public boolean isAllowReplyAll() {
return allowReplyAll;
}
/**
* @description Set internally by the API.
* @param allowReplyAll
*/
public void setAllowReplyAll(boolean allowReplyAll) {
this.allowReplyAll = allowReplyAll;
}
/**
* @description Returns boolean flag indicating if the package contains an encrypted message.
* @returnType boolean
* @return Flag representing if the package contains an encrypted message.
*/
public boolean getPackageContainsMessage() {
return packageContainsMessage;
}
public void setPackageContainsMessage(boolean packageContainsMessage) {
this.packageContainsMessage = packageContainsMessage;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy