org.ipdr.ftp
Class SubscriptionGroup

java.lang.Object
  extended by org.ipdr.ftp.SubscriptionGroup

public class SubscriptionGroup
extends java.lang.Object

This class represents a SubscriptionGroup within a Capability file. It provides methods for setting and getting the details of SubscriptionGroup Also provides methods for getting next control file name, maximum sequence number etc.


Field Summary
protected  BRRecord brRecord_
           
protected  java.lang.String controlFileDirectory_
           
protected  java.lang.String controlFileLocalDirectory_
           
protected  java.lang.String controlFileNamePolicy_
           
protected  java.lang.String controlFilePrefix_
           
protected  java.lang.String controlFileSuffix_
           
protected  java.lang.String groupID_
           
protected  java.lang.String RANGE_FILE_SUFFIX
           
 
Constructor Summary
SubscriptionGroup(java.lang.String groupID, java.lang.String controlFileDir, java.lang.String filePrefix, java.lang.String namePolicy, java.lang.String fileSuffix)
           Constructor for SubscriptionGroup.
SubscriptionGroup(java.lang.String groupID, java.lang.String controlFileDir, java.lang.String filePrefix, java.lang.String namePolicy, java.lang.String fileSuffix, BRRecord brRecord)
           Constructor for SubscriptionGroup.
 
Method Summary
 long decrementSequence(long seqNbr)
           This method decrements the value of sequence number by one in case it is greater than 0, otherwise returns maximum sequence number.
 BRRecord getBRRecord()
          This method returns the BRRecord group element of a SubscriptionGroup
 java.lang.String getControlFileDirectory()
           This method returns the URL to the control file directory for a SubscriptionGroup.
 java.lang.String getControlFileLocalDirectory()
           This method returns the exact path of the control file directory for a SubscriptionGroup.
 java.lang.String getControlFileName(long sequenceNbr)
           This method returns the controlFile name for a particular sequence number related to a SubscriptionGroup
 java.lang.String getControlFileNamePolicy()
           This method returns the control file name policy for a SubscriptionGroup This name policy tells the maximum number of digits that could be there in a control file sequence number.
 java.lang.String getControlFilePrefix()
           This method returns the value of control file prefix for a SubscriptionGroup.
 java.lang.String getControlFileSuffix()
           This method returns the control file suffix for a SubscriptionGroup
static java.io.InputStream getFileStreamFromURL(java.lang.String urlString)
           This method returns the InputStream object for the file specified by the URL string.
 java.lang.String getGroupID()
           This method returns the value of GroupID for a SubscriptionGroup
 long getMaxSequenceNumber()
           This method returns the value of maximum sequence number for a SubscriptionGroup
 java.lang.String getRangeFileName()
           This method returns the name of Range file for a SubscriptionGroup
 java.lang.String getSequenceBasedOnPolicy(long seqNbr)
           This method prepends a sequence number with zeroes in case the number of digits in the sequence number are less than the max number of digits.
 long incrementSequence(long seqNbr)
           This method increments the sequence number given by one in case sequence number is less than maximum sequence number, else returns 0.
 void setBRRecord(BRRecord brRecord)
          This method sets the BRRecord group element for a SubscriptionGroup
 void setControlFileDirectory(java.lang.String controlDirectory)
           This method sets the control file directory name for a SubscriptionGroup
 void setControlFileLocalDirectory(java.lang.String controlFileLocalDirectory)
           This method sets the controlFileDirectoryURL
 void setControlFileNamePolicy(java.lang.String namePolicy)
           This method sets the control file name policy for a SubscriptionGroup
 void setControlFilePrefix(java.lang.String filePrefix)
           This method sets the control file prefix for a SubscriptionGroup
 void setControlFileSuffix(java.lang.String fileSuffix)
           This method sets the control file suffix for a SubscriptionGroup
 void setGroupID(java.lang.String groupID)
           This method sets the value of GroupID for a SubscriptionGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupID_

protected java.lang.String groupID_

controlFileDirectory_

protected java.lang.String controlFileDirectory_

controlFilePrefix_

protected java.lang.String controlFilePrefix_

controlFileNamePolicy_

protected java.lang.String controlFileNamePolicy_

controlFileSuffix_

protected java.lang.String controlFileSuffix_

controlFileLocalDirectory_

protected java.lang.String controlFileLocalDirectory_

brRecord_

protected BRRecord brRecord_

RANGE_FILE_SUFFIX

protected final java.lang.String RANGE_FILE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

SubscriptionGroup

public SubscriptionGroup(java.lang.String groupID,
                         java.lang.String controlFileDir,
                         java.lang.String filePrefix,
                         java.lang.String namePolicy,
                         java.lang.String fileSuffix)
                  throws IPDRFTPException

Constructor for SubscriptionGroup. Sets the details of SubscriptionGroup.

Parameters:
groupID - String containing group ID
controlFileDir - String containing the control file directory name.
filePrefix - String that contains the prefix for control file name.
namePolicy - String for naming policy of control file
fileSuffix - String for suffix of control file name.

Throws:
IPDRFTPException

SubscriptionGroup

public SubscriptionGroup(java.lang.String groupID,
                         java.lang.String controlFileDir,
                         java.lang.String filePrefix,
                         java.lang.String namePolicy,
                         java.lang.String fileSuffix,
                         BRRecord brRecord)
                  throws IPDRFTPException

Constructor for SubscriptionGroup. Sets the details of SubscriptionGroup.

