Search in sources :

Example 1 with DOMMountPoint

use of org.opendaylight.controller.md.sal.dom.api.DOMMountPoint in project controller by opendaylight.

the class BindingDOMMountPointServiceAdapter method getMountPoint.

@Override
public Optional<MountPoint> getMountPoint(InstanceIdentifier<?> mountPoint) {
    YangInstanceIdentifier domPath = codec.toYangInstanceIdentifierBlocking(mountPoint);
    Optional<DOMMountPoint> domMount = mountService.getMountPoint(domPath);
    if (domMount.isPresent()) {
        return Optional.<MountPoint>fromNullable(bindingMountpoints.getUnchecked(domMount.get()));
    }
    return Optional.absent();
}
Also used : DOMMountPoint(org.opendaylight.controller.md.sal.dom.api.DOMMountPoint) MountPoint(org.opendaylight.controller.md.sal.binding.api.MountPoint) DOMMountPoint(org.opendaylight.controller.md.sal.dom.api.DOMMountPoint) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)

Example 2 with DOMMountPoint

use of org.opendaylight.controller.md.sal.dom.api.DOMMountPoint in project controller by opendaylight.

the class MountPointServiceTest method createSimpleMountPoint.

@Test
public void createSimpleMountPoint() {
    Optional<DOMMountPoint> mountNotPresent = mountService.getMountPoint(PATH);
    assertFalse(mountNotPresent.isPresent());
    DOMMountPointBuilder mountBuilder = mountService.createMountPoint(PATH);
    mountBuilder.register();
    Optional<DOMMountPoint> mountPresent = mountService.getMountPoint(PATH);
    assertTrue(mountPresent.isPresent());
}
Also used : DOMMountPointBuilder(org.opendaylight.controller.md.sal.dom.api.DOMMountPointService.DOMMountPointBuilder) DOMMountPoint(org.opendaylight.controller.md.sal.dom.api.DOMMountPoint) Test(org.junit.Test)

Aggregations

DOMMountPoint (org.opendaylight.controller.md.sal.dom.api.DOMMountPoint)2 Test (org.junit.Test)1 MountPoint (org.opendaylight.controller.md.sal.binding.api.MountPoint)1 DOMMountPointBuilder (org.opendaylight.controller.md.sal.dom.api.DOMMountPointService.DOMMountPointBuilder)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1