ibi.broker.api.data.addrbook
Class AddrBook

java.lang.Object
  extended by ibi.broker.api.data.addrbook.AddrBook
All Implemented Interfaces:
java.io.Serializable

public class AddrBook
extends java.lang.Object
implements java.io.Serializable

 The AddrBook class creates and configures ReportCaster Address Books. An Address Book 
 contains information on the recipients of ReportCaster output, such as e-mail addresses, 
 printers addresses, and FTP file names. 
 

 Address Books also contain burst values.Instead of distributing an entire report, 
 ReportCaster's burst feature allows you to break a report into sections 
 to be distributed separately. Bursting enables relevant sections of a report 
 to be sent to individual users. Each report section is saved as a separate file. 

 The code below shows the use of the  AddrBook  class. It is taken from the
 samples packaged with the product, and shows how an Address Book can be updated.
 
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +  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.samples.addrbook;
 
 import ibi.broker.api.cci.AddressBookManager;
 import ibi.broker.api.cci.CasterConnection;
 import ibi.broker.api.data.addrbook.AddrBook;
 import ibi.broker.api.data.addrbook.DestinationElement;
 import ibi.broker.api.samples.Util;
 
 public class A31_Update 
 {
 
        public A31_Update(String[] arg) throws Exception
        {
                //   Example of arg
                //   bookName xxxNew@ibi.com
                
                String bookName = arg[0];
                String location = arg[1];
                
                // Create manager
                CasterConnection casterConnection = Util.createCasterConnection();
                AddressBookManager manager = casterConnection.getAddressBookManager();
                
                //Retrieve addrBook from repository
                AddrBook addrBook = manager.getAddressBook(bookName);
                
                // Create new destinationElement
                DestinationElement element = new DestinationElement();
                element.setLocation(location);
                 
                // Set into addrBook new DestinationElement List with new destinationElement
                addrBook.setDestinationList(new DestinationElement[]{element});
                
                //update addrBook
                manager.updateAddressBook(addrBook);
        }
        
        
        public static void main(String[] arg)
        {
                A31_Update sampl = null;
                if(arg.length < 2) {
                         menu();
                         return;
                }
                try
                {
                        System.out.println("\n******* " + A31_Update.class.getName() + " *****************");
                        sampl = new A31_Update(arg);
                        System.out.println(sampl.getClass().getName() + " OK");
                }
                catch(Exception ce)
                {
                        ce.printStackTrace();
                        System.out.println(sampl.getClass().getName() + " FAIL");
                }
                
                
        }
        private static void menu()
        {
                System.out.println("Usage: java " + A31_Update.class.getName() + " <bookName> <location>");
        
        
        }
 
 }
 

Version:
5.3
See Also:
Serialized Form

Field Summary
static java.lang.String PRIVATE
          PRIVATE is a string constant that indicates the security level of an Address Book.
static java.lang.String PUBLIC
          PUBLIC is a string constant that indicates the security level of an Address Book.
 
Constructor Summary
AddrBook()
           
 
Method Summary
 AddrBook copy()
          Generates a copy of the passed AddrBook.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAccess()
          Returns the security setting of an Address Book.
 java.lang.String getBookName()
          Returns the name of an Address Book.
 DestinationElement[] getDestinationList()
          Returns an Array of DestinationElements where each includes a destination and a burst value.
 java.lang.String getMethod()
          Returns the distribution method for an Address Book.
 java.lang.String getOwner()
          Returns the owner of an Address Book.
 int hashCode()
           
 void setAccess(java.lang.String access)
          The setAccess method specifies the security level of an Address Book.
 void setBookName(java.lang.String bookName)
          Specifies the name of an Address Book.
 void setDestinationList(DestinationElement[] destinationList)
          Accepts an Array of DestinationElements.
 void setMethod(java.lang.String method)
          Specifies the distribution method for an Address Book.
 void setOwner(java.lang.String user)
          Indicates the owner of an Address Book.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC

public static final java.lang.String PUBLIC
PUBLIC is a string constant that indicates the security level of an Address Book. PUBLIC security setting allows all ReportCaster users to view an Address Book.

See Also:
setAccess(String access), Constant Field Values

PRIVATE

public static final java.lang.String PRIVATE
PRIVATE is a string constant that indicates the security level of an Address Book. PRIVATE security setting allows only the owner of an Address Book and the ReportCaster Administrator to view an Address Book.

See Also:
setAccess(String access), Constant Field Values
Constructor Detail

AddrBook

public AddrBook()
Method Detail

getAccess

public java.lang.String getAccess()
Returns the security setting of an Address Book. The returned value is a string constant, either PUBLIC or PRIVATE.

Returns:
A String constant representing the access type.
See Also:
PUBLIC, PRIVATE

setAccess

public void setAccess(java.lang.String access)
The setAccess method specifies the security level of an Address Book. Access must be a string constant, either PUBLIC or PRIVATE. A public Address Book can be viewed by all ReportCaster users, while a private Address Book can be viewed only by the owner and the ReportCaster Administrator.

Parameters:
access - A String constant representing the access type.

getOwner

public java.lang.String getOwner()
Returns the owner of an Address Book. The owner is the User ID used to create a schedule. This method returns a value from the set of all valid User IDS.

Returns:
the user ID of this Address Book's owner as a String.

setOwner

public void setOwner(java.lang.String user)
Indicates the owner of an Address Book. The user ID specified is associated with the Address Book as the owner, and has privileges to view and modify the Address Book.

Parameters:
user - ID of this Address Book's owner as a String.

getDestinationList

public DestinationElement[] getDestinationList()
Returns an Array of DestinationElements where each includes a destination and a burst value. The return values may be printer addresses, email addresses, or FTP files depending on the distribution method selected for the Address Book. getDestinationList() collectively returns all DestinationElements in an Address Book.

Returns:
An Array of DestinationElement

setDestinationList

public void setDestinationList(DestinationElement[] destinationList)
Accepts an Array of DestinationElements. Depending upon the distribution method, each element may contain an email address, printer destination, or FTP path and the burst value associated with that destination. Collectively these elements create an Address Book.

Parameters:
destinationList - An Array of DestinationElement.

getBookName

public java.lang.String getBookName()
Returns the name of an Address Book.

Returns:
A String representing the name of the Address Book.

setBookName

public void setBookName(java.lang.String bookName)
Specifies the name of an Address Book.

Parameters:
bookName - The unique key of this Address Book as a String.

getMethod

public java.lang.String getMethod()
Returns the distribution method for an Address Book. The value returned is a string constant, either Distribution.FTP, Distribution.EMAIL, or Distribution.PRINT.

Returns:
A String indicating the distribution method.

setMethod

public void setMethod(java.lang.String method)
Specifies the distribution method for an Address Book. The method specified must be a string constant, either Distribution.FTP, Distribution.EMAIL, or Distribution.PRINT.

Parameters:
method - The distribution method of this Address Book.
See Also:
Distribution.FTP, Distribution.EMAIL, Distribution.PRINT

copy

public AddrBook copy()
Generates a copy of the passed AddrBook. The user must have access to the Address Book they choose to copy.

Returns:
a copy of the AddrBook

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2006 Information Builders, Incorporated.