X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2FSchemaContextRegistry.java;fp=opendaylight%2Fnetconf%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2FSchemaContextRegistry.java;h=5c3cfe79d3c2f77a2e22087a2e06b9894aff5b64;hp=0000000000000000000000000000000000000000;hb=b3d2a00776a1a5e3a139d73ced859aa557c931af;hpb=d04e0863b86415749a8437241c57df0d32a3b133 diff --git a/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/SchemaContextRegistry.java b/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/SchemaContextRegistry.java new file mode 100644 index 0000000000..5c3cfe79d3 --- /dev/null +++ b/opendaylight/netconf/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/SchemaContextRegistry.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.netconf.cli; + +import com.google.common.base.Optional; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; + +/** + * Contains the local schema context (containing local commands) and remote schema context (remote commands) + * + * Remote commands are set only after the connection is fully established. So classes using the remote schema context + */ +public class SchemaContextRegistry { + + private final SchemaContext localSchemaContext; + private SchemaContext remoteSchemaContext; + + public SchemaContextRegistry(final SchemaContext localSchemaContext) { + this.localSchemaContext = localSchemaContext; + } + + public synchronized Optional getRemoteSchemaContext() { + return Optional.fromNullable(remoteSchemaContext); + } + + public SchemaContext getLocalSchemaContext() { + return localSchemaContext; + } + + public synchronized void setRemoteSchemaContext(final SchemaContext remoteSchemaContext) { + this.remoteSchemaContext = remoteSchemaContext; + } +}