OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.parser.extension.ddl.SqlGrantRole Class Reference
+ Inheritance diagram for com.mapd.parser.extension.ddl.SqlGrantRole:
+ Collaboration diagram for com.mapd.parser.extension.ddl.SqlGrantRole:

Public Member Functions

 SqlGrantRole (SqlParserPos pos, SqlNodeList roles, SqlNodeList grantees)
 
List< SqlNode > getOperandList ()
 
String toString ()
 

Private Attributes

String command
 
SqlNodeList roles
 
SqlNodeList grantees
 

Static Private Attributes

static final SqlOperator OPERATOR
 

Detailed Description

Definition at line 23 of file SqlGrantRole.java.

Constructor & Destructor Documentation

com.mapd.parser.extension.ddl.SqlGrantRole.SqlGrantRole ( SqlParserPos  pos,
SqlNodeList  roles,
SqlNodeList  grantees 
)
inline

Definition at line 33 of file SqlGrantRole.java.

References com.mapd.parser.extension.ddl.SqlGrantRole.grantees, com.mapd.parser.extension.ddl.SqlGrantRole.OPERATOR, and com.mapd.parser.extension.ddl.SqlGrantRole.roles.

33  {
34  super(OPERATOR, pos);
35  requireNonNull(roles);
36  this.command = OPERATOR.getName();
37  this.roles = roles;
38  this.grantees = grantees;
39  }

Member Function Documentation

List<SqlNode> com.mapd.parser.extension.ddl.SqlGrantRole.getOperandList ( )
inline

Definition at line 42 of file SqlGrantRole.java.

42  {
43  return null;
44  }
String com.mapd.parser.extension.ddl.SqlGrantRole.toString ( )
inline

Definition at line 47 of file SqlGrantRole.java.

References com.mapd.parser.extension.ddl.SqlGrantRole.grantees, and com.mapd.parser.extension.ddl.SqlGrantRole.roles.

47  {
48  EscapedStringJsonBuilder jsonBuilder = new EscapedStringJsonBuilder();
49  Map<String, Object> map = jsonBuilder.map();
50 
51  if (this.roles != null) {
52  List<Object> roles_list = jsonBuilder.list();
53  for (SqlNode role : this.roles) {
54  roles_list.add(role.toString());
55  }
56  map.put("roles", roles_list);
57  }
58 
59  if (this.grantees != null) {
60  List<Object> grantee_list = jsonBuilder.list();
61  for (SqlNode grantee : this.grantees) {
62  grantee_list.add(grantee.toString());
63  }
64  map.put("grantees", grantee_list);
65  }
66 
67  map.put("command", "GRANT_ROLE");
68  Map<String, Object> payload = jsonBuilder.map();
69  payload.put("payload", map);
70  return jsonBuilder.toJsonString(payload);
71  }

Member Data Documentation

String com.mapd.parser.extension.ddl.SqlGrantRole.command
private

Definition at line 27 of file SqlGrantRole.java.

SqlNodeList com.mapd.parser.extension.ddl.SqlGrantRole.grantees
private
final SqlOperator com.mapd.parser.extension.ddl.SqlGrantRole.OPERATOR
staticprivate
Initial value:
=
new SqlSpecialOperator("GRANT_ROLE", SqlKind.OTHER_DDL)

Definition at line 24 of file SqlGrantRole.java.

Referenced by com.mapd.parser.extension.ddl.SqlGrantRole.SqlGrantRole().

SqlNodeList com.mapd.parser.extension.ddl.SqlGrantRole.roles
private

The documentation for this class was generated from the following file: