Closed jochenberger closed 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.
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.
I understand that. We can't remove them as long as there are people who configure the store via properties files.
Oh, right, didn't think of that.
@jochenberger just to make it clear, I'm all for having the extra constructors you need.
That's how I understood your response. I just didn't have the time to create a PR yet, I'm afraid.
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.