ibi.broker.api.data.schedule
Class Notification

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

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

 When scheduled reports are distributed, ReportCaster allows selected 
 individuals to be notified with log information about the distribution. This notification 
 feature can be altered on a per schedule basis and can be set to inactive, always notify, 
 or notify only on error. Each schedule allows two types of notification to be sent 
 simultaneously, brief and full.  Where brief notification contains partial log 
 information  and full notification contains complete log information.
 

The code below illustrates how the notification class is used. It is taken from the samples packaged with the product. + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 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. + + + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ public class S06_Add_Notification { public S06_Add_Notification(String[] arg) throws Exception { // Example of arg // scheduleDescription car execid execpass xxx@ibi.com // //Example of Report source //TABLE FILE CAR //PRINT CAR WHERE //COUNTRY EQ 'ENGLAND' //END String scheduleDescription = arg[0]; String fexFileName = arg[1]; String execId = arg[2]; String execPassword = arg[3]; String notificationAddress = arg[4]; // Create ScheduleManager ScheduleManager manager = Util.createCasterConnection().getScheduleManager(); //create object schedule with default values from config file Schedule schedule = manager.createScheduleInstanceDefault(); //set description schedule.setDescription(scheduleDescription); //set distribution to library Distribution distribution = new StorageLibrary(); schedule.setDistribution(distribution); //create task TaskWFServerProcedure task = new TaskWFServerProcedure(); task.setProcedureName(fexFileName); task.setExecId(execId); task.setExecPassword(execPassword); schedule.setTaskList(new Task[]{task}); //Create Notification Notification notification = new Notification(); notification.setAddressForBriefNotification(notificationAddress); notification.setAddressForFullNotification(notificationAddress); notification.setFrom(notificationAddress); notification.setSubject("Test Notification"); notification.setType(Notification.ALWAYS); schedule.setNotification(notification); //subscribe schedule manager.addSchedule(schedule); } public static void main(String[] arg) { S06_Add_Notification sampl = null; if(arg.length < 5) { menu(); return; } try { System.out.println("\n******* " + S06_Add_Notification.class.getName() + " *****************"); sampl = new S06_Add_Notification(arg); System.out.println("\n" + 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 " + S06_Add_Notification.class.getName() + " <scheduleDescription> <fexFileName> <execId> <execPassword> <notificationAddress>"); } }

Version:
5.3
See Also:
Serialized Form

Field Summary
static java.lang.String ALWAYS
          Notification type indicating to always notify upon running of Schedule.
protected  java.lang.String description
           
protected  java.lang.String id
           
static java.lang.String INACTIVE
          Notification type indicating to never notify upon running Schedule (Default).
static java.lang.String ONERROR
          Notification type indicating to notify only if an error is encountered upon running of Schedule.
 
Constructor Summary
Notification()
           
 
Method Summary
 java.lang.String getAddressForBriefNotification()
          Obtains the e-mail address indicating where a brief notification message will be sent after running a schedule in ReportCaster.
 java.lang.String getAddressForFullNotification()
          Obtains the e-mail address where a full notification message will be sent after running a schedule in ReportCaster.
 java.lang.String getDescription()
           
 java.lang.String getFrom()
          Obtains the e-mail address linked to the From header to which notification will be sent upon running a schedule in ReportCaster.
 java.lang.String getId()
           
 java.lang.String getSubject()
          Obtains the e-mail address linked to the Subject header to which notification will be sent upon running a schedule in ReportCaster.
 java.lang.String getType()
          Obtains the type of notification message to be sent upon the running of a ReportCaster schedule.
 void setAddressForBriefNotification(java.lang.String addressForBriefNotification)
          Specifies the e-mail address where a brief notification message will be sent after running a schedule in ReportCaster.
 void setAddressForFullNotification(java.lang.String addressForFullNotification)
          Specifies the e-mail address where a full notification message will be sent upon running a schedule in ReportCaster.
 void setDescription(java.lang.String description)
           
 void setFrom(java.lang.String replyAddress)
          Specifies the e-mail address linked to the "From" header to which notification will be sent upon running a schedule in ReportCaster.
 void setId(java.lang.String id)
           
 void setSubject(java.lang.String subject)
          Specifies the e-mail address linked to the Subject header to which notification will be sent upon running a schedule in ReportCaster.
 void setType(java.lang.String type)
          Specifies the type of notification message to be sent upon the running of a ReportCaster schedule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INACTIVE

public static final java.lang.String INACTIVE
Notification type indicating to never notify upon running Schedule (Default).

See Also:
ALWAYS, ONERROR, Constant Field Values

ALWAYS

public static final java.lang.String ALWAYS
Notification type indicating to always notify upon running of Schedule.

See Also:
INACTIVE, ONERROR, Constant Field Values

ONERROR

public static final java.lang.String ONERROR
Notification type indicating to notify only if an error is encountered upon running of Schedule.

See Also:
INACTIVE, ALWAYS, Constant Field Values

id

protected java.lang.String id

description

protected java.lang.String description
Constructor Detail

Notification

public Notification()
Method Detail

getAddressForBriefNotification

public java.lang.String getAddressForBriefNotification()
Obtains the e-mail address indicating where a brief notification message will be sent after running a schedule in ReportCaster. The content of the brief notification e-mail is partial log information for a given schedule run. The maximum size of the brief notification e-mail address is 75 characters.

Returns:
The brief notification e-mail address as a String.
See Also:
setAddressForBriefNotification(String)

setAddressForBriefNotification

public void setAddressForBriefNotification(java.lang.String addressForBriefNotification)
Specifies the e-mail address where a brief notification message will be sent after running a schedule in ReportCaster. The content of the brief notification e-mail is partial log information for a given schedule run. The maximum size of the brief notification e-mail address is 75 characters.

Parameters:
addressForBriefNotification - The brief notification e-mail address as a String.
See Also:
getAddressForBriefNotification()

getAddressForFullNotification

public java.lang.String getAddressForFullNotification()
Obtains the e-mail address where a full notification message will be sent after running a schedule in ReportCaster. The content of the full notification e-mail is the complete log information for a given schedule run. The maximum size of the full notification e-mail address is 75 characters.

Returns:
The full notification e-mail address as a String
See Also:
setAddressForFullNotification(String)

setAddressForFullNotification

public void setAddressForFullNotification(java.lang.String addressForFullNotification)
Specifies the e-mail address where a full notification message will be sent upon running a schedule in ReportCaster. The content of the full notification e-mail is the complete log information for a given schedule run. The maximum size of the full notification e-mail address is 75 characters.

Parameters:
addressForFullNotification - A String representing the e-mail address for full notification.
See Also:
getAddressForFullNotification()

getFrom

public java.lang.String getFrom()
Obtains the e-mail address linked to the From header to which notification will be sent upon running a schedule in ReportCaster. The maximum size of the From address is 75 characters.

Returns:
The From e-mail address as a String
See Also:
setFrom(String)

setFrom

public void setFrom(java.lang.String replyAddress)
Specifies the e-mail address linked to the "From" header to which notification will be sent upon running a schedule in ReportCaster. The maximum size of the "From" address is 75 characters.

Parameters:
replyAddress - The From e-mail address as a String
See Also:
getFrom()

getSubject

public java.lang.String getSubject()
Obtains the e-mail address linked to the Subject header to which notification will be sent upon running a schedule in ReportCaster. The maximum size of the e-mail Subject is 255 characters.

Returns:
The e-mail Subject as a String.
See Also:
setSubject(String)

setSubject

public void setSubject(java.lang.String subject)
Specifies the e-mail address linked to the Subject header to which notification will be sent upon running a schedule in ReportCaster. The maximum size of the e-mail Subject is 255 characters.

Parameters:
subject - The e-mail subject as a String.
See Also:
getSubject()

getType

public java.lang.String getType()
Obtains the type of notification message to be sent upon the running of a ReportCaster schedule. The three possible types are: ALWAYS, INACTIVE, and ONERROR.

Returns:
The notification type as a String.
See Also:
INACTIVE, ALWAYS, ONERROR, setType(String)

setType

public void setType(java.lang.String type)
Specifies the type of notification message to be sent upon the running of a ReportCaster schedule. The three possible types are: ALWAYS, INACTIVE, and ONERROR.

Parameters:
type - The notification type as a String.
See Also:
INACTIVE, ALWAYS, ONERROR, getType()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)


Copyright © 2006 Information Builders, Incorporated.