DBA Data[Home] [Help]

PACKAGE BODY: APPS.FND_APP_SERVER_PKG

Source


1 PACKAGE BODY fnd_app_server_pkg AS
2 /* $Header: AFSCASRB.pls 120.1.12000000.3 2007/05/17 15:26:49 pdeluna ship $ */
3 
4 /* create_server_id
5 **
6 ** Returns a new unique server_id. The server_id is a string of 64 characters.
7 ** The 1st 32 is a globally unique id and the next 32 is a randomnly
8 ** generated number. Dynamic sql is being used to create the globally unique id
9 ** because PL/SQL doesn't yet support it. This is called by
10 ** AdminAppServer.createServerId().
11 */
12 FUNCTION create_server_id RETURN VARCHAR2
13   IS
14      svrid fnd_application_servers.server_id%TYPE;
15      guid VARCHAR2(32);
16      rnd_dt VARCHAR2(32);
17      curs integer;
18      sqlbuf varchar2(2000);
19      rows integer;
20 BEGIN
21    curs := dbms_sql.open_cursor;
22    sqlbuf := 'select substr(RawToHex(sys_op_guid()),0,32) from dual';
23    dbms_sql.parse(curs, sqlbuf, dbms_sql.v7);
24    dbms_sql.define_column(curs, 1, guid, 32);
25    rows := dbms_sql.execute(curs);
26    rows := dbms_sql.fetch_rows(curs);
27    dbms_sql.column_value(curs, 1, guid);
28    dbms_sql.close_cursor(curs);
29 
30    fnd_random_pkg.init(7);
31    fnd_random_pkg.seed(to_number(to_char(sysdate, 'JSSSSS')), 10, FALSE);
32    rnd_dt:=Substr((To_char(fnd_random_pkg.get_next)||To_char(fnd_random_pkg.get_next)||To_char(fnd_random_pkg.get_next)||To_char(fnd_random_pkg.get_next)),0,32);
33    RETURN guid||rnd_dt;
34 END;
35 
36 /* get_platform_code
37 **
38 ** This is a private API that Returns the platform_code based on the
39 ** lookup_type 'PLATFORM' defined in afoamluplt.ldt. This is called by
40 ** insert_server and update_server.
41 **
42 ** Testcase to test API:
43 
44 set serverout on
45 begin
46    dbms_output.put_line('Solaris = '||
47       FND_APP_SERVER_PKG.get_platform_code('Solaris'));
48    dbms_output.put_line('HP-UX = '||
49       FND_APP_SERVER_PKG.get_platform_code('HP-UX'));
50    dbms_output.put_line('UNIX Alpha = '||
51       FND_APP_SERVER_PKG.get_platform_code('UNIX Alpha'));
52    dbms_output.put_line('IBM AIX = '||
53       FND_APP_SERVER_PKG.get_platform_code('IBM AIX'));
54    dbms_output.put_line('Intel_Solaris = '||
55       FND_APP_SERVER_PKG.get_platform_code('Intel_Solaris'));
56    dbms_output.put_line('Linux = '||
57       FND_APP_SERVER_PKG.get_platform_code('Linux'));
58    dbms_output.put_line('Windows NT = '||
59       FND_APP_SERVER_PKG.get_platform_code('Windows NT'));
60    dbms_output.put_line('Others = '||
61       FND_APP_SERVER_PKG.get_platform_code('Others'));
62    -- R12 only
63    dbms_output.put_line('Others = '||
64       FND_APP_SERVER_PKG.get_platform_code('LINUX_X86-64'));
65 end;
66 
67 Output should be similar to this:
68 
69 Solaris = 453 (23 for R12)
70 HP-UX = 2 (59 for R12)
71 UNIX Alpha = 87
72 IBM AIX = 319 (212 for R12)
73 Intel_Solaris = 173
74 Linux = 46
75 Windows NT = 912
76 Others = 100000
77 LINUX_X86-64 = 226 (R12)
78 
79 */
80 FUNCTION get_platform_code(p_platform IN VARCHAR2) RETURN VARCHAR2
81 IS
82      l_platform_code VARCHAR2(30);
83 BEGIN
84    -- The FND_LOOKUP_VALUES.TAG column was updated for the PLATFORM lookup_type
85    -- to support the p_platform values derived from
86    -- SystemCheck.DetectPlatform().
87    --
88    -- The following query was modeled not to violate the FND_LOOKUP_VALUES_U1
89    -- unique index. See bug 5723530.
90    select lookup_code
91    into l_platform_code
92    from fnd_lookup_values
93    where lookup_type = 'PLATFORM'
94    and tag = p_platform
95    and language = userenv('LANG')
96    and view_application_id = 0
97    and security_group_id = 0;
98 
99    return l_platform_code;
100 
101 EXCEPTION WHEN no_data_found THEN
102    raise no_data_found;
103 END;
104 
105 /* insert_server
106 **
107 ** Inserts information for a new Application Server. The function
108 ** create_server_id must be called to generate a valid id prior to
109 ** calling this api. This is called by AdminAppServer.changeServerInDB().
110 **
111 ** FND_APP_SERVER_PKG.INSERT_SERVER is a wrapper to
112 ** FND_CONCURRENT.REGISTER_NODE.
113 */
114 PROCEDURE insert_server (
115    p_server_id      IN VARCHAR2,
116    p_address        IN VARCHAR2,
117    p_node_name      IN VARCHAR2,
118    p_description    IN VARCHAR2 DEFAULT NULL,
119    p_webhost        IN VARCHAR2 DEFAULT NULL,
120    p_platform_code  IN VARCHAR2 DEFAULT NULL,
121    p_support_cp     IN VARCHAR2 DEFAULT NULL,
122    p_support_forms  IN VARCHAR2 DEFAULT NULL,
123    p_support_web    IN VARCHAR2 DEFAULT NULL,
124    p_support_admin  IN VARCHAR2 DEFAULT NULL,
125    p_support_db     IN VARCHAR2 DEFAULT NULL)
126 IS
127 
128    kount           number := 0;
129    curr_node_id    number := 0;
130    curr_node_name  VARCHAR2(30) := null;
131    l_node_name     VARCHAR2(30) := UPPER(p_node_name);
132    l_platform_code VARCHAR2(30);
133 
134 BEGIN
135    -- Bug 3736714: Platform Code is required by FND_NODES to register a
136    -- node. AdminAppServer has been modified to support platform code.
137    l_platform_code := get_platform_code(p_platform_code);
138 
139    /*  Bug 5279502: DESKTOP NODE SUPPORT IN FND_APP_SERVER_PKG */
140 
141    /*===============+
142     | Desktop Node  |
143     ================*/
144    IF p_support_cp = 'N' and p_support_forms = 'N' and
145       p_support_web = 'N' and p_support_admin = 'N' and
146       p_support_db = 'N' and l_platform_code = '100000' then
147 
148       -- Check if node already exists in FND_NODES.
149       -- Desktop nodes use node_name as primary key.
150       select count(*) into kount
151       from fnd_nodes
152       where UPPER(node_name) = l_node_name;
153 
154       -- If node exists then update the desktop node.
155       IF kount > 0 THEN
156          update_desktop_server(l_node_name, p_server_id,p_address,
157             p_description);
158       ELSE
159          -- Insert the node using fnd_concurrent.register_node
160          FND_CONCURRENT.REGISTER_NODE(
161             name => l_node_name,
162             platform_id => to_number(l_platform_code),
163             forms_tier => p_support_forms,
164             cp_tier => p_support_cp,
165             web_tier => p_support_web,
166             admin_tier => p_support_admin,
167             p_server_id => p_server_id,
168             p_address => p_address,
169             p_description => p_description,
170             db_tier => p_support_db);
171       END IF;
172 
173    /*==========================+
174     | Application Server Node  |
175     ===========================*/
176    ELSE
177 
178       -- Check if node already exists in FND_NODES.
179       select count(*) into kount
180       from fnd_nodes
181       where server_address = p_address;
182 
183       -- If node exists and
184       IF kount > 0 THEN
185          /* Added for Bug 3736714 to clean up entries that have node names which
186          ** are not fully qualified hostnames.
187          */
188 
189          -- If platform_code passed in is UNIX Alpha
190          IF (l_platform_code = '87') THEN
191 
192             -- Then, get the node_id and node_name of the existing node
193             -- entry.
194             select node_id, node_name
195             into curr_node_id, curr_node_name
196             from fnd_nodes
197             where server_address = p_address;
198 
199             -- If the current node_name is not a fully qualified hostname
200             IF INSTR(curr_node_name, '.') = 0 THEN
201 
202                -- Insert the new node using fnd_concurrent.register_node
203                FND_CONCURRENT.REGISTER_NODE(
204                   name => l_node_name,
205                   platform_id => to_number(l_platform_code),
206                   forms_tier => p_support_forms,
207                   cp_tier => p_support_cp,
208                   web_tier => p_support_web,
209                   admin_tier => p_support_admin,
210                   p_server_id => p_server_id,
211                   p_address => p_address,
212                   p_description => p_description,
213                   db_tier => p_support_db);
214 
215                -- Update the old node with the correct platform and null
216                -- out server_id and server_address so that the node does
217                -- not get referenced again.
218                UPDATE FND_NODES
219                SET PLATFORM_CODE = '87',
220                    SERVER_ADDRESS = NULL,
221                    SERVER_ID = NULL
222                WHERE NODE_ID = curr_node_id;
223 
224                -- Added for Bug 3292353.
225                select count(*) into kount
226                from fnd_nodes
227                where UPPER(node_name) = l_node_name;
228 
229                -- Since fnd_concurrent.register_node() does not handle
230                -- the hostname at this time, it will be manually inserted
231                -- using the update_server API IF the node was properly
232                -- inserted using fnd_concurrent.register_node().
233                if kount > 0 then
234                -- If webhost was provided.
235                   if (p_webhost is not null) then
236                      update_server(p_server_id, p_address, p_description,
237                         p_webhost);
238                   end if;
239                end if; -- kount > 0
240             END IF;    -- INSTR(curr_node_name, '.') = 0
241 
242          ELSE
243             /* Node already exists.  It should not be inserted again, just
244                updated.*/
245             update_server(p_server_id, p_address, p_description, p_webhost,
246                p_platform_code);
247          END IF;       -- (l_platform_code = '87')
248 
249       ELSE  /* Node does not exist, the server will be inserted. */
250 
251          -- Check if p_node_name is a fully qualified hostname with domain.
252          -- FND_NODES.NODE_NAME should only have hostname if platform is not
253          -- UNIX Alpha.
254          if (l_platform_code <> '87' and INSTR(p_node_name, '.') <> 0) then
255             -- The hostname should be the beginning of the string up until
256             -- the first period.  FND_NODES.NODE_NAME is stored in
257             -- UPPERCASE.
258             l_node_name := UPPER(SUBSTR(p_node_name, 0,
259                INSTR(p_node_name, '.') - 1));
260          end if;
261          -- Insert the node using fnd_concurrent.register_node
262          FND_CONCURRENT.REGISTER_NODE(
263             name => l_node_name,
264             platform_id => to_number(l_platform_code),
265             forms_tier => p_support_forms,
266             cp_tier => p_support_cp,
267             web_tier => p_support_web,
268             admin_tier => p_support_admin,
269             p_server_id => p_server_id,
270             p_address => p_address,
271             p_description => p_description,
272             db_tier => p_support_db);
273 
274          -- Added for Bug 3292353.
275          select count(*) into kount
276          from fnd_nodes
277          where UPPER(node_name) = l_node_name;
278 
279          -- Since fnd_concurrent.register_node() does not handle the hostname
280          -- at this time, it will be manually inserted using the
281          -- update_server API IF the node was properly inserted using
282          -- fnd_concurrent.register_node().
283          IF kount > 0 THEN
284             -- If webhost was provided, update only the servers, not desktop
285             -- nodes.
286             IF (p_webhost IS NOT NULL) and (l_platform_code <> '100000') THEN
287                update_server(p_server_id, p_address, p_description,
288                   p_webhost);
289             END IF;
290          ELSE -- kount = 0
291             -- Bug 5279502: DESKTOP NODE SUPPORT IN FND_APP_SERVER_PKG
292             -- Added this for better error handling.
293             -- If for any reason that the FND_CONCURRENT.REGISTER_NODE() fails
294             -- to add the node, no_data_found should be raised to signal the
295             -- failure to add the node_name.  If the node existed prior to
296             -- calling FND_CONCURRENT.REGISTER_NODE(), kount should still be
297             -- >0.
298             RAISE no_data_found;
299          END IF;
300 
301       END IF;          -- kount > 0
302    END IF;             -- desktop node
303 
304 END insert_server;
305 
306 
307 /* delete_server
308 **
309 ** This procedure used to remove an Application Server row from the database.
310 ** Due to the migration of FND_APPLICATION_SERVERS to FND_NODES,
311 ** fnd_nodes.server_id is nulled out instead in order to preserve the
312 ** node_name and avoid dangling references to the node_name. This is called by
313 ** AdminAppServer.delSvrFromDB().
314 */
315 PROCEDURE delete_server (p_address IN VARCHAR2)
316 IS
317 BEGIN
318 
319    UPDATE fnd_nodes
320    SET server_id = NULL
321    WHERE server_address = p_address;
322 
323 EXCEPTION WHEN no_data_found THEN
324    raise no_data_found;
325 END;
326 
327 /* update_server
328 **
329 ** This procedure should only be used for updating Application Server Nodes.
330 ** The server_id, description, host and domain are updated if they are not
331 ** NULL. If a new server_id is required, the create_server_id function should
332 ** be called prior to this. This is called by
333 ** AdminAppServer.changeServerInDB().
334 */
335 PROCEDURE update_server (
336    p_server_id   IN VARCHAR2 DEFAULT NULL,
337    p_address     IN VARCHAR2,
338    p_description IN VARCHAR2 DEFAULT NULL,
339    p_webhost     IN VARCHAR2 DEFAULT NULL,
340    p_platform    IN VARCHAR2 DEFAULT NULL)
341 IS
342    l_node_name     VARCHAR2(30);
343    l_support_cp    VARCHAR2(1);
344    l_support_forms VARCHAR2(1);
345    l_support_web   VARCHAR2(1);
346    l_support_admin VARCHAR2(1);
347    l_support_db    VARCHAR2(1);
348    l_platform      VARCHAR2(30);
349    l_platform2     VARCHAR2(30);
350 
351 BEGIN
352 
353    /*  Bug 5279502: DESKTOP NODE SUPPORT IN FND_APP_SERVER_PKG */
354 
355    -- The API should not allow updates of Desktop Nodes.  This query obtains
356    -- the value of columns that determines a Desktop Node.
357    select NODE_NAME, SUPPORT_CP, SUPPORT_FORMS, SUPPORT_WEB, SUPPORT_ADMIN,
358       SUPPORT_DB, PLATFORM_CODE
359    into l_node_name, l_support_cp, l_support_forms, l_support_web,
360       l_support_admin,l_support_db, l_platform
361    from fnd_nodes
362    where server_address = p_address;
363 
364    IF SQL%notfound THEN
365       RAISE no_data_found;
366    END IF;
367 
368    -- Desktop Nodes will have the SUPPORT_* columns explicitly set to 'N' and
369    -- PLATFORM_CODE = '100000' when registered.  If any of the column values
370    -- are not what a Desktop should have, then it can be processed in this API
371    IF l_support_cp <> 'N' or l_support_forms <> 'N' or
375       IF(l_node_name <> UPPER(l_node_name)) THEN
372       l_support_web <> 'N' or l_support_admin <> 'N' or
373       l_support_db <> 'N' or l_platform <> '100000' then
374 
376          UPDATE fnd_nodes
377          SET node_name = UPPER(l_node_name)
378          WHERE server_address = p_address;
379       END IF;
380 
381       IF(p_server_id IS NOT NULL) THEN
382          UPDATE fnd_nodes
383          SET server_id = p_server_id
384          WHERE server_address = p_address;
385       END IF;
386 
387       IF(p_description IS NOT NULL) THEN
388          UPDATE fnd_nodes
389          SET description = p_description
390          WHERE server_address = p_address;
391       END IF;
392 
393       -- Added for Bug 3292353.  ICX code will be calling FND_NODES.WEBHOST so
394       -- there needs to be a way to populate/update the column.  This may
395       -- later be changed to use CP APIs.
396       IF(p_webhost IS NOT NULL) THEN
397          UPDATE fnd_nodes
398          SET webhost = p_webhost
399          WHERE server_address = p_address;
403       -- only AdminAppServer calls FND_APP_SERVER_PKG, then if a platform is
400       END IF;
401 
402       -- Added for Bug 3736714.  Since AdminAppServer derives the platform and
404       -- passed in, the platform_code is likely correct and the platform_code
405       -- for the node needs to be updated.
406       IF (p_platform is NOT NULL) THEN
407          l_platform2 := get_platform_code(p_platform);
408 
409          UPDATE fnd_nodes
410          SET PLATFORM_CODE = l_platform2
411          WHERE server_address = p_address;
412       END IF;
413 
414       /*
415       Bug 3773424:AUTHENTICATION NODE HAS NO VALUES FOR FND_NODES.SUPPORT_*
416       COLUMNS.  A system alert is being logged stating that it "Could not
417       contact Service Manager FNDSM_AUTHENTICATION_*".  It seems that the
418       ICM attempts to tnsping all remote Service Managers using the query:
419 
420       SELECT NODE_NAME, STATUS, NODE_MODE
421       FROM FND_NODES
422       WHERE NOT (SUPPORT_CP = 'N' AND
423           SUPPORT_WEB = 'N' AND SUPPORT_FORMS = 'N' AND
424           SUPPORT_ADMIN = 'N' AND SUPPORT_CP is NOT NULL AND
425           SUPPORT_WEB is NOT NULL AND
426           SUPPORT_ADMIN is NOT NULL AND SUPPORT_FORMS is NOT NULL)
427 
428       Since the AUTHENTICATION row is inserted without these SUPPORT_*
429       columns, the system alert gets logged.  This IF block has been added
430       to check whether those columns have a value for the AUTHENTICATION row.
431       It the column(s) have a null value, 'N' is explicitly set for the
432       applicable SUPPORT_* column.
433       */
434 
435       IF (p_address = '*') THEN
436 
437          IF (l_support_cp is NULL) THEN
438             UPDATE fnd_nodes
439             SET SUPPORT_CP = 'N'
440             WHERE server_address = p_address;
441          END IF;
442 
443          IF (l_support_forms is NULL) THEN
444             UPDATE fnd_nodes
445             SET SUPPORT_FORMS = 'N'
446             WHERE server_address = p_address;
447          END IF;
448 
449          IF (l_support_web is NULL) THEN
450             UPDATE fnd_nodes
451             SET SUPPORT_WEB = 'N'
452             WHERE server_address = p_address;
453          END IF;
454 
455          IF (l_support_admin is NULL) THEN
456             UPDATE fnd_nodes
457             SET SUPPORT_ADMIN = 'N'
458             WHERE server_address = p_address;
459          END IF;
460 
461          IF (l_support_db is NULL) THEN
462             UPDATE fnd_nodes
463             SET SUPPORT_DB = 'N'
464             WHERE server_address = p_address;
465          END IF;
466 
467          /* Bug 3736714 - Need to ensure that AUTHENTICATION row has the right
468          ** platform.
469          */
470          IF (p_platform is NOT NULL) THEN
471             l_platform2 := get_platform_code(p_platform);
472             IF (l_platform <> l_platform2) THEN
473                UPDATE fnd_nodes
474                SET PLATFORM_CODE = l_platform2
475                WHERE server_address = p_address;
476             END IF;
477          END IF;
478 
479       END IF;
480 
481    END IF;  -- IF THEN for Desktop Node
482 
483 END update_server;
484 
485 /* authenticate
486 **
487 ** This procedure is used to turn toggle AUTHENTICATION for an Application
488 ** Server Node. If the AUTHENTICATION row does not exist yet, the procedure
489 ** will insert it. The row with server_address='*' indicates the authentication
490 ** value. If the row already exists, the procedure updates the value to what
491 ** has been passed. The valid AUTHENTICATION values are:
492 **    'ON'
493 **    'OFF'
494 **    'SECURE'
495 ** This is called by AdminAppServer.setAuthentication().
496 **
497 ** Bug 3736714: the p_platform argument was added so that the authentication
498 ** row can be added with the correct platform.  The platform is determined in
499 ** AdminAppServer.java.
500 */
501 PROCEDURE authenticate (
502    p_value    IN VARCHAR2,
503    p_platformcode IN VARCHAR2 DEFAULT NULL
504    )
505 IS
506 BEGIN
507 
508    /* Bug 3736714 - The AUTHENTICATION row should be seeded with the correct
509    ** platform even if it isn't technically a node.
510    */
511    update_server(
512       p_server_id => p_value,
513       p_address => '*',
514       p_description => 'Authentication Value',
515       p_platform => p_platformcode);
516 
517 EXCEPTION WHEN no_data_found THEN
518    /*
519    insert_server(p_value,'*','AUTHENTICATION','Authentication value');
520 
521    Bug 3773424:AUTHENTICATION NODE HAS NO VALUES FOR FND_NODES.SUPPORT_*
522    COLUMNS.  A system alert is being logged stating that it "Could not
523    contact Service Manager FNDSM_AUTHENTICATION_*".  It seems that the
524    ICM attempts to tnsping all remote Service Managers using the query:
525 
526    SELECT NODE_NAME, STATUS, NODE_MODE
527    FROM FND_NODES
528    WHERE NOT (SUPPORT_CP = 'N' AND
529        SUPPORT_WEB = 'N' AND SUPPORT_FORMS = 'N' AND
530        SUPPORT_ADMIN = 'N' AND SUPPORT_CP is NOT NULL AND
531        SUPPORT_WEB is NOT NULL AND
532        SUPPORT_ADMIN is NOT NULL AND SUPPORT_FORMS is NOT NULL)
533 
534    Since the AUTHENTICATION row is inserted without these SUPPORT_*
535    columns, the system alert gets logged.  The call to insert_server has
536    been modified to explicitly set the SUPPORT_* with a value of 'N'.
537    */
538 
539    insert_server (
540       p_server_id     => p_value,
541       p_address       => '*',
542       p_node_name     => 'AUTHENTICATION',
543       p_description   => 'Authentication value',
544       p_platform_code => p_platformcode,
548       p_support_admin => 'N',
545       p_support_cp    => 'N',
546       p_support_forms => 'N',
547       p_support_web   => 'N',
549       p_support_db    => 'N');
550 
551 END;
552 
553 /* insert_desktop_server
554 **
555 ** This API is used for Desktop Nodes only.
556 ** It calls insert_server and sets all the SUPPORT_* collumns to 'N' and the
557 ** PLATFORM_CODE to 'Others'.  It also places 'Desktop Node' as the description
558 ** if NULL was passed.
559 */
560 PROCEDURE insert_desktop_server(
561    p_node_name    IN VARCHAR2,
562    p_server_id    IN VARCHAR2,
563    p_address      IN VARCHAR2 DEFAULT NULL,
564    p_description  IN VARCHAR2 DEFAULT NULL)
565 IS
566 BEGIN
567 
568    -- Check that the server_address passed is not for the AUTHENTICATION row.
569    -- The AUTHENTICATION row also has SUPPORT_* columns = 'N', so it needs to
570    -- be distinguished from Desktop Nodes.
571    -- a NULL server_address can be passed, but not server_address = '*'
572    IF ((p_address is not NULL) and (p_address <> '*')) or (p_address is NULL) THEN
573       insert_server (
574          p_server_id     => p_server_id,
575          p_address       => p_address,
576          p_node_name     => p_node_name,
577          p_description   => nvl(p_description,'Desktop Node'),
578          p_platform_code => 'Others',     -- Use 'Others' as the platform_code
579          p_support_cp    => 'N',
580          p_support_forms => 'N',
581          p_support_web   => 'N',
582          p_support_admin => 'N',
583          p_support_db    => 'N');
584    END IF;
585 
586 END insert_desktop_server;
587 
588 /* update_desktop_server
589 **
590 ** This API is used for Desktop Nodes only.
591 ** Update the FND_NODES row associated with p_node_name with the specified
592 ** values for server_id, address, and description. If NULLs are passed, do not
593 ** update. update_server cannot be used here because it uses p_address as the
594 ** where condition.
595 */
596 PROCEDURE update_desktop_server(
597    p_node_name   IN VARCHAR2,
598    p_server_id   IN VARCHAR2 DEFAULT NULL,
599    p_address     IN VARCHAR2 DEFAULT NULL,
600    p_description IN VARCHAR2 DEFAULT NULL)
601 IS
602    kount           number := 0;
603 BEGIN
604 
605    -- Check if the desktop node exists.
606    select count(*)
607    into kount
608    from fnd_nodes
609    where node_name = p_node_name
610    and SUPPORT_CP = 'N'
611    and SUPPORT_FORMS = 'N'
612    and SUPPORT_WEB = 'N'
613    and SUPPORT_ADMIN = 'N'
614    and SUPPORT_DB = 'N'
615    and PLATFORM_CODE = '100000';
616 
617    -- If it exists, proceed
618    IF kount > 0 then
619       -- Check that the server_address passed is not for the AUTHENTICATION
620       -- row. The AUTHENTICATION row also has SUPPORT_* columns = 'N', so it
621       -- needs to be distinguished from Desktop Nodes. a NULL server_address
622       -- can be passed, but not server_address = '*'. The (p_address is null)
623       -- had to be added because the API was not updating anything without the
624       -- condition if NULL was passed for p_address.
625       IF (p_address is null) OR (p_address <> '*') THEN
626          -- If server_id is provided, update using the node_name as condition.
627          IF(p_server_id IS NOT NULL) THEN
628 
629             UPDATE fnd_nodes
630             SET server_id = p_server_id
631             WHERE node_name = UPPER(p_node_name)
632             and support_cp = 'N'
633             and support_forms = 'N'
634             and support_web = 'N'
635             and support_admin = 'N'
636             and support_db = 'N'
637             and platform_code = '100000';
638          END IF;
639 
640          -- If a server_address is given, update using the node_name as condition.
641          -- server_address cannot be equal to '*' for a desktop node.  The
642          -- (p_address <> '*') condition is intentionally left redundant.
643          IF (p_address IS NOT NULL) and (p_address <> '*') THEN
644             UPDATE fnd_nodes
645             SET server_address = p_address
646             WHERE node_name = UPPER(p_node_name)
647             and support_cp = 'N'
648             and support_forms = 'N'
649             and support_web = 'N'
650             and support_admin = 'N'
651             and support_db = 'N'
652             and platform_code = '100000';
653          END IF;
654 
655          -- If a description is given, update using the node_name as condition.
656          -- Default value is 'Desktop Node', per insert_desktop_server().
657          IF(p_description IS NOT NULL) THEN
658             UPDATE fnd_nodes
659             SET description = p_description
660             WHERE node_name = UPPER(p_node_name)
661             and support_cp = 'N'
662             and support_forms = 'N'
663             and support_web = 'N'
664             and support_admin = 'N'
665             and support_db = 'N'
666             and platform_code = '100000';
667          END IF;
668       END IF;
669    ELSE
670    -- If not, then raise no data found exception.
671       RAISE no_data_found;
672    END IF;
673 
674 END;
675 
676 /* delete_desktop_server
677 **
678 ** This API is used for Desktop Nodes only.
679 ** Similar to delete_server, server_id is NULLed out, the row is not physically
680 ** deleted.
681 */
682 PROCEDURE delete_desktop_server (p_node_name IN VARCHAR2)
683 IS
684 BEGIN
685 
686    UPDATE fnd_nodes
687    SET server_id = NULL
688    WHERE node_name = UPPER(p_node_name)
689    and support_cp = 'N'
690    and support_forms = 'N'
691    and support_web = 'N'
695 
692    and support_admin = 'N'
693    and support_db = 'N'
694    and platform_code = '100000';
696 EXCEPTION WHEN no_data_found THEN
697    raise no_data_found;
698 
699 END;
700 
701 END fnd_app_server_pkg;