{"id":29113949,"url":"https://github.com/juanitadevelopment/amber-timerjob","last_synced_at":"2026-04-20T19:32:05.423Z","repository":{"id":298812435,"uuid":"999977303","full_name":"juanitadevelopment/amber-timerjob","owner":"juanitadevelopment","description":"A modern, lightweight scheduler library for Java applications that provides flexible job scheduling with support for interval-based, time-based, date-based, and cron-style scheduling.","archived":false,"fork":false,"pushed_at":"2025-06-13T08:28:48.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-14T21:34:11.518Z","etag":null,"topics":["cron","java","java21","library","maven","scheduler","scheduling","timerjob"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juanitadevelopment.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-11T04:53:45.000Z","updated_at":"2025-06-13T08:13:59.000Z","dependencies_parsed_at":"2025-06-13T03:38:52.565Z","dependency_job_id":"bd4c0fe4-f40f-4ccf-b33a-118645533de4","html_url":"https://github.com/juanitadevelopment/amber-timerjob","commit_stats":null,"previous_names":["juanitadevelopment/amber-timerjob"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/juanitadevelopment/amber-timerjob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanitadevelopment%2Famber-timerjob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanitadevelopment%2Famber-timerjob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanitadevelopment%2Famber-timerjob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanitadevelopment%2Famber-timerjob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanitadevelopment","download_url":"https://codeload.github.com/juanitadevelopment/amber-timerjob/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanitadevelopment%2Famber-timerjob/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","java","java21","library","maven","scheduler","scheduling","timerjob"],"created_at":"2025-06-29T11:05:57.748Z","updated_at":"2026-04-20T19:32:05.406Z","avatar_url":"https://github.com/juanitadevelopment.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Juanita Amber TimerJob\n\n[![Maven Central](https://img.shields.io/maven-central/v/net.teppan.amber/amber-timerjob.svg)](https://search.maven.org/artifact/net.teppan.amber/amber-timerjob)\n[![Java Version](https://img.shields.io/badge/Java-17%2B-brightgreen.svg)](https://openjdk.java.net/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Build Status](https://github.com/teppan/amber-timerjob/workflows/CI/badge.svg)](https://github.com/teppan/amber-timerjob/actions)\n\nA modern, lightweight scheduler library for Java applications that provides flexible job scheduling with support for interval-based, time-based, date-based, and cron-style scheduling.\n\n## ✨ Features\n\n- 🕒 **Multiple Scheduling Types**: Interval, Time, Date, and Cron scheduling\n- 🌍 **TimeZone \u0026 Locale Support**: Full internationalization support\n- ⚡ **Lightweight**: Minimal dependencies (only SLF4J for logging)\n- 🔧 **Lifecycle Management**: Suspend, resume, and cancel jobs dynamically\n- 🛡️ **Exception Handling**: Robust error handling with continued execution\n- 📋 **Property-based Configuration**: Flexible job configuration\n- 🧪 **Well Tested**: High test coverage with comprehensive integration tests\n\n## 🚀 Quick Start\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.teppan.amber\u003c/groupId\u003e\n    \u003cartifactId\u003eamber-timerjob\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```groovy\nimplementation 'net.teppan.amber:amber-timerjob:1.0.0'\n```\n\n### Basic Usage\n\n```java\nimport net.teppan.amber.timerjob.*;\nimport java.util.Timer;\nimport java.time.ZoneId;\nimport java.util.Locale;\n\n// 1. Create your job\npublic class MyJob extends TimerJob {\n    @Override\n    protected void executeJob() throws Exception {\n        getLogger().info(\"Hello from Juanita Amber TimerJob!\");\n        // Your business logic here\n    }\n}\n\n// 2. Set up the job context\nJobContext context = new JobContextImpl(); // Your implementation\n\n// 3. Create a schedule directive\nScheduleDirective directive = new ScheduleDirective(\n    \"CRON 0 9 * * MON-FRI\",           // Original directive string\n    ScheduleDirective.ScheduleType.CRON,\n    Optional.empty(),                   // intervalMillis\n    Optional.empty(),                   // hour\n    Optional.empty(),                   // minute\n    Set.of(),                          // daysOfWeek\n    Optional.empty(),                   // dayOfMonth\n    Optional.empty(),                   // month\n    Optional.of(\"0 9 * * MON-FRI\"),    // cronExpression\n    ZoneId.of(\"Asia/Tokyo\"),           // timeZone\n    Locale.JAPAN                       // locale\n);\n\n// 4. Schedule the job\nTimer timer = new Timer(\"job-scheduler\", true);\nMyJob job = new MyJob();\njob.setJobContext(context);\njob.setScheduleDirective(directive);\njob.setName(\"morning-job\");\njob.schedule(timer);\n```\n\n## 📋 Scheduling Formats\n\n### Interval-based Scheduling\n```java\n\"EVERY 15 MIN\"  // Every 15 minutes\n\"EVERY 2 HR\"    // Every 2 hours\n\"EVERY 30 SEC\"  // Every 30 seconds\n```\n\n### Time-based Scheduling\n```java\n\"AT 09:30\"                    // Daily at 9:30 AM\n\"AT 14:00 EVERY MON|FRI\"      // 2:00 PM on Monday and Friday\n```\n\n### Date-based Scheduling\n```java\n\"AT 12:00 ON 15\"      // 12:00 PM on the 15th of every month\n\"AT 08:00 ON 12/25\"   // 8:00 AM on December 25th\n```\n\n### Cron-style Scheduling\n```java\n\"CRON 0 9 * * MON-FRI\"     // 9:00 AM weekdays\n\"CRON 30 14 1 * *\"         // 2:30 PM on the 1st of every month\n\"CRON 0 */2 * * *\"         // Every 2 hours\n\"CRON 15,45 * * * *\"       // At 15 and 45 minutes past each hour\n```\n\n#### Cron Expression Format\n```\n┌───────────── minute (0 - 59)\n│ ┌─────────── hour (0 - 23)\n│ │ ┌───────── day of month (1 - 31)\n│ │ │ ┌─────── month (1 - 12 or JAN-DEC)\n│ │ │ │ ┌───── day of week (0 - 7 or SUN-SAT, 0 and 7 are Sunday)\n│ │ │ │ │\n* * * * *\n```\n\n**Special Characters:**\n- `*` - matches all values\n- `,` - separates multiple values\n- `-` - defines ranges\n- `/` - defines step values\n\n## 🔧 Advanced Usage\n\n### Job Lifecycle Management\n\n```java\n// Suspend a job temporarily\njob.suspend();\n\n// Resume a suspended job\njob.resume();\n\n// Cancel a job permanently\njob.cancel();\n\n// Check job status\nboolean isSuspended = job.isSuspended();\nboolean isCancelled = job.isCancelled();\n```\n\n### Custom Job Context\n\n```java\npublic class MyJobContext implements JobContext {\n    private final Logger logger = LoggerFactory.getLogger(MyJobContext.class);\n    private final Properties properties = new Properties();\n    \n    @Override\n    public Logger getLogger() {\n        return logger;\n    }\n    \n    @Override\n    public Optional\u003cString\u003e getJobName() {\n        return Optional.of(\"my-custom-job\");\n    }\n    \n    @Override\n    public Properties getProperties() {\n        return properties;\n    }\n    \n    // Implement other methods...\n}\n```\n\n### Property-based Configuration\n\n```java\n@Override\nprotected void executeJob() throws Exception {\n    String apiUrl = getProperty(\"api.url\", \"https://api.example.com\");\n    int timeout = Integer.parseInt(getProperty(\"timeout\", \"30\"));\n    \n    // Use properties in your job logic\n}\n```\n\n### Initialization and Cleanup Hooks\n\n```java\npublic class DatabaseJob extends TimerJob {\n    private Connection connection;\n    \n    @Override\n    protected void initialize() throws Exception {\n        connection = DriverManager.getConnection(\n            getProperty(\"db.url\"), \n            getProperty(\"db.user\"), \n            getProperty(\"db.password\")\n        );\n        getLogger().info(\"Database connection established\");\n    }\n    \n    @Override\n    protected void executeJob() throws Exception {\n        // Use connection for database operations\n    }\n    \n    @Override\n    protected void cleanup() {\n        if (connection != null) {\n            try {\n                connection.close();\n                getLogger().info(\"Database connection closed\");\n            } catch (SQLException e) {\n                getLogger().warn(\"Error closing database connection\", e);\n            }\n        }\n    }\n}\n```\n\n## 🌍 TimeZone and Locale Support\n\n```java\nScheduleDirective directive = new ScheduleDirective(\n    \"CRON 0 9 * * MON-FRI\",\n    ScheduleDirective.ScheduleType.CRON,\n    // ... other parameters\n    ZoneId.of(\"America/New_York\"),     // Specific timezone\n    Locale.US                          // Specific locale\n);\n```\n\n## 📊 Examples\n\nSee the [examples](examples/) directory for complete working examples:\n\n- [Basic Timer Job](examples/BasicTimerJob.java)\n- [Database Cleanup Job](examples/DatabaseCleanupJob.java)\n- [Email Notification Job](examples/EmailNotificationJob.java)\n- [File Processing Job](examples/FileProcessingJob.java)\n\n## 🛠️ Requirements\n\n- Java 17 or higher\n- SLF4J for logging\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## 📄 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Inspired by modern scheduling libraries like Quartz and Spring Scheduler\n- Built with modern Java features for optimal performance and maintainability\n\n## 🔗 Links\n\n- [API Documentation](https://javadoc.io/doc/net.teppan.amber/amber-timerjob)\n- [GitHub Issues](https://github.com/juanitadevelopment/amber-timerjob/issues)\n- [Changelog](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanitadevelopment%2Famber-timerjob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanitadevelopment%2Famber-timerjob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanitadevelopment%2Famber-timerjob/lists"}