Examples of DataService


Examples of org.eclipse.egit.github.core.service.DataService

   
    String[] paths = getPaths(outputDirectory);
    String prefix = getPrefix(destinationDirectory);
   
    GitHubClient client = createClient(host, userName, password, oauth2Token);
    DataService service = new DataService(client);
   
    boolean createNoJekyll = noJekyll;
   
    if(createNoJekyll){
      for(String path: paths){
        if (NO_JEKYLL_FILE.equals(path)){
          createNoJekyll = false;
          break;
        }
      }
    }

    // Write blobs and build tree entries
    List<TreeEntry> entries = new ArrayList<TreeEntry>(paths.length);
    if(numThreads <= 1){
      createEntries(entries, prefix, paths, service, repository, outputDirectory);
    }else{
      createEntriesInThreads(entries, prefix, paths, service, repository, outputDirectory, numThreads);
    }
   
    if (createNoJekyll) {
      if (log.isDebugEnabled()){
        log.debug("Creating empty '.nojekyll' blob at root of tree");
      }
      TreeEntry entry = createEntry("", NO_JEKYLL_FILE, service, repository, outputDirectory);
      entries.add(entry);
    }

    Reference ref = getReference(service, repository);
   
    if(dryRun){
      log.debug("Dry run mode, skip deploy.");
      return;
    }

    // Write tree
    Tree tree = createTree(service, repository, ref, entries);

    // Build commit
    Commit commit = new Commit();
    commit.setMessage(message != null ? message : "GitHubWagon: Deploying OpooPress to GitHub Pages.");
    commit.setTree(tree);

    // Set parent commit SHA-1 if reference exists
    if (ref != null){
      commit.setParents(Collections.singletonList(new Commit().setSha(ref.getObject().getSha())));
    }

    Commit created;
    try {
      created = service.createCommit(repository, commit);
      log.info(MessageFormat.format("Creating commit with SHA-1: {0}", created.getSha()));
    } catch (IOException e) {
      throw new GitHubException("Error creating commit: " + e.getMessage(), e);
    }

    TypedResource object = new TypedResource();
    object.setType(TYPE_COMMIT).setSha(created.getSha());
    if (ref != null) {
      // Update existing reference
      ref.setObject(object);
      try {
        log.info(String.format("Updating reference %s from %s to %s", branch, commit.getParents().get(0).getSha(), created.getSha()));
        service.editReference(repository, ref, force);
      } catch (IOException e) {
        throw new GitHubException("Error editing reference: " + e.getMessage(), e);
      }
    } else {
      // Create new reference
      ref = new Reference().setObject(object).setRef(branch);
      try {
        log.info(MessageFormat.format("Creating reference {0} starting at commit {1}", branch, created.getSha()));
        service.createReference(repository, ref);
      } catch (IOException e) {
        throw new GitHubException("Error creating reference: " + e.getMessage(), e);
      }
    }
  }
View Full Code Here

Examples of org.pokenet.server.battle.DataService

    /*
     * Initialize all the services
     */
    m_jythonService = new JythonService();
    m_timeService = new TimeService();
    m_dataService = new DataService();
    m_networkService = new NetworkService();
    m_itemdatabase = new ItemDatabase();
    m_movementService = new MovementService();
    m_idleTimer = new IdleTimer();
    m_sprites = new SpriteList();
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   */
  public void testLocalOperationInvocation1() {
    TestUtils.showMessage("testLocalOperationInvocation1");
    try {
      String filePath = this.getTestDBSDirectory() + "H2BasicService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "select_op_given_fields",
              new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   */
  public void testLocalOperationInvocation2() {
    TestUtils.showMessage("testLocalOperationInvocation2");
    try {
      String filePath = this.getTestDBSDirectory() + "H2InputMappingService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      Map<String, ParamValue> params = new HashMap<String, ParamValue>();
      params.put("orderNumber", new ParamValue("10242"));
      params.put("orderDate", new ParamValue("2004-04-20"));
      OMElement result = DSTools.invokeOperation(dataService, "select_input_mappings_op1", params);
      assertTrue(TestUtils.validateResultStructure(result,
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   */
  public void testLocalOperationInvocation3() {
    TestUtils.showMessage("testLocalOperationInvocation3");
    try {
      String filePath = this.getTestDBSDirectory() + "CSVService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "customer_list_op",
          new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result,
          TestUtils.CUSTOMER_XSD_PATH));
      String val = TestUtils.getFirstValue(result,
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   */
  public void testLocalOperationInvocation4() {
    TestUtils.showMessage("testLocalOperationInvocation4");
    try {
      String filePath = this.getTestDBSDirectory() + "ExcelService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.invokeOperation(dataService, "excel_old_noheader_with_ints_op",
          new HashMap<String, ParamValue>());
      assertTrue(TestUtils.validateResultStructure(result,
          TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   */
  public void testLocalResourceAccess1() {
    TestUtils.showMessage("testLocalResourceAccess1");
    try {
      String filePath = this.getTestDBSDirectory() + "H2BasicService.dbs";
      DataService dataService = DSTools.createDataService(this.loadXML(filePath), filePath);
      OMElement result = DSTools.accessResource(dataService, "customers1",
              new HashMap<String, ParamValue>(), "GET");
      assertTrue(TestUtils.validateResultStructure(result, TestUtils.CUSTOMER_XSD_PATH));
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   * Return the generated service name
   */
  public String getDSService(String dataSourceId, String dbName, String[] schemas,
      String[] tableNames, boolean singleService,String serviceName,String serviceNamespace) throws AxisFault {
    DSGenerator generator = new DSGenerator(dataSourceId, dbName, schemas, tableNames, true,serviceNamespace,serviceName);
    DataService dataservice = generator.getGeneratedService();
    OMElement element = DataServiceSerializer.serializeDataService(dataservice);
    this.saveDataService(dataservice.getName(),  null, element.toString());
    return generator.getGeneratedService().getName();
  }
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

   * Populates the given axis service schema with the data service information it encapsulates.
   * @param axisService The target service
   * @throws DataServiceFault
   */
  public static void populateServiceSchema(AxisService axisService) throws DataServiceFault {
    DataService dataservice = (DataService) axisService.getParameter(
        DBConstants.DATA_SERVICE_OBJECT).getValue();
    CommonParams cparams = new CommonParams(axisService, dataservice);
   
    List<List<Operation>> allOps = extractOperations(dataservice);
    List<Operation> normalOperations = allOps.get(0);
View Full Code Here

Examples of org.wso2.carbon.dataservices.core.engine.DataService

    AxisOperation axisOp = msgContext.getAxisOperation();
    OMElement inputMessage = msgContext.getEnvelope().getBody().getFirstElement();
    /* get operation/request name */
    String requestName = axisOp.getName().getLocalPart();
    /* retrieve the DataService object representing the current data service */
    DataService dataService = (DataService) axisService.getParameter(
        DBConstants.DATA_SERVICE_OBJECT).getValue();
   
    DataServiceRequest dsRequest;
    /* check if batch or single request */
    if (isBatchRequest(inputMessage)) {
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.