uk.ac.vamsas.objects.utils
Class AppDataReference

java.lang.Object
  extended byuk.ac.vamsas.objects.utils.AppDataReference

public class AppDataReference
extends java.lang.Object

Form, accessors and validation for ApplicationData references in vamsas document. TODO: LATER:extend XML Schema to properly validate against the same forms required by this class TODO: VAMSAS: URNS for appDatas are supposed to be unique, aren't they ?


Constructor Summary
AppDataReference()
           
 
Method Summary
static boolean equals(ApplicationData p, ClientHandle c)
          returns true if Name matches in c and p, and Urn's match (or c.getUrn()==null) and Version's match (or c.getVersion()==null)
static boolean equals(User p, UserHandle u)
           
static java.util.Vector getAppDataReferences(VamsasDocument doc)
          collect all appData reference strings in a vamsas document
static java.util.Vector getUserandApplicationsData(VamsasDocument doc, UserHandle user, ClientHandle app)
          Searches document appData structure for particular combinations of client and user data
static java.util.Vector searchAppDatas(VamsasDocument doc, uk.ac.vamsas.objects.utils.AppDataReference.IAppDSearch test, boolean cascade)
          General search through the set of AppData objects for a particular profile of Client and User handle.
static java.lang.String uniqueAppDataReference(VamsasDocument dest, java.lang.String base)
          safely creates a new appData reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppDataReference

public AppDataReference()
Method Detail

getAppDataReferences

public static java.util.Vector getAppDataReferences(VamsasDocument doc)
collect all appData reference strings in a vamsas document

Parameters:
doc -
Returns:
vector of String objects

searchAppDatas

public static java.util.Vector searchAppDatas(VamsasDocument doc,
                                              uk.ac.vamsas.objects.utils.AppDataReference.IAppDSearch test,
                                              boolean cascade)
General search through the set of AppData objects for a particular profile of Client and User handle.

Parameters:
doc -
test - interface implemented by the filter selecting particular AppDatas.
cascade - if true only User objects for ApplicationData objects that test.process returned true will be tested.
Returns:
set of uk.ac.vamsas.objects.core.AppData objects for which test.process returned true

equals

public static boolean equals(User p,
                             UserHandle u)

equals

public static boolean equals(ApplicationData p,
                             ClientHandle c)
returns true if Name matches in c and p, and Urn's match (or c.getUrn()==null) and Version's match (or c.getVersion()==null)

Parameters:
p -
c -
Returns:
match of p on template c.

getUserandApplicationsData

public static java.util.Vector getUserandApplicationsData(VamsasDocument doc,
                                                          UserHandle user,
                                                          ClientHandle app)
Searches document appData structure for particular combinations of client and user data

Parameters:
doc - the data
user - template user data to match against
app -
Returns:
set of matching client app datas for this client and user combination
See Also:
AppDataReference.equals(uk.ac.vamsas.objects.core.User, uk.ac.vamsas.client.UserHandle), AppDataReference.equals(uk.ac.vamsas.objects.core.ApplicationData, uk.ac.vamsas.client.ClientHandle)

uniqueAppDataReference

public static java.lang.String uniqueAppDataReference(VamsasDocument dest,
                                                      java.lang.String base)
safely creates a new appData reference

Parameters:
dest - destination document Vobject