use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class AdminMgrImplTest method deleteDsdSet.
/**
* @param sArray
*/
private void deleteDsdSet(String msg, String[][] sArray) {
LogUtil.logIt(msg);
try {
AdminMgr adminMgr = getManagedAdminMgr();
for (String[] dsdle : sArray) {
SDSet dsd = RoleTestData.getSDSet(dsdle);
adminMgr.deleteDsdSet(dsd);
LOG.debug("deleteDsdSet role [" + dsd.getName() + "] successful");
}
} catch (SecurityException ex) {
LOG.error("deleteDsdSet caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrRestImpl method ssdRoleSet.
/**
* {@inheritDoc}
*/
@Override
public SDSet ssdRoleSet(SDSet set) throws SecurityException {
VUtil.assertNotNull(set, GlobalErrIds.SSD_NULL, CLS_NM + ".ssdRoleSet");
SDSet retSet;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(set);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.SSD_READ);
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 ReviewMgrRestImpl method ssdRoleSetCardinality.
/**
* {@inheritDoc}
*/
@Override
public int ssdRoleSetCardinality(SDSet ssd) throws SecurityException {
VUtil.assertNotNull(ssd, GlobalErrIds.SSD_NULL, CLS_NM + ".ssdRoleSetCardinality");
SDSet retSet;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(ssd);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.SSD_CARD);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSet = (SDSet) response.getEntity();
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSet.getCardinality();
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrRestImpl method dsdRoleSets.
/**
* {@inheritDoc}
*/
@Override
public List<SDSet> dsdRoleSets(Role role) throws SecurityException {
VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, CLS_NM + ".dsdRoleSets");
List<SDSet> retDsdRoleSets;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(role);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.DSD_ROLE_SETS);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retDsdRoleSets = response.getEntities();
if (retDsdRoleSets == null) {
retDsdRoleSets = new ArrayList<>();
}
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retDsdRoleSets;
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrRestImpl method ssdRoleSets.
/**
* {@inheritDoc}
*/
@Override
public List<SDSet> ssdRoleSets(Role role) throws SecurityException {
VUtil.assertNotNull(role, GlobalErrIds.ROLE_NULL, CLS_NM + ".ssdRoleSets");
List<SDSet> retSsdRoleSets;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(role);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.SSD_ROLE_SETS);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSsdRoleSets = response.getEntities();
if (retSsdRoleSets == null) {
retSsdRoleSets = new ArrayList<>();
}
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSsdRoleSets;
}
Aggregations