001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.stream;
034:
035: import com.flexive.shared.FxContext;
036:
037: import java.io.Serializable;
038:
039: /**
040: * Payload for binary downloads
041: *
042: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
043: */
044: public class BinaryDownloadPayload implements Serializable {
045: private static final long serialVersionUID = -54895840376576824L;
046:
047: private long id;
048: private int version;
049: private int quality;
050: private int division;
051: private int size;
052:
053: private boolean serverError;
054: private String errorMessage;
055: private String mimeType;
056: private int datasize;
057:
058: public BinaryDownloadPayload(long id, int version, int quality,
059: int size) {
060: this .id = id;
061: this .version = version;
062: this .quality = quality;
063: this .size = size;
064: this .division = FxContext.get().getDivisionId();
065: }
066:
067: public BinaryDownloadPayload(long id, int version, int quality) {
068: this (id, version, quality, 0);
069: }
070:
071: public BinaryDownloadPayload(boolean serverError,
072: String errorMessage) {
073: this .serverError = serverError;
074: this .errorMessage = errorMessage;
075: }
076:
077: public BinaryDownloadPayload(String mimeType, int datasize) {
078: this .serverError = false;
079: this .mimeType = mimeType;
080: this .datasize = datasize;
081: }
082:
083: public long getId() {
084: return id;
085: }
086:
087: public int getVersion() {
088: return version;
089: }
090:
091: public int getQuality() {
092: return quality;
093: }
094:
095: public int getSize() {
096: return size;
097: }
098:
099: public int getDivision() {
100: return division;
101: }
102:
103: public boolean isServerError() {
104: return serverError;
105: }
106:
107: public String getErrorMessage() {
108: return errorMessage;
109: }
110:
111: public String getMimeType() {
112: return mimeType;
113: }
114:
115: public int getDatasize() {
116: return datasize;
117: }
118: }
|