@Override @NoWrap public int compareTo(final BwCollectionLastmod that) { if (this == that) { return 0; } int res = getTagValue().compareTo(that.getTagValue()); if (res != 0) { return res; } return getPath().compareTo(that.getPath()); }
@Override public Object clone() { BwCollectionLastmod lm = new BwCollectionLastmod(); lm.setPath(getPath()); lm.setSequence(getSequence()); return lm; } }
/** Constructor to set last mod * @param dbEntity * @param timestamp */ public BwCollectionLastmod(final BwCalendar dbEntity, final String timestamp) { super(dbEntity); if (dbEntity != null) { setPath(dbEntity.getPath()); } else { setPath(null); } setTimestamp(timestamp); }
/** * @param vpath the virtual path * @param col the collection * @param canSync false if this cannot do sync report */ public SynchReportItem(final String vpath, final BwCalendar col, final boolean canSync) { this.vpath = vpath; this.col = col; this.canSync = canSync; token = col.getLastmod().getTagValue(); }
/** * @return a version value in microseconds. */ @NoDump @JsonIgnore public long getMicrosecsVersion() throws CalFacadeException { try { return new LastModified(getLastmod().getTimestamp()).getDate().getTime() * 1000000 + getLastmod().getSequence(); } catch (final Throwable t) { throw new CalFacadeException(t); } }
public BwCalendar shallowClone() { final BwCalendar cal = new BwCalendar(); super.copyTo(cal); cal.setName(getName()); cal.setPath(getPath()); cal.setSummary(getSummary()); cal.setDescription(getDescription()); cal.setMailListId(getMailListId()); cal.setCalType(getCalType()); cal.setCreated(getCreated()); final BwCollectionLastmod lm = (BwCollectionLastmod)getLastmod().clone(); lm.setDbEntity(cal); cal.setLastmod(lm); cal.setAliasUri(getAliasUri()); cal.setDisplay(getDisplay()); cal.setAffectsFreeBusy(getAffectsFreeBusy()); cal.setIgnoreTransparency(getIgnoreTransparency()); cal.setUnremoveable(getUnremoveable()); cal.setRefreshRate(getRefreshRate()); cal.setLastRefresh(getLastRefresh()); cal.setLastEtag(getLastEtag()); cal.setFilterExpr(getFilterExpr()); if (!Util.isEmpty(getCategoryHrefs())) { final Set<String> uids = new TreeSet<>(getCategoryHrefs()); cal.setCategoryHrefs(uids); } return cal; }
/** Constructor */ public BwCalendar() { super(); /* Set the lastmod and created */ final Date dt = new Date(); setLastmod(new BwCollectionLastmod(this, dt)); setCreated(DateTimeUtil.isoDateTimeUTC(dt)); }
/** * @return a copy for tombstoning. */ public BwCalendar makeTombstoneCopy() { final BwCalendar col = new BwCalendar(); super.copyTo(col); col.setName(getName()); col.setPath(getPath()); col.setCalType(getCalType()); col.setCreated(getCreated()); col.setLastmod((BwCollectionLastmod)getLastmod().clone()); col.setAliasUri(getAliasUri()); return col; }
/** For an alias where the target lastmod is the token * * @param vpath the virtual path * @param col the collection * @param canSync false if this cannot do sync report * @param token to use */ public SynchReportItem(final String vpath, final BwCalendar col, final boolean canSync, final String token) { this.vpath = vpath; this.col = col; this.canSync = canSync; // token is the greater of the collection token or the supplied token. final String colToken = col.getLastmod().getTagValue(); if (colToken.compareTo(token) > 0) { this.token = colToken; } else { this.token = token; } }
/** * @return valid quoted etag */ @NoDump @IcalProperty(pindex = PropertyInfoIndex.CTAG, jname = "ctag") public String getEtag() { return "\"" + getLastmod().getTagValue() + "\""; }
/** Set the path * * @param val String path */ public void setPath(final String val) { path = val; if (getLastmod() != null) { getLastmod().setPath(val); } }