2 * Copyright (c) 2016 Cisco and/or its affiliates.
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 io.fd.vpp.jvpp;
19 import io.fd.vpp.jvpp.callback.JVppCallback;
20 import io.fd.vpp.jvpp.dto.ControlPing;
21 import io.fd.vpp.jvpp.dto.JVppRequest;
24 * Base interface for plugin's Java API.
26 public interface JVpp extends AutoCloseable {
29 * Sends request to vpp.
31 * @param request request to be sent
32 * @return unique identifer of message in message queue
33 * @throws VppInvocationException when message could not be sent
35 int send(final JVppRequest request) throws VppInvocationException;
38 * Initializes plugin's Java API.
40 * @param registry plugin registry
41 * @param callback called by vpe.api message handlers
42 * @param queueAddress address of vpp shared memory queue
43 * @param clientIndex vpp client identifier
45 void init(final JVppRegistry registry, final JVppCallback callback, final long queueAddress,
46 final int clientIndex);
49 * Sends control_ping message.
51 * @param controlPing request DTO
52 * @return unique identifer of message in message queue
53 * @throws VppInvocationException when message could not be sent
55 int controlPing(final ControlPing controlPing) throws VppInvocationException;