Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.AuthorizationManager


     * Test dropping connectors.  Once dropped, I should not be able to
     * get items from its interface.  Regression test for Issue 60.
     */
    instantiator.removeConnector("connector100");
    try {
      AuthorizationManager authz =
          instantiator.getAuthorizationManager("connector100");
      assertNull(authz);
    } catch (ConnectorNotFoundException e1) {
      assertTrue(true);
    }
View Full Code Here


    assertTrue(connectorExists(name));

    // Make sure that this connector has the correct type associated.
    assertEquals(config.getTypeName(), instantiator.getConnectorTypeName(name));

    AuthorizationManager authz = instantiator.getAuthorizationManager(name);
    assertNotNull(authz);

    AuthenticationManager authn = instantiator.getAuthenticationManager(name);
    assertNotNull(authn);
View Full Code Here

  @Override
  public Collection<AuthorizationResponse> authorizeDocids(String connectorName,
      List<String> docidList, AuthenticationIdentity identity) {
    try {
      AuthorizationManager authzManager =
          instantiator.getAuthorizationManager(connectorName);
      if (authzManager == null) {
        // This is a bad situation.  This means the Connector has feed the
        // content in such a way that it is being asked to authorize access to
        // that content and yet it doesn't implement the AuthorizationManager
        // interface.  Log the situation and return the empty result.
        LOGGER.warning("Connector " + connectorName
            + " is being asked to authorize documents but has not implemented"
            + " the AuthorizationManager interface.");
        return null;
      }
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("AUTHORIZE: " + identity + ": docids = " + docidList);
      }
      Collection<AuthorizationResponse> results =
          authzManager.authorizeDocids(docidList, identity);
      if (LOGGER.isLoggable(Level.FINE)) {
         LOGGER.fine("AUTHORIZATION: " + identity + ": authorized for "
            + results.size() + " of " + docidList.size() + " documents.");
      }
      if (LOGGER.isLoggable(Level.FINEST)) {
View Full Code Here

        new MockRepositoryEventList("MockRepositoryEventLog2.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
    Session session = repo.login(creds);
    AuthorizationManager authorizationManager =
        new JcrAuthorizationManager(session);

    {
      String username = "joe";
View Full Code Here

        new MockRepositoryEventList("MockRepositoryEventLogAcl.txt");
    MockRepository r = new MockRepository(mrel);
    MockJcrRepository repo = new MockJcrRepository(r);
    Credentials creds = new SimpleCredentials("admin", "admin".toCharArray());
    Session session = repo.login(creds);
    AuthorizationManager authorizationManager =
        new JcrAuthorizationManager(session);
    {
      String username = "joe";

      Map<String, Boolean> expectedResults = new HashMap<String, Boolean>();
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.AuthorizationManager

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.