Parameters:
groupID - String containing group ID
controlFileDir - String containing the control file directory name.
filePrefix - String that contains the prefix for control file name.
namePolicy - String for naming policy of control file
fileSuffix - String for suffix of control file name.

Throws:
IPDRFTPException
Method Detail

getGroupID

public java.lang.String getGroupID()

This method returns the value of GroupID for a SubscriptionGroup

Returns:
String The value of groupID_


getControlFileDirectory

public java.lang.String getControlFileDirectory()
                                         throws IPDRFTPException

This method returns the URL to the control file directory for a SubscriptionGroup.

Returns:
String The URL of the control file directory

Throws:
IPDRFTPException

getControlFileLocalDirectory

public java.lang.String getControlFileLocalDirectory()
                                              throws IPDRFTPException

This method returns the exact path of the control file directory for a SubscriptionGroup.

Returns:
String The exact path of the control file directory

Throws:
IPDRFTPException

getControlFilePrefix

public java.lang.String getControlFilePrefix()

This method returns the value of control file prefix for a SubscriptionGroup.

Returns:
String The value of controlFilePrefix_


getControlFileNamePolicy

public java.lang.String getControlFileNamePolicy()

This method returns the control file name policy for a SubscriptionGroup This name policy tells the maximum number of digits that could be there in a control file sequence number.

Returns:
String The value of controlFileNamePolicy_


getControlFileSuffix

public java.lang.String getControlFileSuffix()

This method returns the control file suffix for a SubscriptionGroup

Returns:
String The value of controlFileSuffix_


getBRRecord

public BRRecord getBRRecord()
This method returns the BRRecord group element of a SubscriptionGroup

Returns:
BRRecord BRRecord group element


setGroupID

public void setGroupID(java.lang.String groupID)
                throws IPDRFTPException

This method sets the value of GroupID for a SubscriptionGroup

Parameters:
groupID - String that contains the GroupID
Throws:
IPDRFTPException

setControlFileDirectory

public void setControlFileDirectory(java.lang.String controlDirectory)
                             throws IPDRFTPException

This method sets the control file directory name for a SubscriptionGroup

Parameters:
controlDirectory - String that contains the Control file directory
Throws:
IPDRFTPException

setControlFilePrefix

public void setControlFilePrefix(java.lang.String filePrefix)
                          throws IPDRFTPException

This method sets the control file prefix for a SubscriptionGroup

Parameters:
filePrefix - String that contains the Control file prefix
Throws:
IPDRFTPException

setControlFileNamePolicy

public void setControlFileNamePolicy(java.lang.String namePolicy)
                              throws IPDRFTPException

This method sets the control file name policy for a SubscriptionGroup

Parameters:
namePolicy - String with a number of 'N' characters same as maximum number of digits in the sequence number.
Throws:
IPDRFTPException

setControlFileSuffix

public void setControlFileSuffix(java.lang.String fileSuffix)
                          throws IPDRFTPException

This method sets the control file suffix for a SubscriptionGroup

Parameters:
fileSuffix - String that contains the suffic for control file.
Throws:
IPDRFTPException

setBRRecord

public void setBRRecord(BRRecord brRecord)
                 throws IPDRFTPException
This method sets the BRRecord group element for a SubscriptionGroup

Parameters:
brRecord - BRRecord group element.
Throws:
IPDRFTPException

getRangeFileName

public java.lang.String getRangeFileName()
                                  throws IPDRFTPException

This method returns the name of Range file for a SubscriptionGroup

Returns:
String The name of range file for this subscription group.

Throws:
IPDRFTPException

getControlFileName

public java.lang.String getControlFileName(long sequenceNbr)
                                    throws IPDRFTPException

This method returns the controlFile name for a particular sequence number related to a SubscriptionGroup

Parameters:
sequenceNbr - sequence number for which control file name is required.
Returns:
String The control file name

Throws:
IPDRFTPException

getMaxSequenceNumber

public long getMaxSequenceNumber()

This method returns the value of maximum sequence number for a SubscriptionGroup

Returns:
String The value of groupID_


getSequenceBasedOnPolicy

public java.lang.String getSequenceBasedOnPolicy(long seqNbr)
                                          throws IPDRFTPException

This method prepends a sequence number with zeroes in case the number of digits in the sequence number are less than the max number of digits.

Parameters:
seqNbr - long to be prepended with zeores
Returns:
String the sequence number with zeroes prepended to it.

Throws:
IPDRFTPException

incrementSequence

public long incrementSequence(long seqNbr)
                       throws IPDRFTPException

This method increments the sequence number given by one in case sequence number is less than maximum sequence number, else returns 0.

Parameters:
seqNbr - long to be increased by one.
Returns:
long incremented value

Throws:
IPDRFTPException

decrementSequence

public long decrementSequence(long seqNbr)
                       throws IPDRFTPException

This method decrements the value of sequence number by one in case it is greater than 0, otherwise returns maximum sequence number.

Parameters:
seqNbr - long Sequence numberv to be decremented
Returns:
long Sequence number with decremented value.

Throws:
IPDRFTPException

setControlFileLocalDirectory

public void setControlFileLocalDirectory(java.lang.String controlFileLocalDirectory)

This method sets the controlFileDirectoryURL

Parameters:
controlFileLocalDirectory - String containing the control file directory URL.


getFileStreamFromURL

public static java.io.InputStream getFileStreamFromURL(java.lang.String urlString)
                                                throws IPDRFTPException

This method returns the InputStream object for the file specified by the URL string. This is a utility method

Parameters:
urlString - String containing the URL of a file.
Returns:
InputStream An InputStream for the file URL.

Throws:
IPDRFTPException