com.googlecode.msidor.maven.plugins.hpalm.deliverynote
Class DefaultHPALMMojoDAO

java.lang.Object
  extended by com.googlecode.msidor.maven.plugins.hpalm.deliverynote.DefaultHPALMMojoDAO
All Implemented Interfaces:
HPALMMojoDAOI

public class DefaultHPALMMojoDAO
extends Object
implements HPALMMojoDAOI

Default implementation of HPALMMavenPluginDAOI. This Data Access Object provides API that allows to execute remote commands on Confluence and HP ALM servers.

Author:
Maciej SIDOR

Constructor Summary
DefaultHPALMMojoDAO()
          Default contructor
 
Method Summary
 Object authenticateToConfluence(String confleunceUser, String confluencePassword)
          Authenticates to Confluence
 String authenticateToHPALM(String targetURL, String username, String password)
          Authenticate to HP ALM
 HashMap<Object,Object> getConfluencePage(Object cookie, String confluencePageID)
          Retrieves Confluence page content
 String getFromHPALM(String targetURL, String cookie)
          Get the content from target URL via GET method
 void initializeXmlRpcClient(String confluenceServer)
          Initialize XML RPC Client
 String putToHPALM(String targetURL, String urlParameters, String cookie)
          Send content to target URL via PUT method
 void updateConfluencePage(Object cookie, HashMap<Object,Object> page, HashMap<Object,Object> pageUpdateOptions)
          Update Confluence page with given content
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHPALMMojoDAO

public DefaultHPALMMojoDAO()
Default contructor

Method Detail

updateConfluencePage

public void updateConfluencePage(Object cookie,
                                 HashMap<Object,Object> page,
                                 HashMap<Object,Object> pageUpdateOptions)
                          throws org.apache.xmlrpc.XmlRpcException
Update Confluence page with given content

Specified by:
updateConfluencePage in interface HPALMMojoDAOI
Parameters:
cookie - Confluence session authentication object
page - Confluence page content
pageUpdateOptions - Update options
Throws:
org.apache.xmlrpc.XmlRpcException

getConfluencePage

public HashMap<Object,Object> getConfluencePage(Object cookie,
                                                String confluencePageID)
                                         throws org.apache.xmlrpc.XmlRpcException
Retrieves Confluence page content

Specified by:
getConfluencePage in interface HPALMMojoDAOI
Parameters:
cookie - Confluence session authentication object
confluencePageID - CID of Confluence page to retrieve
Returns:
Confluence page content
Throws:
org.apache.xmlrpc.XmlRpcException

authenticateToConfluence

public Object authenticateToConfluence(String confleunceUser,
                                       String confluencePassword)
                                throws org.apache.xmlrpc.XmlRpcException
Authenticates to Confluence

Specified by:
authenticateToConfluence in interface HPALMMojoDAOI
Parameters:
confleunceUser - Confluence user
confluencePassword - Confluence password
Returns:
Confluence session authentication object
Throws:
org.apache.xmlrpc.XmlRpcException

initializeXmlRpcClient

public void initializeXmlRpcClient(String confluenceServer)
                            throws MalformedURLException
Initialize XML RPC Client

Specified by:
initializeXmlRpcClient in interface HPALMMojoDAOI
Parameters:
confluenceServer - Confluence address
Throws:
MalformedURLException

putToHPALM

public String putToHPALM(String targetURL,
                         String urlParameters,
                         String cookie)
                  throws org.apache.maven.plugin.MojoFailureException
Send content to target URL via PUT method

Specified by:
putToHPALM in interface HPALMMojoDAOI
Parameters:
targetURL - - target to send the content to
urlParameters - - the content to be sent
cookie - - cookie to be set in Cookie header file
Returns:
response from the target URL
Throws:
org.apache.maven.plugin.MojoFailureException - if server responded with code different than 200

getFromHPALM

public String getFromHPALM(String targetURL,
                           String cookie)
                    throws org.apache.maven.plugin.MojoFailureException
Get the content from target URL via GET method

Specified by:
getFromHPALM in interface HPALMMojoDAOI
Parameters:
targetURL - - target to get the content from
cookie - - cookie to be set in Cookie header file
Returns:
response from the target URL
Throws:
org.apache.maven.plugin.MojoFailureException - if server responded with code different than 200

authenticateToHPALM

public String authenticateToHPALM(String targetURL,
                                  String username,
                                  String password)
                           throws org.apache.maven.plugin.MojoFailureException
Authenticate to HP ALM

Specified by:
authenticateToHPALM in interface HPALMMojoDAOI
Parameters:
targetURL - - target to authenticate to
username - - HP ALM user
password - - HP ALM password
Returns:
authentication cookie
Throws:
org.apache.maven.plugin.MojoFailureException - if server responded with code different than 200


Copyright © 2014. All rights reserved.