uk.org.ogsadai.client.toolkit.properties
Class DAIVersion

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.properties.DAIVersion

public class DAIVersion
extends java.lang.Object

Information on the type and version OGSA-DAI used to deploy a service.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  int mMajorVersion
          Major version number
private  int mMinorVersion
          Minor version number
private  ServiceType mServiceType
          OGSA-DAI service type as provided by a service
private  java.lang.String mTypeAndVersion
          Type and version as a string
 
Constructor Summary
DAIVersion(java.lang.String typeAndVersion)
          Constructor - extracts service type and version information from a string.
 
Method Summary
static DAIVersion createFromProperty(Property property)
          Creates a DAIVersion object from a property holding a value representing this information.
 int getMajorVersion()
          Return major version (for example, for 2.1 this is 2).
 int getMinorVersion()
          Return minor version (for example, for 2.1 this is 1).
 ServiceType getServiceType()
          Return service type.
 java.lang.String toString()
          Return service type and version in string of form OGSA-DAI PLATFORM MAJOR.MINOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mServiceType

private ServiceType mServiceType
OGSA-DAI service type as provided by a service


mTypeAndVersion

private java.lang.String mTypeAndVersion
Type and version as a string


mMinorVersion

private int mMinorVersion
Minor version number


mMajorVersion

private int mMajorVersion
Major version number

Constructor Detail

DAIVersion

public DAIVersion(java.lang.String typeAndVersion)
Constructor - extracts service type and version information from a string.

The string is assumed to be of form: OGSA-DAI PLATFORM MAJOR.MINOR where

Parameters:
typeAndVersion - String holding service type and vrsion information.
Method Detail

getMinorVersion

public int getMinorVersion()
Return minor version (for example, for 2.1 this is 1).

Returns:
minor version.

getMajorVersion

public int getMajorVersion()
Return major version (for example, for 2.1 this is 2).

Returns:
major version.

toString

public java.lang.String toString()
Return service type and version in string of form OGSA-DAI PLATFORM MAJOR.MINOR

Overrides:
toString in class java.lang.Object
Returns:
string

getServiceType

public ServiceType getServiceType()
Return service type.

Returns:
service type.

createFromProperty

public static DAIVersion createFromProperty(Property property)
                                     throws DataFormatException
Creates a DAIVersion object from a property holding a value representing this information.

The property's getValue method is assumed to return an org.w3c.dom.Element representing the service type and version information as provided by a data service resource.

Parameters:
property - Property holding data type and version information from data service resource.
Returns:
the DataResourceInfo corresponding to the information in the property.
Throws:
DataFormatException - If the value of the property cannot be parsed into service type and version information.