public interface ExternalIntegrationProvider extends LearningTrackingProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_ID
The recommended param key to use for sending in session ids in requests
|
| Modifier and Type | Method and Description |
|---|---|
Object |
fetchEntity(String reference)
|
<T> T |
findService(Class<T> type)
Allows services in the external system to be located
(this is used to find external providers for overriding the default internal services)
|
void |
fireEvent(String eventName,
String reference)
Fires events from EB using an external event system
You can assume the eventName is not null and the reference has been validated and normalized NOTE: if you have no way to handle external events then throw UnsupportedOperationException |
<T> T |
getConfigurationSetting(String settingName,
T defaultValue)
Retrieves settings from the configuration service (sakai.properties)
|
String |
getMaxJSONLevel()
Gets the entitybroker.maxJSONLevel config string from sakai.properties via ServerConfigurationService.
|
String |
getServerUrl()
Gets the full server URL for the server which this is being used on
|
String |
handleEntityError(javax.servlet.http.HttpServletRequest req,
Throwable error)
Handles an error which occurs while processing an entity request,
e.g. by sending an email and logging extra info about the failure
|
void |
handleUserSessionKey(javax.servlet.http.HttpServletRequest req)
Allows the external system to create a session based on a passed in session key (or other data in the request),
no returns are necessary and this method can simple be left unimplemented if it is not used
Most likely all requests will not include session keys so you should not fail if one is not set in most cases |
registerStatementstatic final String SESSION_ID
<T> T findService(Class<T> type)
T - type - the service API classvoid fireEvent(String eventName, String reference)
UnsupportedOperationExceptioneventName - a string which represents the name of the event (e.g. announcement.create),
cannot be null or emptyreference - a globally unique reference to an entity,
consists of the entity prefix and optionally the local id,
cannot be null or emptyIllegalArgumentException - if the event arguments are invalid or the event cannot be thrownUnsupportedOperationException - if the external system does not handle eventsString getServerUrl()
UnsupportedOperationException - if the external system cannot handle thisString getMaxJSONLevel()
Object fetchEntity(String reference)
String or Map and does not have to be a POJO,
the type of object should be determined out of bandreference - a string representing a unique reference to an entity (e.g. /type/id/extra)SecurityException - if the entity cannot be accessed by the current user or is not publicly accessibleIllegalArgumentException - if the reference is invalidUnsupportedOperationException - if the external system cannot handle thisIllegalStateException - if any other error occursString handleEntityError(javax.servlet.http.HttpServletRequest req, Throwable error)
req - the current requesterror - the current error that occurredUnsupportedOperationException - if the external system cannot handle thisvoid handleUserSessionKey(javax.servlet.http.HttpServletRequest req)
req - the request as it is coming in (before any other processing has occurred)IllegalArgumentException - if this request is invalid in some waySecurityException - if this request is not allowed for security reasons<T> T getConfigurationSetting(String settingName, T defaultValue)
settingName - the name of the setting to retrieve, Should be a string name: e.g. auto.ddl,
mystuff.config, etc.defaultValue - a specified default value to return if this setting cannot be found,
NOTE: You can set the default value to null but you must specify the class type in parensCopyright © 2007–2019 Sakai Project. All rights reserved.