Rio Project 4.2 API Documentation



org.rioproject.core
Interface OperationalString

All Known Implementing Classes:
OpString

public interface OperationalString

An OperationalString represents a collection of application and/or infrastructure software services that when put together provide a coarse-grained service, typically distributed through the network.

The OperationalString is the unit of deployment in Rio, and provides the capability to declare, monitor and manage the availability of enclosed services.

Author:
Dennis Reedy

Field Summary
static int BROKEN
          Indicates the OperationalString is deployed and is broken, where all required services are not available
static int COMPROMISED
          Indicates the OperationalString is deployed and is compromised, where some specified services are not available
static int DEPLOYED
          Indicates the OperationalString is deployed
static int INTACT
          Indicates the OperationalString is deployed and is intact, where all specified services are available
static int SCHEDULED
          Indicates the OperationalString is scheduled for deployment
static int UNDEPLOYED
          Indicates the OperationalString is not deployed
 
Method Summary
 void addService(ServiceElement sElem)
          Add a ServiceElement to the OperationalString.
 String getName()
          All OperationalString instances have a descriptive name.
 OperationalString[] getNestedOperationalStrings()
          An OperationalString may contain other OperationalString instances.
 Schedule getSchedule()
          Get the Schedule for the OperationalString Scheduling of an OperationalString is part of the OperationalString itself, the schedule is an optional declarative attribute, and if not declared the OperationalString will be deployed immediately.
 ServiceElement[] getServices()
          Get all services contained by this OperationalString as an array of ServiceElement objects
 int getStatus()
          Get the status of the OperationalString
 URL loadedFrom()
          Get the location the OperationalString was loaded from.
 void removeService(ServiceElement sElem)
          Remove a ServiceElement from the OperationalString.
 void setDeployed(int deployed)
          Set the OperationalString as being scheduled, deployed or undeployed
 

Field Detail

UNDEPLOYED

static final int UNDEPLOYED
Indicates the OperationalString is not deployed

See Also:
Constant Field Values

SCHEDULED

static final int SCHEDULED
Indicates the OperationalString is scheduled for deployment

See Also:
Constant Field Values

DEPLOYED

static final int DEPLOYED
Indicates the OperationalString is deployed

See Also:
Constant Field Values

BROKEN

static final int BROKEN
Indicates the OperationalString is deployed and is broken, where all required services are not available

See Also:
Constant Field Values

COMPROMISED

static final int COMPROMISED
Indicates the OperationalString is deployed and is compromised, where some specified services are not available

See Also:
Constant Field Values

INTACT

static final int INTACT
Indicates the OperationalString is deployed and is intact, where all specified services are available

See Also:
Constant Field Values
Method Detail

getStatus

int getStatus()
Get the status of the OperationalString

Returns:
The status of the OperationalString. If the OperationalString has not been scheduled or deployed the OperationalString status must always return UNDEPLOYED. If the OperationalString is DEPLOYED, then the status will represent the 'weakest link in the chain', that is if this OperationalString has nested OperationalString instances whose state is of lesser fidelity (lesser fidelity reflecting a BROKEN status, highest fidelity representing an INTACT state) then the status of this OperationalString must reflect the weakest status. If no nested OperationalString instances are found, or the OperationalString itself has a lesser fidelity then it's nested OperationalString instances, the status is determined by the inspecting ServiceElement instance availability

setDeployed

void setDeployed(int deployed)
Set the OperationalString as being scheduled, deployed or undeployed

Parameters:
deployed - Either SCHEDULED, DEPLOYED or UNDEPLOYED
Throws:
IllegalStateException - if the deployed parameter is not SCHEDULED, DEPLOYED or UNDEPLOYED

getName

String getName()
All OperationalString instances have a descriptive name. This method is used to get the name of this OperationalString

Returns:
The name of the OperationalString

getNestedOperationalStrings

OperationalString[] getNestedOperationalStrings()
An OperationalString may contain other OperationalString instances. In this fashion OperationalString instances may be nested. This method returns an array of OperationalString objects that this OperationalString contains

Returns:
An array of OperationalString objects. If this OperationalString does not contain any other OperationalStrings, this method will return a zero-length array

getServices

ServiceElement[] getServices()
Get all services contained by this OperationalString as an array of ServiceElement objects

Returns:
An array of ServiceElement objects. If this OperationalString contains no services, this method will return a zero-length array

addService

void addService(ServiceElement sElem)
Add a ServiceElement to the OperationalString.

Parameters:
sElem - The ServiceElement to add

removeService

void removeService(ServiceElement sElem)
Remove a ServiceElement from the OperationalString.

Parameters:
sElem - The ServiceElement to remove

loadedFrom

URL loadedFrom()
Get the location the OperationalString was loaded from.

Returns:
The URL OperationalString was loaded from. The value may be null if the OperationalString was not loaded from a file or repository based mechanism

getSchedule

Schedule getSchedule()
Get the Schedule for the OperationalString

Scheduling of an OperationalString is part of the OperationalString itself, the schedule is an optional declarative attribute, and if not declared the OperationalString will be deployed immediately. The following properties describe the Schedule :

Declaring a Schedule
A Schedule can be declared in an OperationalString XML document as follows :

<DeploymentSchedule>
     <DeployDate DayOfWeek="Thursday" Hour="8" Minute="30" Format="PM"/>
     <Duration Minutes="30"/>
     <Repeats Count="10">
         <Interval Days="1" Hours="1" Minutes="1"/>
     </Repeats>
 </DeploymentSchedule>

This DeploymentSchedule produces the following:

Once the DeploymentSchedule element is parsed, a Schedule object is created and set to the enclosing OperationalString object.

Returns:
The Schedule for the OperationalString, providing context on declared start date, duration, repeat count and repeat interval

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.