Package org.onosproject.net
Class AbstractProjectableModel
- java.lang.Object
- 
- org.onosproject.net.AbstractAnnotated
- 
- org.onosproject.net.AbstractModel
- 
- org.onosproject.net.AbstractProjectableModel
 
 
 
- 
- All Implemented Interfaces:
- Annotated,- Projectable,- Provided
 - Direct Known Subclasses:
- AbstractElement,- DefaultLink
 
 @Beta public abstract class AbstractProjectableModel extends AbstractModel implements Projectable Base model entity, capable of being extended via projection mechanism.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classAbstractProjectableModel.AnnotationDriverDataProjection of the parent entity as a driver data entity.
 - 
Field SummaryFields Modifier and Type Field Description protected static StringNO_DRIVERprotected static StringNO_DRIVER_SERVICE
 - 
Constructor SummaryConstructors Constructor Description AbstractProjectableModel()AbstractProjectableModel(ProviderId providerId, Annotations[] annotations)Creates a model entity attributed to the specified provider and optionally annotated.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <B extends Behaviour>
 Bas(Class<B> projectionClass)Returns the specified projection of this entity if such projection is supported.protected DriverDataasData()Returns self as an immutable driver data instance.protected voidbindAndCheckDriver()Attempts to bind the driver, if not already bound and checks that the driver is bound.protected voidbindDriver()Attempts to binds the driver, if not already bound.Driverdriver()Returns the currently bound driver or null if no driver is bound.protected static DriverServicedriverService()Returns the currently bound driver service reference.<B extends Behaviour>
 booleanis(Class<B> projectionClass)Returns true if this entity is capable of being projected as the specified class.protected DriverlocateDriver()Locates the driver to be used by this entity.static voidsetDriverService(Object key, DriverService driverService)Injects the driver service reference for use during projections into various behaviours.- 
Methods inherited from class org.onosproject.net.AbstractModelproviderId
 - 
Methods inherited from class org.onosproject.net.AbstractAnnotatedannotations
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.onosproject.net.driver.Projectableproject
 
- 
 
- 
- 
- 
Field Detail- 
NO_DRIVER_SERVICEprotected static final String NO_DRIVER_SERVICE - See Also:
- Constant Field Values
 
 - 
NO_DRIVERprotected static final String NO_DRIVER - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
AbstractProjectableModelpublic AbstractProjectableModel() 
 - 
AbstractProjectableModelpublic AbstractProjectableModel(ProviderId providerId, Annotations[] annotations) Creates a model entity attributed to the specified provider and optionally annotated.- Parameters:
- providerId- identity of the provider
- annotations- optional key/value annotations
 
 
- 
 - 
Method Detail- 
setDriverServicepublic static void setDriverService(Object key, DriverService driverService) Injects the driver service reference for use during projections into various behaviours.This is a privileged call; unauthorized invocations will result in illegal state exception - Parameters:
- key- opaque admin key object
- driverService- injected driver service
- Throws:
- IllegalStateException- when invoked sans authorization
 
 - 
driverServiceprotected static DriverService driverService() Returns the currently bound driver service reference.- Returns:
- driver service
 
 - 
driverpublic Driver driver() Returns the currently bound driver or null if no driver is bound.- Returns:
- bound driver; null if none
 
 - 
aspublic <B extends Behaviour> B as(Class<B> projectionClass) Description copied from interface:ProjectableReturns the specified projection of this entity if such projection is supported.- Specified by:
- asin interface- Projectable
- Type Parameters:
- B- type of behaviour
- Parameters:
- projectionClass- requested projection class
- Returns:
- projection instance
 
 - 
ispublic <B extends Behaviour> boolean is(Class<B> projectionClass) Description copied from interface:ProjectableReturns true if this entity is capable of being projected as the specified class.- Specified by:
- isin interface- Projectable
- Type Parameters:
- B- type of behaviour
- Parameters:
- projectionClass- requested projection class
- Returns:
- true if the requested projection is supported
 
 - 
locateDriverprotected Driver locateDriver() Locates the driver to be used by this entity.The default implementation derives the driver based on the driverannotation value.- Returns:
- driver for alternate projections of this model entity or null if no driver is expected or driver is not found
 
 - 
bindDriverprotected final void bindDriver() Attempts to binds the driver, if not already bound.
 - 
bindAndCheckDriverprotected final void bindAndCheckDriver() Attempts to bind the driver, if not already bound and checks that the driver is bound.- Throws:
- IllegalStateException- if driver cannot be bound
 
 - 
asDataprotected DriverData asData() Returns self as an immutable driver data instance.- Returns:
- self as driver data
 
 
- 
 
-