This project has retired. For details please refer to its
Attic page.
DummyCallContext xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.chemistry.opencmis.inmemory;
22
23 import java.io.File;
24 import java.math.BigInteger;
25 import java.util.HashMap;
26 import java.util.Map;
27
28 import org.apache.chemistry.opencmis.commons.server.CallContext;
29
30 public class DummyCallContext implements CallContext {
31 private final Map<String, Object> fParameter = new HashMap<String, Object>();
32
33 public DummyCallContext() {
34 fParameter.put(USERNAME, "Admin");
35 fParameter.put(PASSWORD, "secret");
36 fParameter.put(LOCALE, "en");
37 }
38
39 public DummyCallContext(String principalId) {
40 fParameter.put(USERNAME, principalId);
41 fParameter.put(PASSWORD, "secret");
42 fParameter.put(LOCALE, "en");
43 }
44
45 public boolean isObjectInfoRequired() {
46 return false;
47 }
48
49 public Object get(String key) {
50 return fParameter.get(key);
51 }
52
53 public String getBinding() {
54 return BINDING_ATOMPUB;
55 }
56
57 public String getRepositoryId() {
58 return (String) get(REPOSITORY_ID);
59 }
60
61 public String getLocale() {
62 return (String) get(LOCALE);
63 }
64
65 public BigInteger getOffset() {
66 return (BigInteger) get(OFFSET);
67 }
68
69 public BigInteger getLength() {
70 return (BigInteger) get(LENGTH);
71 }
72
73 public String getPassword() {
74 return (String) get(PASSWORD);
75 }
76
77 public String getUsername() {
78 return (String) get(USERNAME);
79 }
80
81 public void put(String key, String value) {
82 fParameter.put(key, value);
83 }
84
85 public File getTempDirectory() {
86 return null;
87 }
88
89 public int getMemoryThreshold() {
90 return 4 * 1024 * 1024;
91 }
92 }