Package xal.plugin.olog
Class OlogProvider
java.lang.Object
xal.extension.logbook.LogbookProvider
xal.plugin.olog.OlogProvider
@ServiceProvider(service=LogbookProvider.class,
order=10)
public class OlogProvider
extends LogbookProvider
- Author:
- Juan F. Esteban Müller <JuanF.EstebanMuller@ess.eu>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getJsonAttributes
(String nameMap, Map<String, String> attributesMap) Utility class to transform a Map with an Olog property into a Json string.boolean
void
logout()
protected static javafx.util.Pair
parseProperty
(String property) long
long
long
post
(String[] logbooks, Map<String, List<String>> fields, String textBody, List<Attachment> attachments) long
post
(List<Attachment> attachments, String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) long
long
Methods inherited from class xal.extension.logbook.LogbookProvider
getDefaultLogbook, getDefaultServerUrl, getServer, setDefaultLogbook, setDefaultServerUrl, setServer
-
Field Details
-
ENTRY_TYPE_STR
- See Also:
-
TAGS_STR
- See Also:
-
SUBJECT_STR
- See Also:
-
PROPERTIES_STR
- See Also:
-
-
Constructor Details
-
OlogProvider
public OlogProvider()
-
-
Method Details
-
login
- Specified by:
login
in classLogbookProvider
-
logout
public void logout()- Specified by:
logout
in classLogbookProvider
-
post
public long post(String[] logbooks, Map<String, List<String>> fields, String textBody) throws LogbookException- Specified by:
post
in classLogbookProvider
fields
- map containing metadata as pair of name of the attribute and valuetextBody
- entry body text- Returns:
- the message ID
- Throws:
LogbookException
-
post
public long post(String[] logbooks, Map<String, List<String>> fields, String textBody, List<Attachment> attachments) throws LogbookException- Specified by:
post
in classLogbookProvider
- Parameters:
logbooks
- Array with a list of logbooks where the entry should be posted.fields
- Olog allows for the following attributes: Entry Type, Tags, Subject, and Properties. From those, Entry Type and Subject are required, the others are optional.textBody
- Message body test.attachments
-- Returns:
- Throws:
LogbookException
-
post
- Specified by:
post
in classLogbookProvider
- Throws:
LogbookException
-
post
public long post(String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
post
in classLogbookProvider
- Throws:
LogbookException
-
post
public long post(List<Attachment> attachments, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
post
in classLogbookProvider
- Throws:
LogbookException
-
post
public long post(List<Attachment> attachments, String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
post
in classLogbookProvider
- Throws:
LogbookException
-
parseProperty
-
getJsonAttributes
Utility class to transform a Map with an Olog property into a Json string.- Parameters:
nameMap
-attributesMap
-- Returns:
-