net.praqma.jenkins.rqm.model
Class RqmObject<T>

java.lang.Object
  extended by net.praqma.jenkins.rqm.model.RqmObject<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TestCase, TestCaseExecutionRecord, TestPlan, TestScript, TestSuite, TestSuiteExecutionRecord

public abstract class RqmObject<T>
extends Object
implements Serializable

Attempt at making the RQM object a bit more human readable.

Author:
Praqma
See Also:
Serialized Form

Field Summary
protected  String rqmObjectResourceUrl
           
 
Constructor Summary
RqmObject()
           
 
Method Summary
 HashMap<String,String> attributes()
           
static
<T extends RqmObject>
T
createObject(Class<T> clazz, RqmParameterList parameters)
           
 List<T> createOrUpdate(RqmParameterList parameters)
          Override this method if you wish to push data from RQM (PUT && POST)
 boolean equals(Object obj)
           
static String getDescriptor(RqmObject obj)
           
static String getDescriptor(RqmObject obj, String title)
           
static Document getDocumentReader(InputStream is)
          Factory method for the xml document reader
static Document getDocumentReader(String xml)
           
 int getInternalId()
           
abstract  String getResourceName()
           
 String getRqmObjectResourceUrl()
           
 int hashCode()
           
abstract  T initializeSingleResource(String xml)
          Expects an internal resource id.
 T intializeSingleResource(InputStream is)
           
 List<T> read(RqmParameterList parameters)
          Override this method if you wish to read data from RQM (Primarily GET)
 List<T> readMultiple(RqmParameterList parameters)
           
 void setRqmObjectResourceUrl(String rqmObjectResourceUrl)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rqmObjectResourceUrl

protected String rqmObjectResourceUrl
Constructor Detail

RqmObject

public RqmObject()
Method Detail

getResourceName

public abstract String getResourceName()

getDocumentReader

public static Document getDocumentReader(String xml)
                                  throws RQMObjectParseException
Throws:
RQMObjectParseException

getDocumentReader

public static Document getDocumentReader(InputStream is)
                                  throws Exception
Factory method for the xml document reader

Parameters:
is -
Returns:
a readable XML Document
Throws:
Exception

initializeSingleResource

public abstract T initializeSingleResource(String xml)
                                    throws RQMObjectParseException
Expects an internal resource id.

Parameters:
xml -
Returns:
Throws:
RQMObjectParseException

intializeSingleResource

public T intializeSingleResource(InputStream is)
                          throws RQMObjectParseException
Throws:
RQMObjectParseException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getDescriptor

public static String getDescriptor(RqmObject obj)

getDescriptor

public static String getDescriptor(RqmObject obj,
                                   String title)

getRqmObjectResourceUrl

public String getRqmObjectResourceUrl()
Returns:
the rqmObjectResourceUrl

setRqmObjectResourceUrl

public void setRqmObjectResourceUrl(String rqmObjectResourceUrl)
Parameters:
rqmObjectResourceUrl - the rqmObjectResourceUrl to set

getInternalId

public int getInternalId()
                  throws RQMObjectParseException
Throws:
RQMObjectParseException

read

public List<T> read(RqmParameterList parameters)
             throws IOException
Override this method if you wish to read data from RQM (Primarily GET)

Parameters:
parameters -
Returns:
a 'constructed' rqm object. Read populates the object given an array of parameters
Throws:
IOException

readMultiple

public List<T> readMultiple(RqmParameterList parameters)
                     throws IOException
Throws:
IOException

createOrUpdate

public List<T> createOrUpdate(RqmParameterList parameters)
                       throws IOException
Override this method if you wish to push data from RQM (PUT && POST)

Parameters:
parameters -
Returns:
Create or updates the object given an array of parameters. Use the initializeSingleResource() method to parse the object given the returned XML
Throws:
IOException

attributes

public HashMap<String,String> attributes()

createObject

public static <T extends RqmObject> T createObject(Class<T> clazz,
                                                   RqmParameterList parameters)
                                        throws InstantiationException,
                                               IllegalAccessException,
                                               IOException
Throws:
InstantiationException
IllegalAccessException
IOException


Copyright © 2004-2014. All Rights Reserved.