Package org.wso2.carbon.dataservices.core

Examples of org.wso2.carbon.dataservices.core.DataServiceFault


          prefetchData, prefetchedData);
    } else if (type == SQLQuery.DS_QUERY_TYPE_STORED_PROC) {
      return this.processStoredProcQuery(xmlWriter, params, queryLevel,
          prefetchData, prefetchedData);
    } else {
      throw new DataServiceFault("Unsupported query type: " + type);
    }
  }
View Full Code Here


          } else {
              /* process the result of the request, no need to cache the data */
              result.serializeAndConsume(new NullOutputStream());
          }
        } catch (XMLStreamException e) {
          throw new DataServiceFault(e, "Error in request box result serializing");
        }
      }
    }
    return null;
  }
View Full Code Here

    if (username != null) {
      /* set user roles */
      try {
        dsRequest.setUserRoles(DBUtils.getUserRoles(msgContext));
      } catch (Exception e) {
        throw new DataServiceFault(e, "Error setting user roles");
      }
    }
  }
View Full Code Here

      return responseElement;
    } else { /* if no response i.e. in-only, execute the request now */
      try {
        ds.executeInOnly();
      } catch (XMLStreamException e) {
        throw new DataServiceFault(e, "Error in DS non result invoke.");
      }
      return null;
    }
  }
View Full Code Here

      return input;
    } else {
      try {
        return transformer.transform(input);
      } catch (Exception e) {
        throw new DataServiceFault(e,
            "Error in result XSLT transformation");
      }
    }
  }
View Full Code Here

          OMElement lastRequestResult = DSSessionManager.getCurrentRequestBox().execute();
          dataService.endTransaction();
          return lastRequestResult;
      } catch (DataServiceFault e) {
        dataService.rollbackTransaction();
        throw new DataServiceFault(e, "Error in boxcarring end");
      } finally {
        DSSessionManager.getCurrentRequestBox().clear();
        DSSessionManager.setBoxcarring(false);
        TLParamStore.clear();
      }     
View Full Code Here

          typeFound = true;
          break;
        }
      }
      if (!typeFound) {
        throw new DataServiceFault("Invalid query param sqlType: '" +
            this.getSqlType() + "'.");
      }
      /* validate type, i.e. IN, INOUT, OUT */
      if (!(QueryTypes.IN.equals(this.getType()) ||
          QueryTypes.OUT.equals(this.getType()) ||
          QueryTypes.INOUT.equals(this.getType()))) {
        throw new DataServiceFault("Invalid query param type: '" + this.getType() + "'.");
      }
      /* validate paramType, i.e. SCALAR, ARRAY .. */
      if (!(QueryParamTypes.SCALAR.equals(this.getParamType()) ||
          QueryParamTypes.ARRAY.equals(this.getParamType()))) {
        throw new DataServiceFault("Invalid query param type: '" +
            this.getParamType() + "'.");
      }
    } catch (Exception e) {
      throw new DataServiceFault(e);
    }
  }
View Full Code Here

      DataServicesDSComponent.registerRegistryServiceListener(this);
    } else {
      try {
        this.columnMappings = DBUtils.createColumnMappings(this.getHeader());
      } catch (IOException e) {
        throw new DataServiceFault("Error in creating CSV column mappings.");
     
    }
  }
View Full Code Here

    this.exportType = exportType;
    this.hasConstantValue = DBSFields.VALUE.equals(paramType);
   
    /* validate element/attribute name */
    if (!NCName.isValid(this.name)) {
      throw new DataServiceFault("Invalid output " + this.elementType + " name: '" +
          this.name + "', must be an NCName.");
    }
  }
View Full Code Here

        }
      }
      if (paramObj != null) {
          return paramObj.getValue().getValueAsString();
      } else {
        throw new DataServiceFault(FaultCodes.INCOMPATIBLE_PARAMETERS_ERROR,
            "Error in 'StaticOutputElement.execute', " +
            "cannot find parameter with type:"
            + this.getParamType() + " name:" + this.getOriginalParam());
      }
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.dataservices.core.DataServiceFault

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.