View Javadoc
1   /**
2    * This Source Code Form is subject to the terms of the Mozilla Public
3    * License, v. 2.0. If a copy of the MPL was not distributed with this
4    * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5    *
6    * If it is not possible or desirable to put the notice in a particular
7    * file, then You may include the notice in a location (such as a LICENSE
8    * file in a relevant directory) where a recipient would be likely to look
9    * for such a notice.
10  
11   * 
12   */
13   
14  /*  ---------------------------------------------------------------------------
15   *  U.S. Government, Department of the Army
16   *  Army Materiel Command
17   *  Research Development Engineering Command
18   *  Communications Electronics Research Development and Engineering Center
19   *  ---------------------------------------------------------------------------
20   */
21  
22  package org.miloss.fgsms.plugins.federation;
23  
24  import java.util.List;
25  import java.util.concurrent.atomic.AtomicReference;
26  import org.miloss.fgsms.plugins.PluginCommon;
27  import org.miloss.fgsms.services.interfaces.common.NameValuePair;
28  import org.miloss.fgsms.services.interfaces.dataaccessservice.QuickStatWrapper;
29  import org.miloss.fgsms.services.interfaces.policyconfiguration.FederationPolicy;
30  import org.miloss.fgsms.services.interfaces.policyconfiguration.ServicePolicy;
31  
32  /**
33   * Implementors provide the ability to publish summarized data from fgsms to
34   * an external system on a periodic basis. Non periodic federation publishers
35   * (such as a web service MUST also implement this interface. In this case, the
36   * Publish method does nothing. Constructor functions should be non blocking.
37   *
38   * @author AO
39   */
40  public interface FederationInterface extends PluginCommon {
41  
42      /**
43       * This is called by both the user interface as well as whenever someone
44       * attempts to add or change a service policy containing this federation
45       * target.
46       *
47       * @param fp the proposed federation policy
48       * @param outMessage returns the error message, if any. Null or empty string
49       * can be returned if there is no error. The message should be a human
50       * readable reason for why the policy is invalid or misconfigured.
51       * @return True if the configuration is valid, false otherwise
52       */
53      public boolean ValidateConfiguration(FederationPolicy fp, AtomicReference<String> outMessage);
54  
55      /**
56       * Called by a Quartz timer job
57       *
58       * @param pooled indicates where or not we are using pooled database
59       * connections
60       * @param data represents the last known data set for a web service,
61       * availability info for all policy types
62       * @param sp the complete service policy of the thing we are publishing
63       * @param fp the federation policy, which should allow users to dictate
64       * implementation specific parameters and settings
65       * @see org.miloss.fgsms.common.Utility.GetConfigurationDBConnection
66       */
67      public void Publish(boolean pooled, QuickStatWrapper data, ServicePolicy sp, FederationPolicy fp);
68  
69      
70  }