public String[] getUnacceptableTransportGuarantees(){ String acceptable = getTransportGuarantee(); if(acceptable.equals(TRANSPORT_GUARANTEE_NONE)) return (String[]) null; else if (acceptable.equals(TRANSPORT_GUARANTEE_INTEGRAL)){ String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_CONFIDENTIAL }; return ret; } else if (acceptable.equals(TRANSPORT_GUARANTEE_CONFIDENTIAL)){ String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_INTEGRAL }; return ret; } return (String[]) null; } /**
/** * Sets my transport type to the given value. Throws an illegal argument exception * if the value is not allowed. */ public void setTransportGuarantee(String transportGuarantee) { if (this.isBoundsChecking()) { if ( !UserDataConstraint.NONE_TRANSPORT.equals(transportGuarantee) && !UserDataConstraint.INTEGRAL_TRANSPORT.equals(transportGuarantee) && !UserDataConstraint.CONFIDENTIAL_TRANSPORT.equals(transportGuarantee)) { throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.exceptiontransportguarentee", "{0} is not a valid transport guarantee", new Object[] {transportGuarantee})); } } this.transportGuarantee = transportGuarantee; }
/** Copy constructor.*/ public SecurityConstraintImpl(SecurityConstraintImpl other) { if (other.webResourceCollections != null) { this.webResourceCollections = new HashSet<WebResourceCollection>(); for (WebResourceCollection wrc : other.webResourceCollections) { webResourceCollections.add(new WebResourceCollectionImpl((WebResourceCollectionImpl)wrc)); } } if (other.authorizationConstraint != null) { this.authorizationConstraint = new AuthorizationConstraintImpl((AuthorizationConstraintImpl) other.authorizationConstraint); } if (other.userDataConstraint != null) { this.userDataConstraint = new UserDataConstraintImpl(); this.userDataConstraint.setTransportGuarantee(other.userDataConstraint.getTransportGuarantee()); } }
UserDataConstraint udc = new UserDataConstraintImpl(); udc.setTransportGuarantee( ((transportGuarantee == TransportGuarantee.CONFIDENTIAL) ?
UserDataConstraint udc = new UserDataConstraintImpl(); udc.setTransportGuarantee( ((sc.getDataConstraint() == TransportGuarantee.CONFIDENTIAL) ?
/** * Returns a formatted String of my state. */ public void print(StringBuffer toStringBuffer) { toStringBuffer.append("UserDataConstraint "); toStringBuffer.append(" description ").append(super.getDescription()); toStringBuffer.append(" transportGuarantee ").append(getTransportGuarantee()); } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node in the DOM tree * @param node name for the root element of this xml fragment * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, UserDataConstraintImpl descriptor) { Node myNode = appendChild(parent, nodeName); writeLocalizedDescriptions(myNode, descriptor); appendTextChild(myNode, WebTagNames.TRANSPORT_GUARANTEE, descriptor.getTransportGuarantee()); return myNode; } }