handled review comments (sending rpc message to library and version
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / session / SwitchConnectionCookieOFImpl.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.openflow.md.core.session;
10
11 import java.security.MessageDigest;
12
13 /**
14  * @author mirehak
15  */
16 public class SwitchConnectionCookieOFImpl extends SwitchSessionKeyOFImpl {
17
18     private short auxiliaryId;
19
20     /**
21      * @param encodedId
22      * @see {@link SwitchSessionKeyOFImpl#SwitchSessionKeyOFImpl(byte[])}
23      */
24     public SwitchConnectionCookieOFImpl(byte[] encodedId) {
25         super(encodedId);
26     }
27
28     /**
29      * default ctor
30      */
31     public SwitchConnectionCookieOFImpl() {
32         // do nothing
33     }
34
35     /**
36      * @param auxiliaryId
37      *            the auxiliaryId to set
38      */
39     public void setAuxiliaryId(short auxiliaryId) {
40         this.auxiliaryId = auxiliaryId;
41     }
42
43     @Override
44     protected void extend(MessageDigest medi) {
45         super.extend(medi);
46         medi.update(new byte[] { (byte) (auxiliaryId >> 8), (byte) auxiliaryId });
47     }
48
49 }