001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.so6.core.client;
034:
035: public interface ClientI {
036: public static final String SO6_QUEUE_ID = "so6.queue.id";
037: public static final String SO6_XML_DETECT = "so6.xml.autodetect";
038: public final static String SO6_LOGIN = "so6.user.login";
039: public final static String SO6_PASSWORD = "so6.user.password";
040:
041: /**
042: * Return the last ticket for that queue
043: *
044: * @return the last ticket for that queue
045: * @throws Exception
046: */
047: public long getLastTicket() throws AuthenticationException,
048: UnableToContactServerException, ServerException,
049: ConnectionException, LocalException;
050:
051: /**
052: * Return the path of a patch file that is defined with the specified
053: * timestamp in the global history.
054: *
055: * @param ticket
056: * Timestamp for the global history
057: * @return The file path of that patch
058: *
059: * @throws Exception
060: */
061: public String getPatch(long ticket) throws AuthenticationException,
062: PatchNotFoundException, UnableToContactServerException,
063: ServerException, ConnectionException, LocalException;
064:
065: /**
066: * Return the path of the patch file that is defined with the specified
067: * fromTicket timestamp and go to the toTicket timstamp on the global
068: * history.
069: *
070: * @param fromTicket
071: * Timestamp for the global history (from)
072: * @param toTicket
073: * Timestamp for the global history (to)
074: * @return The file path of that patch
075: *
076: * @throws Exception
077: */
078: public String getPatch(long fromTicket, long toTicket)
079: throws AuthenticationException, PatchNotFoundException,
080: UnableToContactServerException, ServerException,
081: ConnectionException, LocalException;
082:
083: /**
084: * Send patch file to the queue.
085: *
086: * @param ticket
087: * Base patch timestamp
088: * @param lastticket
089: * End patch timestamp
090: * @param patchfile
091: * Path of the new patch file
092: *
093: * @throws Exception
094: */
095: public void sendPatch(long ticket, long lastticket,
096: String patchfile, boolean validate)
097: throws AuthenticationException, InvalideTicketException,
098: UnableToContactServerException, ServerException,
099: ConnectionException, LocalException;
100:
101: /**
102: * List the patch as an array of long. <b>listPatch()[n][3] </b> <br>
103: * For each patch we have a triplet made of {fromTicket, toTicket,
104: * patchSize}
105: *
106: * @return <b>listPatch()[n][3] </b>
107: * @throws Exception
108: */
109: public long[][] listPatch() throws AuthenticationException,
110: UnableToContactServerException, ServerException,
111: ConnectionException, LocalException;
112:
113: /**
114: * Add a binary extention in the queue definition
115: *
116: * @param ext
117: * String that represent the file extention
118: *
119: * @throws Exception
120: */
121: public void addBinExt(String ext) throws AuthenticationException,
122: UnableToContactServerException, ServerException,
123: ConnectionException, LocalException;
124:
125: /**
126: * Remove a binary extention in the queue definition
127: *
128: * @param ext
129: * String that represent the file extention
130: *
131: * @throws Exception
132: */
133: public void removeBinExt(String ext)
134: throws AuthenticationException,
135: UnableToContactServerException, ServerException,
136: ConnectionException, LocalException;
137:
138: /**
139: * Return the concatenation of all binary extention with a space as
140: * separator.
141: *
142: * @return the concatenation of all binary extention with a space as
143: * separator.
144: * @throws Exception
145: */
146: public String getBinExt() throws AuthenticationException,
147: UnableToContactServerException, ServerException,
148: ConnectionException, LocalException;
149: }
|