001/*
002 * ModeShape (http://www.modeshape.org)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *       http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.modeshape.web.client;
017
018import org.modeshape.web.shared.JcrNode;
019import com.google.gwt.user.client.rpc.AsyncCallback;
020import java.util.Collection;
021import java.util.Date;
022import org.modeshape.web.shared.BackupParams;
023import org.modeshape.web.shared.JcrNodeType;
024import org.modeshape.web.shared.JcrPermission;
025import org.modeshape.web.shared.JcrRepositoryDescriptor;
026import org.modeshape.web.shared.RepositoryName;
027import org.modeshape.web.shared.RestoreParams;
028import org.modeshape.web.shared.ResultSet;
029import org.modeshape.web.shared.Stats;
030
031/**
032 * The async counterpart of
033 * <code>GreetingService</code>.
034 */
035public interface JcrServiceAsync {
036
037    public void getRequestedURI(AsyncCallback<String> result);
038    
039    public void getRepositories(AsyncCallback<Collection<RepositoryName>> results);
040    public void findRepositories(String criteria, AsyncCallback<Collection<RepositoryName>> results);
041    public void getWorkspaces(String name, AsyncCallback<String[]> result);
042    
043
044    public void getUserName(AsyncCallback<String> cb);
045    
046    public void login(String userName, String password, AsyncCallback<?> cb);
047    
048    public void logout(AsyncCallback<String> cb);
049    
050    public void refreshSession(String repository, String workspace, boolean keepChanges, AsyncCallback<?> res);
051        
052    public void node(String repository, String workspace, String path, AsyncCallback<JcrNode> result);
053
054    public void childNodes(String repository, String workspace, String path, int index, int count, AsyncCallback<Collection<JcrNode>> res);
055
056    public void repositoryInfo(String repository, AsyncCallback<JcrRepositoryDescriptor> result);
057
058    public void nodeTypes(String repository, String workspace, AsyncCallback<Collection<JcrNodeType>> result);
059
060    public void query(String repository, String workspace, String text, String lang, AsyncCallback<ResultSet> result);
061
062    public void supportedQueryLanguages(String repository, String worspace, AsyncCallback<String[]> result);
063
064    public void addNode(String repository, String workspace, String path, String name, String primaryType, AsyncCallback<JcrNode> cb);
065
066    public void removeNode(String repository, String workspace, String path, AsyncCallback<?> cb);
067
068    public void renameNode(String repository, String workspace, String path, String name, AsyncCallback<?> cb);
069    
070    public void addMixin(String repository, String workspace, String path, String mixin, AsyncCallback<?> cb);
071
072    public void removeMixin(String repository, String workspace, String path, String mixin, AsyncCallback<?> cb);
073
074    public void setProperty(JcrNode node, String name, String value, AsyncCallback<?> cb);
075    public void setProperty(JcrNode node, String name, Boolean value, AsyncCallback<?> cb);
076    public void setProperty(JcrNode node, String name, Date value, AsyncCallback<?> cb);
077    
078    public void addAccessList(String repository, String workspace, String path, String principal, AsyncCallback<?> cb);
079    public void removeAccessList( String repository, String workspace, String path, String principal, AsyncCallback<?> cb );
080    public void updateAccessList(String repository, String workspace, String path, String principal,
081            JcrPermission permission, boolean enabled, AsyncCallback<?> cb);
082
083    public void getPrimaryTypes(String repository, String workspace, 
084            String superType, boolean allowAbstract, AsyncCallback<String[]> cb);
085
086    public void getMixinTypes(String repository, String workspace, boolean allowAbstract, AsyncCallback<String[]> cb);
087
088    public void save(String repository, String workspace, AsyncCallback<?> cb);
089    
090    public void backup(String repositoy, String name, BackupParams params, AsyncCallback<?> cb);
091    public void restore(String repositoy, String name, RestoreParams params, AsyncCallback<?> cb);
092    
093    public void export(String repository, String workspace, String path, String location, 
094            boolean skipBinary, boolean noRecurse, AsyncCallback<?> cb) ;
095    public void importXML(String repository, String workspace, String path, String location, 
096            int option, AsyncCallback<?> cb) ;
097    
098    public void getValueStats(String repository, String param, String tu, AsyncCallback<Collection<Stats>> cb);
099    public void getDurationStats(String repository, String param, String tu, AsyncCallback<Collection<Stats>> cb);
100    
101    public void getValueMetrics(AsyncCallback<String[]> cb);
102    public void getDurationMetrics(AsyncCallback<String[]> cb);
103    public void getTimeUnits(AsyncCallback<String[]> cb);
104    
105}