Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-09-22 17:14:28 -0700
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
1216a5f1960d28dfee19e7bfbb4fb14ae986b2d3
1216a5f1
2 parents
85ff08b1
fbf5fd39
Merge remote-tracking branch 'origin/master'
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
2 deletions
core/api/src/main/java/org/onlab/onos/cluster/MastershipAdminService.java
core/api/src/main/java/org/onlab/onos/cluster/MastershipEvent.java
core/api/src/main/java/org/onlab/onos/cluster/MastershipService.java
core/api/src/main/java/org/onlab/onos/cluster/MastershipStore.java
core/api/src/main/java/org/onlab/onos/net/device/DeviceAdminService.java
core/api/src/main/java/org/onlab/onos/cluster/MastershipAdminService.java
0 → 100644
View file @
1216a5f
package
org
.
onlab
.
onos
.
cluster
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.MastershipRole
;
/**
* Service for administering the inventory of device masterships.
*/
public
interface
MastershipAdminService
{
/**
* Applies the current mastership role for the specified device.
*
* @param instance controller instance identifier
* @param deviceId device identifier
* @param role requested role
*/
void
setRole
(
InstanceId
instance
,
DeviceId
deviceId
,
MastershipRole
role
);
}
core/api/src/main/java/org/onlab/onos/cluster/MastershipEvent.java
View file @
1216a5f
...
...
@@ -4,7 +4,7 @@ import org.onlab.onos.event.AbstractEvent;
import
org.onlab.onos.net.DeviceId
;
/**
* Describes
infrastructure device
event.
* Describes
a device mastership
event.
*/
public
class
MastershipEvent
extends
AbstractEvent
<
MastershipEvent
.
Type
,
DeviceId
>
{
...
...
core/api/src/main/java/org/onlab/onos/cluster/MastershipService.java
View file @
1216a5f
...
...
@@ -49,6 +49,6 @@ public interface MastershipService {
*
* @param listener the mastership listener
*/
void
removeListe
m
er
(
MastershipListener
listener
);
void
removeListe
n
er
(
MastershipListener
listener
);
}
...
...
core/api/src/main/java/org/onlab/onos/cluster/MastershipStore.java
0 → 100644
View file @
1216a5f
package
org
.
onlab
.
onos
.
cluster
;
import
java.util.Set
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.MastershipRole
;
/**
* Manages inventory of mastership roles for devices, across controller instances.
*/
public
interface
MastershipStore
{
// three things to map: InstanceId, DeviceId, MastershipRole
/**
* Sets a device's role for a specified controller instance.
*
* @param instance controller instance identifier
* @param deviceId device identifier
* @param role new role
* @return a mastership event
*/
MastershipEvent
setRole
(
InstanceId
instance
,
DeviceId
deviceId
,
MastershipRole
role
);
/**
* Adds or updates the mastership information for a device.
*
* @param instance controller instance identifier
* @param deviceId device identifier
* @param role new role
* @return a mastership event
*/
MastershipEvent
addOrUpdateDevice
(
InstanceId
instance
,
DeviceId
deviceId
,
MastershipRole
role
);
/**
* Returns the master for a device.
*
* @param deviceId the device identifier
* @return the instance identifier of the master
*/
InstanceId
getMaster
(
DeviceId
deviceId
);
/**
* Returns the devices that a controller instance is master of.
*
* @param instanceId the instance identifier
* @return a set of device identifiers
*/
Set
<
DeviceId
>
getDevices
(
InstanceId
instanceId
);
/**
* Returns the role of a device for a specific controller instance.
*
* @param instanceId the instance identifier
* @param deviceId the device identifiers
* @return the role
*/
MastershipRole
getRole
(
InstanceId
instanceId
,
DeviceId
deviceId
);
}
core/api/src/main/java/org/onlab/onos/net/device/DeviceAdminService.java
View file @
1216a5f
...
...
@@ -13,7 +13,9 @@ public interface DeviceAdminService {
*
* @param deviceId device identifier
* @param role requested role
* @deprecated Will be removed in favor of MastershipAdminService.setRole()
*/
@Deprecated
void
setRole
(
DeviceId
deviceId
,
MastershipRole
role
);
/**
...
...
Please
register
or
login
to post a comment