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 StringgetJsonAttributes(String nameMap, Map<String, String> attributesMap) Utility class to transform a Map with an Olog property into a Json string.booleanvoidlogout()protected static javafx.util.PairparseProperty(String property) longlonglongpost(String[] logbooks, Map<String, List<String>> fields, String textBody, List<Attachment> attachments) longpost(List<Attachment> attachments, String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) longlongMethods 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:
loginin classLogbookProvider
-
logout
public void logout()- Specified by:
logoutin classLogbookProvider
-
post
public long post(String[] logbooks, Map<String, List<String>> fields, String textBody) throws LogbookException- Specified by:
postin classLogbookProviderfields- 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:
postin 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:
postin classLogbookProvider- Throws:
LogbookException
-
post
public long post(String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
postin classLogbookProvider- Throws:
LogbookException
-
post
public long post(List<Attachment> attachments, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
postin classLogbookProvider- Throws:
LogbookException
-
post
public long post(List<Attachment> attachments, String[] defaultLogbooks, Map<String, List<String>> defaultAttributes) throws LogbookException- Specified by:
postin classLogbookProvider- Throws:
LogbookException
-
parseProperty
-
getJsonAttributes
Utility class to transform a Map with an Olog property into a Json string.- Parameters:
nameMap-attributesMap-- Returns:
-