EMMA Coverage Report (generated Mon Aug 23 17:21:34 CEST 2010)
[all classes][diskCacheV111.vehicles]

COVERAGE SUMMARY FOR SOURCE FILE [PnfsMessage.java]

nameclass, %method, %block, %line, %
PnfsMessage.java0%   (0/1)0%   (0/12)0%   (0/145)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PnfsMessage0%   (0/1)0%   (0/12)0%   (0/145)0%   (0/27)
PnfsMessage (): void 0%   (0/1)0%   (0/12)0%   (0/4)
PnfsMessage (PnfsId): void 0%   (0/1)0%   (0/15)0%   (0/6)
genericInvalidatesForPnfsMessage (Message): boolean 0%   (0/1)0%   (0/48)0%   (0/4)
getAccessMask (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getPnfsId (): PnfsId 0%   (0/1)0%   (0/3)0%   (0/1)
getPnfsPath (): String 0%   (0/1)0%   (0/3)0%   (0/1)
invalidates (Message): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
readObject (ObjectInputStream): void 0%   (0/1)0%   (0/9)0%   (0/4)
setAccessMask (Set): void 0%   (0/1)0%   (0/11)0%   (0/4)
setPnfsId (PnfsId): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPnfsPath (String): void 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/29)0%   (0/1)

1//$Id: PnfsMessage.java,v 1.5 2004-11-05 12:07:19 tigran Exp $
2 
3package diskCacheV111.vehicles;
4import  diskCacheV111.util.PnfsId ;
5import org.dcache.acl.enums.AccessMask;
6import java.util.Set;
7import java.util.Collections;
8import java.io.IOException;
9import java.io.ObjectInputStream;
10 
11/**
12 * Base class for messages to PnfsManager.
13 */
14public class PnfsMessage extends Message {
15 
16    private PnfsId _pnfsId = null;
17    private String _path   = null ;
18    private Set<AccessMask> _mask = Collections.emptySet();
19 
20    private static final long serialVersionUID = -3686370854772807059L;
21 
22    public PnfsMessage(PnfsId pnfsId){
23        _pnfsId = pnfsId ;
24    }
25 
26    public PnfsMessage(){ }
27 
28    public void setPnfsPath( String pnfsPath ){ _path = pnfsPath ; }
29    public String getPnfsPath(){ return _path ;}
30 
31    public PnfsId getPnfsId(){
32        return _pnfsId;
33    }
34 
35    public void setPnfsId(PnfsId pnfsId){
36        _pnfsId = pnfsId ;
37    }
38 
39    public void setAccessMask(Set<AccessMask> mask)
40    {
41        if (mask == null) {
42            throw new IllegalArgumentException("Null argument not allowed");
43        }
44        _mask = mask;
45    }
46 
47    public Set<AccessMask> getAccessMask()
48    {
49        return _mask;
50    }
51 
52    public String toString(){
53        return _pnfsId==null?
54               (_path==null?"NULL":("Path="+_path)):
55               ("PnfsId="+_pnfsId.toString()) ;
56    }
57 
58    protected final boolean genericInvalidatesForPnfsMessage(Message message)
59    {
60        /* Conservatively assume that a PnfsMessage invalidates any
61         * non PnfsMessage.
62         */
63        if (!(message instanceof PnfsMessage)) {
64            return true;
65        }
66 
67        PnfsMessage msg = (PnfsMessage) message;
68 
69        /* Conservatively assume that this PnfsMessage invalidates
70         * another PnfsMessage if we cannot compare them because one
71         * message is by path and the other by ID or if either the
72         * PNFS IDs or paths are the same.
73         */
74        return
75            ((getPnfsId() == null || msg.getPnfsId() == null) &&
76             (getPnfsPath() == null || msg.getPnfsPath() == null)) ||
77            (getPnfsId() != null && msg.getPnfsId() != null &&
78             getPnfsId().equals(msg.getPnfsId())) ||
79            (getPnfsPath() != null && msg.getPnfsPath() != null &&
80             getPnfsPath().equals(msg.getPnfsPath()));
81    }
82 
83    @Override
84    public boolean invalidates(Message message)
85    {
86        return genericInvalidatesForPnfsMessage(message);
87    }
88 
89    /**
90     * For compatibility with pre-1.9.6 installations, we fill in the
91     * _mask field if it is missing.
92     */
93    private void readObject(ObjectInputStream stream)
94        throws IOException, ClassNotFoundException
95    {
96        stream.defaultReadObject();
97        if (_mask == null) {
98            _mask = Collections.emptySet();
99        }
100    }
101}
102 
103 
104 

[all classes][diskCacheV111.vehicles]
EMMA 2.0.5312 (C) Vladimir Roubtsov