public class OlogImpl extends Object
| Modifier and Type | Method and Description |
|---|---|
Logbook |
addSingleLogbook(String logbookName,
Long logId)
Add the logbook identified by logbook to the single log
id.
|
Tag |
addSingleTag(String tagName,
Long logId)
Add the tag identified by tag to the single log logId.
|
void |
checkIdMatchesPayload(Long logId,
Log data)
Check that logId matches the log id in data.
|
void |
checkNameMatchesPayload(String name,
Logbook data)
Check that name matches the logbook name in data.
|
void |
checkNameMatchesPayload(String name,
Tag data)
Check that name matches the tag name in data.
|
void |
checkPropertyName(String propertyName,
Property data)
Check the property name in data with the property name in the
URL.
|
void |
checkPropertyName(String propertyName,
XmlProperty data)
Check the property name in data with the property name in the
URL.
|
void |
checkUserBelongsToGroup(String user,
Log data)
Check that user belongs to the owner group specified in the log
data.
|
void |
checkUserBelongsToGroup(String user,
Logbook data)
Check that user belongs to the owner group specified in the
logbook data.
|
void |
checkUserBelongsToGroup(String user,
Logbooks data)
Check that user belongs to the owner groups of all logbooks in
data.
|
void |
checkUserBelongsToGroup(String user,
Logs data)
Check that user belongs to the owner groups of all logs in
data.
|
void |
checkUserBelongsToGroupOfLog(String user,
Long logId)
Check that user belongs to the owner group specified in the
database for log logId.
|
void |
checkUserBelongsToGroupOfLogbook(String user,
String logbook)
Check that user belongs to the owner group specified in the
database for logbook logbook.
|
void |
checkValid(Log data)
Check the log in data for valid owner data.
|
void |
checkValid(Logs data)
Check all logs in data for valid owner data.
|
void |
checkValidNameAndOwner(Logbook data)
Check the logbook in data for valid name/owner data.
|
void |
checkValidNameAndOwner(Logbooks data)
Check all logbooks in data for valid name/owner data.
|
void |
checkValidNameAndOwner(Tag data)
Check the tag in data for valid name data.
|
void |
checkValidNameAndOwner(Tags data)
Check all tags in data for valid name data.
|
Log |
createOrReplaceLog(Long logId,
Log data)
Update a log identified by logId, creating it when necessary.
|
Logbook |
createOrReplaceLogbook(String logbookName,
Logbook data)
Adds the logbook identified by tag exclusively to the
logs specified in the Logbook payload data, creating it if
necessary.
|
Logbooks |
createOrReplaceLogbooks(Logbooks data)
Create or replace logbooks specified in data.
|
Logs |
createOrReplaceLogs(Logs logs)
Create logs specified in data.
|
Tag |
createOrReplaceTag(String tagName,
Tag data)
Adds the tag identified by tag exclusively to the logs
specified in the Tag payload data, creating it if necessary.
|
Tags |
createOrReplaceTags(Tags data)
Create tags specified in data.
|
Logbook |
findLogbookByName(String name)
Return single logbook found by name.
|
Log |
findLogById(Long logId)
Return single log found by log id.
|
Logs |
findLogsByMultiMatch(javax.ws.rs.core.MultivaluedMap<String,String> matches)
Returns logs found by matching logbook names, tag names, log description.
|
Tag |
findTagByName(String name)
Return single tag found by name.
|
static OlogImpl |
getInstance()
Returns the (singleton) instance of OlogManager
|
Logbooks |
listLogbooks()
List all Logbooks in the database.
|
XmlProperties |
listProperties()
Return a list of all properties
|
Tags |
listTags()
List all tags in the database.
|
static void |
mergeXmlLogs(Log dest,
Log src)
Merges Logbooks and Tags of two logs in place
|
void |
removeExistingLogbook(String logbook)
Deletes a logbook identified by name from all logs, failing if
the logbook does not exists.
|
void |
removeExistingTag(String tag)
Deletes a logbook identified by name from all logs, failing if
the logbook does not exists.
|
void |
removeLog(Long logId)
Deletes a log identified by logId.
|
void |
removeLogbook(String logbook)
Deletes a logbook identified by name from all logs.
|
void |
removeSingleLogbook(String logbookName,
Long logId)
Deletes a logbook identified by name from a single log.
|
void |
removeSingleTag(String tagName,
Long logId)
Deletes a tag identified by name from a single log.
|
void |
removeTag(String tag)
Deletes a tag identified by name from all logs.
|
Log |
updateLog(Long logId,
Log data)
Merge logbook set in data into the existing log logId.
|
Logbook |
updateLogbook(Logbook data)
Add the logbook identified by logbook to the logs specified in
the Logs data.
|
Tag |
updateTag(String tagName,
Tag data)
Add the tag identified by tag and state to the logs
specified in the Logs data.
|
public static OlogImpl getInstance()
public static void mergeXmlLogs(Log dest, Log src)
dest - destination logsrc - source logpublic Log findLogById(Long logId) throws OlogException, UnsupportedEncodingException, NoSuchAlgorithmException
logId - id to look forOlogException - on SQLExceptionUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic Logs findLogsByMultiMatch(javax.ws.rs.core.MultivaluedMap<String,String> matches) throws OlogException, javax.jcr.RepositoryException, UnsupportedEncodingException, NoSuchAlgorithmException
matches - multivalued map of logbook, tag, log names and patterns to
match their values against.OlogException - wrapping an SQLExceptionjavax.jcr.RepositoryExceptionUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic void removeLog(Long logId) throws OlogException
logId - log to deleteOlogException - wrapping an SQLExceptionpublic Logbooks listLogbooks() throws OlogException
OlogException - wrapping an SQLExceptionpublic Logbook findLogbookByName(String name) throws OlogException
name - name to look forOlogException - on SQLExceptionpublic Logbook updateLogbook(Logbook data) throws OlogException
logbook - logbook to adddata - Logbook data with all logsOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic Logbook createOrReplaceLogbook(String logbookName, Logbook data) throws OlogException
logbook - logbook to adddata - Logbook container with all logs to add logbook toOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic Logbooks createOrReplaceLogbooks(Logbooks data) throws OlogException
data - Logbooks dataOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic Logbook addSingleLogbook(String logbookName, Long logId) throws OlogException
logbook - logbook to addlogId - log to add the logbook todata - LogbookOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic void removeLogbook(String logbook) throws OlogException
logbook - tag to deleteOlogException - wrapping an SQLExceptionpublic void removeExistingLogbook(String logbook) throws OlogException
logbook - tag to deleteOlogException - wrapping an SQLException or on failurepublic void removeSingleLogbook(String logbookName, Long logId) throws OlogException
logbook - tag to deletelogId - log to delete it fromOlogException - wrapping an SQLExceptionpublic Tags listTags() throws OlogException
OlogException - wrapping an SQLExceptionpublic Tag findTagByName(String name) throws OlogException
name - name to look forOlogException - on SQLExceptionpublic Tag updateTag(String tagName, Tag data) throws OlogException
tag - tag to adddata - Tag with list of all logs to add tag toOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic Tag createOrReplaceTag(String tagName, Tag data) throws OlogException
tag - tag to adddata - Tag container with all logs to add tag toOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic Tags createOrReplaceTags(Tags data) throws OlogException
data - Tags dataOlogException - on ownership mismatch, or wrapping an SQLExceptionpublic void removeExistingTag(String tag) throws OlogException
logbook - tag to deleteOlogException - wrapping an SQLException or on failurepublic Tag addSingleTag(String tagName, Long logId) throws OlogException
tag - tag to addlogId - OlogException - on ownership mismatch, or wrapping an SQLExceptionpublic void removeTag(String tag) throws OlogException
tag - tag to deleteOlogException - wrapping an SQLExceptionpublic void removeSingleTag(String tagName, Long logId) throws OlogException
tag - tag to deletelogId - log to delete it fromOlogException - wrapping an SQLExceptionpublic XmlProperties listProperties() throws OlogException
- OlogException - wrapping an SQLExceptionpublic Log createOrReplaceLog(Long logId, Log data) throws OlogException, UnsupportedEncodingException, NoSuchAlgorithmException
logId - log to updatedata - Log dataOlogException - on ownership or name mismatch, or wrapping an
SQLExceptionUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic Logs createOrReplaceLogs(Logs logs) throws OlogException, UnsupportedEncodingException, NoSuchAlgorithmException
logs - Logs dataOlogException - on ownership mismatch, or wrapping an SQLExceptionUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic Log updateLog(Long logId, Log data) throws OlogException, UnsupportedEncodingException, NoSuchAlgorithmException
logId - log to merge the logbooks and tags intodata - Log data containing logbooks and tagsOlogException - on name or owner mismatch, or wrapping an
SQLExceptionUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic void checkIdMatchesPayload(Long logId, Log data) throws OlogException
logId - log id to checkdata - Log data to check againstOlogException - on name mismatchpublic void checkValid(Log data) throws OlogException
data - Log data to checkOlogException - on errorpublic void checkValid(Logs data) throws OlogException
data - Logs data to checkOlogException - on errorpublic void checkNameMatchesPayload(String name, Tag data) throws OlogException
name - tag name to checkdata - Tag data to check againstOlogException - on name mismatchpublic void checkValidNameAndOwner(Tag data) throws OlogException
data - Tag data to checkOlogException - on name mismatchpublic void checkPropertyName(String propertyName, Property data) throws OlogException
propertyName - name coming from the URLdata - Property dataOlogException - on name mismatchpublic void checkPropertyName(String propertyName, XmlProperty data) throws OlogException
propertyName - name coming from the URLdata - Property dataOlogException - on name mismatchpublic void checkValidNameAndOwner(Tags data) throws OlogException
data - Tags data to checkOlogException - on errorpublic void checkNameMatchesPayload(String name, Logbook data) throws OlogException
name - logbook name to checkdata - Logbook data to check againstOlogException - on name mismatchpublic void checkValidNameAndOwner(Logbook data) throws OlogException
data - Logbook data to checkOlogException - on errorpublic void checkValidNameAndOwner(Logbooks data) throws OlogException
data - Logbooks data to checkOlogException - on errorpublic void checkUserBelongsToGroupOfLog(String user, Long logId) throws OlogException, UnsupportedEncodingException, NoSuchAlgorithmException
user - user namelogId - name of log to check ownership forOlogException - on name mismatchUnsupportedEncodingExceptionNoSuchAlgorithmExceptionpublic void checkUserBelongsToGroupOfLogbook(String user, String logbook) throws OlogException
user - user namelogbook - name of logbook to check ownership forOlogException - on name mismatchpublic void checkUserBelongsToGroup(String user, Log data) throws OlogException
user - user namedata - Log data to check ownership forOlogException - on name mismatchpublic void checkUserBelongsToGroup(String user, Logs data) throws OlogException
user - user namedata - Logs data to check ownership forOlogException - on name mismatchpublic void checkUserBelongsToGroup(String user, Logbook data) throws OlogException
user - user namedata - Logbook data to check ownership forOlogException - on name mismatchpublic void checkUserBelongsToGroup(String user, Logbooks data) throws OlogException
user - user namedata - Logs data to check ownership forOlogException - on name mismatchCopyright © 2010-2014 Michigan State University. All Rights Reserved.