public abstract class CalSvcI extends Object implements AutoCloseable, Serializable
This is a high level interface which carries out commonly used calendar operations which may involve a number of interactions with the underlying database implementation.
Within the bedework system events and todos are treated identically. An entity type field defines which is what and allows filtering based on type of entity. Explicit calls to fetch an event always return the addressed object which may be an event or a todo.
Calls for collections of event objects may include filters to specify which type of entity is desired.
| Constructor and Description |
|---|
CalSvcI() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
beginTransaction()
Start a (possibly long-running) transaction.
|
abstract void |
changeAccess(BwShareableDbentity ent,
Collection<org.bedework.access.Ace> aces,
boolean replaceAll)
Change the access to the given calendar entity.
|
abstract org.bedework.access.CurrentAccess |
checkAccess(BwShareableDbentity ent,
int desiredAccess,
boolean returnResult)
Check the access for the given entity.
|
abstract void |
close()
Call on the way out after handling a request..
|
abstract void |
defaultAccess(BwShareableDbentity ent,
org.bedework.access.AceWho who)
Remove any explicit access for the given who to the given calendar entity.
|
abstract void |
dumpDbStats()
Dump db statistics
|
abstract void |
endTransaction()
End a (possibly long-running) transaction.
|
abstract BwGroup |
findGroup(String account,
boolean admin)
Find a group given its account name
|
abstract void |
flushAll()
Flush any backend data we may be hanging on to ready for a new
sequence of interactions.
|
abstract List<IfInfo> |
getActiveIfInfos() |
abstract Directories |
getAdminDirectories()
Get a Groups object for administrators.
|
abstract AdminI |
getAdminHandler()
Obtain an object which handles admin functions
|
abstract AuthProperties |
getAuthProperties()
Return properties about the system that depend on authentication state.
|
abstract AuthProperties |
getAuthProperties(boolean auth)
Return properties about the system that depend on authentication state.
|
abstract BasicSystemProperties |
getBasicSystemProperties()
Return basic properties about the system.
|
abstract Blob |
getBlob(byte[] val) |
abstract CalendarsI |
getCalendarsHandler()
Obtain an object which handles calendars
|
abstract CalSuitesI |
getCalSuitesHandler()
Obtain an object which handles calendar suites
|
abstract Categories |
getCategoriesHandler()
Return the categories maintenance object.
|
abstract Contacts |
getContactsHandler()
Return the contacts maintenance object.
|
abstract Timestamp |
getCurrentTimestamp()
Only valid during a transaction.
|
abstract Collection<BwStats.StatsEntry> |
getDbStats()
Get db statistics
|
abstract boolean |
getDbStatsEnabled() |
abstract Directories |
getDirectories()
Return an object to handle directory information.
|
abstract DumpIntf |
getDumpHandler()
Obtain a dump handler
|
abstract EventsI |
getEventsHandler()
Obtain an object which handles events
|
abstract SimpleFilterParser |
getFilterParser()
Obtain a filter parser
|
abstract FiltersI |
getFiltersHandler()
Obtain an object which handles filters
|
abstract IcalCallback |
getIcalCallback() |
abstract IcalCallback |
getIcalCallback(Boolean timezonesByReference) |
abstract IfInfo |
getIfInfo() |
abstract BwIndexer |
getIndexer(boolean publick,
String docType) |
abstract BwIndexer |
getIndexer(BwOwnedDbentity entity) |
abstract BwIndexer |
getIndexer(String principal,
String docType) |
abstract BwIndexer |
getIndexerForReindex(String principal,
String docType,
String name)
.
|
abstract IndexProperties |
getIndexProperties()
Return properties for indexing.
|
abstract Locations |
getLocationsHandler()
Return the locations maintenance object.
|
abstract MailerIntf |
getMailer()
Get currently configured mailer.
|
abstract NotificationProperties |
getNotificationProperties()
Return notification properties.
|
abstract NotificationsI |
getNotificationsHandler()
Obtain an object which handles notifications
|
abstract <T> Iterator<T> |
getObjectIterator(Class<T> cl) |
abstract BwPreferences |
getPreferences(String principalHref)
Fetch the preferences for the given principal href.
|
abstract PreferencesI |
getPrefsHandler()
Obtain an object which handles user preferences
|
abstract BwPrincipal |
getPrincipal()
Returns an object representing the current principal.
|
abstract BwPrincipal |
getPrincipal(String href)
Find the principal with the given href.
|
abstract PrincipalInfo |
getPrincipalInfo()
This structure is set up early during init.
|
abstract <T> Iterator<T> |
getPrincipalObjectIterator(Class<T> cl) |
abstract byte[] |
getPublicKey(String domain,
String service)
Returns a public key for the given domain and service - either or both of
which may be null.
|
abstract <T> Iterator<T> |
getPublicObjectIterator(Class<T> cl) |
abstract ResourcesI |
getResourcesHandler()
Obtain an object which handles resources
|
abstract RestoreIntf |
getRestoreHandler()
Obtain a restore handler
|
abstract SchedulingI |
getScheduler()
Get an object which implements scheduling methods.
|
abstract SharingI |
getSharingHandler()
Obtain an object which handles sharing
|
abstract BwStats |
getStats()
Get the current stats
|
abstract boolean |
getSuperUser() |
abstract SynchI |
getSynch()
Get an object which interacts with the synch engine.
|
abstract SynchReport |
getSynchReport(String path,
String token,
int limit,
boolean recurse) |
abstract SysparsI |
getSysparsHandler()
Obtain an object which handles system parameters
|
abstract SystemProperties |
getSystemProperties()
Return properties about the system.
|
abstract UserAuth |
getUserAuth()
Get an initialised UserAuth object for the current user.
|
abstract Directories |
getUserDirectories()
Get a Groups object for non-admin users.
|
abstract long |
getUserMaxEntitySize() |
abstract UsersI |
getUsersHandler()
Obtain an object which handles user objects
|
abstract ViewsI |
getViewsHandler()
Obtain an object which handles views
|
abstract void |
init(CalSvcIPars pars)
(Re)initialise the object for a particular use.
|
abstract boolean |
isOpen() |
abstract boolean |
isRolledback() |
abstract void |
kill(IfInfo ifInfo)
Kill an errant interface.
|
abstract void |
logStats()
Log the current stats
|
abstract BwUnversionedDbentity |
merge(BwUnversionedDbentity val)
Call to merge an entity with the current database session
|
abstract void |
open()
Signal the start of a sequence of operations.
|
abstract void |
postNotification(SysEventBase ev)
Send a notification event
|
abstract void |
reAttach(BwDbentity val)
Call to reassociate an entity with the current database session
|
abstract void |
removeFromAllPrefs(BwShareableDbentity val)
Remove any refs to this object
|
abstract void |
rollbackTransaction()
Call if there has been an error during an update process.
|
abstract void |
setCalSuite(String name)
Set the calendar suite we are running as.
|
abstract void |
setDbStatsEnabled(boolean enable)
Enable/disable db statistics
|
abstract void |
setState(String val) |
abstract UpdateFromTimeZonesInfo |
updateFromTimeZones(String colHref,
int limit,
boolean checkOnly,
UpdateFromTimeZonesInfo info)
Update the system after changes to timezones.
|
public abstract void init(CalSvcIPars pars) throws CalFacadeException
pars - Defines the global parameters for the objectCalFacadeExceptionpublic abstract BasicSystemProperties getBasicSystemProperties()
public abstract AuthProperties getAuthProperties()
public abstract AuthProperties getAuthProperties(boolean auth)
auth - - true for auth proiperties false for unauthpublic abstract SystemProperties getSystemProperties()
public abstract NotificationProperties getNotificationProperties()
public abstract IndexProperties getIndexProperties()
public abstract void setCalSuite(String name) throws CalFacadeException
name - unique name for the suiteCalFacadeExceptionpublic abstract PrincipalInfo getPrincipalInfo()
public abstract boolean getSuperUser()
public abstract byte[] getPublicKey(String domain, String service) throws CalFacadeException
This allows us to have different keys for communication with different domains and for different services. At its simplest, both are ignored and a single key (pair) is used to secure all communications.
This is used, for example, by iSchedule for DKIM verification.
In keeping with the DKIM approach,
domain - service - CalFacadeExceptionpublic abstract BwStats getStats() throws CalFacadeException
CalFacadeException - if not adminpublic abstract void setDbStatsEnabled(boolean enable)
throws CalFacadeException
enable - boolean true to turn on db statistics collectionCalFacadeException - if not adminpublic abstract boolean getDbStatsEnabled()
throws CalFacadeException
CalFacadeException - if not adminpublic abstract void dumpDbStats()
throws CalFacadeException
CalFacadeException - if not adminpublic abstract Collection<BwStats.StatsEntry> getDbStats() throws CalFacadeException
CalFacadeException - if not adminpublic abstract void logStats()
throws CalFacadeException
CalFacadeException - if not adminpublic abstract IfInfo getIfInfo() throws CalFacadeException
CalFacadeException - on fatal errorpublic abstract List<IfInfo> getActiveIfInfos() throws CalFacadeException
CalFacadeExceptionpublic abstract void kill(IfInfo ifInfo)
ifInfo - IfInfo for processpublic abstract void setState(String val) throws CalFacadeException
val - a hopefully informative messageCalFacadeExceptionpublic abstract void postNotification(SysEventBase ev) throws CalFacadeException
ev - - system eventCalFacadeExceptionpublic abstract void flushAll()
throws CalFacadeException
A flushAll can discard a back end session allowing open to get a fresh one. close() can then be either a no-op or something like a hibernate disconnect.
This method should be called before calling open (or after calling close).
CalFacadeExceptionpublic abstract void open()
throws CalFacadeException
The open close methods are mainly associated with web style requests and open will usually be called early in the incoming request handling and close will always be called on the way out allowing the interface an opportunity to reacquire (on open) and release (on close) any resources such as connections.
CalFacadeExceptionpublic abstract boolean isOpen()
public abstract boolean isRolledback()
throws CalFacadeException
CalFacadeExceptionpublic abstract void close()
throws CalFacadeException
close in interface AutoCloseableCalFacadeExceptionpublic abstract void beginTransaction()
throws CalFacadeException
CalFacadeExceptionpublic abstract void endTransaction()
throws CalFacadeException
CalFacadeExceptionpublic abstract void rollbackTransaction()
throws CalFacadeException
CalFacadeExceptionpublic abstract Timestamp getCurrentTimestamp() throws CalFacadeException
CalFacadeExceptionpublic abstract Blob getBlob(byte[] val) throws CalFacadeException
CalFacadeException - on fatal errorpublic abstract void reAttach(BwDbentity val) throws CalFacadeException
val - CalFacadeExceptionpublic abstract BwUnversionedDbentity merge(BwUnversionedDbentity val) throws CalFacadeException
val - CalFacadeExceptionpublic abstract IcalCallback getIcalCallback()
public abstract IcalCallback getIcalCallback(Boolean timezonesByReference)
public abstract DumpIntf getDumpHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract RestoreIntf getRestoreHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract SimpleFilterParser getFilterParser()
public abstract SysparsI getSysparsHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract MailerIntf getMailer() throws CalFacadeException
CalFacadeExceptionpublic abstract PreferencesI getPrefsHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract AdminI getAdminHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract EventsI getEventsHandler()
public abstract FiltersI getFiltersHandler()
public abstract CalendarsI getCalendarsHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract CalSuitesI getCalSuitesHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract BwIndexer getIndexer(boolean publick, String docType)
publick - true for public indexpublic abstract BwIndexer getIndexer(String principal, String docType)
principal - - for given principalpublic abstract BwIndexer getIndexer(BwOwnedDbentity entity)
entity - may influence choice of indexerpublic abstract BwIndexer getIndexerForReindex(String principal, String docType, String name)
principal - docType - public abstract NotificationsI getNotificationsHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract ResourcesI getResourcesHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract SchedulingI getScheduler() throws CalFacadeException
CalFacadeExceptionpublic abstract SharingI getSharingHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract SynchI getSynch() throws CalFacadeException
CalFacadeExceptionpublic abstract UsersI getUsersHandler()
public abstract ViewsI getViewsHandler() throws CalFacadeException
CalFacadeExceptionpublic abstract Directories getDirectories() throws CalFacadeException
CalFacadeExceptionpublic abstract Directories getUserDirectories() throws CalFacadeException
CalFacadeExceptionpublic abstract Directories getAdminDirectories() throws CalFacadeException
CalFacadeExceptionpublic abstract Categories getCategoriesHandler()
public abstract Locations getLocationsHandler()
public abstract Contacts getContactsHandler()
public abstract <T> Iterator<T> getObjectIterator(Class<T> cl)
cl - Class of objectspublic abstract <T> Iterator<T> getPrincipalObjectIterator(Class<T> cl)
cl - Class of objectspublic abstract <T> Iterator<T> getPublicObjectIterator(Class<T> cl)
cl - class of objectspublic abstract BwPrincipal getPrincipal()
public abstract BwPrincipal getPrincipal(String href) throws CalFacadeException
href - String principal hierarchy pathCalFacadeExceptionpublic abstract UserAuth getUserAuth() throws CalFacadeException
CalFacadeExceptionpublic abstract long getUserMaxEntitySize()
throws CalFacadeException
CalFacadeExceptionpublic abstract BwPreferences getPreferences(String principalHref) throws CalFacadeException
principalHref - CalFacadeExceptionpublic abstract void removeFromAllPrefs(BwShareableDbentity val) throws CalFacadeException
val - CalFacadeExceptionpublic abstract BwGroup findGroup(String account, boolean admin) throws CalFacadeException
account - String group nameadmin - true for an admin groupCalFacadeException - If there's a problempublic abstract void changeAccess(BwShareableDbentity ent, Collection<org.bedework.access.Ace> aces, boolean replaceAll) throws CalFacadeException
ent - BwShareableDbentityaces - Collection of acereplaceAll - true to replace the entire access list.CalFacadeExceptionpublic abstract void defaultAccess(BwShareableDbentity ent, org.bedework.access.AceWho who) throws CalFacadeException
ent - BwShareableDbentitywho - AceWhoCalFacadeExceptionpublic abstract org.bedework.access.CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, boolean returnResult) throws CalFacadeException
ent - desiredAccess - returnResult - CalFacadeException - if returnResult false and no accesspublic abstract SynchReport getSynchReport(String path, String token, int limit, boolean recurse) throws CalFacadeException
path - token - limit - - negative for no limit on result set sizerecurse - CalFacadeExceptionpublic abstract UpdateFromTimeZonesInfo updateFromTimeZones(String colHref, int limit, boolean checkOnly, UpdateFromTimeZonesInfo info) throws CalFacadeException
To restart the update, call the method again, giving it the result from the last call as a parameter.
If called again after all events have been checked the process will be redone using timestamps to limit the check to events added or updated since the first check. Keep calling until the number of updated events is zero.
limit - -1 for no limitcheckOnly - don't update if true.info - null on first call, returned object from previous calls.CalFacadeExceptionCopyright © 2019 Bedework. All rights reserved.