uk.ac.starlink.plastic
Class MessageDefinition

java.lang.Object
  extended byuk.ac.starlink.plastic.MessageDefinition

public class MessageDefinition
extends Object

Describes PLASTIC messages known to this package. Instances of this class describe messages defined by the PLASTIC message definitions list, currently at , perhaps along with other ones known from elsewhere. The message IDs, argument types and return types are given.

Since:
18 Jul 2006
Author:
Mark Taylor

Field Summary
static MessageDefinition FITS_LOADCUBE
           
static MessageDefinition FITS_LOADIMAGE
           
static MessageDefinition FITS_LOADLINE
           
static MessageDefinition HUB_APPREG
           
static MessageDefinition HUB_APPUNREG
           
static MessageDefinition HUB_STOPPING
           
static MessageDefinition INFO_GETDESCRIPTION
           
static MessageDefinition INFO_GETICONURL
           
static MessageDefinition INFO_GETIVORN
           
static MessageDefinition INFO_GETNAME
           
static MessageDefinition INFO_GETVERSION
           
static MessageDefinition SKY_POINT
           
static MessageDefinition SPECTRUM_LOADURL
           
static MessageDefinition TEST_ECHO
           
static MessageDefinition VOT_HIGHLIGHTOBJECT
           
static MessageDefinition VOT_LOAD
           
static MessageDefinition VOT_LOADURL
           
static MessageDefinition VOT_SHOWOBJECTS
           
 
Constructor Summary
MessageDefinition(String id, ValueType[] argTypes, ValueType returnType)
          Constructs a message definition whose arguments are all required.
MessageDefinition(String id, ValueType[] argTypes, ValueType returnType, int requiredArgs)
          Constructs a message definition which may have some optional arguments.
 
Method Summary
 ValueType[] getArgTypes()
          Returns an array of the types of the first N arguments which must be sent with this message.
 URI getId()
          Returns the URI which forms the message ID of this message.
static MessageDefinition[] getKnownMessages()
          Returns an array of known standard message definitions.
static MessageDefinition getMessage(URI id)
          Returns the message definition corresponding to a given message ID.
 int getRequiredArgs()
          Returns the number of arguments which are required by this message.
 ValueType getReturnType()
          Returns the type of the value which must be returned by this message.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEST_ECHO

public static final MessageDefinition TEST_ECHO

INFO_GETIVORN

public static final MessageDefinition INFO_GETIVORN

INFO_GETNAME

public static final MessageDefinition INFO_GETNAME

INFO_GETDESCRIPTION

public static final MessageDefinition INFO_GETDESCRIPTION

INFO_GETVERSION

public static final MessageDefinition INFO_GETVERSION

INFO_GETICONURL

public static final MessageDefinition INFO_GETICONURL

HUB_APPREG

public static final MessageDefinition HUB_APPREG

HUB_APPUNREG

public static final MessageDefinition HUB_APPUNREG

HUB_STOPPING

public static final MessageDefinition HUB_STOPPING

VOT_LOAD

public static final MessageDefinition VOT_LOAD

VOT_LOADURL

public static final MessageDefinition VOT_LOADURL

VOT_SHOWOBJECTS

public static final MessageDefinition VOT_SHOWOBJECTS

VOT_HIGHLIGHTOBJECT

public static final MessageDefinition VOT_HIGHLIGHTOBJECT

FITS_LOADLINE

public static final MessageDefinition FITS_LOADLINE

FITS_LOADIMAGE

public static final MessageDefinition FITS_LOADIMAGE

FITS_LOADCUBE

public static final MessageDefinition FITS_LOADCUBE

SKY_POINT

public static final MessageDefinition SKY_POINT

SPECTRUM_LOADURL

public static final MessageDefinition SPECTRUM_LOADURL
Constructor Detail

MessageDefinition

public MessageDefinition(String id,
                         ValueType[] argTypes,
                         ValueType returnType,
                         int requiredArgs)
Constructs a message definition which may have some optional arguments.

Parameters:
id - message identifier; this must have the form of a URI
argTypes - types of each argument
returnType - type of return value
requiredArgs - minimum number of arguments for a legal call of this message

MessageDefinition

public MessageDefinition(String id,
                         ValueType[] argTypes,
                         ValueType returnType)
Constructs a message definition whose arguments are all required.

Parameters:
id - message identifier; this must have the form of a URI
argTypes - types of each argument
returnType - type of return value
Method Detail

getId

public URI getId()
Returns the URI which forms the message ID of this message. This probably starts "ivo://...".

Returns:
message ID

getArgTypes

public ValueType[] getArgTypes()
Returns an array of the types of the first N arguments which must be sent with this message.

Returns:
array of argument value types

getReturnType

public ValueType getReturnType()
Returns the type of the value which must be returned by this message.

Returns:
return value type

getRequiredArgs

public int getRequiredArgs()
Returns the number of arguments which are required by this message. This will be less than or equal to the size of the array returned by getArgTypes(). A message may legally carry a number of arguments which is larger than either of these values.


toString

public String toString()

getKnownMessages

public static MessageDefinition[] getKnownMessages()
Returns an array of known standard message definitions. This comprises all the ones defined as public static members of this class. The returned object is a clone.

Returns:
known messages list

getMessage

public static MessageDefinition getMessage(URI id)
Returns the message definition corresponding to a given message ID. Returns null if no such message is known.

Parameters:
id - message ID
Returns:
definition for message with ID id, or null


Copyright © 2006 \\ CLRC: Central Laboratory of the Research Councils. All Rights Reserved.