Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding the ResourceRequestDeniedRemoteException when a user is denign…

…ed access to the system due to quota or resource limits
  • Loading branch information...
commit 898ea3fb54423c0519011b43024cfbb64bd14a76 1 parent d3aedaa
@buzztroll buzztroll authored
View
43 ...dge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/ResourceRequestDeniedRemoteException.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 1999-2010 University of Chicago
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm;
+
+import java.rmi.RemoteException;
+
+public class ResourceRequestDeniedRemoteException extends RemoteException
+{
+
+ public ResourceRequestDeniedRemoteException() {
+ super();
+ }
+
+ public ResourceRequestDeniedRemoteException(String message) {
+ super(message);
+ }
+
+ public ResourceRequestDeniedRemoteException(String message, Exception e) {
+ super(message, e);
+ }
+
+ public ResourceRequestDeniedRemoteException(String message, Throwable e) {
+ super(message, e);
+ }
+
+ public ResourceRequestDeniedRemoteException(Exception e) {
+ super("", e);
+ }
+}
View
4 ...4.0-elastic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/ServiceRMImpl.java
@@ -30,6 +30,7 @@
import org.nimbustools.api.services.rm.IdempotentCreationMismatchException;
import org.nimbustools.api.services.rm.ManageException;
import org.nimbustools.api.services.rm.Manager;
+import org.nimbustools.api.services.rm.ResourceRequestDeniedException;
import org.nimbustools.messaging.gt4_0.common.AddCustomizations;
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31.*;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.ServiceRM;
@@ -166,7 +167,8 @@ public RunInstancesResponseType runInstances(RunInstancesType req)
// would be better to have a more general way of handling EC2
// server error responses for both SOAP and Query
throw new IdempotentCreationMismatchRemoteException(e.getMessage(), e);
-
+ } catch (ResourceRequestDeniedException e) {
+ throw new ResourceRequestDeniedRemoteException(e.getMessage(), e);
} catch (Exception e) {
throw new RemoteException(e.getMessage(), e);
}
View
1  messaging/query/java/source/src/org/nimbustools/messaging/query/QueryError.java
@@ -28,4 +28,5 @@
MissingClientTokenId,
InvalidParameterValue,
IdempotentParameterMismatch,
+ InstanceLimitExceeded,
}
View
3  messaging/query/java/source/src/org/nimbustools/messaging/query/v2009_08_15/ElasticService.java
@@ -18,6 +18,7 @@
import org.nimbustools.messaging.gt4_0_elastic.generated.v2010_08_31.*;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.*;
import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.IdempotentCreationMismatchRemoteException;
+import org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.rm.ResourceRequestDeniedRemoteException;
import org.nimbustools.messaging.query.*;
import static org.nimbustools.messaging.query.QueryUtils.*;
import org.apache.commons.logging.Log;
@@ -261,6 +262,8 @@ public RunInstancesResponseType handleGet(
} catch (IdempotentCreationMismatchRemoteException e) {
throw new QueryException(QueryError.IdempotentParameterMismatch, e);
+ } catch (ResourceRequestDeniedRemoteException e) {
+ throw new QueryException(QueryError.InstanceLimitExceeded, e);
} catch (RemoteException e) {
throw new QueryException(QueryError.GeneralError, e);
}
Please sign in to comment.
Something went wrong with that request. Please try again.