public class OlogClientImpl extends Object implements OlogClient
Modifier and Type | Class and Description |
---|---|
static class |
OlogClientImpl.OlogClientBuilder
Builder Class to help create a olog client.
|
Modifier and Type | Method and Description |
---|---|
Attachment |
add(File local,
Long logId) |
void |
delete(Collection<Log> logs)
Deprecated.
|
void |
delete(LogbookBuilder logbook,
Collection<Long> logIds)
Remove the logbook logbook from the set of logs logIds
|
void |
delete(LogbookBuilder logbook,
Long logId)
Remove logbook logbook from the log with name logName
|
void |
delete(LogBuilder log)
Remove the log identified by log
|
void |
delete(Long logId)
Remove the log identified by log
|
void |
delete(PropertyBuilder property,
Collection<Long> logIds)
Remove the property property from the set of logs
logIds
|
void |
delete(PropertyBuilder property,
Long logId)
Remove property property from the log with id logId
TODO: Should this be it's own service?
|
void |
delete(String fileName,
Long logId)
Remove file attachment from log logId
TODO: sardine delete hangs up, using jersey for delete
|
void |
delete(TagBuilder tag,
Collection<Long> logIds)
Remove the tag tag from all the logs logNames
|
void |
delete(TagBuilder tag,
Long logId)
Remove tag tag from the log with the id logId
|
void |
deleteLogbook(String logbook) |
void |
deleteProperty(String property)
Delete the property with name property
|
void |
deleteTag(String tag)
Remove {tag} from all logs
|
Log |
findLogById(Long logId) |
Collection<Log> |
findLogs(Map<String,String> map)
Query for logs based on the criteria specified in the map
|
Collection<Log> |
findLogs(javax.ws.rs.core.MultivaluedMap<String,String> map)
Multivalued map used to search for a key with multiple values.
|
Collection<Log> |
findLogsByLogbook(String logbook)
This function is a subset of queryLogs - should it be removed??
|
Collection<Log> |
findLogsByProperty(String propertyName) |
Collection<Log> |
findLogsByProperty(String propertyName,
String attributeName,
String attributeValue)
This function is a subset of queryLogs should it be removed??
|
Collection<Log> |
findLogsBySearch(String pattern) |
Collection<Log> |
findLogsByTag(String pattern) |
InputStream |
getAttachment(Long logId,
Attachment attachment) |
Log |
getLog(Long logId)
Returns a log that exactly matches the logId logId
|
Property |
getProperty(String property)
return the complete property property
|
Collection<Attachment> |
listAttachments(Long logId)
Returns a collection of attachments that matches the logId logId
|
Collection<String> |
listAttributes(String propertyName)
List all the active attributes associated with the property propertyName
property must exist, name != null
|
Collection<Level> |
listLevels()
Get a list of all the levels currently existing
|
Collection<Logbook> |
listLogbooks()
Get a list of all the logbooks currently existings
|
Collection<Log> |
listLogs()
Return all the logs.
|
Collection<Property> |
listProperties()
Get a list of all the Properties currently existing
|
Collection<Tag> |
listTags()
Get a list of all the tags currently existing
|
Collection<Log> |
set(Collection<LogBuilder> logs)
Set a set of logs Destructive operation.
|
Logbook |
set(LogbookBuilder logbook)
Set a new logbook logbook with no associated logs.
|
Logbook |
set(LogbookBuilder logbook,
Collection<Long> logIds)
Set Logbook logbook to the logs logIds and remove it
from all other logs
TODO: all logids should exist, no nulls, check transaction
|
Log |
set(LogBuilder log)
Set a single log log, if the log already exists it is replaced.
|
Property |
set(PropertyBuilder property)
Create or replace property property
TODO: test creation of a new property, test changing this property, test old log entries still have old property structure
|
Tag |
set(TagBuilder tag)
Set a Tag tag with no associated logs to the database.
|
Tag |
set(TagBuilder tag,
Collection<Long> logIds)
Set tag tag on the set of logs logIds and remove it
from all others
TODO: all logIds should exist/ service should do proper transactions.
|
Collection<Log> |
update(Collection<LogBuilder> logs)
Update a set of logs
|
Logbook |
update(LogbookBuilder logbook,
Collection<Long> logIds)
TODO: transaction check
|
Logbook |
update(LogbookBuilder logbook,
Long logId)
Add Logbook logbook to the log logId
|
Log |
update(LogBuilder log)
Update a log entry log
|
Property |
update(PropertyBuilder property)
Update an existing property,
TODO: check non destructive nature, old attributes should not be touched.
|
Log |
update(PropertyBuilder property,
Long logId)
Update Property property by adding it to Log with id
logId
TODO : service invalid payload, need attribute and value
|
Tag |
update(TagBuilder tag,
Collection<Long> logIds)
Update the Tag tag by adding it to the set of the logs with ids
logIds
TODO: Transactional nature,
|
Tag |
update(TagBuilder tag,
Long logId)
Update Tag tag by adding it to Log with name logName
TODO: logid valid.
|
public Collection<Logbook> listLogbooks() throws OlogException
OlogClient
listLogbooks
in interface OlogClient
OlogException
public Collection<Tag> listTags() throws OlogException
OlogClient
listTags
in interface OlogClient
OlogException
public Collection<Property> listProperties() throws OlogException
OlogClient
listProperties
in interface OlogClient
OlogException
public Collection<String> listAttributes(String propertyName) throws OlogException
OlogClient
listAttributes
in interface OlogClient
OlogException
public Collection<Level> listLevels() throws OlogException
OlogClient
listLevels
in interface OlogClient
OlogException
public Collection<Log> listLogs()
OlogClient
listLogs
in interface OlogClient
public Log getLog(Long logId) throws OlogException
OlogClient
getLog
in interface OlogClient
logId
- log idOlogException
public Collection<Attachment> listAttachments(Long logId) throws OlogException
OlogClient
listAttachments
in interface OlogClient
logId
- log idOlogException
public InputStream getAttachment(Long logId, Attachment attachment)
getAttachment
in interface OlogClient
public Property getProperty(String property) throws OlogException
OlogClient
getProperty
in interface OlogClient
OlogException
public Log set(LogBuilder log) throws OlogException
OlogClient
set
in interface OlogClient
log
- the log to be addedOlogException
public Collection<Log> set(Collection<LogBuilder> logs) throws OlogException
OlogClient
set
in interface OlogClient
logs
- collection of logs to be addedOlogException
public Tag set(TagBuilder tag) throws OlogException
OlogClient
set
in interface OlogClient
OlogException
public Tag set(TagBuilder tag, Collection<Long> logIds) throws OlogException
OlogClient
set
in interface OlogClient
OlogException
public Logbook set(LogbookBuilder logbook) throws OlogException
OlogClient
set
in interface OlogClient
OlogException
public Logbook set(LogbookBuilder logbook, Collection<Long> logIds) throws OlogException
OlogClient
set
in interface OlogClient
logbook
- logbook builderlogIds
- log idsOlogException
public Property set(PropertyBuilder property)
OlogClient
set
in interface OlogClient
public Log update(LogBuilder log) throws OlogException
OlogClient
update
in interface OlogClient
OlogException
public Collection<Log> update(Collection<LogBuilder> logs) throws OlogException
OlogClient
update
in interface OlogClient
logs
- set of logs to be addedOlogException
public Property update(PropertyBuilder property) throws OlogException
OlogClient
update
in interface OlogClient
OlogException
public Tag update(TagBuilder tag, Long logId) throws OlogException
OlogClient
update
in interface OlogClient
tag
- tag builderlogId
- log id the tag to be addedOlogException
public Tag update(TagBuilder tag, Collection<Long> logIds) throws OlogException
OlogClient
update
in interface OlogClient
tag
- tag builderlogIds
- collection of log idsOlogException
public Logbook update(LogbookBuilder logbook, Long logId) throws OlogException
OlogClient
update
in interface OlogClient
logbook
- logbook builderlogId
- log idOlogException
public Logbook update(LogbookBuilder logbook, Collection<Long> logIds) throws OlogException
OlogClient
update
in interface OlogClient
OlogException
public Log update(PropertyBuilder property, Long logId) throws OlogException
OlogClient
update
in interface OlogClient
property
- property builderlogId
- log id the property to be addedOlogException
public Attachment add(File local, Long logId) throws OlogException
add
in interface OlogClient
OlogException
public Log findLogById(Long logId)
findLogById
in interface OlogClient
public Collection<Log> findLogsBySearch(String pattern) throws OlogException
findLogsBySearch
in interface OlogClient
OlogException
public Collection<Log> findLogsByTag(String pattern) throws OlogException
findLogsByTag
in interface OlogClient
OlogException
public Collection<Log> findLogsByLogbook(String logbook) throws OlogException
OlogClient
TODO: add the usage of patterns and implement on top of the general query using the map
findLogsByLogbook
in interface OlogClient
logbook
- logbook nameOlogException
public Collection<Log> findLogsByProperty(String propertyName) throws OlogException
findLogsByProperty
in interface OlogClient
OlogException
public Collection<Log> findLogsByProperty(String propertyName, String attributeName, String attributeValue) throws OlogException
OlogClient
search for logs with property property and optionally value matching patternpropertyValue
findLogsByProperty
in interface OlogClient
OlogException
public Collection<Log> findLogs(Map<String,String> map) throws OlogException
OlogClient
findLogs
in interface OlogClient
OlogException
public Collection<Log> findLogs(javax.ws.rs.core.MultivaluedMap<String,String> map) throws OlogException
OlogClient
findLogs
in interface OlogClient
map
- Multivalue map for searching a key with multiple valuesOlogException
public void deleteTag(String tag) throws OlogException
OlogClient
deleteTag
in interface OlogClient
OlogException
public void deleteLogbook(String logbook) throws OlogException
deleteLogbook
in interface OlogClient
OlogException
public void deleteProperty(String property) throws OlogException
OlogClient
deleteProperty
in interface OlogClient
OlogException
public void delete(LogBuilder log) throws OlogException
OlogClient
delete
in interface OlogClient
log
- log to be removedOlogException
public void delete(Long logId) throws OlogException
OlogClient
delete
in interface OlogClient
logId
- log id log id to be removedOlogException
@Deprecated public void delete(Collection<Log> logs) throws OlogException
OlogClient
delete
in interface OlogClient
logs
- logs to be removedOlogException
public void delete(TagBuilder tag, Long logId) throws OlogException
OlogClient
delete
in interface OlogClient
OlogException
public void delete(TagBuilder tag, Collection<Long> logIds) throws OlogException
OlogClient
delete
in interface OlogClient
OlogException
public void delete(LogbookBuilder logbook, Long logId) throws OlogException
OlogClient
delete
in interface OlogClient
logbook
- logbook builderlogId
- log idOlogException
public void delete(LogbookBuilder logbook, Collection<Long> logIds) throws OlogException
OlogClient
delete
in interface OlogClient
OlogException
public void delete(PropertyBuilder property, Long logId) throws OlogException
OlogClient
delete
in interface OlogClient
property
- property builderlogId
- log idOlogException
public void delete(PropertyBuilder property, Collection<Long> logIds) throws OlogException
OlogClient
delete
in interface OlogClient
OlogException
public void delete(String fileName, Long logId)
OlogClient
delete
in interface OlogClient
Copyright © 2010-2014 Michigan State University. All Rights Reserved.