use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrRestImpl method dsdRoleSet.
/**
* {@inheritDoc}
*/
@Override
public SDSet dsdRoleSet(SDSet set) throws SecurityException {
VUtil.assertNotNull(set, GlobalErrIds.DSD_NULL, CLS_NM + ".dsdRoleSet");
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.DSD_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 dsdRoleSetCardinality.
/**
* {@inheritDoc}
*/
@Override
public int dsdRoleSetCardinality(SDSet dsd) throws SecurityException {
VUtil.assertNotNull(dsd, GlobalErrIds.DSD_NULL, CLS_NM + ".dsdRoleSetCardinality");
SDSet retSet;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(dsd);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.DSD_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 ssdSets.
/**
* {@inheritDoc}
*/
public List<SDSet> ssdSets(SDSet ssd) throws SecurityException {
VUtil.assertNotNull(ssd, GlobalErrIds.ROLE_NULL, CLS_NM + ".ssdSets");
List<SDSet> retSsdSets;
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_SETS);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSsdSets = response.getEntities();
if (retSsdSets == null) {
retSsdSets = new ArrayList<>();
}
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSsdSets;
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class ReviewMgrRestImpl method dsdSets.
/**
* {@inheritDoc}
*/
public List<SDSet> dsdSets(SDSet dsd) throws SecurityException {
VUtil.assertNotNull(dsd, GlobalErrIds.ROLE_NULL, CLS_NM + ".dsdSets");
List<SDSet> retDsdSets;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(dsd);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.DSD_SETS);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retDsdSets = response.getEntities();
if (retDsdSets == null) {
retDsdSets = new ArrayList<>();
}
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retDsdSets;
}
use of org.apache.directory.fortress.core.model.SDSet in project directory-fortress-core by apache.
the class AdminMgrRestImpl method setDsdSetCardinality.
/**
* {@inheritDoc}
*/
@Override
public SDSet setDsdSetCardinality(SDSet dsdSet, int cardinality) throws SecurityException {
VUtil.assertNotNull(dsdSet, GlobalErrIds.SSD_NULL, CLS_NM + ".setSsdSetCardinality");
SDSet retSet;
FortRequest request = RestUtils.getRequest(this.contextId);
dsdSet.setCardinality(cardinality);
request.setEntity(dsdSet);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.DSD_CARD_UPDATE);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
retSet = (SDSet) response.getEntity();
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return retSet;
}
Aggregations