Apache2
md_status.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef md_status_h
18 #define md_status_h
19 
20 struct md_json_t;
21 struct md_reg_t;
22 struct md_result_t;
23 struct md_ocsp_reg_t;
24 
25 #include "md_store.h"
26 
30 apr_status_t md_status_get_md_json(struct md_json_t **pjson, const md_t *md,
31  struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp,
32  apr_pool_t *p);
33 
38  struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp,
39  apr_pool_t *p);
40 
47  struct md_reg_t *reg, apr_pool_t *p);
48 
49 
50 typedef struct md_job_t md_job_t;
51 
52 struct md_job_t {
53  md_store_group_t group;/* group where job is persisted */
54  const char *mdomain; /* Name of the MD this job is about */
55  md_store_t *store; /* store where it is persisted */
57  apr_time_t next_run; /* Time this job wants to be processed next */
58  apr_time_t last_run; /* Time this job ran last (or 0) */
59  struct md_result_t *last_result; /* Result from last run */
60  int finished; /* true iff the job finished successfully */
61  int notified; /* true iff notifications were handled successfully */
62  int notified_renewed; /* true iff a 'renewed' notification was handled successfully */
63  apr_time_t valid_from; /* at which time the finished job results become valid, 0 if immediate */
64  int error_runs; /* Number of errored runs of an unfinished job */
65  int fatal_error; /* a fatal error is remedied by retrying */
66  md_json_t *log; /* array of log objects with minimum fields
67  MD_KEY_WHEN (timestamp) and MD_KEY_TYPE (string) */
68  apr_size_t max_log; /* max number of log entries, new ones replace oldest */
69  int dirty;
71  apr_time_t min_delay; /* smallest delay a repeated attempt should have */
72 };
73 
79  md_store_group_t group, const char *name,
80  apr_time_t min_delay);
81 
83 
88 
93 
100 void md_job_log_append(md_job_t *job, const char *type,
101  const char *status, const char *detail);
102 
106 md_json_t *md_job_log_get_latest(md_job_t *job, const char *type);
107 
113 
114 void md_job_start_run(md_job_t *job, struct md_result_t *result, md_store_t *store);
115 void md_job_end_run(md_job_t *job, struct md_result_t *result);
117 
122 apr_time_t md_job_delay_on_errors(md_job_t *job, int err_count, const char *last_problem);
123 
124 apr_status_t md_job_notify(md_job_t *job, const char *reason, struct md_result_t *result);
125 
126 #endif /* md_status_h */
int status
Definition: mod_dav.h:141
const char const dav_liveprop_group * group
Definition: mod_dav.h:1049
const char * name
Definition: mod_dav.h:805
int apr_status_t
Definition: apr_errno.h:44
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_time_t
Definition: apr_time.h:45
struct md_json_t md_json_t
Definition: md_json.h:29
struct md_ocsp_reg_t md_ocsp_reg_t
Definition: md_ocsp.h:36
struct md_reg_t md_reg_t
Definition: md_reg.h:33
apr_status_t md_status_get_md_json(struct md_json_t **pjson, const md_t *md, struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp, apr_pool_t *p)
void md_job_set_group(md_job_t *job, md_store_group_t group)
void md_status_take_stock(struct md_json_t **pjson, apr_array_header_t *mds, struct md_reg_t *reg, apr_pool_t *p)
void md_job_end_run(md_job_t *job, struct md_result_t *result)
apr_status_t md_job_save(md_job_t *job, struct md_result_t *result, apr_pool_t *p)
apr_status_t md_job_load(md_job_t *job)
md_json_t * md_job_log_get_latest(md_job_t *job, const char *type)
apr_status_t md_status_get_json(struct md_json_t **pjson, apr_array_header_t *mds, struct md_reg_t *reg, struct md_ocsp_reg_t *ocsp, apr_pool_t *p)
apr_time_t md_job_delay_on_errors(md_job_t *job, int err_count, const char *last_problem)
md_job_t * md_job_make(apr_pool_t *p, md_store_t *store, md_store_group_t group, const char *name, apr_time_t min_delay)
void md_job_start_run(md_job_t *job, struct md_result_t *result, md_store_t *store)
void md_job_retry_at(md_job_t *job, apr_time_t later)
apr_time_t md_job_log_get_time_of_latest(md_job_t *job, const char *type)
apr_status_t md_job_notify(md_job_t *job, const char *reason, struct md_result_t *result)
void md_job_log_append(md_job_t *job, const char *type, const char *status, const char *detail)
md_store_group_t
Definition: md_store.h:62
Definition: apr_tables.h:62
Definition: md_status.h:52
struct md_result_t * observing
Definition: md_status.h:70
apr_time_t min_delay
Definition: md_status.h:71
int fatal_error
Definition: md_status.h:65
int notified
Definition: md_status.h:61
int error_runs
Definition: md_status.h:64
int dirty
Definition: md_status.h:69
apr_time_t last_run
Definition: md_status.h:58
md_store_t * store
Definition: md_status.h:55
const char * mdomain
Definition: md_status.h:54
apr_time_t valid_from
Definition: md_status.h:63
apr_time_t next_run
Definition: md_status.h:57
int finished
Definition: md_status.h:60
int notified_renewed
Definition: md_status.h:62
struct md_result_t * last_result
Definition: md_status.h:59
md_json_t * log
Definition: md_status.h:66
apr_size_t max_log
Definition: md_status.h:68
md_store_group_t group
Definition: md_status.h:53
apr_pool_t * p
Definition: md_status.h:56
Definition: md_result.h:29
const char * detail
Definition: md_result.h:34
Definition: md_store.h:325
Definition: md.h:76
apr_pool_t * p