-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor registry impl code #5787
Refactor registry impl code #5787
Conversation
3cd1181
to
0846ae8
Compare
@@ -84,6 +88,7 @@ public RegistryPolicyDAOImpl() { | |||
@Override | |||
public void init(Properties properties) { | |||
|
|||
// Do nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we avoid overriding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reintroduced the legacy implementation where we set the pdp path reading entitlement properties. Earlier impl seemed to disregard the value set in the properties file.
...ntitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/RegistryPolicyDAOImpl.java
Outdated
Show resolved
Hide resolved
...ntitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/RegistryPolicyDAOImpl.java
Show resolved
Hide resolved
LOG.debug("Removing entitlement policy"); | ||
} | ||
|
||
// Restricts removing policies, that have already been published |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original registry implementation removes the policy from PAP even its published..
But with [1] we decided and implement to avoid removing policies that are published..
But when implementing this, we noted that behaviour change is not needed and we can keep the original behaviour..
Can you confirm this is the reason to remove this code block @Yoshani ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this behavior can be supported in the RDBMS implementation, hence this behavioral change has been reverted.
...ntitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/RegistryPolicyDAOImpl.java
Outdated
Show resolved
Hide resolved
...ntitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/RegistryPolicyDAOImpl.java
Outdated
Show resolved
Hide resolved
@@ -179,7 +203,7 @@ public String[] getVersions(String policyId) { | |||
} | |||
} | |||
} catch (RegistryException e) { | |||
LOG.error("Error while creating new version of policy", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was previous message wrong, and you are correcting it over here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this method retrieves existing versions, not creating any
...ement/src/main/java/org/wso2/carbon/identity/entitlement/pap/store/PAPPolicyStoreReader.java
Outdated
Show resolved
Hide resolved
...identity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/EntitlementUtil.java
Outdated
Show resolved
Hide resolved
...ntitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/RegistryPolicyDAOImpl.java
Outdated
Show resolved
Hide resolved
2fadf7a
to
799b5ad
Compare
....entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dto/PublisherDataHolder.java
Show resolved
Hide resolved
/** | ||
* This implementation handles the subscriber management in the Registry. | ||
*/ | ||
public class RegistrySubscriberDAOImpl implements SubscriberDAO { | ||
|
||
public static final String SUBSCRIBER_ID = "subscriberId"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is added to the PDPConstants class instead. Since RegistrySubscriberDAOImpl.java
class was newly introduced, it is safe to remove this public constant.
799b5ad
to
511f6fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed changes in this pull request
Refactors the code.
Also brings the ability to delete already published policies from PAP back, since it can be supported by the DB impl.
Related issues
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation