Updating Rpc classes dependencies based on latest YANG tools version.

Change-Id: I2595a676132348aebb2175ffacfd9309c862b9ee
This commit is contained in:
Gaurav Agrawal 2017-05-11 19:04:52 +05:30 committed by Thomas Vachuska
parent 10396be4c2
commit 02dbee39b5
7 changed files with 10 additions and 263 deletions

View File

@ -20,6 +20,11 @@ import com.google.common.annotations.Beta;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.ResourceId;
import org.onosproject.event.ListenerService;
import org.onosproject.yang.model.RpcCaller;
import org.onosproject.yang.model.RpcCommand;
import org.onosproject.yang.model.RpcHandler;
import org.onosproject.yang.model.RpcInput;
import org.onosproject.yang.model.RpcOutput;
/**
* Service for storing and distributing dynamic configuration data.

View File

@ -1,33 +0,0 @@
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.config;
import com.google.common.annotations.Beta;
/**
* Service for entities that would invoke RPCs and receive RPC responses,
* through the Dynamic Config brokerage.
*/
@Beta
public interface RpcCaller {
/*
* Receives an RPC response.
*
* @param msgId of a previously invoked RPC
* @param output from the RPC execution
*/
void receiveResponse(Integer msgId, RpcOutput output);
}

View File

@ -1,53 +0,0 @@
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.config;
import com.google.common.annotations.Beta;
import org.onosproject.yang.model.ResourceId;
/**
* Abstract implementation of an RPC command.
*/
@Beta
public abstract class RpcCommand {
/**
* Identifier of an RPC command.
*/
ResourceId cmdId;
/**
* Creates an instance of RpcCommand.
*
* @param cmdId of RPC command
*/
public RpcCommand(ResourceId cmdId) {
this.cmdId = cmdId;
}
/**
* Returns the RPC command id.
*
* @return cmdId
*/
public ResourceId cmdId() {
return this.cmdId;
}
/**
* Executes the RPC command.
*
* @param input input data to the RPC command.
*/
public abstract void execute(RpcInput input);
}

View File

@ -1,34 +0,0 @@
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.config;
import com.google.common.annotations.Beta;
/**
* Service for entities that would execute RPC methods invoked through
* Dynamic Config RPC brokerage.
*/
@Beta
public interface RpcHandler {
/*
* Executes the RPC.
*
* @param msgId of the RPC message to be executed
* @param cmd to be executed
* @param input data to the RPC command
*/
void executeRpc(Integer msgId, RpcCommand cmd, RpcInput input);
}

View File

@ -1,56 +0,0 @@
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.config;
import com.google.common.annotations.Beta;
import org.onosproject.yang.model.DataNode;
/**
* Abstraction for RPC input.
*/
@Beta
public class RpcInput {
/**
* Input data to the RPC execution.
*/
DataNode input;
/**
* TODO
* Any other meta data or contextual information
* to help the RPC execution can be here.
* Examples: List<DataNodes> to provide multiple inputs
* Additional info for the broker, to choose a suitable executor
*/
/**
* Creates an instance of RpcInput.
*
* @param input to RPC execution
*/
public RpcInput(DataNode input) {
this.input = input;
}
/**
* Returns RPC input.
*
* @return DataNode
*/
public DataNode input() {
return this.input;
}
}

View File

@ -1,82 +0,0 @@
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.config;
import com.google.common.annotations.Beta;
import org.onosproject.yang.model.DataNode;
/**
* Abstraction for RPC output.
*/
@Beta
public class RpcOutput {
public enum Status {
/**
* RPC execution was successful.
*/
RPC_SUCCESS,
/**
* RPC execution failed.
*/
RPC_FAILURE,
/**
* RPC execution don't have any output data.
*/
RPC_NODATA,
/**
* Failed to receive a response from the receiver, within the broker specified timeout.
*/
RPC_TIMEOUT,
}
/**
* Status of RPC execution.
*/
Status status;
/**
* Output data from the RPC execution.
*/
DataNode output;
/**
* Creates an instance of RpcOutput.
*
* @param status of RPC execution
* @param output of RPC execution
*/
public RpcOutput(Status status, DataNode output) {
this.status = status;
this.output = output;
}
/**
* Returns RPC status.
*
* @return Status
*/
public RpcOutput.Status status() {
return this.status;
}
/**
* Returns RPC output.
*
* @return DataNode
*/
public DataNode output() {
return this.output;
}
}

View File

@ -29,11 +29,11 @@ import org.onosproject.config.DynamicConfigStore;
import org.onosproject.config.DynamicConfigStoreDelegate;
import org.onosproject.config.FailedException;
import org.onosproject.config.Filter;
import org.onosproject.config.RpcCaller;
import org.onosproject.config.RpcCommand;
import org.onosproject.config.RpcHandler;
import org.onosproject.config.RpcInput;
import org.onosproject.config.RpcOutput;
import org.onosproject.yang.model.RpcCaller;
import org.onosproject.yang.model.RpcCommand;
import org.onosproject.yang.model.RpcHandler;
import org.onosproject.yang.model.RpcInput;
import org.onosproject.yang.model.RpcOutput;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.ResourceId;
import org.onosproject.event.AbstractListenerManager;