Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.management.inventory.tool.appresident.servlet
Class InventoryManagmentServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              com.bea.p13n.management.inventory.tool.appresident.servlet.InventoryManagmentServlet

All Implemented Interfaces:
  Serializable, Servlet, ServletConfig

public class InventoryManagmentServlet
extends HttpServlet

The InventoryManagmentServlet allows a remote HTTP client manage inventory. This servlet will allow remote clients to download, upload, diff, validate, and commit inventory into the system. It does not allow for control over the diffrences when being commited. The diff is only provied as a last chance to see what will change when a commit happens. This servlet requires user to have valid user and password to the administration of the system.

Example URL: http://host:port/oam/inventoryservices?j_username=test&j_password=test&op=DOWNLOAD&client=script&filename=inventory.zip

Valid operations:
DOWNLOAD - Used to download the current application inventory.
`

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
filename (optional)- file name to send back to client. Default is inventory.zip
client (optional)- (SCRIPT) if html messages are not to be returned.

COMMIT - Used to commit last uploaded inventory file to system.

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
client (optional) - (SCRIPT) if html messages are not to be returned.
orphan (optional) - Default to false. Used to tell Inventory commit to orphan deleted nodes.

VALIDATE - Used to validated uploaded inventory.

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
client (optional) - (SCRIPT) if html messages are not to be returned.

DIFFERENCE - Returns the diffences from the current inventory and the prior uploaded inventory.

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
client (optional) - (SCRIPT) if html messages are not to be returned.

COMPUTEDOWNLOADSIZE - Returnes the size of the inventory download file.

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
client (optional) - (SCRIPT) if html messages are not to be returned.

PING - Used to validate the servlet is running

Arguments:

j_password(required) - valid password for user name
j_username(required) - valid administartion user name
client (optional) - (SCRIPT) if html messages are not to be returned.

See Also:
  Serialized Form

Field Summary
`static String` | `CLIENTTYPE_PARAMETER`
`static String` | `COMMIT_OPERATION`
`static String` | `COMPUTEDOWNLOADSIZE_OPERATION`
`static String` | `DIFFERENCE_OPERATION`
`static String` | `DOWNLOAD_FILENAME_PARAMETER`
`static String` | `DOWNLOAD_OPERATION`
`static int` | `FILESIZE_LIMIT`
`static String` | `OPERATION_PARAMETER`
`static String` | `PASSWORD_ATTRIBUTE`
`static String` | `PING_OPERATION`
`static String` | `SCRIPT_CLIENTTYPE`
`static String` | `SESSION_ATTRIBUTE`
`static String` | `UPLOAD_OPERATION`
`static String` | `USERID_ATTRIBUTE`
`static String` | `VALIDATE_OPERATION`

Constructor Summary
`InventoryManagmentServlet()`

Method Summary
`protected void` | `commit(HttpServletRequest request, HttpServletResponse response)` Operation to commit current uploaded inventory to system.
`protected void` | `computeInventoryFileSize(HttpServletRequest request, HttpServletResponse response)` Computes the size of the inventory zip, and writes it as html to the response.
`protected void` | `diff(HttpServletRequest request, HttpServletResponse response)` Diffs the current uploaded inventory to the current application inventory.
`protected void` | `doGet(HttpServletRequest request, HttpServletResponse response)` Put method for servlet, performs one of the following operations: retrieves the Zip file as a binary download.
`protected void` | `doPost(HttpServletRequest request, HttpServletResponse response)` Put method for servlet, performs one of the following operations: retrieves the Zip file as a binary download.
`protected void` | `download(HttpServletRequest request, HttpServletResponse response)` Downloads current running application inventory.
`protected com.bea.p13n.management.inventory.hierarchy.InventoryTree` | `getTree(HttpServletRequest request)` Gets the InventoryTree from the InventoryServicesHelper.
`protected boolean` | `isScriptClient(HttpServletRequest request)` Returns true if current client is true.
`protected void` | `showError(String error, Throwable ex, HttpServletRequest request, HttpServletResponse response)` There was a problem, this method reports an error to the client browser.
`protected void` | `upload(HttpServletRequest request, HttpServletResponse response)` Allows inventory zip file to be uploaded to server.
`protected void` | `validate(HttpServletRequest request, HttpServletResponse response)` Operation to request server to validate current uploaded inventory.
`protected File` | `writeInventoryToTemporaryFile(HttpServletRequest request)` Exports the inventory into a zip file in a temporary location.
`protected void` | `writeResponseMessage(String message, HttpServletRequest request, HttpServletResponse response)` Helper method to return text data back to the client.

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CLIENTTYPE_PARAMETER

    public static final String CLIENTTYPE_PARAMETER

See Also:
  Constant Field Values

### COMMIT_OPERATION

    public static final String COMMIT_OPERATION

See Also:
  Constant Field Values

### COMPUTEDOWNLOADSIZE_OPERATION

    public static final String COMPUTEDOWNLOADSIZE_OPERATION

See Also:
  Constant Field Values

### DIFFERENCE_OPERATION

    public static final String DIFFERENCE_OPERATION

See Also:
  Constant Field Values

### DOWNLOAD_FILENAME_PARAMETER

    public static final String DOWNLOAD_FILENAME_PARAMETER

See Also:
  Constant Field Values

### DOWNLOAD_OPERATION

    public static final String DOWNLOAD_OPERATION

See Also:
  Constant Field Values

### FILESIZE_LIMIT

    public static final int FILESIZE_LIMIT

See Also:
  Constant Field Values

### OPERATION_PARAMETER

    public static final String OPERATION_PARAMETER

See Also:
  Constant Field Values

### PASSWORD_ATTRIBUTE

    public static final String PASSWORD_ATTRIBUTE

See Also:
  Constant Field Values

### PING_OPERATION

    public static final String PING_OPERATION

See Also:
  Constant Field Values

### SCRIPT_CLIENTTYPE

    public static final String SCRIPT_CLIENTTYPE

See Also:
  Constant Field Values

### SESSION_ATTRIBUTE

    public static final String SESSION_ATTRIBUTE

See Also:
  Constant Field Values

### UPLOAD_OPERATION

    public static final String UPLOAD_OPERATION

See Also:
  Constant Field Values

### USERID_ATTRIBUTE

    public static final String USERID_ATTRIBUTE

See Also:
  Constant Field Values

### VALIDATE_OPERATION

    public static final String VALIDATE_OPERATION

See Also:
  Constant Field Values

Constructor Detail

### InventoryManagmentServlet

    public InventoryManagmentServlet()

Method Detail

### commit

    protected void commit(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException

  Operation to commit current uploaded inventory to system.

  Parameters:
    `request` -
    `response` -
  Throws:
    `ServletException`
    `IOException`

### computeInventoryFileSize

    protected void computeInventoryFileSize(HttpServletRequest request,
                                            HttpServletResponse response)
                                     throws ServletException,
                                            IOException

  Computes the size of the inventory zip, and writes it as html to the response.

  Parameters:
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### diff

    protected void diff(HttpServletRequest request,
                        HttpServletResponse response)
                 throws ServletException,
                        IOException

  Diffs the current uploaded inventory to the current application inventory.

  Parameters:
    `request` - Http request object.
    `response` - Http response object.
  Throws:
    `ServletException`
    `IOException`

### doGet

    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException,
                         IOException

  Put method for servlet, performs one of the following operations:
  - retrieves the Zip file as a binary download.
  - retrieves the size of the Zip file encoded as HTML ( op=getSize )
  - responds to a ping, verifies the servlet is alive and well (op=ping)

  Parameters:
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### doPost

    protected void doPost(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException

  Put method for servlet, performs one of the following operations:
  - retrieves the Zip file as a binary download.
  - retrieves the size of the Zip file encoded as HTML ( op=getSize )
  - responds to a ping, verifies the servlet is alive and well (op=ping)

  Parameters:
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### download

    protected void download(HttpServletRequest request,
                            HttpServletResponse response)
                     throws ServletException,
                            IOException

  Downloads current running application inventory.

  Parameters:
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### getTree

    protected com.bea.p13n.management.inventory.hierarchy.InventoryTree getTree(HttpServletRequest request)

  Gets the InventoryTree from the InventoryServicesHelper.

  Parameters:
    `request` - the HttpServletRequest
  Returns:
    the InventoryTree, which may have originated from an import file or from the application itself.

### isScriptClient

    protected boolean isScriptClient(HttpServletRequest request)

  Returns true if current client is true.

  Parameters:
    `request` -
  Returns:

### showError

    protected void showError(String error,
                             Throwable ex,
                             HttpServletRequest request,
                             HttpServletResponse response)
                      throws ServletException,
                             IOException

  There was a problem, this method reports an error to the client browser.

  Parameters:
    `error` - the String error, not localized
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### upload

    protected void upload(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException

  Allows inventory zip file to be uploaded to server.

  Parameters:
    `request` - the HttpServletRequest
    `response` - the HttpServletResponse
  Throws:
    `ServletException`
    `IOException`

### validate

    protected void validate(HttpServletRequest request,
                            HttpServletResponse response)
                     throws ServletException,
                            IOException

  Operation to request server to validate current uploaded inventory.

  Parameters:
    `request` -
    `response` -
  Throws:
    `ServletException`
    `IOException`

### writeInventoryToTemporaryFile

    protected File writeInventoryToTemporaryFile(HttpServletRequest request)

  Exports the inventory into a zip file in a temporary location. The file may not survive a server restart.

  Parameters:
    `request` - the HttpServletRequest
  Returns:
    the temporary File

### writeResponseMessage

    protected void writeResponseMessage(String message,
                                        HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws IOException

  Helper method to return text data back to the client. If the client is a script the method will not add html to the response message.

  Parameters:
    `message` - Message to send back to client.
    `request` -
    `response` -
  Throws:
    `IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2005 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 BEA Systems, Inc. All Rights Reserved