KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > iiop > security > SecurityService


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.iiop.security;
25
26 import com.sun.enterprise.iiop.security.SecurityContext;
27
28 /*
29  * This is an interface between the CSIV2 interceptors
30  * and the rest of the J2EE RI.
31  *
32  */

33
34 public interface SecurityService {
35     public static final int STATUS_PASSED = 0;
36     public static final int STATUS_FAILED = 1;
37     public static final int STATUS_RETRY = 2;
38
39     /**
40      * This is called by the CSIv2 interceptor on the client before
41      * sending the IIOP message.
42      * @param the effective_target field of the PortableInterceptor
43      * ClientRequestInfo object.
44      * @return a SecurityContext which is marshalled into the IIOP msg
45      * by the CSIv2 interceptor.
46      */

47     SecurityContext getSecurityContext(org.omg.CORBA.Object JavaDoc effective_target)
48     throws InvalidMechanismException, InvalidIdentityTokenException;
49     /**
50      * This is called by the CSIv2 interceptor on the client after
51      * a reply is received.
52      * @param the reply status from the call. The reply status field
53      * could indicate an authentication retry.
54      * The following is the mapping of PI status to the reply_status field
55      * PortableInterceptor::SUCCESSFUL -> STATUS_PASSED
56      * PortableInterceptor::SYSTEM_EXCEPTION -> STATUS_FAILED
57      * PortableInterceptor::USER_EXCEPTION -> STATUS_PASSED
58      * PortableInterceptor::LOCATION_FORWARD -> STATUS_RETRY
59      * PortableInterceptor::TRANSPORT_RETRY -> STATUS_RETRY
60      * @param the effective_target field of the PI ClientRequestInfo object.
61      */

62     void receivedReply(int reply_status, org.omg.CORBA.Object JavaDoc effective_target);
63
64     /**
65      * This is called by the CSIv2 interceptor on the server after
66      * receiving the IIOP message. If authentication fails a FAILED status
67      * is returned. If a FAILED status is returned the CSIV2 interceptor will
68      * marshall the MessageError service context and throw the NO_PERMISSION
69      * exception.
70      * @param the SecurityContext which arrived in the IIOP message.
71      * @return the status
72      */

73     int setSecurityContext(SecurityContext context, byte[] object_id, String JavaDoc method);
74
75     /**
76      * This is called by the CSIv2 interceptor on the server before
77      * sending the reply.
78      * @param the SecurityContext which arrived in the IIOP message.
79      */

80     void sendingReply(SecurityContext context);
81     
82     /**
83      * This is called on the server to unset the security context
84      * this is introduced to prevent the re-use of the thread
85      * security context on re-use of the thread.
86      */

87     public void unsetSecurityContext();
88 }
89
90
Popular Tags