michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

MongoDBJobStore should have constructors #82

Closed jochenberger closed 9 years ago

jochenberger commented 9 years ago

If you want to initialize a MongoDBJobStore using a preconfigured Mongo(Client) instance, you have to override a static field of MongoDBJobStore. On the other hand, if you want to configure it using parameters like host name, user and password or uri, user and password, you have to call different setters on an "empty" MongoDBJobStore instance. I think a better option would be a constructor that receives a Mongo(Client) instance and a set of other constructors that take different sets of required parameters and delegate to the former one. Therefore, in my opinion, the setters for connection-related parameters should be deprecated and removed altogether in a later release. Besides, calling them after the connection has been initialized won't have any effect anyway.

michaelklishin commented 9 years ago

We cannot remove the setters, Quartz assumes they exist and uses them. Adding new constructors should be fine, feel free to submit a PR.

jochenberger commented 9 years ago

I meant the setters for connection-related parameters, like setMongoUri, setAddresses, setDbName and the like. I'll see what I can do about the PR.

michaelklishin commented 9 years ago

I understand that. We can't remove them as long as there are people who configure the store via properties files.

jochenberger commented 9 years ago

Oh, right, didn't think of that.

michaelklishin commented 9 years ago

@jochenberger just to make it clear, I'm all for having the extra constructors you need.

jochenberger commented 9 years ago

That's how I understood your response. I just didn't have the time to create a PR yet, I'm afraid.