View Javadoc
1   /**
2    * Copyright 2014-2024 Bloomreach B.V. (<a href="https://www.bloomreach.com">https://www.bloomreach.com</a>)
3    *
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    *         <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>
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   */
16  package org.onehippo.forge.exdocpicker.api;
17  
18  import java.io.Serializable;
19  import java.util.Set;
20  
21  import org.apache.wicket.util.io.IClusterable;
22  import org.hippoecm.frontend.model.JcrNodeModel;
23  import org.hippoecm.frontend.plugin.IPlugin;
24  import org.hippoecm.frontend.plugin.IPluginContext;
25  import org.hippoecm.frontend.plugin.config.IPluginConfig;
26  
27  /**
28   * The service invocation context which is supposed to be used by the service implementations.
29   */
30  public interface ExternalDocumentServiceContext extends IClusterable {
31  
32      /**
33       * Returns the plugin instance.
34       * @return IPlugin instance
35       */
36      IPlugin getPlugin();
37  
38      /**
39       * Returns the plugin config instance.
40       * @return IPluginConfig instance
41       */
42      IPluginConfig getPluginConfig();
43  
44      /**
45       * Returns the plugin context instance.
46       * @return IPluginContext instance
47       */
48      IPluginContext getPluginContext();
49  
50      /**
51       * Returns the context document object which is being used by the user when the invocation is made.
52       * @return context model
53       */
54      JcrNodeModel getContextModel();
55  
56      /**
57       * Set an attribute.
58       *
59       * @param name attribute name
60       * @param value serializable attribute value
61       */
62      void setAttribute(String name, Serializable value);
63  
64      /**
65       * Retrieve the attribute value by the attribute name.
66       * @param name attribute name
67       * @return attribute value
68       */
69      Serializable getAttribute(String name);
70  
71      /**
72       * Removes the attribute by the attribute name.
73       * @param name attribute name
74       */
75      void removeAttribute(String name);
76  
77      /**
78       * Enumerates the attribute names
79       * @return attribute names set
80       */
81      Set<String> getAttributeNames();
82  
83  }