blob: c72784c23e3325a84e198faa239459b49c85dcf1 [file] [log] [blame]
Christian van Spaandonk63814412008-08-02 09:56:01 +00001/*
Richard S. Hall8df9ab12009-07-24 17:06:37 +00002 * Copyright (c) OSGi Alliance (2004, 2008). All Rights Reserved.
Christian van Spaandonk63814412008-08-02 09:56:01 +00003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package info.dmtree.spi;
17
18import info.dmtree.DmtException;
19import info.dmtree.DmtSession;
20
21/**
22 * An implementation of this interface takes the responsibility of handling node
23 * execute requests requests in a subtree of the DMT.
24 * <p>
25 * In an OSGi environment such implementations should be registered at the OSGi
26 * service registry specifying the list of root node URIs in a
27 * <code>String</code> array in the <code>execRootURIs</code> registration
28 * parameter.
Richard S. Hall8df9ab12009-07-24 17:06:37 +000029 *
30 * @version $Revision: 5673 $
Christian van Spaandonk63814412008-08-02 09:56:01 +000031 */
32public interface ExecPlugin {
33
34 /**
35 * Execute the given node with the given data. This operation corresponds to
36 * the EXEC command in OMA DM.
37 * <p>
38 * The semantics of an execute operation and the data parameter it takes
39 * depends on the definition of the managed object on which the command is
40 * issued. Session information is given as it is needed for sending alerts
41 * back from the plugin. If a correlation ID is specified, it should be used
42 * as the <code>correlator</code> parameter for alerts sent in response to
43 * this execute operation.
44 * <p>
45 * The <code>nodePath</code> parameter contains an array of path segments
46 * identifying the node to be executed in the subtree of this plugin. This
47 * is an absolute path, so the first segment is always &quot;.&quot;.
48 * Special characters appear escaped in the segments.
49 *
50 * @param session a reference to the session in which the operation was
51 * issued, must not be <code>null</code>
52 * @param nodePath the absolute path of the node to be executed, must not be
53 * <code>null</code>
54 * @param correlator an identifier to associate this operation with any
55 * alerts sent in response to it, can be <code>null</code>
56 * @param data the parameter of the execute operation, can be
57 * <code>null</code>
58 * @throws DmtException with the following possible error codes:
59 * <ul>
60 * <li><code>NODE_NOT_FOUND</code> if the node does not exist and
61 * the plugin does not allow executing unexisting nodes
62 * <li><code>METADATA_MISMATCH</code> if the command failed
63 * because of meta-data restrictions
64 * <li><code>DATA_STORE_FAILURE</code> if an error occurred while
65 * accessing the data store
66 * <li><code>COMMAND_FAILED</code> if some unspecified error is
67 * encountered while attempting to complete the command
68 * </ul>
69 * @see DmtSession#execute(String, String)
70 * @see DmtSession#execute(String, String, String)
71 */
72 void execute(DmtSession session, String[] nodePath, String correlator,
73 String data) throws DmtException;
74}