Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
post 2.6 nfs code has changes package name from org.dcache.chimera.nfs => org.dcache.nfs Nevertheless one class is used inside a message sent to a pool and brakes compatibility with. this change restores compatibility. Notice, this makes 2.7.6 not compatible in mixed setup. Acked-by: Gerd Behrmann Target: master, 2.7 Require-book: no Require-notes: no
- Loading branch information
Showing
6 changed files
with
117 additions
and
10 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
modules/dcache/src/main/java/org/dcache/chimera/nfs/v4/xdr/stateid4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright (c) 2009 - 2014 Deutsches Elektronen-Synchroton, | ||
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY | ||
* | ||
* This library is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Library General Public License as | ||
* published by the Free Software Foundation; either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public | ||
* License along with this program (see the file COPYING.LIB for more | ||
* details); if not, write to the Free Software Foundation, Inc., | ||
* 675 Mass Ave, Cambridge, MA 02139, USA. | ||
*/ | ||
package org.dcache.chimera.nfs.v4.xdr; | ||
import java.util.Arrays; | ||
|
||
import java.io.Serializable; | ||
import org.dcache.utils.Bytes; | ||
|
||
public class stateid4 implements Serializable { | ||
|
||
static final long serialVersionUID = -6677150504723505919L; | ||
|
||
public uint32_t seqid; | ||
public byte [] other; | ||
|
||
public stateid4(byte[] other, int seq) { | ||
this.other = other; | ||
seqid = new uint32_t(seq); | ||
} | ||
|
||
public stateid4(org.dcache.nfs.v4.xdr.stateid4 stateid) { | ||
this(stateid.other, stateid.seqid.value); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
|
||
if( obj == this) return true; | ||
if( !(obj instanceof stateid4) ) return false; | ||
|
||
final stateid4 other_id = (stateid4) obj; | ||
|
||
return Arrays.equals(this.other, other_id.other); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.hashCode(other); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
sb.append("["); | ||
sb.append(Bytes.toHexString(other)); | ||
sb.append(", seq: ").append(seqid.value).append("]"); | ||
return sb.toString(); | ||
} | ||
|
||
} | ||
// End of stateid4.java |
35 changes: 35 additions & 0 deletions
35
modules/dcache/src/main/java/org/dcache/chimera/nfs/v4/xdr/uint32_t.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2009 - 2014 Deutsches Elektronen-Synchroton, | ||
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY | ||
* | ||
* This library is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Library General Public License as | ||
* published by the Free Software Foundation; either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Library General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Library General Public | ||
* License along with this program (see the file COPYING.LIB for more | ||
* details); if not, write to the Free Software Foundation, Inc., | ||
* 675 Mass Ave, Cambridge, MA 02139, USA. | ||
*/ | ||
package org.dcache.chimera.nfs.v4.xdr; | ||
|
||
import java.io.Serializable; | ||
|
||
public class uint32_t implements Serializable { | ||
|
||
static final long serialVersionUID = -6603937444681096490L; | ||
|
||
public int value; | ||
|
||
public uint32_t(int value) { | ||
this.value = value; | ||
} | ||
|
||
} | ||
// End of uint32_t.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters