* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
public static final String TABLE = "role";
public static final int CACHE_SEG = 0x40; // yields segment 0x0-0x3F
public static final String TABLE = "role";
public static final int CACHE_SEG = 0x40; // yields segment 0x0-0x3F
RoleLoader.deflt.marshal(this,new DataOutputStream(baos));
return ByteBuffer.wrap(baos.toByteArray());
}
RoleLoader.deflt.marshal(this,new DataOutputStream(baos));
return ByteBuffer.wrap(baos.toByteArray());
}
@Override
public void reconstitute(ByteBuffer bb) throws IOException {
RoleLoader.deflt.unmarshal(this, toDIS(bb));
@Override
public void reconstitute(ByteBuffer bb) throws IOException {
RoleLoader.deflt.unmarshal(this, toDIS(bb));
public static final int BUFF_SIZE=96;
public static final RoleLoader deflt = new RoleLoader(KEYLIMIT);
public static final int BUFF_SIZE=96;
public static final RoleLoader deflt = new RoleLoader(KEYLIMIT);
private void init(AuthzTrans trans) {
String[] helpers = setCRUD(trans, TABLE, Data.class, RoleLoader.deflt);
private void init(AuthzTrans trans) {
String[] helpers = setCRUD(trans, TABLE, Data.class, RoleLoader.deflt);
psNS = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
" WHERE ns = ?", new RoleLoader(1),readConsistency);
psName = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
" WHERE name = ?", new RoleLoader(1),readConsistency);
psNS = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
" WHERE ns = ?", new RoleLoader(1),readConsistency);
psName = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
" WHERE name = ?", new RoleLoader(1),readConsistency);
- psChildren = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
- " WHERE ns=? AND name > ? AND name < ?",
+ psChildren = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE +
+ " WHERE ns=? AND name > ? AND name < ?",
public Result<List<Data>> readChildren(AuthzTrans trans, String ns, String role) {
if (role.length()==0 || "*".equals(role)) {
public Result<List<Data>> readChildren(AuthzTrans trans, String ns, String role) {
if (role.length()==0 || "*".equals(role)) {
- return psChildren.read(trans, R_TEXT, new Object[]{ns, FIRST_CHAR, LAST_CHAR});
+ return psChildren.read(trans, R_TEXT, new Object[]{ns, FIRST_CHAR, LAST_CHAR});
} else {
return psChildren.read(trans, R_TEXT, new Object[]{ns, role+DOT, role+DOT_PLUS_ONE});
}
} else {
return psChildren.read(trans, R_TEXT, new Object[]{ns, role+DOT, role+DOT_PLUS_ONE});
}
pencode + "'} WHERE " +
"ns = '" + role.ns + "' AND name = '" + role.name + "';");
} catch (DriverException | APIException | IOException e) {
pencode + "'} WHERE " +
"ns = '" + role.ns + "' AND name = '" + role.name + "';");
} catch (DriverException | APIException | IOException e) {
pencode + "'} WHERE " +
"ns = '" + role.ns + "' AND name = '" + role.name + "';");
} catch (DriverException | APIException | IOException e) {
pencode + "'} WHERE " +
"ns = '" + role.ns + "' AND name = '" + role.name + "';");
} catch (DriverException | APIException | IOException e) {
wasModified(trans, CRUD.update, role, "Removed permission " + pencode + " from role " + role.fullName() );
return Result.ok();
}
wasModified(trans, CRUD.update, role, "Removed permission " + pencode + " from role " + role.fullName() );
return Result.ok();
}
*/
public Result<Void> addDescription(AuthzTrans trans, String ns, String name, String description) {
try {
*/
public Result<Void> addDescription(AuthzTrans trans, String ns, String name, String description) {
try {
+ description + "' WHERE ns = '" + ns + "' AND name = '" + name + "';");
} catch (DriverException | APIException | IOException e) {
reportPerhapsReset(trans,e);
+ description + "' WHERE ns = '" + ns + "' AND name = '" + name + "';");
} catch (DriverException | APIException | IOException e) {
reportPerhapsReset(trans,e);
wasModified(trans, CRUD.update, data, "Added description " + description + " to role " + data.fullName(), null );
return Result.ok();
}
wasModified(trans, CRUD.update, data, "Added description " + description + " to role " + data.fullName(), null );
return Result.ok();
}