DBA Data[Home] [Help]

PACKAGE: XDB.DBMS_XDB_CONFIG

Source


1 PACKAGE     dbms_xdb_config AUTHID CURRENT_USER IS
2 
3 ------------
4 -- CONSTANTS
5 --
6 ------------
7 -- Constant number for 1st argument of setListenerEndPoint
8 XDB_ENDPOINT_HTTP  CONSTANT NUMBER := 1;
9 XDB_ENDPOINT_HTTP2 CONSTANT NUMBER := 2;
10 -- Permit https instead of http2, bug 17213197
11 XDB_ENDPOINT_HTTPS CONSTANT NUMBER := 2;
12 
13 -- Constant number for 4th argument of setListenerEndPoint
14 XDB_PROTOCOL_TCP   CONSTANT NUMBER := 1;
15 XDB_PROTOCOL_TCPS  CONSTANT NUMBER := 2;
16 
17 -- Constant number for 1st argument of xdb_validate_port
18 -- Constant for service id, compatible with xdb.xdb$cdbports
19 XDB_SERVICE_FTP   CONSTANT NUMBER := 1;
20 XDB_SERVICE_HTTP  CONSTANT NUMBER := 2;
21 XDB_SERVICE_HTTP2 CONSTANT NUMBER := 3;
22 -- Following is not used, reserve the value anyway.
23 XDB_SERVICE_NFS   CONSTANT NUMBER := 4;
24 
25 ON_DENY_NEXT_CUSTOM   CONSTANT NUMBER := 1;
26 ON_DENY_BASIC         CONSTANT NUMBER := 2;
27 
28 ---------------------------------------------
29 -- PROCEDURE - usedport
30 --     return the protocol port numbers of all pdbs
31 -- PARAMETERS -
32 ---------------------------------------------
33 FUNCTION usedport RETURN sys.xmltype;
34 
35 ---------------------------------------------
36 -- PROCEDURE - setFTPPort
37 --     sets the FTP port to new value
38 -- PARAMETERS -
39 --     new_port
40 --         value that the ftp port will be set to
41 ---------------------------------------------
42 
43 PROCEDURE setFTPPort(new_port IN NUMBER);
44 
45 ---------------------------------------------
46 -- FUNCTION - getFTPPort
47 --     gets the current value of FTP port
48 -- PARAMETERS -
49 --     none
50 -- RETURNS
51 --     ftp_port
52 --         current value of ftp-port
53 ---------------------------------------------
54 
55 FUNCTION getFTPPort RETURN NUMBER;
56 
57 ---------------------------------------------
58 -- PROCEDURE - setHTTPPort
59 --     sets the HTTP port to new value
60 -- PARAMETERS -
61 --     new_port
62 --         value that the http port will be set to
63 ---------------------------------------------
64 
65 PROCEDURE setHTTPPort(new_port IN NUMBER);
66 
67 ---------------------------------------------
68 -- FUNCTION - getHTTPPort
69 --     gets the current value of HTTP port
70 -- PARAMETERS -
71 --     none
72 -- RETURNS
73 --     http_port
74 --         current value of http-port
75 ---------------------------------------------
76 
77 FUNCTION getHTTPPort RETURN NUMBER;
78 
79 ---------------------------------------------
80 -- PROCEDURE - setHTTPsPort
81 --     sets the HTTPs port to new value
82 --
83 -- PARAMETERS -
84 --     new_port
85 --         value that the https port will be set to.
86 --
87 -- NOTE
88 --     The HTTPS port will be set using the second
89 --     HTTP end point
90 ---------------------------------------------
91 
92 PROCEDURE setHTTPsPort(new_port IN NUMBER);
93 
94 ---------------------------------------------
95 -- FUNCTION - getHTTPsPort
96 --     gets the current value of HTTPs port
97 -- PARAMETERS -
98 --     none
99 -- RETURNS
100 --     https_port
101 --         current value of https-port. Return NULL
102 --         if none has been configured
103 ---------------------------------------------
104 
105 FUNCTION getHTTPsPort RETURN NUMBER;
106 
107 ---------------------------------------------
108 -- PROCEDURE setListenerEndPoint(endpoint IN number, host IN varchar2,
109 --                               port IN number, protocol IN number);
110 
111 -- This procedure sets the parameters of a listener end point corresponding
112 -- to the XML DB HTTP server. Both HTTP and HTTP2 end points can be set by
113 -- invoking this procedure.
114 
115 --   (a) endpoint - The end point to be set. Its value can be
116 --       XDB_ENDPOINT_HTTP or XDB_ENDPOINT_HTTP2.
117 --   (b) host - The interface on which the listener end point is to listen.
118 --       Its value can be 'localhost,' null, or a hostname. If its value is
119 --       'localhost,' then the listener end point is permitted to only listen
120 --       on the localhost interface. If its value is null or hostname, then
121 --       the listener end point is permitted to listen on both localhost and
122 --       non-localhost interfaces.
123 --   (c) port - The port on which the listener end point is to listen.
124 --   (d) protocol - The transport protocol that the listener end point is to
125 --       accept. Its value can be XDB_PROTOCOL_TCP or XDB_PROTOCOL_TCPS.
126 ---------------------------------------------
127 
128 PROCEDURE setListenerEndPoint(endpoint IN number, host IN varchar2,
129                               port IN number, protocol IN number);
130 
131 ---------------------------------------------
132 --  PROCEDURE getListenerEndPoint(endpoint IN NUMBER, host OUT VARCHAR2,
133 --                                port OUT NUMBER, protocol OUT NUMBER);
134 
135 -- This procedure retrieves the parameters of a listener end point
136 -- corresponding to the XML DB HTTP server. The parameters of both HTTP
137 -- and HTTP2 end points can be retrieved by invoking this procedure.
138 
139 --  (a) endpoint - The end point whose parameters are to be retrieved. Its
140 --      value can be XDB_ENDPOINT_HTTP or XDB_ENDPOINT_HTTP2.
141 --  (b) host - The interface on which the listener end point listens.
142 --  (c) port - The port on which the listener end point listens.
143 --  (d) protocol - The transport protocol accepted by the listener end point.
144 ---------------------------------------------
145 
146 PROCEDURE getListenerEndPoint(endpoint IN NUMBER, host OUT VARCHAR2,
147                               port OUT NUMBER, protocol OUT NUMBER);
148 
149 ---------------------------------------------
150 -- PROCEDURE setListenerLocalAccess(l_access boolean);
151 -- This procedure restricts all listener end points of the XML DB HTTP server
152 -- to listen only on the localhost interface (when l_access is TRUE) or
153 -- allows all listener end points of the XML DB HTTP server to listen on
154 -- both localhost and non-localhost interfaces (when l_access is FALSE).
155 
156 --  (a) l_access - TRUE or FALSE. See description of procedure above.
157 ---------------------------------------------
158 PROCEDURE setListenerLocalAccess(l_access boolean);
159 
160 ---------------------------------------------
161 -- PROCEDURE - refresh
162 --     Refreshes the session configuration with the latest configuration
163 ---------------------------------------------
164 PROCEDURE cfg_refresh;
165 
166 ---------------------------------------------
167 -- FUNCTION - get
168 --     retrieves the xdb configuration
169 -- RETURNS -
170 --     XMLType for xdb configuration
171 ---------------------------------------------
172 FUNCTION cfg_get RETURN sys.xmltype;
173 
174 ---------------------------------------------
175 -- PROCEDURE - update
176 --     Updates the xdb configuration with the input xmltype document
177 -- PARAMETERS -
178 --  xdbconfig
179 ---     XMLType for xdb configuration
180 --------------------------------------------
181 PROCEDURE cfg_update(xdbconfig IN sys.xmltype);
182 
183 -----------------------------------------------------------
184 -- XDB Config Update APIs
185 -- PROCEDURE ADDMIMEMAPPING         Add a mime mapping
186 -- PROCEDURE DELETEMIMEMAPPING      Delete a mime mapping
187 -- PROCEDURE ADDXMLEXTENSION        Add an xml extension
188 -- PROCEDURE DELETEXMLEXTENSION     Delete an xml extension
189 -- PROCEDURE ADDSERVLETMAPPING      Add a servlet mapping
190 -- PROCEDURE DELETESERVLETMAPPING   Delete a servlet mapping
191 -- PROCEDURE ADDSCHEMALOCMAPPING    Add a schema location mapping
192 -- PROCEDURE DELETESCHEMALOCMAPPING Delete a schema location mapping
193 -- PROCEDURE ADDSERVLET             Add a servlet
194 -- PROCEDURE DELETESERVLET          Delete a servlet
195 -- PROCEDURE ADDSERVLETSECROLE      Add a security role ref to a servlet
196 -- PROCEDURE DELETESERVLETSECROLE   Delete a security role ref from a servlet
197 -----------------------------------------------------------
198 
199 procedure ADDMIMEMAPPING (
200 	extension IN VARCHAR2,
201 	mimetype  IN VARCHAR2
202 );
203 
204 procedure DELETEMIMEMAPPING (
205 	extension IN VARCHAR2
206 );
207 
208 procedure ADDXMLEXTENSION (
209 	extension IN VARCHAR2
210 );
211 
212 procedure DELETEXMLEXTENSION (
213 	extension IN VARCHAR2
214 );
215 
216 procedure ADDSERVLETMAPPING (
217  	pattern IN VARCHAR2,
218  	name    IN VARCHAR2
219 );
220 
221 procedure DELETESERVLETMAPPING (
222  	name IN VARCHAR2
223 );
224 
225 procedure ADDSERVLET (
226 	name     IN VARCHAR2,
227 	language IN VARCHAR2,
228 	dispname IN VARCHAR2,
229 	icon     IN VARCHAR2 := NULL,
230 	descript IN VARCHAR2 := NULL,
231 	class    IN VARCHAR2 := NULL,
232 	jspfile  IN VARCHAR2 := NULL,
233 	plsql    IN VARCHAR2 := NULL,
234 	schema   IN VARCHAR2 := NULL
235 );
236 
237 procedure DELETESERVLET (
238  	name IN VARCHAR2
239 );
240 
241 procedure ADDSERVLETSECROLE (
242  	servname IN VARCHAR2,
243  	rolename IN VARCHAR2,
244  	rolelink IN VARCHAR2,
245  	descript IN VARCHAR2 := NULL
246 );
247 
248 procedure DELETESERVLETSECROLE (
249 	servname IN VARCHAR2,
250 	rolename IN VARCHAR2
251 );
252 
253 procedure ADDSCHEMALOCMAPPING (
254 	namespace IN VARCHAR2,
255 	element   IN VARCHAR2,
256 	schemaURL IN VARCHAR2
257 );
258 
259 procedure DELETESCHEMALOCMAPPING (
260 	schemaURL IN VARCHAR2
261 );
262 
263 ---------------------------------------------
264 -- PROCEDURE - addAuthenticationMapping
265 --     Adds a mapping from the authentication method name to a
266 --      URL pattern (in xdb$onfig).
267 -- PARAMETERS -
268 --     pattern - URL pattern
269 --     name    - authentication method name
270 ---------------------------------------------
271 procedure addAuthenticationMapping(pattern IN VARCHAR2,
272                                    name IN VARCHAR2,
273                                    user_prefix IN VARCHAR2 := NULL,
274                                    on_deny IN NUMBER := NULL);
275 PRAGMA SUPPLEMENTAL_LOG_DATA(addAuthenticationMapping, UNSUPPORTED_WITH_COMMIT);
276 
277 ---------------------------------------------
278 -- PROCEDURE - deleteAuthenticationMapping
279 --     Deletes a mapping from the authentication method name to a
280 --      URL pattern (from xdb$onfig).
281 -- PARAMETERS -
282 --     pattern - URL pattern
283 --     name    - authentication method name
284 ---------------------------------------------
285 procedure deleteAuthenticationMapping(pattern IN VARCHAR2,
286                                       name IN VARCHAR2);
287 PRAGMA SUPPLEMENTAL_LOG_DATA(deleteAuthenticationMapping, UNSUPPORTED_WITH_COMMIT);
288 
289 ---------------------------------------------
290 -- PROCEDURE - addAuthenticationMethod
291 --     Adds to xdb$config a custom authentication method entry.
292 -- PARAMETERS -
293 --     name    - authentication method name (the name the
294 --               custom authentication routine will be known to XDB)
295 --     description - some note on the authentication method
296 --     implement_schema - the owner of the routine that implements
297 --                        the authentication
298 --     implement_method - the name of the routine that implements
299 --                        the authentication
300 --     language         - the language in which the implementation
301 --                        routine is written (currently only PL/SQL)
302 ---------------------------------------------
303 procedure addAuthenticationMethod(name IN VARCHAR2,
304                                   description IN VARCHAR2,
305                                   implement_schema IN VARCHAR2,
306                                   implement_method IN VARCHAR2,
307                                   language  IN VARCHAR2 := 'PL/SQL');
308 PRAGMA SUPPLEMENTAL_LOG_DATA(addAuthenticationMethod, UNSUPPORTED_WITH_COMMIT);
309 
310 ---------------------------------------------
311 -- PROCEDURE - deleteAuthenticationMethod
312 --    Deletes from  xdb$config a custom authentication method entry.
313 -- PARAMETERS -
314 --     name    - authentication method name (the name the
315 --               custom authentication routine will be known to XDB)
316 ---------------------------------------------
317 procedure deleteAuthenticationMethod(name IN VARCHAR2);
318 PRAGMA SUPPLEMENTAL_LOG_DATA(deleteAuthenticationMethod, UNSUPPORTED_WITH_COMMIT);
319 
320 procedure addTrustScheme(name IN VARCHAR2,
321                          description IN VARCHAR2,
322                          session_user IN VARCHAR2,
323                          parsing_schema IN VARCHAR2,
324                          system_level IN BOOLEAN := TRUE,
325                          require_parsing_schema IN BOOLEAN := TRUE,
326                          allow_registration IN BOOLEAN := TRUE);
327 PRAGMA SUPPLEMENTAL_LOG_DATA(addTrustScheme, UNSUPPORTED_WITH_COMMIT);
328 
329 procedure deleteTrustScheme(name IN VARCHAR2,
330                             system_level IN BOOLEAN := TRUE);
331 PRAGMA SUPPLEMENTAL_LOG_DATA(deleteTrustScheme, UNSUPPORTED_WITH_COMMIT);
332 
333 procedure addTrustMapping(pattern IN VARCHAR2,
334                           auth_name IN VARCHAR2,
335                           trust_name IN VARCHAR2,
336                           user_prefix IN VARCHAR2 := NULL);
337 PRAGMA SUPPLEMENTAL_LOG_DATA(addTrustMapping, UNSUPPORTED_WITH_COMMIT);
338 
339 procedure deleteTrustMapping(pattern IN VARCHAR2,
340                              name IN VARCHAR2);
341 PRAGMA SUPPLEMENTAL_LOG_DATA(deleteTrustMapping, UNSUPPORTED_WITH_COMMIT);
342 
343 procedure enableCustomAuthentication;
344 PRAGMA SUPPLEMENTAL_LOG_DATA(enableCustomAuthentication, UNSUPPORTED_WITH_COMMIT);
345 
346 procedure enableCustomTrust;
347 PRAGMA SUPPLEMENTAL_LOG_DATA(enableCustomTrust, UNSUPPORTED_WITH_COMMIT);
348 
349 procedure setDynamicGroupStore(is_dynamic IN BOOLEAN := TRUE);
350 PRAGMA SUPPLEMENTAL_LOG_DATA(setDynamicGroupStore, UNSUPPORTED_WITH_COMMIT);
351 
352 procedure enableDigestAuthentication;
353 PRAGMA SUPPLEMENTAL_LOG_DATA(enableDigestAuthentication, UNSUPPORTED_WITH_COMMIT);
354 
355 function getHttpConfigRealm
356   return VARCHAR2;
357 
358 procedure setHttpConfigRealm(realm IN VARCHAR2);
359 
360 
361 -----------------------------------------------------------
362 -- PROCEDURE - addDefaultTypeMappings
363 --  creats a default-type-mappings entry in xdbconfig.
364 --  Default is pre-11.2
365 --
366 -- PARAMETERS -
367 --  version (IN) - Accepted values: "pre-11.2" or "post-11.2"
368 --                 Default is pre-11.2
369 -----------------------------------------------------------
370 PROCEDURE addDefaultTypeMappings ( version IN VARCHAR2 := 'pre-11.2');
371 
372 
373 -----------------------------------------------------------
374 -- PROCEDURE - deleteDefaultTypeMappings
375 --  deletes the default type mappings from xdbconfig.
376 --
377 -- PARAMETERS -
378 -----------------------------------------------------------
379 PROCEDURE deleteDefaultTypeMappings;
380 
381 -----------------------------------------------------------
382 -- PROCEDURE - setDefaultTypeMappings
383 --  sets the value of default-type-mappings in xdbconfig
384 --
385 -- PARAMETERS -
386 --  type (IN) - Accepted values: "pre-11.2" or "post-11.2"
387 -----------------------------------------------------------
388 PROCEDURE setDefaultTypeMappings ( version IN VARCHAR2 );
389 
390 
391 -------------------------------------------------------------------------------
392 -- PROCEDURE - addHttpExpireMapping
393 --    Adds to xdb$config a mapping of the URL pattern to an
394 --     expiration date. This will control the Expire headers
395 --     for URLs matching the pattern.
396 -- PARAMETERS -
397 --     pattern  -- URL pattern (only * accepted as wildcards)
398 --     expire   -- expiration directive, follows the ExpireDefault
399 --                 in Apache's mod_expires, i.e.,
400 --                 base [plus] (num type)*
401 --                 -- base: now | modification
402 --                 -- type: year|years|month|months|week|weeks|day|days|
403 --                          minute|minutess|second|seconds
404 -- EXAMPLE
405 --  dbms_xdb.addHttpExpireMapping('/public/test1/*', 'now plus 4 weeks');
406 --  dbms_xdb.addHttpExpireMapping('/public/test2/*',
407 --                                'modification plus 1 day 30 seconds');
408 -------------------------------------------------------------------------------
409 procedure addHttpExpireMapping(pattern IN VARCHAR2,
410                                expire IN VARCHAR2);
411 
412 -------------------------------------------------------------------------------
413 -- PROCEDURE - deleteHttpExpireMapping
414 --    Deletes from xdb$config all mappings of the URL pattern to an
415 --     expiration date.
416 -- PARAMETERS -
417 --     pattern  -- URL pattern (only * accepted as wildcards)
418 -------------------------------------------------------------------------------
419 procedure deleteHttpExpireMapping(pattern IN VARCHAR2);
420 
421 -------------------------------------------------------------------------------
422 -- FUNCTION - getHTTPRequestHeader
423 --    If called during an HTTP request serviced by XDB, it returns the values
424 --    of the passed header. It returns NULL in case the header is not present
425 --    in the request, or for AUTHENTICATION, for security reasons.
426 --    Expected to be used by routines that implement custom authentication.
427 -------------------------------------------------------------------------------
428 function getHTTPRequestHeader(header_name IN VARCHAR2)
429   return VARCHAR2;
430 
431 end dbms_xdb_config;