DBA Data[Home] [Help]

PACKAGE: APPS.FND_CP_OPP_IPC

Source


1 PACKAGE  fnd_cp_opp_ipc AUTHID CURRENT_USER AS
2 /* $Header: AFCPOPIS.pls 120.3 2006/09/15 17:07:36 pferguso noship $ */
3 
4 
5 -- Message types
6 -- these values must be kept in sync with OPPMessage.java
7 COMMAND_TYPE     constant number := 0;
8 REQUEST_TYPE     constant number := 1;
9 RETURN_TYPE      constant number := 2;
10 
11 
12 TYPE subscriber_list is table of varchar2(30);
13 
14 --------------------------------------------------------------------------------
15 
16 
17 -- =========================================================
18 -- Subscription procedures
19 -- =========================================================
20 
21 --
22 -- Subscribe to the OPP AQ
23 --
24 procedure Subscribe(subscriber in Varchar2);
25 
26 
27 --
28 -- Subscribe to the OPP AQ using a particular group
29 --
30 -- Subscribers will only receive messages targeted to this group,
31 -- i.e. where payload.message_group matches the subscriber's group
32 --
33 -- The OPP service will subscribe using the node name (or APPL_TOP name)
34 -- as its group id.
35 --
36 procedure Subscribe_to_group(subscriber in varchar2, groupid in varchar2);
37 
38 
39 --
40 -- Unsubscribe a single subscriber from the OPP AQ
41 --
42 procedure Unsubscribe(subscriber in Varchar2);
43 
44 
45 --
46 -- Return a count of how many subscribers are currently subscribed to the AQ
47 -- for a particular group.
48 --
49 function check_group_subscribers(groupid  in varchar2) return number ;
50 
51 
52 --
53 -- Select a random OPP AQ subscriber out of all the current subscribers.
54 -- Returns the subscriber name.
55 --
56 function select_random_subscriber return varchar2;
57 
58 
59 --
60 -- Remove all subscribers of the OPP AQ
61 --
62 procedure remove_all_subscribers;
63 
64 
65 --
66 -- Return a list of all subscribers
67 --
68 function list_subscribers return subscriber_list;
69 
70 
71 
72 
73 
74 -- =========================================================
75 -- Message sending procedures
76 -- =========================================================
77 
78 
79 
80 --
81 -- Generic send message procedure
82 -- Send a message of any type to one or more recipients
83 --
84 procedure send_message (recipients in subscriber_list,
85                         sender     in Varchar2,
86                         type       in Number,
87                         message    in Varchar2,
88                         Parameters in Varchar2);
89 
90 
91 --
92 -- Send a message of any type to a specific process
93 --
94 procedure send_targeted_message (recipient   in Varchar2,
95                                  sender      in Varchar2,
96                                  type        in Number,
97                                  message     in Varchar2,
98                                  Parameters  in Varchar2,
99 								 correlation in Varchar2 default null);
100 
101 
102 --
103 -- Send a message to a group to post-process a request
104 --
105 procedure send_request (groupid       in Varchar2,
106                         sender        in Varchar2,
107                         request_id    in number,
108                         Parameters    in Varchar2);
109 
110 
111 --
112 -- Send a message to a specific process to post-process a request
113 --
114 procedure send_targeted_request ( recipient  in Varchar2,
115                                   sender     in Varchar2,
116                                   request_id in number,
117                                   parameters in Varchar2);
118 
119 
120 --
121 -- Send an OPP command to a specific process
122 --
123 procedure send_command ( recipient  in Varchar2,
124                          sender     in Varchar2,
125                          command    in Varchar2,
126                          parameters in Varchar2);
127 
128 
129 
130 
131 
132 
133 
134 -- =========================================================
135 -- Receiving messages
136 -- =========================================================
137 
138 
139 --
140 -- Dequeue a message from the OPP AQ
141 --
142 -- INPUT:
143 --   Handle               - Used as the consumer name
144 --   Message_Wait_Timeout - Timeout in seconds
145 --
146 -- OUTPUT:
147 --   Success_Flag   - Y if received message, T if timeout, N if error
148 --   Message_Type   - Type of message
149 --   Message_group  - Group message was sent to
150 --   Message        - Message contents
151 --   Parameters     - Message payload
152 --   Sender         - Sender of message
153 --
154 -- If an exception occurs, success_flag will contain 'N', and
155 -- Message will contain the error message.
156 --
157 
158 Procedure Get_Message ( Handle               in Varchar2,
159                         Success_Flag         OUT NOCOPY  Varchar2,
160                         Message_Type         OUT NOCOPY  Number,
161                         Message_group        OUT NOCOPY  Varchar2,
162                         Message              OUT NOCOPY  Varchar2,
163                         Parameters           OUT NOCOPY  Varchar2,
164                         Sender               OUT NOCOPY  Varchar2,
165                         Message_Wait_Timeout IN          Number   default 60,
166                         Correlation          IN          Varchar2 default null);
167 
168 END fnd_cp_opp_ipc;