KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > commonimpl > acl > AclStrategy


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.commonimpl.acl;
17
18 import org.outerj.daisy.repository.commonimpl.AuthenticatedUser;
19 import org.outerj.daisy.repository.Document;
20 import org.outerj.daisy.repository.RepositoryException;
21 import org.outerj.daisy.repository.VariantKey;
22 import org.outerj.daisy.repository.acl.AclResultInfo;
23 import org.outerj.daisy.repository.acl.AclPermission;
24
25 /**
26  * Allows to customise the behaviour of the abstract implementation classes of the
27  * repository ACL API.
28  *
29  * <p>For (important) general information about this and other strategy interfaces, see also
30  * {@link org.outerj.daisy.repository.commonimpl.DocumentStrategy}.
31  */

32 public interface AclStrategy {
33     public static final long LIVE_ACL_ID = 1;
34     public static final long STAGING_ACL_ID = 2;
35
36     public AclImpl loadAcl(long id, AuthenticatedUser user) throws RepositoryException;
37
38     public void storeAcl(AclImpl acl) throws RepositoryException;
39
40     public void copyStagingToLive(AuthenticatedUser user) throws RepositoryException;
41
42     public void copyLiveToStaging(AuthenticatedUser user) throws RepositoryException;
43
44     public AclResultInfo getAclInfo(AuthenticatedUser user, long id, long userId, long[] roleIds, Document document) throws RepositoryException;
45
46     public AclResultInfo getAclInfo(AuthenticatedUser user, long id, long userId, long[] roleIds, long documentId, long branchId, long languageId) throws RepositoryException;
47
48     // TODO VARIANTS: add branch and language here
49
public long[] filterDocumentTypes(AuthenticatedUser user, long[] documentTypeIds, long collectionId) throws RepositoryException;
50
51     public VariantKey[] filterDocuments(AuthenticatedUser user, VariantKey[] variantKeys, AclPermission permission) throws RepositoryException;
52 }
53
Popular Tags