01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2002-2004 French National Institute For Research In Computer
04: * Science And Control (INRIA).
05: * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
06: * Contact: sequoia@continuent.org
07: *
08: * Licensed under the Apache License, Version 2.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: * Initial developer(s): Emmanuel Cecchet.
21: * Contributor(s): Jean-Bernard van Zuylen
22: */package org.continuent.sequoia.controller.loadbalancer.policies.createtable;
23:
24: import java.util.ArrayList;
25:
26: /**
27: * Use all backends for <code>CREATE TABLE</code> statements.
28: *
29: * @author <a href="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet</a>
30: * @author <a href="mailto:jbvanzuylen@transwide.com">Jean-Bernard van Zuylen
31: * </a>
32: * @version 1.0
33: */
34: public class CreateTableAll extends CreateTableRule {
35:
36: /**
37: * Creates a new <code>CreateTableAll</code> instance.
38: */
39: public CreateTableAll() {
40: super (CreateTablePolicy.ALL);
41: }
42:
43: /**
44: * Creates a new <code>CreateTableAll</code> instance.
45: *
46: * @param backendList <code>ArryList</code> of backend
47: */
48: public CreateTableAll(ArrayList backendList) {
49: super (CreateTablePolicy.ALL, backendList);
50: }
51:
52: /**
53: * @see org.continuent.sequoia.controller.loadbalancer.policies.createtable.CreateTableRule#getBackends(ArrayList)
54: */
55: public ArrayList getBackends(ArrayList backends)
56: throws CreateTableException {
57: return super .getBackends(backends);
58: }
59:
60: /**
61: * @see org.continuent.sequoia.controller.loadbalancer.policies.createtable.CreateTableRule#getInformation()
62: */
63: public String getInformation() {
64: String s;
65: if (tableName == null)
66: s = "Default rule create table on ";
67: else
68: s = "Rule for table " + tableName + " create table on ";
69:
70: return s + " all nodes in " + backendList;
71: }
72: }
|