Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 19, 2019
2 parents 0dfe2ed + 29fca9c commit c1353af
Show file tree
Hide file tree
Showing 169 changed files with 8,527 additions and 1,211 deletions.
21 changes: 19 additions & 2 deletions build-system/pom.xml
Expand Up @@ -78,7 +78,7 @@
<jdbc.mariadb>2.3.0</jdbc.mariadb>
<jdbc.mysql>6.0.6</jdbc.mysql>
<wicket.version>8.0.0</wicket.version>
<groovy.version>2.4.14</groovy.version>
<groovy.version>2.5.6</groovy.version>
<activiti-engine.version>5.22.0</activiti-engine.version>
<activiti-spring.version>5.22.0</activiti-spring.version>
<commons-email.version>1.3</commons-email.version>
Expand All @@ -95,6 +95,8 @@
<jcommander.version>1.72</jcommander.version>
<failsafe.version>3.0.0-M2</failsafe.version>
<antrun.version>1.8</antrun.version>
<rabbit-amqp-client.version>5.1.2</rabbit-amqp-client.version> <!-- must match the version used by Spring Boot -->
<qpid-broker.version>7.1.1</qpid-broker.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -223,6 +225,7 @@
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.python</groupId>
Expand Down Expand Up @@ -1226,7 +1229,21 @@
<artifactId>jetty-server</artifactId>
<version>9.4.11.v20180605</version>
</dependency>

<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-broker-core</artifactId>
<version>${qpid-broker.version}</version>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-broker-plugins-amqp-0-8-protocol</artifactId>
<version>${qpid-broker.version}</version>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-broker-plugins-memory-store</artifactId>
<version>${qpid-broker.version}</version>
</dependency>
</dependencies>

</dependencyManagement>
Expand Down
Expand Up @@ -46,6 +46,7 @@
import com.evolveum.midpoint.prism.query.builder.S_FilterEntryOrEmpty;
import com.evolveum.midpoint.prism.util.PolyStringUtils;
import com.evolveum.midpoint.repo.api.CacheDispatcher;
import com.evolveum.midpoint.repo.api.CounterManager;
import com.evolveum.midpoint.repo.common.ObjectResolver;
import com.evolveum.midpoint.repo.common.expression.Expression;
import com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext;
Expand Down Expand Up @@ -311,6 +312,9 @@ public abstract class PageBase extends WebPage implements ModelServiceLocator {

@SpringBean
private MidpointFunctions midpointFunctions;

@SpringBean
private CounterManager counterManager;

private List<Breadcrumb> breadcrumbs;

Expand Down Expand Up @@ -472,6 +476,10 @@ public LocalizationService getLocalizationService() {
public MidpointFunctions getMidpointFunctions() {
return midpointFunctions;
}

public CounterManager getCounterManager() {
return counterManager;
}

@Contract(pure = true)
public PrismContext getPrismContext() {
Expand Down
Expand Up @@ -18,6 +18,28 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:panel>

<div class="row">

<div class="col-md-12">
<h3><wicket:message key="PageInternals.title.thresholds.counters"/></h3>
<table class="table table-bordered">
<tbody>
<tr wicket:id="thresholdCountersTable">
<th wicket:id="counterTask"/>
<td wicket:id="counterPolicyRule"/>
<td wicket:id="counterCount"/>
<td>
<a class="btn btn-primary" wicket:id="resetThresholdCounter">
<wicket:message key="InternalsCountersPanel.threshold.reset.button"/>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div class="row">

<div class="col-md-6">
Expand Down
@@ -1,15 +1,22 @@
package com.evolveum.midpoint.web.page.admin.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.IModel;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.repo.api.CounterSepcification;
import com.evolveum.midpoint.schema.internals.InternalCounters;
import com.evolveum.midpoint.schema.internals.InternalMonitor;
import com.evolveum.midpoint.web.component.dialog.ConfirmationPanel;

public class InternalsCountersPanel extends BasePanel<ListView<InternalCounters>> {

Expand All @@ -18,7 +25,14 @@ public class InternalsCountersPanel extends BasePanel<ListView<InternalCounters>
private static final String ID_COUNTERS_TABLE = "countersTable";
private static final String ID_COUNTER_LABEL = "counterLabel";
private static final String ID_COUNTER_VALUE = "counterValue";

private static final String ID_THRESHOLD_COUNTER = "thresholdCounter";
private static final String ID_THRESHOLD_COUNTERS_TABLE = "thresholdCountersTable";
private static final String ID_COUNTER_TASK_LABEL = "counterTask";
private static final String ID_COUNTER_POLICY_RULE_LABEL = "counterPolicyRule";
private static final String ID_COUNTER_COUNT_LABEL = "counterCount";
private static final String ID_RESET_THRESHOLD_COUNTER = "resetThresholdCounter";


public InternalsCountersPanel(String id) {
super(id);
}
Expand All @@ -29,6 +43,49 @@ protected void onInitialize() {

setOutputMarkupId(true);

Label thresholdCounter = new Label(ID_THRESHOLD_COUNTER, createStringResource("InternalsCountersPanel.thresholds"));
add(thresholdCounter);

ListView<CounterSepcification> thresholdCountersTable = new ListView<CounterSepcification>(ID_THRESHOLD_COUNTERS_TABLE, createThresholdCounterModel()) {
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem<CounterSepcification> item) {
CounterSepcification counter = item.getModelObject();
Label task = new Label(ID_COUNTER_TASK_LABEL, counter.getTaskName());
item.add(task);

Label policyRule = new Label(ID_COUNTER_POLICY_RULE_LABEL, counter.getPolicyRuleName());
item.add(policyRule);

Label count = new Label(ID_COUNTER_COUNT_LABEL, counter.getCount());
item.add(count);

AjaxLink<Void> resetCounter = new AjaxLink<Void>(ID_RESET_THRESHOLD_COUNTER) {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
ConfirmationPanel confirmPanel = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), createStringResource("InternalsCountersPanel.reset.confirm.message", counter.getTaskName(), counter.getPolicyRuleName())) {

private static final long serialVersionUID = 1L;

public void yesPerformed(AjaxRequestTarget target) {
getPageBase().getCounterManager().removeCounter(counter);
target.add(InternalsCountersPanel.this);
};
};
getPageBase().showMainPopup(confirmPanel, target);
target.add(InternalsCountersPanel.this);
}
};
item.add(resetCounter);
}

};
add(thresholdCountersTable);

ListView<InternalCounters> countersTable = new ListView<InternalCounters>(ID_COUNTERS_TABLE,
Arrays.asList(InternalCounters.values())) {
private static final long serialVersionUID = 1L;
Expand All @@ -54,4 +111,17 @@ public String getObject() {
};
add(countersTable);
}
}

