radtools.services.linux
Class LinuxSystem

java.lang.Object
  extended by rcf.core.framework.component.DynamicComponent.Abstract
      extended by radtools.services.AbstractRADService
          extended by radtools.services.AbstractRemoteRADService
              extended by radtools.services.linux.LinuxSystem
All Implemented Interfaces:
SecureSystem<UsernamePasswordPrincipal>, NetworkSystem<UsernamePasswordPrincipal>, RADService, RemoteRADService, DynamicBound, DynamicComponent, ReflectedBindable<DynamicComponent>, ReflectedComponent, rcf.core.util.accessor.GUIAccessible
Direct Known Subclasses:
FedoraSystem, VMWareLinux

@Revision(value="$Revision: 1.15 $",
          date="$Date: 2006/12/14 16:14:56 $",
          tag="$Name:  $")
public class LinuxSystem
extends AbstractRemoteRADService
implements NetworkSystem<UsernamePasswordPrincipal>

TODO: Javadoc

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

Version:
$Revision: 1.15 $
Author:
Greg Gibeling

Nested Class Summary
protected  class LinuxSystem.FrameworkEventSink
          TODO: Javadoc
protected  class LinuxSystem.State
          TODO: Javadoc
 
Nested classes/interfaces inherited from class radtools.services.AbstractRADService
AbstractRADService.AbstractRADServiceState, AbstractRADService.RefreshTask, AbstractRADService.StateProxy, AbstractRADService.UpdateTask
 
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
 
Field Summary
private  Reference<LinuxSession> cachedSession
          TODO: Javadoc
protected  byte[] hostkey
          TODO: Javadoc
private  UsernamePasswordPrincipal principal
          TODO: Javadoc
 
Fields inherited from class radtools.services.AbstractRemoteRADService
hostport
 
Fields inherited from class radtools.services.AbstractRADService
composition, dependency, management, proxy, state, window
 
Fields inherited from class rcf.core.framework.component.DynamicComponent.Abstract
component, operations, properties
 
Constructor Summary
LinuxSystem(RADService _management, RADService _dependency, RADService _composition, UsernamePasswordPrincipal _principal, HostPort _hostport, byte[] _hostkey)
          TODO: Javadoc
 
Method Summary
 Date boottime()
          TODO: Javadoc
private  LinuxSession cachedSession(RADService _composition)
          TODO: Javadoc
 LinuxSession connect(UsernamePasswordPrincipal _principal)
          TODO: Javadoc
 LinuxSession connect(UsernamePasswordPrincipal _principal, RADService _composition)
          TODO: Javadoc
 void disconnect()
          TODO: Javadoc
 File getArchive(String path)
          TODO: Javadoc
 boolean isConcrete()
          Determine if this RADService is a concrete service, or simply an arbitrary abstraction built for management purposes.
private  void loadNagiosProperties(LinuxSession session)
          TODO: Javadoc
 boolean ping(HostPort _hostport)
          TODO: Javadoc
 UsernamePasswordPrincipal principal()
          TODO: Javadoc
 DynamicProperty<RADService.State> radServiceState()
          Returns the dynamic property object for the state of this service.
 void setArchive(String path, File file)
          TODO: Javadoc
 String toString()
           
private  void unloadNagiosProperties()
          TODO: Javadoc
 
Methods inherited from class radtools.services.AbstractRemoteRADService
hostport
 
Methods inherited from class radtools.services.AbstractRADService
check, communication, composition, dependency, icon, management, radTools, refresh, update, window
 
Methods inherited from class rcf.core.framework.component.DynamicComponent.Abstract
bind, component, gui, interfaces, isInstance, o, operations, popupMenu, properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface radtools.services.RADService
communication, composition, dependency, management, refresh, update, window
 
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
 

Field Detail

cachedSession

private Reference<LinuxSession> cachedSession
TODO: Javadoc


hostkey

protected final byte[] hostkey
TODO: Javadoc


principal

private final UsernamePasswordPrincipal principal
TODO: Javadoc

Constructor Detail

LinuxSystem

public LinuxSystem(RADService _management,
                   RADService _dependency,
                   RADService _composition,
                   UsernamePasswordPrincipal _principal,
                   HostPort _hostport,
                   byte[] _hostkey)
TODO: Javadoc

Parameters:
_management -
_dependency -
_composition -
_principal -
_hostport -
_hostkey -
Method Detail

boottime

@StaticGetMethod(value="System.BootTime")
public Date boottime()
TODO: Javadoc

Returns:

cachedSession

private LinuxSession cachedSession(RADService _composition)
TODO: Javadoc

Returns:

connect

public LinuxSession connect(UsernamePasswordPrincipal _principal)
Description copied from interface: SecureSystem
TODO: Javadoc

Specified by:
connect in interface SecureSystem<UsernamePasswordPrincipal>
Specified by:
connect in interface NetworkSystem<UsernamePasswordPrincipal>
Parameters:
_principal - Can be null to use the default principal
Returns:

connect

public LinuxSession connect(UsernamePasswordPrincipal _principal,
                            RADService _composition)
TODO: Javadoc

Parameters:
_principal -
_composition -
Returns:

disconnect

public void disconnect()
Description copied from interface: SecureSystem
TODO: Javadoc

Specified by:
disconnect in interface SecureSystem<UsernamePasswordPrincipal>

getArchive

@StaticOperation(value="System.GetArchive")
public File getArchive(@StaticParameter(value="path",use=Option)
                                            String path)
TODO: Javadoc

Parameters:
path -
Returns:

isConcrete

public boolean isConcrete()
Description copied from interface: RADService
Determine if this RADService is a concrete service, or simply an arbitrary abstraction built for management purposes.

Specified by:
isConcrete in interface RADService
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.

loadNagiosProperties

private void loadNagiosProperties(LinuxSession session)
TODO: Javadoc


ping

@StaticOperation(value="System.Ping")
public boolean ping(HostPort _hostport)
TODO: Javadoc

Parameters:
_hostport -
Returns:

principal

public UsernamePasswordPrincipal principal()
Description copied from interface: SecureSystem
TODO: Javadoc

Specified by:
principal in interface SecureSystem<UsernamePasswordPrincipal>
Returns:
The default security principal.

radServiceState

public DynamicProperty<RADService.State> radServiceState()
Description copied from interface: RADService
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 RADService.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 RADService.refresh() and RADService.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 RADService.update(boolean, RADService.State) so that the service state will be updated in the future.

Specified by:
radServiceState in interface RADService
Returns:
The dynamic property which represents the offline state of this service.

setArchive

public void setArchive(@StaticParameter(value="path",use=Option)
                       String path,
                       @StaticParameter(value="file",use=Data)
                       File file)
TODO: Javadoc

Parameters:
path -
file -

toString

public String toString()
Overrides:
toString in class Object

unloadNagiosProperties

private void unloadNagiosProperties()
TODO: Javadoc