View Javadoc

1   package fr.in2p3.jsaga.sync.namespace;
2   
3   import org.ogf.saga.SagaObject;
4   import org.ogf.saga.error.*;
5   import org.ogf.saga.namespace.NSEntry;
6   import org.ogf.saga.permissions.Permissions;
7   import org.ogf.saga.url.URL;
8   
9   /**
10   * Defines methods that allow inspection and management of the entry.
11   */
12  public interface SyncNSEntry extends SagaObject, Permissions<NSEntry> {
13  
14      /**
15       * Obtains the complete URL refering to the entry.
16       *
17       * @return the URL.
18       */
19      public URL getURLSync() throws NotImplementedException,
20              IncorrectStateException, TimeoutException, NoSuccessException;
21  
22      /**
23       * Obtains the current working directory for the entry.
24       *
25       * @return the current working directory.
26       */
27      public URL getCWDSync() throws NotImplementedException,
28              IncorrectStateException, TimeoutException, NoSuccessException;
29  
30      /**
31       * Obtains the name part of the URL of this entry.
32       *
33       * @return the name part.
34       */
35      public URL getNameSync() throws NotImplementedException,
36              IncorrectStateException, TimeoutException, NoSuccessException;
37  
38      /**
39       * Tests this entry for being a directory.
40       *
41       * @return true if the entry is a directory.
42       */
43      public boolean isDirSync() throws NotImplementedException,
44              AuthenticationFailedException, AuthorizationFailedException,
45              PermissionDeniedException, IncorrectStateException,
46              TimeoutException, NoSuccessException;
47  
48      /**
49       * Tests this entry for being a namespace entry. If this entry represents a
50       * link or a directory, this method returns <code>false</code>, although
51       * strictly speaking, directories and links are namespace entries as well.
52       *
53       * @return true if the entry is a namespace entry.
54       */
55      public boolean isEntrySync() throws NotImplementedException,
56              AuthenticationFailedException, AuthorizationFailedException,
57              PermissionDeniedException, IncorrectStateException,
58              TimeoutException, NoSuccessException;
59  
60      /**
61       * Tests this entry for being a link.
62       *
63       * @return true if the entry is a link.
64       */
65      public boolean isLinkSync() throws NotImplementedException,
66              AuthenticationFailedException, AuthorizationFailedException,
67              PermissionDeniedException, IncorrectStateException,
68              TimeoutException, NoSuccessException;
69  
70      /**
71       * Returns the URL representing the link target. Resolves one link level
72       * only.
73       *
74       * @return the link target.
75       */
76      public URL readLinkSync() throws NotImplementedException,
77              AuthenticationFailedException, AuthorizationFailedException,
78              PermissionDeniedException, IncorrectStateException,
79              TimeoutException, NoSuccessException;
80  
81      /**
82       * Returns the time of the last modification in seconds since epoch
83       * (01.01.1970).
84       *
85       * @return
86       *      the last modification time.
87       */
88      public long getMTimeSync() throws NotImplementedException,
89              AuthenticationFailedException, AuthorizationFailedException,
90              PermissionDeniedException, IncorrectStateException,
91              TimeoutException, NoSuccessException;
92  
93      /**
94       * Copies this entry to another part of the namespace.
95       *
96       * @param target
97       *            the name to copy to.
98       * @param flags
99       *            defining the operation modus.
100      */
101     public void copySync(URL target, int flags) throws NotImplementedException,
102             AuthenticationFailedException, AuthorizationFailedException,
103             PermissionDeniedException, BadParameterException,
104             IncorrectStateException, AlreadyExistsException,
105             DoesNotExistException, TimeoutException, NoSuccessException,
106             IncorrectURLException;
107 
108     /**
109      * Copies this entry to another part of the namespace.
110      *
111      * @param target
112      *            the name to copy to.
113      */
114     public void copySync(URL target) throws NotImplementedException,
115             AuthenticationFailedException, AuthorizationFailedException,
116             PermissionDeniedException, BadParameterException,
117             IncorrectStateException, AlreadyExistsException,
118             DoesNotExistException, TimeoutException, NoSuccessException,
119             IncorrectURLException;
120 
121     /**
122      * Creates a symbolic link from the target to this entry.
123      *
124      * @param target
125      *            the name that will have the symbolic link to this entry.
126      * @param flags
127      *            defining the operation modus.
128      */
129     public void linkSync(URL target, int flags) throws NotImplementedException,
130             AuthenticationFailedException, AuthorizationFailedException,
131             PermissionDeniedException, BadParameterException, DoesNotExistException,
132             IncorrectStateException, AlreadyExistsException, TimeoutException,
133             NoSuccessException, IncorrectURLException;
134 
135     /**
136      * Creates a symbolic link from the target to this entry.
137      *
138      * @param target
139      *            the name that will have the symbolic link to this entry.
140      */
141     public void linkSync(URL target) throws NotImplementedException,
142             AuthenticationFailedException, AuthorizationFailedException,
143             PermissionDeniedException, BadParameterException, DoesNotExistException,
144             IncorrectStateException, AlreadyExistsException, TimeoutException,
145             NoSuccessException, IncorrectURLException;
146 
147     /**
148      * Renames this entry to the target, or moves this entry to the target if it
149      * is a directory.
150      *
151      * @param target
152      *            the name to move to.
153      * @param flags
154      *            defining the operation modus.
155      */
156     public void moveSync(URL target, int flags) throws NotImplementedException,
157             AuthenticationFailedException, AuthorizationFailedException,
158             PermissionDeniedException, BadParameterException,
159             IncorrectStateException, AlreadyExistsException,
160             DoesNotExistException, TimeoutException, NoSuccessException,
161             IncorrectURLException;
162 
163     /**
164      * Renames this entry to the target, or moves this entry to the target if it
165      * is a directory.
166      *
167      * @param target
168      *            the name to move to.
169      */
170     public void moveSync(URL target) throws NotImplementedException,
171             AuthenticationFailedException, AuthorizationFailedException,
172             PermissionDeniedException, BadParameterException,
173             IncorrectStateException, AlreadyExistsException,
174             DoesNotExistException, TimeoutException, NoSuccessException,
175             IncorrectURLException;
176 
177     /**
178      * Removes this entry and closes it.
179      *
180      * @param flags
181      *            defining the operation modus.
182      */
183     public void removeSync(int flags) throws NotImplementedException,
184             AuthenticationFailedException, AuthorizationFailedException,
185             PermissionDeniedException, BadParameterException,
186             IncorrectStateException, TimeoutException, NoSuccessException;
187 
188     /**
189      * Removes this entry and closes it.
190      */
191     public void removeSync() throws NotImplementedException,
192             AuthenticationFailedException, AuthorizationFailedException,
193             PermissionDeniedException, BadParameterException,
194             IncorrectStateException, TimeoutException, NoSuccessException;
195 
196     /**
197      * Allows the specified permissions for the specified id. An id of "*"
198      * enables the permissions for all.
199      *
200      * @param id
201      *            the id.
202      * @param permissions
203      *            the permissions to enable.
204      * @param flags
205      *            the only allowed flags are RECURSIVE and DEREFERENCE.
206      */
207     public void permissionsAllowSync(String id, int permissions, int flags)
208             throws NotImplementedException, AuthenticationFailedException,
209             AuthorizationFailedException, PermissionDeniedException,
210             IncorrectStateException, BadParameterException, TimeoutException,
211             NoSuccessException;
212 
213     /**
214      * Denies the specified permissions for the specified id. An id of "*"
215      * disables the permissions for all.
216      *
217      * @param id
218      *            the id.
219      * @param permissions
220      *            the permissions to disable.
221      * @param flags
222      *            the only allowed flags are RECURSIVE and DEREFERENCE.
223      */
224     public void permissionsDenySync(String id, int permissions, int flags)
225             throws NotImplementedException, AuthenticationFailedException,
226             AuthorizationFailedException, IncorrectStateException,
227             PermissionDeniedException, BadParameterException, TimeoutException,
228             NoSuccessException;
229 }