uk.ac.ic.doc.automed.reps
Class DataSource

java.lang.Object
  extended by uk.ac.ic.doc.automed.reps.DataSource
All Implemented Interfaces:
PersistentObject

public class DataSource
extends java.lang.Object
implements PersistentObject

DataSource.java Represents the data source published by a peer to the network. It encapsulates the data source schema (e.g. uni_s1_src) and contains other attributes useful for other peers on the network to infer about a data source's capability.

Author:
Duc M Le dmle@doc.ic.ac.uk Created on 03 May 2006 Department of Computing, Imperial College

Field Summary
private  int _capability
           
private  java.lang.String _name
           
private  java.lang.String _type
           
static int CAP_DEFAULT
           
static java.lang.String TYP_CACHE
           
static java.lang.String TYP_SOURCE
           
 
Constructor Summary
DataSource(java.lang.String name, java.lang.String type, int capability)
          Creates a new instance of DataSource
 
Method Summary
static DataSource deserialise(java.util.Map pa)
          This method guarantees that a PersistentObject can be deserialised properly from its own set of persistent attributes.
 PersistentKey getKey()
           
 java.lang.String getName()
           
 java.util.Map getPersistentAttributes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

private java.lang.String _name

_type

private java.lang.String _type

_capability

private int _capability

TYP_SOURCE

public static final java.lang.String TYP_SOURCE
See Also:
Constant Field Values

TYP_CACHE

public static final java.lang.String TYP_CACHE
See Also:
Constant Field Values

CAP_DEFAULT

public static final int CAP_DEFAULT
See Also:
Constant Field Values
Constructor Detail

DataSource

public DataSource(java.lang.String name,
                  java.lang.String type,
                  int capability)
Creates a new instance of DataSource

Parameters:
name - of the data source schema that wraps around the actual data source
type - one of the following:
capabilityCode - an integer representing the features of the AutoMedWrapper object used to create this data source schema
Method Detail

getName

public java.lang.String getName()

getKey

public PersistentKey getKey()
Specified by:
getKey in interface PersistentObject

getPersistentAttributes

public java.util.Map getPersistentAttributes()
Specified by:
getPersistentAttributes in interface PersistentObject

deserialise

public static DataSource deserialise(java.util.Map pa)
                              throws java.lang.IllegalArgumentException
This method guarantees that a PersistentObject can be deserialised properly from its own set of persistent attributes. It is a reverse of getPersistentAttributes()

Parameters:
pa - a HashMap of persistent attributes (created by {@link #getPersistentAttributes())
Throws:
java.lang.IllegalArgumentException