2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org
.argeo
.slc
.server
.client
;
19 import java
.util
.List
;
22 import org
.argeo
.slc
.execution
.ExecutionModuleDescriptor
;
23 import org
.argeo
.slc
.msg
.ExecutionAnswer
;
24 import org
.argeo
.slc
.msg
.event
.SlcEvent
;
25 import org
.argeo
.slc
.process
.RealizedFlow
;
26 import org
.argeo
.slc
.process
.SlcExecution
;
27 import org
.argeo
.slc
.runtime
.SlcAgentDescriptor
;
28 import org
.argeo
.slc
.server
.HttpServices
;
30 /** Abstraction of the access to HTTP services of an SLC Server. */
31 public interface SlcServerHttpClient
extends HttpServicesClient
,HttpServices
{
32 /** Wait for the provided SlcExecution to be finished. */
33 public void waitForSlcExecutionFinished(SlcExecution slcExecution
,
36 /** Block until one of the registered event is finished. */
37 public SlcEvent
pollEvent(Long timeout
);
39 /** Register an event type. */
40 public ExecutionAnswer
addEventListener(String eventType
, String eventFilter
);
42 /** Unregister an event type. */
43 public ExecutionAnswer
removeEventListener(String eventType
,
46 /** Wait for one agent to be available. */
47 public SlcAgentDescriptor
waitForOneAgent();
49 /** Wait for the http server to be ready. */
50 public void waitForServerToBeReady();
52 /** Start an execution flow on the given agent. */
53 public SlcExecution
startFlow(String agentId
, RealizedFlow realizedFlow
);
55 /** Assume one agent and one version per module. */
56 public SlcExecution
startFlowDefault(String moduleName
, String flowName
,
57 Map
<String
, Object
> args
);
59 /** List execution modules descriptors. */
60 public List
<ExecutionModuleDescriptor
> listModuleDescriptors(String agentId
);
62 /** Retrieve a single execution module descriptor. */
63 public ExecutionModuleDescriptor
getModuleDescriptor(String agentId
,
64 String moduleName
, String version
);