private IModel<List<CounterSepcification>> createThresholdCounterModel() {
return new IModel<List<CounterSepcification>>() {
private static final long serialVersionUID = 1L;

@Override
public List<CounterSepcification> getObject() {
Collection<CounterSepcification> thresholdCounters = getPageBase().getCounterManager().listCounters();
return new ArrayList<>(thresholdCounters);
}
};
}

}
Expand Up @@ -4375,3 +4375,7 @@ ResourceSummaryPanel.DOWN=Down
operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowAllThreads=Show all threads (Gui)
operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeShowTasksThreads=Show running tasks threads (Gui)
operation.com.evolveum.midpoint.web.page.admin.configuration.InternalsThreadsPanel.executeRecordTasksThreads=Record running tasks threads (Gui)
InternalsCountersPanel.thresholds=Thresholds
PageInternals.title.thresholds.counters=Thresholds counters
InternalsCountersPanel.reset.confirm.message=Do you really want to remove counters for {0} ({1})
InternalsCountersPanel.threshold.reset.button=Reset
Expand Up @@ -1105,7 +1105,7 @@ PageAdmin.menu.top.configuration.expressionEvaluator=Expression evaluator
PageAdmin.menu.top.configuration.importObject=Import object
PageAdmin.menu.top.configuration.internals=Internals configuration
PageAdmin.menu.top.configuration.objectPolicy=Object policy
PageAdmin.menu.top.configuration.globalPolicyRule=Global policy rule
PageAdmin.menu.top.configuration.globalPolicyRule=Global policy rules
PageAdmin.menu.top.configuration.globalAccountSynchronization=Global account synchronization
PageAdmin.menu.top.configuration.cleanupPolicy=Cleanup Policy
PageAdmin.menu.top.configuration.workflow=Workflow configuration
Expand Down Expand Up @@ -4261,19 +4261,19 @@ ApprovalPolicyActionType.details.newValue=New approval policy action
LifecycleStateType.details.newValue=New lifecycle state
NotificationPolicyActionType.details.newValue=New notification policy action
PropertyConstraintType.details.newValue=New property constraint
objectState.details.newValue=New object state
assignmentState.details.newValue=New assignment state
hasAssignment.details.newValue=New has assignment
hasNoAssignment.details.newValue=New has no assignment
exclusion.details.newValue=New exclusion
minAssignees.details.newValue=New minimum assignees
maxAssignees.details.newValue=New maximum assignees
modification.details.newValue=New modification
assignment.details.newValue=New assignment
objectTimeValidity.details.newValue=New object time validity
assignmentTimeValidity.details.newValue=New assignment time validity
situation.details.newValue=New policy situation
transition.details.newValue=New transition
objectState.details.newValue=New 'object state' constraint
assignmentState.details.newValue=New 'assignment state' constraint
hasAssignment.details.newValue=New 'has assignment' constraint
hasNoAssignment.details.newValue=New 'has no assignment' constraint
exclusion.details.newValue=New 'exclusion' constraint
minAssignees.details.newValue=New 'minimum assignees' constraint
maxAssignees.details.newValue=New 'maximum assignees' constraint
modification.details.newValue=New 'modification' constraint
assignment.details.newValue=New 'assignment' constraint
objectTimeValidity.details.newValue=New 'object time validity' constraint
assignmentTimeValidity.details.newValue=New 'assignment time validity' constraint
situation.details.newValue=New 'situation' constraint
transition.details.newValue=New 'transition' constraint
ref.details.newValue=New reference
objectMaxAssigneesViolation.details.newValue=New object max assignees violation
objectMinAssigneesViolation.details.newValue=New object min assignees violation
Expand Down
Expand Up @@ -134,8 +134,6 @@ private static List<PropertyDelta<?>> createSynchronizationTimestampsDelta(Prism
return deltas;
}



private static List<SynchronizationSituationDescriptionType> getSituationFromSameChannel(
PrismObject<ShadowType> shadow, String channel) {

Expand Down
Expand Up @@ -25,7 +25,7 @@
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
* Unit tests for Util class
Expand Down Expand Up @@ -56,7 +56,7 @@ public void cleaupUtfTest() throws FileNotFoundException, IOException {
FileChannel fc = stream.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());

badStr = Charset.forName("UTF-8").decode(bb).toString();
badStr = StandardCharsets.UTF_8.decode(bb).toString();
}
finally {
stream.close();
Expand Down
Expand Up @@ -217,11 +217,12 @@ private static <ID extends ItemDefinition> ID augmentWithClass(ID definition, Cl
return definition;
}
@SuppressWarnings("unchecked")
List<ID> defFromClass = schemaRegistry.findItemDefinitionsByCompileTimeClass((Class) clazz, (Class) definitionClass);
if (defFromClass.size() != 1) {
List<ID> defFromClass = schemaRegistry.findItemDefinitionsByCompileTimeClass(clazz, (Class) definitionClass);
ID singleDef = DefinitionStoreUtils.getOne(defFromClass, false, null);
if (singleDef == null) {
return definition;
} else {
return schemaRegistry.selectMoreSpecific(definition, defFromClass.get(0));
return schemaRegistry.selectMoreSpecific(definition, singleDef);
}
}

Expand Down
Expand Up @@ -33,11 +33,12 @@ public class RawTypeUtil {

public static <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> getParsedItem(ID itemDefinition, List<RawType> values, QName elementQName, PrismContainerDefinition containerDef) throws SchemaException{

Item<IV,ID> subItem = null;
Item<IV,ID> subItem;

List<IV> parsedValues = new ArrayList<>();
for (RawType rawValue : values){
for (RawType rawValue : values) {
if (itemDefinition == null && containerDef != null){
//noinspection unchecked
itemDefinition = (ID) ((PrismContextImpl) containerDef.getPrismContext()).getPrismUnmarshaller().locateItemDefinition(containerDef, elementQName, rawValue.getXnode());
}
IV parsed = rawValue.getParsedValue(itemDefinition, elementQName);
Expand Down
Expand Up @@ -42,7 +42,7 @@
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -228,7 +228,7 @@ public void strangeCharsTest() throws IOException {
try (FileInputStream stream = new FileInputStream(file)) {
FileChannel fc = stream.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
xpathStr = Charset.forName("UTF-8").decode(bb).toString();
xpathStr = StandardCharsets.UTF_8.decode(bb).toString();
}

ItemPathHolder xpath = ItemPathHolder.createForTesting(xpathStr);
Expand Down
1 change: 1 addition & 0 deletions infra/schema-pure-jaxb/src/compile/resources/catalog.xml
Expand Up @@ -32,6 +32,7 @@ Used when building via xjc.
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-core-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-core-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-model-context-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-model-context-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-notifications-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-notifications-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-asynchronous-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-asynchronous-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-workflows-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-workflows-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-policy-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-policy-3.xsd" />
<system systemId="http://midpoint.evolveum.com/xml/ns/public/common/common-case-management-3" uri="../../../target/midpoint-schema/xml/ns/public/common/common-case-management-3.xsd" />
Expand Down
Expand Up @@ -83,6 +83,10 @@ public ResourceShadowDiscriminator(ShadowDiscriminatorType accRefType, String de
setKind(kind);
}

public ResourceShadowDiscriminator(String resourceOid) {
this.resourceOid = resourceOid;
}

public ResourceShadowDiscriminator(String resourceOid, QName objectClass) {
this.resourceOid = resourceOid;
this.objectClass = objectClass;
Expand Down
Expand Up @@ -123,4 +123,6 @@ public class ExpressionConstants {
public static final QName VAR_POLICY_RULE = new QName(SchemaConstants.NS_C, "policyRule");
public static final QName VAR_POLICY_ACTION = new QName(SchemaConstants.NS_C, "policyAction");
public static final QName VAR_LOGIN_MODE = new QName(SchemaConstants.NS_C, "loginMode");

public static final QName VAR_MESSAGE = new QName(SchemaConstants.NS_C, "message");
}
Expand Up @@ -25,6 +25,7 @@ public class MidPointConstants {

public static final String NS_MIDPOINT_PUBLIC_PREFIX = "http://midpoint.evolveum.com/xml/ns/public";
public static final String NS_MIDPOINT_TEST_PREFIX = "http://midpoint.evolveum.com/xml/ns/test";
public static final String EXPRESSION_LANGUAGE_URL_BASE = NS_MIDPOINT_PUBLIC_PREFIX + "/expression/language#";

public static final String NS_RA = NS_MIDPOINT_PUBLIC_PREFIX+"/resource/annotation-3";
public static final String PREFIX_NS_RA = "ra";
Expand Down
Expand Up @@ -250,6 +250,8 @@ public abstract class SchemaConstants {
public static final String NS_PROVISIONING_CHANNEL = NS_PROVISIONING + "/channels-3";
public static final QName CHANGE_CHANNEL_LIVE_SYNC = new QName(NS_PROVISIONING_CHANNEL, "liveSync");
public static final String CHANGE_CHANNEL_LIVE_SYNC_URI = QNameUtil.qNameToUri(CHANGE_CHANNEL_LIVE_SYNC);
public static final QName CHANGE_CHANNEL_ASYNC_UPDATE = new QName(NS_PROVISIONING_CHANNEL, "asyncUpdate");
public static final String CHANGE_CHANNEL_ASYNC_UPDATE_URI = QNameUtil.qNameToUri(CHANGE_CHANNEL_ASYNC_UPDATE);
public static final QName CHANGE_CHANNEL_RECON = new QName(NS_PROVISIONING_CHANNEL, "reconciliation");
public static final String CHANGE_CHANNEL_RECON_URI = QNameUtil.qNameToUri(CHANGE_CHANNEL_RECON);
public static final QName CHANGE_CHANNEL_RECOMPUTE = new QName(NS_PROVISIONING_CHANNEL, "recompute");
Expand Down Expand Up @@ -441,6 +443,8 @@ public abstract class SchemaConstants {
CONNECTOR_SCHEMA_CONFIGURATION_PROPERTIES_ELEMENT_LOCAL_NAME);
public static final String ACCOUNT_OBJECT_CLASS_LOCAL_NAME = "AccountObjectClass";
public static final String GROUP_OBJECT_CLASS_LOCAL_NAME = "GroupObjectClass";
public static final ItemName RI_ACCOUNT_OBJECT_CLASS = new ItemName(MidPointConstants.NS_RI, ACCOUNT_OBJECT_CLASS_LOCAL_NAME);
public static final ItemName RI_GROUP_OBJECT_CLASS = new ItemName(MidPointConstants.NS_RI, GROUP_OBJECT_CLASS_LOCAL_NAME);

public static final String UCF_FRAMEWORK_URI_BUILTIN = "http://midpoint.evolveum.com/xml/ns/public/connector/builtin-1";

Expand Down

0 comments on commit c1353af

Please sign in to comment.