Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Config subclasses implement the tunables for a subject as a set of getters and setters (attribute accessors) to JSON object constructs (ObjectNodes). Example: An OpticalPortConfig is defined as:

     

    Code Block
    languagejava
    public class OpticalPortConfig extends Config<ConnectPoint>

     

    meaning that it manipulates the configurations associated with ConnectPoint subjects (optical ports). Some of its attribute accessors include the port’s string and numeric names, and the number of channels that the port supports.

  • SubjectFactory ties a subject to its subject key, and generates objects that represent the subject. Example: the factory that generates ConnectPoints is instantiated as:

     

    Code Block
    languagejava
    public static final SubjectFactory<ConnectPoint> CONNECT_POINT_SUBJECT_FACTORY = 
    		new SubjectFactory<ConnectPoint>(ConnectPoint.class, "ports") { 
    			@Override public ConnectPoint createSubject(String key) {
                		 return ConnectPoint.deviceConnectPoint(key); 
    			} 
    		};

     

    meaning that the key for the JSON field containing port information is keyed on string “ports”, and the factory can create ConnectPoints from a “deviceId:port” string (the argument to createSubject).

...

Using Network Configuration Services