import org.opendaylight.mdsal.binding.runtime.api.DataRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.NotificationRuntimeType;
import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
-import org.opendaylight.mdsal.binding.spec.naming.BindingMapping;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.yangtools.util.ClassLoaderUtils;
import org.opendaylight.yangtools.yang.binding.Action;
import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.binding.RpcInput;
import org.opendaylight.yangtools.yang.binding.RpcOutput;
+import org.opendaylight.yangtools.yang.binding.contract.Naming;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
final QNameModule qnameModule = qname.getModule();
final Module module = context.getEffectiveModelContext().findModule(qnameModule)
.orElseThrow(() -> new IllegalArgumentException("Failed to find module for " + qnameModule));
- final String className = BindingMapping.getClassName(qname);
+ final String className = Naming.getClassName(qname);
for (final RpcDefinition potential : module.getRpcs()) {
final QName potentialQName = potential.getQName();
*
* FIXME: Rework this to have more precise logic regarding Binding Specification.
*/
- if (key.getSimpleName().equals(BindingMapping.getClassName(potentialQName) + className)) {
+ if (key.getSimpleName().equals(Naming.getClassName(potentialQName) + className)) {
final ContainerLike schema = getRpcDataSchema(potential, qname);
checkArgument(schema != null, "Schema for %s does not define input / output.", potentialQName);
}
});
- private SchemaRootCodecContext(final DataContainerCodecPrototype<BindingRuntimeTypes> dataPrototype) {
- super(dataPrototype);
- }
-
- /**
- * Creates RootNode from supplied CodecContextFactory.
- *
- * @param factory
- * CodecContextFactory
- * @return A new root node
- */
- static SchemaRootCodecContext<?> create(final CodecContextFactory factory) {
- return new SchemaRootCodecContext<>(DataContainerCodecPrototype.rootPrototype(factory));
+ SchemaRootCodecContext(final CodecContextFactory factory) {
+ super(DataContainerCodecPrototype.rootPrototype(factory));
}
@Override
final Optional<ParameterizedType> optParamType = ClassLoaderUtils.findParameterizedType(action, actionType);
checkState(optParamType.isPresent(), "%s does not specialize %s", action, actionType);
- final ParameterizedType paramType = optParamType.get();
+ final ParameterizedType paramType = optParamType.orElseThrow();
final Type[] args = paramType.getActualTypeArguments();
checkArgument(args.length == expectedArgsLength, "Unexpected (%s) Action generatic arguments", args.length);
final ActionRuntimeType schema = factory().getRuntimeContext().getActionDefinition(action);