Exemplo n.º 1
0
  protected void deleteServerObject(String ticketId) throws Exception {
    Ticket ticket = (Ticket) this.ticketConnector.read(ticketId);

    this.ticketConnector.delete(ticket);

    List serverChangeLog = new ArrayList();
    ChangeLogEntry serverEntry = new ChangeLogEntry();
    serverEntry.setNodeId(this.runner.getService());
    serverEntry.setOperation(ServerSyncEngine.OPERATION_DELETE);
    serverEntry.setRecordId(ticketId);
    serverChangeLog.add(serverEntry);
    this.serverSyncEngine.addChangeLogEntries(
        this.runner.getDeviceId(), this.runner.getApp(), serverChangeLog);
  }
Exemplo n.º 2
0
  // -----------------------------------------------------------------------------------------------------------------------
  protected String createNewServerObject() throws Exception {
    Ticket ticket = this.dataGenerator.generateTransientData("ticket://new");
    String ticketId = this.ticketConnector.getTicketds().create(ticket);
    ticket = this.ticketConnector.getTicketds().readByTicketId(ticketId);

    List serverChangeLog = new ArrayList();
    ChangeLogEntry serverEntry = new ChangeLogEntry();
    serverEntry.setNodeId(this.runner.getService());
    serverEntry.setOperation(ServerSyncEngine.OPERATION_ADD);
    serverEntry.setRecordId(ticket.getTicketId());
    serverChangeLog.add(serverEntry);
    this.serverSyncEngine.addChangeLogEntries(
        this.runner.getDeviceId(), this.runner.getApp(), serverChangeLog);

    return ticket.getTicketId();
  }