1 /*------------------------------------------------------------------------------
  2 Name:      GetReturnKey.java
  3 Project:   xmlBlaster.org
  4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
  5 ------------------------------------------------------------------------------*/
  6 package org.xmlBlaster.client.key;
  7 
  8 import org.xmlBlaster.util.Global;
  9 import org.xmlBlaster.util.key.MsgKeyData;
 10 import org.xmlBlaster.util.XmlBlasterException;
 11 
 12 /**
 13  * Parses the key of returned MsgUnit of get() invocations
 14  * <p>
 15  * See MsgKeySaxFactory for a syntax description of the xml structure
 16  * </p>
 17  * @see org.xmlBlaster.util.key.MsgKeySaxFactory
 18  * @see <a href="http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.get.html" target="others">the interface.get requirement</a>
 19  */
 20 public class GetReturnKey
 21 {
 22    private final static String ME = "GetReturnKey";
 23    private final MsgKeyData msgKeyData;
 24 
 25    /**
 26     * Parse the given xml data. 
 27     */
 28    public GetReturnKey(Global glob, String xmlKey) throws XmlBlasterException {
 29       this.msgKeyData = glob.getMsgKeyFactory().readObject(xmlKey);
 30    }
 31 
 32    public MsgKeyData getData() {
 33       return this.msgKeyData;
 34    }
 35 
 36    /**
 37     * Access the &lt;key oid="...">.
 38     * @return The unique key oid
 39     */
 40    public String getOid() {
 41       return this.msgKeyData.getOid();
 42    }
 43 
 44    /**
 45     * Dead letters are unrecoverable lost messages, usually an administrator
 46     * should subscribe to those messages.
 47     */
 48    public boolean isDeadMessage() {
 49       return this.msgKeyData.isDeadMessage();
 50    }
 51 
 52    /**
 53     * Messages starting with "_" are reserved for usage in plugins
 54     */
 55    public final boolean isPluginInternal() {
 56       return this.msgKeyData.isPluginInternal();
 57    }
 58 
 59    /**
 60     * Messages starting with "__" are reserved for internal usage
 61     */
 62    public final boolean isInternal() {
 63       return this.msgKeyData.isInternal();
 64    }
 65 
 66    /**
 67     * A MIME type like "image/gif"
 68     */
 69    public String getContentMime() {
 70       return this.msgKeyData.getContentMime();
 71    }
 72 
 73    /**
 74     * For example a version number of the mime type
 75     */
 76    public String getContentMimeExtended() {
 77       return this.msgKeyData.getContentMimeExtended();
 78    }
 79 
 80    /**
 81     * Access the domain setting
 82     * @return A domain string or null
 83     */
 84    public String getDomain() {
 85       return this.msgKeyData.getDomain();
 86    }
 87 
 88    /**
 89     * Your specific application tags.
 90     */
 91    public String getClientTags() {
 92       return this.msgKeyData.getClientTags();
 93    }
 94 
 95    /**
 96     * Converts the data in XML ASCII string.
 97     * @return An XML ASCII string
 98     */
 99    public String toXml() {
100       return this.msgKeyData.toXml();
101    }
102 }


syntax highlighted by Code2HTML, v. 0.9.1