Dynamic Address - This is a Focus Executable that dynamically determines recipients at run
time.
The default destination type is Distribution List. Once the destination type is assigned or
accessed by the coder, corresponding properties, such as file names can then be specified or
inspected by use of the class's set and get methods. When creating a distribution object, a coder
must set the destination type with the setType method. The coder must then set the corresponding
property. For example, if the coder sets a setType of DISTRIBUTION_FILE, then the corresponding
setDistributionFile method must be called.
In order to create a single address, distribution file or distribution list distribution type,
the user must pass one of 4 distribution type constants corresponding to the setType method:
SINGLE_ADDRESS
DISTRIBUTION_FILE
DISTRIBUTION_LIST
In order to create a dynamic address, the user must pass a dynamicAddress object to the setType
method.
The following code example illustrates how all four destination types are declared:
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Copyright (c) 2004 Information Builders, Inc. All Rights Reserved. +
+ +
+ Information Builders offers sample API programs as a heuristic device. +
+ They are not intended, as is, for production use. Licensed users are +
+ welcome to alter and extend these samples and deploy them in other +
+ environments, or alternate configurations, as they see fit. +
+ Information Builders will support the documented functionality of +
+ its API classes and methods. However, Information Builders is not +
+ responsible for functionality or behavior of products built with +
+ its API unless the documented behavior of its discrete classes and +
+ methods is different than the actual results. +
+ +
+ Redistributions of IBI source code and documentation must be within +
+ the scope of the Information Builders Software License Agreement. +
+ +
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package ibi.broker.api.test.samples;
import ibi.broker.api.data.schedule.Destination;
import ibi.broker.api.data.schedule.DistributionEmail;
import ibi.broker.api.data.schedule.DistributionFTP;
import ibi.broker.api.data.schedule.DynamicAddress;
public class SampleScheduleDistribution {
public Destination createDestinationSingleAddress()
{
Destination destination = new Destination();
destination.setType(Destination.SINGLE_ADDRESS);
destination.setSingleAddress("aaa@aaa.com");//note: Because this can be a group email address.
//The API will not check for format.
return destination;
}
public Destination createDestinationFile()
{
Destination destination = new Destination();
destination.setType(Destination.DISTRIBUTION_FILE);
destination.setDistributionFile("fileName.txt");
return destination;
}
public Destination createDestinationList()
{
Destination destination = new Destination();
destination.setType(Destination.DISTRIBUTION_LIST);
destination.setDistributionList("listName");
return destination;
}
public DynamicAddress createDynamicAddress()
{
DynamicAddress address = new DynamicAddress();
address.setProcedureName("procedureName.fex");
address.setServerName("ServerName");
address.setUserName("user");
address.setPassword("passw");
return address;
}
public Destination createDestinationDynamic()
{
Destination destination = new Destination();
destination.setType(Destination.DYNAMIC_ADDRESS);
DynamicAddress dynamicAddress = createDynamicAddress();
destination.setDynamicAddress(dynamicAddress);
return destination;
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
DISTRIBUTION_FILE
Destination type indicating distribution file. |
static java.lang.String |
DISTRIBUTION_LIST
Destination type indicating distribution list. |
static java.lang.String |
DYNAMIC_ADDRESS
Destination type indicating dynamic address. |
static java.lang.String |
SINGLE_ADDRESS
Destination type indicating single address. |
Method Summary |
java.lang.String |
getDistributionFile()
Obtains the fully qualified path to the distribution file associated with this Destination
object. |
java.lang.String |
getDistributionList()
This method obtains the distribution list associated with this Destination object. |
DynamicAddress |
getDynamicAddress()
Obtains the DynamicAddress object associated with this Destination object. |
java.lang.String |
getSingleAddress()
Obtains the single email address associated with this Destination object. |
java.lang.String |
getType()
Obtains a String constant representing one of four
destination types associated with this Destination object. |
void |
setDistributionFile(java.lang.String distributionFile)
This method assigns a distribution file, in the form of a fully qualified path
to a file accessible from the distribution server, to this Destination object. |
void |
setDistributionList(java.lang.String distributionList)
Sets the distribution list name to this Destination object. |
void |
setDynamicAddress(DynamicAddress dynamicAddress)
Assigns the DynamicAddress object associated with this Destination object. |
void |
setSingleAddress(java.lang.String singleAddress)
Assigns the single email address associated with this Destination object. |
void |
setType(java.lang.String type)
Assigns a String constant representing
one the four types of destinations associated with this Destination object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISTRIBUTION_LIST
public static final java.lang.String DISTRIBUTION_LIST
- Destination type indicating distribution list.
- See Also:
- Constant Field Values
DISTRIBUTION_FILE
public static final java.lang.String DISTRIBUTION_FILE
- Destination type indicating distribution file.
- See Also:
- Constant Field Values
SINGLE_ADDRESS
public static final java.lang.String SINGLE_ADDRESS
- Destination type indicating single address.
- See Also:
- Constant Field Values
DYNAMIC_ADDRESS
public static final java.lang.String DYNAMIC_ADDRESS
- Destination type indicating dynamic address.
- See Also:
- Constant Field Values
Destination
public Destination()
getDistributionFile
public java.lang.String getDistributionFile()
- Obtains the fully qualified path to the distribution file associated with this Destination
object.
The actual distribution file contains a list of addresses corresponding to
different methods of distributions such as Email, FTP or Printer.
It is a flat text file having a certain format for storing the address
information and corresponding burst values (provided they exist).
The getDistributionFile method does not actually produce the contents of the file itself,
only the name of the file. Only in the case of a SINGLE ADDRESS destination type does the
return value indicate the actual recipient. In the case of a distribution file, the method
produces references to objects in the file system. In the case of DISTRIBUTION LIST,
the corresponding method produces references to data in the Repository.
In the final case of DYNAMIC ADDRESS, the corresponding method produces references to
a FOCUS EXECUTABLE (i.e, 'FOCEXEC') which consists of a FOCUS code
that creates the actual list of addresses dynamically at run time.
- Returns:
- Returns a String representing a fully qualified path
to a file accessible to the distribution serever.
setDistributionFile
public void setDistributionFile(java.lang.String distributionFile)
- This method assigns a distribution file, in the form of a fully qualified path
to a file accessible from the distribution server, to this Destination object. The actual
distribution
file contains a list of addresses corresponding to different methods of distributions
such as Email, FTP or Printer.
It is a flat text file having a certain format for storing the address information
and corresponding burst values (provided they exist).
- Parameters:
distributionFile
- String representing a fully qualified path
to a file accessible to the distribution serever.
getDistributionList
public java.lang.String getDistributionList()
- This method obtains the distribution list associated with this Destination object.
The method produces the name of the actual distribution list which references data in the
repository.
- Returns:
- Returns a string corresponding to the name of the distribution list.
setDistributionList
public void setDistributionList(java.lang.String distributionList)
- Sets the distribution list name to this Destination object.
The actual distribution list consists of references to data in the Repository.
- Parameters:
distributionList
- String representing the name of the distribution list.
getDynamicAddress
public DynamicAddress getDynamicAddress()
- Obtains the DynamicAddress object associated with this Destination object.
The DynamicAddress object refers to a FOCUS EXECUTABLE (i.e, 'FOCEXEC')that
dynamically generates a list of addresses at run time.
- Returns:
- Returns a DynamicAddress object
setDynamicAddress
public void setDynamicAddress(DynamicAddress dynamicAddress)
- Assigns the DynamicAddress object associated with this Destination object.
The DynamicAddress object refers to a FOCUS EXECUTABLE (i.e, 'FOCEXEC')that
dynamically generates a list of addresses at run time.
- Parameters:
dynamicAddress
- a DynamicAddress object
getSingleAddress
public java.lang.String getSingleAddress()
- Obtains the single email address associated with this Destination object.
- Returns:
- Returns a string representing a single email address.
setSingleAddress
public void setSingleAddress(java.lang.String singleAddress)
- Assigns the single email address associated with this Destination object.
- Parameters:
singleAddress
- A string representing a single email address.
getType
public java.lang.String getType()
- Obtains a String constant representing one of four
destination types associated with this Destination object.
DISTRIBUTION_LIST,DISTRIBUTION_FILE,SINGLE_ADDRESS,DYNAMIC_ADDRESS
- Returns:
- A String representing the type of Destination
- See Also:
DISTRIBUTION_LIST
,
DISTRIBUTION_FILE
,
SINGLE_ADDRESS
,
DYNAMIC_ADDRESS
setType
public void setType(java.lang.String type)
- Assigns a String constant representing
one the four types of destinations associated with this Destination object. Once set,
the comparable method specifying the name, or reference information about the type
must also be set. For example, if the coder sets a setType of DISTRIBUTION_FILE,
then the corresponding setDistributionFile method must be called.
The String constant representing the four destination typess associated with this
Destination object are:
DISTRIBUTION_LIST,DISTRIBUTION_FILE,SINGLE_ADDRESS,DYNAMIC_ADDRESS
- Parameters:
type
- A String representing the type of Destination.- See Also:
DISTRIBUTION_LIST
,
DISTRIBUTION_FILE
,
SINGLE_ADDRESS
,
DYNAMIC_ADDRESS
Copyright © 2006 Information Builders, Incorporated.