Revision 9512 org.gvsig.online/trunk/org.gvsig.online/org.gvsig.online.lib/org.gvsig.online.lib.impl/src/main/java/org/gvsig/online/lib/impl/workspace/tables/EntitiesTable.java
EntitiesTable.java | ||
---|---|---|
185 | 185 |
return changesTable.getCountLocalChangesOfEntity(workspace, transaction, this.getCode()); |
186 | 186 |
} |
187 | 187 |
|
188 |
public long getCountRemoteChanges(DataTransaction transaction) { |
|
189 |
RemoteChangesTable changesTable = new RemoteChangesTable(); |
|
190 |
return changesTable.getCountRemoteChangesOfEntity(workspace, transaction, this.getCode()); |
|
191 |
} |
|
192 |
|
|
188 | 193 |
/** |
189 | 194 |
* Actualiza el estado si es necesario y retorna cierto si este ha cambiado. |
190 | 195 |
* @return |
... | ... | |
278 | 283 |
if(this.isOutdated()){ |
279 | 284 |
state = OnlineManager.STATE_LOCAL_OUTDATED_AND_MODIFIED; |
280 | 285 |
} |
281 |
this.setState(state); |
|
282 | 286 |
} else { |
283 | 287 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
284 | 288 |
} |
285 | 289 |
this.setState(state); |
286 | 290 |
break; |
287 | 291 |
case OnlineManager.STATE_CONFLICT: |
292 |
//TODO: Migrar a VCSGIS |
|
293 |
long countLocalChanges = this.getCountLocalChanges(transaction); |
|
294 |
long countRemoteChanges = this.getCountRemoteChanges(transaction); |
|
295 |
if (countRemoteChanges < 1 && countLocalChanges < 1) { |
|
296 |
state = OnlineManager.STATE_LOCAL_UNMODIFIED; |
|
297 |
} else if (countRemoteChanges < 1 && countLocalChanges > 0) { |
|
298 |
state = OnlineManager.STATE_LOCAL_MODIFIED; |
|
299 |
} else if (countRemoteChanges > 0 && countLocalChanges < 1) { |
|
300 |
state = OnlineManager.STATE_REMOTE_MODIFIED; |
|
301 |
} else if (countRemoteChanges > 0 && countLocalChanges > 0) { |
|
302 |
state = OnlineManager.STATE_CONFLICT; |
|
303 |
} else { |
|
304 |
LOGGER.warn("Por aqui no deberia pasar"); |
|
305 |
state = OnlineManager.STATE_CORRUPT; |
|
306 |
} |
|
307 |
this.setState(state); |
|
288 | 308 |
break; |
309 |
|
|
289 | 310 |
default: |
290 | 311 |
if(this.isOutdated()){ |
291 | 312 |
state = OnlineManager.STATE_LOCAL_OUTDATED; |
Also available in: Unified diff