{
    "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": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "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": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "path": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "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 of a JobScheduler object.",
                                            "type": "string",
                                            "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                            "maxLength": 255,
                                            "minLength": 1
                                        },
                                        "taskId": {
                                            "type": "number",
                                            "format": "utc-millisec",
                                            "minimum": 0
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "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 of a JobScheduler object.",
                                    "type": "string",
                                    "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                    "maxLength": 255,
                                    "minLength": 1
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}