Package org.apache.wicket

Examples of org.apache.wicket.AccessStackPageMap$Access


  /**
   * @see org.apache.wicket.session.ISessionStore#createPageMap(java.lang.String)
   */
  public IPageMap createPageMap(String name)
  {
    return new AccessStackPageMap(name);
  }
View Full Code Here


            // request
            processRequest = false;
          }
          else if (pageMap instanceof AccessStackPageMap)
          {
            AccessStackPageMap accessStackPageMap = (AccessStackPageMap)pageMap;
            if (accessStackPageMap.getAccessStack().size() > 0)
            {
              final Access access = (Access)accessStackPageMap.getAccessStack()
                  .peek();

              final int pageId = Integer
                  .parseInt(Strings.firstPathComponent(requestParameters
                      .getComponentPath(), Component.PATH_SEPARATOR));
View Full Code Here

  {
    if (pageMap instanceof AccessStackPageMap)
    {
      synchronized (Session.get())
      {
        AccessStackPageMap accessPM = (AccessStackPageMap)pageMap;
        // Do we need to evict under this strategy?
        if (accessPM.getVersions() > maxVersions)
        {
          // Remove oldest entry from access stack
          final AccessStackPageMap.Access oldestAccess = (Access)accessPM.getAccessStack()
              .remove(0);
          final IPageMapEntry oldestEntry = pageMap.getEntry(oldestAccess.getId());

          // If entry is a page (cannot be null if we're evicting)
          if (oldestEntry instanceof Page)
          {
            Page page = (Page)oldestEntry;

            // If there is more than one version of this page
            if (page.getVersions() > 1)
            {
              // expire the oldest version
              page.expireOldestVersion();
            }
            else
            {
              // expire whole page
              accessPM.removeEntry(page);
            }
          }
          else
          {
            // If oldestEntry is not an instance of Page, then it is
            // some
            // custom, user-defined IPageMapEntry class and cannot
            // contain
            // versioning information, so we just remove the entry.
            if (oldestEntry != null)
            {
              accessPM.removeEntry(oldestEntry);
            }
          }
        }
      }
    }
View Full Code Here

        KeystoneAuthenticationToken fakeToken = buildFakeToken("HELLOWORLD");
        client.listTenants(fakeToken);
    }

    private KeystoneAuthenticationToken buildFakeToken(String tokenCode) {
        Access auth = new Access();
        Token tokenObject = new Token();
        tokenObject.setId(tokenCode);
        auth.setToken(tokenObject);
        return new KeystoneAuthenticationToken(auth);
    }
View Full Code Here

      StringBuilder stringBuilder = new StringBuilder( "Invalid access: ").append( issues.toString() );
      fail( stringBuilder.toString() );
    }

    // Build
    Access access = null;
    try
    { access = accessImpl.build(); }
    catch ( BuilderException e )
    { fail( "Build failed: " + e.getMessage() ); }
View Full Code Here

    accessImpl.setServiceBuilder( serviceBuilder );
    accessImpl.setUrlPath( urlPath );
    accessImpl.setDataSize( dataSize );
    accessImpl.setDataFormat( formatType );

    Access access;
    try
    { access = accessImpl.build(); }
    catch( BuilderException e )
    { fail( "Build failed: " + e.getMessage() ); return; }

    assertTrue( access.getService().getName().equals( serviceName ) );
    assertTrue( access.getUrlPath().equals( urlPath ) );
    assertTrue( access.getDataSize() == dataSize );
    assertTrue( access.getDataFormat().equals( formatType ) );
  }
View Full Code Here

    accessImpl.setServiceBuilder( serviceBuilder );
    accessImpl.setUrlPath( urlPath );
    accessImpl.setDataSize( dataSize );
    accessImpl.setDataFormat( formatType );

    Access access;
    try
    { access = accessImpl.build(); }
    catch( BuilderException e )
    { fail( "Build failed: " + e.getMessage() ); return; }
View Full Code Here

TOP

Related Classes of org.apache.wicket.AccessStackPageMap$Access

Copyright © 2018 www.massapicom. 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.