use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.
the class AccessLog method add.
public void add(AddInterceptorChain chain, Entry entry, LDAPConstraints constraints) throws LDAPException {
long start = System.currentTimeMillis();
long end = 0;
int result = -1;
Int op = new Int(0);
Int con = new Int(0);
this.getOpNum(chain.getSession(), con, op);
StringBuffer buf = new StringBuffer("ADD op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(entry.getEntry().getDN()).append("'");
logger.info(buf.toString());
try {
chain.nextAdd(entry, constraints);
result = 0;
} catch (LDAPException le) {
result = le.getResultCode();
throw le;
} finally {
end = System.currentTimeMillis();
if (result == -1) {
result = LDAPException.OPERATIONS_ERROR;
}
buf.setLength(0);
buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
logger.info(buf.toString());
}
}
use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.
the class AccessLog method search.
public void search(SearchInterceptorChain chain, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, Results results, LDAPSearchConstraints constraints) throws LDAPException {
long start = System.currentTimeMillis();
long end = 0;
int result = -1;
Int op = new Int(0);
Int con = new Int(0);
Int nentries = new Int(0);
this.getOpNum(chain.getSession(), con, op);
StringBuffer buf = new StringBuffer();
Iterator<Attribute> it = attributes.iterator();
while (it.hasNext()) {
buf.append(it.next().getAttribute().getName()).append(' ');
}
buf = new StringBuffer("SRCH op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" base='").append(base.getDN()).append("' filter='").append(filter.getRoot().toString()).append("' scope='").append(scope.getValue()).append("' attribs='").append(buf).append("'");
StringBuffer b = new StringBuffer();
b.append(AccessLog.ACCESS_LOG_SRCH_BEGIN).append(this.name);
chain.getRequest().put(b.toString(), start);
b.setLength(0);
b.append(AccessLog.ACCESS_LOG_SRCH_CON).append(this.name);
chain.getRequest().put(b.toString(), con);
b.setLength(0);
b.append(AccessLog.ACCESS_LOG_SRCH_OP).append(this.name);
chain.getRequest().put(b.toString(), op);
b.setLength(0);
b.append(AccessLog.ACCESS_LOG_SRCH_COUNT).append(this.name);
chain.getRequest().put(b.toString(), nentries);
logger.info(buf.toString());
try {
chain.nextSearch(base, scope, filter, attributes, typesOnly, results, constraints);
result = 0;
} catch (LDAPException le) {
result = le.getResultCode();
throw le;
} finally {
end = System.currentTimeMillis();
if (result == -1) {
result = LDAPException.OPERATIONS_ERROR;
}
buf.setLength(0);
buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
logger.info(buf.toString());
}
}
use of net.sourceforge.myvd.types.Int in project OpenUnison by TremoloSecurity.
the class AccessLog method modify.
public void modify(ModifyInterceptorChain chain, DistinguishedName dn, ArrayList<LDAPModification> mods, LDAPConstraints constraints) throws LDAPException {
long start = System.currentTimeMillis();
long end = 0;
int result = -1;
Int op = new Int(0);
Int con = new Int(0);
this.getOpNum(chain.getSession(), con, op);
StringBuffer buf = new StringBuffer("MOD op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("'");
logger.info(buf.toString());
try {
chain.nextModify(dn, mods, constraints);
result = 0;
} catch (LDAPException le) {
result = le.getResultCode();
throw le;
} finally {
end = System.currentTimeMillis();
if (result == -1) {
result = LDAPException.OPERATIONS_ERROR;
}
buf.setLength(0);
buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end - start);
logger.info(buf.toString());
}
}
Aggregations