On Jan 27, 2010, at 12:20 PM, Bryan Kearney wrote:
On 01/27/2010 12:16 PM, Bryan Kearney wrote:
> Working through a plugin, there were a couple of things I did not know
> how to do. Any pointers on best practices would be appreciated.
>
> 1) I would like to exposed operations based on the state (availability)
> of the resource.
We do not have this capability right now. Probably sending the operation and waiting for a
failure is the best we can do without changes.
Perhaps a new piece of metadata declaring required availability state for an operation
(but then I'm sure there'd be a need for more advanced conditionals and other
state checking). Perhaps an enhanced facet API that can be called to ask the plugin what
operations are valid at any given time.
>
> 2) I would like to kick off discovery based on an operation being executed.
Yes, we need this. We currently invoke this in some particular parts of the plugin
container, but what is really needed is a mechanism for the plugin to request it. I
suggest a callback on ResourceContext like "requestDiscovery". Should be a few
lines of code.
>
> 3) I would like to update availability based on an operation.
The availability system is a bit complicated and tied to agent heartbeats at the moment.
One option around complexity would be to just invoke the normal avail check out of cycle.
This would likely be done the same as above with a "requestAvailabilityCheck"
callback on the ResourceContext.
>
> I assume some/all of this is supported.
Not so much... but easy to add.
>
> -- bk
One more thing. When an item is in inventrory, and then is deleted not
by RHQ. How, during the availability check, do I say "It is gone.. never
to return"
This is a bit more complicated. We specifically do not delete server side resources when
they are no longer detected by the agent because it could cause a loss of important
related audit information. It could also be a temporary situation like a service being
down. For example, a JBossAS instance will not be detected if it isn't running, but if
you delete it you wouldn't be able to use the start command to restart it.
One possible solution to this could be a new InventoryStatus state like
"MISSING" that would allow for filtering in some areas of the UI, but not lose
related audit information and still allow it to be operated and reconnected when the
resource is "re-detected" in the future. Other options would have the missing
state only used if the plugin indicates that discovery is foolproof. False for an AS
instance but true for something that can really detect that the underlying resource has
been completely removed.
-- bk
_______________________________________________
rhq-devel mailing list
rhq-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/rhq-devel
- Greg