summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-10-03 23:18:47 +0200
commitb68ea0f2b12c4c5189c5fc7c182a1b242dc63579 (patch)
tree85b1cc4713ba978c044bfa0656f9115c9f9bf9e3 /src/main/java/com/c2kernel/entity/proxy/ItemProxy.java
parent275d0bbf555c8917be82ce4cc21eb4cabb00f4c5 (diff)
Rolled back the renaming of existing exceptions.
Diffstat (limited to 'src/main/java/com/c2kernel/entity/proxy/ItemProxy.java')
-rw-r--r--src/main/java/com/c2kernel/entity/proxy/ItemProxy.java66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java b/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java
index f5b0be7..7a2d930 100644
--- a/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java
+++ b/src/main/java/com/c2kernel/entity/proxy/ItemProxy.java
@@ -33,10 +33,10 @@ import com.c2kernel.collection.Collection;
import com.c2kernel.collection.CollectionArrayList;
import com.c2kernel.common.AccessRightsException;
import com.c2kernel.common.InvalidCollectionModification;
-import com.c2kernel.common.InvalidData;
-import com.c2kernel.common.InvalidTransition;
-import com.c2kernel.common.ObjectAlreadyExists;
-import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.InvalidDataException;
+import com.c2kernel.common.InvalidTransitionException;
+import com.c2kernel.common.ObjectAlreadyExistsException;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.common.PersistencyException;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.entity.Item;
@@ -89,18 +89,18 @@ public class ItemProxy
return mItemPath;
}
- protected Item getItem() throws ObjectNotFound {
+ protected Item getItem() throws ObjectNotFoundException {
if (mItem == null)
mItem = narrow();
return mItem;
}
- public Item narrow() throws ObjectNotFound
+ public Item narrow() throws ObjectNotFoundException
{
try {
return ItemHelper.narrow(mIOR);
} catch (org.omg.CORBA.BAD_PARAM ex) { }
- throw new ObjectNotFound("CORBA Object was not an Item, or the server is down.");
+ throw new ObjectNotFoundException("CORBA Object was not an Item, or the server is down.");
}
public void initialise( AgentPath agentId,
@@ -108,11 +108,11 @@ public class ItemProxy
CompositeActivity workflow,
CollectionArrayList colls
)
- throws AccessRightsException, InvalidData, PersistencyException, ObjectNotFound, MarshalException, ValidationException, IOException, MappingException, InvalidCollectionModification
+ throws AccessRightsException, InvalidDataException, PersistencyException, ObjectNotFoundException, MarshalException, ValidationException, IOException, MappingException, InvalidCollectionModification
{
Logger.msg(7, "ItemProxy::initialise - started");
CastorXMLUtility xml = Gateway.getMarshaller();
- if (itemProps == null) throw new InvalidData("No initial properties supplied");
+ if (itemProps == null) throw new InvalidDataException("No initial properties supplied");
String propString = xml.marshall(itemProps);
String wfString = "";
if (workflow != null) wfString = xml.marshall(workflow);
@@ -124,7 +124,7 @@ public class ItemProxy
public void setProperty(AgentProxy agent, String name, String value)
throws AccessRightsException,
- PersistencyException, InvalidData
+ PersistencyException, InvalidDataException
{
String[] params = new String[2];
params[0] = name;
@@ -135,7 +135,7 @@ public class ItemProxy
throw (e);
} catch (PersistencyException e) {
throw (e);
- } catch (InvalidData e) {
+ } catch (InvalidDataException e) {
throw (e);
} catch (Exception e) {
Logger.error(e);
@@ -149,23 +149,23 @@ public class ItemProxy
**************************************************************************/
public String requestAction( Job thisJob )
throws AccessRightsException,
- InvalidTransition,
- ObjectNotFound,
- InvalidData,
+ InvalidTransitionException,
+ ObjectNotFoundException,
+ InvalidDataException,
PersistencyException,
- ObjectAlreadyExists,
+ ObjectAlreadyExistsException,
InvalidCollectionModification
{
String outcome = thisJob.getOutcomeString();
// check fields that should have been filled in
if (outcome==null)
if (thisJob.isOutcomeRequired())
- throw new InvalidData("Outcome is required.");
+ throw new InvalidDataException("Outcome is required.");
else
outcome="";
if (thisJob.getAgentPath() == null)
- throw new InvalidData("No Agent specified.");
+ throw new InvalidDataException("No Agent specified.");
Logger.msg(7, "ItemProxy - executing "+thisJob.getStepPath()+" for "+thisJob.getAgentName());
return getItem().requestAction (thisJob.getAgentPath().getSystemKey(), thisJob.getStepPath(),
@@ -177,7 +177,7 @@ public class ItemProxy
**************************************************************************/
private ArrayList<Job> getJobList(AgentPath agentPath, boolean filter)
throws AccessRightsException,
- ObjectNotFound,
+ ObjectNotFoundException,
PersistencyException
{
JobArrayList thisJobList;
@@ -194,7 +194,7 @@ public class ItemProxy
public ArrayList<Job> getJobList(AgentProxy agent)
throws AccessRightsException,
- ObjectNotFound,
+ ObjectNotFoundException,
PersistencyException
{
return getJobList(agent.getPath(), true);
@@ -202,7 +202,7 @@ public class ItemProxy
private Job getJobByName(String actName, AgentPath agent)
throws AccessRightsException,
- ObjectNotFound,
+ ObjectNotFoundException,
PersistencyException {
ArrayList<Job> jobList = getJobList(agent, true);
@@ -214,21 +214,21 @@ public class ItemProxy
}
- public Collection<?> getCollection(String collName) throws ObjectNotFound {
+ public Collection<?> getCollection(String collName) throws ObjectNotFoundException {
return (Collection<?>)getObject(ClusterStorage.COLLECTION+"/"+collName+"/last");
}
- public Workflow getWorkflow() throws ObjectNotFound {
+ public Workflow getWorkflow() throws ObjectNotFoundException {
return (Workflow)getObject(ClusterStorage.LIFECYCLE+"/workflow");
}
- public Viewpoint getViewpoint(String schemaName, String viewName) throws ObjectNotFound {
+ public Viewpoint getViewpoint(String schemaName, String viewName) throws ObjectNotFoundException {
return (Viewpoint)getObject(ClusterStorage.VIEWPOINT+"/"+schemaName+"/"+viewName);
}
public Job getJobByName(String actName, AgentProxy agent)
throws AccessRightsException,
- ObjectNotFound,
+ ObjectNotFoundException,
PersistencyException {
return getJobByName(actName, agent.getPath());
}
@@ -248,7 +248,7 @@ public class ItemProxy
*
**************************************************************************/
public String queryData( String path )
- throws ObjectNotFound
+ throws ObjectNotFoundException
{
try {
@@ -266,7 +266,7 @@ public class ItemProxy
}
C2KLocalObject target = Gateway.getStorage().get(mItemPath, path, null);
return Gateway.getMarshaller().marshall(target);
- } catch (ObjectNotFound e) {
+ } catch (ObjectNotFoundException e) {
throw e;
} catch (Exception e) {
Logger.error(e);
@@ -274,11 +274,11 @@ public class ItemProxy
}
}
- public String[] getContents( String path ) throws ObjectNotFound {
+ public String[] getContents( String path ) throws ObjectNotFoundException {
try {
return Gateway.getStorage().getClusterContents(mItemPath, path.substring(0, path.length()));
} catch (PersistencyException e) {
- throw new ObjectNotFound(e.toString());
+ throw new ObjectNotFoundException(e.toString());
}
}
@@ -287,7 +287,7 @@ public class ItemProxy
*
**************************************************************************/
public C2KLocalObject getObject( String xpath )
- throws ObjectNotFound
+ throws ObjectNotFoundException
{
// load from storage, falling back to proxy loader if not found in others
try
@@ -297,14 +297,14 @@ public class ItemProxy
catch( PersistencyException ex )
{
Logger.msg(4, "Exception loading object :"+mItemPath+"/"+xpath);
- throw new ObjectNotFound( ex.toString() );
+ throw new ObjectNotFoundException( ex.toString() );
}
}
public String getProperty( String name )
- throws ObjectNotFound
+ throws ObjectNotFoundException
{
Logger.msg(5, "Get property "+name+" from item "+mItemPath);
Property prop = (Property)getObject("Property/"+name);
@@ -314,7 +314,7 @@ public class ItemProxy
}
catch (NullPointerException ex)
{
- throw new ObjectNotFound();
+ throw new ObjectNotFoundException();
}
}
@@ -322,7 +322,7 @@ public class ItemProxy
{
try {
return getProperty("Name");
- } catch (ObjectNotFound ex) {
+ } catch (ObjectNotFoundException ex) {
return null;
}
}