Package org.ogce.gfac.exception

Examples of org.ogce.gfac.exception.GfacException


      in = new FileInputStream(file);
      byte[] content = new byte[in.available()];
      in.read(content);
      return new String(content);
    } catch (FileNotFoundException e) {
      throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
    } catch (IOException e) {
      throw new GfacException(e, FaultCode.LocalError);
    } finally {
      if (in != null) {
        try {
          in.close();
        } catch (IOException e) {
          throw new GfacException(e, FaultCode.LocalError);
        }
      }
    }
  }
View Full Code Here


  public void addCapability(String resource, String actor, boolean isUser, String action) throws GfacException {
    try {
      xregistryClient.addCapability(resource, actor, isUser, action);
    } catch (XRegistryClientException e) {
      throw new GfacException(e, FaultCode.ErrorAtDependentService);
    }
  }
View Full Code Here

      HostDescriptionType hostDesc = HostDescriptionDocument.Factory.parse(hostDescStr).getHostDescription();
      SchemaValidator validator = new SchemaValidator(hostDesc);
      validator.validate();
      return hostDesc;
    } catch (Exception e) {
      throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
    }
  }
View Full Code Here

  public CapabilityToken[] getCapability(String resource, String actor, boolean isUser, String action) throws GfacException {
    try {
      return xregistryClient.findCapability(resource, actor, isUser, action);
    } catch (XRegistryClientException e) {
      throw new GfacException(e, FaultCode.ErrorAtDependentService);
    }
  }
View Full Code Here

      ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(reader).getApplicationDescription();
      SchemaValidator validator = new SchemaValidator(appDesc);
      validator.validate();
      return appDesc;
    } catch (IOException e) {
      throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
    } catch (Exception e) {
      throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
    }
  }
View Full Code Here

      MethodType method = portType.addNewMethod();
      method.setMethodName(operationName);
      return method;
    }

    throw new GfacException("Method name " + operationName + " not found", FaultCode.InvaliedLocalArgumnet);
  }
View Full Code Here

        return true;
      } else {
        return false;
      }
    } catch (UnknownHostException e) {
      throw new GfacException(e, FaultCode.LocalError);
    }
  }
View Full Code Here

        // host name
        hostName = findHostFromServiceMap(registryService, appName);     
       
      } catch (XmlException e) {
        throw new GfacException(e, FaultCode.InitalizationError);
      }
    } else {
      throw new GfacException("Service Map for " + context.getServiceName() + " does not found on resource Catalog " + registryService, FaultCode.InvalidRequest);
    }

   
    /*
     * Determine provider
     */
    if (GfacUtils.isLocalHost(hostName)) {
      return new LocalProvider();
    } else {
      // set Security context for executionContext
      if (context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT) != null) {
        context.getExecutionContext().setSecurityContext(context.getSecurityContext(GramProvider.MYPROXY_SECURITY_CONTEXT));
      } else {
        throw new GfacException("Cannot get security context to run on Gram", FaultCode.InvalidRequest);
      }

      return new GramProvider();
    }
  }
View Full Code Here

          // add parameter name if needed
        }
      }
      return params;
    } catch (URISyntaxException e) {
      throw new GfacException(e, FaultCode.InvaliedLocalArgumnet);
    }
  }
View Full Code Here

  public void removeCapability(String resourceID, String actor) throws GfacException {
    try {
      xregistryClient.removeCapability(resourceID, actor);
    } catch (XRegistryClientException e) {
      throw new GfacException(e, FaultCode.ErrorAtDependentService);
    }
  }
View Full Code Here

TOP

Related Classes of org.ogce.gfac.exception.GfacException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.