Package org.wso2.carbon.dataservices.core

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


        int yTop = getStartIconYTop();
        org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates coords = null;
        if (layoutManager.isVerticalLayout()) {
            coords = new org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates(xLeft, yTop);
        } else {
            coords = new SVGCoordinates(yTop, xLeft);
        }
        // Check Sub Activities
        if (subActivities != null && subActivities.size() > 0) {
            org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = subActivities.get(0);
            coords = activity.getEntryArrowCoords();
View Full Code Here


    public org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates getExitArrowCoords() {
        int xLeft = getStartIconXLeft() + (getStartIconWidth() / 2);
        int yTop = getStartIconYTop();
        org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates coords = null;
        if (layoutManager.isVerticalLayout()) {
            coords = new SVGCoordinates(xLeft, yTop);
        } else {
            coords = new org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates(yTop, xLeft);
        }
        // Check Sub Activities
        if (subActivities != null && subActivities.size() > 0) {
View Full Code Here

        if (subActivities != null) {
            ActivityInterface prevActivity = null;
            ActivityInterface activity = null;
            String id = null;
            org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates exitCoords = null;
            SVGCoordinates entryCoords = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = subActivities.iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                if (prevActivity != null) {
                    exitCoords = prevActivity.getExitArrowCoords();
                    entryCoords = activity.getEntryArrowCoords();
                    id = prevActivity.getId() + "-" + activity.getId();
                    subGroup.appendChild(getArrowDefinition(doc, exitCoords.getXLeft(),
                        exitCoords.getYTop(), entryCoords.getXLeft(),
                        entryCoords.getYTop(), id, prevActivity, activity));
                }
                prevActivity = activity;
            }
        }
        return subGroup;
View Full Code Here

    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing();
            width += getXSpacing();
View Full Code Here

    super(dataService, queryId, queryParams, result, configId, inputEventTrigger,
        outputEventTrigger,  advancedProperties, inputNamespace);
    try {
        this.config = (ExcelConfig) this.getDataService().getConfig(this.getConfigId());
    } catch (ClassCastException e) {
      throw new DataServiceFault(e, "Configuration is not an Excel config:" +
          this.getConfigId());
    }   
    this.workbookName = workbookName;
    this.hasHeader = hasHeader;
    this.startingRow = startingRow;
    this.maxRowCount = maxRowCount;   
    if (DBUtils.isRegistryPath(config.getExcelDataSourcePath())) {
      /* register registry service listener */
      DataServicesDSComponent.registerRegistryServiceListener(this);
    } else {
      try {
        this.columnMappings = DBUtils.createColumnMappings(this.getHeader());
      } catch (Exception e) {
        throw new DataServiceFault(e, "Error in creating Excel column mappings.");
     

    }
   
  }
View Full Code Here

          count++;
        }
       
        return null;
    } catch (Exception e) {
      throw new DataServiceFault(e, "Error in ExcelQuery.runQuery.");
    }
  }
View Full Code Here

      this.keyColumns = keyColumns;
    this.query = query;
    try {
        this.config = (SQLConfig) this.getDataService().getConfig(this.getConfigId());
    } catch (ClassCastException e) {
      throw new DataServiceFault(e, "Configuration is not an SQL config:" +
          this.getConfigId());
    }
    init ();
   
  }
