radtools.services
Interface RADService

All Superinterfaces:
DynamicBound, DynamicComponent, rcf.core.util.accessor.GUIAccessible, ReflectedBindable<DynamicComponent>, ReflectedComponent
All Known Subinterfaces:
FedoraHostedRADService, HostedRADService, LinuxHostedRADService, NetworkSession<SP>, NetworkSystem<SP>, NetworkTunnel<SP>, RemoteHostedRADService, RemoteRADService
All Known Implementing Classes:
AbstractFedoraHostedRADService, AbstractLinuxHostedRADService, AbstractNetworkTunnel, AbstractRADService, AbstractRemoteRADService, AdvancedResearchIndexLoadLinux, ComposedRADService, FedoraSystem, HAProxyLinux, LigHTTPDLinux, LinuxSession, LinuxSession.Tunnel, LinuxSystem, MemcachedFedora, MySQLFedora, RADTools, ResearchIndexLoadLinux, RoRServerLinux, VMWareFedora, VMWareLinux

@Revision(value="$Revision: 1.10 $",
          date="$Date: 2006/12/16 17:54:00 $",
          tag="$Name:  $")
@StaticComponent
public interface RADService
extends DynamicComponent, rcf.core.util.accessor.GUIAccessible

TODO: Javadoc

TODO: Unit tests, Code review, Javadoc review, Seal/Finalize TODO: equals, hashCode, toString

Version:
$Revision: 1.10 $
Author:
Greg Gibeling

Nested Class Summary
static class RADService.State
          An enumeration of the valid states which a RADService can be in.
 
Nested classes/interfaces inherited from interface rcf.core.framework.component.DynamicComponent
DynamicComponent.Abstract, DynamicComponent.Default
 
Nested classes/interfaces inherited from interface rcf.core.framework.component.DynamicBound
DynamicBound.GUIType
 
Method Summary
 rcf.core.util.graph.Vertex<RADService,?,?,?,?,?> communication()
          Get the vertex containing this RADService, in the comminications graph.
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition()
          Get the tree node containing this RADService, whose parent is the RADService which is built out of this one.
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency()
          Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order for this service to be running.
 boolean isConcrete()
          Determine if this RADService is a concrete service, or simply an arbitrary abstraction built for management purposes.
 rcf.core.util.tree.Node<RADService,?,?,?,?,?> management()
          Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order to manage this service at all.
 DynamicProperty<RADService.State> radServiceState()
          Returns the dynamic property object for the state of this service.
 void refresh()
          Schedule an update of the state of this object, from the state of the actual service it represents.
 void update(boolean schedule, RADService.State _state)
          Update the actual service to match the state held by this object.
 void window()
          Popup the automatically generated window containing controls for the various DynamicComponent.properties() and DynamicComponent.operations() supported by not only this interface, but by any other component interfaces implemented by any specific RADService object.
 
Methods inherited from interface rcf.core.framework.component.DynamicComponent
component, operations, properties
 
Methods inherited from interface rcf.core.framework.component.DynamicBound
gui
 
Methods inherited from interface rcf.core.util.accessor.GUIAccessible
icon, popupMenu
 
Methods inherited from interface rcf.core.framework.component.ReflectedComponent
interfaces, isInstance
 
Methods inherited from interface rcf.core.framework.component.ReflectedBindable
bind
 

Method Detail

communication

rcf.core.util.graph.Vertex<RADService,?,?,?,?,?> communication()
Get the vertex containing this RADService, in the comminications graph. Edges in this graph represent communications, and can be tagged with the type: e.g. RPC versus dataflow. This graph is not currently implemented but would provide significant benefits especially in conjunction with path based analysis or, for example, StarTrace.

TODO: Javadoc

Returns:
The communications graph vertex containing this RADService.

composition

rcf.core.util.tree.Node<RADService,?,?,?,?,?> composition()
Get the tree node containing this RADService, whose parent is the RADService which is built out of this one. The composition tree is meant to capture e.g. that a website is built out of a webserver, some application logic and a database.

Returns:
The composition tree node containing this RADService.
See Also:
radtools

dependency

rcf.core.util.tree.Node<RADService,?,?,?,?,?> dependency()
Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order for this service to be running. The dependency tree is meant to capture e.g. that a virtual machine cannot be running if the physical machine it is hosted by is not running, or that the physical machine depends on a UPS or power strip.

Dependencies for information should be modelled through the communication graph, and composition of services through the composition tree.

Returns:
The dependency tree node containing this RADService.
See Also:
radtools

isConcrete

@StaticGetMethod(value="RADService.Concrete",
                 mode=Read)
boolean isConcrete()
Determine if this RADService is a concrete service, or simply an arbitrary abstraction built for management purposes.

Returns:
true if this object represents a concrete service. false if this object represents an arbitrary abstraction, and does not correspond to a real service.

management

rcf.core.util.tree.Node<RADService,?,?,?,?,?> management()
Get the tree node containing this RADService, whose parent is the RADService which must be RADService.State.Running in order to manage this service at all. The management tree is meant to capture e.g. that the management of a machine depends on an SSH session, which might itself depend on an SSH tunnel.

Returns:
The management tree node containing this RADService.
See Also:
radtools

radServiceState

@StaticPropertyMethod(value="RADService.State")
DynamicProperty<RADService.State> radServiceState()
Returns the dynamic property object for the state of this service. The dynamic property can then be used to query the actual state, or to set it. There are few restrictions on state, except that it must be RADService.State.Unknown when management().parent().get().radServiceState().get() != RADService.State.Running.

Note that the ImmutableSingletonInterface.get() and SingletonInterface#set() methods on the dynamic property refer to the offline state of this service. The refresh() and update(boolean, RADService.State) methods can be used to synchronize this state with the state of the actual service. SingletonInterface#set() will schedule a call to update(boolean, RADService.State) so that the service state will be updated in the future.

Returns:
The dynamic property which represents the offline state of this service.
Throws:
IllegalArgumentException - If _state == RADService.State.Unknown or if this service otherwise does not support the requested state. For example if _state == RADService.State.Uninstalled and this class does not have code or permission to uninstall the service.

refresh

@StaticOperation(value="RADService.Refresh")
void refresh()
Schedule an update of the state of this object, from the state of the actual service it represents. In objects which inherit from AbstractRADService, this will schedule a call to AbstractRADService.check() using RADTools.schedule(rcf.core.concurrent.schedule.TimerTask).


update

void update(boolean schedule,
            RADService.State _state)
Update the actual service to match the state held by this object. This method can either schedule an update or perform one immediately. This is necessary to avoid running a comparatively expensive update operation as part of the simple event handler for GUI events.

Parameters:
schedule - Should the update be scheduled, or performed immediately?
_state - The new state to update this RADService to.

window

@StaticOperation(value="RADService.Window")
void window()
Popup the automatically generated window containing controls for the various DynamicComponent.properties() and DynamicComponent.operations() supported by not only this interface, but by any other component interfaces implemented by any specific RADService object.

Two calls to this method, will display the same window, rather than generating a new one.