Examples of BindRequest


Examples of com.logica.smpp.pdu.BindRequest

    TCPIPConnection connection = new TCPIPConnection (myHost, myPort);
    connection.setReceiveTimeout (cReceiveTimeout);
    mySession = new Session (connection);

    // configure the bind request
    BindRequest request = null;
    if (access.equals (SmppAccessType.eTransmitter)) {
      request = new BindTransmitter ();
    }
    else if (access.equals (SmppAccessType.eReceiver)) {
      request = new BindReceiver ();
    }
    else if (access.equals (SmppAccessType.eTransciever)) {
      request = new BindTransciever ();
    }
    else {
      myLog.error ("open :access type {} not recognissed.", access);
      return false;
    }

    try {
      request.setSystemId (myUsername);
      request.setPassword (myPassword);
      request.setSystemType (system.getCode ());
    }
    catch (WrongLengthOfStringException exc) {
      myLog.error ("open: failed setting parameters for request", exc);
      return false;
    }
    request.setInterfaceVersion ((byte)0x34);
    request.setAddressRange (addressRange);

    myLog.debug("open: bind pdu: {}", request.debugString ());
    return bind (request, listener);
  }
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.BindRequest

  public static final int NOT_IDEMPOTENT = -1;

  public static boolean isIdempotent(JndiRequest request) {
    if (request instanceof JndiReadRequest) return true;
    if (request instanceof BindRequest) {
      BindRequest br = (BindRequest)request;
      return br.isRebind();
    }
    return false;
  }
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.BindRequest

                       name + ',' + obj + ')');
    if (obj instanceof Referenceable) {
      obj = ((Referenceable)obj).getReference();
    }
    JndiReply reply = connection.invoke(
      new BindRequest(merge(contextPath, name), obj));
    if (reply instanceof JndiError) {
      NamingException exc = ((JndiError)reply).getException();
      exc.fillInStackTrace();
      throw exc;
    }
View Full Code Here

Examples of fr.dyade.aaa.jndi2.msg.BindRequest

                       name + ',' + obj + ')');
    if (obj instanceof Referenceable) {
      obj = ((Referenceable)obj).getReference();
    }
    JndiReply reply = connection.invoke(
      new BindRequest(merge(contextPath, name), obj, true));
    if (reply instanceof JndiError) {
      NamingException exc = ((JndiError)reply).getException();
      exc.fillInStackTrace();
      throw exc;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

    /**
     * {@inheritDoc}
     */
    public void anonymousBind() throws LdapException
    {
        BindRequest bindRequest = new BindRequestImpl();
        bindRequest.setName( "" );
        bindRequest.setCredentials( ( byte[] ) null );

        BindResponse bindResponse = bind( bindRequest );

        processResponse( bindResponse );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

    @Ignore("Activate and fix when DIRAPI-36 (Provide a SaslBindRequest extending BindRequest that can be used in LdapConnection.bind(...) method) is solved")
    public void testSaslBindNoMech() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
        BindRequest bindReq = new BindRequestImpl();
        bindReq.setCredentials( "secret" );
        bindReq.setDn( userDn );
        bindReq.setSaslMechanism( "" ); // invalid mechanism
        bindReq.setSimple( false );

        try
        {
            connection.bind( bindReq );
            fail();
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

        AddResponse addResp = adminConnection.add( addRequest );
        assertEquals( ResultCodeEnum.SUCCESS, addResp.getLdapResult().getResultCode() );
        PasswordPolicy respCtrl = getPwdRespCtrl( addResp );
        assertNull( respCtrl );

        BindRequest bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
        bindReq.setCredentials( "1234" ); // wrong password
        bindReq.addControl( PP_REQ_CTRL );

        LdapConnection userConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        for ( int i = 0; i < 3; i++ )
        {
            userConnection.bind( bindReq );
            assertFalse( userConnection.isAuthenticated() );
        }

        // Added an extra wait (for Windows)
        Thread.sleep( 2000 );

        userEntry = adminConnection.lookup( userDn, SchemaConstants.ALL_ATTRIBUTES_ARRAY );
        Attribute pwdAccountLockedTime = userEntry.get( PasswordPolicySchemaConstants.PWD_ACCOUNT_LOCKED_TIME_AT );
        assertNotNull( pwdAccountLockedTime );
        assertEquals( "000001010000Z", pwdAccountLockedTime.getString() );

        bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
        bindReq.setCredentials( "12345" ); // correct password
        bindReq.addControl( PP_REQ_CTRL );
        userConnection.bind( bindReq );
        assertFalse( userConnection.isAuthenticated() ); // but still fails cause account is locked

        userConnection.close();
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

        Dn userDn = new Dn( "cn=userMaxAgeNoGraceAuthNLimit,ou=system" );
        String password = "12345";

        addUser( adminConnection, "userMaxAgeNoGraceAuthNLimit", password );

        BindRequest bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
        bindReq.setCredentials( password.getBytes() );
        bindReq.addControl( PP_REQ_CTRL );

        LdapConnection userCon = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
        userCon.setTimeOut( 0 );

        Thread.sleep( 1000 ); // sleep for one second so that the password expire warning will be sent
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

        Dn userDn = new Dn( "cn=userMaxAgeWithGraceAuthNLimit,ou=system" );
        String password = "12345";

        addUser( adminConnection, "userMaxAgeWithGraceAuthNLimit", password );

        BindRequest bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
        bindReq.setCredentials( password.getBytes() );
        bindReq.addControl( PP_REQ_CTRL );

        LdapConnection userCon = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
        userCon.setTimeOut( 0 );

        Thread.sleep( 1000 ); // sleep for one second so that the password expire warning will be sent
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.BindRequest

        Dn userDn = new Dn( "cn=userMaxAgeWithGraceExpire,ou=system" );
        String password = "12345";

        addUser( adminConnection, "userMaxAgeWithGraceExpire", password );

        BindRequest bindReq = new BindRequestImpl();
        bindReq.setDn( userDn );
        bindReq.setCredentials( password.getBytes() );
        bindReq.addControl( PP_REQ_CTRL );

        LdapConnection userCon = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
        userCon.setTimeOut( 0 );

        Thread.sleep( 1000 ); // sleep for one second so that the password expire warning will be sent
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.