-
Notifications
You must be signed in to change notification settings - Fork 4
Messages 0.2.1
- Chime address is event bus address Chime is listen to. Given with verticle configuration. Default is "chime".
- Scheduler address or name is given name scheduler is created with. Chime listens event bus at this address for the messages to the given scheduler.
- Timer name is given name timer is created with.
- Timer full name is 'scheduler name' and 'timer name' separated with ':', i.e. 'scheduler name:timer name'. Chime sends or publishes timer events to this address.
To be sent to Chime address.
{
"operation": "create",
"name": "scheduler name",
"state": "String, one of running, paused or completed, default is running",
"time zone": "String, default is local time zone"
}
operation
and name
fields are mandatory.
state
field is optional with default value set to "running".
time zone
field is optional with default value equal to local time zone.
Time zone applied at scheduler level is default for timers created within this scheduler.
Available time zones.
{
"name": "scheduler name",
"state": "running, paused or completed"
}
To be sent to Chime address or to scheduler address.
{
"operation": "delete",
"name": "scheduler name"
}
{
"name": "scheduler name",
"state": "completed"
}
To be sent to Chime address.
{
"operation": "delete",
"name": ""
}
{
"schedulers": ["name of first scheduler name", "...", "name of nth scheduler"]
}
Where 'schedulers' array contains String
names of deleted schedulers.
To be sent to Chime address.
{
"operation": "delete",
"name": ["name of first scheduler", "...", "name of nth scheduler"]
}
Where name array contains String
s with names of schedulers to be deleted.
{
"schedulers": ["name of first scheduler", "...", "name of nth scheduler"]
}
Where 'schedulers' array contains String
names of actually deleted schedulers.
To be sent to Chime address or to scheduler address.
{
"operation": "info",
"name": "scheduler name"
}
{
"name": "scheduler name",
"state": "running, paused or completed",
"time zone": "time zone ID",
"timers": []
}
Where timers
array contains JsonObject
's of timer info.
To be sent to Chime address.
{
"operation": "info",
"name": ""
}
{
"schedulers": []
}
Where schedulers
array contains JsonObject
's of scheduler info.
To be sent to Chime address.
{
"operation": "info",
"name": ["name of first scheduler", "...", "name of nth scheduler"]
}
Where names
is array of Strings
with names of schedulers info is requested for.
{
"schedulers": []
}
Where schedulers
array contains JsonObject
's of scheduler info.
To be sent to Chime address or to scheduler address.
{
"operation": "state",
"name": "scheduler name",
"state": "get"
}
{
"name": "scheduler name",
"state": "String, one of running, paused or completed"
}
To be sent to Chime address or to scheduler address.
Pausing scheduler leads to all timers operated within the given scheduler are paused.
{
"operation": "state",
"name": "scheduler name",
"state": "paused"
}
{
"name": "scheduler name",
"state": "paused"
}
To be sent to Chime address or to scheduler address.
Resuming scheduler leads to all timers with running state are resumed.
While timers with paused state are remain paused.
{
"operation": "state",
"name": "scheduler name",
"state": "running"
}
{
"name": "scheduler name",
"state": "running"
}
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "create",
"name": "scheduler name:timer name",
"description": {},
"state": "String, one of running, paused or completed, default is running",
"maximum count": "Integer, maximum number of fires, default is unlimited",
"publish": "Boolean, if true message to be published and to be sent otherwise, default is false",
"start time": {
"seconds": "Integer",
"minutes": "Integer",
"hours": "Integer",
"day of month": "Integer",
"month": "Integer or String",
"year": "Integer"
},
"end time": {
"seconds": "Integer",
"minutes": "Integer",
"hours": "Integer",
"day of month": "Integer",
"month": "Integer or String",
"year": "Integer"
},
"time zone": "String, default is local time zone",
"message": "any Json supports",
"delivery options": {}
}
Where description
contains JsonObject
with timer descriptions.
operation
, name
, and description
are mandatory fields.
Other fields are optional, default values are:
-
state
= "running" -
maximum count
= unlimited -
publish
= false -
start time
= right now -
end time
= never -
time zone
= local -
message
= unused -
delivery options
= unused
If name field is 'scheduler name', i.e. timer name is omitted then unique timer name is generated and returned with response.
If scheduler with 'scheduler name' hasn't been created before then new scheduler with 'scheduler name' will be created.
{
"name": "scheduler name:timer name",
"state": "running, paused or completed"
}
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "delete",
"name": "scheduler name:timer name"
}
{
"name": "scheduler name:timer name",
"state": "completed"
}
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "delete",
"name": ["scheduler name:timer name"]
}
Where 'name' array contains String
s with names of timers to be deleted.
{
"timers": ["name of first timer", "..." "name of nth timer"]
}
Where 'timers' array contains String
s with names of actually deleted timers.
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "info",
"name": "scheduler name:timer name"
}
{
"name": "scheduler name:timer name",
"state": "running, paused or completed",
"count": "Integer, total number of fires when request is received",
"description": {}
}
Response contains all fields set at timer create request.
description
field contains JsonObject
with timer descriptions.
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "info",
"name": ["name of first timer", "..." "name of nth timer"]
}
Where names
is array of Strings
with names of timers the info is requested for.
{
"timers": []
}
Where timers
array contains JsonObject
's of timer info.
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "state",
"name": "scheduler name:timer name",
"state": "get"
}
{
"name": "scheduler name:timer name",
"state": "running, paused or completed"
}
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "state",
"name": "scheduler name:timer name",
"state": "running"
}
{
"name": "scheduler name:timer name",
"state": "running"
}
To be sent to Chime address with full timer name, i.e. "scheduler name:timer name" or to scheduler address with either full or short timer name.
{
"operation": "state",
"name": "scheduler name:timer name",
"state": "paused"
}
{
"name": "scheduler name:timer name",
"state": "paused"
}
Used in timer create request.
{
"type": "cron",
"seconds": "String in cron-style",
"minutes": "String in cron-style",
"hours": "String in cron-style",
"days of month": "String in cron-style",
"months": "String in cron-style",
"days of week": "String in cron-style, optional",
"years": "String in cron-style, optional"
}
type
, seconds
, minutes
, hours
, days of month
and months
are mandatory.
days of week
and years
are optional.
-
seconds, mandatory
- allowed values: 0-59
- allowed special characters: , - * /
-
minutes, mandatory
- allowed values: 0-59
- allowed special characters: , - * /
-
hours, mandatory
- allowed values: 0-23
- allowed special characters: , - * /
-
days of month, mandatory
- allowed values 1-31
- allowed special characters: , - * /
-
months, mandatory
- allowed values 1-12, Jan-Dec, January-December
- allowed special characters: , - * /
-
days of week, optional
- allowed values 1-7, Sun-Sat, Sunday-Saturday
- allowed special characters: , - * / L #
-
years, optional
- allowed values 1970-2099
- allowed special characters: , - * /
Names of months and days of the week are case insensitive.
Sunday is the first day of week.
- '*' means all values
- ',' separates list items
- '-' specifies range, for example, '10-12' means '10, 11, 12'
- '/' specifies increments, for example, '0/15' in seconds field means '0,15,30,45', '0-30/15' means '0,15,30'
- 'L' has to be used after digit and means the last xxx day of the month, where xxx is day of week, for example, '6L' means the last Friday of the month
- '#' has to be used with digits before and after: 'x#y' and means the y'th x day of the month, for example, '6#3' means the third Friday of the month
{
"type": "interval",
"delay": "Integer > 0"
}
type
and interval
are mandatory.
{
"type": "union",
"timers": []
}
Where timers
array contains JsonObject
's of timer descriptions.
type
and timers
are mandatory.
Sent or published (depending on publish
option in timer create request)
by Chime to timer full name ("scheduler name:timer name") address.
{
"name": "String, timer name",
"event": "fire",
"count": "Integer, total number of fire times",
"time": "String formated time / date",
"seconds": "Integer, number of seconds since last minute",
"minutes": "Integer, number of minutes since last hour",
"hours": "Integer, hour of day",
"day of month": "Integer, day of month",
"month": "Integer, month",
"year": "Integer, year",
"time zone": "String, time zone the timer works in",
"message": "message given at a timer create request, optional"
}
message
is given at create timer request in any Json supported type.
Published by Chime to timer full name ("scheduler name:timer name") address.
{
"name": "scheduler name:timer name",
"event": "complete",
"count": "Integer, total number of fires"
}
Complete event is always published in order all consumers may receive it.