1 /* 2 * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.] 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 17 package org.opensaml.ws.transport; 18 19 import org.opensaml.xml.security.credential.Credential; 20 21 /** 22 * Base interface for inbound and outbound transports. 23 */ 24 public interface Transport { 25 26 /** 27 * Gets a transport-specific attribute. 28 * 29 * @param name name of the attribute 30 * 31 * @return attribute value 32 */ 33 public Object getAttribute(String name); 34 35 /** 36 * Gets the character encoding of the transport. 37 * 38 * @return character encoding of the transport 39 */ 40 public String getCharacterEncoding(); 41 42 /** 43 * Gets the local credential used to authenticate to the peer. 44 * 45 * @return local credential used to authenticate to the peer 46 */ 47 public Credential getLocalCredential(); 48 49 /** 50 * Gets the credential offered by the peer to authenticate itself. 51 * 52 * @return credential offered by the peer to authenticate itself 53 */ 54 public Credential getPeerCredential(); 55 56 /** 57 * Gets whether the peer is authenticated. 58 * 59 * @return whether the peer is authenticated 60 */ 61 public boolean isAuthenticated(); 62 63 /** 64 * Sets whether the peer is authenticated. 65 * 66 * @param isAuthenticated whether the peer is authenticated 67 */ 68 public void setAuthenticated(boolean isAuthenticated); 69 70 /** 71 * Gets whether the transport represents a confidential connection (e.g. an SSL connection). 72 * 73 * @return whether the transport represents a confidential connection 74 */ 75 public boolean isConfidential(); 76 77 /** 78 * Sets whether the transport represents a confidential connection. 79 * 80 * @param isConfidential whether the transport represents a confidential connection 81 */ 82 public void setConfidential(boolean isConfidential); 83 84 /** 85 * Gets whether the transport represents a connection that protects the integrity of transported content. 86 * 87 * @return whether the transport represents a connection that protects the integrity of transported content 88 */ 89 public boolean isIntegrityProtected(); 90 91 /** 92 * Sets whether the transport represents a connection that protects the integrity of transported content. 93 * 94 * @param isIntegrityProtected whether the transport represents a connection that protects the integrity of 95 * transported content 96 */ 97 public void setIntegrityProtected(boolean isIntegrityProtected); 98 }