public class RunnerRestDeploy extends RunnerRest
Modifier and Type | Field and Description |
---|---|
(package private) CommandDeploy |
command
Holding data for command execution.
|
private String |
multipartBoundary |
private static String |
NEWLINE |
parser, report, result
auth, FALSE_VALUE, HTTP_CONNECTION_TIMEOUT, HTTP_RETRY_DELAY, ITEM_SEPARATOR, PARAM_ASSIGN_VALUE, PARAM_SEPARATOR, path, query, QUERY_SEPARATOR, retry, server, silentFailureAllowed, stateListeners, TRUE_VALUE
Constructor and Description |
---|
RunnerRestDeploy(GlassFishServer server,
Command command)
Constructs an instance of administration command executor using
REST interface.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Set the content-type of information sent to the server.
|
InputStream |
getInputStream()
Get
InputStream object for deployed file. |
protected void |
handleSend(HttpURLConnection hconn)
Handle sending data to server using HTTP command interface.
|
protected void |
prepareHttpConnection(HttpURLConnection conn)
Prepare headers for HTTP connection.
|
private void |
writeBinaryFile(OutputStreamWriter writer,
OutputStream output,
File file) |
private void |
writeParam(OutputStreamWriter writer,
String paramName,
String paramValue) |
acceptsGzip, appendIfNotEmpty, appendProperties, constructCommandUrl, createResult, getDoOutput, getRequestMethod, getResponseType, processResponse, readResponse
call, execute, execute, getCommand, getCommandWithQuery, getQuery, getResult, handleReceive, handleSecureConnection, handleStateChange, isSilentFailureAllowed, parallelExecutor, serializedExecutor, setReadyState, setSilentFailureAllowed, setStateListeners, stateChangeArgs, stateChangeArgs, toBoolean, toString
private static final String NEWLINE
private String multipartBoundary
final CommandDeploy command
public RunnerRestDeploy(GlassFishServer server, Command command)
server
- GlassFish server entity object.command
- GlassFish server administration command entity.protected void prepareHttpConnection(HttpURLConnection conn) throws CommandException
RunnerRest
prepareHttpConnection
in class RunnerRest
conn
- Target HTTP connection.CommandException
protected void handleSend(HttpURLConnection hconn) throws IOException
CLIRemoteCommand.java
from the server's code repository. Since some asadmin commands
need to send multiple files, the server assumes the input is a ZIP
stream.handleSend
in class RunnerRest
IOException
private void writeParam(OutputStreamWriter writer, String paramName, String paramValue) throws IOException
IOException
private void writeBinaryFile(OutputStreamWriter writer, OutputStream output, File file) throws IOException
IOException
public String getContentType()
application/zip
for file deployment
and
null
(not set) for directory deployment.getContentType
in class Runner
public InputStream getInputStream()
InputStream
object for deployed file.
InputStream
object for deployed file
or null
for directory deployment.Copyright © 2013. All Rights Reserved.