Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E60410405 for ; Wed, 4 Sep 2013 17:06:37 +0000 (UTC) Received: (qmail 65582 invoked by uid 500); 4 Sep 2013 17:06:36 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 65539 invoked by uid 500); 4 Sep 2013 17:06:31 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 65523 invoked by uid 99); 4 Sep 2013 17:06:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 17:06:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 17:06:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7A64223888CD; Wed, 4 Sep 2013 17:06:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1520068 - in /airavata/trunk/modules/registry: airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ registry-api/src/main/java/org/apache/airavata/registry/api/exception/ Date: Wed, 04 Sep 2013 17:06:08 -0000 To: commits@airavata.apache.org From: samindaw@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130904170608.7A64223888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: samindaw Date: Wed Sep 4 17:06:07 2013 New Revision: 1520068 URL: http://svn.apache.org/r1520068 Log: checking if the gateway is registered in airavata Added: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java (with props) Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1520068&r1=1520067&r2=1520068&view=diff ============================================================================== --- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original) +++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Wed Sep 4 17:06:07 2013 @@ -77,6 +77,7 @@ import org.apache.airavata.registry.api. import org.apache.airavata.registry.api.UserWorkflowRegistry; import org.apache.airavata.registry.api.WorkspaceProject; import org.apache.airavata.registry.api.exception.AiravataRegistryUninitializedException; +import org.apache.airavata.registry.api.exception.GatewayNotRegisteredException; import org.apache.airavata.registry.api.exception.RegistryAPIVersionIncompatibleException; import org.apache.airavata.registry.api.exception.RegistryAccessorInstantiateException; import org.apache.airavata.registry.api.exception.RegistryAccessorNotFoundException; @@ -150,6 +151,9 @@ public class AiravataJPARegistry extends @Override protected void initialize() throws RegistryException { + if (!ResourceUtils.isGatewayExist(getGateway().getGatewayName())){ + throw new GatewayNotRegisteredException(getGateway().getGatewayName()); + } jpa = new JPAResourceAccessor(this); //TODO check if the db connections are proper & accessible & the relevant db/tables are //present Added: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java?rev=1520068&view=auto ============================================================================== --- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java (added) +++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java Wed Sep 4 17:06:07 2013 @@ -0,0 +1,32 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.airavata.registry.api.exception; + +public class GatewayNotRegisteredException extends RegistryException { + + private static final long serialVersionUID = -139586125325993500L; + + public GatewayNotRegisteredException(String gatewayName) { + super("The gateway id '"+gatewayName+"' is not registered within Airavata"); + } + +} Propchange: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/GatewayNotRegisteredException.java ------------------------------------------------------------------------------ svn:mime-type = text/plain