Interface LoggingSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session is used to log entries to a log.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanLog()Tests if this user can log.voidcreateLogEntry(LogEntryForm logEntryForm) Logs an entry through the log entry form.getLog()Gets theLogassociated with this session.Gets a log entry form for creating a log entry.getLogId()Gets theLogIdassociated with this session.voidLogs an item.voidlogAtPriority(Type priorityType, Object content, Type contentType) Logs an item.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getLogId
Id getLogId()Gets theLogIdassociated with this session.- Returns:
- the
Log Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getLog
Gets theLogassociated with this session.- Returns:
- the log
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLog
boolean canLog()Tests if this user can log. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer logging operations.- Returns:
falseif logging methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
log
void log(Object content, Type contentType) throws OperationFailedException, PermissionDeniedException Logs an item. This method is a shortcut tocreateLogEntry().- Parameters:
content- the entry to logcontentType- the type of this entry which must be one of the types returned byLoggingManager.getContentTypes()- Throws:
InvalidArgumentException-contentis not ofcontentTypeNullArgumentException-contentorcontentTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-LoggingManager.supportsContentType(contentType)isfalse- Compliance:
mandatory- This method must be implemented.
-
logAtPriority
void logAtPriority(Type priorityType, Object content, Type contentType) throws OperationFailedException, PermissionDeniedException Logs an item.- Parameters:
priorityType- the entry prioritycontent- the entry to logcontentType- the type of this entry which must be one of the types returned byLoggingManager.getContentTypes()- Throws:
InvalidArgumentException-contentis not ofcontentTypeNullArgumentException-content,contentTypeorpriorityTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-LoggingManager.supportsContentType(contentType)isfalseorLoggingManager.supportsPriorityType(priorityType)isfalse- Compliance:
mandatory- This method must be implemented.
-
getLogEntryForm
LogEntryForm getLogEntryForm()Gets a log entry form for creating a log entry.- Returns:
- the log entry form
- Compliance:
mandatory- This method must be implemented.
-
createLogEntry
void createLogEntry(LogEntryForm logEntryForm) throws OperationFailedException, PermissionDeniedException Logs an entry through the log entry form.- Parameters:
logEntryForm- the log entry form- Throws:
InvalidArgumentException- one or more of the form elements is invalidNullArgumentException-logEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-logEntryFormis not of this service- Compliance:
mandatory- This method must be implemented.
-