1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.chemistry.opencmis.server.impl;
20
21 import org.apache.chemistry.opencmis.commons.server.CallContext;
22
23 import java.io.File;
24
25 import java.math.BigInteger;
26
27 import java.util.HashMap;
28 import java.util.Map;
29
30
31
32
33
34 public class CallContextImpl implements CallContext
35 {
36 private final String binding;
37 private final boolean objectInfoRequired;
38 private final Map<String, Object> parameter = new HashMap<String, Object>( );
39
40 public CallContextImpl( String binding, String repositoryId, boolean objectInfoRequired )
41 {
42 this.binding = binding;
43 this.objectInfoRequired = objectInfoRequired;
44 put( REPOSITORY_ID, repositoryId );
45 }
46
47 public String getBinding( )
48 {
49 return binding;
50 }
51
52 public boolean isObjectInfoRequired( )
53 {
54 return objectInfoRequired;
55 }
56
57 public Object get( String key )
58 {
59 return parameter.get( key );
60 }
61
62 public String getRepositoryId( )
63 {
64 return (String) get( REPOSITORY_ID );
65 }
66
67 public String getUsername( )
68 {
69 return (String) get( USERNAME );
70 }
71
72 public String getPassword( )
73 {
74 return (String) get( PASSWORD );
75 }
76
77 public String getLocale( )
78 {
79 return (String) get( LOCALE );
80 }
81
82 public BigInteger getOffset( )
83 {
84 return (BigInteger) get( OFFSET );
85 }
86
87 public BigInteger getLength( )
88 {
89 return (BigInteger) get( LENGTH );
90 }
91
92 public File getTempDirectory( )
93 {
94 return (File) get( TEMP_DIR );
95 }
96
97 public int getMemoryThreshold( )
98 {
99 return (Integer) get( MEMORY_THRESHOLD );
100 }
101
102
103
104
105 public void put( String key, Object value )
106 {
107 parameter.put( key, value );
108 }
109
110
111
112
113 public Object remove( String key )
114 {
115 return parameter.remove( key );
116 }
117 }