Package org.apache.slide.common

Examples of org.apache.slide.common.NamespaceAccessToken


       
        if (path == null || path.length() == 0) {
            path = "/";
        }
       
        NamespaceAccessToken nat = m_repository.getNamespaceToken(namespace);
        if (nat == null) {
            throw new SourceException("No such namespace: " + namespace);
        }

        SourceParameters queryParameters = null;

        if (query == null || query.length() == 0) {
            queryParameters = new SourceParameters();
        } else {
            queryParameters = new SourceParameters(query);
        }

        String version = queryParameters.getParameter("version",null);
        String scope   = queryParameters.getParameter("scope",
            nat.getNamespaceConfig().getFilesPath());
       
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("scheme: " + scheme);
            getLogger().debug("principal: " + principal);
            getLogger().debug("namespace: " + namespace);
View Full Code Here


            final int lifetime = node.getAttributeAsInt("subscription-lifetime", 3600);
            final int notificationDelay = node.getAttributeAsInt("notification-delay", 0);

            final Subscriber contentSubscriber = new Subscriber() {
                public void notify(String uri, Map information) {
                    NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this), Domain.getDefaultNamespace());
                    try {
                        nat.begin();
                        Iterator keys = information.keySet().iterator();
                        while (keys.hasNext()) {
                            String key = keys.next().toString();
                            if ("uri".equals(key)) {
                                Uri theUri = nat.getUri(new SlideTokenImpl(new CredentialsToken("")), stripUri(information.get(key).toString()));
                                Store store = theUri.getStore();
                                if (store instanceof ExtendedStore) {
                                    Domain.log("Resetting cache for " + theUri, LOG_CHANNEL, Logger.INFO);
                                    ((ExtendedStore) store).removeObjectFromCache(theUri);
                                }
                            }
                        }
                        nat.commit();
                    } catch(Exception e) {
                      if (Domain.isEnabled(LOG_CHANNEL, Logger.ERROR)) {
                        Domain.log("Error clearing cache: " + e + ". See stderr for stacktrace.", LOG_CHANNEL, Logger.ERROR);
                        e.printStackTrace();
                      }
                    }
                }
            };

            final Subscriber structureSubscriber = new Subscriber() {
                public void notify(String uri, Map information) {
                    NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this), Domain.getDefaultNamespace());
                    try {
                        nat.begin();
                      Iterator keys = information.keySet().iterator();
                      while (keys.hasNext()) {
                          String key = keys.next().toString();
                          if ("uri".equals(key)) {
                              Uri theUri = nat.getUri(new SlideTokenImpl(new CredentialsToken("")), stripUri(information.get(key).toString()));
                              Store store = theUri.getParentUri().getStore();
                              if (store instanceof ExtendedStore) {
                                  Domain.log("Resetting cache for " + theUri.getParentUri(), LOG_CHANNEL, Logger.INFO);
                                  ((ExtendedStore) store).removeObjectFromCache(theUri.getParentUri());
                              }
                          }
                      }
                        nat.commit();
                    } catch(Exception e) {
                      if (Domain.isEnabled(LOG_CHANNEL, Logger.ERROR)) {
                        Domain.log("Error clearing cache: " + e + ". See stderr for stacktrace.", LOG_CHANNEL, Logger.ERROR);
                        e.printStackTrace();
                      }
View Full Code Here

       
        if (path == null || path.length() == 0) {
            path = "/";
        }
       
        NamespaceAccessToken nat = m_repository.getNamespaceToken(namespace);
        if (nat == null) {
            throw new SourceException("No such namespace: " + namespace);
        }

        SourceParameters queryParameters = null;

        if (query == null || query.length() == 0) {
            queryParameters = new SourceParameters();
        } else {
            queryParameters = new SourceParameters(query);
        }

        String version = queryParameters.getParameter("version",null);
        String scope   = queryParameters.getParameter("scope",
            nat.getNamespaceConfig().getFilesPath());
        boolean eventCaching = queryParameters.getParameterAsBoolean("event-caching",false);
       
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("scheme: " + scheme);
            getLogger().debug("principal: " + principal);
View Full Code Here

        if (namespace == null) {
            namespace = Domain.getDefaultNamespace();
        }
       
        // access the namespace
        NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this),namespace);
        m_content = nat.getContentHelper();
        m_security = nat.getSecurityHelper();
        m_usersPath = nat.getNamespaceConfig().getUsersPath();
        m_rolesPath = nat.getNamespaceConfig().getRolesPath();
    }
View Full Code Here

            context.getServletContext().setAttribute
                ("org.apache.slide.NamespaceName", namespaceName);
            ((ApplicationContext) context.getServletContext())
                .setAttributeReadOnly("org.apache.slide.NamespaceName");

            NamespaceAccessToken accessToken =
                domain.getNamespaceToken(namespaceName);

            SlideRealm slideRealm = new SlideRealm();
            slideRealm.setAccessToken(accessToken);
            slideRealm.setNamespace(namespaceName);
View Full Code Here

     * @return NamespaceBean representing the requested namespace
     */
    public NamespaceBean getNamespace(String name) {
       
        NamespaceBean bean = null;
        NamespaceAccessToken token =
            Domain.accessNamespace(new SecurityToken(this), name);
        if (token != null) {
            bean = new NamespaceBean(token, st);
        }
       
View Full Code Here

            }
            if (namespaceName.equals("")) {
                namespaceName = domain.getDefaultNamespace();
            }

            NamespaceAccessToken accessToken =
                domain.getNamespaceToken(namespaceName);

            SlideRealm slideRealm = new SlideRealm();
            slideRealm.setAccessToken(accessToken);
            slideRealm.setNamespace(namespaceName);
View Full Code Here

            }
            if (namespaceName.equals("")) {
                namespaceName = domain.getDefaultNamespace();
            }

            NamespaceAccessToken accessToken =
                domain.getNamespaceToken(namespaceName);

            SlideRealm slideRealm = new SlideRealm();
            slideRealm.setAccessToken(accessToken);
            slideRealm.setNamespace(namespaceName);
View Full Code Here

                return null;
            }

            SlideRepository sliderepository = (SlideRepository) repository;

            NamespaceAccessToken nat = sliderepository.getNamespaceToken(namespace);

            if (nat==null) {
                throw new SourceException("Repository with the namespace '"+
                                          namespace+"' couldn't be found");
            }
View Full Code Here

                return null;
            }

            SlideRepository sliderepository = (SlideRepository) repository;

            NamespaceAccessToken nat = sliderepository.getNamespaceToken(namespace);

            if (nat==null) {
                throw new SourceException("Repository with the namespace '"+
                                          namespace+"' couldn't be found");
            }
View Full Code Here

TOP

Related Classes of org.apache.slide.common.NamespaceAccessToken

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.