常用服务
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected TopologyService topologyService ;//用于提供网络拓补信息
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected PacketService packetService ;
//Service for intercepting data plane packets and for emitting synthetic outbound packets.
//用于截获数据包信息、构建并发送数据包
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected HostService hostService ;
//Service for interacting with the inventory of end-station hosts.
//用于与终端主机交互
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected FlowRuleService flowRuleService ;
//Service for injecting flow rules into the environment
//and for obtaining information about flow rules already in the environment.
//This implements semantics of a distributed authoritative flow table
//where the master copy of the flow rules lies with the controller and the devices hold only the 'cached' copy.
//下发等操作
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected FlowObjectiveService flowObjectiveService ;
//Service for programming data plane flow rules
//in manner independent of specific device table pipeline configuration.
//用于构造特定设备的流表
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService ;
//Service for interacting with the core system of the controller.
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ComponentConfigService cfgService ;
//Service for tracking system-wide configurations for various software components.
//追踪整个系统各个组件的配置
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected StorageService storageService ;
//Storage service.
//This service provides builders for various distributed primitives.
//提供构建者
//It is expected that services and applications
//will leverage the primitives
//indirectly provided by this service for their distributed state management and coordination.
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DeviceService deviceService ;
//与现有基础设备交互服务
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected MastershipService mastershipService ;
//Service responsible for determining the controller instance mastership
//of a device in a clustered environment.
//This is the central authority for determining mastership,
//but is not responsible for actually applying it to the devices;
//决定master授权,但不应用
//this falls on the device service.
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ClusterService clusterService ;
//Service for obtaining information about the individual nodes within the controller cluster.
//获取集群中的单个节点信息
常量设置
@Property(name = "flowTimeout", intValue = DEFAULT_TIMEOUT,
label = "Configure Flow Timeout for installed flow rules; " +
"default is 10 sec")
private int flowTimeout = DEFAULT_TIMEOUT;
//常量的设置方式,此处是流表过期时间设定