Method from org.apache.geronimo.corba.security.config.css.CSSCompoundSecMechConfig Detail: |
public boolean canHandle(TSSCompoundSecMechConfig requirement) {
if (log.isDebugEnabled()) {
log.debug("canHandle()");
log.debug(" CSS SUPPORTS: " + ConfigUtil.flags(supports));
log.debug(" CSS REQUIRES: " + ConfigUtil.flags(requires));
log.debug(" TSS SUPPORTS: " + ConfigUtil.flags(requirement.getSupports()));
log.debug(" TSS REQUIRES: " + ConfigUtil.flags(requirement.getRequires()));
}
if ((supports & requirement.getRequires()) != requirement.getRequires()) return false;
if ((requires & requirement.getSupports()) != requires) return false;
if (!transport_mech.canHandle(requirement.getTransport_mech())) return false;
if (!as_mech.canHandle(requirement.getAs_mech())) return false;
if (!sas_mech.canHandle(requirement.getSas_mech())) return false;
return true;
}
|
public ServiceContext generateServiceContext() throws UserException {
if (as_mech instanceof CSSNULLASMechConfig && sas_mech.getIdentityToken() instanceof CSSSASITTAbsent) return null;
EstablishContext msg = new EstablishContext();
msg.client_context_id = 0;
msg.client_authentication_token = as_mech.encode();
msg.authorization_token = sas_mech.encodeAuthorizationElement();
msg.identity_token = sas_mech.encodeIdentityToken();
ServiceContext context = new ServiceContext();
SASContextBody sas = new SASContextBody();
sas.establish_msg(msg);
Any sas_any = Util.getORB().create_any();
SASContextBodyHelper.insert(sas_any, sas);
context.context_data = Util.getCodec().encode_value(sas_any);
context.context_id = SecurityAttributeService.value;
return context;
}
|
public CSSASMechConfig getAs_mech() {
return as_mech;
}
|
public CSSSASMechConfig getSas_mech() {
return sas_mech;
}
|
public CSSTransportMechConfig getTransport_mech() {
return transport_mech;
}
|
public void setAs_mech(CSSASMechConfig as_mech) {
this.as_mech = as_mech;
this.supports |= as_mech.getSupports();
this.requires |= as_mech.getRequires();
}
|
public void setSas_mech(CSSSASMechConfig sas_mech) {
this.sas_mech = sas_mech;
this.supports |= sas_mech.getSupports();
this.requires |= sas_mech.getRequires();
}
|
public void setTransport_mech(CSSTransportMechConfig transport_mech) {
this.transport_mech = transport_mech;
this.supports |= transport_mech.getSupports();
this.requires |= transport_mech.getRequires();
}
|
public String toString() {
StringBuffer buf = new StringBuffer();
toString("", buf);
return buf.toString();
}
|
void toString(String spaces,
StringBuffer buf) {
String moreSpaces = spaces + " ";
buf.append(spaces).append("CSSCompoundSecMechConfig: [\n");
buf.append(moreSpaces).append("SUPPORTS: ").append(ConfigUtil.flags(supports)).append("\n");
buf.append(moreSpaces).append("REQUIRES: ").append(ConfigUtil.flags(requires)).append("\n");
transport_mech.toString(moreSpaces, buf);
as_mech.toString(moreSpaces, buf);
sas_mech.toString(moreSpaces, buf);
buf.append(spaces).append("]\n");
}
|