Skip to content

Commit 1538e72

Browse files
committed
remove lcm
1 parent daf9b84 commit 1538e72

File tree

7 files changed

+147
-30
lines changed

7 files changed

+147
-30
lines changed

components/apimgt/org.wso2.carbon.apimgt.gateway/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
--add-exports java.base/sun.nio.cs=ALL-UNNAMED
380380
</argLine>
381381
<classpathDependencyExcludes>
382-
<classpathDependencyExclude>org.wso2.org.ops4j.pax.logging:pax-logging-api</classpathDependencyExclude>
382+
<classpathDependencyExclude>org.wso2.org.ops4j.pax.logging</classpathDependencyExclude>
383383
<classpathDependencyExclude>org.wso2.orbit.com.fasterxml.jackson.core:jackson-core</classpathDependencyExclude>
384384
</classpathDependencyExcludes>
385385
<systemProperties>

components/apimgt/org.wso2.carbon.apimgt.impl/pom.xml

+1-10
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,7 @@
223223
<artifactId>hamcrest-all</artifactId>
224224
<scope>test</scope>
225225
</dependency>
226-
<dependency>
227-
<groupId>org.wso2.carbon.governance</groupId>
228-
<artifactId>org.wso2.carbon.governance.custom.lifecycles.checklist</artifactId>
229-
<exclusions>
230-
<exclusion>
231-
<groupId>org.apache.poi.wso2</groupId>
232-
<artifactId>poi-ooxml</artifactId>
233-
</exclusion>
234-
</exclusions>
235-
</dependency>
226+
236227
<dependency>
237228
<groupId>org.apache.pdfbox</groupId>
238229
<artifactId>pdfbox</artifactId>

components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import org.wso2.carbon.apimgt.impl.importexport.ExportFormat;
6767
import org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI;
6868
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
69+
import org.wso2.carbon.apimgt.impl.lifecycle.CheckListItem;
6970
import org.wso2.carbon.apimgt.impl.monetization.DefaultMonetizationImpl;
7071
import org.wso2.carbon.apimgt.impl.notification.NotificationDTO;
7172
import org.wso2.carbon.apimgt.impl.notification.NotificationExecutor;
@@ -96,7 +97,6 @@
9697
import org.wso2.carbon.context.CarbonContext;
9798
import org.wso2.carbon.context.PrivilegedCarbonContext;
9899
import org.wso2.carbon.databridge.commons.Event;
99-
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.CheckListItem;
100100
import org.wso2.carbon.identity.application.common.model.IdentityProvider;
101101
import org.wso2.carbon.user.api.UserStoreException;
102102
import org.wso2.carbon.user.api.UserStoreManager;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
3+
*
4+
* WSO2 Inc. licenses this file to you under the Apache License,
5+
* Version 2.0 (the "License"); you may not use this file except
6+
* in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
package org.wso2.carbon.apimgt.impl.lifecycle;
19+
public class CheckListItem implements Comparable {
20+
private String lifeCycleStatus;
21+
private String name;
22+
private String value;
23+
private String order;
24+
private String propertyName;
25+
private String isVisible;
26+
private static final Object HASH_CODE_OBJECT = new Object();
27+
28+
public String getVisible() {
29+
return this.isVisible;
30+
}
31+
32+
public void setVisible(String visible) {
33+
this.isVisible = visible;
34+
}
35+
36+
public String getPropertyName() {
37+
return this.propertyName;
38+
}
39+
40+
public void setPropertyName(String propertyName) {
41+
this.propertyName = propertyName;
42+
}
43+
44+
public String getLifeCycleStatus() {
45+
return this.lifeCycleStatus;
46+
}
47+
48+
public void setLifeCycleStatus(String lifeCycleStatus) {
49+
this.lifeCycleStatus = lifeCycleStatus;
50+
}
51+
52+
public String getName() {
53+
return this.name;
54+
}
55+
56+
public void setName(String name) {
57+
this.name = name;
58+
}
59+
60+
public String getValue() {
61+
return this.value;
62+
}
63+
64+
public void setValue(String value) {
65+
this.value = value;
66+
}
67+
68+
public String getOrder() {
69+
return this.order;
70+
}
71+
72+
public void setOrder(String order) {
73+
this.order = order;
74+
}
75+
76+
public CheckListItem(String lifeCycleStatus, String name, String value, String order) {
77+
this.lifeCycleStatus = lifeCycleStatus;
78+
this.name = name;
79+
this.value = value;
80+
this.order = order;
81+
}
82+
83+
public CheckListItem() {
84+
}
85+
86+
public boolean matchLifeCycleStatus(String status, boolean ignoreCase) {
87+
if (this.lifeCycleStatus != null && status != null) {
88+
return ignoreCase ? this.lifeCycleStatus.equalsIgnoreCase(status) : this.lifeCycleStatus.equals(status);
89+
} else {
90+
return false;
91+
}
92+
}
93+
94+
public boolean matchLifeCycleStatus(String status) {
95+
return this.matchLifeCycleStatus(status, true);
96+
}
97+
98+
public int hashCode() {
99+
int hashCode = HASH_CODE_OBJECT.hashCode();
100+
if (this.order != null) {
101+
hashCode &= this.order.hashCode();
102+
}
103+
104+
if (this.name != null) {
105+
hashCode &= this.name.hashCode();
106+
}
107+
108+
if (this.value != null) {
109+
hashCode &= this.value.hashCode();
110+
}
111+
112+
if (this.lifeCycleStatus != null) {
113+
hashCode &= this.lifeCycleStatus.hashCode();
114+
}
115+
116+
if (this.propertyName != null) {
117+
hashCode &= this.propertyName.hashCode();
118+
}
119+
120+
return hashCode;
121+
}
122+
123+
public boolean equals(Object obj) {
124+
if (!(obj instanceof CheckListItem)) {
125+
return false;
126+
} else {
127+
CheckListItem item = (CheckListItem)obj;
128+
return (this.order != null && this.order.equals(item.order) || this.order == null && item.order == null) && (this.lifeCycleStatus != null && this.lifeCycleStatus.equals(item.lifeCycleStatus) || this.lifeCycleStatus == null && item.lifeCycleStatus == null) && (this.name != null && this.name.equals(item.name) || this.name == null && item.name == null) && (this.value != null && this.value.equals(item.value) || this.value == null && item.value == null) && (this.propertyName != null && this.propertyName.equals(item.propertyName) || this.propertyName == null && item.propertyName == null);
129+
}
130+
}
131+
132+
public int compareTo(Object anotherItem) {
133+
if (this.equals(anotherItem)) {
134+
return 0;
135+
} else {
136+
CheckListItem item = (CheckListItem)anotherItem;
137+
int otherItemOrder = Integer.parseInt(item.getOrder());
138+
int itemOrder = Integer.parseInt(this.order);
139+
return itemOrder - otherItemOrder;
140+
}
141+
}
142+
}

components/apimgt/org.wso2.carbon.apimgt.impl/src/test/java/org/wso2/carbon/apimgt/impl/APIProviderImplTest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.mockito.Mockito;
3232
import org.mockito.stubbing.Answer;
3333
import org.powermock.api.mockito.PowerMockito;
34-
import org.powermock.core.classloader.annotations.PowerMockIgnore;
3534
import org.powermock.core.classloader.annotations.PrepareForTest;
3635
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
3736
import org.powermock.modules.junit4.PowerMockRunner;
@@ -105,7 +104,6 @@
105104
import org.wso2.carbon.governance.api.generic.GenericArtifactManager;
106105
import org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact;
107106
import org.wso2.carbon.governance.api.util.GovernanceUtils;
108-
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.LifecycleBeanPopulator;
109107
import org.wso2.carbon.registry.core.Collection;
110108
import org.wso2.carbon.registry.core.Registry;
111109
import org.wso2.carbon.registry.core.Resource;
@@ -152,7 +150,7 @@
152150
@SuppressStaticInitializationFor("org.wso2.carbon.context.PrivilegedCarbonContext")
153151
@PrepareForTest({ ServiceReferenceHolder.class, ApiMgtDAO.class, APIUtil.class, APIGatewayManager.class,
154152
GovernanceUtils.class, PrivilegedCarbonContext.class, WorkflowExecutorFactory.class, JavaUtils.class,
155-
APIProviderImpl.class, APIManagerFactory.class, RegistryUtils.class, LifecycleBeanPopulator.class,
153+
APIProviderImpl.class, APIManagerFactory.class, RegistryUtils.class,
156154
Caching.class, PaginationContext.class, MultitenantUtils.class, AbstractAPIManager.class, OASParserUtil.class,
157155
KeyManagerHolder.class, CertificateManagerImpl.class , PublisherAPI.class, Organization.class,
158156
APIPersistence.class, GatewayArtifactsMgtDAO.class, RegistryPersistenceUtil.class})
@@ -183,7 +181,6 @@ public void init() throws Exception {
183181
PowerMockito.mockStatic(RegistryUtils.class);
184182
PowerMockito.mockStatic(GovernanceUtils.class);
185183
PowerMockito.mockStatic(WorkflowExecutorFactory.class);
186-
PowerMockito.mockStatic(LifecycleBeanPopulator.class);
187184
PowerMockito.mockStatic(KeyManagerHolder.class);
188185
PowerMockito.mockStatic(Caching.class);
189186
PowerMockito.mockStatic(PaginationContext.class);

components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/APIMappingUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import org.wso2.carbon.apimgt.impl.definitions.AsyncApiParser;
6363
import org.wso2.carbon.apimgt.impl.definitions.OASParserUtil;
6464
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
65+
import org.wso2.carbon.apimgt.impl.lifecycle.CheckListItem;
6566
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
6667
import org.wso2.carbon.apimgt.impl.wsdl.model.WSDLInfo;
6768
import org.wso2.carbon.apimgt.impl.wsdl.model.WSDLValidationResponse;
@@ -121,7 +122,6 @@
121122
import org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.WorkflowResponseDTO;
122123
import org.wso2.carbon.core.util.CryptoException;
123124
import org.wso2.carbon.core.util.CryptoUtil;
124-
import org.wso2.carbon.governance.custom.lifecycles.checklist.util.CheckListItem;
125125
import org.wso2.carbon.user.api.UserStoreException;
126126
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
127127
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

pom.xml

-13
Original file line numberDiff line numberDiff line change
@@ -930,19 +930,6 @@
930930
<version>${carbon.governance.version}</version>
931931
</dependency>
932932

933-
934-
<dependency>
935-
<groupId>org.wso2.carbon.governance</groupId>
936-
<artifactId>org.wso2.carbon.governance.custom.lifecycles.checklist</artifactId>
937-
<version>${carbon.governance.version}</version>
938-
<exclusions>
939-
<exclusion>
940-
<groupId>org.apache.poi.wso2</groupId>
941-
<artifactId>poi-scratchpad</artifactId>
942-
</exclusion>
943-
</exclusions>
944-
</dependency>
945-
946933
<dependency>
947934
<groupId>org.wso2.org.ops4j.pax.logging</groupId>
948935
<artifactId>pax-logging-api</artifactId>

0 commit comments

Comments
 (0)