summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/ProtocolInstance.java
blob: 9e217d9df4a26c450a464ed926df33f3a91c9b60 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// **********************************************************************
//
// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

package IceInternal;

public class ProtocolInstance
{
    public ProtocolInstance(Ice.Communicator communicator, short type, String protocol)
    {
        _instance = Util.getInstance(communicator);
        _traceLevel = _instance.traceLevels().network;
        _traceCategory = _instance.traceLevels().networkCat;
        _logger = _instance.initializationData().logger;
        _properties = _instance.initializationData().properties;
        _type = type;
        _protocol = protocol;
    }

    public int traceLevel()
    {
        return _traceLevel;
    }

    public String traceCategory()
    {
        return _traceCategory;
    }

    public Ice.Logger logger()
    {
        return _logger;
    }

    public String protocol()
    {
        return _protocol;
    }

    public short type()
    {
        return _type;
    }

    public Ice.Properties properties()
    {
        return _properties;
    }

    public boolean preferIPv6()
    {
        return _instance.preferIPv6();
    }

    public int protocolSupport()
    {
        return _instance.protocolSupport();
    }

    public String defaultHost()
    {
        return _instance.defaultsAndOverrides().defaultHost;
    }

    public java.net.InetSocketAddress defaultSourceAddress()
    {
        return _instance.defaultsAndOverrides().defaultSourceAddress;
    }

    public Ice.EncodingVersion defaultEncoding()
    {
        return _instance.defaultsAndOverrides().defaultEncoding;
    }

    public int defaultTimeout()
    {
        return _instance.defaultsAndOverrides().defaultTimeout;
    }

    public NetworkProxy networkProxy()
    {
        return _instance.networkProxy();
    }

    public int messageSizeMax()
    {
        return _instance.messageSizeMax();
    }

    public java.util.List<Connector> resolve(String host, int port, Ice.EndpointSelectionType type, IPEndpointI endpt)
    {
        return _instance.endpointHostResolver().resolve(host, port, type, endpt);
    }

    public void resolve(String host, int port, Ice.EndpointSelectionType type, IPEndpointI endpt,
                        EndpointI_connectors callback)
    {
        _instance.endpointHostResolver().resolve(host, port, type, endpt, callback);
    }

    ProtocolInstance(Instance instance, short type, String protocol)
    {
        _instance = instance;
        _traceLevel = _instance.traceLevels().network;
        _traceCategory = _instance.traceLevels().networkCat;
        _logger = _instance.initializationData().logger;
        _properties = _instance.initializationData().properties;
        _type = type;
        _protocol = protocol;
    }

    protected Instance _instance;
    protected int _traceLevel;
    protected String _traceCategory;
    protected Ice.Logger _logger;
    protected Ice.Properties _properties;
    protected String _protocol;
    protected short _type;
}