/** Copy this to val * * @param val BwPrincipal target */ public void copyTo(final BwPrincipal val) { val.setAccount(getAccount()); val.setPrincipalRef(getPrincipalRef()); val.setId(getId()); val.setSeq(getSeq()); val.setCreated(getCreated()); val.setLogon(getLogon()); val.setLastAccess(getLastAccess()); val.setLastModify(getLastModify()); val.setCategoryAccess(getCategoryAccess()); val.setLocationAccess(getLocationAccess()); val.setContactAccess(getContactAccess()); val.setGroups(getGroups()); // XXX this should be cloned }
/** Constructor * * @param account */ public SAICalCallback(final String account) { principal = BwPrincipal.makeUserPrincipal(); principal.setAccount(account); }
@Override public int compareTo(final BwPrincipal o) { return compare(this, o); }
/** * @param whoType - type of principal * @return a principal based on type - null if unknown. */ public static BwPrincipal makePrincipal(final int whoType) { if (whoType == WhoDefs.whoTypeUser) { return makeUserPrincipal(); } if (whoType == WhoDefs.whoTypeGroup) { return makeGroupPrincipal(); } if (whoType == WhoDefs.whoTypeVenue) { return makeLocationPrincipal(); } return null; }
@Override protected void toStringSegment(final ToString ts) { super.toStringSegment(ts); ts.append("account", getAccount()) .append("pref", getPrincipalRef()) .append("created", getCreated()) .newLine() .append("logon", getLogon()) .append("lastAccess", getLastAccess()) .append("lastModify", getLastModify()) .append("kind", getKind()); ts.append("quota", getQuota()); }
public String getHref() { return getPrincipalRef(); }
if (principal.getKind() == Ace.whoTypeUser) { homeDir = userRoot; } else { homeDir = Util.pathElement(1, principal.getPrincipalRef()); homeDir, "/", principal.getAccount(), "/", colPathElement,
).getPath(), "UTF-8"); if (!isPrincipal(uri)) { return null; p = new BwAdminGroup(); } else { p = makePrincipal(whoType); p.setAccount(who); p.setPrincipalRef(uri); return p;
/** Add a principal to the ToString object * * @param ts ToString object * @param name tag * @param val BwPrincipal */ public static void toStringSegment(final ToString ts, final String name, final BwPrincipal val) { if (val == null) { ts.append(name, "**NULL**"); } else { ts.append(name, "(" + val.getId() + ", " + val.getPrincipalRef() + ")"); } }
@Override protected void toStringSegment(final ToString ts) { super.toStringSegment(ts); Collection<String> refs = new ArrayList<String>(); Collection<BwPrincipal> ms = getGroupMembers(); if (ms != null) { for (BwPrincipal mbr: ms) { refs.add(mbr.getPrincipalRef()); } } ts.newLine().append("groupMembers", refs); }
@Override public int compare(final BwPrincipal p1, final BwPrincipal p2) { if (p1.getKind() < p2.getKind()) { return -1; } if (p1.getKind() > p2.getKind()) { return 1; } return CalFacadeUtil.compareStrings(p1.getAccount(), p2.getAccount()); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("UnknownTimezoneInfo(owner="); sb.append(owner.getAccount()); sb.append(", tzid="); sb.append(tzid); sb.append(")"); return sb.toString(); } }
/** Copy this to val without members * * @param val BwGroup target */ public void shallowCopyTo(final BwGroup val) { super.copyTo(val); }
@Override public boolean equals(final Object o) { return compareTo((BwPrincipal)o) == 0; }
/** * @param val * @param methodType * @param pattern * @return JSON jcal * @throws CalFacadeException */ public String toJcal(final EventInfo val, final int methodType, final IcalendarType pattern) throws CalFacadeException { String currentPrincipal = null; BwPrincipal principal = cb.getPrincipal(); if (principal != null) { currentPrincipal = principal.getPrincipalRef(); } List<EventInfo> eis = new ArrayList<>(); eis.add(val); return JcalHandler.toJcal(eis, methodType, pattern, currentPrincipal, new EventTimeZonesRegistry(this, val.getEvent())); }
if (principal.getKind() == Ace.whoTypeUser) { homeDir = props.getUserCalendarRoot(); } else { homeDir = Util.pathElement(1, principal.getPrincipalRef()); homeDir, "/", principal.getAccount(), "/", props.getBedeworkResourceDirectory(),
/** * @return String[] account name split on "/" */ @NoDump @JsonIgnore public String[] getAccountSplit() { final String res = getAccount(); if (!res.contains("/")) { return new String[]{res}; } return res.split("/"); }
/** Copy this to val * * @param val BwUser */ public void copyTo(final BwLocpr val) { super.copyTo(val); }
@Override public int compareTo(final UnknownTimezoneInfo that) { if (this == that) { return 0; } int res = owner.compareTo(that.owner); if (res != 0) { return res; } return tzid.compareTo(that.tzid); }