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.ant.taskdefs
Class InventoryManagment

    java.lang.Object
      Task
          com.bea.p13n.ant.taskdefs.InventoryManagment

public class InventoryManagment
extends Task

This task takes a number of operations and parameters to help access the inventory services servlet. This task will allow the user to control most of the life cycle for inventory services including (upload, download, diff, commit, validate).
Usage:
1. Define the task in ant script.

< taskdef name="InventoryManagment" classname="com.bea.p13n.ant.taskdefs.InventoryManagment"/>

2. Use new target.

< InventoryManagment sourceURL="http://localhost:7001/oam/inventorymanagment" userName="weblogic" password="bob" destFile="output.zip"/>

Valid agurment combinations:

operation="DOWNLOAD" - Downloades current application inventory to local file system.

sourceURL (Required) - Full URL to remote server holding the Inventory file.
destFile (Required) - Zip file name to store Inventory file in.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="COMMIT"

sourceURL (Required) - Full URL to remote server holding the Inventory file.
orphan (Optional) - ( true or false )tells server to orphan deleted inventor. Default is true. userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="UPLOAD" - Uploades inventory file to server. Using this operation will remove any prior uploaded inventory files from server. This operation also accepts the fileset option to allow for multiple file uploades.

destURL (Required) - Full URL to remote server holding the Inventory file.
sourceFile - Required if no file set is specified. Zip file name to store Inventory file in.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="DIFF" - Request server to return diffrences between current application inventory and uploaded inventory file.

sourceURL (Required) - Full URL to remote server holding the Inventory file.
destFile (Required) - Zip file name to store Inventory file in.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="PING" - Verifies server can be reached and inventory servlet is instlaled

sourceURL (Required) - Full URL to remote server holding the Inventory file.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="DOWNLOADSIZE" - Returnes the size in bytes the downloaded inventory file will be.

sourceURL (Required) - Full URL to remote server holding the Inventory file.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

operation="VALIDATE" - Request server to validated uploaded inventory file.

sourceURL (Required) - Full URL to remote server holding the Inventory file.
userName (Required) - User name to login to server with.
password (Required) - Password to login to server with.
fileOnError (0ptional) - True by default. If task has problem it will throw exception causing Ant to stop.
verbose (Optional) - False by default. If set to true task will print out debug information.

See Also:
  Serialized Form

Field Summary
`static String` | `COMMIT_OPERATION`
`static String` | `DIFFERENCE_OPERATION`
`static String` | `DOWNLOAD_OPERATION`
`static String` | `DOWNLOADSIZE_OPERATION`
`static String` | `PING_OPERATION`
`static String` | `UPLOAD_OPERATION`
`static String` | `VALIDATE_OPERATION`

Constructor Summary
`InventoryManagment()` Copy task constructor.

Method Summary
`void` | `addFileset(FileSet set)` Adds a set of files to copy.
`void` | `execute()` Performs remote download operation.
`String` | `getDestFile()` Returns the file name to write inventory file to.
`String` | `getDestURL()` Returns the URL to download inventory file from.
`boolean` | `getFailOnError()` Returns the true if task should fail ant build.
`String` | `getOperation()`
`boolean` | `getOrphan()`
`String` | `getPassword()` Returns Remote server password.
`String` | `getSourceFile()` Returns the file name to read inventory file from.
`String` | `getSourceURL()` Returns the URL to download inventory file from.
`String` | `getUserName()` Returns the user id used to login to remote server with.
`boolean` | `getVerbose()` Returns true if debugging should be on for task.
`protected void` | `logMessage(String message, Exception e)` Helper method to log error message to ant and to fail task if needed.
`void` | `setDestFile(String file)` File name to write Inventory file to.
`void` | `setDestURL(String url)` Stores the string version of the url for the remote server.
`void` | `setFailOnError(boolean fail)` True if task should throw exception terminating ant script if error is found.
`void` | `setOperation(String operation)`
`void` | `setOphan(boolean orphan)`
`void` | `setPassword(String password)` Password to use to login to remote server with.
`void` | `setSourceFile(String file)` File name to read Inventory file from.
`void` | `setSourceURL(String url)` Stores the string version of the url for the remote server.
`void` | `setUserName(String user)` User to login to remote server with.
`void` | `setVerbose(boolean verbose)` True if debugging for task should be turned on.
`protected void` | `validateAttributes()` Ensure we have a consistent and legal set of attributes

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

