{
    "title": "locks (volatile part)",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.lock.LocksV",
    "type": "object",
    "required": [
        "deliveryDate",
        "locks"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Current date of the JOC server/REST service. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "locks": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.lock.LockV",
                "type": "object",
                "description": "The lock is free iff no holders specified",
                "required": [
                    "surveyDate",
                    "path",
                    "name"
                ],
                "properties": {
                    "surveyDate": {
                        "description": "Current date of the JobScheduler Master/Agent. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
                        "type": "string",
                        "format": "date-time"
                    },
                    "path": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "name": {
                        "type": "string"
                    },
                    "maxNonExclusive": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "holders": {
                        "javaType": "com.sos.joc.model.lock.LockHolders",
                        "type": "object",
                        "required": [
                            "exclusive",
                            "tasks"
                        ],
                        "properties": {
                            "exclusive": {
                                "type": "boolean"
                            },
                            "tasks": {
                                "description": "Collection of tasks which are now using the lock",
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.lock.LockHolder",
                                    "type": "object",
                                    "properties": {
                                        "job": {
                                            "description": "absolute path based on live folder of a JobScheduler object.",
                                            "type": "string",
                                            "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                            "maxLength": 255
                                        },
                                        "taskId": {
                                            "description": "id of the task",
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "queue": {
                        "type": "array",
                        "description": "Collection of jobs which have to wait until the lock is free",
                        "items": {
                            "type": "object",
                            "required": [
                                "exclusive",
                                "job"
                            ],
                            "properties": {
                                "exclusive": {
                                    "description": "Is true iff the job want to use the lock exclusive",
                                    "type": "boolean"
                                },
                                "job": {
                                    "description": "absolute path based on live folder of a JobScheduler object.",
                                    "type": "string",
                                    "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "configurationStatus": {
                        "javaType": "com.sos.joc.model.common.ConfigurationState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "4=ok; 5=replacement_is_standing_by,removing_delayed; 2=error_in_configuration_file,changed_file_not_loaded,resource_is_missing",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.common.ConfigurationStateText",
                                "type": "string",
                                "enum": [
                                    "ERROR_IN_CONFIGURATION_FILE",
                                    "CHANGED_FILE_NOT_LOADED",
                                    "REMOVING_DELAYED",
                                    "RESOURCE_IS_MISSING",
                                    "REPLACEMENT_IS_STANDING_BY",
                                    "OK"
                                ]
                            },
                            "message": {
                                "description": "contains e.g. error message",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}