org.glassfish.api.admin
Interface Payload.Outbound

Enclosing interface:
Payload

public static interface Payload.Outbound

Public API for outbound Payloads.


Method Summary
 void addPart(int index, java.lang.String contentType, java.lang.String name, java.util.Properties props, java.io.InputStream content)
          Adds a part of the specified content type, name, and content at a specified position in the parts of the payload.
 void addPart(java.lang.String contentType, java.lang.String name, java.util.Properties props, java.io.InputStream content)
          Adds a part of the specified content type, name, and content to the payload.
 void addPart(java.lang.String contentType, java.lang.String name, java.util.Properties props, java.lang.String content)
          Adds a part of the specified content type, name, and String content to the payload.
 void attachFile(java.lang.String contentType, java.net.URI fileURI, java.lang.String dataRequestName, java.io.File file)
          Adds a part to the payload of the given content type from the specified file.
 void attachFile(java.lang.String contentType, java.net.URI fileURI, java.lang.String dataRequestName, java.io.File file, boolean isRecursive)
          Adds a part to the payload of the given content type from the specified file.
 void attachFile(java.lang.String contentType, java.net.URI fileURI, java.lang.String dataRequestName, java.util.Properties props, java.io.File file)
          Adds a part to the payload of the given content type from the specified file.
 void attachFile(java.lang.String contentType, java.net.URI fileURI, java.lang.String dataRequestName, java.util.Properties props, java.io.File file, boolean isRecursive)
          Adds a part to the payload of the given content type from the specified file.
 java.lang.String getContentType()
          Returns the content type of the payload, determined by whether there are multiple parts and, if not, if the content type of the single part is of type "text."
 java.lang.String getHeaderName()
          Returns the name of the header that should be set in the outgoing and incoming http request or response.
 void requestFileRemoval(java.net.URI fileURI, java.lang.String dataRequestName, java.util.Properties props)
          Adds a part to the payload that represents a request to remove the specified file, presumably previously transferred in a payload during an earlier request.
 void requestFileRemoval(java.net.URI fileURI, java.lang.String dataRequestName, java.util.Properties props, boolean isRecursive)
          Adds a part to the payload that represents a request to remove the specified file, presumably previously transferred in a payload during an earlier request.
 void requestFileReplacement(java.lang.String contentType, java.net.URI fileURI, java.lang.String dataRequestName, java.util.Properties props, java.io.File file, boolean isRecursive)
          Adds a part to the payload to request that the specified file be replaced.
 void writeTo(java.io.OutputStream os)
          Writes the parts already added to the payload to the specified OutputStream.
 

Method Detail

addPart

void addPart(java.lang.String contentType,
             java.lang.String name,
             java.util.Properties props,
             java.lang.String content)
             throws java.io.IOException
Adds a part of the specified content type, name, and String content to the payload.

Parameters:
contentType - content type of the part
name - name to be assigned to the part
props - Properties to be included with the part
content - String containing the content for the part
Throws:
java.io.IOException

addPart

void addPart(java.lang.String contentType,
             java.lang.String name,
             java.util.Properties props,
             java.io.InputStream content)
             throws java.io.IOException
Adds a part of the specified content type, name, and content to the payload.

Parameters:
contentType - content type of the part
name - name to be assigned to the part
props - Properties to be included with the part
content - InputStream furnishing the content for this part
Throws:
java.io.IOException

addPart

void addPart(int index,
             java.lang.String contentType,
             java.lang.String name,
             java.util.Properties props,
             java.io.InputStream content)
             throws java.io.IOException
Adds a part of the specified content type, name, and content at a specified position in the parts of the payload.

Parameters:
index - position (zero-based) where the part should be added
contentType - content type of the part
name - name to be assigned to thepart
props - Properties to be included with the part
content - InputStream furnishing the content for this part
Throws:
java.io.IOException

attachFile

void attachFile(java.lang.String contentType,
                java.net.URI fileURI,
                java.lang.String dataRequestName,
                java.io.File file)
                throws java.io.IOException
Adds a part to the payload of the given content type from the specified file. The name assigned to the new part is the URI for the file relativized according to the specified file URI. The properties which indicate that this is file transfer data request are set automatically.

If the file argument specifies a directory, only the directory - not its contents - are attached to the payload. To include the directory and its contents use attachFile(java.lang.String, java.net.URI, java.lang.String, java.io.File, boolean) and specify the recursive argument as true.

Parameters:
contentType - content type of the part
fileURI - URI relative to which the part's name should be computed
dataRequestName - name identifying which part of a request this file answers
file - File containing the content for the part
Throws:
java.io.IOException

