use of org.apache.directory.fortress.core.model.AuthZ in project directory-fortress-core by apache.
the class AuditMgrRestImpl method searchInvalidUsers.
/**
* {@inheritDoc}
*/
@Override
public List<AuthZ> searchInvalidUsers(UserAudit uAudit) throws SecurityException {
VUtil.assertNotNull(uAudit, GlobalErrIds.AUDT_INPUT_NULL, CLS_NM + ".searchInvalidUsers");
List<AuthZ> outRecords;
FortRequest request = new FortRequest();
request.setContextId(this.contextId);
request.setEntity(uAudit);
if (this.adminSess != null) {
request.setSession(adminSess);
}
String szRequest = RestUtils.marshal(request);
String szResponse = RestUtils.getInstance().post(szRequest, HttpIds.AUDIT_INVLD);
FortResponse response = RestUtils.unmarshall(szResponse);
if (response.getErrorCode() == 0) {
outRecords = response.getEntities();
// do not return a null list to the caller:
if (outRecords == null) {
outRecords = new ArrayList<>();
}
} else {
throw new SecurityException(response.getErrorCode(), response.getErrorMessage());
}
return outRecords;
}
use of org.apache.directory.fortress.core.model.AuthZ in project directory-fortress-core by apache.
the class AuditDAO method getAuthzEntityFromLdapEntry.
/**
* @param le
* @return
* @throws LdapInvalidAttributeValueException
* @throws LdapException
*/
private AuthZ getAuthzEntityFromLdapEntry(Entry le, long sequence) throws LdapInvalidAttributeValueException {
// these attrs also on audit bind OC:
AuthZ authZ = new ObjectFactory().createAuthZ();
authZ.setSequenceId(sequence);
authZ.setCreateTimestamp(getAttribute(le, CREATETIMESTAMP));
authZ.setCreatorsName(getAttribute(le, CREATORSNAME));
authZ.setEntryCSN(getAttribute(le, ENTRYCSN));
authZ.setEntryDN(getAttribute(le, ENTRYDN));
authZ.setEntryUUID(getAttribute(le, ENTRYUUID));
authZ.setHasSubordinates(getAttribute(le, HASSUBORDINATES));
authZ.setModifiersName(getAttribute(le, MODIFIERSNAME));
authZ.setModifyTimestamp(getAttribute(le, MODIFYTIMESTAMP));
authZ.setObjectClass(getAttribute(le, OBJECTCLASS));
authZ.setReqAuthzID(getAttribute(le, REQUAUTHZID));
authZ.setReqControls(getAttribute(le, REQCONTROLS));
authZ.setReqDN(getAttribute(le, REQDN));
authZ.setReqEnd(getAttribute(le, REQEND));
authZ.setReqResult(getAttribute(le, REQRESULT));
authZ.setReqSession(getAttribute(le, REQSESSION));
authZ.setReqStart(getAttribute(le, REQSTART));
authZ.setReqType(getAttribute(le, REQTYPE));
authZ.setStructuralObjectClass(getAttribute(le, STRUCTURALOBJECTCLASS));
// these attrs only on audit search OC:
authZ.setReqAttr(getAttribute(le, REQATTR));
authZ.setReqAttrsOnly(getAttribute(le, REQATTRSONLY));
authZ.setReqDerefAliases(getAttribute(le, REQDREFALIASES));
authZ.setReqEntries(getAttribute(le, REQENTRIES));
authZ.setReqFilter(getAttribute(le, REQFILTER));
authZ.setReqScope(getAttribute(le, REQSCOPE));
authZ.setReqSizeLimit(getAttribute(le, REQSIZELIMIT));
authZ.setReqTimeLimit(getAttribute(le, REQTIMELIMIT));
return authZ;
}
Aggregations