Field Detail

### COMMIT_OPERATION

    public static final String COMMIT_OPERATION

See Also:
  Constant Field Values

### DIFFERENCE_OPERATION

    public static final String DIFFERENCE_OPERATION

See Also:
  Constant Field Values

### DOWNLOAD_OPERATION

    public static final String DOWNLOAD_OPERATION

See Also:
  Constant Field Values

### DOWNLOADSIZE_OPERATION

    public static final String DOWNLOADSIZE_OPERATION

See Also:
  Constant Field Values

### PING_OPERATION

    public static final String PING_OPERATION

See Also:
  Constant Field Values

### UPLOAD_OPERATION

    public static final String UPLOAD_OPERATION

See Also:
  Constant Field Values

### VALIDATE_OPERATION

    public static final String VALIDATE_OPERATION

See Also:
  Constant Field Values

Constructor Detail

### InventoryManagment

    public InventoryManagment()

  Copy task constructor.

Method Detail

### addFileset

    public void addFileset(FileSet set)

  Adds a set of files to copy.

  Parameters:
    `set` - a set of files to copy

### execute

    public void execute()
                 throws InventoryManagmentException

  Performs remote download operation.

  Throws:
    `InventoryManagmentException` - if an error occurs

### getDestFile

    public String getDestFile()

  Returns the file name to write inventory file to.

  Returns:
    Inventory zip file name.

### getDestURL

    public String getDestURL()

  Returns the URL to download inventory file from.

  Returns:
    URL of source server.

### getFailOnError

    public boolean getFailOnError()

  Returns the true if task should fail ant build.

  Returns:
    Returns the true if task should fail ant build.

### getOperation

    public String getOperation()

### getOrphan

    public boolean getOrphan()

### getPassword

    public String getPassword()

  Returns Remote server password.

  Returns:
    Remote server password.

### getSourceFile

    public String getSourceFile()

  Returns the file name to read inventory file from.

  Returns:
    Inventory zip file name.

### getSourceURL

    public String getSourceURL()

  Returns the URL to download inventory file from.

  Returns:
    URL of source server.

### getUserName

    public String getUserName()

  Returns the user id used to login to remote server with.

  Returns:
    User id for remote server.

### getVerbose

    public boolean getVerbose()

  Returns true if debugging should be on for task.

  Returns:
    Returns true if debugging should be on for task.

### logMessage

    protected void logMessage(String message,
                              Exception e)
                       throws InventoryManagmentException

  Helper method to log error message to ant and to fail task if needed.

  Parameters:
    `message` - Message to log
    `e` - Exception causing issue.
  Throws:
    `InventoryManagmentException`

### setDestFile

    public void setDestFile(String file)

  File name to write Inventory file to.

  Parameters:
    `file` - Name of file to write inventory file to.

### setDestURL

    public void setDestURL(String url)

  Stores the string version of the url for the remote server. URL Should be in format http://host:port/servletcontext/download

  Parameters:
    `url` - URL to remote server.

### setFailOnError

    public void setFailOnError(boolean fail)

  True if task should throw exception terminating ant script if error is found.

  Parameters:
    `fail` - True if task should throw exception terminating ant script if error is found.

### setOperation

    public void setOperation(String operation)

### setOphan

    public void setOphan(boolean orphan)

### setPassword

    public void setPassword(String password)

  Password to use to login to remote server with.

  Parameters:
    `password` - Password to log in to remote server with.

### setSourceFile

    public void setSourceFile(String file)

  File name to read Inventory file from.

  Parameters:
    `file` - Name of file to write inventory file to.

### setSourceURL

    public void setSourceURL(String url)

  Stores the string version of the url for the remote server. URL Should be in format http://host:port/servletcontext/download

  Parameters:
    `url` - URL to remote server.

### setUserName

    public void setUserName(String user)

  User to login to remote server with.

  Parameters:
    `user` - User id to login to remote server with.

### setVerbose

    public void setVerbose(boolean verbose)

  True if debugging for task should be turned on.

  Parameters:
    `verbose` - True if debugging for task should be turned on.

### validateAttributes

    protected void validateAttributes()
                               throws InventoryManagmentException

  Ensure we have a consistent and legal set of attributes

  Throws:
    `InventoryManagmentException` - if an error occurs

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