attachFile

void attachFile(java.lang.String contentType,
                java.net.URI fileURI,
                java.lang.String dataRequestName,
                java.io.File file,
                boolean isRecursive)
                throws java.io.IOException
Adds a part to the payload of the given content type from the specified file. The name assigned to the new part is the URI for the file relativized according to the specified file URI. The properties which indicate that this is file transfer data request are set automatically.

Parameters:
contentType - content type of the part
fileURI - URI relative to which the part's name should be computed
dataRequestName - name identifying which part of a request this file answers
file - File containing the content for the part
isRecursive - if file is a directory, whether to add its contents as well
Throws:
java.io.IOException

attachFile

void attachFile(java.lang.String contentType,
                java.net.URI fileURI,
                java.lang.String dataRequestName,
                java.util.Properties props,
                java.io.File file)
                throws java.io.IOException
Adds a part to the payload of the given content type from the specified file. The name assigned to the new part is the URI for the file relativized according to the specified file URI. The properties which indicate that this is a file transfer data request are set automatically and added to the properties passed by the caller.

Parameters:
contentType - content type of the part
fileURI - URI relative to which the part's name should be computed
dataRequestName - name identifying which part of a request this file answers
props - Properties to be included with the part
file - File containing the content for the part
Throws:
java.io.IOException

attachFile

void attachFile(java.lang.String contentType,
                java.net.URI fileURI,
                java.lang.String dataRequestName,
                java.util.Properties props,
                java.io.File file,
                boolean isRecursive)
                throws java.io.IOException
Adds a part to the payload of the given content type from the specified file. The name assigned to the new part is the URI for the file relativized according to the specified file URI. The properties which indicate that this is a file transfer data request are set automatically and added to the properties passed by the caller.

Parameters:
contentType - content type of the part
fileURI - URI relative to which the part's name should be computed
dataRequestName - name identifying which part of a request this file answers
props - Properties to be included with the part
file - File containing the content for the part
isRecursive - if file is a directory, whether to add its contents as well
Throws:
java.io.IOException

requestFileRemoval

void requestFileRemoval(java.net.URI fileURI,
                        java.lang.String dataRequestName,
                        java.util.Properties props)
                        throws java.io.IOException
Adds a part to the payload that represents a request to remove the specified file, presumably previously transferred in a payload during an earlier request.

Parameters:
fileURI - relative URI of the file for deletion
dataRequestName - name identifying which part of a request triggered the file removal
props - Properties to be included with the part
Throws:
java.io.IOException

requestFileRemoval

void requestFileRemoval(java.net.URI fileURI,
                        java.lang.String dataRequestName,
                        java.util.Properties props,
                        boolean isRecursive)
                        throws java.io.IOException
Adds a part to the payload that represents a request to remove the specified file, presumably previously transferred in a payload during an earlier request.

Parameters:
fileURI - relative URI of the file for deletion
dataRequestName - name identifying which part of a request triggered the file removal
props - Properties to be included with the part
isRecursive - if fileURI is a directory, whether to remove its contents as well
Throws:
java.io.IOException

requestFileReplacement

void requestFileReplacement(java.lang.String contentType,
                            java.net.URI fileURI,
                            java.lang.String dataRequestName,
                            java.util.Properties props,
                            java.io.File file,
                            boolean isRecursive)
                            throws java.io.IOException
Adds a part to the payload to request that the specified file be replaced.

If the fileURI translates to a non-directory file on the receiving system then calling this method will replace the file's contents on the target with the contents of the file argument.

If the fileURI is for a directory, then if isRecursive is also specified the payload will contain one Part to replace the directory (which will have the result of removing the directory and its contents and then recreating the directory) plus a Part for each file, including subdirectories, below the directory. The intent is to replace the entire directory with new contents.

Parameters:
fileURI -
dataRequestName -
props -
isRecursive -
Throws:
java.io.IOException

writeTo

void writeTo(java.io.OutputStream os)
             throws java.io.IOException
Writes the parts already added to the payload to the specified OutputStream.

Parameters:
os - OutputStream to receive the formatted payload
Throws:
java.io.IOException

getContentType

java.lang.String getContentType()
Returns the content type of the payload, determined by whether there are multiple parts and, if not, if the content type of the single part is of type "text."

Returns:
the content type of the pauload

getHeaderName

java.lang.String getHeaderName()
Returns the name of the header that should be set in the outgoing and incoming http request or response.

Returns:
the header name


Copyright © 2012 GlassFish Community. All Rights Reserved.