org.openware.loadsim.link
Class Link

java.lang.Object
  |
  +--org.openware.loadsim.link.Link
All Implemented Interfaces:
java.io.Serializable

public class Link
extends java.lang.Object
implements java.io.Serializable

This class represents a URL for a virtual user. During the simulation the virtual user submits a series of requests which are encapsulated by this class.

Author:
Vincent Sheffer
See Also:
Serialized Form

Field Summary
static int FIRST
          If there are multiple links in the page that match the link defined by this object then some rule must be used to pick the one to use.
static int FORM
           
static int GET
           
static int LINK
           
static int POST
           
static int RANDOM
          If there are multiple links in the page that match the link defined by this object then some rule must be used to pick the one to use.
 
Constructor Summary
Link(Config config, org.w3c.dom.Node node)
           
 
Method Summary
 Link deepCopy()
           
 LinkData getFormData()
          Get the form data.
 LinkData getQueryStringData()
          Get query string data.
 long getWaitTime()
          Get the time to wait before submitting the link.
 SampleResult sample_test(CookieManager cookieManager, ILog log)
           
 SampleResult sample(CookieManager cookieManager, ILog log)
          Send the link to the webserver using the VirtualUser's CookieManager.
 void setDataSets(java.util.HashMap datasets)
          Set the data sets for the link.
 void setupLink(com.meterware.httpunit.WebResponse lastpage, ILog log)
          Called before the current link is sent to the web server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORM

public static final int FORM

LINK

public static final int LINK

POST

public static final int POST

GET

public static final int GET

RANDOM

public static final int RANDOM
If there are multiple links in the page that match the link defined by this object then some rule must be used to pick the one to use.

RANDOM will pick the link at random.


FIRST

public static final int FIRST
If there are multiple links in the page that match the link defined by this object then some rule must be used to pick the one to use. FIRST will pick the first one in the page.
Constructor Detail

Link

public Link(Config config,
            org.w3c.dom.Node node)
     throws ConfigException
Method Detail

deepCopy

public Link deepCopy()

getQueryStringData

public LinkData getQueryStringData()
Get query string data.

getFormData

public LinkData getFormData()
Get the form data.

getWaitTime

public long getWaitTime()
Get the time to wait before submitting the link. Because the virtual user is controlling the simulation (for each user, that is) it needs to know how long to wait before submitting the next link.

setDataSets

public void setDataSets(java.util.HashMap datasets)
Set the data sets for the link.

setupLink

public void setupLink(com.meterware.httpunit.WebResponse lastpage,
                      ILog log)
               throws LinkException
Called before the current link is sent to the web server. The setup is a 2 step process. First, the last HTML page downloaded is used to set up the link data that requires data from the page to be complete. Page data is used to fill in, for instance, a session ID that has been URL encoded (as opposed to sent via a cookie).

The second step involves filling in the pertinent instance variables for use in the sample method.

Parameters:
lastpage - The contents of the last HTML page downloaded. This page is used to fill in page type links specified in the configuration file.

sample

public SampleResult sample(CookieManager cookieManager,
                           ILog log)
                    throws java.io.IOException
Send the link to the webserver using the VirtualUser's CookieManager.
Parameters:
cookieManager - The VirtualUser's CookieManager.
log - The log file to log information/errors to.
Returns:
The SampleResult object.
Throws:
java.io.IOException - if an error occurs reading from or writing to the webserver.

sample_test

public SampleResult sample_test(CookieManager cookieManager,
                                ILog log)
                         throws java.io.IOException


Copyright © 2000, 2001 Openware, Spin Software. All Rights Reserved.