summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/TraceLevels.java
blob: 331b40a714759076cb31d706f477e83f2d03c3aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

package IceInternal;

final class TraceLevels
{
    public
    TraceLevels(Ice.Properties properties)
    {
        network = 0;
        networkCat = "Network";
        protocol = 0;
        protocolCat = "Protocol";
        retry = 0;
        retryCat = "Retry";
        security = 0;
        securityCat = "Security";

        String value;
        final String keyBase = "Ice.Trace.";

        value = properties.getProperty(keyBase + networkCat);
        if (value != null)
        {
            try
            {
                network = Integer.parseInt(value);
            }
            catch (NumberFormatException ex)
            {
            }
        }

        value = properties.getProperty(keyBase + protocolCat);
        if (value != null)
        {
            try
            {
                protocol = Integer.parseInt(value);
            }
            catch (NumberFormatException ex)
            {
            }
        }

        value = properties.getProperty(keyBase + retryCat);
        if (value != null)
        {
            try
            {
                retry = Integer.parseInt(value);
            }
            catch (NumberFormatException ex)
            {
            }
        }

        value = properties.getProperty(keyBase + securityCat);
        if (value != null)
        {
            try
            {
                security = Integer.parseInt(value);
            }
            catch (NumberFormatException ex)
            {
            }
        }
    }

    int network;
    String networkCat;
    int protocol;
    String protocolCat;
    int retry;
    String retryCat;
    int security;
    String securityCat;
}