use of org.bedework.calsvci.CalSvcIPars in project bw-calendar-engine by Bedework.
the class AbstractScheduler method getSvci.
/**
* Get an svci object as a different user.
*
* @param principalHref
* @return CalSvcI
* @throws CalFacadeException
*/
protected CalSvcI getSvci(final String principalHref) throws CalFacadeException {
CalSvcI svci;
/* account is what we authenticated with.
* user, if non-null, is the user calendar we want to access.
*/
CalSvcIPars runAsPars = CalSvcIPars.getServicePars("scheduler", // principal.getAccount(),
principalHref, // publicAdmin
false, // allow SuperUser
"/principals/users/root".equals(principalHref));
svci = new CalSvcFactoryDefault().getSvc(runAsPars);
setSvc(svci);
svci.open();
svci.beginTransaction();
return svci;
}
use of org.bedework.calsvci.CalSvcIPars in project bw-calendar-engine by Bedework.
the class BwDumpRestore method getSvci.
/**
* Get an svci object and return it. Also embed it in this object.
*
* @return svci object
* @throws CalFacadeException on fatal error
*/
private CalSvcI getSvci(final String owner, final boolean publick) throws CalFacadeException {
if ((svci != null) && svci.isOpen()) {
return svci;
}
boolean publicAdmin = false;
if ((curSvciOwner == null) || !curSvciOwner.equals(owner)) {
svci = null;
curSvciOwner = owner;
publicAdmin = publick;
}
if (svci == null) {
final CalSvcIPars pars = CalSvcIPars.getIndexerPars(curSvciOwner, publicAdmin);
// CalSvcIPars pars = CalSvcIPars.getServicePars(curSvciOwner,
// publicAdmin, // publicAdmin
// true); // Allow super user
svci = new CalSvcFactoryDefault().getSvc(pars);
}
svci.open();
svci.beginTransaction();
return svci;
}
use of org.bedework.calsvci.CalSvcIPars in project bw-calendar-engine by Bedework.
the class BwSysIntfImpl method getSvci.
private CalSvcI getSvci(final String account, final String runAs, final boolean service, final boolean publicAdmin, final String clientId, final boolean allowCreateEprops) throws WebdavException {
try {
/* account is what we authenticated with.
* user, if non-null, is the user calendar we want to access.
*/
final boolean possibleSuperUser = // allow SuperUser
"root".equals(account) || "admin".equals(account);
String runAsUser = null;
String clientIdent = null;
if (possibleSuperUser) {
runAsUser = runAs;
clientIdent = clientId;
}
final CalSvcIPars pars = CalSvcIPars.getCaldavPars("bwcaldav", account, runAsUser, clientIdent, // allow SuperUser
possibleSuperUser, service, publicAdmin, allowCreateEprops);
svci = new CalSvcFactoryDefault().getSvc(pars);
svci.open();
svci.beginTransaction();
trans = new IcalTranslator(svci.getIcalCallback());
} catch (Throwable t) {
throw new WebdavException(t);
}
return svci;
}
use of org.bedework.calsvci.CalSvcIPars in project bw-calendar-engine by Bedework.
the class SystemConf method getSvci.
/* ====================================================================
* Private methods
* ==================================================================== */
/**
* Get an svci object and return it. Also embed it in this object.
*
* @return svci object
* @throws org.bedework.calfacade.exc.CalFacadeException
*/
private CalSvcI getSvci() throws CalFacadeException {
if (getConfig() == null) {
return null;
}
if ((svci != null) && svci.isOpen()) {
return svci;
}
if (getRootUsers() == null) {
return null;
}
final String[] rootUsers = getRootUsers().split(",");
if ((rootUsers.length == 0) || (rootUsers[0] == null)) {
return null;
}
final CalSvcIPars pars = CalSvcIPars.getServicePars(getServiceName(), rootUsers[0], // publicAdmin
true, // Allow super user
true);
svci = new CalSvcFactoryDefault().getSvc(pars);
svci.open();
svci.beginTransaction();
return svci;
}
use of org.bedework.calsvci.CalSvcIPars in project bw-calendar-engine by Bedework.
the class NotificationConf method getSvci.
/* ====================================================================
* Private methods
* ==================================================================== */
/**
* Get an svci object and return it. Also embed it in this object.
*
* @param account of user to run as
* @return svci object
* @throws org.bedework.calfacade.exc.CalFacadeException
*/
private CalSvcI getSvci(final String account) throws CalFacadeException {
if ((svci != null) && svci.isOpen()) {
return svci;
}
if (svci == null) {
final CalSvcIPars pars = CalSvcIPars.getServicePars("notifications", account, // publicAdmin
false, // Allow super user
true);
svci = new CalSvcFactoryDefault().getSvc(pars);
}
svci.open();
svci.beginTransaction();
return svci;
}
Aggregations