Search in sources :

Example 6 with Props

use of org.apache.directory.fortress.core.model.Props in project directory-fortress-core by apache.

the class ConfigMgrRestImpl method delete.

/**
 * {@inheritDoc}
 */
@Override
public void delete(String name, Properties inProperties) throws SecurityException {
    VUtil.assertNotNull(name, GlobalErrIds.FT_CONFIG_NAME_NULL, CLS_NM + ".delete");
    VUtil.assertNotNull(inProperties, GlobalErrIds.FT_CONFIG_PROPS_NULL, CLS_NM + ".delete");
    FortRequest request = new FortRequest();
    Props inProps = RestUtils.getProps(inProperties);
    request.setEntity(inProps);
    request.setValue(name);
    String szRequest = RestUtils.marshal(request);
    String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.CFG_DELETE);
    FortResponse response = RestUtils.unmarshall(szResponse);
    if (response.getErrorCode() != 0) {
        throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
    }
}
Also used : FortResponse(org.apache.directory.fortress.core.model.FortResponse) SecurityException(org.apache.directory.fortress.core.SecurityException) Props(org.apache.directory.fortress.core.model.Props) FortRequest(org.apache.directory.fortress.core.model.FortRequest)

Aggregations

Props (org.apache.directory.fortress.core.model.Props)6 Properties (java.util.Properties)4 SecurityException (org.apache.directory.fortress.core.SecurityException)4 FortRequest (org.apache.directory.fortress.core.model.FortRequest)4 FortResponse (org.apache.directory.fortress.core.model.FortResponse)4 ObjectFactory (org.apache.directory.fortress.core.model.ObjectFactory)1