01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.webapps.session;
18:
19: import java.io.IOException;
20:
21: import org.apache.cocoon.ProcessingException;
22: import org.apache.cocoon.webapps.session.context.SessionContext;
23: import org.xml.sax.SAXException;
24:
25: /**
26: * This is the context manager.
27: *
28: * The main purpose of this component is maintaining contexts. Each
29: * application can have one or more session contexts.
30: * A context is a data container that can hold arbitrary information.
31: * The contained information can either be an XML tree or custom
32: * objects.
33: *
34: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
35: * @deprecated This block is deprecated and will be removed in future versions.
36: * @version CVS $Id: ContextManager.java 433543 2006-08-22 06:22:54Z crossley $
37: */
38: public interface ContextManager {
39:
40: /** Avalon role */
41: String ROLE = ContextManager.class.getName();;
42:
43: /**
44: * Create a new public context in the session.
45: * Create a new public session context for this user. If this context
46: * already exists no new context is created and the old one will be used
47: * instead.
48: */
49: SessionContext createContext(String name, String loadURI,
50: String saveURI) throws IOException, SAXException,
51: ProcessingException;
52:
53: /**
54: * Delete a public context in the session.
55: * If the context exists for this user, it and all of its information
56: * is deleted.
57: */
58: void deleteContext(String name) throws ProcessingException;
59:
60: /**
61: * Get a public context.
62: * The session context with the given name is returned. If the context does
63: * not exist <CODE>null</CODE> is returned.
64: */
65: SessionContext getContext(String name) throws ProcessingException;
66:
67: /**
68: * Check if a context exists
69: */
70: boolean hasSessionContext() throws ProcessingException;
71:
72: /**
73: * Check if a public context exists.
74: * If the session context with the given name exists, <CODE>true</CODE> is
75: * returned.
76: */
77: boolean existsContext(String name) throws ProcessingException;
78: }
|