summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/AdminRouter.java
blob: a163d742bbcf1bfee4a281cc622666c4e1e3aa51 (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
// **********************************************************************
//
// Copyright (c) 2003-2007 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 IceGridGUI;

import IceGrid.*;

class AdminRouter extends Ice.Blobject
{
    public boolean ice_invoke(byte[] inParams,
			      Ice.ByteSeqHolder outParams,
			      Ice.Current current)
    {

	if(_admin == null)
	{
	    throw new Ice.ObjectNotExistException(current.id, 
						  current.facet, 
						  current.operation);
	}
	else if(current.operation.equals("ice_id") ||
		current.operation.equals("ice_ids") ||
		current.operation.equals("ice_isA") ||
		current.operation.equals("ice_ping") ||
		current.operation.equals("getDefaultApplicationDescriptor"))
	{
	    
	    return _admin.ice_invoke(current.operation,
				     current.mode,
				     inParams, outParams,
				     current.ctx);
	}
	else
	{
	    //
	    // Routing other operations could be a security risk
	    //
	    throw new Ice.OperationNotExistException(current.id, 
						     current.facet, 
						     current.operation);
	}
    }

    AdminRouter(AdminPrx admin)
    {
	_admin = admin;
    }

    private final AdminPrx _admin;
}