use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrImpl method dsdRoleSetCardinality.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public int dsdRoleSetCardinality(SDSet dsd) throws SecurityException {
String methodName = "dsdRoleSetCardinality";
assertContext(CLS_NM, methodName, dsd, GlobalErrIds.DSD_NULL);
checkAccess(CLS_NM, methodName);
SDSet se = ssdP.read(dsd);
return se.getCardinality();
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrImpl method ssdRoleSetCardinality.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public int ssdRoleSetCardinality(SDSet ssd) throws SecurityException {
String methodName = "ssdRoleSetCardinality";
assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
checkAccess(CLS_NM, methodName);
SDSet se = ssdP.read(ssd);
return se.getCardinality();
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrImpl method dsdRoleSetRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Set<String> dsdRoleSetRoles(SDSet dsd) throws SecurityException {
String methodName = "dsdRoleSetRoles";
assertContext(CLS_NM, methodName, dsd, GlobalErrIds.DSD_NULL);
checkAccess(CLS_NM, methodName);
dsd.setType(SDSet.SDType.DYNAMIC);
SDSet se = ssdP.read(dsd);
return se.getMembers();
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class AdminMgrRestImpl method deleteDsdRoleMember.
/**
* {@inheritDoc}
*/
@Override
public SDSet deleteDsdRoleMember(SDSet dsdSet, Role role) throws SecurityException {
VUtil.assertNotNull(dsdSet, GlobalErrIds.SSD_NULL, CLS_NM + ".deleteDsdRoleMember");
VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, CLS_NM + ".deleteSsdRoleMember");
SDSet retSet;
FortRequest request = RestUtils.getRequest(this.contextId);
request.setEntity(dsdSet);
request.setValue(role.getName());
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.DSD_DEL_MEMBER);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSet = (SDSet) response.getEntity();
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSet;
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class AdminMgrRestImpl method createSsdSet.
/**
* {@inheritDoc}
*/
@Override
public SDSet createSsdSet(SDSet ssdSet) throws SecurityException {
VUtil.assertNotNull(ssdSet, GlobalErrIds.SSD_NULL, CLS_NM + ".createSsdSet");
SDSet retSet;
FortRequest request = RestUtils.getRequest(this.contextId);
request.setEntity(ssdSet);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.SSD_ADD);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSet = (SDSet) response.getEntity();
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSet;
}
Aggregations