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

Public Member Functions

 SqlRevokeRole (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 22 of file SqlRevokeRole.java.

Constructor & Destructor Documentation

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

Definition at line 32 of file SqlRevokeRole.java.

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

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

Member Function Documentation

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

Definition at line 41 of file SqlRevokeRole.java.

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

Definition at line 46 of file SqlRevokeRole.java.

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

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

Member Data Documentation

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

Definition at line 26 of file SqlRevokeRole.java.

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

Definition at line 23 of file SqlRevokeRole.java.

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

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

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