Package org.mozilla.zest.core.v1
Class ZestRequest
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestStatement
-
- org.mozilla.zest.core.v1.ZestRequest
-
public class ZestRequest extends ZestStatement
The Class ZestRequest.
-
-
Field Summary
-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestRequest()Instantiates a new zest request.ZestRequest(int index)Instantiates a new zest request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAssertion(ZestAssertion assertion)Adds the assertion.voidaddCookie(String domain, String name, String value, String path, Date expiry, boolean secure)voidaddCookie(ZestCookie cookie)voidclearCookies()ZestRequestdeepCopy()Deep copy.List<ZestAssertion>getAssertions()Gets the assertions.List<ZestCookie>getCookies()StringgetData()Gets the data.StringgetHeaders()Gets the headers.StringgetMethod()Gets the method.ZestResponsegetResponse()Gets the response.longgetTimestamp()Gets when the request was sent (unix time).URLgetUrl()Gets the url.StringgetUrlToken()Gets the url token.booleanisFollowRedirects()booleanisPassive()Checks if is passive.booleanisSameSubclass(ZestElement ze)Checks if is same subclass.voidmoveDown(ZestElement ze)Move down.voidmoveUp(ZestElement ze)Move up.voidremoveAssertion(ZestAssertion assertion)Removes the assertion.voidreplaceTokens(ZestVariables tokens)Replace tokens.voidsetData(String data)Sets the data.voidsetFollowRedirects(boolean followRedirects)voidsetHeaders(String headers)Sets the headers.voidsetMethod(String method)Sets the method.voidsetPrefix(String oldPrefix, String newPrefix)voidsetResponse(ZestResponse response)Sets the response.voidsetTimestamp(long timestamp)Sets when the request was sent (unix time).voidsetUrl(URL url)Sets the url.voidsetUrlToken(String urlToken)Sets the url token.-
Methods inherited from class org.mozilla.zest.core.v1.ZestStatement
getIndex, getNext, getPrevious, init, insertAfter, insertBefore, isEnabled, remove, setEnabled, setNext, setPrev
-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, setElementType
-
-
-
-
Method Detail
-
deepCopy
public ZestRequest deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin classZestStatement- Returns:
- the zest element
-
getUrl
public URL getUrl()
Gets the url.- Returns:
- the url
-
setUrl
public void setUrl(URL url)
Sets the url.- Parameters:
url- the new url
-
getUrlToken
public String getUrlToken()
Gets the url token.- Returns:
- the url token
-
setUrlToken
public void setUrlToken(String urlToken)
Sets the url token.- Parameters:
urlToken- the new url token
-
getData
public String getData()
Gets the data.- Returns:
- the data
-
setData
public void setData(String data)
Sets the data.- Parameters:
data- the new data
-
getHeaders
public String getHeaders()
Gets the headers.- Returns:
- the headers
-
setHeaders
public void setHeaders(String headers)
Sets the headers.- Parameters:
headers- the new headers
-
getMethod
public String getMethod()
Gets the method.- Returns:
- the method
-
setMethod
public void setMethod(String method)
Sets the method.- Parameters:
method- the new method
-
addAssertion
public void addAssertion(ZestAssertion assertion)
Adds the assertion.- Parameters:
assertion- the assertion
-
removeAssertion
public void removeAssertion(ZestAssertion assertion)
Removes the assertion.- Parameters:
assertion- the assertion
-
getAssertions
public List<ZestAssertion> getAssertions()
Gets the assertions.- Returns:
- the assertions
-
getResponse
public ZestResponse getResponse()
Gets the response.- Returns:
- the response
-
setResponse
public void setResponse(ZestResponse response)
Sets the response.- Parameters:
response- the new response
-
isFollowRedirects
public boolean isFollowRedirects()
-
setFollowRedirects
public void setFollowRedirects(boolean followRedirects)
-
getTimestamp
public long getTimestamp()
Gets when the request was sent (unix time).- Returns:
- the timestamp when the request was sent.
- Since:
- 0.14.0
-
setTimestamp
public void setTimestamp(long timestamp)
Sets when the request was sent (unix time).- Parameters:
timestamp- the timestamp when the request was sent.- Since:
- 0.14.0
-
moveUp
public void moveUp(ZestElement ze)
Move up.- Parameters:
ze- the ze
-
moveDown
public void moveDown(ZestElement ze)
Move down.- Parameters:
ze- the ze
-
replaceTokens
public void replaceTokens(ZestVariables tokens)
Replace tokens.- Parameters:
tokens- the tokens
-
isSameSubclass
public boolean isSameSubclass(ZestElement ze)
Description copied from class:ZestElementChecks if is same subclass.- Overrides:
isSameSubclassin classZestStatement- Parameters:
ze- the ze- Returns:
- true, if is same subclass
-
setPrefix
public void setPrefix(String oldPrefix, String newPrefix) throws MalformedURLException
- Throws:
MalformedURLException
-
isPassive
public boolean isPassive()
Description copied from class:ZestStatementChecks if is passive.- Specified by:
isPassivein classZestStatement- Returns:
- true, if is passive
-
clearCookies
public void clearCookies()
-
addCookie
public void addCookie(String domain, String name, String value, String path, Date expiry, boolean secure)
-
addCookie
public void addCookie(ZestCookie cookie)
-
getCookies
public List<ZestCookie> getCookies()
-
-