Examples of UnlocalizableTextResourceKey


Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }

      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {}
    };

    // Just use a normal auth handler
    server = Intrepid.create( new IntrepidSetup().vmidHint(
      "server" ).authHandler( handler ).serverPort( 0 ) );
    final int server_port = server.getServerPort().intValue();
    VMID original_server_vmid = server.getLocalVMID();
    System.out.println( "Server VMID: " + original_server_vmid );
    client = Intrepid.create( new IntrepidSetup().vmidHint( "client" ).authHandler(
      new AuthenticationHandler() {
        @Override
        public UserContextInfo checkConnection( ConnectionArgs connection_args,
          SocketAddress remote_address, Object session_source )
          throws ConnectionAuthFailureException {

//          System.out.println( "--- checkConnection(" + connection_args +
//            "," + remote_address + "," + session_source + ")" );

          if ( connection_args instanceof UserCredentialsConnectionArgs ) {
            String user =
              ( ( UserCredentialsConnectionArgs ) connection_args ).getUser();
            if ( !user.equals( "reden" ) ) {
              throw new ConnectionAuthFailureException(
                new UnlocalizableTextResourceKey( "Bad user: " + user ) );
            }

            UserCredentialsConnectionArgs uargs =
              ( UserCredentialsConnectionArgs ) connection_args;
            return new SimpleUserContextInfo( uargs.getUser() );
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }


      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {
        auth_error_slot.set( error );
      }
    };

    // Just use a normal auth handler
    server = Intrepid.create( new IntrepidSetup().vmidHint(
      "server" ).authHandler( handler ).serverPort( 0 ) );
    final int server_port = server.getServerPort().intValue();
    VMID original_server_vmid = server.getLocalVMID();
    System.out.println( "Server VMID: " + original_server_vmid );
    client = Intrepid.create( new IntrepidSetup().vmidHint( "client" ).authHandler(
      new AuthenticationHandler() {
        @Override
        public UserContextInfo checkConnection( ConnectionArgs connection_args,
          SocketAddress remote_address, Object session_source )
          throws ConnectionAuthFailureException {

//          System.out.println( "--- checkConnection(" + connection_args +
//            "," + remote_address + "," + session_source + ")" );

          if ( connection_args instanceof UserCredentialsConnectionArgs ) {
            String user =
              ( ( UserCredentialsConnectionArgs ) connection_args ).getUser();
            if ( !user.equals( "reden" ) ) {
              throw new ConnectionAuthFailureException(
                new UnlocalizableTextResourceKey( "Bad user: " + user ) );
            }

            UserCredentialsConnectionArgs uargs =
              ( UserCredentialsConnectionArgs ) connection_args;
            return new SimpleUserContextInfo( uargs.getUser() );
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserCredentialsConnectionArgs getUserCredentials(
        SocketAddress remote_address,
        Object session_source ) throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Test rejection" ) );
      }

      @Override
      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }

      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {}
    };
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }

      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {}
    };
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }

      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {}
    };
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      public UserContextInfo checkConnection( ConnectionArgs connection_args,
        SocketAddress remote_address, Object session_source )
        throws ConnectionAuthFailureException {

        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Shouldn't get here" ) );
      }

      @Override
      public void notifyUserCredentialFailure( ResourceKey<String> error ) {}
    };
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

  }


  public void testChannelReject() throws IOException {
    ChannelAcceptor acceptor = new TestAcceptor(
      new UnlocalizableTextResourceKey( "Test reject" ) );

    server = Intrepid.create(
      new IntrepidSetup().openServer().channelAcceptor( acceptor ) );
    client = Intrepid.create( null );
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

*/
public class ObjectNotBoundExceptionTest extends TestCase {
 
  public void testSerialization() throws Exception {
    ObjectNotBoundException original =
      new ObjectNotBoundException( new UnlocalizableTextResourceKey( "Test" ) );

    ObjectNotBoundException clone = ( ObjectNotBoundException )
      IOKit.deserialize( IOKit.serialize( original ) );
    assertEquals( "Test", clone.getMessage() );
    assertEquals( "Test", clone.getLocalizedMessage() );
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

    test_cases.add( new ChannelInitResponseIMessage( 0 ) );
    test_cases.add( new ChannelInitResponseIMessage( 10 ) );
    test_cases.add( new ChannelInitResponseIMessage( Integer.MAX_VALUE ) );
    test_cases.add( new ChannelInitResponseIMessage( 5, null ) );
    test_cases.add( new ChannelInitResponseIMessage( 5,
      new UnlocalizableTextResourceKey( "Blah" ) ) );

    for( ChannelInitResponseIMessage message : test_cases ) {
      buffer.clear();

      IMessageEncoder.encodeChannelInitResponse( message, buffer );
View Full Code Here

Examples of com.starlight.locale.UnlocalizableTextResourceKey

      SocketAddress remote_address, Object session_source )
      throws ConnectionAuthFailureException {

      if ( !( connection_args instanceof UserCredentialsConnectionArgs ) ) {
        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Bad args type: " +
          connection_args ) );
      }

      UserCredentialsConnectionArgs credentials =
        ( UserCredentialsConnectionArgs ) connection_args;

      if ( !"reden".equals( credentials.getUser() ) ) {
        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Bad user" ) );
      }

      if ( !"12345".equals( new String( credentials.getPassword() ) ) ) {
        throw new ConnectionAuthFailureException(
          new UnlocalizableTextResourceKey( "Bad password" ) );
      }

      return new SimpleUserContextInfo( credentials.getUser() );
    }
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.