OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SqlAlterServer.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 
3 import com.google.gson.annotations.Expose;
4 
5 import org.apache.calcite.sql.SqlKind;
7 import org.apache.calcite.sql.SqlSpecialOperator;
8 import org.apache.calcite.sql.parser.SqlParserPos;
9 
10 import java.util.Map;
11 
15 public class SqlAlterServer extends SqlCustomDdl {
16  private static final SqlOperator OPERATOR =
17  new SqlSpecialOperator("ALTER_SERVER", SqlKind.OTHER_DDL);
18 
31  public enum AlterType { SET_OPTIONS, CHANGE_OWNER, RENAME_SERVER, SET_DATA_WRAPPER }
32 
33  public static class Builder extends SqlOptionsBuilder {
35  private String serverName;
36  private String newServerName;
37  private String newOwner;
38  private String dataWrapper;
39  private SqlParserPos pos;
40 
41  public void setAlterType(final AlterType alterType) {
42  this.alterType = alterType;
43  }
44 
45  public void setServerName(final String serverName) {
46  this.serverName = serverName;
47  }
48 
49  public void setNewServerName(final String newServerName) {
50  this.newServerName = newServerName;
51  }
52 
53  public void setNewOwner(final String newOwner) {
54  this.newOwner = newOwner;
55  }
56 
57  public void setDataWrapper(final String dataWrapper) {
58  this.dataWrapper = dataWrapper;
59  }
60 
61  public void setPos(final SqlParserPos pos) {
62  this.pos = pos;
63  }
64 
65  public SqlAlterServer build() {
66  return new SqlAlterServer(pos,
67  alterType,
68  serverName,
70  newOwner,
72  super.options);
73  }
74  }
75 
76  @Expose
78  @Expose
79  private String newServerName;
80  @Expose
81  private String newOwner;
82  @Expose
83  private String serverName;
84  @Expose
85  private String dataWrapper;
86  @Expose
87  private Map<String, String> options;
88 
89  public SqlAlterServer(final SqlParserPos pos,
90  final AlterType alterType,
91  final String serverName,
92  final String newServerName,
93  final String newOwner,
94  final String dataWrapper,
95  final Map<String, String> options) {
96  super(OPERATOR, pos);
97  this.alterType = alterType;
98  this.newServerName = newServerName;
99  this.newOwner = newOwner;
100  this.serverName = serverName;
101  this.dataWrapper = dataWrapper;
102  this.options = options;
103  }
104 }
void setNewServerName(final String newServerName)
SqlAlterServer(final SqlParserPos pos, final AlterType alterType, final String serverName, final String newServerName, final String newOwner, final String dataWrapper, final Map< String, String > options)