Examples of SchemaValidator


Examples of org.ogce.schemas.gfac.validator.SchemaValidator

    public static HostDescriptionType parseHostDescirption(String hostDescStr) throws GFacSchemaException {
        try {
            HostDescriptionType hostDesc = HostDescriptionDocument.Factory.parse(hostDescStr)
                    .getHostDescription();
            SchemaValidator validator = new SchemaValidator(hostDesc);
            validator.validate();
            return hostDesc;
        } catch (XmlException e) {
            throw new GFacSchemaException(e);
        } catch (Exception e) {
            throw new GFacSchemaException(e);
View Full Code Here

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

    public static ApplicationDescriptionType parseAppDescirption(Reader reader)
            throws GFacSchemaException {
        try {
            ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(
                    reader).getApplicationDescription();
            SchemaValidator validator = new SchemaValidator(appDesc);
            validator.validate();
            return appDesc;
        } catch (XmlException e) {
            throw new GFacSchemaException(e);
        } catch (IOException e) {
            throw new GFacSchemaException(e);
View Full Code Here

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

      if(host.isSshEnabled()){
      hostDesc.getHostConfiguration().setSshEnabled(true);
      }
      // Validates correctness of XML message
      try {
        SchemaValidator validator = new SchemaValidator(hostDesc);
        validator.validate();
      } catch (GFacSchemaException e) {
        throw new GfacException(e,FaultCode.SchemaValidationError);
      }
      return hostDescDoc.xmlText();
    } catch (NumberFormatException e) {
View Full Code Here

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

      if(host.isSshEnabled()){
      hostDesc.getHostConfiguration().setSshEnabled(true);
      }
      // Validates correctness of XML message
      try {
        SchemaValidator validator = new SchemaValidator(hostDesc);
        validator.validate();
      } catch (GFacSchemaException e) {
        throw new GfacException(e,FaultCode.SchemaValidationError);
      }
      return hostDescDoc.xmlText();
    } catch (NumberFormatException e) {
View Full Code Here

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

    }
    if (appInfo.getHostCount() != null) {
      appType.setHostCount(appInfo.getHostCount());
    }
   
    SchemaValidator validator = new SchemaValidator(appType);
    validator.validate();

    return appDescDoc.xmlText();
  }
View Full Code Here

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

  }

  public static HostDescriptionType parseHostDescirption(String hostDescStr) throws GfacException {
    try {
      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

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

  }

  public static ApplicationDescriptionType parseAppDescirption(Reader reader) throws GfacException {
    try {
      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

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

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

Examples of org.ogce.schemas.gfac.validator.SchemaValidator

    public static ApplicationDescriptionType parseAppDescirption(Reader reader)
            throws GfacException {
        try {
            ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(
                    reader).getApplicationDescription();
            SchemaValidator validator = new SchemaValidator(appDesc);
            validator.validate();
            return appDesc;
        } catch (XmlException e) {
            throw new GfacException(e,FaultCode.InvaliedLocalArgumnet);
        } catch (IOException e) {
            throw new GfacException(e,FaultCode.InvaliedLocalArgumnet);
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.SchemaValidator

        if (!CommonUtil.isUpdateLockAvailable()) {
            return;
        }
        CommonUtil.acquireUpdateLock();
        try {
            SchemaValidator validator = new SchemaValidator();
            Resource resource = requestContext.getResource();
            Object resourceContent = resource.getContent();
            if (resourceContent instanceof byte[]) {
                InputStream in = new ByteArrayInputStream((byte[]) resourceContent);
                validator.validate(in, resource);
            }
            resource.setContentStream(null);
    //        requestContext.getRegistry().put(resource.getPath() ,resource);
        } finally {
            CommonUtil.releaseUpdateLock();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.