cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [07/18] cxf-fediz git commit: Whitespace cleanup
Date Mon, 13 Feb 2017 11:36:23 GMT
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java
index e01c80b..62bcb4a 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/TrustedIdpServiceImpl.java
@@ -42,38 +42,38 @@ public class TrustedIdpServiceImpl implements TrustedIdpService {
 
     @Autowired
     private TrustedIdpDAO trustedIdpDAO;
-    
-    
+
+
     @Override
     public Response updateTrustedIDP(UriInfo ui, String realm, TrustedIdp trustedIdp) {
         if (!realm.equals(trustedIdp.getRealm().toString())) {
             throw new BadRequestException();
         }
         trustedIdpDAO.updateTrustedIDP(realm, trustedIdp);
-        
+
         return Response.noContent().build();
     }
-    
+
     @Override
     public TrustedIdps getTrustedIDPs(int start, int size, UriInfo uriInfo) {
         List<TrustedIdp> trustedIdps = trustedIdpDAO.getTrustedIDPs(start, size);
-        
+
         TrustedIdps list = new TrustedIdps();
         list.setTrustedIDPs(trustedIdps);
         return list;
     }
-    
+
     @Override
     public TrustedIdp getTrustedIDP(String realm) {
         return this.trustedIdpDAO.getTrustedIDP(realm);
     }
-    
+
     @Override
     public Response addTrustedIDP(UriInfo ui, TrustedIdp trustedIDP) {
         LOG.info("add Trusted IDP config");
-        
+
         TrustedIdp createdTrustedIdp = trustedIdpDAO.addTrustedIDP(trustedIDP);
-        
+
         UriBuilder uriBuilder = UriBuilder.fromUri(ui.getRequestUri());
         uriBuilder.path("{index}");
         URI location = uriBuilder.build(createdTrustedIdp.getRealm());
@@ -83,11 +83,11 @@ public class TrustedIdpServiceImpl implements TrustedIdpService {
     @Override
     public Response deleteTrustedIDP(String realm) {
         trustedIdpDAO.deleteTrustedIDP(realm);
-        
+
         return Response.noContent().build();
     }
-           
-    
+
+
 
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2CallbackHandler.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2CallbackHandler.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2CallbackHandler.java
index 9981253..a19d291 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2CallbackHandler.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2CallbackHandler.java
@@ -48,14 +48,14 @@ import org.opensaml.saml.saml2.core.Subject;
  * Assertion.
  */
 public class SAML2CallbackHandler implements CallbackHandler {
-    
+
     private Subject subject;
     private String confirmationMethod = SAML2Constants.CONF_BEARER;
     private String issuer;
     private ConditionsBean conditions;
     private SubjectConfirmationDataBean subjectConfirmationData;
     private List<AttributeStatement> attributeStatements;
-    
+
     private void createAndSetStatement(SAMLCallback callback) {
         AuthenticationStatementBean authBean = new AuthenticationStatementBean();
         authBean.setAuthenticationMethod("Password");
@@ -63,11 +63,11 @@ public class SAML2CallbackHandler implements CallbackHandler {
 
         if (attributeStatements != null && !attributeStatements.isEmpty()) {
             List<AttributeStatementBean> attrStatementBeans = new ArrayList<>();
-            
+
             for (AttributeStatement attrStatement : attributeStatements) {
                 AttributeStatementBean attrStatementBean = new AttributeStatementBean();
                 List<AttributeBean> attrBeans = new ArrayList<>();
-                
+
                 for (Attribute attribute : attrStatement.getAttributes()) {
                     AttributeBean attributeBean = new AttributeBean();
                     attributeBean.setQualifiedName(attribute.getName());
@@ -85,7 +85,7 @@ public class SAML2CallbackHandler implements CallbackHandler {
             callback.setAttributeStatementData(attrStatementBeans);
         }
     }
-    
+
     public void handle(Callback[] callbacks)
         throws IOException, UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
@@ -96,8 +96,8 @@ public class SAML2CallbackHandler implements CallbackHandler {
                 if (conditions != null) {
                     callback.setConditions(conditions);
                 }
-                
-                SubjectBean subjectBean = 
+
+                SubjectBean subjectBean =
                     new SubjectBean(
                         subject.getNameID().getValue(), subject.getNameID().getNameQualifier(), confirmationMethod
                     );
@@ -111,19 +111,19 @@ public class SAML2CallbackHandler implements CallbackHandler {
             }
         }
     }
-    
+
     public void setSubjectConfirmationData(SubjectConfirmationDataBean subjectConfirmationData) {
         this.subjectConfirmationData = subjectConfirmationData;
     }
-    
+
     public void setConditions(ConditionsBean conditionsBean) {
         this.conditions = conditionsBean;
     }
-    
+
     public void setConfirmationMethod(String confMethod) {
         confirmationMethod = confMethod;
     }
-    
+
     public void setIssuer(String issuer) {
         this.issuer = issuer;
     }
@@ -143,6 +143,6 @@ public class SAML2CallbackHandler implements CallbackHandler {
     public void setAttributeStatements(List<AttributeStatement> attributeStatements) {
         this.attributeStatements = attributeStatements;
     }
-    
-    
+
+
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2PResponseComponentBuilder.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2PResponseComponentBuilder.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2PResponseComponentBuilder.java
index 7e64cfa..998df5b 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2PResponseComponentBuilder.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAML2PResponseComponentBuilder.java
@@ -36,24 +36,24 @@ import org.opensaml.saml.saml2.core.StatusMessage;
 * A (basic) set of utility methods to construct SAML 2.0 Protocol Response statements
 */
 public final class SAML2PResponseComponentBuilder {
-    
+
     private static SAMLObjectBuilder<Response> responseBuilder;
-    
+
     private static SAMLObjectBuilder<Issuer> issuerBuilder;
-    
+
     private static SAMLObjectBuilder<Status> statusBuilder;
-    
+
     private static SAMLObjectBuilder<StatusCode> statusCodeBuilder;
-    
+
     private static SAMLObjectBuilder<StatusMessage> statusMessageBuilder;
-    
-    private static XMLObjectBuilderFactory builderFactory = 
+
+    private static XMLObjectBuilderFactory builderFactory =
         XMLObjectProviderRegistrySupport.getBuilderFactory();
-    
+
     private SAML2PResponseComponentBuilder() {
-        
+
     }
-    
+
     @SuppressWarnings("unchecked")
     public static Response createSAMLResponse(
         String inResponseTo,
@@ -65,17 +65,17 @@ public final class SAML2PResponseComponentBuilder {
                 builderFactory.getBuilder(Response.DEFAULT_ELEMENT_NAME);
         }
         Response response = responseBuilder.buildObject();
-        
+
         response.setID(UUID.randomUUID().toString());
         response.setIssueInstant(new DateTime());
         response.setInResponseTo(inResponseTo);
         response.setIssuer(createIssuer(issuer));
         response.setStatus(status);
         response.setVersion(SAMLVersion.VERSION_20);
-        
+
         return response;
     }
-    
+
     @SuppressWarnings("unchecked")
     public static Issuer createIssuer(
         String issuerValue
@@ -86,10 +86,10 @@ public final class SAML2PResponseComponentBuilder {
         }
         Issuer issuer = issuerBuilder.buildObject();
         issuer.setValue(issuerValue);
-        
+
         return issuer;
     }
-    
+
     @SuppressWarnings("unchecked")
     public static Status createStatus(
         String statusCodeValue,
@@ -107,21 +107,21 @@ public final class SAML2PResponseComponentBuilder {
             statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>)
                 builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
         }
-        
+
         Status status = statusBuilder.buildObject();
-        
+
         StatusCode statusCode = statusCodeBuilder.buildObject();
         statusCode.setValue(statusCodeValue);
         status.setStatusCode(statusCode);
-        
+
         if (statusMessage != null) {
             StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
             statusMessageObject.setMessage(statusMessage);
             status.setStatusMessage(statusMessageObject);
         }
-        
+
         return status;
     }
-    
-    
+
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAMLAuthnRequest.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAMLAuthnRequest.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAMLAuthnRequest.java
index c7ded4b..d1606ac 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAMLAuthnRequest.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/samlsso/SAMLAuthnRequest.java
@@ -29,21 +29,21 @@ import org.opensaml.saml.saml2.core.AuthnRequest;
  */
 public class SAMLAuthnRequest implements Serializable {
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 4353024755428346545L;
-    
+
     private String issuer;
     private String consumerServiceURL;
     private String requestId;
     private boolean forceAuthn;
     private String subjectNameId;
-    
+
     public SAMLAuthnRequest(AuthnRequest authnRequest) {
         if (authnRequest.getIssuer() != null) {
             issuer = authnRequest.getIssuer().getValue();
         }
-        
+
         consumerServiceURL = authnRequest.getAssertionConsumerServiceURL();
         requestId = authnRequest.getID();
         forceAuthn = authnRequest.isForceAuthn().booleanValue();
@@ -51,23 +51,23 @@ public class SAMLAuthnRequest implements Serializable {
             subjectNameId = authnRequest.getSubject().getNameID().getValue();
         }
     }
-    
+
     public String getIssuer() {
         return issuer;
     }
-    
+
     public String getConsumerServiceURL() {
         return consumerServiceURL;
     }
-    
+
     public String getRequestId() {
         return requestId;
     }
-    
+
     public boolean isForceAuthn() {
         return forceAuthn;
     }
-    
+
     public String getSubjectNameId() {
         return subjectNameId;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ApplicationDAO.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ApplicationDAO.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ApplicationDAO.java
index a519908..81c1403 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ApplicationDAO.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ApplicationDAO.java
@@ -37,7 +37,7 @@ public interface ApplicationDAO {
     void deleteApplication(String realm);
 
     void addClaimToApplication(Application application, RequestClaim claim);
-    
+
     void removeClaimFromApplication(Application application, RequestClaim claim);
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ClaimDAO.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ClaimDAO.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ClaimDAO.java
index 417a50a..9d8fc44 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ClaimDAO.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ClaimDAO.java
@@ -26,13 +26,13 @@ import org.apache.cxf.fediz.service.idp.domain.Claim;
 public interface ClaimDAO {
 
     List<Claim> getClaims(int start, int size);
-    
+
     Claim getClaim(String claimType);
-    
+
     Claim addClaim(Claim claim);
-    
+
     void updateClaim(String claimType, Claim claim);
-    
+
     void deleteClaim(String claimType);
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigService.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigService.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigService.java
index e306ff4..1d52592 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigService.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigService.java
@@ -28,5 +28,5 @@ public interface ConfigService {
     void setIDP(Idp config);
 
     void removeIDP(String realm);
-    
+
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigServiceSpring.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigServiceSpring.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigServiceSpring.java
index 8545af3..1e1c5c3 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigServiceSpring.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/ConfigServiceSpring.java
@@ -62,7 +62,7 @@ public class ConfigServiceSpring implements ConfigService {
             serviceConfigs.put(s.getRealm(), s);
         }
     }
-    
+
     public List<Idp> getIdpConfigs() {
         return new ArrayList<Idp>(idpConfigs.values());
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/EntitlementDAO.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/EntitlementDAO.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/EntitlementDAO.java
index d93cdc0..f874447 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/EntitlementDAO.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/EntitlementDAO.java
@@ -26,13 +26,13 @@ import org.apache.cxf.fediz.service.idp.domain.Entitlement;
 public interface EntitlementDAO {
 
     List<Entitlement> getEntitlements(int start, int size);
-    
+
     Entitlement getEntitlement(String name);
-    
+
     Entitlement addEntitlement(Entitlement entitlement);
-    
+
     void updateEntitlement(String name, Entitlement entitlement);
-    
+
     void deleteEntitlement(String name);
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/IdpDAO.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/IdpDAO.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/IdpDAO.java
index 41c5cdf..f560268 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/IdpDAO.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/IdpDAO.java
@@ -39,15 +39,15 @@ public interface IdpDAO {
     void deleteIdp(String realm);
 
     void addApplicationToIdp(Idp idp, Application application);
-    
+
     void removeApplicationFromIdp(Idp idp, Application application);
-    
+
     void addTrustedIdpToIdp(Idp idp, TrustedIdp trustedIdp);
-    
+
     void removeTrustedIdpFromIdp(Idp idp, TrustedIdp trustedIdp);
-    
+
     void addClaimToIdp(Idp idp, Claim claim);
-    
+
     void removeClaimFromIdp(Idp idp, Claim claim);
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/RoleDAO.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/RoleDAO.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/RoleDAO.java
index 2d8e7f5..1f06eff 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/RoleDAO.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/RoleDAO.java
@@ -37,7 +37,7 @@ public interface RoleDAO {
     void deleteRole(String name);
 
     void addEntitlementToRole(Role role, Entitlement entitlement);
-    
+
     void removeEntitlementFromRole(Role role, Entitlement entitlement);
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationClaimEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationClaimEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationClaimEntity.java
index e2ca923..ddb0875 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationClaimEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationClaimEntity.java
@@ -26,29 +26,29 @@ import javax.persistence.ManyToOne;
 @Entity(name = "Application_Claim")
 //@IdClass(ApplicationClaimId.class)
 public class ApplicationClaimEntity {
-    
+
     @Id
     private int id;
-    
+
     @ManyToOne
     @JoinColumn(name = "applicationid")
     private ApplicationEntity application;
- 
+
     @ManyToOne
     @JoinColumn(name = "claimid")
     private ClaimEntity claim;
- 
+
     private boolean optional;
-    
+
     public ApplicationClaimEntity() {
     }
-    
+
     public ApplicationClaimEntity(ApplicationEntity application, ClaimEntity claim) {
         super();
         this.application = application;
         this.claim = claim;
     }
-    
+
     public int getId() {
         return id;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPAImpl.java
index 307e381..b8480a6 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationDAOJPAImpl.java
@@ -42,52 +42,52 @@ import org.springframework.transaction.annotation.Transactional;
 @Repository
 @Transactional
 public class ApplicationDAOJPAImpl implements ApplicationDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(ApplicationDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @Autowired
     private ClaimDAO claimDAO;
-    
-    
+
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<Application> getApplications(int start, int size, List<String> expandList) {
         List<Application> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select a from Application a");
-        
+
         //@SuppressWarnings("rawtypes")
         List<?> serviceEntities = query
             .setFirstResult(start)
             .setMaxResults(size)
             .getResultList();
-    
+
         for (Object obj : serviceEntities) {
             ApplicationEntity entity = (ApplicationEntity) obj;
             list.add(entity2domain(entity, expandList));
         }
         return list;
     }
-    
+
     @Override
     public Application getApplication(String realm, List<String> expandList) {
         return entity2domain(getApplicationEntity(realm, em), expandList);
     }
-    
+
     @Override
     public Application addApplication(Application application) {
         ApplicationEntity entity = new ApplicationEntity();
-        
+
         domain2entity(application, entity);
         em.persist(entity);
-        
+
         LOG.debug("Application '{}' added", application.getRealm());
         return entity2domain(entity, Arrays.asList("all"));
     }
@@ -97,32 +97,32 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
         Query query = null;
         query = em.createQuery("select a from Application a where a.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         ApplicationEntity applicationEntity = (ApplicationEntity)query.getSingleResult();
-        
+
         domain2entity(application, applicationEntity);
-        
+
         em.persist(applicationEntity);
-        
+
         LOG.debug("Application '{}' updated", realm);
     }
-    
+
 
     @Override
     public void deleteApplication(String realm) {
         Query query = null;
         query = em.createQuery("select a from Application a where a.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         Object applObj = query.getSingleResult();
         em.remove(applObj);
-        
+
         LOG.debug("Application '{}' deleted", realm);
-        
+
     }
-    
+
     @Override
     public void addClaimToApplication(Application application, RequestClaim claim) {
         ApplicationEntity applicationEntity = null;
@@ -132,21 +132,21 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
             Query query = null;
             query = em.createQuery("select a from Application a where a.realm=:realm");
             query.setParameter("realm", application.getRealm());
-            
+
             applicationEntity = (ApplicationEntity)query.getSingleResult();
         }
-        
+
         Claim c = claimDAO.getClaim(claim.getClaimType().toString());
         ClaimEntity claimEntity = em.find(ClaimEntity.class, c.getId());
-                
+
         ApplicationClaimEntity appClaimEntity = new ApplicationClaimEntity();
         appClaimEntity.setClaim(claimEntity);
         appClaimEntity.setApplication(applicationEntity);
         appClaimEntity.setOptional(claim.isOptional());
-        
+
         applicationEntity.getRequestedClaims().add(appClaimEntity);
     }
-    
+
     @Override
     public void removeClaimFromApplication(Application application, RequestClaim claim) {
         ApplicationEntity applicationEntity = null;
@@ -156,10 +156,10 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
             Query query = null;
             query = em.createQuery("select a from Application a where a.realm=:realm");
             query.setParameter("realm", application.getRealm());
-            
+
             applicationEntity = (ApplicationEntity)query.getSingleResult();
         }
-        
+
         ApplicationClaimEntity foundEntity = null;
         for (ApplicationClaimEntity acm : applicationEntity.getRequestedClaims()) {
             if (claim.getClaimType().toString().equals(acm.getClaim().getClaimType())) {
@@ -170,26 +170,26 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
         if (foundEntity == null) {
             throw new EntityNotFoundException("ApplicationClaimEntity not found");
         }
-        
+
         applicationEntity.getRequestedClaims().remove(foundEntity);
     }
-    
-    
+
+
     static ApplicationEntity getApplicationEntity(String realm, EntityManager em) {
         Query query = null;
         query = em.createQuery("select a from Application a where a.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         return (ApplicationEntity)query.getSingleResult();
     }
-        
+
     public static void domain2entity(Application application, ApplicationEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (application.getId() > 0) {
             entity.setId(application.getId());
         }
-        
+
         entity.setEncryptionCertificate(application.getEncryptionCertificate());
         entity.setValidatingCertificate(application.getValidatingCertificate());
         entity.setLifeTime(application.getLifeTime());
@@ -204,7 +204,7 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
         entity.setPassiveRequestorEndpointConstraint(application.getPassiveRequestorEndpointConstraint());
         entity.setEnableAppliesTo(application.isEnableAppliesTo());
     }
-    
+
     public static Application entity2domain(ApplicationEntity entity, List<String> expandList) {
         Application application = new Application();
         application.setId(entity.getId());
@@ -221,7 +221,7 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
         application.setPassiveRequestorEndpoint(entity.getPassiveRequestorEndpoint());
         application.setPassiveRequestorEndpointConstraint(entity.getPassiveRequestorEndpointConstraint());
         application.setEnableAppliesTo(entity.isEnableAppliesTo());
-        
+
         if (expandList != null && (expandList.contains("all") || expandList.contains("claims"))) {
             for (ApplicationClaimEntity item : entity.getRequestedClaims()) {
                 RequestClaim claim = entity2domain(item);
@@ -230,22 +230,22 @@ public class ApplicationDAOJPAImpl implements ApplicationDAO {
         }
         return application;
     }
-    
+
     public static RequestClaim entity2domain(ApplicationClaimEntity entity) {
         Claim claim = ClaimDAOJPAImpl.entity2domain(entity.getClaim());
         RequestClaim reqClaim = new RequestClaim(claim);
         reqClaim.setId(entity.getId());
         reqClaim.setOptional(entity.isOptional());
-        
+
         return reqClaim;
     }
-    
+
     public static void domain2entity(ApplicationEntity application,
                                      RequestClaim reqClaim, ApplicationClaimEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         ClaimEntity claim = new ClaimEntity();
         ClaimDAOJPAImpl.domain2entity(reqClaim, claim);
-        
+
         entity.setApplication(application);
         entity.setClaim(claim);
         entity.setOptional(reqClaim.isOptional());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
index 1397da2..9907add 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationEntity.java
@@ -33,10 +33,10 @@ import org.apache.openjpa.persistence.jdbc.Index;
 
 @Entity(name = "Application")
 public class ApplicationEntity {
-    
+
     @Id
     private int id;
-    
+
     @Index
     @NotNull
     private String realm;  //wtrealm, whr
@@ -47,47 +47,47 @@ public class ApplicationEntity {
     @NotNull
     @ApplicationProtocolSupported
     private String protocol;
- 
+
     // Public key only
     // Could be read from Metadata, md:KeyDescriptor, use="encryption"
     private String encryptionCertificate;
-    
+
     // Certificate for Signature verification
     private String validatingCertificate;
-    
+
     // Could be read from Metadata, fed:ClaimTypesRequested
     @OneToMany(mappedBy = "application", cascade = CascadeType.ALL, orphanRemoval = true)
     private List<ApplicationClaimEntity> requestedClaims = new ArrayList<>();
-    
+
     //Could be read from Metadata, ServiceDisplayName
     //usage for list of application where user is logged in
     @NotNull
     private String serviceDisplayName;
-    
+
     //Could be read from Metadata, ServiceDescription
     //usage for list of application where user is logged in
     private String serviceDescription;
-    
+
     //Could be read from Metadata, RoleDescriptor
     //fed:ApplicationServiceType, fed:SecurityTokenServiceType
     private String role;
-    
+
     // Not in Metadata, configured in IDP or passed in wreq parameter
     @NotNull
     private String tokenType;
-    
+
     // Not in Metadata, configured in IDP or passed in wreq parameter
     @Min(value = 1)
     private int lifeTime;
-    
+
     // Request audience restriction in token for this application (default is true)
     private boolean enableAppliesTo = true;
-    
+
     // WS-Policy Namespace in SignIn Response
     private String policyNamespace;
-    
+
     private String passiveRequestorEndpoint;
-    
+
     // A regular expression constraint on the passiveRequestorEndpoint
     private String passiveRequestorEndpointConstraint;
 
@@ -98,8 +98,8 @@ public class ApplicationEntity {
 
     public void setId(int id) {
         this.id = id;
-    }    
-    
+    }
+
     public String getRealm() {
         return realm;
     }
@@ -171,7 +171,7 @@ public class ApplicationEntity {
     public void setLifeTime(int lifeTime) {
         this.lifeTime = lifeTime;
     }
-    
+
     public String getPolicyNamespace() {
         return policyNamespace;
     }
@@ -187,7 +187,7 @@ public class ApplicationEntity {
     public void setPassiveRequestorEndpoint(String passiveRequestorEndpoint) {
         this.passiveRequestorEndpoint = passiveRequestorEndpoint;
     }
-    
+
     public String getPassiveRequestorEndpointConstraint() {
         return passiveRequestorEndpointConstraint;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
index 5a999e9..84e8a20 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
@@ -39,10 +39,10 @@ public class ApplicationIdpProtocolSupportValidator
     @Autowired
     @Qualifier("applicationProtocolControllerImpl")
     private ProtocolController<ApplicationProtocolHandler> applicationProtocolHandlers;
-    
+
     @Override
     public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
-        
+
         List<String> protocols = applicationProtocolHandlers.getProtocols();
         return protocols.contains(object);
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimDAOJPAImpl.java
index dea2b8d..8354d50 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimDAOJPAImpl.java
@@ -38,23 +38,23 @@ import org.springframework.transaction.annotation.Transactional;
 @Repository
 @Transactional
 public class ClaimDAOJPAImpl implements ClaimDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(ClaimDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<Claim> getClaims(int start, int size) {
         List<Claim> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select c from Claim c");
-        
+
         //@SuppressWarnings("rawtypes")
         List<?> claimEntities = query
             .setFirstResult(start)
@@ -65,16 +65,16 @@ public class ClaimDAOJPAImpl implements ClaimDAO {
             ClaimEntity entity = (ClaimEntity) obj;
             list.add(entity2domain(entity));
         }
-        
+
         return list;
     }
-    
+
     @Override
     public Claim addClaim(Claim claim) {
         ClaimEntity entity = new ClaimEntity();
         domain2entity(claim, entity);
         em.persist(entity);
-        
+
         LOG.debug("Claim '{}' added", claim.getClaimType());
         return entity2domain(entity);
     }
@@ -89,12 +89,12 @@ public class ClaimDAOJPAImpl implements ClaimDAO {
         Query query = null;
         query = em.createQuery("select c from Claim c where c.claimtype=:claimtype");
         query.setParameter("claimtype", claimType);
-        
+
         //@SuppressWarnings("rawtypes")
         ClaimEntity claimEntity = (ClaimEntity)query.getSingleResult();
-        
+
         domain2entity(claim, claimEntity);
-        
+
         LOG.debug("Claim '{}' added", claim.getClaimType());
         em.persist(claimEntity);
     }
@@ -104,23 +104,23 @@ public class ClaimDAOJPAImpl implements ClaimDAO {
         Query query = null;
         query = em.createQuery("select c from Claim c where c.claimType=:claimtype");
         query.setParameter("claimtype", claimType);
-        
+
         //@SuppressWarnings("rawtypes")
         Object claimObj = query.getSingleResult();
         em.remove(claimObj);
-        
+
         LOG.debug("Claim '{}' deleted", claimType);
     }
-    
+
     static ClaimEntity getClaimEntity(String claimType, EntityManager em) {
         Query query = null;
         query = em.createQuery("select c from Claim c where c.claimType=:claimtype");
         query.setParameter("claimtype", claimType);
-        
+
         //@SuppressWarnings("rawtypes")
         return (ClaimEntity)query.getSingleResult();
     }
-    
+
     public static void domain2entity(Claim claim, ClaimEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (claim.getId() > 0) {
@@ -130,7 +130,7 @@ public class ClaimDAOJPAImpl implements ClaimDAO {
         entity.setDisplayName(claim.getDisplayName());
         entity.setDescription(claim.getDescription());
     }
-    
+
     public static Claim entity2domain(ClaimEntity entity) {
         Claim claim = new Claim();
         claim.setId(entity.getId());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimEntity.java
index 54ee1eb..e967844 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ClaimEntity.java
@@ -26,17 +26,17 @@ import org.apache.openjpa.persistence.jdbc.Index;
 
 @Entity(name = "Claim")
 public class ClaimEntity {
-    
+
     @Id
     private int id;
-    
+
     @Index
     @NotNull
     private String claimType;
-    
+
     private String displayName;
     private String description;
-        
+
     public int getId() {
         return id;
     }
@@ -44,11 +44,11 @@ public class ClaimEntity {
     public void setId(int id) {
         this.id = id;
     }
-    
+
     public void setClaimType(String claimType) {
         this.claimType = claimType;
     }
-    
+
     public String getClaimType() {
         return claimType;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
index 03f70b9..d356c45 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
@@ -40,7 +40,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
 public class ConfigServiceJPA implements ConfigService {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConfigServiceJPA.class);
-    
+
     IdpService idpService;
 
     @Override
@@ -48,22 +48,22 @@ public class ConfigServiceJPA implements ConfigService {
         Authentication currentAuthentication = SecurityContextHolder.getContext().getAuthentication();
         try {
             final Set<GrantedAuthority> authorities = new HashSet<>();
-            
+
             if (realm == null || realm.length() == 0) {
                 authorities.add(new SimpleGrantedAuthority("IDP_LIST"));
                 UsernamePasswordAuthenticationToken technicalUser =
                     new UsernamePasswordAuthenticationToken("IDP_TEST", "N.A", authorities);
-                
+
                 SecurityContextHolder.getContext().setAuthentication(technicalUser);
-                
+
                 return idpService.getIdps(0, 1, Arrays.asList("all"), null).getIdps().iterator().next();
             } else {
                 authorities.add(new SimpleGrantedAuthority("IDP_READ"));
                 UsernamePasswordAuthenticationToken technicalUser =
                     new UsernamePasswordAuthenticationToken("IDP_TEST", "N.A", authorities);
-                
+
                 SecurityContextHolder.getContext().setAuthentication(technicalUser);
-                
+
                 return idpService.getIdp(realm, Arrays.asList("all"));
             }
         } finally {
@@ -75,13 +75,13 @@ public class ConfigServiceJPA implements ConfigService {
     @Override
     public void setIDP(Idp config) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void removeIDP(String realm) {
         // TODO Auto-generated method stub
-        
+
     }
 
     public IdpService getIdpService() {
@@ -91,6 +91,6 @@ public class ConfigServiceJPA implements ConfigService {
     public void setIdpService(IdpService idpService) {
         this.idpService = idpService;
     }
-    
+
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBInitApplicationListener.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBInitApplicationListener.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBInitApplicationListener.java
index eebb99a..6353aac 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBInitApplicationListener.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBInitApplicationListener.java
@@ -37,31 +37,31 @@ import org.springframework.stereotype.Component;
 public class DBInitApplicationListener implements ApplicationListener<ContextRefreshedEvent> {
 
     private static final Logger LOG = LoggerFactory.getLogger(DBInitApplicationListener.class);
-    
+
     private EntityManager em;
-    
+
     @Autowired
     private List<DBLoader> dbloader;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-        
+
     @Override
     public void onApplicationEvent(ContextRefreshedEvent arg0) {
         if (!isDBEmpty()) {
             LOG.info("Inital DB already loaded");
             return;
         }
-        
+
         LOG.debug("Loading inital DB data...");
         for (DBLoader loader : this.dbloader) {
             loader.load();
             LOG.info("Inital DB data loaded for " + loader.getName());
         }
     }
-    
+
     protected boolean isDBEmpty() {
         CriteriaBuilder cb = em.getCriteriaBuilder();
         CriteriaQuery<Long> cq = cb.createQuery(Long.class);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoader.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoader.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoader.java
index c79a79b..0ef599b 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoader.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoader.java
@@ -22,7 +22,7 @@ package org.apache.cxf.fediz.service.idp.service.jpa;
 public interface DBLoader {
 
     void load();
-    
+
     String getName();
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
index 2c6ab15..78dfb41 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderImpl.java
@@ -37,23 +37,23 @@ import org.springframework.transaction.annotation.Transactional;
 @Transactional
 //CHECKSTYLE:OFF
 public class DBLoaderImpl implements DBLoader {
-    
+
     public static final String NAME = "DEMODBLOADER";
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(DBLoaderImpl.class);
-    
+
     private EntityManager em;
 
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public String getName() {
         return NAME;
     }
-    
+
     @Override
     public void load() {
 
@@ -63,26 +63,26 @@ public class DBLoaderImpl implements DBLoader {
             claimEntity1.setDisplayName("firstname");
             claimEntity1.setDescription("Description for firstname");
             em.persist(claimEntity1);
-    
+
             ClaimEntity claimEntity2 = new ClaimEntity();
             claimEntity2.setClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname");
             claimEntity2.setDisplayName("lastname");
             claimEntity2.setDescription("Description for lastname");
             em.persist(claimEntity2);
-    
+
             ClaimEntity claimEntity3 = new ClaimEntity();
             claimEntity3.setClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress");
             claimEntity3.setDisplayName("email");
             claimEntity3.setDescription("Description for email");
             em.persist(claimEntity3);
-    
+
             ClaimEntity claimEntity4 = new ClaimEntity();
             claimEntity4.setClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
             claimEntity4.setDisplayName("role");
             claimEntity4.setDescription("Description for role");
             em.persist(claimEntity4);
-            
-            
+
+
             ApplicationEntity entity = new ApplicationEntity();
             entity.setEncryptionCertificate("");
             entity.setLifeTime(3600);
@@ -111,8 +111,8 @@ public class DBLoaderImpl implements DBLoader {
             em.persist(ace4);
             entity.getRequestedClaims().add(ace4);
             em.persist(entity);
-            
-            
+
+
             TrustedIdpEntity entity3 = new TrustedIdpEntity();
             entity3.setCacheTokens(true);
             entity3.setCertificate("trusted cert");
@@ -124,7 +124,7 @@ public class DBLoaderImpl implements DBLoader {
             entity3.setTrustType(TrustType.PEER_TRUST);
             entity3.setUrl("https://localhost:12443/fediz-idp-remote/federation");
             em.persist(entity3);
-            
+
             IdpEntity idpEntity = new IdpEntity();
             idpEntity.getApplications().add(entity);
             idpEntity.getTrustedIdps().add(entity3);
@@ -154,7 +154,7 @@ public class DBLoaderImpl implements DBLoader {
             idpEntity.setTokenTypesOffered(tokenTypes);
             idpEntity.setUseCurrentIdp(true);
             em.persist(idpEntity);
-            
+
             em.flush();
         } catch (Exception ex) {
             LOG.warn("Failed to initialize DB with data", ex);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java
index eb0fa40..1d58a77 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/DBLoaderSpring.java
@@ -30,11 +30,11 @@ import org.springframework.transaction.annotation.Transactional;
 
 @Transactional
 public class DBLoaderSpring implements DBLoader {
-    
+
     public static final String NAME = "SPRINGDBLOADER";
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(DBLoaderSpring.class);
-    
+
     private EntityManager em;
     private String resource;
 
@@ -42,12 +42,12 @@ public class DBLoaderSpring implements DBLoader {
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public String getName() {
         return NAME;
     }
-    
+
     public String getResource() {
         return resource;
     }
@@ -61,61 +61,61 @@ public class DBLoaderSpring implements DBLoader {
 
         GenericXmlApplicationContext ctx = null;
         try {
-            
+
             if (resource == null) {
                 LOG.warn("Resource null for DBLoaderSpring");
             }
-            
+
             ctx = new GenericXmlApplicationContext();
             ctx.load(resource);
             ctx.refresh();
             ctx.start();
-            
+
             Collection<EntitlementEntity> entitlements = ctx.
                 getBeansOfType(EntitlementEntity.class, true, true).values();
             for (EntitlementEntity e : entitlements) {
                 em.persist(e);
             }
             LOG.info(entitlements.size() + " EntitlementEntity added");
-            
+
             Collection<RoleEntity> roles = ctx.
                 getBeansOfType(RoleEntity.class, true, true).values();
             for (RoleEntity r : roles) {
                 em.persist(r);
             }
             LOG.info(roles.size() + " RoleEntity added");
-            
+
             Collection<ClaimEntity> claims = ctx.getBeansOfType(ClaimEntity.class, true, true).values();
             for (ClaimEntity c : claims) {
                 em.persist(c);
             }
             LOG.info(claims.size() + " ClaimEntity added");
-            
+
             Collection<TrustedIdpEntity> trustedIdps = ctx.getBeansOfType(TrustedIdpEntity.class).values();
             for (TrustedIdpEntity t : trustedIdps) {
                 em.persist(t);
             }
             LOG.info(trustedIdps.size() + " TrustedIdpEntity added");
-            
+
             Collection<ApplicationEntity> applications = ctx.getBeansOfType(ApplicationEntity.class).values();
             for (ApplicationEntity a : applications) {
                 em.persist(a);
             }
             LOG.info(applications.size() + " ApplicationEntity added");
-            
+
             Collection<IdpEntity> idps = ctx.getBeansOfType(IdpEntity.class).values();
             for (IdpEntity i : idps) {
                 em.persist(i);
             }
             LOG.info(idps.size() + " IdpEntity added");
-            
+
             Collection<ApplicationClaimEntity> applicationClaims =
                 ctx.getBeansOfType(ApplicationClaimEntity.class).values();
             for (ApplicationClaimEntity ac : applicationClaims) {
                 em.persist(ac);
             }
             LOG.info(applicationClaims.size() + " ApplicationClaimEntity added");
-            
+
             em.flush();
         } catch (Exception ex) {
             LOG.warn("Failed to initialize DB with data", ex);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementDAOJPAImpl.java
index 5603e39..56c70ce 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementDAOJPAImpl.java
@@ -37,23 +37,23 @@ import org.springframework.transaction.annotation.Transactional;
 @Repository
 @Transactional
 public class EntitlementDAOJPAImpl implements EntitlementDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(EntitlementDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<Entitlement> getEntitlements(int start, int size) {
         List<Entitlement> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select e from Entitlement e");
-        
+
         //@SuppressWarnings("rawtypes")
         List<?> entitlementEntities = query
             .setFirstResult(start)
@@ -64,16 +64,16 @@ public class EntitlementDAOJPAImpl implements EntitlementDAO {
             EntitlementEntity entity = (EntitlementEntity) obj;
             list.add(entity2domain(entity));
         }
-        
+
         return list;
     }
-    
+
     @Override
     public Entitlement addEntitlement(Entitlement entitlement) {
         EntitlementEntity entity = new EntitlementEntity();
         domain2entity(entitlement, entity);
         em.persist(entity);
-        
+
         LOG.debug("Entitlement '{}' added", entitlement.getName());
         return entity2domain(entity);
     }
@@ -88,12 +88,12 @@ public class EntitlementDAOJPAImpl implements EntitlementDAO {
         Query query = null;
         query = em.createQuery("select e from Entitlement e where e.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         EntitlementEntity entitlementEntity = (EntitlementEntity)query.getSingleResult();
-        
+
         domain2entity(entitlement, entitlementEntity);
-        
+
         LOG.debug("Entitlement '{}' added", entitlement.getName());
         em.persist(entitlementEntity);
     }
@@ -103,23 +103,23 @@ public class EntitlementDAOJPAImpl implements EntitlementDAO {
         Query query = null;
         query = em.createQuery("select e from Entitlement e where e.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         Object entitlementObj = query.getSingleResult();
         em.remove(entitlementObj);
-        
+
         LOG.debug("Entitlement '{}' deleted", name);
     }
-    
+
     static EntitlementEntity getEntitlementEntity(String name, EntityManager em) {
         Query query = null;
         query = em.createQuery("select e from Entitlement e where e.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         return (EntitlementEntity)query.getSingleResult();
     }
-    
+
     public static void domain2entity(Entitlement entitlement, EntitlementEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (entitlement.getId() > 0) {
@@ -129,7 +129,7 @@ public class EntitlementDAOJPAImpl implements EntitlementDAO {
         entity.setName(entitlement.getName());
         entity.setDescription(entitlement.getDescription());
     }
-    
+
     public static Entitlement entity2domain(EntitlementEntity entity) {
         Entitlement entitlement = new Entitlement();
         entitlement.setId(entity.getId());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementEntity.java
index aec6b91..dbb169b 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/EntitlementEntity.java
@@ -25,19 +25,19 @@ import org.apache.openjpa.persistence.jdbc.Index;
 
 @Entity(name = "Entitlement")
 public class EntitlementEntity {
-    
+
     @Id
     private int id;
-    
+
     @Index
     private String name;
-    
+
     private String description;
-    
+
     //Internal entities can't be updated, changed and deleted
     //Default: false
     private boolean internal;
-        
+
     public int getId() {
         return id;
     }
@@ -45,7 +45,7 @@ public class EntitlementEntity {
     public void setId(int id) {
         this.id = id;
     }
-    
+
     public String getName() {
         return name;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPAImpl.java
index 5025a25..f085333 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpDAOJPAImpl.java
@@ -42,57 +42,57 @@ import org.springframework.transaction.annotation.Transactional;
 @Repository
 @Transactional
 public class IdpDAOJPAImpl implements IdpDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(IdpDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<Idp> getIdps(int start, int size, List<String> expandList) {
         List<Idp> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select i from IDP i");
-        
+
         /*List serviceEntities = query.setFirstResult(start)
             .setMaxResults(size)
             .getResultList();*/
-        
+
         //@SuppressWarnings("rawtypes")
         List<?> idpEntities = query
             .setFirstResult(start)
             .setMaxResults(size)
             .getResultList();
-    
+
         for (Object obj : idpEntities) {
             IdpEntity entity = (IdpEntity) obj;
             list.add(entity2domain(entity, expandList));
         }
         return list;
     }
-    
+
     @Override
     public Idp getIdp(String realm, List<String> expandList) {
         Query query = null;
         query = em.createQuery("select i from IDP i where i.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         Object idpObj = query.getSingleResult();
         return entity2domain((IdpEntity)idpObj, expandList);
     }
-    
+
     @Override
     public Idp addIdp(Idp idp) {
         IdpEntity entity = new IdpEntity();
         domain2entity(idp, entity);
         em.persist(entity);
-        
+
         LOG.debug("IDP '{}' added", idp.getRealm());
         return entity2domain(entity, Arrays.asList("all"));
     }
@@ -102,14 +102,14 @@ public class IdpDAOJPAImpl implements IdpDAO {
         Query query = null;
         query = em.createQuery("select i from IDP i where i.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         IdpEntity idpEntity = (IdpEntity)query.getSingleResult();
-        
+
         domain2entity(idp, idpEntity);
-        
+
         em.persist(idpEntity);
-        
+
         LOG.debug("IDP '{}' updated", idp.getRealm());
     }
 
@@ -118,14 +118,14 @@ public class IdpDAOJPAImpl implements IdpDAO {
         Query query = null;
         query = em.createQuery("select i from IDP i where i.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         Object idpObj = query.getSingleResult();
         em.remove(idpObj);
-        
+
         LOG.debug("IDP '{}' deleted", realm);
     }
-    
+
     @Override
     public void addApplicationToIdp(Idp idp, Application application) {
         IdpEntity idpEntity = null;
@@ -134,19 +134,19 @@ public class IdpDAOJPAImpl implements IdpDAO {
         } else {
             idpEntity = getIdpEntity(idp.getRealm(), em);
         }
-        
+
         ApplicationEntity applicationEntity = null;
         if (application.getId() != 0) {
             applicationEntity = em.find(ApplicationEntity.class, application.getId());
         } else {
             applicationEntity = ApplicationDAOJPAImpl.getApplicationEntity(application.getRealm(), em);
         }
-        
+
         idpEntity.getApplications().add(applicationEntity);
-        
+
         LOG.debug("Application '{}' added to IDP '{}'", application.getRealm(), idp.getRealm());
     }
-    
+
     @Override
     public void removeApplicationFromIdp(Idp idp, Application application) {
         IdpEntity idpEntity = null;
@@ -155,25 +155,25 @@ public class IdpDAOJPAImpl implements IdpDAO {
         } else {
             idpEntity = getIdpEntity(idp.getRealm(), em);
         }
-        
+
         ApplicationEntity applicationEntity = null;
         if (application.getId() != 0) {
             applicationEntity = em.find(ApplicationEntity.class, application.getId());
         } else {
             applicationEntity = ApplicationDAOJPAImpl.getApplicationEntity(application.getRealm(), em);
         }
-        
+
         if (applicationEntity == null) {
             throw new EntityNotFoundException("ApplicationEntity not found");
         }
-        
+
         if (!idpEntity.getApplications().remove(applicationEntity)) {
             throw new EntityNotFoundException("ApplicationEntity not assigned to IdpEntity");
         }
-                
+
         LOG.debug("Application '{}' removed from IDP '{}'", application.getRealm(), idp.getRealm());
     }
-    
+
     @Override
     public void addTrustedIdpToIdp(Idp idp, TrustedIdp trustedIdp) {
         IdpEntity idpEntity = null;
@@ -182,19 +182,19 @@ public class IdpDAOJPAImpl implements IdpDAO {
         } else {
             idpEntity = getIdpEntity(idp.getRealm(), em);
         }
-        
+
         TrustedIdpEntity trustedIdpEntity = null;
         if (trustedIdp.getId() != 0) {
             trustedIdpEntity = em.find(TrustedIdpEntity.class, trustedIdp.getId());
         } else {
             trustedIdpEntity = TrustedIdpDAOJPAImpl.getTrustedIdpEntity(trustedIdp.getRealm(), em);
         }
-        
+
         idpEntity.getTrustedIdps().add(trustedIdpEntity);
-        
+
         LOG.debug("Trusted IDP '{}' added to IDP '{}'", trustedIdp.getRealm(), idp.getRealm());
     }
-    
+
     @Override
     public void removeTrustedIdpFromIdp(Idp idp, TrustedIdp trustedIdp) {
         IdpEntity idpEntity = null;
@@ -203,19 +203,19 @@ public class IdpDAOJPAImpl implements IdpDAO {
         } else {
             idpEntity = getIdpEntity(idp.getRealm(), em);
         }
-        
+
         TrustedIdpEntity trustedIdpEntity = null;
         if (trustedIdp.getId() != 0) {
             trustedIdpEntity = em.find(TrustedIdpEntity.class, trustedIdp.getId());
         } else {
             trustedIdpEntity = TrustedIdpDAOJPAImpl.getTrustedIdpEntity(trustedIdp.getRealm(), em);
         }
-        
+
         idpEntity.getTrustedIdps().remove(trustedIdpEntity);
-        
+
         LOG.debug("Trusted IDP '{}' removed from IDP '{}'", trustedIdp.getRealm(), idp.getRealm());
     }
-        
+
     @Override
     public void addClaimToIdp(Idp idp, Claim claim) {
         IdpEntity idpEntity = null;
@@ -224,19 +224,19 @@ public class IdpDAOJPAImpl implements IdpDAO {
         } else {
             idpEntity = getIdpEntity(idp.getRealm(), em);
         }
-        
+
         ClaimEntity claimEntity = null;
         if (claim.getId() != 0) {
             claimEntity = em.find(ClaimEntity.class, claim.getId());
         } else {
             claimEntity = ClaimDAOJPAImpl.getClaimEntity(claim.getClaimType().toString(), em);
         }
-        
+
         idpEntity.getClaimTypesOffered().add(claimEntity);
-        
+
         LOG.debug("Claim '{}' added to IDP '{}'", claim.getClaimType(), idp.getRealm());
     }
-    
+
     @Override
     public void removeClaimFromIdp(Idp idp, Claim claim) {
         IdpEntity idpEntity = null;
@@ -248,7 +248,7 @@ public class IdpDAOJPAImpl implements IdpDAO {
         if (idpEntity == null) {
             throw new EntityNotFoundException("IdpEntity not found");
         }
-        
+
         ClaimEntity claimEntity = null;
         if (claim.getId() != 0) {
             claimEntity = em.find(ClaimEntity.class, claim.getId());
@@ -258,29 +258,29 @@ public class IdpDAOJPAImpl implements IdpDAO {
         if (claimEntity == null) {
             throw new EntityNotFoundException("ClaimEntity not found");
         }
-        
+
         if (!idpEntity.getClaimTypesOffered().remove(claimEntity)) {
             throw new EntityNotFoundException("ClaimEntity not assigned to IdpEntity");
         }
-        
+
         LOG.debug("Claim '{}' removed from IDP '{}'", claim.getClaimType(), idp.getRealm());
     }
-    
+
     static IdpEntity getIdpEntity(String realm, EntityManager em) {
         Query query = null;
         query = em.createQuery("select i from IDP i where i.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         return (IdpEntity)query.getSingleResult();
     }
-    
+
     public static void domain2entity(Idp idp, IdpEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (idp.getId() > 0) {
             entity.setId(idp.getId());
         }
-        
+
         entity.setCertificate(idp.getCertificate());
         entity.setCertificatePassword(idp.getCertificatePassword());
         entity.setRealm(idp.getRealm());
@@ -294,24 +294,24 @@ public class IdpDAOJPAImpl implements IdpDAO {
         entity.setUseCurrentIdp(idp.isUseCurrentIdp());
         entity.setRpSingleSignOutConfirmation(idp.isRpSingleSignOutConfirmation());
         entity.setRpSingleSignOutCleanupConfirmation(idp.isRpSingleSignOutCleanupConfirmation());
-        
+
         entity.getAuthenticationURIs().clear();
         for (Map.Entry<String, String> item : idp.getAuthenticationURIs().entrySet()) {
             entity.getAuthenticationURIs().put(item.getKey(), item.getValue());
         }
-        
+
         entity.getTokenTypesOffered().clear();
         for (String item : idp.getTokenTypesOffered()) {
             entity.getTokenTypesOffered().add(item);
         }
-        
+
         entity.getSupportedProtocols().clear();
         for (String item : idp.getSupportedProtocols()) {
             entity.getSupportedProtocols().add(item);
-        }        
+        }
     }
 
-    
+
     public static Idp entity2domain(IdpEntity entity, List<String> expandList) {
         Idp idp = new Idp();
         idp.setId(entity.getId());
@@ -328,39 +328,39 @@ public class IdpDAOJPAImpl implements IdpDAO {
         idp.setUseCurrentIdp(entity.isUseCurrentIdp());
         idp.setRpSingleSignOutConfirmation(entity.isRpSingleSignOutConfirmation());
         idp.setRpSingleSignOutCleanupConfirmation(entity.isRpSingleSignOutCleanupConfirmation());
-        
+
         if (expandList != null && (expandList.contains("all") || expandList.contains("applications"))) {
             for (ApplicationEntity item : entity.getApplications()) {
                 Application application = ApplicationDAOJPAImpl.entity2domain(item, expandList);
                 idp.getApplications().add(application);
             }
         }
-        
+
         if (expandList != null && (expandList.contains("all") || expandList.contains("trusted-idps"))) {
             for (TrustedIdpEntity item : entity.getTrustedIdps()) {
                 TrustedIdp trustedIdp = TrustedIdpDAOJPAImpl.entity2domain(item);
                 idp.getTrustedIdps().add(trustedIdp);
             }
         }
-        
+
         for (Map.Entry<String, String> item : entity.getAuthenticationURIs().entrySet()) {
             idp.getAuthenticationURIs().put(item.getKey(), item.getValue());
         }
-        
+
         for (String item : entity.getTokenTypesOffered()) {
             idp.getTokenTypesOffered().add(item);
         }
-        
+
         for (String item : entity.getSupportedProtocols()) {
             idp.getSupportedProtocols().add(item);
         }
-        
+
         if (expandList != null && (expandList.contains("all") || expandList.contains("claims"))) {
             for (ClaimEntity item : entity.getClaimTypesOffered()) {
                 idp.getClaimTypesOffered().add(ClaimDAOJPAImpl.entity2domain(item));
             }
         }
-        
+
         return idp;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
index 986b28d..1430fbc 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/IdpEntity.java
@@ -82,14 +82,14 @@ public class IdpEntity {
     // published hostname, port must be configured
     @NotNull
     private URL idpUrl;
-    
+
     private boolean rpSingleSignOutConfirmation;
 
     // RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
     // "http://docs.oasis-open.org/ws-sx/ws-trust/200512"
     // Could be more in the future
-    
+
     @ElementCollection
     @CollectionTable(name = "idp_protocols")
     @Column(name = "protocol")
@@ -134,7 +134,7 @@ public class IdpEntity {
 
     // ServiceDescription
     private String serviceDescription;
-    
+
     private boolean rpSingleSignOutCleanupConfirmation;
 
 
@@ -145,7 +145,7 @@ public class IdpEntity {
     public void setId(int id) {
         this.id = id;
     }
-    
+
     public String getRealm() {
         return realm;
     }
@@ -281,7 +281,7 @@ public class IdpEntity {
     public void setServiceDescription(String serviceDescription) {
         this.serviceDescription = serviceDescription;
     }
-    
+
     public boolean isRpSingleSignOutConfirmation() {
         return rpSingleSignOutConfirmation;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleDAOJPAImpl.java
index 0493bf9..ac70772 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleDAOJPAImpl.java
@@ -39,53 +39,53 @@ import org.springframework.transaction.annotation.Transactional;
 @Repository
 @Transactional
 public class RoleDAOJPAImpl implements RoleDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(RoleDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<Role> getRoles(int start, int size, List<String> expandList) {
         List<Role> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select r from Role r");
-        
+
         //@SuppressWarnings("rawtypes")
         List<?> roleEntities = query
             .setFirstResult(start)
             .setMaxResults(size)
             .getResultList();
-    
+
         for (Object obj : roleEntities) {
             RoleEntity entity = (RoleEntity) obj;
             list.add(entity2domain(entity, expandList));
         }
         return list;
     }
-    
+
     @Override
     public Role getRole(String name, List<String> expandList) {
         Query query = null;
         query = em.createQuery("select r from Role r where r.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         Object roleObj = query.getSingleResult();
         return entity2domain((RoleEntity)roleObj, expandList);
     }
-    
+
     @Override
     public Role addRole(Role role) {
         RoleEntity entity = new RoleEntity();
         domain2entity(role, entity);
         em.persist(entity);
-        
+
         LOG.debug("Role '{}' added", role.getName());
         return entity2domain(entity, Arrays.asList("all"));
     }
@@ -95,14 +95,14 @@ public class RoleDAOJPAImpl implements RoleDAO {
         Query query = null;
         query = em.createQuery("select r from Role r where r.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         RoleEntity roleEntity = (RoleEntity)query.getSingleResult();
-        
+
         domain2entity(role, roleEntity);
-        
+
         em.persist(roleEntity);
-        
+
         LOG.debug("Role '{}' updated", role.getName());
     }
 
@@ -111,14 +111,14 @@ public class RoleDAOJPAImpl implements RoleDAO {
         Query query = null;
         query = em.createQuery("select r from Role r where r.name=:name");
         query.setParameter("name", name);
-        
+
         //@SuppressWarnings("rawtypes")
         Object roleObj = query.getSingleResult();
         em.remove(roleObj);
-        
+
         LOG.debug("Role '{}' deleted", name);
     }
-    
+
     @Override
     public void addEntitlementToRole(Role role, Entitlement entitlement) {
         RoleEntity roleEntity = null;
@@ -127,19 +127,19 @@ public class RoleDAOJPAImpl implements RoleDAO {
         } else {
             roleEntity = getRoleEntity(role.getName(), em);
         }
-        
+
         EntitlementEntity entitlementEntity = null;
         if (entitlement.getId() != 0) {
             entitlementEntity = em.find(EntitlementEntity.class, entitlement.getId());
         } else {
             entitlementEntity = EntitlementDAOJPAImpl.getEntitlementEntity(entitlement.getName(), em);
         }
-        
+
         roleEntity.getEntitlements().add(entitlementEntity);
-        
+
         LOG.debug("Entitlement '{}' added to Role '{}'", entitlement.getName(), role.getName());
     }
-    
+
     @Override
     public void removeEntitlementFromRole(Role role, Entitlement entitlement) {
         RoleEntity roleEntity = null;
@@ -148,58 +148,58 @@ public class RoleDAOJPAImpl implements RoleDAO {
         } else {
             roleEntity = getRoleEntity(role.getName(), em);
         }
-        
+
         EntitlementEntity entitlementEntity = null;
         if (entitlement.getId() != 0) {
             entitlementEntity = em.find(EntitlementEntity.class, entitlement.getId());
         } else {
             entitlementEntity = EntitlementDAOJPAImpl.getEntitlementEntity(entitlement.getName(), em);
         }
-        
+
         if (entitlementEntity == null) {
             throw new EntityNotFoundException("EntitlementEntity not found");
         }
-        
+
         if (!roleEntity.getEntitlements().remove(entitlementEntity)) {
             throw new EntityNotFoundException("EntitlementEntity not assigned to RoleEntity");
         }
-        
+
         LOG.debug("Entitlement '{}' removed from Role '{}'", entitlement.getName(), role.getName());
     }
-    
+
     static RoleEntity getRoleEntity(String realm, EntityManager em) {
         Query query = null;
         query = em.createQuery("select i from IDP i where i.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         return (RoleEntity)query.getSingleResult();
     }
-    
+
     public static void domain2entity(Role role, RoleEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (role.getId() > 0) {
             entity.setId(role.getId());
         }
-        
+
         entity.setName(role.getName());
         entity.setDescription(role.getDescription());
     }
 
-    
+
     public static Role entity2domain(RoleEntity entity, List<String> expandList) {
         Role role = new Role();
         role.setId(entity.getId());
         role.setName(entity.getName());
         role.setDescription(entity.getDescription());
-        
+
         if (expandList != null && (expandList.contains("all") || expandList.contains("entitlements"))) {
             for (EntitlementEntity item : entity.getEntitlements()) {
                 Entitlement entitlement = EntitlementDAOJPAImpl.entity2domain(item);
                 role.getEntitlements().add(entitlement);
             }
         }
-        
+
         return role;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleEntity.java
index 3b515c3..eb7c141 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/RoleEntity.java
@@ -30,18 +30,18 @@ import org.apache.openjpa.persistence.jdbc.Index;
 
 @Entity(name = "Role")
 public class RoleEntity {
-    
+
     @Id
     private int id;
-    
+
     @Index
     private String name;
-    
+
     private String description;
-    
+
     @ManyToMany(cascade = CascadeType.ALL)
     private List<EntitlementEntity> entitlements = new ArrayList<>();
-    
+
     public int getId() {
         return id;
     }
@@ -49,7 +49,7 @@ public class RoleEntity {
     public void setId(int id) {
         this.id = id;
     }
-    
+
     public String getName() {
         return name;
     }
@@ -65,7 +65,7 @@ public class RoleEntity {
     public void setDescription(String description) {
         this.description = description;
     }
-    
+
     public List<EntitlementEntity> getEntitlements() {
         return entitlements;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPAImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPAImpl.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPAImpl.java
index 16d05f1..fbb654a 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPAImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpDAOJPAImpl.java
@@ -37,23 +37,23 @@ import org.springframework.transaction.annotation.Transactional;
 @Transactional
 @Repository
 public class TrustedIdpDAOJPAImpl implements TrustedIdpDAO {
-    
+
     private static final Logger LOG = LoggerFactory.getLogger(TrustedIdpDAOJPAImpl.class);
 
     private EntityManager em;
-    
+
     @PersistenceContext
     public void setEntityManager(EntityManager entityManager) {
         this.em = entityManager;
     }
-    
+
     @Override
     public List<TrustedIdp> getTrustedIDPs(int start, int size) {
         List<TrustedIdp> list = new ArrayList<>();
-        
+
         Query query = null;
         query = em.createQuery("select t from TrustedIDP t");
-        
+
         List<?> idpEntities = query
             .setFirstResult(start)
             .setMaxResults(size)
@@ -63,7 +63,7 @@ public class TrustedIdpDAOJPAImpl implements TrustedIdpDAO {
             TrustedIdpEntity entity = (TrustedIdpEntity) obj;
             list.add(entity2domain(entity));
         }
-        
+
         return list;
     }
 
@@ -71,24 +71,24 @@ public class TrustedIdpDAOJPAImpl implements TrustedIdpDAO {
     public TrustedIdp getTrustedIDP(String realm) {
         return entity2domain(getTrustedIdpEntity(realm, em));
     }
-    
+
     @Override
     public TrustedIdp addTrustedIDP(TrustedIdp trustedIdp) {
         TrustedIdpEntity entity = new TrustedIdpEntity();
         domain2entity(trustedIdp, entity);
         em.persist(entity);
-        
+
         LOG.debug("Trusted IDP '" + trustedIdp.getRealm() + "' added");
         return entity2domain(entity);
     }
-    
+
     @Override
     public void updateTrustedIDP(String realm, TrustedIdp trustedIdp) {
         TrustedIdpEntity trustedIdpEntity = getTrustedIdpEntity(realm, em);
-        
+
         domain2entity(trustedIdp, trustedIdpEntity);
         em.persist(trustedIdpEntity);
-        
+
         LOG.debug("Trusted IDP '" + trustedIdp.getRealm() + "' updated");
     }
 
@@ -97,23 +97,23 @@ public class TrustedIdpDAOJPAImpl implements TrustedIdpDAO {
         Query query = null;
         query = em.createQuery("select t from TrustedIDP t where t.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         Object trustedIdpObj = query.getSingleResult();
         em.remove(trustedIdpObj);
-        
+
         LOG.debug("Trusted IDP '" + realm + "' deleted");
     }
-    
+
     static TrustedIdpEntity getTrustedIdpEntity(String realm, EntityManager em) {
         Query query = null;
         query = em.createQuery("select t from TrustedIDP t where t.realm=:realm");
         query.setParameter("realm", realm);
-        
+
         //@SuppressWarnings("rawtypes")
         return (TrustedIdpEntity)query.getSingleResult();
     }
-    
+
     public static void domain2entity(TrustedIdp trustedIDP, TrustedIdpEntity entity) {
         //The ID must not be updated if the entity has got an id already (update case)
         if (trustedIDP.getId() > 0) {
@@ -132,7 +132,7 @@ public class TrustedIdpDAOJPAImpl implements TrustedIdpDAO {
         entity.setUrl(trustedIDP.getUrl());
         entity.setParameters(trustedIDP.getParameters());
     }
-    
+
     public static TrustedIdp entity2domain(TrustedIdpEntity entity) {
         TrustedIdp trustedIDP = new TrustedIdp();
         trustedIDP.setId(entity.getId());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
index a4c6592..9ee23a9 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpEntity.java
@@ -47,52 +47,52 @@ public class TrustedIdpEntity {
     @Index
     @NotNull
     private String realm;  //wtrealm, whr
-    
+
     private String issuer;  //Validation of issuer name in SAMLResponse
 
     // Should tokens be cached from trusted IDPs
     // to avoid redirection to the trusted IDP again for next SignIn request
     private boolean cacheTokens;
-    
+
     //Could be read from Metadata, PassiveRequestorEndpoint
     @NotNull
     private String url;
-    
+
     //Could be read from Metadata, md:KeyDescriptor, use="signing"
     //Store certificate in DB or filesystem, provide options?
     private String certificate;
-    
+
     //Direct trust (signing cert imported), Indirect trust (CA certs imported, subject configured)
     @Enumerated(EnumType.STRING)
     private TrustType trustType;
-    
+
     //Could be read from Metadata, RoleDescriptor protocolSupportEnumeration=
     // "http://docs.oasis-open.org/wsfed/federation/200706"
     // Metadata could provide more than one but one must be chosen
     @TrustedIdpProtocolSupported
     private String protocol;
-    
+
     //FederateIdentity, FederateClaims
     @Enumerated(EnumType.STRING)
     private FederationType federationType;
-    
+
     //optional (to provide a list of IDPs)
     @NotNull
     private String name;
-    
+
     //optional (to provide a list of IDPs)
     private String description;
-    
+
     //optional (to provide a list of IDPs)
     private String logo;
-    
+
     // Additional (possibly protocol specific parameters)
     @ElementCollection
     @MapKeyColumn(name = "name")
     @Column(name = "value")
     @CollectionTable(name = "trusted_idp_parameters", joinColumns = @JoinColumn(name = "trusted_idp_id"))
     private Map<String, String> parameters = new HashMap<>();
-    
+
 
     public int getId() {
         return id;
@@ -109,7 +109,7 @@ public class TrustedIdpEntity {
     public void setIssuer(String issuer) {
         this.issuer = issuer;
     }
-    
+
     public String getRealm() {
         return realm;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
index 75ac2ec..54c00f2 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
@@ -39,10 +39,10 @@ public class TrustedIdpProtocolSupportValidator implements ConstraintValidator<T
     // Qualifier workaround. See http://www.jayway.com/2013/11/03/spring-and-autowiring-of-generic-types/
     @Qualifier("trustedIdpProtocolControllerImpl")
     private ProtocolController<TrustedIdpProtocolHandler> trustedIdpProtocolHandlers;
-    
+
     @Override
     public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
-        
+
         List<String> protocols = trustedIdpProtocolHandlers.getProtocols();
         return protocols.contains(object);
     }


Mime
View raw message