KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > cvsclient > response > ResponseServices


1 /*****************************************************************************
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14
15  * The Original Software is the CVS Client Library.
16  * The Initial Developer of the Original Software is Robert Greig.
17  * Portions created by Robert Greig are Copyright (C) 2000.
18  * All Rights Reserved.
19
20  * Contributor(s): Robert Greig.
21  *****************************************************************************/

22 package org.netbeans.lib.cvsclient.response;
23
24 import java.io.*;
25 import java.util.*;
26
27 import org.netbeans.lib.cvsclient.admin.*;
28 import org.netbeans.lib.cvsclient.command.GlobalOptions;
29 import org.netbeans.lib.cvsclient.event.*;
30 import org.netbeans.lib.cvsclient.file.*;
31 import org.netbeans.lib.cvsclient.util.StringPattern;
32 import org.netbeans.lib.cvsclient.command.KeywordSubstitutionOptions;
33
34 /**
35  * Services that are provided to response handlers.
36  * @author Robert Greig
37  */

38 public interface ResponseServices {
39     /**
40      * Set the modified date of the next file to be written. The next call
41      * to writeFile will use this date.
42      * @param modifiedDate the date the file should be marked as modified
43      */

44     void setNextFileDate(Date modifiedDate);
45
46     /**
47      * Get the modified date of the next file to be written. This will also
48      * null any stored date so that future calls will not retrieve a date
49      * that was meant for a previous file.
50      * @return the date the next file should be marked as having been modified
51      * on.
52      */

53     Date getNextFileDate();
54
55     /**
56      * Convert a <i>pathname</i> in the CVS sense (see 5.10 in the protocol
57      * document) into a local pathname for the file
58      * @param localDirectory the name of the local directory, relative to the
59      * directory in which the command was given
60      * @param repository the full repository name for the file
61      */

62     String JavaDoc convertPathname(String JavaDoc localDirectory, String JavaDoc repository);
63
64     /**
65      * Create or update the administration files for a particular file
66      * This will create the CVS directory if necessary, and the
67      * Root and Repository files if necessary. It will also update
68      * the Entries file with the new entry
69      * @param localDirectory the local directory, relative to the directory
70      * in which the command was given, where the file in question lives
71      * @param entry the entry object for that file
72      * @throws IOException if there is an error writing the files
73      */

74     void updateAdminData(String JavaDoc localDirectory, String JavaDoc repositoryPath,
75                          Entry entry)
76             throws IOException;
77
78     /**
79      * Set the Entry for the specified file
80      * @param f the file
81      * @param e the new entry
82      * @throws IOException if an error occurs writing the details
83      */

84     void setEntry(File f, Entry e) throws IOException;
85
86     /**
87      * Remove the Entry for the specified file
88      * @param f the file whose entry is to be removed
89      * @throws IOException if an error occurs writing the Entries file
90      */

91     void removeEntry(File f) throws IOException;
92
93     /**
94      * Remove the specified file from the local disk
95      * If the file does not exist, the operation does nothing.
96      *
97      * @param pathname the full path to the file to remove
98      * @throws IOException if an IO error occurs while removing the file
99      */

100     void removeLocalFile(String JavaDoc pathname) throws IOException;
101
102     /**
103      * Remove the specified file from the local disk.
104      * @throws IOException if an IO error occurs while removing the file
105      */

106     void removeLocalFile(String JavaDoc localPath, String JavaDoc repositoryFileName)
107             throws IOException;
108
109     /**
110      * Rename the local file
111      * @param pathname the full path to the file to rename
112      * @param newName the new name of the file (not the full path)
113      * @throws IOException if an IO error occurs while renaming the file
114      */

115     void renameLocalFile(String JavaDoc pathname, String JavaDoc newName) throws IOException;
116
117     /**
118      * Get the CVS event manager. This is generally called by response handlers
119      * that want to fire events.
120      * @return the eventManager
121      */

122     EventManager getEventManager();
123
124     /**
125      * Obtain from the underlying implementation the file handler for
126      * handling uncompressed data.
127      * @return file handler for uncompressed data.
128      */

129     FileHandler getUncompressedFileHandler();
130
131     /**
132      * Obtain the file handler for Gzip compressed data.
133      * @return file handler for Gzip compressed data.
134      */

135     FileHandler getGzipFileHandler();
136
137     /**
138      * ReSet the filehandler for Gzip compressed data. Makes sure the
139      * requests for sending gzipped data are not sent..
140      */

141     void dontUseGzipFileHandler();
142     
143     /**
144      * This method is called when a response for the ValidRequests request
145      * is received.
146      * @param requests A List of requests that is valid for this CVS server
147      * separated by spaces.
148      */

149     void setValidRequests(String JavaDoc requests);
150     
151
152     /**
153      * This method is called by WrapperSendResponse for each wrapper setting sent
154      * back by the CVS server
155      * @param pattern A StringPattern indicating the pattern for which the
156      * wrapper applies
157      * @param option A KeywordSubstituionOption corresponding to the setting
158      */

159      void addWrapper(StringPattern pattern, KeywordSubstitutionOptions option);
160      
161      /**
162      * Get the global options that are set to this client.
163      * Individual commands can get the global options via this method.
164      */

165      GlobalOptions getGlobalOptions();
166 }
167
Popular Tags