© 2005 BEA Systems, Inc.

com.bea.p13n.ant.taskdefs
Class InventoryManagment

java.lang.Object
  extended byTask
      extended bycom.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.


2. Use new target. Valid agurment combinations:

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

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved