public class NetconfSessionImpl extends Object implements NetconfSession
| Modifier and Type | Class and Description |
|---|---|
class |
NetconfSessionImpl.NetconfSessionDelegateImpl |
| Constructor and Description |
|---|
NetconfSessionImpl(NetconfDeviceInfo deviceInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeviceOutputListener(NetconfDeviceOutputEventListener listener)
Remove a listener from the underlying stream handler implementation.
|
boolean |
close()
Closes the Netconf session with the device.
|
boolean |
copyConfig(String targetConfiguration,
String newConfiguration)
Copies the new configuration, an Url or a complete configuration xml tree
to the target configuration.
|
boolean |
deleteConfig(String targetConfiguration)
Deletes part of the specified configuration based on the filterSchema.
|
String |
doWrappedRpc(String request)
Executes an synchronous RPC to the server and wrap the request in RPC header.
|
boolean |
editConfig(String newConfiguration)
Retrives part of the specified configuration based on the filterSchema.
|
boolean |
editConfig(String targetConfiguration,
String mode,
String newConfiguration)
Retrives part of the specified configuration based on the filterSchema.
|
void |
endSubscription()
Ends subscription to the device's notifications.
|
String |
get(String request)
Retrives the requested configuration, different from get-config.
|
String |
get(String filterSchema,
String withDefaultsMode)
Retrives the requested data.
|
String |
getConfig(String targetConfiguration)
Retrives the specified configuration.
|
String |
getConfig(String targetConfiguration,
String configurationSchema)
Retrives part of the specivied configuration based on the filterSchema.
|
String |
getServerCapabilities()
Gets the capabilities of the Netconf server associated to this session.
|
String |
getSessionId()
Gets the session ID of the Netconf session.
|
boolean |
lock()
Locks the running configuration.
|
boolean |
lock(String configType)
Locks the specified configuration.
|
void |
removeDeviceOutputListener(NetconfDeviceOutputEventListener listener)
Remove a listener from the underlying stream handler implementation.
|
CompletableFuture<String> |
request(String request)
Executes an asynchronous RPC to the server and obtains a future to be completed.
|
String |
requestSync(String request)
Executes an synchronous RPC to the server.
|
void |
setDeviceCapabilities(List<String> capabilities)
Sets the ONOS side capabilities.
|
void |
startSubscription()
Starts subscription to the device's notifications.
|
void |
startSubscription(String filterSchema)
Starts subscription to the device's notifications.
|
boolean |
unlock()
Unlocks the running configuration.
|
boolean |
unlock(String configType)
Unlocks the specified configuration.
|
public NetconfSessionImpl(NetconfDeviceInfo deviceInfo) throws NetconfException
NetconfExceptionpublic void startSubscription()
throws NetconfException
NetconfSessionstartSubscription in interface NetconfSessionNetconfException - when there is a problem starting the subscription@Beta public void startSubscription(String filterSchema) throws NetconfException
NetconfSessionstartSubscription in interface NetconfSessionfilterSchema - XML subtrees to indicate specific notificationNetconfException - when there is a problem starting the subscriptionpublic void endSubscription()
throws NetconfException
NetconfSessionendSubscription in interface NetconfSessionNetconfException - when there is a problem ending the subscriptionpublic String requestSync(String request) throws NetconfException
NetconfSessionrequestSync in interface NetconfSessionrequest - the XML containing the RPC for the server.NetconfException - when there is a problem in the communication process on
the underlying connectionpublic CompletableFuture<String> request(String request)
NetconfSessionrequest in interface NetconfSessionrequest - the XML containing the RPC for the server.public String doWrappedRpc(String request) throws NetconfException
NetconfSessiondoWrappedRpc in interface NetconfSessionrequest - the XML containing the request to the server.NetconfException - when there is a problem in the communication process on
the underlying connectionpublic String get(String request) throws NetconfException
NetconfSessionget in interface NetconfSessionrequest - the XML containing the request to the server.NetconfException - when there is a problem in the communication process on
the underlying connectionpublic String get(String filterSchema, String withDefaultsMode) throws NetconfException
NetconfSessionget in interface NetconfSessionfilterSchema - XML subtrees to include in the replywithDefaultsMode - with-defaults modeNetconfException - when there is a problem in the communication process on
the underlying connectionpublic String getConfig(String targetConfiguration) throws NetconfException
NetconfSessiongetConfig in interface NetconfSessiontargetConfiguration - the type of configuration to retrieve.NetconfException - when there is a problem in the communication process on
the underlying connectionpublic String getConfig(String targetConfiguration, String configurationSchema) throws NetconfException
NetconfSessiongetConfig in interface NetconfSessiontargetConfiguration - the type of configuration to retrieve.configurationSchema - XML schema to filter the configuration
elements we are interested inNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean editConfig(String newConfiguration) throws NetconfException
NetconfSessioneditConfig in interface NetconfSessionnewConfiguration - configuration to setNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean editConfig(String targetConfiguration, String mode, String newConfiguration) throws NetconfException
NetconfSessioneditConfig in interface NetconfSessiontargetConfiguration - the targetConfiguration to changemode - selected mode to change the configurationnewConfiguration - configuration to setNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean copyConfig(String targetConfiguration, String newConfiguration) throws NetconfException
NetconfSessioncopyConfig in interface NetconfSessiontargetConfiguration - the type of configuration to retrieve.newConfiguration - configuration to setNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean deleteConfig(String targetConfiguration) throws NetconfException
NetconfSessiondeleteConfig in interface NetconfSessiontargetConfiguration - the name of the configuration to deleteNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean lock(String configType) throws NetconfException
NetconfSessionlock in interface NetconfSessionconfigType - type of configuration to be lockedNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean unlock(String configType) throws NetconfException
NetconfSessionunlock in interface NetconfSessionconfigType - type of configuration to be lockedNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean lock()
throws NetconfException
NetconfSessionlock in interface NetconfSessionNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean unlock()
throws NetconfException
NetconfSessionunlock in interface NetconfSessionNetconfException - when there is a problem in the communication process on
the underlying connectionpublic boolean close()
throws NetconfException
NetconfSessionclose in interface NetconfSessionNetconfException - when there is a problem in the communication process on
the underlying connectionpublic String getSessionId()
NetconfSessiongetSessionId in interface NetconfSessionpublic String getServerCapabilities()
NetconfSessiongetServerCapabilities in interface NetconfSessionpublic void setDeviceCapabilities(List<String> capabilities)
NetconfSessionsetDeviceCapabilities in interface NetconfSessioncapabilities - list of capabilities the device has.public void addDeviceOutputListener(NetconfDeviceOutputEventListener listener)
NetconfSessionaddDeviceOutputListener in interface NetconfSessionlistener - event listener.public void removeDeviceOutputListener(NetconfDeviceOutputEventListener listener)
NetconfSessionremoveDeviceOutputListener in interface NetconfSessionlistener - event listener.