DBA Data[Home] [Help]

PACKAGE: SYS.OWA_CACHE

Source


1 PACKAGE owa_cache
2 AS
3   --
4   -- Public types and global variables
5   --
6 
7   -- The different caching levels. For now, just user and system.
8   system_level CONSTANT VARCHAR(6) := 'SYSTEM';
9   user_level   CONSTANT VARCHAR(4) := 'USER';
10 
11   --
12   -- PROCEDURE:
13   --   init
14   -- DESCRIPTION:
15   --   Reserve header spaces
16   -- PARAMS:
17   --   p_htbuf    IN/OUT: the buffer to reserve the headers in
18   --   p_rows_in  IN/OUT: the current row number in that buffer
19   -- NOTE:
20   --   Should only be called before any data is written to the htbuf
21   --
22   PROCEDURE init(p_htbuf IN OUT NOCOPY htp.htbuf_arr, p_rows_in IN OUT number);
23 
24   --
25   -- PROCEDURE:
26   --   disable
27   -- DESCRIPTION:
28   --   Disables the cache
29   --
30   PROCEDURE disable;
31 
32   --
33   -- PROCEDURE:
34   --   set_expires
35   -- DESCRIPTION:
36   --   Sets up the cache headers
37   -- PARAMS:
38   --   p_expires  IN: number of minutes this cached item is fresh
39   --   p_level    IN: the caching level for it (USER or SYSTEM for now)
40   -- EXCEPTIONS:
41   --   VALUE_ERROR : If p_expires is negative or zero, or p_level is not
42   --                 'USER' or 'SYSTEM', this exception is thrown
43   --                 If p_expires is > 525600 (1 year), this exception is thrown
44   PROCEDURE set_expires(p_expires IN number, p_level IN varchar2);
45 
46   --
47   -- PROCEDURE:
48   --   set_cache
49   -- DESCRIPTION:
50   --   Sets up the cache headers
51   -- PARAMS:
52   --   p_etag     IN: the ETag associated with this content
53   --   p_level    IN: the caching level for it (USER or SYSTEM for now)
54   -- EXCEPTIONS:
55   --   VALUE_ERROR : If p_etag is greater than 55 in length or p_level is
56   --                 not 'USER' or 'SYSTEM', this exception is thrown
57   --
58   PROCEDURE set_cache(p_etag IN varchar2, p_level IN varchar2);
59 
60   --
61   -- PROCEDURE:
62   --   set_not_modified
63   -- DESCRIPTION:
64   --   Sets up the headers for a not modified cache hit
65   -- EXCEPTIONS:
66   --   VALUE_ERROR : If the ETag wasn't passed in, this exception is thrown
67   --
68   PROCEDURE set_not_modified;
69 
70   --
71   -- PROCEDURE:
72   --   set_surrogate_control
73   -- DESCRIPTION:
74   --   Sets up the headers for a surrogate-control header for web cache
75   -- PARAMS:
76   --   p_value    IN: value to be passed as the Surrogate-Control header
77   -- EXCEPTIONS:
78   --   VALUE_ERROR : If p_value is greater than 55 in length
79   --
80   PROCEDURE set_surrogate_control(p_value IN varchar2);
81 
82   --
83   -- FUNCTION:
84   --   get_level
85   -- DESCRIPTION:
86   --   Returns the caching level
87   -- PARAMS:
88   --   none
89   -- RETURN:
90   --   The caching level string (USER or SYSTEM for now)
91   --
92   FUNCTION get_level
93     RETURN VARCHAR2;
94 
95   --
96   -- FUNCTION:
97   --   get_etag
98   -- DESCRIPTION:
99   --   Returns the caching etag
100   -- PARAMS:
101   --   none
102   -- RETURN:
103   --   The caching etag string
104   --
105   FUNCTION get_etag
106     RETURN VARCHAR2;
107 
108 END owa_cache;