01: /* Copyright 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal;
07:
08: /**
09: * A proxy class that allows channels to contribute to inter channel
10: * communication registry.
11: *
12: * @author <a href="mailto:pkharchenko@interactivebusiness.com">Peter Kharchenk
13: </a>
14: * @version $Revision: 34804 $
15: */
16: public class ICCRegistry {
17: private ChannelManager cm;
18: private String currentChannelSubscribeId;
19:
20: /**
21: * Creates a new <code>IICRegistry</code> instance.
22: *
23: * @param cm a <code>ChannelManager</code> value
24: * @param currentChannelSubscribeId a <code>String</code> value
25: */
26: public ICCRegistry(ChannelManager cm,
27: String currentChannelSubscribeId) {
28: this .cm = cm;
29: this .currentChannelSubscribeId = currentChannelSubscribeId;
30: }
31:
32: /**
33: * Add a listener channel
34: *
35: * @param channelSubscribeId a <code>String</code> value
36: */
37: public void addListenerChannel(String channelSubscribeId) {
38: cm.registerChannelDependency(channelSubscribeId,
39: this .currentChannelSubscribeId);
40: }
41:
42: /**
43: * Remove a listener channel
44: *
45: * @param channelSubscribeId a <code>String</code> value
46: */
47: public void removeListenerChannel(String channelSubscribeId) {
48: cm.removeChannelDependency(channelSubscribeId,
49: this .currentChannelSubscribeId);
50: }
51:
52: /**
53: * Add an instructor channel (to which the current channel will listen)
54: *
55: * @param channelSubscribeId a <code>String</code> value
56: */
57: public void addInstructorChannel(String channelSubscribeId) {
58: cm.registerChannelDependency(this .currentChannelSubscribeId,
59: channelSubscribeId);
60: }
61:
62: /**
63: * Remove an instructor channel
64: *
65: * @param channelSubscribeId a <code>String</code> value
66: */
67: public void removeInstructorChannel(String channelSubscribeId) {
68: cm.removeChannelDependency(this.currentChannelSubscribeId,
69: channelSubscribeId);
70: }
71: }
|