|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.schedule.Notification
public class Notification
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>"); } }
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 |
---|
public static final java.lang.String INACTIVE
ALWAYS
,
ONERROR
,
Constant Field Valuespublic static final java.lang.String ALWAYS
INACTIVE
,
ONERROR
,
Constant Field Valuespublic static final java.lang.String ONERROR
INACTIVE
,
ALWAYS
,
Constant Field Valuesprotected java.lang.String id
protected java.lang.String description
Constructor Detail |
---|
public Notification()
Method Detail |
---|
public java.lang.String getAddressForBriefNotification()
setAddressForBriefNotification(String)
public void setAddressForBriefNotification(java.lang.String addressForBriefNotification)
addressForBriefNotification
- The brief notification
e-mail address as a String.getAddressForBriefNotification()
public java.lang.String getAddressForFullNotification()
setAddressForFullNotification(String)
public void setAddressForFullNotification(java.lang.String addressForFullNotification)
addressForFullNotification
- A String representing the e-mail address for full notification.getAddressForFullNotification()
public java.lang.String getFrom()
setFrom(String)
public void setFrom(java.lang.String replyAddress)
replyAddress
- The From e-mail address as a StringgetFrom()
public java.lang.String getSubject()
setSubject(String)
public void setSubject(java.lang.String subject)
subject
- The e-mail subject as a String.getSubject()
public java.lang.String getType()
INACTIVE
,
ALWAYS
,
ONERROR
,
setType(String)
public void setType(java.lang.String type)
type
- The notification type as a String.INACTIVE
,
ALWAYS
,
ONERROR
,
getType()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public java.lang.String getId()
public void setId(java.lang.String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |