org.openeai.moa.jmsobjects
Interface JmsEnterpriseObject
- All Known Implementing Classes:
- JmsEnterpriseObjectBase
- public interface JmsEnterpriseObject
This is the ancestor of all "message aware" enterprise objects.
This is where the functionality for querying, creating, updating and deleting
is. This is a specific layer used for producing requests and consuming the
replies via JMS. It is also the layer which produces sync messages.
Clients use this layer when they call the "message actions" on a given
message aware Enterprise Object.
For example, when a client makes a call
to BasicPerson.update(), this is the layer performing that function.
In some cases, some of the methods used to generate the XML associated with
a given message will be re-implemented by a lower class (like InstitutionalId.generate())
This will only be necessary when that lower class doesn't use the same
information in its message (the DataArea portion is different).
- Version:
- 3.0 beta2 - 28 January 2003
- Author:
- Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
query
public java.util.List query(XmlEnterpriseObject keyObject,
PointToPointProducer producer)
throws EnterpriseObjectQueryException
- Query message production. Builds an XML document (using the primed query document
as a "template") out of the current contents of the keyObject passed in.
While building the XML Query message, it will validate contents of the keyObject checking
for any malformed, missing or invalid fields. Field data values are also
checked for validitity against the EnterpriseObjects document. Uses the
producer passed in to send the XML document as a JMS request to the queue
connected to by the producer which then processes the response checking
for any errors in the response.
- Returns:
- java.util.List this is a list of XmlEnterpriseObject objects
(like BasicPerson, BasicEmployee etc.) provided by the authoritative source
(the application consuming the query request).
- Throws:
EnterpriseObjectQueryException - if any errors occur when validating
the contents of the object, if any errors occur while producing the request
or if the object doesn't support the create action. This exception will also
be thrown if the contents of the reply document contains an error. That is, if
the consuming application had errors processing the request. This exception will
include the Result information containing the error that occurred.
create
public XmlEnterpriseObject create(PointToPointProducer producer)
throws EnterpriseObjectCreateException
- Create message production. Builds an XML document (using the primed create document
as a "template") out of the current contents of the object. While building the
XML Create document, it will validate contents of the object checking
for any malformed, missing or invalid fields. Field data values are also
checked for validitity against the EnterpriseObjects document. Uses the
producer passed in to send the XML document as a JMS request to the queue
connected to by the producer which then processes the response checking
for any errors in the response.
- Returns:
- XmlEnterpriseObject a generic response
which will indicate success or failure. If failure, any error information will
be included in that result. The object returned is actually a
org.openeai.moa.objects.Result object.
- Throws:
EnterpriseObjectCreateException - if any errors occur when validating
the contents of the object, if any errors occur while producing the request
or if the object doesn't support the create action. This exception will also
be thrown if the contents of the reply document contains an error. That is, if
the consuming application had errors processing the request. This exception will
include the Result information containing the error that occurred.
createSync
public void createSync(PubSubProducer producer)
throws EnterpriseObjectSyncException
- Create Sync message production. Builds an XML document (using the primed
create sync document as a baseline) out of the current contents of the object.
While building the XML Create Sync document, it will validate contents of
the object checking for any malformed, missing or invalid fields.
Field data values are also checked for validitity against the
EnterpriseObjects document. Publishes the XML document in a JMS message
to the topic connected to by producer.
- Parameters:
producer - org.openeai.jms.producer.PubSubProducer to
use to publish the message.
- Throws:
EnterpriseObjectSyncException - if any errors occur when validating
the contents of the object. Or, if any errors occur while publishing the message.
delete
public XmlEnterpriseObject delete(java.lang.String deleteAction,
PointToPointProducer producer)
throws EnterpriseObjectDeleteException
- Delete message production. Builds an XML document (using the primed delete document
as a "template") out of the current contents of the object. While building the
XML Delete document, it will validate contents of the object checking
for any malformed, missing or invalid fields. Field data values are also
checked for validitity against the EnterpriseObjects document. Uses the
producer passed in to send the XML document as a JMS request to the queue
connected to by the producer which then processes the response checking
for any errors in the response.
- Returns:
- XmlEnterpriseObject a generic response
which will indicate success or failure. If failure, any error information will
be included in that result. The object returned is actually a
org.openeai.moa.objects.Result object.
- Throws:
EnterpriseObjectDeleteException - if any errors occur when validating
the contents of the object, if any errors occur while producing the request
or if the object doesn't support the create action. This exception will also
be thrown if the contents of the reply document contains an error. That is, if
the consuming application had errors processing the request. This exception will
include the Result information containing the error that occurred.
deleteSync
public void deleteSync(java.lang.String deleteAction,
PubSubProducer producer)
throws EnterpriseObjectSyncException
- Delete Sync message production. Builds an XML document (using the primed
delete sync document as a baseline) out of the current contents of the object.
While building the XML Delete Sync document, it will validate contents of
the object checking for any malformed, missing or invalid fields.
Field data values are also checked for validitity against the
EnterpriseObjects document. Publishes the XML document in a JMS message
to the topic connected to by producer.
- Throws:
EnterpriseObjectSyncException - if any errors occur when validating
the contents of the object. Or, if any errors occur while publishing the message.
generate
public java.util.List generate(XmlEnterpriseObject keyObject,
PointToPointProducer producer)
throws EnterpriseObjectGenerateException
- Generate message production. Builds an XML document (using the primed generate document
as a "template") out of the current contents of the object. While building the
XML Generate document, it will validate contents of the object checking
for any malformed, missing or invalid fields. Field data values are also
checked for validitity against the EnterpriseObjects document. Uses the
producer passed in to send the XML document as a JMS request to the queue
connected to by the producer which then processes the response checking
for any errors in the response.
- Returns:
- java.util.List this is a list of XmlEnterpriseObject objects generated by the authoritative source
(the application consuming the request to generate). Typically, this will
be only one object (like an InstitutionalIdentity).
- Throws:
EnterpriseObjectGenerateException - if any errors occur when validating
the contents of the object, if any errors occur while producing the request
or if the object doesn't support the create action. This exception will also
be thrown if the contents of the reply document contains an error. That is, if
the consuming application had errors processing the request. This exception will
include the Result information containing the error that occurred.
generateSync
public void generateSync(PubSubProducer producer,
XmlEnterpriseObject keyObject)
throws EnterpriseObjectSyncException
- Generate Sync message production. Builds an XML document (using the primed
generate sync document as a "template") out of the current contents of the object.
While building the XML generate Sync document, it will validate contents of
the object checking for any malformed, missing or invalid fields.
Field data values are also checked for validitity against the
EnterpriseObjects document. Publishes the XML document in a JMS message
to the topic connected to by producer.
- Throws:
EnterpriseObjectSyncException - if any errors occur when validating
the contents of the object. Or, if any errors occur while publishing the message.
update
public XmlEnterpriseObject update(PointToPointProducer producer)
throws EnterpriseObjectUpdateException
- Update message production. Builds an XML document (using the primed update document
as a "template") out of the current contents of the object (this). It will use the
current contents of the object as the NewData portion of the message and it will
use this object's "baseline" object as the Baseline portion of the message. The "baseline"
object is set when this object was "queried" for previously.
While building the XML Update message, it will validate contents checking
for any malformed, missing or invalid fields. Field data values are also
checked for validitity against the EnterpriseObjects document. Uses the
producer passed in to send the XML document as a JMS request to the queue
connected to by the producer which then processes the response checking
for any errors in the response.
- Returns:
- XmlEnterpriseObject (Result) this will indicate the success or failure
of the Update request. In an error condition, this will include any error
information.
- Throws:
EnterpriseObjectUpdateException - if any errors occur when validating
the contents of the object, if any errors occur while producing the request
or if the object doesn't support the create action. This exception will also
be thrown if the contents of the reply document contains an error. That is, if
the consuming application had errors processing the request. This exception will
include the Result information containing the error that occurred.
updateSync
public void updateSync(PubSubProducer producer)
throws EnterpriseObjectSyncException
- Update Sync message production. Builds an XML document (using the primed
update sync document as a "template") out of the current contents of the object.
It will use the current contents of the object as the NewData portion of the message and it will
use the m_baseline object as the Baseline portion of the message. The m_baseline
object is set when this object was "queried" for previously.
While building the XML Update Sync document, it will validate contents of
the object checking for any malformed, missing or invalid fields.
Field data values are also checked for validitity against the
EnterpriseObjects document. Publishes the XML document in a JMS message
to the topic connected to by producer.
- Throws:
EnterpriseObjectSyncException - if any errors occur when validating
the contents of the object. Or, if any errors occur while publishing the message.
getCommandName
public java.lang.String getCommandName()
- Returns the Command name associated with this object. This is a
core part of all messages (a property on the JMS message) and no message can be produced
if either this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The Command Name
is set based on contents of the MessagingEnterprise XML document which is used to initialize all
message objects. No client application should ever need to call this method
directly. This is information that will be used by a consumer of the message
to determine which "command" to execute when it receives the message. For more information
on Commands and the University JMS Consumer framework refer to the JavaDoc for the
org.openeai.jms.consumer package.
- Returns:
- String message name associated with this object.
setCommandName
public void setCommandName(java.lang.String name)
- Sets the Command name associated with this object. This is a
core part of all messages (a property on the JMS message) and no message can be produced
if this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The Command Name
is set based on contents of the application Deployment configuration document which is used to initialize all
message objects. No client application should ever need to call this method
directly. This is information that will be used by a consumer of the message
to determine which "command" to execute when it receives the message. For more information
on Commands and the University JMS Consumer framework refer to the JavaDoc for the
org.openeai.jms.consumer package.
getAuthentication
public Authentication getAuthentication()
- Returns the Authentication object associated with this object. This is a
core part of all messages (in the ControlArea) and no message can be produced
if this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The
information contained in the Authentication object is set based on contents
of the MessagingEnterprise XML document which is used to initialize all
message objects. No client application should ever need to call this method
directly.
- Returns:
- Authentication the authentication object associated with this object.
setAuthentication
public void setAuthentication(Authentication auth)
- Sets the Authentication object associated with this object. This is a
core part of all messages (in the ControlArea) and no message can be produced
if this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The
information contained in the Authentication object is set based on contents
of the MessagingEnterprise XML document which is used to initialize all
message objects. No client application should ever need to call this method
directly.
getMessageId
public MessageId getMessageId()
- Returns the MessageId object associated with this object. This is a
core part of all messages (in the ControlArea) and no message can be produced
if this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The
information contained in the MessageId object is set based on contents
of the MessagingEnterprise XML document which is used to initialize all
message objects. No client application should ever need to call this method
directly.
- Returns:
- MessageId the MessageId object associated with this object.
setMessageId
public void setMessageId(MessageId msgId)
- Sets the MessageId object associated with this object. This is a
core part of all messages (in the ControlArea) and no message can be produced
if this hasn't been set. However, this gets set when the Message Object is
initialized via the init method and the MessageObjectConfig object. The
information contained in the MessageId object is set based on contents
of the MessagingEnterprise XML document which is used to initialize all
message objects. No client application should ever need to call this method
directly.
getXmlEnterpriseObject
public XmlEnterpriseObject getXmlEnterpriseObject()
- Helper method that returns this object as an XmlEnterpriseObject.
- Returns:
- org.openeai.moa.XmlEnterpriseObject. This object cast to an XmlEnterpriseObject.
getLastErrors
public java.util.List getLastErrors()
- Returns a List containing the last errors encountered by this object during
a Request action (create, query, generate, update, delete). When an error
occurs during one of those actions, an exception is thrown. Therefore, the
calling application doesn't have access to the errror objects in the result.
This convenience method gives them access to those Error objects so they
may use them accordingly in their application instead of having to parse
the exception message etc.
- Returns:
- java.util.List the list of errors that were saved the last time this
object had an error performing a request action.
Copyright © 2002, OpenEAI Software Foundation