AdventNet Web NMS 4 API Specification

com.adventnet.management.config.ftp
Class FTPAttribute

java.lang.Object
  |
  +--com.adventnet.management.config.xml.BaseElement
        |
        +--com.adventnet.management.config.xml.Attribute
              |
              +--com.adventnet.management.config.ftp.FTPAttribute
All Implemented Interfaces:
java.io.Serializable

public class FTPAttribute
extends Attribute

This class holds configuration information for transfering files using FTP across two devices. By default, file transfer takes place in ascii mode. If destination file name is not specified, source file name will be taken for destination file name.

If the command is GET, file is transferred from remote machine to local machine, so source file name should be specified with respect to the remote machine and the destination file name specified can either be relative to the config server home or be a absolute path.

If the command is PUT, file is transferred from local machine to remote machine, so source file name specified can either be relative to the config server home or be a absolute path and the destFileName should be specified with respect to the remote machine.

See Also:
Serialized Form

Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
FTPAttribute()
          Constructs a FTPAttribute by initializing an empty Element of name "Attribute".
FTPAttribute(Attribute attribute)
          Constructs a FTPAttribute from the specified Attribute's Element.
FTPAttribute(java.lang.String command, java.lang.String fileName)
          Constructs a FTPAttribute with the specified command and file name.
FTPAttribute(java.lang.String command, java.lang.String fileName, java.lang.String mode)
          Constructs a FTPAttribute with the specified command, file name and mode.
FTPAttribute(java.lang.String command, java.lang.String srcFileName, java.lang.String destFileName, java.lang.String mode)
          Constructs a FTPAttribute with the specified command, source file name, destination file name and mode.
FTPAttribute(java.lang.String command, java.lang.String srcFileName, java.lang.String destFileName, java.lang.String mode, java.lang.String connectionMode)
           
 
Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Method used to get the value of an attribute.
 java.lang.String getCommand()
          Returns the command of the FTPAttribute, which is either of FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
 java.lang.String getConnectionMode()
           
 java.lang.String getDestinationFileName()
          Returns the destination file name of FTPAttribute.
 java.lang.String getMode()
          Returns the mode of the file transfer, which is either of FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.
 java.lang.String getSourceFileName()
          Returns the source file name of FTPAttribute.
 void setCommand(java.lang.String command)
          Sets the command of the FTPAttribute, which is either of FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
 void setConnectionMode(java.lang.String mode)
           
 void setDestinationFileName(java.lang.String destFileName)
          Sets the destination file name for file transfer.
 void setMode(java.lang.String mode)
          Sets the mode of file tranfer, which is either of FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.
 void setSourceFileName(java.lang.String srcFileName)
          Sets the source file name for file transfer.
 
Methods inherited from class com.adventnet.management.config.xml.Attribute
getAttributeList, getAttributeType, getIdentifier, getUserAttributes, setAttributeList, setAttributeType, setUserAttributes
 
Methods inherited from class com.adventnet.management.config.xml.BaseElement
addSubTag, getElement, getProperties, getSubTagsByName, hasAttribute, removeSubTagsByName, setAttribute, setProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FTPAttribute

public FTPAttribute()
Constructs a FTPAttribute by initializing an empty Element of name "Attribute".

FTPAttribute

public FTPAttribute(Attribute attribute)
Constructs a FTPAttribute from the specified Attribute's Element.
Parameters:
attribute - Attribute object whose element is taken for initialization.

FTPAttribute

public FTPAttribute(java.lang.String command,
                    java.lang.String fileName)
Constructs a FTPAttribute with the specified command and file name. Here the fileName is used for both the source and destination file name, also the mode of file transfer is taken as ascii.
Parameters:
command - name of the command either FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
fileName - name of the file ( this file name is used for both the source and destination file names ).

FTPAttribute

public FTPAttribute(java.lang.String command,
                    java.lang.String fileName,
                    java.lang.String mode)
Constructs a FTPAttribute with the specified command, file name and mode. Here the fileName is used for both the source and destination file name.
Parameters:
command - name of the command either FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
fileName - name of the file ( this file name is used for both the source and destination file names ).
mode - mode of the file tranfer either FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.

FTPAttribute

public FTPAttribute(java.lang.String command,
                    java.lang.String srcFileName,
                    java.lang.String destFileName,
                    java.lang.String mode)
Constructs a FTPAttribute with the specified command, source file name, destination file name and mode.
Parameters:
command - name of the command either FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
srcFileName - name of the source file ( For GET, srcFileName is in the remote machine and for PUT, srcFileName is in the local machine ).
destFileName - name of the destination file ( For GET, destFileName is in the local machine and for PUT, destFileName is in the remote machine ).
mode - mode of the file tranfer either FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.

FTPAttribute

public FTPAttribute(java.lang.String command,
                    java.lang.String srcFileName,
                    java.lang.String destFileName,
                    java.lang.String mode,
                    java.lang.String connectionMode)
Method Detail

setCommand

public void setCommand(java.lang.String command)
Sets the command of the FTPAttribute, which is either of FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
Parameters:
command - name of the command.

getCommand

public java.lang.String getCommand()
Returns the command of the FTPAttribute, which is either of FTPAttributeConstants.GET_COMMAND or FTPAttributeConstants.PUT_COMMAND
Returns:
the value of the command.

setMode

public void setMode(java.lang.String mode)
Sets the mode of file tranfer, which is either of FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.
Parameters:
mode - mode of the file transfer.

getMode

public java.lang.String getMode()
Returns the mode of the file transfer, which is either of FTPAttributeConstants.ASCII_MODE or FTPAttributeConstants.BINARY_MODE.
Returns:
mode of the file transfer.

setSourceFileName

public void setSourceFileName(java.lang.String srcFileName)
Sets the source file name for file transfer.
Parameters:
srcFileName - name of the source file.

getSourceFileName

public java.lang.String getSourceFileName()
Returns the source file name of FTPAttribute.
Returns:
name of the source file.

setConnectionMode

public void setConnectionMode(java.lang.String mode)

getConnectionMode

public java.lang.String getConnectionMode()

setDestinationFileName

public void setDestinationFileName(java.lang.String destFileName)
Sets the destination file name for file transfer.
Parameters:
destFileName - name of the destination file.

getDestinationFileName

public java.lang.String getDestinationFileName()
Returns the destination file name of FTPAttribute.
Returns:
name of the destination file.

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Description copied from class: BaseElement
Method used to get the value of an attribute.
Overrides:
getAttribute in class BaseElement
Following copied from class: com.adventnet.management.config.xml.BaseElement
Parameters:
name - name of the property whose value is requested.
Returns:
the attribute's value.

AdventNet Web NMS 4 API Specification