public class CiscoDNARestCollector extends Collector
collectorDescription, collectorName, collectorPort, dataStore, propsFileName, running| Constructor and Description |
|---|
CiscoDNARestCollector(java.lang.String collectorName,
java.lang.String collectorDescription)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addL2TopologicalConnection(L2Link links) |
void |
addL3TopologicalConnection(L3OSPFLink links) |
void |
addTopologicalConnection(L1Link links) |
boolean |
authenticate()
Authenticate to Cisco DNA while performing a Full Discovery operation
3 - Level Authentication to Cisco DNA
|
protected void |
collectData(int dataSourceId,
java.lang.String address,
java.lang.String mask)
This method is responsible for ensuring that data is updated as appropriate, that is, the Collector should check
the EMS for new data and update any internal stores as appropriate.
|
protected void |
doFullDiscovery(java.lang.String nodeId)
Performs a Full Discovery operation
|
protected java.util.List<InterfaceResponse> |
getAllInterfaces(java.lang.String deviceId,
java.lang.String BaseName,
int elementCount)
Performs a getAllInterfaces operation
|
protected java.util.List<VlanResponse> |
getAllVlans(java.lang.String deviceId,
java.lang.String BaseName,
int elementCount)
Performs a getAllVlans operation
|
protected java.util.List<Response> |
getDeviceList()
Performs a getDeviceList operation
|
static javax.xml.parsers.DocumentBuilderFactory |
getDocumentBuilder() |
protected void |
getL2TopologyDetails(java.util.List<VlanResponse> vList) |
protected java.util.List<L3OSPFLink> |
getL3OSPFTopology() |
protected java.util.List<ModuleResponse> |
getModule(java.lang.String deviceId,
java.lang.String BaseName,
int elementCount)
Performs a getModule operation
|
protected java.util.List<OSPFResponse> |
getOSPFInterfaces()
Performs a getOSPF operation
|
protected java.util.List<L1Link> |
getPhysicalTopology() |
protected void |
initDataStore()
Initializes data source as specified in the properties file
|
protected boolean |
initialise()
Initialize collector with data gather from properties file
|
protected boolean |
isGetEntities() |
protected boolean |
isGetLayer1Connections() |
protected boolean |
isGetLayer2Connections() |
protected boolean |
isGetLayer3Connections() |
void |
loadEquipmentNodeShelf(ModuleResponse processModuleList,
java.lang.String deviceId)
Load EquipmentNode class attributes into hashmap to be used for creating
entity
|
void |
loadEquipmentPort(InterfaceResponse processInterfaceList,
java.lang.String deviceId)
Load Equipment Port class attributes into hashmap to be used for creating
entity
|
static void |
main(java.lang.String[] args)
Runs the Cisco DNA rest collector
|
protected void |
parseL2Connection(java.util.List<L2Link> l2Link) |
java.util.List<NetworkDevice> |
parseNetworkDeviceData(java.util.List<Response> responseList) |
protected void |
processPhysicalInventoryData(java.util.List<Response> processResponseList)
Process data for Physical Inventory add the Entities/Interfaces to the
Datastore
|
java.util.List<InterfaceResponse> |
readInterfaceDataFromServer(java.lang.String BaseName)
Reads Interface data from server
|
java.util.List<L2Link> |
readL2DataFromServer(java.lang.String vlanName)
Reads L2 data from server
|
java.util.List<L3OSPFLink> |
readL3OSPFDataFromServer() |
java.util.List<ModuleResponse> |
readModuleDataFromServer(java.lang.String BaseName)
Reads Module data from server
|
java.util.List<Response> |
readNodeDataFromServer(int repetetions)
Reads node data from server
|
java.util.List<OSPFResponse> |
readOSPFDataFromServer()
Reads OSPF data from server
|
java.util.List<L1Link> |
readPhysicalLinkDataFromServer()
Reads L1 data from server
|
java.util.List<VlanResponse> |
readVlanDataFromServer(java.lang.String BaseName)
Reads VLAN data from server
|
protected boolean |
setConnectionParameters(WebSocketTransport webSocketTransport,
java.lang.String remoteUsername,
java.lang.String remotePassword,
java.lang.String remoteHost,
java.lang.Integer remotePort,
java.lang.String remotekeyStoreFileName,
java.lang.String remotekeyStorePassword,
java.lang.String remoteHTTPversion,
java.lang.String remoteResponseTimeout,
java.lang.Integer remoteRefreshInterval,
java.lang.Boolean remoteEnableSSL,
java.lang.String pathToKeyStoreFile,
java.lang.String TrustStorePath,
java.lang.String TrustStorePassword,
java.lang.String setProtocolValue,
int maxBufferSize)
Setting up websocket connection parameters for REST
|
protected void |
setGetEntities(java.lang.String getEntitiesFlag) |
protected void |
setGetLayer1Connections(java.lang.String getLayer1Connections) |
protected void |
setGetLayer2Connections(java.lang.String getLayer2Connections) |
protected void |
setGetLayer3Connections(java.lang.String getLayer3Connections) |
java.lang.String |
UpdateData(int dataSourceId,
int requestType,
java.lang.String address,
java.lang.String mask)
UpdateData invokes the collectData method which is responsible for ensuring
that data is updated as appropriate, that is, the Collector should check the
EMS for new data and update any internal stores as appropriate.
|
GetAfData, GetAmfData, GetAssociatedAddresses, GetAssociatedAddresses, GetAusfData, getCommandLineArgument, GetConnections, GetConnections, GetDeviceInfo, GetDeviceInfo, GetDeviceInfo, GetDeviceList, GetEirData, GetENodeBData, GetEntities, GetEntities, GetGNodeBData, GetHssData, GetInfo, GetInventory, GetInventory, GetLayer1Connections, GetLayer1Connections, GetLayer2Connections, GetLayer2Connections, GetLayer2Vpns, GetLayer2Vpns, GetLayer3Connections, GetLayer3Connections, GetLayer3Vpns, GetLayer3Vpns, GetMmeData, GetMplsInterfaces, GetMplsInterfaces, GetNefData, GetNrfData, GetNssfData, GetPcfData, GetPcrfData, GetPgwData, getPortNumberArgument, getPropertiesFileNameArgument, getPropertyValue, GetRanData, GetSAEGatewayData, GetSgwData, GetSmfData, GetUdmData, GetUpfData, initialiseDataStore, isRunning, loadPropertiesFile, setDataStore, setRunning, shutdown, startup, startuppublic CiscoDNARestCollector(java.lang.String collectorName,
java.lang.String collectorDescription)
collectorName - The name of the collectorcollectorDescription - A description of the collectorpublic static void main(java.lang.String[] args)
args - Command line arguments, e.g. -propsFile <props file name>public boolean authenticate()
None - protected boolean initialise()
protected void initDataStore()
protected boolean setConnectionParameters(WebSocketTransport webSocketTransport, java.lang.String remoteUsername, java.lang.String remotePassword, java.lang.String remoteHost, java.lang.Integer remotePort, java.lang.String remotekeyStoreFileName, java.lang.String remotekeyStorePassword, java.lang.String remoteHTTPversion, java.lang.String remoteResponseTimeout, java.lang.Integer remoteRefreshInterval, java.lang.Boolean remoteEnableSSL, java.lang.String pathToKeyStoreFile, java.lang.String TrustStorePath, java.lang.String TrustStorePassword, java.lang.String setProtocolValue, int maxBufferSize)
webSocketTransport - webSocketTransport classremoteUsername - Cisco DNA usernameremotePassword - Cisco DNA passwordremoteHost - Cisco DNA ip addressremoteServiceName - Cisco DNA Service NameremotePreUsername - Cisco DNA Presentation Server usernameremotePrePassword - Cisco DNA Presentation Server passwordremotePreHost - Cisco DNA Presentation Server ip addressremotePort - Cisco DNA portremotekeyStoreFileName - Cisco DNA usernameremotekeyStorePassword - keyStorePasswordremoteHTTPversion - HTTP versionremoteResponseTimeout - Response Timeout in secondssetRefreshInterval - Refresh Interval in secondsprotected void doFullDiscovery(java.lang.String nodeId)
throws java.io.IOException
nodeId - Node Id for Partial Discovery operation. When a non-zero value
is supplied, Partial Discovery is performed, else Full
Discovery is performed insteadjava.io.IOException - ,TolAttributeException,TolCommunicationExceptionpublic java.util.List<Response> readNodeDataFromServer(int repetetions)
public java.util.List<ModuleResponse> readModuleDataFromServer(java.lang.String BaseName)
public java.util.List<InterfaceResponse> readInterfaceDataFromServer(java.lang.String BaseName)
public java.util.List<VlanResponse> readVlanDataFromServer(java.lang.String BaseName)
public java.util.List<L2Link> readL2DataFromServer(java.lang.String vlanName)
public java.util.List<OSPFResponse> readOSPFDataFromServer()
public java.util.List<L1Link> readPhysicalLinkDataFromServer()
public java.util.List<L3OSPFLink> readL3OSPFDataFromServer()
protected java.util.List<Response> getDeviceList() throws java.io.IOException
None - It will get all the list of Elements from DNA. First it will
return the location of JSON file and next send the request to
download the JSON filejava.io.IOExceptionprotected java.util.List<ModuleResponse> getModule(java.lang.String deviceId, java.lang.String BaseName, int elementCount) throws java.io.IOException
None - It will get all the list of Module Links from DNA. First it
will return the location of JSON file and next send the request
to download the JSON filejava.io.IOExceptionprotected java.util.List<InterfaceResponse> getAllInterfaces(java.lang.String deviceId, java.lang.String BaseName, int elementCount) throws java.io.IOException
None - It will get all the list of Interface Links from DNA. First it
will return the location of JSON file and next send the request
to download the JSON filejava.io.IOExceptionprotected java.util.List<VlanResponse> getAllVlans(java.lang.String deviceId, java.lang.String BaseName, int elementCount) throws java.io.IOException
None - It will get all the list of VLAN Links from DNA. First it
will return the location of JSON file and next send the request
to download the JSON filejava.io.IOExceptionprotected void getL2TopologyDetails(java.util.List<VlanResponse> vList) throws java.io.IOException
java.io.IOExceptionprotected void parseL2Connection(java.util.List<L2Link> l2Link)
protected java.util.List<OSPFResponse> getOSPFInterfaces() throws java.io.IOException
None - It will get all the list of OSPF Links from DNA. First it
will return the location of JSON file and next send the request
to download the JSON filejava.io.IOExceptionprotected java.util.List<L1Link> getPhysicalTopology() throws java.io.IOException
java.io.IOExceptionprotected java.util.List<L3OSPFLink> getL3OSPFTopology() throws java.io.IOException
java.io.IOExceptionprotected void collectData(int dataSourceId,
java.lang.String address,
java.lang.String mask)
CollectorThis method is responsible for ensuring that data is updated as appropriate, that is, the Collector should check the EMS for new data and update any internal stores as appropriate.
collectData in class CollectordataSourceId - Holds the ID of the data source which should be updatedaddress - If mask is not defined then it holds the address (IP or native id) of the device to refresh, or else it holds the subnet to
refresh.mask - Holds the subnet mask, or is not definedpublic java.lang.String UpdateData(int dataSourceId,
int requestType,
java.lang.String address,
java.lang.String mask)
UpdateData invokes the collectData method which is responsible for ensuring that data is updated as appropriate, that is, the Collector should check the EMS for new data and update any internal stores as appropriate.
If the Collector does not need to update its data then it does not need to perform any work other than returning the response message "<updateResponse></updateResponse>".
Note: Is it the Collector's responsibility to determine which devices the supplied IP relates to; the IP is NOT guaranteed to be the device id.
UpdateData in class CollectordataSourceId - Holds the ID of the data source which should be updatedrequestType - The type of requestaddress - If mask is not defined then it holds the IP of the device
to refresh, or else it holds the subnet to refreshmask - Holds the subnet mask, or is not defined<updateResponse></updateResponse>protected void processPhysicalInventoryData(java.util.List<Response> processResponseList) throws java.io.IOException
processNodeList - List of nodesNetworkEquipment - NetworkEquipment List of Network Equipmentjava.io.IOExceptionpublic void addTopologicalConnection(L1Link links)
public void addL3TopologicalConnection(L3OSPFLink links)
public void addL2TopologicalConnection(L2Link links)
public void loadEquipmentNodeShelf(ModuleResponse processModuleList, java.lang.String deviceId)
EquipmentNode - List of items belong to EquipmentNodeneName - The ID of Network Elementpublic void loadEquipmentPort(InterfaceResponse processInterfaceList, java.lang.String deviceId)
processInterfaceList - List of items belong to InterfaceResponsedeviceId - public java.util.List<NetworkDevice> parseNetworkDeviceData(java.util.List<Response> responseList)
nodeList - protected boolean isGetEntities()
protected void setGetEntities(java.lang.String getEntitiesFlag)
getEntities - the getEntities to setprotected boolean isGetLayer1Connections()
protected void setGetLayer1Connections(java.lang.String getLayer1Connections)
getLayer1Connections - the getLayer1Connections to setprotected boolean isGetLayer2Connections()
protected void setGetLayer2Connections(java.lang.String getLayer2Connections)
getLayer2Connections - the getLayer2Connections to setprotected boolean isGetLayer3Connections()
protected void setGetLayer3Connections(java.lang.String getLayer3Connections)
getLayer3Connections - the getLayer3Connections to setpublic static javax.xml.parsers.DocumentBuilderFactory getDocumentBuilder()