コード例 #1
0
 public static RequestPolicy toRequestPolicy(
     org.societies.api.schema.privacytrust.privacy.model.privacypolicy.RequestPolicy
         requestPolicyBean,
     IIdentityManager identityManager)
     throws InvalidFormatException {
   if (null == requestPolicyBean) {
     return null;
   }
   return new RequestPolicy(
       RequestorUtils.toRequestor(requestPolicyBean.getRequestor(), identityManager),
       RequestItemUtils.toRequestItems(requestPolicyBean.getRequestItems()));
 }
コード例 #2
0
 /**
  * Create a XACML string representing the Privacy Policy from a Java RequestPolicy
  *
  * @param privacyPolicy Privacy policy as a Java object
  * @return A string containing the XACML version the privacy policy
  */
 public static String toXmlString(
     org.societies.api.schema.privacytrust.privacy.model.privacypolicy.RequestPolicy
         requestPolicy) {
   StringBuilder sb = new StringBuilder();
   if (null != requestPolicy) {
     sb.append("<RequestPolicy>");
     sb.append(RequestorUtils.toXmlString(requestPolicy.getRequestor()));
     sb.append(RequestItemUtils.toXmlString(requestPolicy.getRequestItems()));
     sb.append("</RequestPolicy>");
   }
   return sb.toString();
 }
コード例 #3
0
 public static boolean equal(
     org.societies.api.schema.privacytrust.privacy.model.privacypolicy.RequestPolicy o1,
     Object o2) {
   // -- Verify reference equality
   if (o1 == o2) {
     return true;
   }
   if (o2 == null) {
     return false;
   }
   if (o1 == null) {
     return false;
   }
   if (o1.getClass() != o2.getClass()) {
     return false;
   }
   // -- Verify obj type
   org.societies.api.schema.privacytrust.privacy.model.privacypolicy.RequestPolicy ro2 =
       (org.societies.api.schema.privacytrust.privacy.model.privacypolicy.RequestPolicy) o2;
   return (
   /*PrivacyPolicyTypeConstantsUtils.equal(o1.getPrivacyPolicyType(), ro2.getPrivacyPolicyType())
   && */ RequestItemUtils.equal(o1.getRequestItems(), ro2.getRequestItems())
       && RequestorUtils.equal(o1.getRequestor(), ro2.getRequestor()));
 }