Package org.alfresco.utility.network
Class HttpConsoleOperation
- java.lang.Object
-
- org.alfresco.utility.network.HttpConsoleOperation
-
- Direct Known Subclasses:
ModelAndMessagesConsole,TenantConsole,WorkflowConsole
public abstract class HttpConsoleOperation extends java.lang.Object- Author:
- Paul Brodner
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGprotected TasPropertiespropertiesprotected java.lang.StringrelativePath
-
Constructor Summary
Constructors Constructor Description HttpConsoleOperation(java.lang.String relativePath)Pass the relative path of the "console" page, take a look at the implementation ofTenantConsoleclass
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jsoup.nodes.Elementexecute(org.apache.http.message.BasicNameValuePair command)This is the method that will perform the actual POST command on alfresco consoleprotected org.jsoup.nodes.DocumentfullResponseDocument()Perform the get request on console page.protected java.lang.StringgetAdminBasicAuthentication()protected java.lang.StringgetAlfrescoConsolePath()org.apache.http.impl.client.CloseableHttpClientgetHttpClient()protected org.jsoup.nodes.ElementparsedResponse()
-
-
-
Field Detail
-
properties
@Autowired protected TasProperties properties
-
LOG
protected static org.slf4j.Logger LOG
-
relativePath
protected java.lang.String relativePath
-
-
Constructor Detail
-
HttpConsoleOperation
public HttpConsoleOperation(java.lang.String relativePath)
Pass the relative path of the "console" page, take a look at the implementation ofTenantConsoleclass- Parameters:
relativePath-
-
-
Method Detail
-
getHttpClient
public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
- Returns:
- HTTP Client used in POST calls
-
getAlfrescoConsolePath
protected java.lang.String getAlfrescoConsolePath()
- Returns:
- the full path (server & relative path) of console page
-
getAdminBasicAuthentication
protected java.lang.String getAdminBasicAuthentication()
- Returns:
- Basic Authentication 64 bit encoded of admin user (defined in *.properties file)
-
execute
public org.jsoup.nodes.Element execute(org.apache.http.message.BasicNameValuePair command) throws java.lang.ExceptionThis is the method that will perform the actual POST command on alfresco console- Returns:
- Throws:
java.lang.Exception
-
fullResponseDocument
protected org.jsoup.nodes.Document fullResponseDocument() throws java.lang.ExceptionPerform the get request on console page.- Returns:
Documentobject with entire HTML page- Throws:
java.lang.Exception
-
parsedResponse
protected org.jsoup.nodes.Element parsedResponse() throws java.lang.Exception- Returns:
- the response value parsed
- Throws:
java.lang.Exception
-
-