src/main/java/pityoulish/tickets/TicketImpl.java
public final void validate(TicketManager creator, String username,
                             InetAddress address, String host, String token)
    throws TicketException
  {
    if (creator == null)
       throw new NullPointerException("TicketManager");
    if (token == null)
       throw new NullPointerException("token");

    // required attribute matches
    if (issuedBy != creator)
       throw new TicketException(Catalog.WRONG_TICKET_MANAGER.lookup());
    if (!ticketToken.equals(token))
       throw new TicketException(Catalog.WRONG_TOKEN.lookup());

    // optional attribute matches
    if ((username != null) && !issuedToUsername.equals(username))
       throw new TicketException(Catalog.WRONG_USERNAME.lookup());
    if ((address != null) && (issuedToAddress != null) &&
        !issuedToAddress.equals(address))
       throw new TicketException(Catalog.WRONG_NETWORK_ADDRESS.lookup());
    if ((host != null) && (issuedToHost != null) &&
        !issuedToHost.equals(host))
       throw new TicketException(Catalog.WRONG_NETWORK_HOST.lookup());

    // validity checks
    if (isExpired())
       throw new TicketException(Catalog.TICKET_EXPIRED.lookup());

    // ok
  }
/**
   * Validates this ticket against the provided information.
   * And against the system time, for expiry.
   * If the ticket is not valid, an exception is thrown.
   *
   * @param creator     the ticket manager, mandatory
   * @param username    the username, or <code>null</code> to ignore
   * @param address     the address, or <code>null</code> to ignore
   * @param host        the client host, or <code>null</code> to ignore
   * @param token       the token, mandatory
   *
   * @throws TicketException
   *    if this ticket is not valid in the context of the arguments
   */
Validates this ticket against the provided information.
And against the system time, for expiry.
If the ticket is not valid, an exception is thrown.



@throws TicketException
if this ticket is not valid in the context of the arguments
Validates this ticket against the provided information . And against the system time for expiry . If the ticket is not valid an exception is thrown . @throws TicketException if this ticket is not valid in the context of the arguments
public final void validate(TicketManager creator, String username,
                             InetAddress address, String host, String token)
    throws TicketException
  {
    if (creator == null)
       throw new NullPointerException("TicketManager");
    if (token == null)
       throw new NullPointerException("token");
    if (issuedBy != creator)
       throw new TicketException(Catalog.WRONG_TICKET_MANAGER.lookup());
    if (!ticketToken.equals(token))
       throw new TicketException(Catalog.WRONG_TOKEN.lookup());
    if ((username != null) && !issuedToUsername.equals(username))
       throw new TicketException(Catalog.WRONG_USERNAME.lookup());
    if ((address != null) && (issuedToAddress != null) &&
        !issuedToAddress.equals(address))
       throw new TicketException(Catalog.WRONG_NETWORK_ADDRESS.lookup());
    if ((host != null) && (issuedToHost != null) &&
        !issuedToHost.equals(host))
       throw new TicketException(Catalog.WRONG_NETWORK_HOST.lookup());
    if (isExpired())
       throw new TicketException(Catalog.TICKET_EXPIRED.lookup());
  }
public final void validate ( TicketManager creator , String username , InetAddress address , String host , String token ) throws TicketException { if ( creator == null ) throw new NullPointerException ( "TicketManager" ) ; if ( token == null ) throw new NullPointerException ( "token" ) ; if ( issuedBy != creator ) throw new TicketException ( Catalog . WRONG_TICKET_MANAGER . lookup ( ) ) ; if ( ! ticketToken . equals ( token ) ) throw new TicketException ( Catalog . WRONG_TOKEN . lookup ( ) ) ; if ( ( username != null ) && ! issuedToUsername . equals ( username ) ) throw new TicketException ( Catalog . WRONG_USERNAME . lookup ( ) ) ; if ( ( address != null ) && ( issuedToAddress != null ) && ! issuedToAddress . equals ( address ) ) throw new TicketException ( Catalog . WRONG_NETWORK_ADDRESS . lookup ( ) ) ; if ( ( host != null ) && ( issuedToHost != null ) && ! issuedToHost . equals ( host ) ) throw new TicketException ( Catalog . WRONG_NETWORK_HOST . lookup ( ) ) ; if ( isExpired ( ) ) throw new TicketException ( Catalog . TICKET_EXPIRED . lookup ( ) ) ; }
Validates this ticket against the provided information.
Validates this ticket against the provided information .
// required attribute matches // optional attribute matches // validity checks // ok