Examples of SlideTokenImpl


Examples of org.apache.slide.common.SlideTokenImpl

                        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());
                              }
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

    }

    public void initialize() throws SourceException {
       
        CredentialsToken credentials = new CredentialsToken(m_principal);
        m_slideToken = new SlideTokenImpl(credentials);
       
        m_structure = m_nat.getStructureHelper();
        m_content = m_nat.getContentHelper();
        m_lock = m_nat.getLockHelper();
        m_macro = m_nat.getMacroHelper();
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

                               String password) throws Exception {
       
        String usersPath = nat.getNamespaceConfig().getUsersPath();
        String userUri = usersPath + "/" + username;
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Structure structure = nat.getStructureHelper();
        Content content = nat.getContentHelper();
       
        try {
           
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

                                String groupname) throws Exception {
       
        String groupsPath = nat.getNamespaceConfig().getGroupsPath();
        String groupUri = groupsPath + "/" + groupname;
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Structure structure = nat.getStructureHelper();
        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

                                String rolename) throws Exception {
       
        String rolesPath = nat.getNamespaceConfig().getRolesPath();
        String roleUri = rolesPath + "/" + rolename;
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Structure structure = nat.getStructureHelper();
        Content content = nat.getContentHelper();
       
        try {
            nat.begin();
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

        // user cannot delete itself
        if (callerUri.equals(objectUri)) {
            return;
        }
   
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Macro macro = nat.getMacroHelper();
   
        try {
            nat.begin();
   
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

    public static void addMember(NamespaceAccessToken nat,
                                 String caller,
                                 String objectUri,
                                 String subjectUri) throws Exception {
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Structure structure = nat.getStructureHelper();
        Content content = nat.getContentHelper();
       
        try {
           
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

    public static void removeMember(NamespaceAccessToken nat,
                                    String caller,
                                    String objectUri,
                                    String subjectUri) throws Exception {
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Content content = nat.getContentHelper();
       
        try {
           
            NodeRevisionDescriptors revisions = content.retrieve(slideToken,objectUri);
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

                                       String caller,
                                       String path) throws Exception {
                                          
        String uri = getUriFromPath(nat,path);
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Security security = nat.getSecurityHelper();
       
        List result = new ArrayList();
        try {
            nat.begin();
View Full Code Here

Examples of org.apache.slide.common.SlideTokenImpl

                                 String caller,
                                 String path) throws Exception {

        String uri = getUriFromPath(nat,path);
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Lock lock = nat.getLockHelper();
       
        List result = new ArrayList();
        try {
            nat.begin();
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.