use of org.locationtech.geogig.api.RevPersonImpl in project GeoGig by boundlessgeo.
the class HashObjectTest method testHashTags.
@Test
public void testHashTags() throws Exception {
RevPerson tagger = new RevPersonImpl("volaya", "volaya@boundlessgeo.com", -1000, -1);
RevPerson tagger2 = new RevPersonImpl("groldan", "groldan@boundlessgeo.com", 10000, 0);
RevTag tag = new RevTagImpl(null, "tag1", ObjectId.forString("fake commit id"), "message", tagger);
RevTag tag2 = new RevTagImpl(null, "tag2", ObjectId.forString("another fake commit id"), "another message", tagger2);
ObjectId tagId = hashCommand.setObject(tag).call();
ObjectId tagId2 = hashCommand.setObject(tag2).call();
assertNotNull(tagId);
assertNotNull(tagId2);
assertNotSame(tagId, tagId2);
}
use of org.locationtech.geogig.api.RevPersonImpl in project GeoGig by boundlessgeo.
the class TagCreateOp method resolveTagger.
private RevPerson resolveTagger() {
final String nameKey = "user.name";
final String emailKey = "user.email";
Optional<String> name = command(ConfigGet.class).setName(nameKey).call();
Optional<String> email = command(ConfigGet.class).setName(emailKey).call();
checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", nameKey, nameKey);
checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailKey, emailKey);
String taggerName = name.get();
String taggerEmail = email.get();
Platform platform = platform();
long taggerTimeStamp = platform.currentTimeMillis();
int taggerTimeZoneOffset = platform.timeZoneOffset(taggerTimeStamp);
return new RevPersonImpl(taggerName, taggerEmail, taggerTimeStamp, taggerTimeZoneOffset);
}
use of org.locationtech.geogig.api.RevPersonImpl in project GeoGig by boundlessgeo.
the class FormatCommonV2 method readRevPerson.
public static final RevPerson readRevPerson(DataInput in) throws IOException {
final String name = in.readUTF();
final String email = in.readUTF();
final long timestamp = readUnsignedVarLong(in);
final int tzOffset = readUnsignedVarInt(in);
return new RevPersonImpl(name.length() == 0 ? null : name, email.length() == 0 ? null : email, timestamp, tzOffset);
}
Aggregations