KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > emb > MetaDataEntityLocalHome


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license. See terms of license at gnu.org.
5  */

6
7 package javax.emb;
8
9 import java.util.Collection;
10 import java.util.Map;
11
12 import javax.ejb.CreateException;
13 import javax.ejb.EJBLocalHome;
14 import javax.ejb.FinderException;
15
16 /**
17  * This interface defines the local home interface of metadata entity EJBs and
18  * therefore services relevant for local, persistent and mutable metadata
19  * objects. It extends javax.ejb.EJBLocalHome and defines additional methods
20  * with a semantic requiring the persistence of such metadata
21  *
22  * @version <tt>$Revision: 1.1 $</tt>
23  * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo
24  * Argüello</a>
25  */

26 public interface MetaDataEntityLocalHome extends EJBLocalHome
27 {
28    /**
29     * Creates a new metadata entity EJB with a generated identity key, null XML
30     * content and default values for the other properties. Please note many of
31     * the Metadata Entity EJB methods will throw exceptions until the XML
32     * content is set.
33     *
34     * @return metadata entity.
35     * @throws javax.ejb.CreateException if a problem related to EJB creation
36     * occurs.
37     * @throws MediaException
38     */

39    MetaDataEntityLocal create() throws CreateException, MediaException;
40
41    /**
42     * Returns the metadata entity with the given identity.
43     *
44     * @param identity.
45     * @return metadata entity.
46     * @throws java.lang.NullPointerException if the value passed is <code>null</code>.
47     * @throws javax.ejb.FinderException if no matching metadata entity is
48     * found.
49     */

50    MetaDataEntityLocal findByPrimaryKey(String identity)
51       throws FinderException;
52
53    /**
54     * Returns the metadata entities that match the given query. The query
55     * semantics are defined by the given query language in association with the
56     * optionally given query options. Note that the set of query languages and
57     * options supported is up to the implementation. Valid keys for the options
58     * map can be derived by calling <code>retrieveSupportedOptions()</code>.
59     * In case unsupported options are passed, implementations should ignore
60     * them.
61     *
62     * @param query
63     * @param queryLanguage
64     * @param options
65     * @return collection.
66     * @throws java.lang.NullPointerException if the query or query language
67     * passed is <code>null</code>.
68     * @throws java.lang.NullPointerException if the query or query language
69     * passed is null.
70     * @throws javax.emb.MalformedQueryException if the query statement does not
71     * match the syntax defined by the given query language.
72     * @throws javax.emb.UnsupportedQueryLanguageException if the specified
73     * query language is not supported by the implementation.
74     * @throws javax.emb.IllegalOptionException if the given options are not
75     * formatted properly and cannot be read or if one of the options is
76     * unsupported and cannot be processed.
77     * @throws javax.emb.MalformedQueryException if the query statement does not
78     * match the syntax defined by the given query language.
79     * @throws javax.emb.UnsupportedQueryLanguageException if the specified
80     * query language is not supported by the implementation.
81     * @throws javax.emb.IllegalOptionException if the given options are not
82     * formatted properly and cannot be read or if one of the options is
83     * unsupported and cannot be processed.
84     */

85    Collection query(String query, String queryLanguage, Map options)
86       throws FinderException, MediaException;
87
88    /**
89     * Returns an array containing the names of supported options for the given
90     * query language. If no query options are supported then an empty array is
91     * returned.
92     *
93     * @param queryLanguage
94     * @return @throws java.lang.NullPointerException if the value passed is
95     * <code>null</code>.
96     * @throws javax.emb.UnsupportedQueryLanguageException if the name of the
97     * query language passed is not supported by the implementation.
98     */

99    String[] retrieveSupportedOptions(String queryLanguage)
100       throws MediaException;
101
102    /**
103     * Returns an array containing the names of supported query languages. If no
104     * query languages are supported then an empty array is returned.
105     *
106     * @return @throws MediaException
107     */

108    String[] retrieveSupportedQueryLanguages() throws MediaException;
109 }
Popular Tags