summaryrefslogtreecommitdiff
path: root/slice/IcePatch2/FileServer.ice
blob: b5f8af414ad39a8f54c28187cb507bd4a9d368a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// **********************************************************************
//
// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#pragma once

[["cpp:header-ext:h", "objc:header-dir:objc"]]
[["cpp:include:IcePatch2/Config.h"]]

#include <IcePatch2/FileInfo.ice>

/**
 *
 * IcePatch can be used to update file hiearchies in a simple and
 * efficient manner. Checksums ensure file integrity, and data is
 * compressed before download.
 *
 **/
["objc:prefix:ICEPATCH2"]
module IcePatch2
{

/**
 *
 * A sequence of byte sequences. Each element is the checksum for a
 * partition.
 *
 **/
sequence<Ice::ByteSeq> ByteSeqSeq;

/**
 *
 * The <tt>partition</tt> argument for
 * {@link FileServer#getFileInfoSeq} was not in the range 0-255.
 *
 **/
exception PartitionOutOfRangeException
{
};

/**
 *
 * This exception is raised if {@link FileServer#getFileCompressed} cannot read the
 * contents of a file.
 *
 **/
exception FileAccessException
{
    /**
     *
     * An explanation of the reason for the failure.
     *
     **/
    string reason;
};

/**
 *
 * This exception is raised if {@link FileServer#getFileCompressed} or
 * {@link FileServer#getFileInfoSeq} try to operate in files with size
 * large than 2.1 GB, these operations does not support working with
 * large files instead {@link FileServer#getLargeFileCompressed} and 
 * {@link FileServer#getLargeFileInfoSeq} must be used.
 *
 **/
exception FileSizeRangeException extends FileAccessException
{
};

/**
 *
 * The interface that provides access to files.
 *
 **/
interface FileServer
{
    /**
     *
     * Return the {@link FileInfoSeq} for the specified partition. If the
     * partion number is out of range, the operation throws
     * 
     * <p class="Deprecated"> This operation is deprecated, and only keep for
     * compativility with old Ice clients (older than version 3.6).
     *
     * {@link PartitionOutOfRangException}.
     *
     * @param partition The partition number in the range 0-255.
     *
     * @return A sequence containing the {@link FileInfo} structures for
     * files in the specified partition.
     *
     **/
    ["deprecate:getFileInfoSeq() is deprecated, use getLargeFileInfoSeq() instead.",
     "nonmutating", "cpp:const"] idempotent FileInfoSeq getFileInfoSeq(int partition)
        throws PartitionOutOfRangeException, FileSizeRangeException;
        
    /**
     *
     * Return the {@link FileInfoSeq} for the specified partition. If the
     * partion number is out of range, the operation throws
     * {@link PartitionOutOfRangException}.
     *
     * @param partition The partition number in the range 0-255.
     *
     * @return A sequence containing the {@link FileInfo} structures for
     * files in the specified partition.
     *
     **/
    ["nonmutating", "cpp:const"] idempotent LargeFileInfoSeq getLargeFileInfoSeq(int partition)
        throws PartitionOutOfRangeException;

    /**
     *
     * Return the checksums for all partitions.
     *
     * @return A sequence containing 256 checksums. Partitions with a
     * checksum that differs from the previous checksum for the same
     * partition contain updated files. Partitions with a checksum
     * that is identical to the previous checksum do not contain
     * updated files.
     *
     **/
    ["nonmutating", "cpp:const"] idempotent ByteSeqSeq getChecksumSeq();

    /**
     *
     * Return the master checksum for all partitions. If this checksum is the same
     * as for a previous run, the entire file set is up-to-date.
     *
     * @return The master checksum for the file set.
     *
     **/
    ["nonmutating", "cpp:const"] idempotent Ice::ByteSeq getChecksum();

    /**
     *
     * Read the specified file. If the read operation fails, the
     * operation throws {@link FileAccessException}. This operation may only
     * return fewer bytes than requested in case there was an
     * end-of-file condition.
     *
     * <p class="Deprecated"> This operation is deprecated, and only keep for
     * compativility with old Ice clients (older than version 3.6).
     *
     * @param path The pathname (relative to the data directory) for
     * the file to be read.
     *
     * @param pos The file offset at which to begin reading.
     *
     * @param num The number of bytes to be read.
     *
     * @return A sequence containing the compressed file contents.
     *
     **/
    ["deprecate:getFileCompressed() is deprecated, use getLargeFileCompressed() instead.",
     "amd", "nonmutating", "cpp:const", "cpp:array"] 
    idempotent Ice::ByteSeq getFileCompressed(string path, int pos, int num)
        throws FileAccessException, FileSizeRangeException;
        
    /**
     *
     * Read the specified file. If the read operation fails, the
     * operation throws {@link FileAccessException}. This operation may only
     * return fewer bytes than requested in case there was an
     * end-of-file condition.
     *
     * @param path The pathname (relative to the data directory) for
     * the file to be read.
     *
     * @param pos The file offset at which to begin reading.
     *
     * @param num The number of bytes to be read.
     *
     * @return A sequence containing the compressed file contents.
     *
     **/
    ["amd", "nonmutating", "cpp:const", "cpp:array"] 
    idempotent Ice::ByteSeq getLargeFileCompressed(string path, long pos, int num)
        throws FileAccessException;
};

};