View Full Code Here

          ResultSet rs = this.getStoredProcFuncProps(
              this.extractStoredProcName(true));
          if (rs.isLast()) {
            rs = this.getStoredProcFuncProps(this.extractStoredProcName(false));
            if (rs.isLast()) {
              throw new DataServiceFault(
                  "Cannot find metadata for the stored procedure");
            }
          }
          /* stored procedures here can only have IN params and results which only
           * returns an integer, which has the update count,
           * all other situations are not supported for batch updates */
          StoredProcMetadataCollection mdCollection = new StoredProcMetadataCollection(rs);
          for (StoredProcMetdataEntry entry : mdCollection.getEntries()) {
            switch (entry.getColumnReturn()) {
            case DatabaseMetaData.procedureColumnIn:             
              break;
            case DatabaseMetaData.procedureColumnReturn:
              if (!(entry.getColumnDataType() == Types.INTEGER ||
                  entry.getColumnDataType() == Types.BIGINT
                  || entry.getColumnDataType() == Types.DECIMAL)) {
                return false;
              }
              break;
            default:
              return false;
            }
          }
          return true;
        } catch (SQLException e) {
          throw new DataServiceFault(e, "Error in retrieving database metadata");
        }
      } else {
        return true;
      }
    } else {
View Full Code Here

      if (AdvancedSQLProps.FETCH_DIRECTION_FORWARD.equals(fetchDirectionProp)) {
        this.fetchDirection = ResultSet.FETCH_FORWARD;
      } else if (AdvancedSQLProps.FETCH_DIRECTION_REVERSE.equals(fetchDirectionProp)) {
        this.fetchDirection = ResultSet.FETCH_REVERSE;
      } else {
        throw new DataServiceFault("Invalid fetch direction: " + fetchDirectionProp +
            ", valid values are {'" +  AdvancedSQLProps.FETCH_DIRECTION_FORWARD +
            "', '" + AdvancedSQLProps.FETCH_DIRECTION_REVERSE + "'}");
      }
      this.hasFetchDirection = true;     
    } else {
      this.hasFetchDirection = false;
    }
    /* process fetch size */
    String fetchSizeProp = props.get(RDBMS.FETCH_SIZE);
    if (!DBUtils.isEmptyString(fetchSizeProp)) {     
      fetchSizeProp = fetchSizeProp.trim();
      try {
        this.fetchSize = Integer.parseInt(fetchSizeProp);       
      } catch (NumberFormatException e) {
        throw new DataServiceFault(e, "Invalid fetch size: " + fetchSizeProp +
            ", fetch size should be an integer");
      }
      this.hasFetchSize = true;
    } else {
      this.hasFetchSize = false;
    }
    /* process max field size */
    String maxFieldSizeProp = props.get(RDBMS.MAX_FIELD_SIZE);
    if (!DBUtils.isEmptyString(maxFieldSizeProp)) {
      maxFieldSizeProp = maxFieldSizeProp.trim();
      try {
        this.maxFieldSize = Integer.parseInt(maxFieldSizeProp);
        if (this.maxFieldSize <= 0) {
          throw new DataServiceFault("Invalid maximum field size: " + maxFieldSizeProp +
              ", maximum field size should be a positive integer");
        }
      } catch (NumberFormatException e) {
        throw new DataServiceFault(e, "Invalid maximum field size: " + maxFieldSizeProp +
            ", maximum field size should be a positive integer");
      }
      this.hasMaxFieldSize = true;     
    } else {
      this.hasMaxFieldSize = false;
    }
    /* process max rows */
    String maxRowsProp = props.get(RDBMS.MAX_ROWS);
    if (!DBUtils.isEmptyString(maxRowsProp)) {
      maxRowsProp = maxRowsProp.trim();
      try {
        this.maxRows = Integer.parseInt(maxRowsProp);
        if (this.maxRows <= 0) {
          throw new DataServiceFault("Invalid maximum rows: " + maxRowsProp +
              ", maximum rows should be a positive integer");
        }
      } catch (NumberFormatException e) {
        throw new DataServiceFault(e, "Invalid maximum rows: " + maxRowsProp +
              ", maximum rows should be a positive integer");
      }
      this.hasMaxRows = true;     
    } else {
      this.hasMaxRows = false;
    }
    /* process query timeout */
    String queryTimeoutProp = props.get(RDBMS.QUERY_TIMEOUT);
    if (!DBUtils.isEmptyString(queryTimeoutProp)) {
      queryTimeoutProp = queryTimeoutProp.trim();
      try {
        this.queryTimeout = Integer.parseInt(queryTimeoutProp);
        if (this.queryTimeout <= 0) {
          throw new DataServiceFault("Invalid query timeout: " + queryTimeoutProp +
              ", query timeout be a positive integer");
        }
      } catch (NumberFormatException e) {
        throw new DataServiceFault(e, "Invalid query timeout: " + queryTimeoutProp +
              ", query timeout be a positive integer");
      }
      this.hasQueryTimeout = true;     
    } else {
      this.hasQueryTimeout = false;
    }
    /* auto commit */
    /* first check local auto commit setting */
    String autoCommitProp = props.get(RDBMS.AUTO_COMMIT);
    if (!DBUtils.isEmptyString(autoCommitProp)) {
      autoCommitProp = autoCommitProp.trim();
      try {
        boolean acBool = Boolean.parseBoolean(autoCommitProp);
        if (acBool) {
          this.autoCommit = AutoCommit.AUTO_COMMIT_ON;
        } else {
          this.autoCommit = AutoCommit.AUTO_COMMIT_OFF;
        }
      } catch (Exception e) {
        throw new DataServiceFault(e, "Invalid autocommit value: " + autoCommitProp +
              ", autocommit should be a boolean value");
      }           
    } else {
      /* global auto commit setting */
      this.autoCommit = this.getConfig().getAutoCommit();
View Full Code Here

    int i;
    for (i = 0; i < indices.length; i++) {
      tmpParam = params.getParam(indices[i]);
      remainingParams.remove(tmpParam);
      if (tmpParam == null) {
        throw new DataServiceFault(
            "A parameter is expected at position '" + (i + 1)
                + "' for the SQL query '" + this.getQuery() + "'");
      }
      if (indices[i] >= 0) {
          newParams.addParam(new InternalParam(tmpParam, i + 1));
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.