public EntryImpl ( final ConnectionDescriptor connectionDescriptor, final ConnectionService connectionService, final ServiceRegistration<?> serviceRegistration ) { this.connectionDescriptor = connectionDescriptor; this.connectionService = connectionService; this.serviceRegistration = serviceRegistration; connectionService.getConnection ().addConnectionStateListener ( this ); }
@Override public void dispose () { this.connectionService.getConnection ().removeConnectionStateListener ( this ); try { this.serviceRegistration.unregister (); } finally { this.connectionService.dispose (); } } }
@Override public String getLabel () { return this.connection.getConnectionInformation ().toMaskedString (); }
return connection.getState (); return connection.getSessionProperties ().get ( ( (SessionPropertyDescriptor)id ).getKey () );
if ( connection != null ) for ( final String key : connection.getSessionProperties ().keySet () )
protected void performConnect () { if ( this.controller != null ) { this.controller.connect ( this.connectCallbackHandler ); } else { this.connection.connect ( this.connectCallbackHandler ); } }
protected void performDisconnect () { if ( this.controller != null ) { this.controller.disconnect (); } else { this.connection.disconnect (); } }
@Override public void dispose () { logger.info ( "Disposing: {}", this.connection ); disconnect (); if ( this.controller != null ) { this.controller.dispose (); } if ( this.connection != null ) { this.connection.dispose (); } }
@Override public boolean hasRole ( final String role ) { try { if ( this.sessionPrivileges ) { return this.connectionService.getConnection ().getPrivileges ().contains ( role ); } else { final Map<String, String> properties = this.connectionService.getConnection ().getSessionProperties (); final String value = properties.get ( "session.privilege." + role ); if ( value == null ) { return false; } return Boolean.parseBoolean ( value ); } } catch ( final NullPointerException e ) { return false; } } }
return connection.getState (); return connection.getSessionProperties ().get ( ( (SessionPropertyDescriptor)id ).getKey () );
if ( connection != null ) for ( final String key : connection.getSessionProperties ().keySet () )
@Override public void dispose () { this.connectionService.getConnection ().removeConnectionStateListener ( this ); try { this.serviceRegistration.unregister (); } finally { this.connectionService.dispose (); } } }
public EntryImpl ( final ConnectionDescriptor connectionDescriptor, final ConnectionService connectionService, final ServiceRegistration<?> serviceRegistration ) { this.connectionDescriptor = connectionDescriptor; this.connectionService = connectionService; this.serviceRegistration = serviceRegistration; connectionService.getConnection ().addConnectionStateListener ( this ); }
properties.put ( ConnectionService.CONNECTION_URI, this.connectionService.getConnection ().getConnectionInformation ().toString () ); properties.put ( Constants.SERVICE_PID, servicePid ); if ( this.loginConnection.getPriority () != null )
private void markCompleteOk () { this.complete = true; this.ok = true; this.connectionService.getConnection ().removeConnectionStateListener ( this.connectionStateListener ); checkRegister (); }
@Override public void startLogin () { notifyStateChange ( this.connectionService, ConnectionState.CLOSED, null, false ); this.connectionService.getConnection ().addConnectionStateListener ( this.connectionStateListener ); this.connectionService.setConnectCallbackHandler ( this.callbackHandler ); // we do call connect for lazy connections since the ConnectionService decides when to connect this.connectionService.connect (); }
@Override public synchronized void dispose () { if ( this.registrations != null ) { for ( final ServiceRegistration<?> reg : this.registrations ) { reg.unregister (); } this.registrations = null; } if ( this.connectionService != null ) { if ( this.connectionStateListener != null ) { this.connectionService.getConnection ().removeConnectionStateListener ( this.connectionStateListener ); } this.connectionService.dispose (); this.connectionService = null; } }
private synchronized void createConnection () { this.entry = Activator.getDefaultConectionManager ().getConnection ( this.info ); if ( this.entry != null ) { this.entry.getConnectionService ().getConnection ().addConnectionStateListener ( this ); setConnectionService ( this.entry.getConnectionService () ); setConnectionState ( ConnectionState.CLOSED ); setConnectionError ( null ); } }
private synchronized void destroyConnection () { if ( this.entry != null ) { this.entry.getConnectionService ().getConnection ().removeConnectionStateListener ( this ); this.entry.dispose (); } setConnectionService ( null ); setConnectionState ( null ); setConnectionError ( null ); }
private synchronized void createConnection () { this.entry = Activator.getDefaultConectionManager ().getConnection ( this.info ); if ( this.entry != null ) { this.entry.getConnectionService ().getConnection ().addConnectionStateListener ( this ); setConnectionService ( this.entry.getConnectionService () ); setConnectionState ( ConnectionState.CLOSED ); setConnectionError ( null ); } }