|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.shared.data.MobyContentInstance
public class MobyContentInstance
This class represents the data package sent back and forth between clients and servers. Currently, this corresponds to the "mobyContent" element and children in the MOBY API. It holds a named collection of data groups, which could correspond to either queries or responses depending on its use. It contains also two ancillary pieces of information populated by service providers: the service notes (generally, human readable text describing the service), and the authority URI (points to more info about the service). This class implements MobyDataInstance because it does have an XML representation of MOBY instance data, but using it in CENTRAL_XML_MODE does not currently have a solidly defined behaviour (what if it's a mixed bag of different data?). The Map interface is implemented to make it easier to fetch, enumerate, and merge content objects and their subgroups.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
MobyContentInstance()
Creates a blank MOBY envelope, to be filled in programatically with data instances. |
|
MobyContentInstance(Element objectTag)
Builds a MobyContentInstance (i.e. one or more MOBY queries or responses) using a DOM-parsed XML MOBY envelope (i.e. the mobyContent tag). |
|
MobyContentInstance(Element objectTag,
Registry registry)
|
|
MobyContentInstance(MobyDataInstance mdi,
String paramName)
A convenience constructor when you want to create an envelope with just one object in it. |
Method Summary | |
---|---|
void |
addException(ServiceException me)
Adds a new exception to the list of exceptions associated with the content |
void |
clear()
Effectively deletes the contents, leaving you with a data-less container. |
boolean |
containsKey(Object fieldName)
To check for the presence of a data group with a given name |
boolean |
containsValue(Object value)
To check for the presence of a data group as one of the members |
Set<Map.Entry<String,MobyDataJob>> |
entrySet()
Retrieves each name/data group pair for the members of content. |
boolean |
equals(Object o)
Returns true if and only if both query sets have the same queries with the same values |
MobyDataJob |
get(Object fieldName)
Retrieves a member (AbstractMap |
ServiceException[] |
getExceptions()
|
String |
getServiceAuthorityURI()
|
String |
getServiceNotes()
|
int |
getXmlMode()
Report whether toXML will produce Central template or service call instance XML. |
boolean |
hasExceptions()
Indicates whether the moby content has any exception (according to the style of MOBY-S RFC 1863) |
boolean |
hasExceptions(int severity)
Indicates whether the moby content has any exception of the given severity or worse (according to the style of MOBY-S RFC 1863). |
int |
hashCode()
|
boolean |
isEmpty()
Is this a blank, uninstantiated object? |
Set<String> |
keySet()
Retrieves a list of the query names in this object. |
void |
parseDataGroup(Element dataGroupTag,
Registry registry)
|
void |
put(MobyDataJob value)
same as put(String, MobyDataJob), but the queryID will be automatically generated for this value |
MobyDataJob |
put(String queryID,
MobyDataJob value)
|
void |
putAll(Map<? extends String,? extends MobyDataJob> map)
Sets a number of queries at once. |
MobyDataJob |
remove(Object fieldName)
Removes the query with the given name, if present |
MobyDataObjectSet |
retrieveObjects()
This is a convenience method that allows the user extract all Objects from all content job subgroups (simples and collections) into a single Collection, removing duplicates. |
static void |
setDebugMode(boolean mode)
|
static void |
setDebugPrintStream(PrintStream ps)
Standard error is used unless this method is called. |
void |
setExceptions(ServiceException[] mes)
Sets the exception list for the content en masse, replacing any current values |
void |
setServiceAuthorityURI(String uri)
|
void |
setServiceNotes(String notes)
Note this is only the human readable notes. |
void |
setXmlMode(int mode)
|
int |
size()
Reports the number of queries |
String |
toString()
|
String |
toXML()
|
Collection<MobyDataJob> |
values()
Returns all of the queries |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MobyContentInstance()
public MobyContentInstance(MobyDataInstance mdi, String paramName) throws MobyException
MobyException
- if the passed in object is not a MobyDataObject or a MobyDataObjectSet or null (an empty data group)public MobyContentInstance(Element objectTag) throws MobyException
MobyException
public MobyContentInstance(Element objectTag, Registry registry) throws MobyException
MobyException
Method Detail |
---|
public static void setDebugMode(boolean mode)
mode
- if true, debugging information is printed to the stream returned by getDebugOutputStreampublic static void setDebugPrintStream(PrintStream ps) throws IllegalArgumentException
ps
- the OutputStream to which debugging information is sent.
IllegalArgumentException
- if the stream is nullpublic void parseDataGroup(Element dataGroupTag, Registry registry) throws MobyException
MobyException
public MobyDataObjectSet retrieveObjects()
public String getServiceAuthorityURI()
public void setServiceAuthorityURI(String uri)
public String getServiceNotes()
public void setServiceNotes(String notes)
notes
- the human readable message (e.g. citation) to associate with these resultspublic void setExceptions(ServiceException[] mes)
mes
- the exceptions to associate with the content, or null to remove any existing exceptionspublic void addException(ServiceException me)
public ServiceException[] getExceptions()
public boolean hasExceptions()
public boolean hasExceptions(int severity)
severity
- the minimum severity of exception (info < warning < error) to report
public void setXmlMode(int mode) throws IllegalArgumentException
IllegalArgumentException
public int getXmlMode()
public String toString()
toString
in class Object
public String toXML()
public void clear()
clear
in interface Map<String,MobyDataJob>
public boolean containsKey(Object fieldName)
containsKey
in interface Map<String,MobyDataJob>
public boolean containsValue(Object value)
containsValue
in interface Map<String,MobyDataJob>
public Set<Map.Entry<String,MobyDataJob>> entrySet()
entrySet
in interface Map<String,MobyDataJob>
public boolean equals(Object o)
equals
in interface Map<String,MobyDataJob>
equals
in class Object
public MobyDataJob get(Object fieldName)
get
in interface Map<String,MobyDataJob>
public int hashCode()
hashCode
in interface Map<String,MobyDataJob>
hashCode
in class Object
public boolean isEmpty()
isEmpty
in interface Map<String,MobyDataJob>
public Set<String> keySet()
keySet
in interface Map<String,MobyDataJob>
public MobyDataJob put(String queryID, MobyDataJob value)
put
in interface Map<String,MobyDataJob>
queryID
- a unique ID for the query. If null, or not a String, or blank it will be auto-generatedvalue
- an AbstractMap of public void put(MobyDataJob value)
public void putAll(Map<? extends String,? extends MobyDataJob> map)
putAll
in interface Map<String,MobyDataJob>
public MobyDataJob remove(Object fieldName)
remove
in interface Map<String,MobyDataJob>
public int size()
size
in interface Map<String,MobyDataJob>
public Collection<MobyDataJob> values()
values
in interface Map<String,MobyDataJob>
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |