本文整理汇总了Java中org.apache.directory.fortress.core.model.Bind类的典型用法代码示例。如果您正苦于以下问题:Java Bind类的具体用法?Java Bind怎么用?Java Bind使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bind类属于org.apache.directory.fortress.core.model包,在下文中一共展示了Bind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createResponse
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
* ************************************************************************************************************************************
* BEGIN AUDIT
* **************************************************************************************************************************************
*/
/* No qualifier */ FortResponse searchBinds(FortRequest request)
{
FortResponse response = createResponse();
try
{
UserAudit inAudit = (UserAudit) request.getEntity();
AuditMgr auditMgr = AuditMgrFactory.createInstance( request.getContextId() );
auditMgr.setAdmin( request.getSession() );
List<Bind> outAudit = auditMgr.searchBinds( inAudit );
response.setEntities( outAudit );
}
catch ( SecurityException se )
{
createError( response, log, se );
}
return response;
}
示例2: findBinds
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
*
*/
void findBinds()
{
ReaderUtil.clearScreen();
try
{
System.out.println("Enter userId value to search Audit Binds with or null to retrieve all:");
String val = ReaderUtil.readLn();
UserAudit uAudit = new UserAudit();
uAudit.setUserId(val);
List<Bind> list = am.searchBinds(uAudit);
printAuthNs(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("findBinds caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例3: getList
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
private List<Bind> getList( UserAudit userAudit )
{
List<Bind> bindList = null;
try
{
bindList = auditMgr.searchBinds( userAudit );
}
catch ( SecurityException se )
{
String error = ".getList caught SecurityException=" + se;
LOG.warn( error );
}
return bindList;
}
示例4: searchBinds
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<Bind> searchBinds(UserAudit uAudit)
throws SecurityException
{
VUtil.assertNotNull(uAudit, GlobalErrIds.AUDT_INPUT_NULL, CLS_NM + ".searchBinds");
List<Bind> 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_BINDS);
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;
}
示例5: getBindEntityFromLdapEntry
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
* @param le
* @return
* @throws LdapInvalidAttributeValueException
* @throws LdapException
*/
private Bind getBindEntityFromLdapEntry( Entry le, long sequence ) throws LdapInvalidAttributeValueException
{
Bind auditBind = new ObjectFactory().createBind();
auditBind.setSequenceId( sequence );
auditBind.setCreateTimestamp( getAttribute( le, CREATETIMESTAMP ) );
auditBind.setCreatorsName( getAttribute( le, CREATORSNAME ) );
auditBind.setEntryCSN( getAttribute( le, ENTRYCSN ) );
auditBind.setEntryDN( getAttribute( le, ENTRYDN ) );
auditBind.setEntryUUID( getAttribute( le, ENTRYUUID ) );
auditBind.setHasSubordinates( getAttribute( le, HASSUBORDINATES ) );
auditBind.setModifiersName( getAttribute( le, MODIFIERSNAME ) );
auditBind.setModifyTimestamp( getAttribute( le, MODIFYTIMESTAMP ) );
auditBind.setObjectClass( getAttribute( le, OBJECTCLASS ) );
auditBind.setReqAuthzID( getAttribute( le, REQUAUTHZID ) );
auditBind.setReqControls( getAttribute( le, REQCONTROLS ) );
auditBind.setReqDN( getAttribute( le, REQDN ) );
auditBind.setReqEnd( getAttribute( le, REQEND ) );
auditBind.setReqMethod( getAttribute( le, REQMETHOD ) );
auditBind.setReqResult( getAttribute( le, REQRESULT ) );
auditBind.setReqSession( getAttribute( le, REQSESSION ) );
auditBind.setReqStart( getAttribute( le, REQSTART ) );
auditBind.setReqType( getAttribute( le, REQTYPE ) );
auditBind.setReqVersion( getAttribute( le, REQVERSION ) );
auditBind.setStructuralObjectClass( getAttribute( le, STRUCTURALOBJECTCLASS ) );
return auditBind;
}
示例6: searchBinds
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<Bind> searchBinds(UserAudit uAudit)
throws SecurityException
{
String methodName = "searchBinds";
assertContext(CLS_NM, methodName, uAudit, GlobalErrIds.AUDT_INPUT_NULL);
checkAccess(CLS_NM, methodName);
return auditP.searchBinds(uAudit);
}
示例7: getBindReport
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
*
*/
void getBindReport()
{
ReaderUtil.clearScreen();
try
{
System.out.println("Enter userId value to search Audit Binds with or null to retrieve all:");
String val = ReaderUtil.readLn();
UserAudit uAudit = new UserAudit();
uAudit.setUserId(val);
System.out.println("Check for failed only? (Enter 'Y' for yes or 'N' for no");
val = ReaderUtil.readLn();
if (val.equalsIgnoreCase("Y"))
uAudit.setFailedOnly(true);
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
List<Bind> list = am.searchBinds(uAudit);
printAuthNReport(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getBindReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例8: searchBinds
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
*
* @param msg
* @param uArray
*/
private static void searchBinds( String msg, String[][] uArray )
{
LogUtil.logIt( msg );
try
{
AuditMgr auditMgr = getManagedAuditMgr();
for ( String[] usr : uArray )
{
User user = UserTestData.getUser( usr );
// now search for successful authentications:
UserAudit uAudit = new UserAudit();
uAudit.setUserId( user.getUserId() );
uAudit.setFailedOnly( false );
List<Bind> binds = auditMgr.searchBinds( uAudit );
assertNotNull( binds );
assertTrue(
CLS_NM + "searchBinds failed search for successful authentication user [" + user.getUserId() + "]",
binds.size() > 0 );
// now search for failed authentications:
uAudit.setFailedOnly( true );
binds = auditMgr.searchBinds( uAudit );
assertNotNull( binds );
assertTrue( CLS_NM + "searchBinds failed search for failed authentication user [" + user.getUserId()
+ "]", binds.size() > 0 );
}
LOG.debug( "searchBinds successful" );
}
catch ( SecurityException ex )
{
LOG.error(
"searchBinds: failed with SecurityException rc=" + ex.getErrorId() + ", msg="
+ ex.getMessage(), ex );
fail( ex.getMessage() );
}
}
示例9: AuditBindDetailPanel
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
public AuditBindDetailPanel( String id, Displayable display )
{
super( id );
this.auditMgr.setAdmin( SecUtils.getSession( this ) );
this.reviewMgr.setAdmin( SecUtils.getSession( this ) );
this.detailForm = new AuditBindDetailForm( GlobalIds.DETAIL_FIELDS,
new CompoundPropertyModel<>( new Bind() ) );
this.display = display;
add( detailForm );
}
示例10: AuditBindDetailForm
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
public AuditBindDetailForm( String id, final IModel<Bind> model )
{
super( id, model );
add( new Label( GlobalIds.REQ_DN ) );
add( new Label( GlobalIds.REQ_RESULT ) );
add( new Label( GlobalIds.REQ_START ) );
userPanel = new UserAuditDetailPanel( GlobalIds.USERAUDITDETAILPANEL, new CompoundPropertyModel<>(
new User() ) );
add( userPanel );
setOutputMarkupId( true );
}
示例11: onEvent
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
@Override
public void onEvent( final IEvent<?> event )
{
if ( event.getPayload() instanceof SelectModelEvent )
{
SelectModelEvent modelEvent = ( SelectModelEvent ) event.getPayload();
Bind bind = ( Bind ) modelEvent.getEntity();
this.setModelObject( bind );
String msg = "Bind: " + bind.getReqDN() + " has been selected";
LOG.debug( ".onEvent SelectModelEvent: " + bind.getReqDN() );
display.setMessage( msg );
component = detailForm;
}
else if ( event.getPayload() instanceof AjaxRequestTarget )
{
// only add the form to ajax target if something has changed...
if ( component != null )
{
AjaxRequestTarget target = ( ( AjaxRequestTarget ) event.getPayload() );
LOG.debug( ".onEvent AjaxRequestTarget: " + target.toString() );
target.add( component );
component = null;
}
display.display( ( AjaxRequestTarget ) event.getPayload() );
}
}
示例12: init
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
@SuppressWarnings( "Convert2Diamond" )
private void init( UserAudit userAudit )
{
IModel<SerializableList<Bind>> pageModel = new AuditBindListModel( userAudit, SecUtils.getSession( this ) );
setDefaultModel( pageModel );
createAndLoadGrid();
this.listForm = new Form( "bindform" );
this.listForm.addOrReplace( grid );
this.listForm.setModel( new CompoundPropertyModel<UserAudit>( userAudit ) );
addEditFields();
addButtons();
add( this.listForm );
}
示例13: createTreeModel
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
private DefaultTreeModel createTreeModel( List<Bind> binds )
{
DefaultTreeModel model;
rootNode = new DefaultMutableTreeNode( null );
model = new DefaultTreeModel( rootNode );
if ( binds == null )
LOG.debug( "no Authentications found" );
else
{
LOG.debug( "Binds found:" + binds.size() );
info( "Loading " + binds.size() + " objects into list panel" );
loadTree( binds );
}
return model;
}
示例14: loadTree
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
private void loadTree( List<Bind> binds )
{
for ( Bind bind : binds )
{
Date start = null;
try
{
start = TUtil.decodeGeneralizedTime( bind.getReqStart() );
}
catch ( ParseException pe )
{
LOG.warn( "ParseException=" + pe.getMessage() );
}
if ( start != null )
{
SimpleDateFormat formatter = new SimpleDateFormat( GlobalIds.AUDIT_TIMESTAMP_FORMAT );
String formattedDate = formatter.format( start );
bind.setReqStart( formattedDate );
}
if ( bind.getReqResult().equals( GlobalIds.BIND_SUCCESS_CODE ) )
{
bind.setReqResult( GlobalIds.SUCCESS );
}
else
{
bind.setReqResult( GlobalIds.FAILURE );
}
bind.setReqDN( AuditUtils.getAuthZId( bind.getReqDN() ) );
rootNode.add( new DefaultMutableTreeNode( bind ) );
}
}
示例15: getObject
import org.apache.directory.fortress.core.model.Bind; //导入依赖的package包/类
/**
* This data is bound for RoleListPanel
*
* @return T extends List<Role> roles data will be bound to panel data view component.
*/
@Override
public SerializableList<Bind> getObject()
{
if ( binds != null )
{
LOG.debug( ".getObject count: " + binds.size() );
return binds;
}
// if caller did not set userId return an empty list:
if ( ( userAudit == null ) ||
(
!StringUtils.isNotEmpty( userAudit.getUserId() ) &&
( userAudit.getBeginDate() == null ) &&
( userAudit.getEndDate() == null )
)
)
{
LOG.debug(".getObject null");
binds = new SerializableList<>( new ArrayList<Bind>() );
}
else
{
// get the list of matching bind records from fortress:
binds = new SerializableList<>( getList(userAudit) );
}
return binds;
}