Package org.onosproject.net.key
Class DeviceKey
- java.lang.Object
- 
- org.onosproject.net.AbstractAnnotated
- 
- org.onosproject.net.key.DeviceKey
 
 
- 
- All Implemented Interfaces:
- Annotated
 - Direct Known Subclasses:
- CommunityName,- UsernamePassword
 
 @Beta public class DeviceKey extends AbstractAnnotated Abstraction of a device key.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDeviceKey.Typetype of the device key.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommunityNameasCommunityName()Returns a community name object from the device key.UsernamePasswordasUsernamePassword()Returns a username and password object from the device key.static DeviceKeycreateDeviceKeyUsingCommunityName(DeviceKeyId id, java.lang.String label, java.lang.String name)Method to create a device key of type CommunityName.static DeviceKeycreateDeviceKeyUsingSshKey(DeviceKeyId id, java.lang.String label, java.lang.String username, java.lang.String password, java.lang.String sshkey)Method to create a device key of type SSL_KEY.static DeviceKeycreateDeviceKeyUsingUsernamePassword(DeviceKeyId id, java.lang.String label, java.lang.String username, java.lang.String password)Method to create a device key of type USERNAME_PASSWORD.DeviceKeyIddeviceKeyId()Returns the device key identifier of the device key.java.lang.Stringlabel()Returns the label of device key.DeviceKey.Typetype()Returns the type of the device key.- 
Methods inherited from class org.onosproject.net.AbstractAnnotatedannotations
 
- 
 
- 
- 
- 
Method Detail- 
deviceKeyIdpublic DeviceKeyId deviceKeyId() Returns the device key identifier of the device key.- Returns:
- device key identifier
 
 - 
labelpublic java.lang.String label() Returns the label of device key.- Returns:
- label
 
 - 
typepublic DeviceKey.Type type() Returns the type of the device key.- Returns:
- type
 
 - 
createDeviceKeyUsingCommunityNamepublic static DeviceKey createDeviceKeyUsingCommunityName(DeviceKeyId id, java.lang.String label, java.lang.String name) Method to create a device key of type CommunityName.- Parameters:
- id- device key identifier
- label- optional label for this device key
- name- community name for this device key
- Returns:
- device key
 
 - 
asCommunityNamepublic CommunityName asCommunityName() Returns a community name object from the device key.- Returns:
- community name
 
 - 
createDeviceKeyUsingUsernamePasswordpublic static DeviceKey createDeviceKeyUsingUsernamePassword(DeviceKeyId id, java.lang.String label, java.lang.String username, java.lang.String password) Method to create a device key of type USERNAME_PASSWORD.- Parameters:
- id- device key identifier
- label- optional label for this device key
- username- username for accessing this device
- password- password for accessing this device
- Returns:
- device key
 
 - 
createDeviceKeyUsingSshKeypublic static DeviceKey createDeviceKeyUsingSshKey(DeviceKeyId id, java.lang.String label, java.lang.String username, java.lang.String password, java.lang.String sshkey) Method to create a device key of type SSL_KEY.- Parameters:
- id- device key identifier
- label- optional label for this device key
- username- username for accessing this device
- password- password for accessing this device SSH key
- sshkey- SSH key for accessing this device
- Returns:
- device key
 
 - 
asUsernamePasswordpublic UsernamePassword asUsernamePassword() Returns a username and password object from the device key.- Returns:
- username and password
 
 
- 
 
-