KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > virtualdatabase > protocol > IsValidUserForAllBackends


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
4  * Contact: sequoia@continuent.org
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * Initial developer(s): Damian Arregui.
19  * Contributor(s): ______________________.
20  */

21
22 package org.continuent.sequoia.controller.virtualdatabase.protocol;
23
24 import java.io.Serializable JavaDoc;
25
26 import org.continuent.hedera.common.Member;
27 import org.continuent.sequoia.common.users.VirtualDatabaseUser;
28 import org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase;
29
30 /**
31  * This class defines a IsValidUserForAllBackends command.
32  *
33  * @author <a HREF="mailto:Damian.Arregui@continuent.com">Damian Arregui</a>
34  * @version 1.0
35  */

36 public class IsValidUserForAllBackends
37     extends DistributedVirtualDatabaseMessage
38 {
39   private static final long serialVersionUID = -1267300635779611796L;
40
41   private VirtualDatabaseUser vdbUser;
42
43   /**
44    * Creates a new <code>IsValidUserForAllBackends</code> object
45    *
46    * @param vdbUser user to be checked on backends.
47    */

48   public IsValidUserForAllBackends(VirtualDatabaseUser vdbUser)
49   {
50     this.vdbUser = vdbUser;
51   }
52
53   /**
54    * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageMultiThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
55    * org.continuent.hedera.common.Member, java.lang.Object)
56    */

57   public Serializable JavaDoc handleMessageMultiThreaded(
58       DistributedVirtualDatabase dvdb, Member sender,
59       Object JavaDoc handleMessageSingleThreadedResult)
60   {
61     return (Boolean JavaDoc) handleMessageSingleThreadedResult;
62   }
63
64   /**
65    * @see org.continuent.sequoia.controller.virtualdatabase.protocol.DistributedVirtualDatabaseMessage#handleMessageSingleThreaded(org.continuent.sequoia.controller.virtualdatabase.DistributedVirtualDatabase,
66    * org.continuent.hedera.common.Member)
67    */

68   public Object JavaDoc handleMessageSingleThreaded(DistributedVirtualDatabase dvdb,
69       Member sender)
70   {
71     // Checking authenticationManager.isTransparentLoginEnabled() is redundant
72
// if the request has been issued through this controller: the same check is
73
// performed at the vdb worker thread level.
74
return new Boolean JavaDoc(dvdb.getAuthenticationManager()
75         .isTransparentLoginEnabled()
76         && dvdb.isValidUserForAllBackends(vdbUser));
77   }
78
79 }
80
Popular Tags