Search in sources :

Example 1 with PseudoTime

use of org.structr.net.data.time.PseudoTime in project structr by structr.

the class Delete method deserialize.

@Override
public void deserialize(final DataInputStream dis) throws IOException {
    super.deserialize(dis);
    // dis.readUTF();
    this.objectId = deserializeUUID(dis);
    this.time = new PseudoTime();
    time.deserialize(dis);
}
Also used : PseudoTime(org.structr.net.data.time.PseudoTime)

Example 2 with PseudoTime

use of org.structr.net.data.time.PseudoTime in project structr by structr.

the class Get method deserialize.

@Override
public void deserialize(final DataInputStream dis) throws IOException {
    super.deserialize(dis);
    // dis.readUTF();
    this.recipient = deserializeUUID(dis);
    // dis.readUTF();
    this.objectId = deserializeUUID(dis);
    // dis.readUTF();
    this.transactionId = deserializeUUID(dis);
    this.key = dis.readUTF();
    this.time = new PseudoTime();
    time.deserialize(dis);
}
Also used : PseudoTime(org.structr.net.data.time.PseudoTime)

Example 3 with PseudoTime

use of org.structr.net.data.time.PseudoTime in project structr by structr.

the class GetHistory method deserialize.

@Override
public void deserialize(final DataInputStream dis) throws IOException {
    super.deserialize(dis);
    // dis.readUTF();
    this.recipient = deserializeUUID(dis);
    // dis.readUTF();
    this.objectId = deserializeUUID(dis);
    this.instant = new PseudoTime();
    instant.deserialize(dis);
}
Also used : PseudoTime(org.structr.net.data.time.PseudoTime)

Example 4 with PseudoTime

use of org.structr.net.data.time.PseudoTime in project structr by structr.

the class GetHistory method onMessage.

@Override
public void onMessage(Peer peer, PeerInfo sender) {
    if (peer.getUuid().equals(recipient)) {
        final RepositoryObject obj = peer.getRepository().getObject(objectId);
        if (obj != null) {
            final PseudoTime lastModified = obj.getLastModificationTime();
            if (lastModified.before(instant)) {
                final Map<String, Object> data = obj.getProperties(instant);
                peer.log("History(", objectId, ")");
                peer.broadcast(new History(peer.getUuid(), getSender(), objectId, obj.getType(), obj.getUserId(), obj.getCreationTime(), lastModified, data));
            } else {
                peer.log("GetHistory(", objectId, "): not modified");
            }
        } else {
            peer.log("GetHistory(", objectId, "): object not found");
        }
    }
}
Also used : PseudoTime(org.structr.net.data.time.PseudoTime) RepositoryObject(org.structr.net.repository.RepositoryObject) RepositoryObject(org.structr.net.repository.RepositoryObject)

Example 5 with PseudoTime

use of org.structr.net.data.time.PseudoTime in project structr by structr.

the class Inventory method deserialize.

@Override
public void deserialize(final DataInputStream dis) throws IOException {
    super.deserialize(dis);
    // dis.readUTF();
    this.objectId = deserializeUUID(dis);
    // dis.readUTF();
    this.owner = deserializeUUID(dis);
    this.lastModificationDate = new PseudoTime();
    this.lastModificationDate.deserialize(dis);
}
Also used : PseudoTime(org.structr.net.data.time.PseudoTime)

Aggregations

PseudoTime (org.structr.net.data.time.PseudoTime)14 RepositoryObject (org.structr.net.repository.RepositoryObject)4 LinkedList (java.util.LinkedList)2 GraphObject (org.structr.core.GraphObject)2 HashMap (java.util.HashMap)1