Package com.orientechnologies.orient.server.network.protocol.http

Examples of com.orientechnologies.orient.server.network.protocol.http.OHttpRequestException


    if (parametersPos > -1)
      iURL = iURL.substring(0, parametersPos);

    String[] parts = iURL.substring(1).split("/");
    if (parts.length < iArgumentCount)
      throw new OHttpRequestException(iSyntax);

    return parts;
  }
View Full Code Here


  @Override
  public boolean beforeExecute(final OHttpRequest iRequest) throws IOException {
    final String[] urlParts = iRequest.url.substring(1).split("/");
    if (urlParts.length < 2)
      throw new OHttpRequestException("Syntax error in URL. Expected is: <command>/<database>[/...]");

    iRequest.databaseName = urlParts[1];

    iRequest.databaseName = iRequest.databaseName.replace(DBNAME_DIR_SEPARATOR, '/');
View Full Code Here

    if (parametersPos > -1)
      iURL = iURL.substring(0, parametersPos);

    String[] parts = iURL.substring(1).split("/");
    if (parts.length < iArgumentCount)
      throw new OHttpRequestException(iSyntax);

    return parts;
  }
View Full Code Here

    if (parametersPos > -1)
      iURL = iURL.substring(0, parametersPos);

    String[] parts = iURL.substring(1).split("/");
    if (parts.length < iArgumentCount)
      throw new OHttpRequestException(iSyntax);

    return parts;
  }
View Full Code Here

   public boolean beforeExecute(final OHttpRequest iRequest, OHttpResponse iResponse) throws IOException {
     super.beforeExecute(iRequest, iResponse);

     final String[] urlParts = iRequest.url.substring(1).split("/");
     if (urlParts.length < 2)
       throw new OHttpRequestException("Syntax error in URL. Expected is: <command>/<database>[/...]");

     iRequest.databaseName = urlParts[1];
     final List<String> authenticationParts = iRequest.authorization != null ? OStringSerializerHelper.split(iRequest.authorization,
         ':') : null;
View Full Code Here

   protected String[] checkSyntax(final String iURL, final int iArgumentCount, final String iSyntax) {
     final List<String> parts = OStringSerializerHelper.smartSplit(iURL, OHttpResponse.URL_SEPARATOR, 1, -1, true, true, false,
         false);
     if (parts.size() < iArgumentCount)
       throw new OHttpRequestException(iSyntax);

     return parts.toArray(new String[parts.size()]);
   }
View Full Code Here

     switch (propertyType) {
     case LINKLIST:
     case LINKMAP:
     case LINKSET: {
       if (urlParts.length < 6) {
         throw new OHttpRequestException("Syntax error: property named " + propertyName + " is declared as " + propertyType
             + " but linked type is not declared: property/<database>/<class-name>/<property-name>/<property-type>/<link-type>");
       }
       final OType linkType = OType.valueOf(urlParts[5]);
       final OClass linkClass = db.getMetadata().getSchema().getClass(urlParts[5]);
       if (linkType != null && linkClass != null) {
         throw new IllegalArgumentException(
             "linked type declared as "
                 + urlParts[5]
                 + " can be either a Type or a Class, use the JSON document usage instead. See 'http://code.google.com/p/orient/w/edit/OrientDB_REST'");
       } else if (linkType != null) {
         final OProperty prop = cls.createProperty(propertyName, propertyType, linkType);
       } else if (linkClass != null) {
         final OProperty prop = cls.createProperty(propertyName, propertyType, linkClass);
       } else {
         throw new IllegalArgumentException("property named " + propertyName + " is declared as " + propertyType
             + " but linked type is not declared");
       }
     }
       break;
     case LINK: {
       if (urlParts.length < 6) {
         throw new OHttpRequestException("Syntax error: property named " + propertyName + " is declared as " + propertyType
             + " but linked type is not declared: property/<database>/<class-name>/<property-name>/<property-type>/<link-type>");
       }
       final String linkClass = urlParts[5];
       if (linkClass != null) {
         final OProperty prop = cls.createProperty(propertyName, propertyType, db.getMetadata().getSchema().getClass(linkClass));
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.server.network.protocol.http.OHttpRequestException

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.