diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-10-03 17:30:41 +0200 |
| commit | 275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (patch) | |
| tree | ddcc6b14077d90d1b970b67829f07120547dbb62 /src/main/java/com/c2kernel/persistency/ClusterStorage.java | |
| parent | a139f95bfeca603333b8c0310ae09c6805e58584 (diff) | |
Huge exception overhaul: Merged ClusterStorageException with
PersistencyException. Replaced MembershipException with
InvalidCollectionModification CORBA Exception. Made all predef steps
throw more accurate exceptions when they go wrong, and let more
exceptions bubble through from underneath.
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/ClusterStorage.java')
| -rw-r--r-- | src/main/java/com/c2kernel/persistency/ClusterStorage.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/main/java/com/c2kernel/persistency/ClusterStorage.java b/src/main/java/com/c2kernel/persistency/ClusterStorage.java index e4aa81c..a2a33fe 100644 --- a/src/main/java/com/c2kernel/persistency/ClusterStorage.java +++ b/src/main/java/com/c2kernel/persistency/ClusterStorage.java @@ -21,6 +21,7 @@ package com.c2kernel.persistency;
import com.c2kernel.collection.Collection;
+import com.c2kernel.common.PersistencyException;
import com.c2kernel.common.SystemKey;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.lookup.ItemPath;
@@ -48,7 +49,7 @@ import com.c2kernel.utils.Logger; * {@link #put(ItemPath, C2KLocalObject)} and {@link #delete(ItemPath, String)}
* for clusters they return {@link #WRITE} and {@link #READWRITE} from
* {@link #getClusterContents(ItemPath, String)}. Operations that have not been
- * declared as not supported should throw a ClusterStorageException. If a
+ * declared as not supported should throw a PersistencyException. If a
* cluster does not exist, get should return null, and delete should return with
* no action.
*/
@@ -145,21 +146,21 @@ public abstract class ClusterStorage { * @param auth
* The Authenticator instance that the user or server logged in
* with.
- * @throws ClusterStorageException
+ * @throws PersistencyException
* If storage initialization failed
*/
public abstract void open(Authenticator auth)
- throws ClusterStorageException;
+ throws PersistencyException;
/**
* Shuts down the storage. Data must be completely written to disk before
* this method returns, so the process can exit. No further gets or puts
* should follow.
*
- * @throws ClusterStorageException
+ * @throws PersistencyException
* If closing failed
*/
- public abstract void close() throws ClusterStorageException;
+ public abstract void close() throws PersistencyException;
/**
* Declares whether or not this ClusterStorage can read or write a
@@ -240,11 +241,11 @@ public abstract class ClusterStorage { * @param path
* The path of the local object
* @return The C2KLocalObject, or null if the object was not found
- * @throws ClusterStorageException
+ * @throws PersistencyException
* when retrieval failed
*/
public abstract C2KLocalObject get(ItemPath itemPath, String path)
- throws ClusterStorageException;
+ throws PersistencyException;
/**
* Stores a CRISTAL local object. The path is automatically generated.
@@ -253,11 +254,11 @@ public abstract class ClusterStorage { * The Item that the object will be stored under
* @param obj
* The C2KLocalObject to store
- * @throws ClusterStorageException
+ * @throws PersistencyException
* When storage fails
*/
public abstract void put(ItemPath itemPath, C2KLocalObject obj)
- throws ClusterStorageException;
+ throws PersistencyException;
/**
* Remove a CRISTAL local object from storage. This should be used sparingly
@@ -268,11 +269,11 @@ public abstract class ClusterStorage { * The containing Item
* @param path
* The path of the object to be removed
- * @throws ClusterStorageException
+ * @throws PersistencyException
* When deletion fails or is not allowed
*/
public abstract void delete(ItemPath itemPath, String path)
- throws ClusterStorageException;
+ throws PersistencyException;
// directory listing
/**
@@ -285,10 +286,10 @@ public abstract class ClusterStorage { * The path within that Item to query. May be ClusterStorage.ROOT
* (empty String)
* @return A String array of the possible next path elements
- * @throws ClusterStorageException
+ * @throws PersistencyException
* When an error occurred during the query
*/
public abstract String[] getClusterContents(ItemPath itemPath, String path)
- throws ClusterStorageException;
+ throws PersistencyException;
}
|
