elisa_client.service
Class ElisaClient

java.lang.Object
  extended by elisa_client.service.ElisaClient

@Component(value="elisaClient")
public class ElisaClient
extends java.lang.Object

Client used for communicating with the ELisA REST web service

Author:
alina

Constructor Summary
ElisaClient()
           
 
Method Summary
 Attachment getAttachment(java.lang.String username, java.lang.String pwd, long msgId, long attachId)
           
 AttachmentList getAttachments(java.lang.String username, java.lang.String pwd, long msgId)
           
 Message getMessage(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile, long msgId)
          Return the entry with a given ID from the ELisA REST server
 OptionMetadataList getMessageTypeOptions(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile, java.lang.Enum<MessageType> msgType)
          Get from logbook configuration the options for a specified message type Method that can be used without user credentials
 java.lang.String getMessageTypeOptionsxml(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile, java.lang.Enum<MessageType> msgType)
           
 MessageTypeList getMessageTypes(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile)
          Get from logbook configuration the list of possible message types Method that can be used without user credentials
 SystemAffectedList getSystemsAffected(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile, java.lang.Enum<MessageType> msgType)
          Get from logbook configuration the preset SA for a specified message type Method that can be used without user credentials
 Message insertMessage(java.lang.String username, java.lang.String pwd, java.lang.String ssocookiefile, InputMessage msg)
          Insert a logbook entry with given properties encapsulated into object of type InputMessage
 Message replyToMessage(java.lang.String username, java.lang.String pwd)
           
 MessageList searchMessages(java.lang.String username, java.lang.String pwd)
           
 Message updateMessage(java.lang.String username, java.lang.String pwd, MessageBody update)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElisaClient

public ElisaClient()
Method Detail

getMessage

public Message getMessage(java.lang.String username,
                          java.lang.String pwd,
                          java.lang.String ssocookiefile,
                          long msgId)
Return the entry with a given ID from the ELisA REST server

Parameters:
username -
pwd -
ssocookiefile: - path to file containing the sso cookie
msgId: - the message ID to be retrieved
Returns:
Object of type Message (class imported from ELisA REST server)
Throws:
java.lang.Exception

getAttachment

public Attachment getAttachment(java.lang.String username,
                                java.lang.String pwd,
                                long msgId,
                                long attachId)

getAttachments

public AttachmentList getAttachments(java.lang.String username,
                                     java.lang.String pwd,
                                     long msgId)

searchMessages

public MessageList searchMessages(java.lang.String username,
                                  java.lang.String pwd)

insertMessage

public Message insertMessage(java.lang.String username,
                             java.lang.String pwd,
                             java.lang.String ssocookiefile,
                             InputMessage msg)
Insert a logbook entry with given properties encapsulated into object of type InputMessage

Parameters:
username -
pwd -
ssocookiefile: - path to file containing the sso cookie
msg: - object of type InputMessage to be inserted into logbook
Returns:
object of type Message
Throws:
java.lang.Exception

updateMessage

public Message updateMessage(java.lang.String username,
                             java.lang.String pwd,
                             MessageBody update)

replyToMessage

public Message replyToMessage(java.lang.String username,
                              java.lang.String pwd)

getMessageTypes

public MessageTypeList getMessageTypes(java.lang.String username,
                                       java.lang.String pwd,
                                       java.lang.String ssocookiefile)
Get from logbook configuration the list of possible message types Method that can be used without user credentials

Parameters:
username -
pwd -
ssocookiefile: - path to file containing the sso cookie
Returns:
a list of message types
Throws:
ElisaApiException

getMessageTypeOptions

public OptionMetadataList getMessageTypeOptions(java.lang.String username,
                                                java.lang.String pwd,
                                                java.lang.String ssocookiefile,
                                                java.lang.Enum<MessageType> msgType)
Get from logbook configuration the options for a specified message type Method that can be used without user credentials

Parameters:
username -
pwd -
ssocookiefile: - path to file containing the sso cookie
msgType: - a given message type
Returns:
the options of that message type
Throws:
java.lang.Exception

getSystemsAffected

public SystemAffectedList getSystemsAffected(java.lang.String username,
                                             java.lang.String pwd,
                                             java.lang.String ssocookiefile,
                                             java.lang.Enum<MessageType> msgType)
Get from logbook configuration the preset SA for a specified message type Method that can be used without user credentials

Parameters:
username -
pwd -
ssocookiefile: - path to file containing the sso cookie
msgType: - a given message type; if null return the list of all possible systems affected
Returns:
a list of SA for that message type or a list of all possible SA
Throws:
java.lang.Exception

getMessageTypeOptionsxml

public java.lang.String getMessageTypeOptionsxml(java.lang.String username,
                                                 java.lang.String pwd,
                                                 java.lang.String ssocookiefile,
                                                 java.lang.Enum<MessageType> msgType)