hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
ac011fa8deb1815fdbe5d7f2e3fd0c810a6c14be
3,151
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.table.planner.delegation.hive.desc; import org.apache.flink.table.planner.delegation.hive.copy.HiveParserASTNode; import org.apache.hadoop.hive.metastore.api.FieldSchema; import java.io.Serializable; import java.util.List; import java.util.Map; /** Desc for create view operation. */ public class HiveParserCreateViewDesc implements Serializable { private static final long serialVersionUID = 1L; private final String compoundName; private final String comment; private final Map<String, String> tblProps; private final boolean ifNotExists; private final boolean isAlterViewAs; private final HiveParserASTNode query; private List<FieldSchema> schema; private String originalText; private String expandedText; public HiveParserCreateViewDesc( String compoundName, List<FieldSchema> schema, String comment, Map<String, String> tblProps, boolean ifNotExists, boolean isAlterViewAs, HiveParserASTNode query) { this.compoundName = compoundName; this.schema = schema; this.comment = comment; this.tblProps = tblProps; this.ifNotExists = ifNotExists; this.isAlterViewAs = isAlterViewAs; this.query = query; } public String getCompoundName() { return compoundName; } public List<FieldSchema> getSchema() { return schema; } public void setSchema(List<FieldSchema> schema) { this.schema = schema; } public String getComment() { return comment; } public Map<String, String> getTblProps() { return tblProps; } public boolean ifNotExists() { return ifNotExists; } public boolean isAlterViewAs() { return isAlterViewAs; } public String getOriginalText() { return originalText; } public void setOriginalText(String originalText) { this.originalText = originalText; } public String getExpandedText() { return expandedText; } public void setExpandedText(String expandedText) { this.expandedText = expandedText; } public HiveParserASTNode getQuery() { return query; } public boolean isMaterialized() { return false; } }
27.640351
77
0.684862
daf9e359efd3616a7730e894b3489877c7ad7984
4,970
package com.ubiqlog.vis.ui; import java.util.Date; import android.app.Activity; import android.app.ProgressDialog; import android.os.Bundle; import android.os.Handler; import android.view.View.OnClickListener; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import com.ubiqlog.ui.R; import com.ubiqlog.vis.common.DataCollectorEvent; import com.ubiqlog.vis.common.IDataCollectorListener; import com.ubiqlog.vis.common.Settings; import com.ubiqlog.vis.extras.movement.MovementDataCollector; import com.ubiqlog.vis.extras.movement.MovementDataCollectorEvent; import com.ubiqlog.vis.ui.extras.DateTimeSelector.DateTimeIntervalSelector; import com.ubiqlog.vis.ui.extras.DateTimeSelector.DateTimePickerDialog.Type; import com.ubiqlog.vis.ui.extras.movement.MovementLogInfoLayout; import com.ubiqlog.vis.ui.extras.movement.MovementLogScrollView; import com.ubiqlog.vis.ui.extras.movement.MovementLogView; /** * * @author Dorin Gugonatu * */ public class MovementLog extends Activity implements IDataCollectorListener { private MovementLogView movementLogDataView; private MovementLogInfoLayout infoView; private DateTimeIntervalSelector dateSelectorView; private final int ID_INFO_VIEW = 1; private final int ID_DATA_VIEW = 2; private final int ID_DATE_SELECTOR_VIEW = 3; private MovementDataCollector movementDataCollector; private Handler uiThreadHandler; private ProgressDialog progressDialog; private final String MAIN_FOLDER = Settings.LOG_FOLDER; //private final String TEST_FOLDER = "TestData"; private final String FOLDER_DELIMITER = "/"; //private final boolean USE_TEST_DATA = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); RelativeLayout relativeLayout = new RelativeLayout(this); Date nowDate = new Date(); Date startDate = new Date(nowDate.getYear(), nowDate.getMonth(), nowDate.getDate(), 0, 0); Date endDate = new Date(nowDate.getYear(), nowDate.getMonth(), nowDate.getDate(), 23, 59); dateSelectorView = new DateTimeIntervalSelector( this, startDate, endDate, Type.DATETIME, null, onDataChanged, this.getString(R.string.Vis_StartDateTime), this.getString(R.string.Vis_EndDateTime).toString(), true, false); dateSelectorView.setId(ID_DATE_SELECTOR_VIEW); MovementLogScrollView movementScrollView = new MovementLogScrollView(this); movementScrollView.setId(ID_DATA_VIEW); infoView = new MovementLogInfoLayout(this); infoView.setId(ID_INFO_VIEW); infoView.setVisibility(View.INVISIBLE); movementLogDataView = new MovementLogView(this); movementScrollView.addView(movementLogDataView); movementScrollView.addZoomNotificationListener(movementLogDataView); RelativeLayout.LayoutParams relativeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); relativeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); relativeLayout.addView(dateSelectorView, relativeLayoutParams); relativeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); relativeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); relativeLayout.addView(infoView, relativeLayoutParams); relativeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); relativeLayoutParams.addRule(RelativeLayout.ABOVE, dateSelectorView.getId()); relativeLayoutParams.addRule(RelativeLayout.BELOW, infoView.getId()); relativeLayout.addView(movementScrollView, relativeLayoutParams); setContentView(relativeLayout); } //@Override public void completed(DataCollectorEvent dataCollectorEvent) { final MovementDataCollectorEvent movementDataCollectorEvent = (MovementDataCollectorEvent)dataCollectorEvent; uiThreadHandler.post(new Runnable() { public void run() { progressDialog.dismiss(); if (infoView.getVisibility() == View.INVISIBLE) { infoView.setVisibility(View.VISIBLE); } movementLogDataView.setData(movementDataCollectorEvent.getMovementContainer()); } }); } private OnClickListener onDataChanged = new OnClickListener() { //@Override public void onClick(View v) { progressDialog = ProgressDialog.show(MovementLog.this, "Loading ...", "Loading Movement Data", true, false); uiThreadHandler = new Handler(); // if (USE_TEST_DATA) // { // movementDataCollector = new MovementDataCollector(MovementLog.this, MAIN_FOLDER + FOLDER_DELIMITER + TEST_FOLDER, dateSelectorView.getStartDate(), dateSelectorView.getEndDate()); // } // else // { movementDataCollector = new MovementDataCollector(MovementLog.this, MAIN_FOLDER + FOLDER_DELIMITER, dateSelectorView.getStartDate(), dateSelectorView.getEndDate()); // } new Thread(movementDataCollector).start(); } }; }
35.248227
184
0.791952
00328f7cf33e997832d3e9e28ae29f5b0f8c6081
337
package com.zzptc.sky.netnews.mvp.view; import com.zzptc.sky.netnews.greendao.NewsChannelTable; import com.zzptc.sky.netnews.mvp.view.base.BaseView; import java.util.List; /** * Created by Hu Zhilin on 2016/10/31. */ public interface NewsView extends BaseView { void initViewPager(List<NewsChannelTable> newsChannelTables); }
21.0625
65
0.771513
6645e5db7de5a9dc02f00f12cd145698ddf564d1
4,925
package me.markoutte.process.impl; import me.markoutte.algorithm.Maths; import me.markoutte.ds.Channel; import me.markoutte.ds.Color; import me.markoutte.image.Image; import me.markoutte.image.Pixel; import me.markoutte.image.RectImage; import me.markoutte.process.ImageProcessing; import java.util.Properties; import static me.markoutte.ds.Color.*; public enum ColorProcessing implements ImageProcessing { GRAYSCALE { @Override public Image process(Image src, Properties properties) { Image clone = src.clone(); for (Pixel pixel : src) { clone.setPixel(pixel.getId(), getIntGray(getGray(pixel.getValue()))); } return clone; } }, RED { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : out) { out.setPixel(pixel.getId(), combine(255, getChannel(pixel.getValue(), Channel.RED), 0, 0)); } return out; } }, GREEN { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : out) { out.setPixel(pixel.getId(), combine(255, 0, getChannel(pixel.getValue(), Channel.GREEN), 0)); } return out; } }, BLUE { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : out) { out.setPixel(pixel.getId(), combine(255, 0, 0, getChannel(pixel.getValue(), Channel.BLUE))); } return out; } }, HUE { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : src) { double hue = getHSL(pixel.getValue()).getHue(); out.setPixel(pixel.getId(), getIntGray((int) (255 * hue))); } return out; } }, SATURATION { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : out) { double saturation = getHSL(pixel.getValue()).getSaturation(); out.setPixel(pixel.getId(), getIntGray((int) (255 * saturation))); } return out; } }, INTENSITY { @Override public Image process(Image src, Properties properties) { Image out = src.clone(); for (Pixel pixel : out) { double lightness = getHSL(pixel.getValue()).getIntensity(); out.setPixel(pixel.getId(), getIntGray((int) (255 * lightness))); } return out; } }, DIFF { @Override public Image process(Image src, Properties properties) { Image other = (Image) properties.get("DIFF.image"); Image out = src.clone(); for (Pixel pixel1 : out) { int red1 = getRed(pixel1.getValue()); int green1 = getGreen(pixel1.getValue()); int blue1 = getBlue(pixel1.getValue()); int pixel2 = other.getPixel(pixel1.getId()); int red2 = getRed(pixel2); int green2 = getGreen(pixel2); int blue2 = getBlue(pixel2); int dRed = normalize(red2 - red1); int dGreen = normalize(green2 - green1); int dBlue = normalize(blue2 - blue1); out.setPixel(pixel1.getId(), combine(255, dRed, dGreen, dBlue)); } return out; } }, WHITE_BALANCE { @Override public Image process(Image src, Properties properties) { int red = 0; int green = 0; int blue = 0; int gray = 0; for (Pixel pixel : src) { red += getRed(pixel.getValue()); green += getGreen(pixel.getValue()); blue += getBlue(pixel.getValue()); gray += getGray(pixel.getValue()); } red /= src.getSize(); green /= src.getSize(); blue /= src.getSize(); gray /= src.getSize(); Image out = src.clone(); for (Pixel pixel : out) { out.setPixel(pixel.getId(), combine( 255, normalize(getRed(pixel.getValue()) * gray / red), normalize(getGreen(pixel.getValue()) * gray / green), normalize(getBlue(pixel.getValue()) * gray / blue)) ); } return out; } }, ; @Override public String toString() { return name(); } }
30.78125
109
0.507817
b2686c7b7f1555524f677802e6888a6c6ae19e47
354
import java.jang.String; /** * @author Dmitry Batkovich <[email protected]> */ class FileIndex { } class ProjectFileIndex extends FileIndex { public static ProjectFileIndex getInstance(Project p) { return null; } } interface Project {} public class TestCompletion { public void method() { FileIndex fi = <caret> } }
14.16
60
0.70339
bfa05784a37461c1614720a8be3922f64655ddad
2,752
package salvo.jesus.graph; import java.io.Serializable; /** * This interface defines a factory for creting Vertices and Edges * in a <tt>Graph</tt>. By default, each of the following * classes that implement the <tt>Graph</tt> interface uses a different * <tt>GraphFactory</tt> as shown below: * <p> * <table border="1"> * <tr> * <td>Class implementing the <tt>Graph</tt> interface</td> * <td>Corresponding class implementing the <tt>GraphFactory</tt> interface</td> * </tr> * <tr> * <td><tt>GraphImpl</tt></td><td><tt>GraphImplFactory</tt></td> * </tr> * <tr> * <td><tt>DirectedGraphImpl</tt></td><td><tt>DirectedGraphImplFactory</tt></td> * </tr> * <tr> * <td><tt>DirectedAcylicGraphImpl</tt></td><td><tt>DirectedAcylicGraphImplFactory</tt></td> * </tr> * <tr> * <td><tt>WeightedGraphImpl</tt></td><td><tt>WeightedGraphImplFactory</tt></td> * </tr> * <tr> * <td><tt>TreeImpl</tt></td><td><tt>TreeImplFactory</tt></td> * </tr> * <tr> * <td><tt>BinaryTreeImpl</tt></td><td><tt>TreeImplFactory</tt></td> * </tr> * </table> * <p> * If you only want to replace the <tt>Vertex</tt> class being created from the factory, * the easiest way is to extend the <tt>GraphFactory</tt> class for the corresponding * <tt>Graph</tt> class that you are providing a factory for and just override the * <tt>createVertex()</tt> method without overriding the <tt>createEdge()</tt> method. * <p> * Otherwise, you must ensure that the <tt>Edge</tt> being created via the * <tt>createEdge()</tt> method is of the proper type as expected by the corresponding * <tt>Graph</tt> class. * <p> * Implementation of this interface must also have a noarg constructor, in order for it * to be properly serialized and deserialized from XML. * * @author Jesus M. Salvo Jr. */ public interface GraphFactory extends Serializable { /** * Factory method to create a <tt>Vertex</tt>. * <p> * Internally within OpenJGraph, this method is used in the following: * <ul> * <li><tt>GraphPanelVertexState</tt> so that this method is called whenever a user * interactively adds a <tt>Vertex</tt> to the <tt>Graph</tt>.</li> * <li><tt>XGMMLContentHandler</tt> when recreating the <tt>Graph</tt> * from an XML file.</tt></li> * </ul> */ public Vertex createVertex(); /** * Factory method to create an <tt>Edge</tt>. * All previous calls to <tt>Graph.createEdge()</tt> will be expected to be * replace by calling this method instead. * <p> * Internally within OpenJGraph, as of 0.9.0, this method is called in * <tt>GraphImpl.addEdge( Vertex, Vertex )</tt>. */ public Edge createEdge( Vertex v1, Vertex v2 ); }
36.210526
97
0.648983
6479b62f8e21c0668d1681e8a255ec15f8096baf
2,806
package com.py.py.security; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; import org.springframework.web.filter.GenericFilterBean; import com.py.py.constants.HeaderNames; public class CustomCORSFilter extends GenericFilterBean { protected String accessControlAllowOrigin = "*"; protected String accessControlAllowMethods = "GET, PUT, POST, OPTIONS, DELETE"; protected String accessControlMaxAge = "3600"; protected String accessControlAllowHeaders = HeaderNames.AUTHENTICATION_TOKEN + ", " + HeaderNames.ANTI_CACHE_TIMESTAMP + ", Content-Type"; protected List<String> accessControlAllowHeadersList = new ArrayList<String>(); @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletResponse response = (HttpServletResponse) res; response.setHeader("Access-Control-Allow-Origin", accessControlAllowOrigin); response.setHeader("Access-Control-Allow-Methods", accessControlAllowMethods); response.setHeader("Access-Control-Max-Age", accessControlMaxAge); response.setHeader("Access-Control-Allow-Headers", accessControlAllowHeaders); chain.doFilter(req, res); } public String getAccessControlAllowOrigin() { return accessControlAllowOrigin; } public void setAccessControlAllowOrigin(String accessControlAllowOrigin) { this.accessControlAllowOrigin = accessControlAllowOrigin; } public String getAccessControlAllowMethods() { return accessControlAllowMethods; } public void setAccessControlAllowMethods(String accessControlAllowMethods) { this.accessControlAllowMethods = accessControlAllowMethods; } public String getAccessControlMaxAge() { return accessControlMaxAge; } public void setAccessControlMaxAge(String accessControlMaxAge) { this.accessControlMaxAge = accessControlMaxAge; } /* public String getAccessControlAllowHeaders() { return accessControlAllowHeaders; } public void setAccessControlAllowHeaders(String accessControlAllowHeaders) { this.accessControlAllowHeaders = accessControlAllowHeaders; } */ public List<String> getAccessControlAllowHeadersList() { return accessControlAllowHeadersList; } public void setAccessControlAllowHeadersList(List<String> accessControlAllowHeadersList) { this.accessControlAllowHeadersList = accessControlAllowHeadersList; this.accessControlAllowHeaders = ""; String delimiter = ""; for(String header : accessControlAllowHeadersList) { this.accessControlAllowHeaders = this.accessControlAllowHeaders + delimiter + header; delimiter = ", "; } } }
32.252874
140
0.808981
33bfc588eb8fb2092b0ee4074c4e0cf80890a514
10,215
package pnet.data.api.util; import com.fasterxml.jackson.databind.ObjectMapper; import at.porscheinformatik.happyrest.RestCallFactory; import at.porscheinformatik.happyrest.RestLoggerAdapter; import at.porscheinformatik.happyrest.SystemRestLoggerAdapter; import at.porscheinformatik.happyrest.slf4j.Slf4jRestLoggerAdapter; import pnet.data.api.about.AboutDataClient; import pnet.data.api.activity.ActivityDataClient; import pnet.data.api.advisortype.AdvisorTypeDataClient; import pnet.data.api.application.ApplicationDataClient; import pnet.data.api.brand.BrandDataClient; import pnet.data.api.client.MutablePnetDataClientPrefs; import pnet.data.api.client.PnetDataClientPrefs; import pnet.data.api.client.context.PnetDataApiTokenRepository; import pnet.data.api.client.context.PrefsBasedPnetDataApiContext; import pnet.data.api.company.CompanyDataClient; import pnet.data.api.companygroup.CompanyGroupDataClient; import pnet.data.api.companygrouptype.CompanyGroupTypeDataClient; import pnet.data.api.companynumbertype.CompanyNumberTypeDataClient; import pnet.data.api.companytype.CompanyTypeDataClient; import pnet.data.api.contractstate.ContractStateDataClient; import pnet.data.api.contracttype.ContractTypeDataClient; import pnet.data.api.externalbrand.ExternalBrandDataClient; import pnet.data.api.function.FunctionDataClient; import pnet.data.api.legalform.LegalFormDataClient; import pnet.data.api.numbertype.NumberTypeDataClient; import pnet.data.api.person.PersonDataClient; import pnet.data.api.proposal.ProposalDataClient; import pnet.data.api.todo.TodoGroupDataClient; /** * A factory for clients if you are working without Spring. * * @author HAM * @param <T> the type itself */ public abstract class AbstractClientFactory<T extends AbstractClientFactory<T>> implements ClientProvider { private final PnetDataClientPrefs prefs; private final ObjectMapper mapper; private final RestLoggerAdapter loggerAdapter; private final RestCallFactory restCallFactory; private final PnetDataApiTokenRepository repository; private final PrefsBasedPnetDataApiContext context; private AboutDataClient aboutDataClient = null; private ActivityDataClient activityDataClient = null; private AdvisorTypeDataClient advisorTypeDataClient = null; private ApplicationDataClient applicationDataClient = null; private BrandDataClient brandDataClient = null; private CompanyDataClient companyDataClient = null; private CompanyGroupDataClient companyGroupDataClient = null; private CompanyGroupTypeDataClient companyGroupTypeDataClient = null; private CompanyNumberTypeDataClient companyNumberTypeDataClient = null; private CompanyTypeDataClient companyTypeDataClient = null; private ContractStateDataClient contractStateDataClient = null; private ContractTypeDataClient contractTypeDataClient = null; private ExternalBrandDataClient externalBrandDataClient = null; private FunctionDataClient functionDataClient = null; private LegalFormDataClient legalFormDataClient = null; private NumberTypeDataClient numberTypeDataClient = null; private PersonDataClient personDataClient = null; private ProposalDataClient proposalDataClient = null; private TodoGroupDataClient todoGroupDataClient = null; public AbstractClientFactory(PnetDataClientPrefs prefs, ObjectMapper mapper, RestLoggerAdapter loggerAdapter) { super(); this.prefs = prefs; this.mapper = mapper; this.loggerAdapter = loggerAdapter; restCallFactory = createRestCallFactory(mapper, loggerAdapter); repository = new PnetDataApiTokenRepository(restCallFactory); context = new PrefsBasedPnetDataApiContext(repository, prefs); } protected abstract RestCallFactory createRestCallFactory(ObjectMapper mapper, RestLoggerAdapter loggerAdapter); protected abstract T copy(PnetDataClientPrefs prefs, ObjectMapper mapper, RestLoggerAdapter loggerAdapter); public T withPrefs(PnetDataClientPrefs prefs) { return copy(prefs, mapper, loggerAdapter); } public T withPrefs(String url, String username, String password) { return withPrefs(new MutablePnetDataClientPrefs(url, username, password)); } public T withMapper(ObjectMapper mapper) { return copy(prefs, mapper, loggerAdapter); } public T loggingTo(RestLoggerAdapter loggerAdapter) { return copy(prefs, mapper, loggerAdapter); } public T loggingToSlf4J() { return loggingTo(new Slf4jRestLoggerAdapter()); } public T loggingToSystemOut() { return loggingTo(new SystemRestLoggerAdapter()); } public PnetDataClientPrefs getPrefs() { return prefs; } public ObjectMapper getMapper() { return mapper; } public RestLoggerAdapter getLoggerAdapter() { return loggerAdapter; } public PnetDataApiTokenRepository getRepository() { return repository; } public PrefsBasedPnetDataApiContext getContext() { return context; } @Override public synchronized AboutDataClient getAboutDataClient() { if (aboutDataClient == null) { aboutDataClient = new AboutDataClient(context); } return aboutDataClient; } @Override public synchronized ActivityDataClient getActivityDataClient() { if (activityDataClient == null) { activityDataClient = new ActivityDataClient(context); } return activityDataClient; } @Override public synchronized AdvisorTypeDataClient getAdvisorTypeDataClient() { if (advisorTypeDataClient == null) { advisorTypeDataClient = new AdvisorTypeDataClient(context); } return advisorTypeDataClient; } @Override public synchronized ApplicationDataClient getApplicationDataClient() { if (applicationDataClient == null) { applicationDataClient = new ApplicationDataClient(context); } return applicationDataClient; } @Override public synchronized BrandDataClient getBrandDataClient() { if (brandDataClient == null) { brandDataClient = new BrandDataClient(context); } return brandDataClient; } @Override public synchronized CompanyDataClient getCompanyDataClient() { if (companyDataClient == null) { companyDataClient = new CompanyDataClient(context); } return companyDataClient; } @Override public synchronized CompanyGroupDataClient getCompanyGroupDataClient() { if (companyGroupDataClient == null) { companyGroupDataClient = new CompanyGroupDataClient(context); } return companyGroupDataClient; } @Override public synchronized CompanyGroupTypeDataClient getCompanyGroupTypeDataClient() { if (companyGroupTypeDataClient == null) { companyGroupTypeDataClient = new CompanyGroupTypeDataClient(context); } return companyGroupTypeDataClient; } @Override public synchronized CompanyNumberTypeDataClient getCompanyNumberTypeDataClient() { if (companyNumberTypeDataClient == null) { companyNumberTypeDataClient = new CompanyNumberTypeDataClient(context); } return companyNumberTypeDataClient; } @Override public synchronized CompanyTypeDataClient getCompanyTypeDataClient() { if (companyTypeDataClient == null) { companyTypeDataClient = new CompanyTypeDataClient(context); } return companyTypeDataClient; } @Override public synchronized ContractStateDataClient getContractStateDataClient() { if (contractStateDataClient == null) { contractStateDataClient = new ContractStateDataClient(context); } return contractStateDataClient; } @Override public synchronized ContractTypeDataClient getContractTypeDataClient() { if (contractTypeDataClient == null) { contractTypeDataClient = new ContractTypeDataClient(context); } return contractTypeDataClient; } @Override public synchronized ExternalBrandDataClient getExternalBrandDataClient() { if (externalBrandDataClient == null) { externalBrandDataClient = new ExternalBrandDataClient(context); } return externalBrandDataClient; } @Override public synchronized FunctionDataClient getFunctionDataClient() { if (functionDataClient == null) { functionDataClient = new FunctionDataClient(context); } return functionDataClient; } @Override public synchronized LegalFormDataClient getLegalFormDataClient() { if (legalFormDataClient == null) { legalFormDataClient = new LegalFormDataClient(context); } return legalFormDataClient; } @Override public synchronized NumberTypeDataClient getNumberTypeDataClient() { if (numberTypeDataClient == null) { numberTypeDataClient = new NumberTypeDataClient(context); } return numberTypeDataClient; } @Override public synchronized PersonDataClient getPersonDataClient() { if (personDataClient == null) { personDataClient = new PersonDataClient(context); } return personDataClient; } @Override public synchronized ProposalDataClient getProposalDataClient() { if (proposalDataClient == null) { proposalDataClient = new ProposalDataClient(context); } return proposalDataClient; } @Override public synchronized TodoGroupDataClient getTodoGroupDataClient() { if (todoGroupDataClient == null) { todoGroupDataClient = new TodoGroupDataClient(context); } return todoGroupDataClient; } }
29.185714
115
0.711209
fad6211fd66886c9f08958758f3ad707606afb78
246
package datastructure; import java.util.*; public class Free { public static void main(String[] args) { List<Integer> ll=new LinkedList<>(); for(int i=0;i<100;i++) { ll.add(i); } ll.set(45, 0); System.out.println(ll); } }
12.3
41
0.609756
48c705cc6ab63c7555de03ed92aee5f5441b2cee
2,140
package de.aservo.confapi.commons.model; import lombok.Data; import lombok.NoArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsExclude; import org.apache.commons.lang3.builder.HashCodeExclude; import org.codehaus.jackson.annotate.JsonIgnore; import javax.xml.bind.annotation.XmlElement; @Data @NoArgsConstructor public abstract class AbstractMailServerProtocolBean { public static final Long DEFAULT_TIMEOUT = 10000L; @XmlElement private String name; @XmlElement private String description; @XmlElement private String host; @XmlElement private Integer port; @XmlElement private String protocol; @XmlElement private Long timeout; @XmlElement private String username; @XmlElement @EqualsExclude @HashCodeExclude private String password; /** * Make sure port can be set from an int and from a String value. * * @param port the port */ @JsonIgnore //prevent "Conflicting setter definitions for property \"port\", see https://stackoverflow.com/questions/6346018/deserializing-json-into-object-with-overloaded-methods-using-jackson public void setPort( final int port) { this.port = port; } /** * Make sure port can be set from an int and from a String value. * * @param port the port */ public void setPort( final String port) { if (StringUtils.isNotBlank(port)) { this.port = Integer.parseInt(port); } } /** * Make sure always to set protocol in lowercase format. * * @param protocol the protocol */ public void setProtocol( final String protocol) { if (StringUtils.isNotBlank(protocol)) { this.protocol = protocol.toLowerCase(); } } /** * Return set timeout or default timeout of 10000L if null. * * @return timeout */ public Long getTimeout() { if (timeout == null) { return DEFAULT_TIMEOUT; } return timeout; } }
22.291667
201
0.645327
9a9962eb3b330e6541d097b49d3805d0efcef5e7
4,407
/** * The MIT License * Copyright © 2017 WebFolder OÜ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package io.webfolder.cdp.type.tracing; import java.util.ArrayList; import java.util.List; import io.webfolder.cdp.type.constant.TraceRecordMode; public class TraceConfig { private TraceRecordMode recordMode; private Boolean enableSampling; private Boolean enableSystrace; private Boolean enableArgumentFilter; private List<String> includedCategories = new ArrayList<>(); private List<String> excludedCategories = new ArrayList<>(); private List<String> syntheticDelays = new ArrayList<>(); private MemoryDumpConfig memoryDumpConfig; /** * Controls how the trace buffer stores data. */ public TraceRecordMode getRecordMode() { return recordMode; } /** * Controls how the trace buffer stores data. */ public void setRecordMode(TraceRecordMode recordMode) { this.recordMode = recordMode; } /** * Turns on JavaScript stack sampling. */ public Boolean isEnableSampling() { return enableSampling; } /** * Turns on JavaScript stack sampling. */ public void setEnableSampling(Boolean enableSampling) { this.enableSampling = enableSampling; } /** * Turns on system tracing. */ public Boolean isEnableSystrace() { return enableSystrace; } /** * Turns on system tracing. */ public void setEnableSystrace(Boolean enableSystrace) { this.enableSystrace = enableSystrace; } /** * Turns on argument filter. */ public Boolean isEnableArgumentFilter() { return enableArgumentFilter; } /** * Turns on argument filter. */ public void setEnableArgumentFilter(Boolean enableArgumentFilter) { this.enableArgumentFilter = enableArgumentFilter; } /** * Included category filters. */ public List<String> getIncludedCategories() { return includedCategories; } /** * Included category filters. */ public void setIncludedCategories(List<String> includedCategories) { this.includedCategories = includedCategories; } /** * Excluded category filters. */ public List<String> getExcludedCategories() { return excludedCategories; } /** * Excluded category filters. */ public void setExcludedCategories(List<String> excludedCategories) { this.excludedCategories = excludedCategories; } /** * Configuration to synthesize the delays in tracing. */ public List<String> getSyntheticDelays() { return syntheticDelays; } /** * Configuration to synthesize the delays in tracing. */ public void setSyntheticDelays(List<String> syntheticDelays) { this.syntheticDelays = syntheticDelays; } /** * Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. */ public MemoryDumpConfig getMemoryDumpConfig() { return memoryDumpConfig; } /** * Configuration for memory dump triggers. Used only when "memory-infra" category is enabled. */ public void setMemoryDumpConfig(MemoryDumpConfig memoryDumpConfig) { this.memoryDumpConfig = memoryDumpConfig; } }
27.716981
97
0.682777
2362fcb0081f3cff57c9e30d5fcfb0bcc2a0fa80
854
package com.qiniu.api.fop; import com.qiniu.api.net.CallRet; import com.qiniu.api.net.Client; import com.qiniu.api.auth.AuthException; import com.qiniu.api.auth.digest.*; import com.qiniu.api.rs.*; public class ImageExif { /** * Makes a request url that we can get the image's exif. * * @param url * The picture's download url on the qiniu server * */ public static String makeRequest(String url) { return url + "?exif"; } public static ExifRet call(String url) { CallRet ret = new Client().call(makeRequest(url)); return new ExifRet(ret); } public static ExifRet call(String url,Mac mac) throws AuthException { String pubUrl = makeRequest(url); GetPolicy policy =new GetPolicy(); String priUrl = policy.makeRequest(pubUrl, mac); CallRet ret = new Client().call(priUrl); return new ExifRet(ret); } }
25.117647
70
0.697892
2a2a40e08cf6b5b70d5d8f9ac7eae94319a052c6
396
package env.wis.jtlv.regression.fds; import junit.framework.Test; import junit.framework.TestSuite; public class AllFDSTests { public static Test suite() { TestSuite fds_suite = new TestSuite("Tests suite for FDS."); // adding sub testing suites // fds_suite.addTest(....suite()); // adding the actual tests fds_suite.addTest(new FDSTestCaseTemplate()); return fds_suite; } }
19.8
62
0.727273
328b4f83fec3aecc02dd9fe79f52ee8a7d801771
833
package samurayrus.vk_widget_servers; import java.io.IOException; import java.util.Date; import java.util.TimerTask; import samurayrus.vk_widget_servers.log.LoggerFile; /** Класс Таймер. Каждые n секунд вызывает {@link ServerManager#newConnectAndPushInfoInVkApi}*/ public class SendTimer extends TimerTask { @Override public void run() { try { LoggerFile.writeLog("\n TimerTask begin in:" + new Date()); String answer = completeTask(); LoggerFile.writeLog("\n TimerTask end and return: " + answer + "\n"); } catch (IOException ex) { LoggerFile.writeLog(SendTimer.class.getName() + " IOException " + ex.getMessage()); } } private String completeTask() throws IOException { return ServerManager.newConnectAndPushInfoInVkApi(); } }
33.32
96
0.67587
1e92e75e62dc3c577161ad46708472875c39f854
170,898
/* SPDX-License-Identifier: Apache 2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.commonservices.generichandlers; /** * OpenMetadataAPIMapper provides property name mapping for the generic builder, handler and converter. * It includes identifiers for all of the types that need specialist processing at this level in the stack */ public class OpenMetadataAPIMapper { public static final String GUID_PROPERTY_NAME = "guid"; /* ============================================================================================================================*/ /* Area 0 - Basic definitions and Infrastructure */ /* ============================================================================================================================*/ public static final String OPEN_METADATA_ROOT_TYPE_GUID = "4e7761e8-3969-4627-8f40-bfe3cde85a1d"; public static final String OPEN_METADATA_ROOT_TYPE_NAME = "OpenMetadataRoot"; /* from Area 0 */ public static final String REFERENCEABLE_TYPE_GUID = "a32316b8-dc8c-48c5-b12b-71c1b2a080bf"; public static final String REFERENCEABLE_TYPE_NAME = "Referenceable"; /* from Area 0 */ public static final String QUALIFIED_NAME_PROPERTY_NAME = "qualifiedName"; /* from Referenceable entity */ public static final String ADDITIONAL_PROPERTIES_PROPERTY_NAME = "additionalProperties"; /* from Referenceable entity */ public static final String ASSET_TYPE_GUID = "896d14c2-7522-4f6c-8519-757711943fe6"; public static final String ASSET_TYPE_NAME = "Asset"; /* Referenceable */ public static final String PROCESS_TYPE_GUID = "d8f33bd7-afa9-4a11-a8c7-07dcec83c050"; public static final String PROCESS_TYPE_NAME = "Process"; /* Referenceable */ public static final String DATA_SET_TYPE_GUID = "1449911c-4f44-4c22-abc0-7540154feefb"; /* from Area 0 */ public static final String DATA_SET_TYPE_NAME = "DataSet"; /* Asset */ public static final String NAME_PROPERTY_NAME = "name"; /* from Asset entity */ public static final String FORMULA_PROPERTY_NAME = "formula"; /* from Process entity */ public static final String IS_PUBLIC_PROPERTY_NAME = "isPublic"; /* from feedback relationships - Area 1 */ public static final String DISPLAY_NAME_PROPERTY_NAME = "displayName"; /* from many entities */ public static final String DESCRIPTION_PROPERTY_NAME = "description"; /* from many entity */ public static final String ANCHORS_CLASSIFICATION_TYPE_GUID = "aa44f302-2e43-4669-a1e7-edaae414fc6e"; public static final String ANCHORS_CLASSIFICATION_TYPE_NAME = "Anchors"; public static final String ANCHOR_GUID_PROPERTY_NAME = "anchorGUID"; public static final String LATEST_CHANGE_TARGET_ENUM_TYPE_GUID = "a0b7d7a0-4af5-4539-9b81-cbef52d8cc5d"; public static final String LATEST_CHANGE_TARGET_ENUM_TYPE_NAME = "LatestChangeTarget"; public static final int ENTITY_STATUS_LATEST_CHANGE_TARGET_ORDINAL = 0; public static final int ENTITY_PROPERTY_LATEST_CHANGE_TARGET_ORDINAL = 1; public static final int ENTITY_CLASSIFICATION_LATEST_CHANGE_TARGET_ORDINAL = 2; public static final int ENTITY_RELATIONSHIP_LATEST_CHANGE_TARGET_ORDINAL = 3; public static final int ATTACHMENT_LATEST_CHANGE_TARGET_ORDINAL = 4; public static final int ATTACHMENT_STATUS_LATEST_CHANGE_TARGET_ORDINAL = 5; public static final int ATTACHMENT_PROPERTY_LATEST_CHANGE_TARGET_ORDINAL = 6; public static final int ATTACHMENT_CLASSIFICATION_LATEST_CHANGE_TARGET_ORDINAL = 7; public static final int ATTACHMENT_RELATIONSHIP_LATEST_CHANGE_TARGET_ORDINAL = 8; public static final int OTHER_LATEST_CHANGE_TARGET_ORDINAL = 99; public static final String LATEST_CHANGE_ACTION_ENUM_TYPE_GUID = "032d844b-868f-4c4a-bc5d-81f0f9704c4d"; public static final String LATEST_CHANGE_ACTION_ENUM_TYPE_NAME = "LatestChangeAction"; public static final int CREATED_LATEST_CHANGE_ACTION_ORDINAL = 0; public static final int UPDATED_LATEST_CHANGE_ACTION_ORDINAL = 1; public static final int DELETED_LATEST_CHANGE_ACTION_ORDINAL = 2; public static final int OTHER_LATEST_CHANGE_ACTION_ORDINAL = 99; public static final String LATEST_CHANGE_CLASSIFICATION_TYPE_GUID = "adce83ac-10f1-4279-8a35-346976e94466"; public static final String LATEST_CHANGE_CLASSIFICATION_TYPE_NAME = "LatestChange"; public static final String CHANGE_TARGET_PROPERTY_NAME = "changeTarget"; public static final String CHANGE_ACTION_PROPERTY_NAME = "changeAction"; public static final String CLASSIFICATION_NAME_PROPERTY_NAME = "classificationName"; public static final String CLASSIFICATION_PROPERTY_NAME_PROPERTY_NAME = "classificationPropertyName"; public static final String ATTACHMENT_GUID_PROPERTY_NAME = "attachmentGUID"; public static final String ATTACHMENT_TYPE_PROPERTY_NAME = "attachmentType"; public static final String RELATIONSHIP_TYPE_PROPERTY_NAME = "relationshipType"; public static final String USER_PROPERTY_NAME = "user"; public static final String ACTION_DESCRIPTION_PROPERTY_NAME = "description"; public static final String TEMPLATE_CLASSIFICATION_TYPE_GUID = "25fad4a2-c2d6-440d-a5b1-e537881f84ee"; public static final String TEMPLATE_CLASSIFICATION_TYPE_NAME = "Template"; public static final String TEMPLATE_NAME_PROPERTY_NAME = "name"; public static final String TEMPLATE_DESCRIPTION_PROPERTY_NAME = "description"; public static final String TEMPLATE_ADDITIONAL_PROPERTIES_PROPERTY_NAME = "additionalProperties"; public static final String SOURCED_FROM_RELATIONSHIP_TYPE_GUID = "87b7371e-e311-460f-8849-08646d0d6ad3"; /* from Area 0 */ public static final String SOURCED_FROM_RELATIONSHIP_TYPE_NAME = "SourcedFrom"; /* End1 = NewEntity; End 2 = Template */ public static final String MEMENTO_CLASSIFICATION_TYPE_GUID = "ecdcd472-6701-4303-8dec-267bcb54feb9"; public static final String MEMENTO_CLASSIFICATION_TYPE_NAME = "Memento"; public static final String ARCHIVE_DATE_PROPERTY_NAME = "archiveDate"; public static final String ARCHIVE_USER_PROPERTY_NAME = "archiveUser"; public static final String ARCHIVE_PROCESS_PROPERTY_NAME = "archiveProcess"; public static final String ARCHIVE_SERVICE_PROPERTY_NAME = "archiveService"; public static final String ARCHIVE_METHOD_PROPERTY_NAME = "archiveMethod"; public static final String ARCHIVE_PROPERTIES_PROPERTY_NAME = "archiveProperties"; public static final String REFERENCEABLE_TO_MORE_INFO_TYPE_GUID = "1cbf059e-2c11-4e0c-8aae-1da42c1ee73f"; public static final String REFERENCEABLE_TO_MORE_INFO_TYPE_NAME = "MoreInformation"; /* End1 = Referenceable; End 2 = more info Referenceable */ public static final String SEARCH_KEYWORD_TYPE_GUID = "0134c9ae-0fe6-4224-bb3b-e18b78a90b1e"; public static final String SEARCH_KEYWORD_TYPE_NAME = "SearchKeyword"; public static final String KEYWORD_PROPERTY_NAME = "keyword"; public static final String KEYWORD_DESCRIPTION_PROPERTY_NAME = "description"; public static final String REFERENCEABLE_TO_SEARCH_KEYWORD_TYPE_GUID = "111e6d2e-94e9-43ed-b4ed-f0d220668cbf"; public static final String REFERENCEABLE_TO_SEARCH_KEYWORD_TYPE_NAME = "SearchKeywordLink"; /* End1 = Referenceable; End 2 = SearchKeyword */ public static final String SEARCH_KEYWORD_TO_RELATED_KEYWORD_TYPE_GUID = "f9ffa8a8-80f5-4e6d-9c05-a3a5e0277d62"; public static final String SEARCH_KEYWORD_TO_RELATED_KEYWORD_TYPE_NAME = "RelatedKeyword"; /* End1 = SearchKeyword; End 2 = SearchKeyword */ public static final String EXTERNAL_IDENTIFIER_TYPE_GUID = "7c8f8c2c-cc48-429e-8a21-a1f1851ccdb0"; public static final String EXTERNAL_IDENTIFIER_TYPE_NAME = "ExternalId"; /* from Area 0 */ public static final String IDENTIFIER_PROPERTY_NAME = "identifier"; /* from ExternalId entity */ public static final String MAPPING_PROPERTIES_PROPERTY_NAME = "mappingProperties"; /* from ExternalId entity */ public static final String LAST_SYNCHRONIZED_PROPERTY_NAME = "lastSynchronized"; /* from ExternalId entity */ public static final String KEY_PATTERN_PROPERTY_NAME = "keyPattern"; /* from ExternalId entity */ /* Enum type KeyPattern */ public static final String KEY_PATTERN_ENUM_TYPE_GUID = "8904df8f-1aca-4de8-9abd-1ef2aadba300"; public static final String KEY_PATTERN_ENUM_TYPE_NAME = "KeyPattern"; public static final String REFERENCEABLE_TO_EXTERNAL_ID_TYPE_GUID = "28ab0381-c662-4b6d-b787-5d77208de126"; public static final String REFERENCEABLE_TO_EXTERNAL_ID_TYPE_NAME = "ExternalIdLink"; /* End1 = Referenceable; End 2 = ExternalId */ public static final String SOURCE_PROPERTY_NAME = "source"; /* from ExternalIdLink relationship */ public static final String EXTERNAL_ID_SCOPE_TYPE_GUID = "8c5b1415-2d1f-4190-ba6c-1fdd47f03269"; public static final String EXTERNAL_ID_SCOPE_TYPE_NAME = "ExternalIdScope"; /* End1 = Referenceable; End 2 = ExternalId */ public static final String PERMITTED_SYNC_PROPERTY_NAME = "permittedSynchronization"; /* from ExternalId entity */ /* Enum type PermittedSynchronization */ public static final String PERMITTED_SYNC_ENUM_TYPE_GUID = "973a9f4c-93fa-43a5-a0c5-d97dbd164e78"; public static final String PERMITTED_SYNC_ENUM_TYPE_NAME = "PermittedSynchronization"; public static final String REFERENCEABLE_TO_EXT_REF_TYPE_GUID = "7d818a67-ab45-481c-bc28-f6b1caf12f06"; public static final String REFERENCEABLE_TO_EXT_REF_TYPE_NAME = "ExternalReferenceLink"; /* End1 = Referenceable; End 2 = ExternalReference */ public static final String EXTERNAL_REFERENCE_TYPE_GUID = "af536f20-062b-48ef-9c31-1ddd05b04c56"; public static final String EXTERNAL_REFERENCE_TYPE_NAME = "ExternalReference"; /* from Area 0 */ /* Referenceable */ public static final String URL_PROPERTY_NAME = "url"; /* from ExternalReference entity */ public static final String REFERENCE_VERSION_PROPERTY_NAME = "referenceVersion"; /* from ExternalReference entity */ public static final String REFERENCE_ID_PROPERTY_NAME = "referenceId"; /* from ExternalReferenceLink relationship */ /* also description property */ public static final String RELATED_MEDIA_TYPE_GUID = "747f8b86-fe7c-4c9b-ba75-979e093cc307"; public static final String RELATED_MEDIA_TYPE_NAME = "RelatedMedia"; /* from Area 0 */ /* ExternalReference */ public static final String MEDIA_USAGE_PROPERTY_NAME = "mediaUsage"; /* from RelatedMedia entity */ public static final String MEDIA_TYPE_PROPERTY_NAME = "mediaType"; /* from RelatedMedia entity */ /* MediaType enum */ public static final String REFERENCEABLE_TO_RELATED_MEDIA_TYPE_GUID = "1353400f-b0ab-4ab9-ab09-3045dd8a7140"; public static final String REFERENCEABLE_TO_RELATED_MEDIA_TYPE_NAME = "MediaReference"; /* End1 = Referenceable; End 2 = RelatedMedia */ public static final String MEDIA_ID_PROPERTY_NAME = "mediaId"; /* from MediaReference relationship */ public static final String MEDIA_DESCRIPTION_PROPERTY_NAME = "description"; /* from MediaReference relationship */ public static final String LOCATION_TYPE_GUID = "3e09cb2b-5f15-4fd2-b004-fe0146ad8628"; public static final String LOCATION_TYPE_NAME = "Location"; /* Referenceable */ public static final String PROPERTY_FACET_TYPE_GUID = "6403a704-aad6-41c2-8e08-b9525c006f85"; public static final String PROPERTY_FACET_TYPE_NAME = "PropertyFacet"; /* Referenceable */ public static final String SCHEMA_VERSION_PROPERTY_NAME = "schemaVersion"; /* from PropertyFacet entity */ public static final String PROPERTIES_PROPERTY_NAME = "properties"; /* from PropertyFacet entity */ public static final String VENDOR_PROPERTIES_DESCRIPTION_VALUE = "vendorProperties"; public static final String REFERENCEABLE_TO_PROPERTY_FACET_TYPE_GUID = "58c87647-ada9-4c90-a3c3-a40ace46b1f7"; public static final String REFERENCEABLE_TO_PROPERTY_FACET_TYPE_NAME = "ReferenceableFacet"; /* End1 = Referenceable; End 2 = PropertyFacet */ public static final String FIXED_LOCATION_CLASSIFICATION_TYPE_GUID = "bc111963-80c7-444f-9715-946c03142dd2"; public static final String FIXED_LOCATION_CLASSIFICATION_TYPE_NAME = "FixedLocation"; public static final String COORDINATES_PROPERTY_NAME = "coordinates"; public static final String MAP_PROJECTION_PROPERTY_NAME = "mapProjection"; public static final String POSTAL_ADDRESS_PROPERTY_NAME = "postalAddress"; public static final String POSTAL_ADDRESS_PROPERTY_NAME_DEP = "address"; public static final String TIME_ZONE_PROPERTY_NAME = "timeZone"; public static final String SECURE_LOCATION_CLASSIFICATION_TYPE_GUID = "e7b563c0-fcdd-4ba7-a046-eecf5c4638b8"; public static final String SECURE_LOCATION_CLASSIFICATION_TYPE_NAME = "SecureLocation"; public static final String LEVEL_PROPERTY_NAME = "level"; public static final String CYBER_LOCATION_CLASSIFICATION_TYPE_GUID = "f9ec3633-8ac8-480b-aa6d-5e674b9e1b17"; public static final String CYBER_LOCATION_CLASSIFICATION_TYPE_NAME = "CyberLocation"; public static final String NETWORK_ADDRESS_PROPERTY_NAME_DEP = "address"; public static final String MOBILE_ASSET_CLASSIFICATION_TYPE_GUID = "b25fb90d-8fa2-4aa9-b884-ff0a6351a697"; public static final String MOBILE_ASSET_CLASSIFICATION_TYPE_NAME = "MobileAsset"; public static final String ASSET_LOCATION_TYPE_GUID = "bc236b62-d0e6-4c5c-93a1-3a35c3dba7b1"; /* from Area 0 */ public static final String ASSET_LOCATION_TYPE_NAME = "AssetLocation"; /* End1 = Location; End 2 = Asset */ public static final String NESTED_LOCATION_TYPE_GUID = "f82a96c2-95a3-4223-88c0-9cbf2882b772"; /* from Area 0 */ public static final String NESTED_LOCATION_TYPE_NAME = "NestedLocation"; /* End1 = ParentLocation; End 2 = ChildLocation */ public static final String ADJACENT_LOCATION_TYPE_GUID = "017d0518-fc25-4e5e-985e-491d91e61e17"; /* from Area 0 */ public static final String ADJACENT_LOCATION_TYPE_NAME = "AdjacentLocation"; /* End1 = Location; End 2 = Location */ public static final String IT_INFRASTRUCTURE_TYPE_GUID = "151e6dd1-54a0-4b7f-a072-85caa09d1dda"; public static final String IT_INFRASTRUCTURE_TYPE_NAME = "ITInfrastructure"; /* Infrastructure */ public static final String HOST_TYPE_GUID = "1abd16db-5b8a-4fd9-aee5-205db3febe99"; public static final String HOST_TYPE_NAME = "Host"; /* ITInfrastructure */ public static final String HOST_CLUSTER_TYPE_GUID = "9794f42f-4c9f-4fe6-be84-261f0a7de890"; public static final String HOST_CLUSTER_TYPE_NAME = "HostCluster"; /* Host */ public static final String VIRTUAL_CONTAINER_TYPE_GUID = "e2393236-100f-4ac0-a5e6-ce4e96c521e7"; public static final String VIRTUAL_CONTAINER_TYPE_NAME = "VirtualContainer"; /* Host */ public static final String OPERATING_PLATFORM_TYPE_GUID = "bd96a997-8d78-42f6-adf7-8239bc98501c"; public static final String OPERATING_PLATFORM_TYPE_NAME = "OperatingPlatform"; /* Referenceable */ public static final String OPERATING_SYSTEM_PROPERTY_NAME = "operatingSystem"; /* from OperatingPlatform entity */ public static final String BYTE_ORDERING_PROPERTY_NAME = "byteOrdering"; /* from OperatingPlatform entity */ public static final String BYTE_ORDERING_PROPERTY_NAME_DEP = "endianness"; /* from OperatingPlatform entity */ public static final String ENDIANNESS_ENUM_TYPE_GUID = "e5612c3a-49bd-4148-8f67-cfdf145d5fd8"; public static final String ENDIANNESS_ENUM_TYPE_NAME = "Endianness"; /* from Area 1 */ public static final String HOST_OPERATING_PLATFORM_TYPE_GUID = "b9179df5-6e23-4581-a8b0-2919e6322b12"; /* from Area 0 */ public static final String HOST_OPERATING_PLATFORM_TYPE_NAME = "HostOperatingPlatform"; /* End1 = Host; End2 = OperatingPlatform */ public static final String HOST_CLUSTER_MEMBER_TYPE_GUID = "1a1c3933-a583-4b0c-9e42-c3691296a8e0"; /* from Area 0 */ public static final String HOST_CLUSTER_MEMBER_TYPE_NAME = "HostClusterMember"; /* End1 = HostCluster; End2 = Host (Member) */ public static final String DEPLOYED_VIRTUAL_CONTAINER_TYPE_GUID = "4b981d89-e356-4d9b-8f17-b3a8d5a86676"; /* from Area 0 */ public static final String DEPLOYED_VIRTUAL_CONTAINER_TYPE_NAME = "DeployedVirtualContainer"; /* End1 = Host; End2 = VirtualContainer (running on host) */ public static final String SOFTWARE_SERVER_PLATFORM_TYPE_GUID = "ba7c7884-32ce-4991-9c41-9778f1fec6aa"; public static final String SOFTWARE_SERVER_PLATFORM_TYPE_NAME = "SoftwareServerPlatform"; /* ITInfrastructure */ public static final String DEPLOYED_IMPLEMENTATION_TYPE_PROPERTY_NAME = "deployedImplementationType"; /* from SoftwareServerPlatform */ public static final String DEPLOYED_IMPLEMENTATION_TYPE_PROPERTY_NAME_DEP = "type"; /* from SoftwareServerPlatform */ public static final String PLATFORM_VERSION_PROPERTY_NAME = "platformVersion"; /* from SoftwareServerPlatform */ public static final String SOFTWARE_SERVER_PLATFORM_DEPLOYMENT_TYPE_GUID = "b909eb3b-5205-4180-9f63-122a65b30738"; /* from Area 0 */ public static final String SOFTWARE_SERVER_PLATFORM_DEPLOYMENT_TYPE_NAME = "SoftwareServerPlatformDeployment"; /* End1 = Host; End2 = SoftwareServerPlatform (running on host) */ public static final String DEPLOYMENT_TIME_PROPERTY_NAME = "deploymentTime"; /* from multiple */ public static final String DEPLOYER_PROPERTY_NAME = "deployer"; /* from multiple */ public static final String PLATFORM_STATUS_PROPERTY_NAME = "platformStatus"; /* from SoftwareServerPlatform */ public static final String OPERATIONAL_STATUS_ENUM_TYPE_GUID = "24e1e33e-9250-4a6c-8b07-05c7adec3a1d"; public static final String OPERATIONAL_STATUS_ENUM_TYPE_NAME = "OperationalStatus"; /* from Area 1 */ public static final String SOFTWARE_SERVER_TYPE_GUID = "896d14c2-7522-4f6c-8519-757711943fe6"; public static final String SOFTWARE_SERVER_TYPE_NAME = "SoftwareServer"; /* ITInfrastructure */ public static final String SERVER_VERSION_PROPERTY_NAME = "serverVersion"; /* from SoftwareServer entity */ public static final String SERVER_ENDPOINT_TYPE_GUID = "2b8bfab4-8023-4611-9833-82a0dc95f187"; public static final String SERVER_ENDPOINT_TYPE_NAME = "ServerEndpoint"; /* End 1 = SoftwareServer; End 2 = Endpoint */ public static final String SERVER_DEPLOYMENT_TYPE_GUID = "d909eb3b-5205-4180-9f63-122a65b30738"; public static final String SERVER_DEPLOYMENT_TYPE_NAME = "SoftwareServerDeployment"; /* End 1 = SoftwareServerPlatform; End 2 = SoftwareServer */ public static final String SERVER_STATUS_PROPERTY_NAME = "serverStatus"; /* from SoftwareServerDeployment */ public static final String ENDPOINT_TYPE_GUID = "dbc20663-d705-4ff0-8424-80c262c6b8e7"; public static final String ENDPOINT_TYPE_NAME = "Endpoint"; /* Referenceable */ public static final String ENDPOINT_DISPLAY_NAME_PROPERTY_NAME = "name"; /* from Endpoint entity */ public static final String NETWORK_ADDRESS_PROPERTY_NAME = "networkAddress"; /* from Endpoint entity */ public static final String PROTOCOL_PROPERTY_NAME = "protocol"; /* from Endpoint entity */ public static final String ENCRYPTION_METHOD_PROPERTY_NAME = "encryptionMethod"; /* from Endpoint entity */ public static final String SOFTWARE_SERVER_CAPABILITY_TYPE_GUID = "fe30a033-8f86-4d17-8986-e6166fa24177"; public static final String SOFTWARE_SERVER_CAPABILITY_TYPE_NAME = "SoftwareServerCapability"; /* Referenceable */ public static final String CAPABILITY_VERSION_PROPERTY_NAME = "capabilityVersion"; /* from SoftwareServerCapability entity */ public static final String CAPABILITY_VERSION_PROPERTY_NAME_DEP = "version"; /* from SoftwareServerCapability entity */ public static final String PATCH_LEVEL_PROPERTY_NAME = "patchLevel"; /* from SoftwareServerCapability entity */ public static final String SUPPORTED_CAPABILITY_TYPE_GUID = "8b7d7da5-0668-4174-a43b-8f8c6c068dd0"; public static final String SUPPORTED_CAPABILITY_TYPE_NAME = "SoftwareServerSupportedCapability"; /* End 1 = SoftwareServer; End 2 = SoftwareServerCapability */ public static final String SERVER_CAPABILITY_STATUS_PROPERTY_NAME = "serverCapabilityStatus"; /* from SoftwareServerSupportedCapability */ public static final String SERVER_ASSET_USE_TYPE_GUID = "56315447-88a6-4235-ba91-fead86524ebf"; /* from Area 0 */ public static final String SERVER_ASSET_USE_TYPE_NAME = "ServerAssetUse"; /* End1 = SoftwareServerCapability; End 2 = Asset */ public static final String USE_TYPE_PROPERTY_NAME = "useType"; /* from ServerAssetUse relationship */ public static final String SERVER_ASSET_USE_TYPE_TYPE_GUID = "09439481-9489-467c-9ae5-178a6e0b6b5a"; /* from Area 0 */ public static final String SERVER_ASSET_USE_TYPE_TYPE_NAME = "ServerAssetUseType"; public static final int SERVER_ASSET_USE_TYPE_OWNS_ORDINAL = 0; public static final int SERVER_ASSET_USE_TYPE_GOVERNS_ORDINAL = 1; public static final int SERVER_ASSET_USE_TYPE_MAINTAINS_ORDINAL = 2; public static final int SERVER_ASSET_USE_TYPE_USES_ORDINAL = 3; public static final int SERVER_ASSET_USE_TYPE_OTHER_ORDINAL = 99; public static final String APPLICATION_TYPE_GUID = "58280f3c-9d63-4eae-9509-3f223872fb25"; public static final String APPLICATION_TYPE_NAME = "Application"; /* SoftwareServerCapability */ public static final String API_MANAGER_TYPE_GUID = "283a127d-3acd-4d64-b558-1fce9db9a35b"; public static final String API_MANAGER_TYPE_NAME = "APIManager"; /* SoftwareServerCapability */ public static final String EVENT_BROKER_TYPE_GUID = "309dfc3c-663b-4732-957b-e4a084436314"; public static final String EVENT_BROKER_TYPE_NAME = "EventBroker"; /* SoftwareServerCapability */ public static final String ENGINE_TYPE_GUID = "3566527f-b1bd-4e7a-873e-a3e04d5f2a14"; public static final String ENGINE_TYPE_NAME = "Engine"; /* SoftwareServerCapability */ public static final String WORKFLOW_ENGINE_CLASSIFICATION_GUID = "37a6d212-7c4a-4a82-b4e2-601d4358381c"; public static final String WORKFLOW_ENGINE_CLASSIFICATION_NAME = "WorkflowEngine"; /* Engine */ public static final String REPORTING_ENGINE_CLASSIFICATION_GUID = "e07eefaa-16e0-46cf-ad54-bed47fb15812"; public static final String REPORTING_ENGINE_CLASSIFICATION_NAME = "ReportingEngine"; /* Engine */ public static final String ANALYTICS_ENGINE_CLASSIFICATION_GUID = "1a0dc6f6-7980-42f5-98bd-51e56543a07e"; public static final String ANALYTICS_ENGINE_CLASSIFICATION_NAME = "AnalyticsEngine"; /* Engine */ public static final String DATA_MOVEMENT_ENGINE_CLASSIFICATION_GUID = "d2ed6621-9d99-4fe8-843a-b28d816cf888"; public static final String DATA_MOVEMENT_ENGINE_CLASSIFICATION_NAME = "DataMovementEngine"; /* Engine */ public static final String DATA_VIRTUALIZATION_ENGINE_CLASSIFICATION_GUID = "03e25cd0-03d7-4d96-b28b-eed671824ed6"; public static final String DATA_VIRTUALIZATION_ENGINE_CLASSIFICATION_NAME = "DataVirtualizationEngine"; /* Engine */ public static final String ASSET_MANAGER_TYPE_GUID = "03170ce7-edf1-4e94-b6ab-2d5cbbf1f13c"; public static final String ASSET_MANAGER_TYPE_NAME = "AssetManager"; public static final String USER_PROFILE_MANAGER_TYPE_GUID = "53ef4062-9e0a-4892-9824-8d51d4ad59d3"; public static final String USER_PROFILE_MANAGER_TYPE_NAME = "UserProfileManager"; public static final String USER_ACCESS_DIRECTORY_TYPE_GUID = "29c98cf7-32b3-47d2-a411-48c1c9967e6d"; public static final String USER_ACCESS_DIRECTORY_TYPE_NAME = "UserAccessDirectory"; public static final String MASTER_DATA_MANAGER_TYPE_GUID = "5bdad12e-57e7-4ff9-b7be-5d869e77d30b"; public static final String MASTER_DATA_MANAGER_TYPE_NAME = "MasterDataManager"; public static final String SOFTWARE_SERVICE_TYPE_GUID = "f3f69251-adb1-4042-9d95-70082f95a028"; public static final String SOFTWARE_SERVICE_TYPE_NAME = "SoftwareService"; /* SoftwareServerCapability */ public static final String METADATA_INTEGRATION_SERVICE_TYPE_GUID = "92f7fe27-cd2f-441c-a084-156821aa5bca8"; public static final String METADATA_INTEGRATION_SERVICE_TYPE_NAME = "MetadataIntegrationService"; /* SoftwareService */ public static final String METADATA_ACCESS_SERVICE_TYPE_GUID = "0bc3a16a-e8ed-4ad0-a302-0773365fdef0"; public static final String METADATA_ACCESS_SERVICE_TYPE_NAME = "MetadataAccessService"; /* SoftwareService */ public static final String ENGINE_HOSTING_SERVICE_TYPE_GUID = "90880f0b-c7a3-4d1d-93cc-0b877f27cd33"; public static final String ENGINE_HOSTING_SERVICE_TYPE_NAME = "EngineHostingService"; /* SoftwareService */ public static final String USER_VIEW_SERVICE_TYPE_GUID = "1f83fc7c-75bb-491d-980d-ff9a6f80ae02"; public static final String USER_VIEW_SERVICE_TYPE_NAME = "UserViewService"; /* SoftwareService */ public static final String NETWORK_TYPE_GUID = "e0430f59-f021-411a-9d81-883e1ff3f6f6"; public static final String NETWORK_TYPE_NAME = "Network"; /* ITInfrastructure */ public static final String NETWORK_GATEWAY_TYPE_GUID = "9bbae94d-e109-4c96-b072-4f97123f04fd"; public static final String NETWORK_GATEWAY_TYPE_NAME = "NetworkGateway"; /* SoftwareServerCapability */ public static final String HOST_NETWORK_TYPE_GUID = "f2bd7401-c064-41ac-862c-e5bcdc98fa1e"; /* from Area 0 */ public static final String HOST_NETWORK_TYPE_NAME = "HostNetwork"; /* End1 = Host; End2 = Network */ public static final String NETWORK_GATEWAY_LINK_TYPE_GUID = "5bece460-1fa6-41fb-a29f-fdaf65ec8ce3"; /* from Area 0 */ public static final String NETWORK_GATEWAY_LINK_TYPE_NAME = "NetworkGatewayLink"; /* End1 = NetworkGateway; End2 = Network */ public static final String CLOUD_PROVIDER_CLASSIFICATION_GUID = "a2bfdd08-d0a8-49db-bc97-7f240628104"; public static final String CLOUD_PROVIDER_CLASSIFICATION_NAME = "CloudProvider"; /* Host */ public static final String PROVIDER_NAME_PROPERTY_NAME = "providerName"; /* from CloudProvider */ public static final String CLOUD_PLATFORM_CLASSIFICATION_GUID = "1b8f8511-e606-4f65-86d3-84891706ad12"; public static final String CLOUD_PLATFORM_CLASSIFICATION_NAME = "CloudPlatform"; /* SoftwareServerPlatform */ public static final String CLOUD_TENANT_CLASSIFICATION_GUID = "1b8f8522-e606-4f65-86d3-84891706ad12"; public static final String CLOUD_TENANT_CLASSIFICATION_NAME = "CloudTenant"; /* SoftwareServer */ public static final String TENANT_NAME_PROPERTY_NAME = "TenantName"; /* from CloudTenant */ public static final String TENANT_TYPE_PROPERTY_NAME = "TenantType"; /* from CloudTenant */ public static final String CLOUD_SERVICE_CLASSIFICATION_GUID = "337e7b1a-ad4b-4818-aa3e-0ff3307b2fbe6"; public static final String CLOUD_SERVICE_CLASSIFICATION_NAME = "CloudService"; /* SoftwareServerCapability */ public static final String OFFERING_NAME_PROPERTY_NAME = "offeringName"; /* from CloudService */ public static final String SERVICE_TYPE_PROPERTY_NAME = "serviceType"; /* from CloudService */ /* ============================================================================================================================*/ /* Area 1 - Collaboration */ /* ============================================================================================================================*/ public static final String ACTOR_PROFILE_TYPE_GUID = "5a2f38dc-d69d-4a6f-ad26-ac86f118fa35"; public static final String ACTOR_PROFILE_TYPE_NAME = "ActorProfile"; /* from Area 1 */ /* Referenceable */ public static final String USER_IDENTITY_TYPE_GUID = "fbe95779-1f3c-4ac6-aa9d-24963ff16282"; public static final String USER_IDENTITY_TYPE_NAME = "UserIdentity"; /* Referenceable */ public static final String PROFILE_IDENTITY_RELATIONSHIP_TYPE_GUID = "01664609-e777-4079-b543-6baffe910ff1"; /* from Area 1 */ public static final String PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME = "ProfileIdentity"; /* End1 = ActorProfile; End 2 = UserIdentity */ public static final String CONTACT_DETAILS_TYPE_GUID = "79296df8-645a-4ef7-a011-912d1cdcf75a"; public static final String CONTACT_DETAILS_TYPE_NAME = "ContactDetails"; public static final String CONTACT_METHOD_TYPE_PROPERTY_NAME = "contactMethodType"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_SERVICE_PROPERTY_NAME = "contactMethodService"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_VALUE_PROPERTY_NAME = "contactMethodValue"; /* from ContactDetail entity */ public static final String CONTACT_METHOD_TYPE_ENUM_TYPE_GUID = "30e7d8cd-df01-46e8-9247-a24c5650910d"; public static final String CONTACT_METHOD_TYPE_ENUM_TYPE_NAME = "ContactMethodType"; public static final String CONTACT_THROUGH_RELATIONSHIP_TYPE_GUID = "6cb9af43-184e-4dfa-854a-1572bcf0fe75"; /* from Area 1 */ public static final String CONTACT_THROUGH_RELATIONSHIP_TYPE_NAME = "ContactThrough"; /* End1 = ActorProfile; End 2 = ContactDetails */ public static final String PERSON_TYPE_GUID = "ac406bf8-e53e-49f1-9088-2af28bbbd285"; public static final String PERSON_TYPE_NAME = "Person"; /* from Area 1 */ /* ActorProfile */ public static final String FULL_NAME_PROPERTY_NAME = "fullName"; /* from Person entity */ public static final String JOB_TITLE_PROPERTY_NAME = "jobTitle"; /* from Person entity */ public static final String PERSONAL_CONTRIBUTION_RELATIONSHIP_TYPE_GUID = "4a316abe-eeee-4d11-ad5a-4bfb4079b80b"; /* from Area 1 */ public static final String PERSONAL_CONTRIBUTION_RELATIONSHIP_TYPE_NAME = "PersonalContribution"; /* End1 = Person; End 2 = ContributionRecord */ public static final String CONTRIBUTION_RECORD_TYPE_GUID = "ac406bf8-e53e-49f1-9088-2af28cccd285"; public static final String CONTRIBUTION_RECORD_TYPE_NAME = "ContributionRecord"; /* from Area 1 */ /* Referenceable */ public static final String KARMA_POINTS_PROPERTY_NAME = "karmaPoints"; /* from ContributionRecord entity */ public static final String PERSON_ROLE_TYPE_GUID = "ac406bf8-e53e-49f1-9088-2af28bcbd285"; public static final String PERSON_ROLE_TYPE_NAME = "PersonRole"; /* Referenceable */ public static final String HEAD_COUNT_PROPERTY_NAME = "headCount"; /* from PersonRole entity */ public static final String PERSON_ROLE_APPOINTMENT_RELATIONSHIP_TYPE_GUID = "4a316abe-bcce-4d11-ad5a-4bfb4079b80b"; /* from Area 1 */ public static final String PERSON_ROLE_APPOINTMENT_RELATIONSHIP_TYPE_NAME = "PersonRoleAppointment"; /* End1 = Person; End 2 = PersonRole */ public static final String PEER_RELATIONSHIP_TYPE_GUID = "4a316abe-bccd-4d11-ad5a-4bfb4079b80b"; /* from Area 1 */ public static final String PEER_RELATIONSHIP_TYPE_NAME = "Peer"; /* End1 = Person; End 2 = Person */ public static final String TEAM_TYPE_GUID = "36db26d5-aba2-439b-bc15-d62d373c5db6"; public static final String TEAM_TYPE_NAME = "Team"; /* from Area 1 */ /* ActorProfile */ public static final String TEAM_STRUCTURE_RELATIONSHIP_TYPE_GUID = "5ebc4fb2-b62a-4269-8f18-e9237a2229ca"; /* from Area 1 */ public static final String TEAM_STRUCTURE_RELATIONSHIP_TYPE_NAME = "TeamStructure"; /* End1 = Team; End 2 = Team */ public static final String DELEGATION_ESCALATION_PROPERTY_NAME = "delegationEscalationAuthority"; /* from TeamStructure relationship */ public static final String TEAM_MEMBER_TYPE_GUID = "46db26d5-abb2-538b-bc15-d62d373c5db6"; public static final String TEAM_MEMBER_TYPE_NAME = "TeamMember"; /* from Area 1 */ /* PersonRole */ public static final String TEAM_MEMBERSHIP_RELATIONSHIP_TYPE_GUID = "1ebc4fb2-b62a-4269-8f18-e9237a2119ca"; /* from Area 1 */ public static final String TEAM_MEMBERSHIP_RELATIONSHIP_TYPE_NAME = "TeamMembership"; /* End1 = TeamMember; End 2 = Team */ public static final String TEAM_LEADER_TYPE_GUID = "36db26d5-abb2-439b-bc15-d62d373c5db6"; public static final String TEAM_LEADER_TYPE_NAME = "TeamLeader"; /* from Area 1 */ /* PersonRole */ public static final String TEAM_LEADERSHIP_RELATIONSHIP_TYPE_GUID = "5ebc4fb2-b62a-4269-8f18-e9237a2119ca"; /* from Area 1 */ public static final String TEAM_LEADERSHIP_RELATIONSHIP_TYPE_NAME = "TeamLeadership"; /* End1 = TeamLeader; End 2 = Team */ public static final String IT_PROFILE_TYPE_GUID = "81394f85-6008-465b-926e-b3fae4668937"; public static final String IT_PROFILE_TYPE_NAME = "ITProfile"; /* from Area 1 */ /* ActorProfile */ public static final String COLLECTION_TYPE_GUID = "347005ba-2b35-4670-b5a7-12c9ebed0cf7"; public static final String COLLECTION_TYPE_NAME = "Collection"; /* from Area 1 */ /* Referenceable */ public static final String RESOURCE_LIST_RELATIONSHIP_TYPE_GUID = "73cf5658-6a73-4ebc-8f4d-44fdfac0b437"; public static final String RESOURCE_LIST_RELATIONSHIP_TYPE_NAME = "ResourceList"; /* End1 = Referenceable (anchor); End 2 = Referenceable */ public static final String RESOURCE_USE_PROPERTY_NAME = "resourceUse"; /* from ResourceList relationship */ public static final String WATCH_RESOURCE_PROPERTY_NAME = "watchResource"; /* from ResourceList relationship */ public static final String COLLECTION_MEMBERSHIP_TYPE_GUID = "5cabb76a-e25b-4bb5-8b93-768bbac005af"; public static final String COLLECTION_MEMBERSHIP_TYPE_NAME = "CollectionMembership"; /* End1 = Collection; End 2 = Referenceable */ public static final String REFERENCEABLE_TO_COLLECTION_TYPE_GUID = COLLECTION_MEMBERSHIP_TYPE_GUID; public static final String REFERENCEABLE_TO_COLLECTION_TYPE_NAME = COLLECTION_MEMBERSHIP_TYPE_NAME; /* End1 = Collection; End 2 = Referenceable */ public static final String MEMBERSHIP_RATIONALE_PROPERTY_NAME = "membershipRationale"; public static final String SET_TYPE_GUID = "3947f08d-7412-4022-81fc-344a20dfbb26"; public static final String SET_TYPE_NAME = "Set"; /* from Area 1 */ public static final String FOLDER_TYPE_GUID = "3c0fa687-8a63-4c8e-8bda-ede9c78be6c7"; public static final String FOLDER_TYPE_NAME = "Folder"; /* from Area 1 */ public static final String ORDER_BY_PROPERTY_NAME = "orderBy"; /* from Folder classification */ public static final String ORDER_PROPERTY_NAME_PROPERTY_NAME = "orderPropertyName"; /* from Folder classification */ public static final String ORDER_BY_TYPE_ENUM_TYPE_GUID = "1d412439-4272-4a7e-a940-1065f889fc56"; public static final String ORDER_BY_TYPE_ENUM_TYPE_NAME = "OrderBy"; public static final String COMMUNITY_TYPE_GUID = "ba846a7b-2955-40bf-952b-2793ceca090a"; public static final String COMMUNITY_TYPE_NAME = "Community"; /* from Area 1 */ /* Referenceable */ public static final String COMMUNITY_MEMBER_TYPE_GUID = "fbd42379-f6c3-4f09-b6f7-378565cda993"; public static final String COMMUNITY_MEMBER_TYPE_NAME = "CommunityMember"; /* from Area 1 */ /* PersonRole */ public static final String COMMUNITY_MEMBERSHIP_TYPE_ENUM_TYPE_GUID = "b0ef45bf-d12b-4b6f-add6-59c14648d750"; public static final String COMMUNITY_MEMBERSHIP_TYPE_ENUM_TYPE_NAME = "CommunityMembershipType"; public static final String COMMUNITY_MEMBERSHIP_TYPE_GUID = "7c7da1a3-01b3-473e-972e-606eff0cb112"; public static final String COMMUNITY_MEMBERSHIP_TYPE_NAME = "CommunityMembership"; /* End1 = Community; End 2 = CommunityMember */ public static final String MISSION_PROPERTY_NAME = "mission"; public static final String INFORMAL_TAG_TYPE_GUID = "ba846a7b-2955-40bf-952b-2793ceca090a"; public static final String INFORMAL_TAG_TYPE_NAME = "InformalTag"; /* from Area 1 */ public static final String TAG_IS_PUBLIC_PROPERTY_NAME = "isPublic"; /* from InformalTag entity and AttachedTag relationship */ public static final String TAG_NAME_PROPERTY_NAME = "tagName"; /* from InformalTag entity */ public static final String TAG_DESCRIPTION_PROPERTY_NAME = "tagDescription"; /* from InformalTag entity */ public static final String TAG_USER_PROPERTY_NAME = "createdBy"; /* From Audit Header */ public static final String REFERENCEABLE_TO_TAG_TYPE_GUID = "4b1641c4-3d1a-4213-86b2-d6968b6c65ab"; public static final String REFERENCEABLE_TO_TAG_TYPE_NAME = "AttachedTag"; /* End1 = Referenceable; End 2 = InformalTag */ /* Also isPublic */ public static final String LIKE_TYPE_GUID = "deaa5ca0-47a0-483d-b943-d91c76744e01"; public static final String LIKE_TYPE_NAME = "Like"; /* from Area 1 */ public static final String REFERENCEABLE_TO_LIKE_TYPE_GUID = "e2509715-a606-415d-a995-61d00503dad4"; public static final String REFERENCEABLE_TO_LIKE_TYPE_NAME = "AttachedLike"; /* End1 = Referenceable; End 2 = Like */ public static final String LIKE_IS_PUBLIC_PROPERTY_NAME = "isPublic"; /* from AttachedLike relationship*/ public static final String RATING_TYPE_GUID = "7299d721-d17f-4562-8286-bcd451814478"; public static final String RATING_TYPE_NAME = "Rating"; /* from Area 1 */ public static final String STAR_RATING_ENUM_TYPE_GUID = "77fea3ef-6ec1-4223-8408-38567e9d3c93"; public static final String STAR_RATING_ENUM_TYPE_NAME = "StarRating"; /* from Area 1 */ public static final String STARS_PROPERTY_NAME = "stars"; /* from Rating entity */ /* StarRating enum */ public static final String REVIEW_PROPERTY_NAME = "review"; /* from Rating entity */ public static final String REFERENCEABLE_TO_RATING_TYPE_GUID = "0aaad9e9-9cc5-4ad8-bc2e-c1099bab6344"; public static final String REFERENCEABLE_TO_RATING_TYPE_NAME = "AttachedRating"; /* End1 = Referenceable; End 2 = Rating */ public static final String RATING_IS_PUBLIC_PROPERTY_NAME = "isPublic"; /* from AttachedRating relationship */ public static final String COMMENT_TYPE_GUID = "1a226073-9c84-40e4-a422-fbddb9b84278"; public static final String COMMENT_TYPE_NAME = "Comment"; /* from Area 1 */ /* Referenceable */ public static final String COMMENT_TEXT_PROPERTY_NAME = "text"; /* from Comment entity */ public static final String COMMENT_TYPE_PROPERTY_NAME = "commentType"; /* from Comment entity */ public static final String COMMENT_TYPE_PROPERTY_NAME_DEP = "type"; /* from Comment entity */ public static final String COMMENT_TYPE_ENUM_TYPE_GUID = "06d5032e-192a-4f77-ade1-a4b97926e867"; public static final String COMMENT_TYPE_ENUM_TYPE_NAME = "CommentType"; /* from Area 1 */ public static final String REFERENCEABLE_TO_COMMENT_TYPE_GUID = "0d90501b-bf29-4621-a207-0c8c953bdac9"; public static final String REFERENCEABLE_TO_COMMENT_TYPE_NAME = "AttachedComment"; /* End1 = Referenceable; End 2 = Comment */ public static final String ANSWER_RELATIONSHIP_TYPE_GUID = "ecf1a3ca-adc5-4747-82cf-10ec590c5c69"; public static final String ANSWER_RELATIONSHIP_TYPE_NAME = "AcceptedAnswer"; /* End1 = Comment; End 2 = Comment */ public static final String TEXT_PROPERTY_NAME = "text"; /* from NoteEntry entity */ public static final String REFERENCEABLE_TO_NOTE_LOG_TYPE_GUID = "4f798c0c-6769-4a2d-b489-d2714d89e0a4"; public static final String REFERENCEABLE_TO_NOTE_LOG_TYPE_NAME = "AttachedNoteLog"; /* End1 = Referenceable; End 2 = NoteLog */ /* And isPublicProperty */ public static final String NOTE_LOG_TYPE_GUID = "646727c7-9ad4-46fa-b660-265489ad96c6"; public static final String NOTE_LOG_TYPE_NAME = "NoteLog"; /* from Area 1 */ /* Referenceable */ public static final String NOTE_LOG_ENTRIES_RELATIONSHIP_TYPE_GUID = "38edecc6-f385-4574-8144-524a44e3e712"; public static final String NOTE_LOG_ENTRIES_RELATIONSHIP_TYPE_NAME = "AttachedNoteLogEntry"; /* End1 = NoteLog; End 2 = NoteEntry */ public static final String NOTE_ENTRY_TYPE_GUID = "2a84d94c-ac6f-4be1-a72a-07dcec7b1fe3"; public static final String NOTE_ENTRY_TYPE_NAME = "NoteEntry"; /* from Area 1 */ /* Referenceable */ public static final String NOTE_LOG_AUTHOR_RELATIONSHIP_TYPE_GUID = "8f798c0c-6769-4a2d-b489-12714d89e0a4"; public static final String NOTE_LOG_AUTHOR_RELATIONSHIP_TYPE_NAME = "NoteLogAuthorship"; /* End1 = NoteLogAuthor; End 2 = NoteLog */ public static final String NOTE_LOG_AUTHOR_TYPE_GUID = "3a84d94c-ac6f-4be1-a72a-07dbec7b1fe3"; public static final String NOTE_LOG_AUTHOR_TYPE_NAME = "NoteLogAuthor"; /* from Area 1 */ /* PersonRole */ public static final String NOTE_TYPE_GUID = "646727c7-9ad4-46fa-b660-265489ad96c6"; public static final String NOTE_TYPE_NAME = "NoteEntry"; /* from Area 1 */ /* Referenceable */ /* ============================================================================================================================*/ /* Area 2 - Assets */ /* ============================================================================================================================*/ public static final String CONNECTION_TYPE_GUID = "114e9f8f-5ff3-4c32-bd37-a7eb42712253"; public static final String CONNECTION_TYPE_NAME = "Connection"; /* Referenceable */ public static final String SECURED_PROPERTIES_PROPERTY_NAME = "securedProperties"; /* from Connection entity */ public static final String CONFIGURATION_PROPERTIES_PROPERTY_NAME = "configurationProperties"; /* from Connection entity */ public static final String USER_ID_PROPERTY_NAME = "userId"; /* from Connection entity */ public static final String CLEAR_PASSWORD_PROPERTY_NAME = "clearPassword"; /* from Connection entity */ public static final String ENCRYPTED_PASSWORD_PROPERTY_NAME = "encryptedPassword"; /* from Connection entity */ public static final String CONNECTION_ENDPOINT_TYPE_GUID = "887a7132-d6bc-4b92-a483-e80b60c86fb2"; public static final String CONNECTION_ENDPOINT_TYPE_NAME = "ConnectionEndpoint"; /* End1 = Endpoint; End 2 = Connection */ public static final String CONNECTION_CONNECTOR_TYPE_TYPE_GUID = "e542cfc1-0b4b-42b9-9921-f0a5a88aaf96"; public static final String CONNECTION_CONNECTOR_TYPE_TYPE_NAME = "ConnectionConnectorType"; /* End1 = Connection; End 2 = ConnectorType */ public static final String CONNECTOR_TYPE_TYPE_GUID = "954421eb-33a6-462d-a8ca-b5709a1bd0d4"; public static final String CONNECTOR_TYPE_TYPE_NAME = "ConnectorType"; /* Referenceable */ public static final String CONNECTOR_PROVIDER_PROPERTY_NAME = "connectorProviderClassName"; /* from ConnectorType entity */ public static final String RECOGNIZED_ADD_PROPS_PROPERTY_NAME = "recognizedAdditionalProperties"; /* from ConnectorType entity */ public static final String RECOGNIZED_SEC_PROPS_PROPERTY_NAME = "recognizedSecuredProperties"; /* from ConnectorType entity */ public static final String RECOGNIZED_CONFIG_PROPS_PROPERTY_NAME = "recognizedConfigurationProperties"; /* from ConnectorType entity */ public static final String VIRTUAL_CONNECTION_TYPE_GUID = "82f9c664-e59d-484c-a8f3-17088c23a2f3"; public static final String VIRTUAL_CONNECTION_TYPE_NAME = "VirtualConnection"; public static final String EMBEDDED_CONNECTION_TYPE_GUID = "eb6dfdd2-8c6f-4f0d-a17d-f6ce4799f64f"; public static final String EMBEDDED_CONNECTION_TYPE_NAME = "EmbeddedConnection"; /* End1 = VirtualConnection; End 2 = Connection */ public static final String POSITION_PROPERTY_NAME = "position"; /* from EmbeddedConnection relationship */ public static final String ARGUMENTS_PROPERTY_NAME = "arguments"; /* from EmbeddedConnection relationship */ public static final String ASSET_TO_CONNECTION_TYPE_GUID = "e777d660-8dbe-453e-8b83-903771f054c0"; public static final String ASSET_TO_CONNECTION_TYPE_NAME = "ConnectionToAsset"; /* End1 = Connection; End 2 = Asset */ public static final String ASSET_SUMMARY_PROPERTY_NAME = "assetSummary"; /* from ConnectionToAsset relationship */ public static final String DATA_STORE_TYPE_GUID = "10752b4a-4b5d-4519-9eae-fdd6d162122f"; /* from Area 2 */ public static final String DATA_STORE_TYPE_NAME = "DataStore"; /* Asset */ public static final String PATH_NAME_PROPERTY_NAME = "pathName"; /* from DataStore entity */ public static final String STORE_CREATE_TIME_PROPERTY_NAME = "storeCreateTime"; /* from DataStore entity */ public static final String STORE_CREATE_TIME_PROPERTY_NAME_DEP = "createTime"; /* from DataStore entity */ public static final String STORE_UPDATE_TIME_PROPERTY_NAME = "storeUpdateTime"; /* from DataStore entity */ public static final String STORE_UPDATE_TIME_PROPERTY_NAME_DEP = "updateTime"; /* from DataStore entity */ public static final String DATA_STORE_ENCODING_CLASSIFICATION_GUID = "f08e48b5-6b66-40f5-8ff6-c2bfe527330b"; public static final String DATA_STORE_ENCODING_CLASSIFICATION_NAME = "DataStoreEncoding"; public static final String ENCODING_TYPE_PROPERTY_NAME = "encoding"; /* from DataStoreEncoding classification */ public static final String ENCODING_LANGUAGE_PROPERTY_NAME = "language"; /* from DataStoreEncoding classification */ public static final String ENCODING_DESCRIPTION_PROPERTY_NAME = "description"; /* from DataStoreEncoding classification */ public static final String ENCODING_PROPERTIES_PROPERTY_NAME = "properties"; /* from DataStoreEncoding classification */ public static final String DATABASE_TYPE_GUID = "0921c83f-b2db-4086-a52c-0d10e52ca078"; /* from Area 2 */ public static final String DATABASE_TYPE_NAME = "Database"; /* DataStore */ public static final String DATABASE_TYPE_PROPERTY_NAME = "deployedImplementationType"; /* from Database entity */ public static final String DATABASE_TYPE_PROPERTY_NAME_DEP = "type"; /* from Database entity */ public static final String DATABASE_VERSION_PROPERTY_NAME = "databaseVersion"; /* from Database entity */ public static final String DATABASE_VERSION_PROPERTY_NAME_DEP = "version"; /* from Database entity */ public static final String DATABASE_INSTANCE_PROPERTY_NAME = "instance"; /* from Database entity */ public static final String DATABASE_IMPORTED_FROM_PROPERTY_NAME = "importedFrom"; /* from Database entity */ public static final String FILE_FOLDER_TYPE_GUID = "229ed5cc-de31-45fc-beb4-9919fd247398"; /* from Area 2 */ public static final String FILE_FOLDER_TYPE_NAME = "FileFolder"; /* DataStore */ public static final String DATA_FOLDER_TYPE_GUID = "9f1fb984-db15-43ee-85fb-f8b0353bfb8b"; /* from Area 2 */ public static final String DATA_FOLDER_TYPE_NAME = "DataFolder"; /* FileFolder */ public static final String FOLDER_HIERARCHY_TYPE_GUID = "48ac9028-45dd-495d-b3e1-622685b54a01"; /* from Area 2 */ public static final String FOLDER_HIERARCHY_TYPE_NAME = "FolderHierarchy"; public static final String NESTED_FILE_TYPE_GUID = "4cb88900-1446-4eb6-acea-29cd9da45e63"; /* from Area 2 */ public static final String NESTED_FILE_TYPE_NAME = "NestedFile"; public static final String LINKED_FILE_TYPE_GUID = "970a3405-fde1-4039-8249-9aa5f56d5151"; /* from Area 2 */ public static final String LINKED_FILE_TYPE_NAME = "LinkedFile"; public static final String DATA_FILE_TYPE_GUID = "10752b4a-4b5d-4519-9eae-fdd6d162122f"; /* from Area 2 */ public static final String DATA_FILE_TYPE_NAME = "DataFile"; /* DataStore */ public static final String FILE_TYPE_PROPERTY_NAME = "fileType"; /* from DataFile entity */ public static final String MEDIA_FILE_TYPE_GUID = "c5ce5499-9582-42ea-936c-9771fbd475f8"; /* from Area 2 */ public static final String MEDIA_FILE_TYPE_NAME = "MediaFile"; /* DataFile */ public static final String DOCUMENT_TYPE_GUID = "b463827c-c0a0-4cfb-a2b2-ddc63746ded4"; /* from Area 2 */ public static final String DOCUMENT_TYPE_NAME = "Document"; /* MediaFile */ public static final String DOCUMENT_STORE_TYPE_GUID = "37156790-feac-4e1a-a42e-88858ae6f8e1"; /* from Area 2 */ public static final String DOCUMENT_STORE_TYPE_NAME = "DocumentStore"; /* DataStore */ public static final String MEDIA_COLLECTION_TYPE_GUID = "0075d603-1627-41c5-8cae-f5458d1247fe"; /* from Area 2 */ public static final String MEDIA_COLLECTION_TYPE_NAME = "MediaCollection"; /* DataSet */ public static final String LINKED_MEDIA_TYPE_GUID = "cee3a190-fc8d-4e53-908a-f1b9689581e0"; /* from Area 2 */ public static final String LINKED_MEDIA_TYPE_NAME = "LinkedMedia"; /* End1 = MediaFile; End 2 = MediaFile */ public static final String GROUPED_MEDIA_TYPE_GUID = "7d881574-461d-475c-ab44-077451528cb8"; /* from Area 2 */ public static final String GROUPED_MEDIA_TYPE_NAME = "GroupedMedia"; /* End1 = MediaCollection; End 2 = MediaFile */ public static final String EMBEDDED_METADATA_PROPERTY_NAME = "embeddedMetadata"; /* from MediaFile entity */ public static final String AVRO_FILE_TYPE_GUID = "75293260-3373-4777-af7d-7274d5c0b9a5"; /* from Area 2 */ public static final String AVRO_FILE_TYPE_NAME = "AvroFile"; /* DataFile */ public static final String CSV_FILE_TYPE_GUID = "2ccb2117-9cee-47ca-8150-9b3a543adcec"; /* from Area 2 */ public static final String CSV_FILE_TYPE_NAME = "CSVFile"; /* DataFile */ public static final String DELIMITER_CHARACTER_PROPERTY_NAME = "delimiterCharacter"; /* from CSVFile entity */ public static final String QUOTE_CHARACTER_PROPERTY_NAME = "quoteCharacter"; /* from CSVFile entity */ public static final String JSON_FILE_TYPE_GUID = "baa608fa-510e-42d7-95cd-7c12fa37bb35"; /* from Area 2 */ public static final String JSON_FILE_TYPE_NAME = "JSONFile"; /* DataFile */ public static final String DEPLOYED_DATABASE_SCHEMA_TYPE_GUID = "eab811ec-556a-45f1-9091-bc7ac8face0f"; /* from Area 2 */ public static final String DEPLOYED_DATABASE_SCHEMA_TYPE_NAME = "DeployedDatabaseSchema"; /* DataSet */ public static final String DATA_CONTENT_FOR_DATA_SET_TYPE_GUID = "b827683c-2924-4df3-a92d-7be1888e23c0"; /* from Area 2 */ public static final String DATA_CONTENT_FOR_DATA_SET_TYPE_NAME = "DataContentForDataSet"; /* End1 = Asset; End 2 = DataSet */ public static final String DATABASE_MANAGER_TYPE_GUID = "68b35c1e-6c28-4ac3-94f9-2c3dbcbb79e9"; public static final String DATABASE_MANAGER_TYPE_NAME = "DatabaseManager"; /* SoftwareServerCapability */ public static final String FILE_SYSTEM_CLASSIFICATION_TYPE_GUID = "cab5ba1d-cfd3-4fca-857d-c07711fc4157"; public static final String FILE_SYSTEM_CLASSIFICATION_TYPE_NAME = "FileSystem"; /* SoftwareServerCapability */ public static final String FORMAT_PROPERTY_NAME = "format"; /* from FileSystem */ public static final String ENCRYPTION_PROPERTY_NAME = "encryption"; /* from FileSystem */ public static final String FILE_MANAGER_CLASSIFICATION_TYPE_GUID = "eadec807-02f0-4d6f-911c-261eddd0c2f5"; public static final String FILE_MANAGER_CLASSIFICATION_TYPE_NAME = "FileManager"; /* SoftwareServerCapability */ public static final String NOTIFICATION_MANAGER_CLASSIFICATION_GUID = "3e7502a7-396a-4737-a106-378c9c94c1057"; public static final String NOTIFICATION_MANAGER_CLASSIFICATION_NAME = "NotificationManager"; /* SoftwareServerCapability */ public static final String ENTERPRISE_ACCESS_LAYER_TYPE_GUID = "39444bf9-638e-4124-a5f9-1b8f3e1b008b"; public static final String ENTERPRISE_ACCESS_LAYER_TYPE_NAME = "EnterpriseAccessLayer"; /* SoftwareServerCapability */ public static final String TOPIC_ROOT_PROPERTY_NAME = "topicRoot"; /* from EnterpriseAccessLayer */ public static final String METADATA_COLLECTION_ID_PROPERTY_NAME = "accessedMetadataCollectionId"; /* from EnterpriseAccessLayer */ public static final String COHORT_MEMBER_TYPE_GUID = "42063797-a78a-4720-9353-52026c75f667"; public static final String COHORT_MEMBER_TYPE_NAME = "CohortMember"; /* SoftwareServerCapability */ public static final String PROTOCOL_VERSION_PROPERTY_NAME = "protocolVersion"; /* from CohortMember */ public static final String DEPLOYED_API_TYPE_GUID = "7dbb3e63-138f-49f1-97b4-66313871fc14"; /* from Area 2 */ public static final String DEPLOYED_API_TYPE_NAME = "DeployedAPI"; /* Asset */ public static final String API_ENDPOINT_TYPE_GUID = "de5b9501-3ad4-4803-a8b2-e311c72a4336"; /* from Area 2 */ public static final String API_ENDPOINT_TYPE_NAME = "APIEndpoint"; /* End1 = DeployedAPI; End 2 = Endpoint */ public static final String LOG_FILE_TYPE_GUID = "ff4c8484-9127-464a-97fc-99579d5bc429"; /* from Area 2 */ public static final String LOG_FILE_TYPE_NAME = "LogFile"; /* DataFile */ public static final String LOG_FILE_TYPE_PROPERTY_NAME = "deployedImplementationType"; /* from LogFile entity */ public static final String TOPIC_TYPE_GUID = "29100f49-338e-4361-b05d-7e4e8e818325"; /* from Area 2 */ public static final String TOPIC_TYPE_NAME = "Topic"; /* DataSet */ public static final String TOPIC_TYPE_PROPERTY_NAME = "topicType"; /* from Topic entity */ public static final String SUBSCRIBER_LIST_TYPE_GUID = "69751093-35f9-42b1-944b-ba6251ff513d"; /* from Area 2 */ public static final String SUBSCRIBER_LIST_TYPE_NAME = "SubscriberList"; /* DataSet */ public static final String TOPIC_SUBSCRIBERS_TYPE_GUID = "bc91a28c-afb9-41a7-8eb2-fc8b5271fe9e"; /* from Area 2 */ public static final String TOPIC_SUBSCRIBERS_TYPE_NAME = "TopicSubscribers"; /* End1 = SubscriberList; End 2 = Topic */ public static final String INFORMATION_VIEW_TYPE_GUID = "68d7b905-6438-43be-88cf-5de027b4aaaf"; /* from Area 2 */ public static final String INFORMATION_VIEW_TYPE_NAME = "InformationView"; /* DataSet */ public static final String FORM_TYPE_GUID = "8078e3d1-0c63-4ace-aafa-68498b39ccd6"; /* from Area 2 */ public static final String FORM_TYPE_NAME = "Form"; /* DataSet */ public static final String DEPLOYED_REPORT_TYPE_GUID = "e9077f4f-955b-4d7b-b1f7-12ee769ff0c3"; /* from Area 2 */ public static final String DEPLOYED_REPORT_TYPE_NAME = "DeployedReport"; /* DataSet */ public static final String ID_PROPERTY_NAME = "id"; /* from DeployedReport entity */ public static final String CREATED_TIME_PROPERTY_NAME = "createdTime"; /* from DeployedReport entity */ public static final String LAST_MODIFIED_TIME_PROPERTY_NAME = "lastModifiedTime"; /* from DeployedReport entity */ public static final String LAST_MODIFIER_PROPERTY_NAME = "lastModifier"; /* from DeployedReport entity */ public static final String DEPLOYED_SOFTWARE_COMPONENT_TYPE_GUID = "486af62c-dcfd-4859-ab24-eab2e380ecfd"; /* from Area 2 */ public static final String DEPLOYED_SOFTWARE_COMPONENT_TYPE_NAME = "DeployedSoftwareComponent"; /* Process */ public static final String IMPLEMENTATION_LANGUAGE_PROPERTY_NAME = "implementationLanguage"; /* from Topic entity */ public static final String PROCESS_HIERARCHY_TYPE_GUID = "70dbbda3-903f-49f7-9782-32b503c43e0e"; /* from Area 2 */ public static final String PROCESS_HIERARCHY_TYPE_NAME = "ProcessHierarchy"; /* End1 = Process - parent; End 2 = Process - child */ public static final String PROCESS_CONTAINMENT_TYPE_ENUM_TYPE_GUID = "1bb4b908-7983-4802-a2b5-91b095552ee9"; public static final String PROCESS_CONTAINMENT_TYPE_ENUM_TYPE_NAME = "ProcessContainmentType"; /* from Area 2 */ public static final String CONTAINMENT_TYPE_PROPERTY_NAME = "containmentType"; /* from ProcessHierarchy relationship */ public static final String PORT_TYPE_GUID = "e3d9FD9F-d5eD-2aed-CC98-0bc21aB6f71C"; /* from Area 2 */ public static final String PORT_TYPE_NAME = "Port"; /* Referenceable */ public static final String PORT_TYPE_ENUM_TYPE_GUID = "b57Fbce7-42ac-71D1-D6a6-9f62Cb7C6dc3"; public static final String PORT_TYPE_ENUM_TYPE_NAME = "PortType"; /* from Area 2 */ public static final String PORT_TYPE_PROPERTY_NAME = "portType"; /* from Port entity */ public static final String PORT_ALIAS_TYPE_GUID = "DFa5aEb1-bAb4-c25B-bDBD-B95Ce6fAB7F5"; /* from Area 2 */ public static final String PORT_ALIAS_TYPE_NAME = "PortAlias"; /* Port */ public static final String PORT_IMPLEMENTATION_TYPE_GUID = "ADbbdF06-a6A3-4D5F-7fA3-DB4Cb0eDeC0E"; /* from Area 2 */ public static final String PORT_IMPLEMENTATION_TYPE_NAME = "PortImplementation"; /* Port */ public static final String PROCESS_PORT_TYPE_GUID = "fB4E00CF-37e4-88CE-4a94-233BAdB84DA2"; /* from Area 2 */ public static final String PROCESS_PORT_TYPE_NAME = "ProcessPort"; /* End1 = Process; End 2 = Port */ public static final String PORT_DELEGATION_TYPE_GUID = "98bB8BA1-dc6A-eb9D-32Cf-F837bEbCbb8E"; /* from Area 2 */ public static final String PORT_DELEGATION_TYPE_NAME = "PortDelegation"; /* End1 = Port delegating from; End 2 = Port delegating to */ /* ============================================================================================================================*/ /* Area 3 - Glossary */ /* ============================================================================================================================*/ public static final String GLOSSARY_TYPE_GUID = "36f66863-9726-4b41-97ee-714fd0dc6fe4"; public static final String GLOSSARY_TYPE_NAME = "Glossary"; /* from Area 3 */ /* Referenceable */ public static final String LANGUAGE_PROPERTY_NAME = "language"; /* from Glossary entity*/ public static final String USAGE_PROPERTY_NAME = "usage"; /* from Glossary entity*/ public static final String TAXONOMY_CLASSIFICATION_TYPE_GUID = "37116c51-e6c9-4c37-942e-35d48c8c69a0"; public static final String TAXONOMY_CLASSIFICATION_TYPE_NAME = "Taxonomy"; /* from Area 3 */ public static final String ORGANIZING_PRINCIPLE_PROPERTY_NAME = "organizingPrinciple"; /* from Taxonomy classification */ public static final String CANONICAL_VOCAB_CLASSIFICATION_TYPE_GUID = "33ad3da2-0910-47be-83f1-daee018a4c05"; public static final String CANONICAL_VOCAB_CLASSIFICATION_TYPE_NAME = "CanonicalVocabulary"; /* from Area 3 */ public static final String SCOPE_PROPERTY_NAME = "scope"; /* from CanonicalVocabulary classification */ public static final String EXTERNAL_GLOSSARY_LINK_TYPE_GUID = "183d2935-a950-4d74-b246-eac3664b5a9d"; public static final String EXTERNAL_GLOSSARY_LINK_TYPE_NAME = "ExternalGlossaryLink"; /* from Area 3 */ /* ExternalReference */ public static final String EXTERNALLY_SOURCED_GLOSSARY_TYPE_GUID = "7786a39c-436b-4538-acc7-d595b5856add"; public static final String EXTERNALLY_SOURCED_GLOSSARY_TYPE_NAME = "ExternallySourcedGlossary"; /* from Area 3 */ public static final String GLOSSARY_CATEGORY_TYPE_GUID = "e507485b-9b5a-44c9-8a28-6967f7ff3672"; public static final String GLOSSARY_CATEGORY_TYPE_NAME = "GlossaryCategory"; /* from Area 3 */ /* Referenceable */ public static final String CATEGORY_ANCHOR_TYPE_GUID = "c628938e-815e-47db-8d1c-59bb2e84e028"; public static final String CATEGORY_ANCHOR_TYPE_NAME = "CategoryAnchor"; /* from Area 3 */ public static final String CATEGORY_HIERARCHY_TYPE_GUID = "71e4b6fb-3412-4193-aff3-a16eccd87e8e"; public static final String CATEGORY_HIERARCHY_TYPE_NAME = "CategoryHierarchyLink"; /* from Area 3 */ public static final String LIBRARY_CATEGORY_REFERENCE_TYPE_GUID = "3da21cc9-3cdc-4d87-89b5-c501740f00b2e"; public static final String LIBRARY_CATEGORY_REFERENCE_TYPE_NAME = "LibraryCategoryReference"; /* from Area 3 */ public static final String GLOSSARY_TERM_TYPE_GUID = "0db3e6ec-f5ef-4d75-ae38-b7ee6fd6ec0a"; public static final String GLOSSARY_TERM_TYPE_NAME = "GlossaryTerm"; /* from Area 3 */ /* Referenceable */ public static final String CONTROLLED_GLOSSARY_TERM_TYPE_GUID = "c04e29b2-2d66-48fc-a20d-e59895de6040"; public static final String CONTROLLED_GLOSSARY_TERM_TYPE_NAME = "ControlledGlossaryTerm"; /* from Area 3 */ /* GlossaryTerm */ public static final String SUMMARY_PROPERTY_NAME = "summary"; /* from GlossaryTerm and GovernanceDefinition entity */ public static final String EXAMPLES_PROPERTY_NAME = "examples"; /* from GlossaryTerm entity */ public static final String ABBREVIATION_PROPERTY_NAME = "abbreviation"; /* from GlossaryTerm entity */ public static final String TERM_RELATIONSHIP_STATUS_ENUM_TYPE_GUID = "42282652-7d60-435e-ad3e-7cfe5291bcc7"; public static final String TERM_RELATIONSHIP_STATUS_ENUM_TYPE_NAME = "TermRelationshipStatus"; /* from Area 3 */ public static final String TERM_ANCHOR_TYPE_GUID = "1d43d661-bdc7-4a91-a996-3239b8f82e56"; public static final String TERM_ANCHOR_TYPE_NAME = "TermAnchor"; /* from Area 3 */ public static final String TERM_CATEGORIZATION_TYPE_GUID = "696a81f5-ac60-46c7-b9fd-6979a1e7ad27"; public static final String TERM_CATEGORIZATION_TYPE_NAME = "TermCategorization"; /* from Area 3 */ public static final String LIBRARY_TERM_REFERENCE_TYPE_GUID = "38c346e4-ddd2-42ef-b4aa-55d53c078d22"; public static final String LIBRARY_TERM_REFERENCE_TYPE_NAME = "LibraryTermReference"; /* from Area 3 */ public static final String ACTIVITY_TYPE_ENUM_TYPE_GUID = "af7e403d-9865-4ebb-8c1a-1fd57b4f4bca"; public static final String ACTIVITY_TYPE_ENUM_TYPE_NAME = "ActivityType"; /* from Area 3 */ public static final String ACTIVITY_TYPE_PROPERTY_NAME = "activityType"; /* from Area 3 */ public static final String ACTIVITY_DESC_CLASSIFICATION_TYPE_GUID = "317f0e52-1548-41e6-b90c-6ae5e6c53fed"; public static final String ACTIVITY_DESC_CLASSIFICATION_TYPE_NAME = "ActivityDescription"; /* from Area 3 */ /* GlossaryTerm */ public static final String ABSTRACT_CONCEPT_CLASSIFICATION_TYPE_GUID = "9d725a07-4abf-4939-a268-419d200b69c2"; public static final String ABSTRACT_CONCEPT_CLASSIFICATION_TYPE_NAME = "AbstractConcept"; /* from Area 3 */ /* GlossaryTerm */ public static final String DATA_VALUE_CLASSIFICATION_TYPE_GUID = "ab253e31-3d8a-45a7-8592-24329a189b9e"; public static final String DATA_VALUE_CLASSIFICATION_TYPE_NAME = "DataValue"; /* from Area 3 */ /* GlossaryTerm */ public static final String CONTEXT_DEFINITION_CLASSIFICATION_TYPE_GUID = "54f9f41a-3871-4650-825d-59a41de01330e"; public static final String CONTEXT_DEFINITION_CLASSIFICATION_TYPE_NAME = "ContextDefinition"; /* from Area 3 */ /* GlossaryTerm */ public static final String SPINE_OBJECT_CLASSIFICATION_TYPE_GUID = "a41ee152-de1e-4533-8535-2f8b37897cac"; public static final String SPINE_OBJECT_CLASSIFICATION_TYPE_NAME = "SpineObject"; /* from Area 3 */ /* GlossaryTerm */ public static final String SPINE_ATTRIBUTE_CLASSIFICATION_TYPE_GUID = "ccb749ba-34ec-4f71-8755-4d8b383c34c3"; public static final String SPINE_ATTRIBUTE_CLASSIFICATION_TYPE_NAME = "SpineAttribute"; /* from Area 3 */ /* GlossaryTerm */ public static final String OBJECT_IDENTIFIER_CLASSIFICATION_TYPE_GUID = "3d1e4389-27de-44fa-8df4-d57bfaf809ea"; public static final String OBJECT_IDENTIFIER_CLASSIFICATION_TYPE_NAME = "ObjectIdentifier"; /* from Area 3 */ /* GlossaryTerm */ public static final String GLOSSARY_PROJECT_CLASSIFICATION_TYPE_GUID = "43be51a9-2d19-4044-b399-3ba36af10929"; public static final String GLOSSARY_PROJECT_CLASSIFICATION_TYPE_NAME = "GlossaryProject"; /* from Area 3 */ /* Project */ public static final String REFERENCEABLE_TO_MEANING_TYPE_GUID = "e6670973-645f-441a-bec7-6f5570345b92"; public static final String REFERENCEABLE_TO_MEANING_TYPE_NAME = "SemanticAssignment"; /* End1 = Referenceable; End 2 = GlossaryTerm */ public static final String TERM_ASSIGNMENT_STATUS_ENUM_TYPE_GUID = "c8fe36ac-369f-4799-af75-46b9c1343ab3"; public static final String TERM_ASSIGNMENT_STATUS_ENUM_TYPE_NAME = "TermAssignmentStatus"; public static final String EXPRESSION_PROPERTY_NAME = "expression"; public static final String STATUS_PROPERTY_NAME = "status"; public static final String CONFIDENCE_PROPERTY_NAME = "confidence"; public static final String STEWARD_PROPERTY_NAME = "steward"; public static final String CREATED_BY_PROPERTY_NAME = "createdBy"; public static final String ELEMENT_SUPPLEMENT_CLASSIFICATION_TYPE_GUID = "58520015-ce6e-47b7-a1fd-864030544819"; public static final String ELEMENT_SUPPLEMENT_CLASSIFICATION_TYPE_NAME = "ElementSupplement"; /* from Area 3 */ /* Project */ public static final String SUPPLEMENTARY_PROPERTIES_TYPE_GUID = "2bb10ba5-7aa2-456a-8b3a-8fdbd75c95cd"; public static final String SUPPLEMENTARY_PROPERTIES_TYPE_NAME = "SupplementaryProperties"; /* from Area 3 */ /* End1 = Referenceable; End 2 = GlossaryTerm */ /* ============================================================================================================================*/ /* Area 4 - Governance */ /* ============================================================================================================================*/ public static final String GOVERNANCE_DOMAIN_TYPE_GUID = "578a3500-9ad3-45fe-8ada-e4e9572c37c8"; public static final String GOVERNANCE_DOMAIN_TYPE_NAME = "GovernanceDomainDescription"; /* Referenceable */ public static final String GOVERNANCE_ROLE_TYPE_GUID = "de2d7f2e-1759-44e3-b8a6-8af53e8fb0ee"; public static final String GOVERNANCE_ROLE_TYPE_NAME = "GovernanceRole"; /* PersonRole */ public static final String GOVERNANCE_OFFICER_TYPE_GUID = "578a3500-9ad3-45fe-8ada-e4e9572c37c8"; public static final String GOVERNANCE_OFFICER_TYPE_NAME = "GovernanceOfficer"; /* GovernanceRole */ public static final String ASSET_OWNER_TYPE_GUID = "ac406bf8-e53e-49f1-9088-2af28eeee285"; public static final String ASSET_OWNER_TYPE_NAME = "AssetOwner"; /* GovernanceRole */ public static final String COMPONENT_OWNER_TYPE_GUID = "21756af1-06c9-4b06-87d2-3ef911f0a58a"; public static final String COMPONENT_OWNER_TYPE_NAME = "ComponentOwner"; /* GovernanceRole */ public static final String DATA_ITEM_OWNER_TYPE_GUID = "69836cfd-39b8-460b-8727-b04e19210069"; public static final String DATA_ITEM_OWNER_TYPE_NAME = "DataItemOwner"; /* GovernanceRole */ public static final String GOVERNANCE_DEFINITION_TYPE_GUID = "578a3500-9ad3-45fe-8ada-e4e9572c37c8"; public static final String GOVERNANCE_DEFINITION_TYPE_NAME = "GovernanceDefinition"; /* Referenceable */ public static final String GOVERNANCE_DRIVER_TYPE_GUID = "c403c109-7b6b-48cd-8eee-df445b258b33"; public static final String GOVERNANCE_DRIVER_TYPE_NAME = "GovernanceDriver"; /* GovernanceDefinition */ public static final String GOVERNANCE_STRATEGY_TYPE_GUID = "3c34f121-07a6-4e95-a07d-9b0ef17b7bbf"; public static final String GOVERNANCE_STRATEGY_TYPE_NAME = "GovernanceStrategy"; /* GovernanceDriver */ public static final String REGULATION_TYPE_GUID = "e3c4293d-8846-4500-b0c0-197d73aba8b0"; public static final String REGULATION_TYPE_NAME = "Regulation"; /* GovernanceDriver */ public static final String GOVERNANCE_POLICY_TYPE_GUID = "a7defa41-9cfa-4be5-9059-359022bb016d"; public static final String GOVERNANCE_POLICY_TYPE_NAME = "GovernancePolicy"; /* GovernanceDefinition */ public static final String GOVERNANCE_PRINCIPLE_TYPE_GUID = "3b7d1325-ec2c-44cb-8db0-ce207beb78cf"; public static final String GOVERNANCE_PRINCIPLE_TYPE_NAME = "GovernancePrinciple"; /* GovernancePolicy */ public static final String GOVERNANCE_OBLIGATION_TYPE_GUID = "0cec20d3-aa29-41b7-96ea-1c544ed32537"; public static final String GOVERNANCE_OBLIGATION_TYPE_NAME = "GovernanceObligation"; /* GovernancePolicy */ public static final String GOVERNANCE_APPROACH_TYPE_GUID = "2d03ec9d-bd6b-4be9-8e17-95a7ecdbaa67"; public static final String GOVERNANCE_APPROACH_TYPE_NAME = "GovernanceApproach"; /* GovernancePolicy */ public static final String GOVERNANCE_CONTROL_TYPE_GUID = "c794985e-a10b-4b6c-9dc2-6b2e0a2901d3"; public static final String GOVERNANCE_CONTROL_TYPE_NAME = "GovernanceControl"; /* GovernanceDefinition */ public static final String TECHNICAL_CONTROL_TYPE_GUID = "d8f6eb5b-36f0-49bd-9b25-bf16f370d1ec"; public static final String TECHNICAL_CONTROL_TYPE_NAME = "TechnicalControl"; /* GovernanceControl */ public static final String GOVERNANCE_RULE_TYPE_GUID = "8f954380-12ce-4a2d-97c6-9ebe250fecf8"; public static final String GOVERNANCE_RULE_TYPE_NAME = "GovernanceRule"; /* TechnicalControl */ public static final String NAMING_STANDARD_RULE_TYPE_GUID = "52505b06-98a5-481f-8a32-db9b02afabfc"; public static final String NAMING_STANDARD_RULE_TYPE_NAME = "NamingStandardRule"; /* GovernanceRule */ public static final String GOVERNANCE_PROCESS_TYPE_GUID = "b68b5d9d-6b79-4f3a-887f-ec0f81c54aea"; public static final String GOVERNANCE_PROCESS_TYPE_NAME = "GovernanceProcess"; /* TechnicalControl */ public static final String ORGANIZATIONAL_CONTROL_TYPE_GUID = "befa1458-79b8-446a-b813-536700e60fa8"; public static final String ORGANIZATIONAL_CONTROL_TYPE_NAME = "OrganizationalControl"; /* GovernanceControl */ public static final String GOVERNANCE_RESPONSIBILITY_TYPE_GUID = "89a76b24-deb8-45bf-9304-a578a610326f"; public static final String GOVERNANCE_RESPONSIBILITY_TYPE_NAME = "GovernanceResponsibility"; /* OrganizationalControl */ public static final String GOVERNANCE_PROCEDURE_TYPE_GUID = "69055d10-51dc-4c2b-b21f-d76fad3f8ef3"; public static final String GOVERNANCE_PROCEDURE_TYPE_NAME = "GovernanceProcedure"; /* OrganizationalControl */ public static final String NAMING_STANDARD_RULE_SET_TYPE_GUID = "ba70f506-1f81-4890-bb4f-1cb1d99c939e"; public static final String NAMING_STANDARD_RULE_SET_TYPE_NAME = "NamingStandardRuleSet"; /* Collection */ public static final String PRIME_WORD_CLASSIFICATION_TYPE_GUID = "3ea1ea66-8923-4662-8628-0bacef3e9c5f"; public static final String PRIME_WORD_CLASSIFICATION_TYPE_NAME = "PrimeWord"; public static final String CLASS_WORD_CLASSIFICATION_TYPE_GUID = "feac4bd9-37d9-4437-82f6-618ce3e2793e"; public static final String CLASS_WORD_CLASSIFICATION_TYPE_NAME = "ClassWord"; public static final String MODIFIER_CLASSIFICATION_TYPE_GUID = "f662c95a-ae3f-4f71-b442-78ab70f2ee47"; public static final String MODIFIER_CLASSIFICATION_TYPE_NAME = "Modifier"; public static final String GOVERNED_BY_TYPE_GUID = "89c3c695-9e8d-4660-9f44-ed971fd55f89"; public static final String GOVERNED_BY_TYPE_NAME = "GovernedBy"; /* from Area 4 */ /* End1 = GovernanceDefinition; End 2 = Referenceable */ public static final String GOVERNANCE_RESPONSE_TYPE_GUID = "8845990e-7fd9-4b79-a19d-6c4730dadd6b"; public static final String GOVERNANCE_RESPONSE_TYPE_NAME = "GovernanceResponse"; /* from Area 4 */ /* End1 = GovernanceDriver; End 2 = GovernancePolicy */ public static final String GOVERNANCE_POLICY_LINK_TYPE_GUID = "0c42c999-4cac-4da4-afab-0e381f3a818e"; public static final String GOVERNANCE_POLICY_LINK_TYPE_NAME = "GovernancePolicyLink"; /* from Area 4 */ /* End1 = GovernancePolicy; End 2 = GovernancePolicy */ public static final String GOVERNANCE_IMPLEMENTATION_TYPE_GUID = "787eaf46-7cf2-4096-8d6e-671a0819d57e"; public static final String GOVERNANCE_IMPLEMENTATION_TYPE_NAME = "GovernanceImplementation"; /* from Area 4 */ /* End1 = GovernancePolicy; End 2 = GovernanceControl */ public static final String GOVERNANCE_CONTROL_LINK_TYPE_GUID = "806933fb-7925-439b-9876-922a960d2ba1"; public static final String GOVERNANCE_CONTROL_LINK_TYPE_NAME = "GovernanceControlLink"; /* from Area 4 */ /* End1 = GovernanceControl; End 2 = GovernanceControl */ public static final String GOVERNANCE_ROLE_ASSIGNMENT_TYPE_GUID = "cb10c107-b7af-475d-aab0-d78b8297b982"; public static final String GOVERNANCE_ROLE_ASSIGNMENT_TYPE_NAME = "GovernanceRoleAssignment"; /* from Area 4 */ /* End1 = Referenceable; End 2 = PersonRole */ public static final String GOVERNANCE_RESPONSIBILITY_ASSIGNMENT_TYPE_GUID = "cb15c107-b7af-475d-aab0-d78b8297b982"; public static final String GOVERNANCE_RESPONSIBILITY_ASSIGNMENT_TYPE_NAME = "GovernanceResponsibilityAssignment"; /* from Area 4 */ /* End1 = PersonRole; End 2 = GovernanceResponsibility */ public static final String DOMAIN_PROPERTY_NAME = "domain"; /* Deprecated */ public static final String DOMAIN_IDENTIFIER_PROPERTY_NAME = "domainIdentifier"; /* from many governance entities */ public static final String LEVEL_IDENTIFIER_PROPERTY_NAME = "levelIdentifier"; /* from many governance entities */ public static final String CRITERIA_PROPERTY_NAME = "criteria"; /* from many governance entities */ public static final String TITLE_PROPERTY_NAME = "title"; /* from GovernanceDefinition entity */ public static final String PRIORITY_PROPERTY_NAME = "priority"; /* from GovernanceDefinition and To Do entity */ public static final String IMPLICATIONS_PROPERTY_NAME = "implications"; /* from GovernanceDefinition entity */ public static final String OUTCOMES_PROPERTY_NAME = "outcomes"; /* from GovernanceDefinition entity */ public static final String RESULTS_PROPERTY_NAME = "results"; /* from GovernanceDefinition entity */ public static final String BUSINESS_IMPERATIVES_PROPERTY_NAME = "businessImperatives"; /* from GovernanceStrategy entity */ public static final String JURISDICTION_PROPERTY_NAME = "jurisdiction"; /* from Regulation entity */ public static final String IMPLEMENTATION_DESCRIPTION_PROPERTY_NAME = "implementationDescription"; /* from GovernanceControl entity */ public static final String NAME_PATTERN_PROPERTY_NAME = "namePattern"; /* from NamingStandardRule entity */ public static final String NOTES_PROPERTY_NAME = "notes"; /* from multiple entities */ public static final String RATIONALE_PROPERTY_NAME = "rationale"; /* from GovernanceResponse, GovernanceImplementation relationship */ public static final String GOVERNANCE_PROJECT_CLASSIFICATION_TYPE_GUID = "37142317-4125-4046-9514-71dc5031563f"; public static final String GOVERNANCE_PROJECT_CLASSIFICATION_TYPE_NAME = "GovernanceProject"; public static final String GOVERNANCE_CLASSIFICATION_LEVEL_TYPE_GUID = "8af91d61-2ae8-4255-992e-14d7f745a556"; public static final String GOVERNANCE_CLASSIFICATION_LEVEL_TYPE_NAME = "GovernanceClassificationLevel"; /* Referenceable */ public static final String GOVERNANCE_CLASSIFICATION_STATUS_ENUM_TYPE_GUID = "cc540586-ac7c-41ba-8cc1-4da694a6a8e4"; public static final String GOVERNANCE_CLASSIFICATION_STATUS_ENUM_TYPE_NAME = "GovernanceClassificationStatus"; public static final int DISCOVERED_GC_STATUS_ORDINAL = 0; public static final int PROPOSED_GC_STATUS_ORDINAL = 1; public static final int IMPORTED_GC_STATUS_ORDINAL = 2; public static final int VALIDATED_GC_STATUS_ORDINAL = 3; public static final int DEPRECATED_GC_STATUS_ORDINAL = 4; public static final int OBSOLETE_GC_STATUS_ORDINAL = 5; public static final int OTHER_GC_STATUS_ORDINAL = 99; public static final String CONFIDENCE_LEVEL_ENUM_TYPE_GUID = "ae846797-d88a-4421-ad9a-318bf7c1fe6f"; public static final String CONFIDENCE_LEVEL_ENUM_TYPE_NAME = "ConfidenceLevel"; public static final String RETENTION_BASIS_ENUM_TYPE_GUID = "de79bf78-ecb0-4fd0-978f-ecc2cb4ff6c7"; public static final String RETENTION_BASIS_ENUM_TYPE_NAME = "RetentionBasis"; public static final String CRITICALITY_LEVEL_ENUM_TYPE_GUID = "22bcbf49-83e1-4432-b008-e09a8f842a1e"; public static final String CRITICALITY_LEVEL_ENUM_TYPE_NAME = "CriticalityLevel"; public static final String IMPACT_SEVERITY_ENUM_TYPE_GUID = "3a6c4ba7-3cc5-48cd-8952-a50a92da016d"; public static final String IMPACT_SEVERITY_ENUM_TYPE_NAME = "ImpactSeverity"; public static final String CONFIDENTIALITY_CLASSIFICATION_TYPE_GUID = "742ddb7d-9a4a-4eb5-8ac2-1d69953bd2b6"; public static final String CONFIDENTIALITY_CLASSIFICATION_TYPE_NAME = "Confidentiality"; public static final String CONFIDENCE_CLASSIFICATION_TYPE_GUID = "25d8f8d5-2998-4983-b9ef-265f58732965"; public static final String CONFIDENCE_CLASSIFICATION_TYPE_NAME = "Confidence"; public static final String CRITICALITY_CLASSIFICATION_TYPE_GUID = "d46d211a-bd22-40d5-b642-87b4954a167e"; public static final String CRITICALITY_CLASSIFICATION_TYPE_NAME = "Criticality"; public static final String IMPACT_CLASSIFICATION_TYPE_GUID = "5b905856-90ec-4944-80c4-0d42bcad484a"; public static final String IMPACT_CLASSIFICATION_TYPE_NAME = "Impact"; public static final String RETENTION_CLASSIFICATION_TYPE_GUID = "83dbcdf2-9445-45d7-bb24-9fa661726553"; public static final String RETENTION_CLASSIFICATION_TYPE_NAME = "Retention"; public static final String GOVERNANCE_CLASSIFICATION_STATUS_PROPERTY_NAME = "status"; public static final String GOVERNANCE_CLASSIFICATION_CONFIDENCE_PROPERTY_NAME = "confidence"; public static final String GOVERNANCE_CLASSIFICATION_STEWARD_PROPERTY_NAME = "steward"; public static final String GOVERNANCE_CLASSIFICATION_SOURCE_PROPERTY_NAME = "source"; public static final String GOVERNANCE_CLASSIFICATION_NOTES_PROPERTY_NAME = "notes"; public static final String CONFIDENTIALITY_LEVEL_PROPERTY_NAME = "level"; public static final String CONFIDENCE_LEVEL_PROPERTY_NAME = "level"; public static final String CRITICALITY_LEVEL_PROPERTY_NAME = "level"; public static final String IMPACT_LEVEL_PROPERTY_NAME = "level"; public static final String RETENTION_BASIS_PROPERTY_NAME = "basis"; public static final String RETENTION_ASSOCIATED_GUID_PROPERTY_NAME = "associatedGUID"; public static final String RETENTION_ARCHIVE_AFTER_PROPERTY_NAME = "archiveAfter"; public static final String RETENTION_DELETE_AFTER_PROPERTY_NAME = "deleteAfter"; public static final String SECURITY_TAG_CLASSIFICATION_TYPE_GUID = "a0b07a86-9fd3-40ca-bb9b-fe83c6981deb"; public static final String SECURITY_TAG_CLASSIFICATION_TYPE_NAME = "SecurityTags"; public static final String SECURITY_LABELS_PROPERTY_NAME = "securityLabels"; public static final String SECURITY_PROPERTIES_PROPERTY_NAME = "securityProperties"; public static final String ZONE_TYPE_GUID = "290a192b-42a7-449a-935a-269ca62cfdac"; public static final String ZONE_TYPE_NAME = "GovernanceZone"; /* Referenceable */ public static final String ZONE_HIERARCHY_TYPE_GUID = "ee6cf469-cb4d-4c3b-a4c7-e2da1236d139"; public static final String ZONE_HIERARCHY_TYPE_NAME = "ZoneHierarchy"; /* from Area 4 */ /* End1 = Parent Zone; End 2 = Child Zone */ public static final String SUBJECT_AREA_TYPE_GUID = "d28c3839-bc6f-41ad-a882-5667e01fea72"; public static final String SUBJECT_AREA_TYPE_NAME = "SubjectAreaDefinition"; /* Referenceable */ public static final String SUBJECT_AREA_HIERARCHY_TYPE_GUID = "fd3b7eaf-969c-4c26-9e1e-f31c4c2d1e4b"; public static final String SUBJECT_AREA_HIERARCHY_TYPE_NAME = "SubjectAreaHierarchy"; /* from Area 4 */ /* End1 = Parent Subject Area; End 2 = Child Subject Area */ public static final String SUBJECT_AREA_CLASSIFICATION_TYPE_GUID = "480e6993-35c5-433a-b50b-0f5c4063fb5d"; public static final String SUBJECT_AREA_CLASSIFICATION_TYPE_NAME = "SubjectArea"; /* Referenceable */ public static final String ORGANIZATION_TYPE_GUID = "50a61105-35be-4ee3-8b99-bdd958ed0685"; public static final String ORGANIZATION_TYPE_NAME = "Organization"; /* from Area 4 */ /* Team */ public static final String BUSINESS_CAPABILITY_TYPE_GUID = "7cc6bcb2-b573-4719-9412-cf6c3f4bbb15"; public static final String BUSINESS_CAPABILITY_TYPE_NAME = "BusinessCapability"; /* from Area 4 */ /* Referenceable */ public static final String ORGANIZATIONAL_CAPABILITY_TYPE_GUID = "47f0ad39-db77-41b0-b406-36b1598e0ba7"; public static final String ORGANIZATIONAL_CAPABILITY_TYPE_NAME = "OrganizationalCapability"; /* from Area 4 */ /* End1 = BusinessCapability; End 2 = Team */ public static final String BUSINESS_CAPABILITY_CONTROLS_TYPE_GUID = "b5de932a-738c-4c69-b852-09fec2b9c678"; public static final String BUSINESS_CAPABILITY_CONTROLS_TYPE_NAME = "BusinessCapabilityControls"; /* from Area 4 */ /* End1 = GovernanceControl; End 2 = BusinessCapability */ public static final String ASSET_ORIGIN_CLASSIFICATION_GUID = "e530c566-03d2-470a-be69-6f52bfbd5fb7"; public static final String ASSET_ORIGIN_CLASSIFICATION_NAME = "AssetOrigin"; public static final String ORGANIZATION_PROPERTY_NAME = "organization"; /* from AssetOrigin classification */ public static final String ORGANIZATION_PROPERTY_NAME_PROPERTY_NAME = "organizationPropertyName"; /* from AssetOrigin classification */ public static final String BUSINESS_CAPABILITY_PROPERTY_NAME = "businessCapability"; /* from AssetOrigin classification */ public static final String BUSINESS_CAPABILITY_PROPERTY_NAME_PROPERTY_NAME = "businessCapabilityPropertyName"; /* from AssetOrigin classification */ public static final String OTHER_ORIGIN_VALUES_PROPERTY_NAME = "otherOriginValues"; /* from AssetOrigin classification */ public static final String BUSINESS_CAPABILITY_TYPE_PROPERTY_NAME = "businessCapabilityType"; /* from BusinessCapability entity */ public static final String ASSET_ZONES_CLASSIFICATION_GUID = "a1c17a86-9fd3-40ca-bb9b-fe83c6981deb"; public static final String ASSET_ZONES_CLASSIFICATION_NAME = "AssetZoneMembership"; public static final String ZONE_MEMBERSHIP_PROPERTY_NAME = "zoneMembership"; /* from Area 4 */ public static final String ASSET_OWNERSHIP_CLASSIFICATION_GUID = "d531c566-03d2-470a-be69-6f52cabd5fb9"; public static final String ASSET_OWNERSHIP_CLASSIFICATION_NAME = "AssetOwnership"; public static final String OWNERSHIP_CLASSIFICATION_TYPE_GUID = "8139a911-a4bd-432b-a9f4-f6d11c511abe"; public static final String OWNERSHIP_CLASSIFICATION_TYPE_NAME = "Ownership"; public static final String OWNER_PROPERTY_NAME = "owner"; /* from Area 4 */ public static final String OWNER_TYPE_PROPERTY_NAME = "ownerType"; /* deprecated */ public static final String OWNER_TYPE_NAME_PROPERTY_NAME = "ownerTypeName"; public static final String OWNER_PROPERTY_NAME_PROPERTY_NAME = "ownerPropertyName"; public static final String OWNER_TYPE_ENUM_TYPE_GUID = "5ce92a70-b86a-4e0d-a9d7-fc961121de97"; public static final String OWNER_TYPE_ENUM_TYPE_NAME = "OwnerType"; /* deprecated */ public static final String ASSET_OWNER_TYPE_ENUM_TYPE_GUID = "9548390c-69f5-4dc6-950d-6feeee257b56"; public static final String ASSET_OWNER_TYPE_ENUM_TYPE_NAME = "AssetOwnerType"; public static final int USER_ID_OWNER_TYPE_ORDINAL = 0; public static final int PROFILE_ID_OWNER_TYPE_ORDINAL = 1; public static final int OTHER_OWNER_TYPE_ORDINAL = 99; public static final String PROJECT_CHARTER_TYPE_GUID = "f96b5a32-42c1-4a74-8f77-70a81cec783d"; public static final String PROJECT_CHARTER_TYPE_NAME = "ProjectCharter"; /* Referenceable */ public static final String PROJECT_CHARTER_LINK_TYPE_GUID = "f081808d-545a-41cb-a9aa-c4f074a16c78"; public static final String PROJECT_CHARTER_LINK_TYPE_NAME = "ProjectCharterLink"; /* End1 = Project; End 2 = ProjectCharter */ public static final String PROJECT_TYPE_PROPERTY_NAME = "projectType"; /* from Area 4 */ public static final String PURPOSES_PROPERTY_NAME = "purposes"; /* from Area 4 */ public static final String EXECUTION_POINT_DEFINITION_TYPE_GUID = "d7f8d1d2-8cec-4fd2-b9fd-c8307cad750d"; public static final String EXECUTION_POINT_DEFINITION_TYPE_NAME = "ExecutionPointDefinition"; /* Referenceable */ public static final String CONTROL_POINT_DEFINITION_TYPE_GUID = "a376a993-5f1c-4926-b74e-a15a38e1d55ad"; public static final String CONTROL_POINT_DEFINITION_TYPE_NAME = "ControlPointDefinition"; /* ExecutionPointDefinition */ public static final String VERIFICATION_POINT_DEFINITION_TYPE_GUID = "27db26a1-ff66-4042-9932-ddc728b977b9"; public static final String VERIFICATION_POINT_DEFINITION_TYPE_NAME = "VerificationPointDefinition"; /* ExecutionPointDefinition */ public static final String ENFORCEMENT_POINT_DEFINITION_TYPE_GUID = "e87ff806-bb9c-4c5d-8106-f38f2dd21037"; public static final String ENFORCEMENT_POINT_DEFINITION_TYPE_NAME = "EnforcementPointDefinition"; /* ExecutionPointDefinition */ public static final String CONTROL_POINT_CLASSIFICATION_TYPE_GUID = "acf8b73e-3545-435d-ba16-fbfae060dd28"; public static final String CONTROL_POINT_CLASSIFICATION_TYPE_NAME = "ControlPoint"; /* Referenceable */ public static final String VERIFICATION_POINT_CLASSIFICATION_TYPE_GUID = "12d78c95-3879-466d-883f-b71f6477a741"; public static final String VERIFICATION_POINT_CLASSIFICATION_TYPE_NAME = "VerificationPoint"; /* Referenceable */ public static final String ENFORCEMENT_POINT_CLASSIFICATION_TYPE_GUID = "f4ce104e-7430-4c30-863d-60f6af6394d9"; public static final String ENFORCEMENT_POINT_CLASSIFICATION_TYPE_NAME = "EnforcementPoint"; /* Referenceable */ public static final String EXECUTION_POINT_USE_TYPE_GUID = "3eb268f4-9419-4281-a487-d25ccd88eba3"; public static final String EXECUTION_POINT_USE_TYPE_NAME = "ExecutionPointUse"; /* End1 = GovernanceDefinition; End 2 = ExecutionPointDefinition */ public static final String POLICY_ADMINISTRATION_POINT_CLASSIFICATION_TYPE_GUID = "4f13baa3-31b3-4a85-985e-2abc784900b8"; public static final String POLICY_ADMINISTRATION_POINT_CLASSIFICATION_TYPE_NAME = "PolicyAdministrationPoint"; /* Referenceable */ public static final String POLICY_DECISION_POINT_CLASSIFICATION_TYPE_GUID = "12d78c95-3879-466d-883f-b71f6477a741"; public static final String POLICY_DECISION_POINT_CLASSIFICATION_TYPE_NAME = "PolicyDecisionPoint"; /* Referenceable */ public static final String POLICY_ENFORCEMENT_POINT_CLASSIFICATION_TYPE_GUID = "9a68b20b-3f84-4d7d-bc9e-790c4b27e685"; public static final String POLICY_ENFORCEMENT_POINT_CLASSIFICATION_TYPE_NAME = "PolicyEnforcementPoint"; /* Referenceable */ public static final String POLICY_INFORMATION_POINT_CLASSIFICATION_TYPE_GUID = "2058ab6f-ddbf-45f9-9136-47354544e282"; public static final String POLICY_INFORMATION_POINT_CLASSIFICATION_TYPE_NAME = "PolicyInformationPoint"; /* Referenceable */ public static final String POLICY_RETRIEVAL_POINT_CLASSIFICATION_TYPE_GUID = "d7367412-7ba6-409f-84db-42b51e859367"; public static final String POLICY_RETRIEVAL_POINT_CLASSIFICATION_TYPE_NAME = "PolicyRetrievalPoint"; /* Referenceable */ public static final String POINT_TYPE_PROPERTY_NAME = "pointType"; /* from Area 4 */ public static final String GOVERNANCE_ENGINE_TYPE_GUID = "3fa23d4a-aceb-422f-9301-04ed474c6f74"; public static final String GOVERNANCE_ENGINE_TYPE_NAME = "GovernanceEngine"; /* SoftwareServerCapability */ public static final String GOVERNANCE_SERVICE_TYPE_GUID = "191d870c-26f4-4310-a021-b8ca8772719d"; public static final String GOVERNANCE_SERVICE_TYPE_NAME = "GovernanceService"; /* DeployedConnector */ public static final String GOVERNANCE_ACTION_ENGINE_TYPE_GUID = "5d74250a-57ca-4197-9475-8911f620a94e"; public static final String GOVERNANCE_ACTION_ENGINE_TYPE_NAME = "GovernanceActionEngine"; /* GovernanceEngine */ public static final String GOVERNANCE_ACTION_SERVICE_TYPE_GUID = "ececb378-31ac-4cc3-99b4-1c44e5fbc4d9"; public static final String GOVERNANCE_ACTION_SERVICE_TYPE_NAME = "GovernanceActionService"; /* DeployedConnector */ public static final String SUPPORTED_GOVERNANCE_SERVICE_TYPE_GUID = "2726df0e-4f3a-44e1-8433-4ca5301457fd"; public static final String SUPPORTED_GOVERNANCE_SERVICE_TYPE_NAME = "SupportedGovernanceService"; /* End1 = GovernanceEngine; End 2 = GovernanceService */ public static final String REQUEST_TYPE_PROPERTY_NAME = "requestType"; /* from SupportedGovernanceService relationship */ public static final String REQUEST_PARAMETERS_PROPERTY_NAME = "requestParameters"; /* from SupportedGovernanceService relationship */ public static final String GOVERNANCE_ACTION_PROCESS_TYPE_GUID = "4d3a2b8d-9e2e-4832-b338-21c74e45b238"; public static final String GOVERNANCE_ACTION_PROCESS_TYPE_NAME = "GovernanceActionProcess"; /* Process */ public static final String GOVERNANCE_ACTION_TYPE_TYPE_GUID = "92e20083-0393-40c0-a95b-090724a91ddc"; public static final String GOVERNANCE_ACTION_TYPE_TYPE_NAME = "GovernanceActionType"; /* Reference */ public static final String PRODUCED_GUARDS_PROPERTY_NAME = "producedGuards"; /* from GovernanceActionType entity */ public static final String GOVERNANCE_ACTION_FLOW_TYPE_GUID = "5f6ddee5-31ea-4d4f-9c3f-00ad2fcb2aa0"; public static final String GOVERNANCE_ACTION_FLOW_TYPE_NAME = "GovernanceActionFlow"; /* End1 = GovernanceActionProcess; End 2 = GovernanceActionType */ public static final String GOVERNANCE_ACTION_TYPE_EXECUTOR_TYPE_GUID = "f672245f-35b5-4ca7-b645-014cf61d5b75"; public static final String GOVERNANCE_ACTION_TYPE_EXECUTOR_TYPE_NAME = "GovernanceActionTypeExecutor"; /* End1 = GovernanceActionType; End 2 = GovernanceEngine */ public static final String NEXT_GOVERNANCE_ACTION_TYPE_TYPE_GUID = "d9567840-9904-43a5-990b-4585c0446e00"; public static final String NEXT_GOVERNANCE_ACTION_TYPE_TYPE_NAME = "NextGovernanceActionType"; /* End1 = GovernanceActionType; End 2 = GovernanceActionType */ public static final String GUARD_PROPERTY_NAME = "guard"; /* from NextGovernanceActionType relationship */ public static final String MANDATORY_GUARD_PROPERTY_NAME = "mandatoryGuard"; /* from NextGovernanceActionType relationship */ public static final String IGNORE_MULTIPLE_TRIGGERS_PROPERTY_NAME = "ignoreMultipleTriggers"; /* from NextGovernanceActionType relationship */ public static final String GOVERNANCE_ACTION_STATUS_ENUM_TYPE_GUID = "a6e698b0-a4f7-4a39-8c80-db0bb0f972ec"; public static final String GOVERNANCE_ACTION_STATUS_ENUM_TYPE_NAME = "GovernanceActionStatus"; public static final int REQUESTED_GA_STATUS_ORDINAL = 0; public static final int APPROVED_GA_STATUS_ORDINAL = 1; public static final int WAITING_GA_STATUS_ORDINAL = 2; public static final int IN_PROGRESS_GA_STATUS_ORDINAL = 3; public static final int ACTIONED_GA_STATUS_ORDINAL = 10; public static final int INVALID_GA_STATUS_ORDINAL = 11; public static final int IGNORED_GA_STATUS_ORDINAL = 12; public static final int FAILED_GA_STATUS_ORDINAL = 13; public static final int OTHER_GA_STATUS_ORDINAL = 99; public static final String GOVERNANCE_ACTION_TYPE_GUID = "c976d88a-2b11-4b40-b972-c38d41bfc6be"; public static final String GOVERNANCE_ACTION_TYPE_NAME = "GovernanceAction"; /* Reference */ public static final String MANDATORY_GUARDS_PROPERTY_NAME = "mandatoryGuards"; /* from GovernanceAction entity */ public static final String RECEIVED_GUARDS_PROPERTY_NAME = "receivedGuards"; /* from GovernanceAction entity */ public static final String START_DATE_PROPERTY_NAME = "startDate"; /* from GovernanceAction and Project entity */ public static final String PLANNED_END_DATE_PROPERTY_NAME = "plannedEndDate"; /* from Project entity */ public static final String CREATION_TIME_PROPERTY_NAME = "creationTime"; /* from To Do entity */ public static final String DUE_TIME_PROPERTY_NAME = "dueTime"; /* from To Do entity */ public static final String COMPLETION_TIME_PROPERTY_NAME = "completionTime"; /* from To Do entity */ public static final String ACTION_STATUS_PROPERTY_NAME = "actionStatus"; /* from GovernanceAction entity */ public static final String PROCESSING_ENGINE_USER_ID_PROPERTY_NAME = "processingEngineUserId"; /* from GovernanceAction entity */ public static final String COMPLETION_DATE_PROPERTY_NAME = "completionDate"; /* from GovernanceAction entity */ public static final String COMPLETION_GUARDS_PROPERTY_NAME = "completionGuards"; /* from GovernanceAction entity */ public static final String GOVERNANCE_ACTION_TYPE_USE_TYPE_GUID = "31e734ec-5baf-4e96-9f0d-e8a85081cb14"; public static final String GOVERNANCE_ACTION_TYPE_USE_TYPE_NAME = "GovernanceActionTypeUse"; /* End1 = GovernanceActionType; End 2 = GovernanceAction */ public static final String ORIGIN_GOVERNANCE_SERVICE_PROPERTY_NAME = "originGovernanceService"; /* from GovernanceActionTypeUse relationship */ public static final String ORIGIN_GOVERNANCE_ENGINE_PROPERTY_NAME = "originGovernanceEngine"; /* from GovernanceActionTypeUse relationship */ public static final String GOVERNANCE_ACTION_REQUEST_SOURCE_TYPE_GUID = "5323a705-4c1f-456a-9741-41fdcb8e93ac"; public static final String GOVERNANCE_ACTION_REQUEST_SOURCE_TYPE_NAME = "GovernanceActionRequestSource"; /* End1 = OpenMetadataRoot; End 2 = GovernanceAction */ public static final String REQUEST_SOURCE_NAME_PROPERTY_NAME = "requestSourceName"; /* from GovernanceActionRequestSource relationship */ public static final String TARGET_FOR_ACTION_TYPE_GUID = "46ec49bf-af66-4575-aab7-06ce895120cd"; public static final String TARGET_FOR_ACTION_TYPE_NAME = "TargetForAction"; /* End1 = GovernanceAction; End 2 = Referenceable */ public static final String ACTION_TARGET_NAME_PROPERTY_NAME = "actionTargetName"; /* from TargetForAction relationship */ public static final String NEXT_GOVERNANCE_ACTION_TYPE_GUID = "4efd16d4-f397-449c-a75d-ebea42fe581b"; public static final String NEXT_GOVERNANCE_ACTION_TYPE_NAME = "NextGovernanceAction"; /* End1 = GovernanceAction; End 2 = GovernanceAction */ public static final String GOVERNANCE_ACTION_EXECUTOR_TYPE_GUID = "e690ab17-6779-46b4-a8f1-6872d88c1bbb"; public static final String GOVERNANCE_ACTION_EXECUTOR_TYPE_NAME = "GovernanceActionExecutor"; /* End1 = GovernanceAction; End 2 = GovernanceEngine */ public static final String DUPLICATE_TYPE_ENUM_TYPE_GUID = "2f6a3dc1-aa98-4b92-add4-68de53b7369c"; public static final String DUPLICATE_TYPE_ENUM_TYPE_NAME = "DuplicateType"; public static final int PEER_ORDINAL = 0; public static final int CONSOLIDATED_ORDINAL = 1; public static final int OTHER_DUPLICATE_ORDINAL = 99; public static final String KNOWN_DUPLICATE_CLASSIFICATION_TYPE_GUID = "e55062b2-907f-44bd-9831-255642285731"; public static final String KNOWN_DUPLICATE_CLASSIFICATION_TYPE_NAME = "KnownDuplicate"; /* Referenceable */ public static final String KNOWN_DUPLICATE_LINK_TYPE_GUID = "7540d9fb-1848-472e-baef-97a44b9f0c45"; public static final String KNOWN_DUPLICATE_LINK_TYPE_NAME = "KnownDuplicateLink"; /* End1 = Referenceable; End 2 = Referenceable */ public static final String DUPLICATE_TYPE_PROPERTY_NAME = "duplicateType"; /* from KnowDuplicateLink relationship */ public static final String INCIDENT_REPORT_STATUS_ENUM_TYPE_GUID = "a9d4f64b-fa24-4eb8-8bf6-308926ef2c14"; public static final String INCIDENT_REPORT_STATUS_ENUM_TYPE_NAME = "IncidentReportStatus"; public static final int RAISED_INCIDENT_ORDINAL = 0; public static final int REVIEWED_INCIDENT_ORDINAL = 1; public static final int VALIDATED_INCIDENT_ORDINAL = 2; public static final int RESOLVED_INCIDENT_ORDINAL = 3; public static final int INVALID_INCIDENT_ORDINAL = 4; public static final int IGNORED_INCIDENT_ORDINAL = 5; public static final int OTHER_INCIDENT_ORDINAL = 99; public static final String INCIDENT_CLASSIFIER_TYPE_GUID = "361158c0-ade1-4c92-a6a7-64f7ac39b87d"; public static final String INCIDENT_CLASSIFIER_TYPE_NAME = "IncidentClassifier"; /* Referenceable */ public static final String INCIDENT_CLASSIFIER_SET_TYPE_GUID = "361158c0-ade1-4c92-a6a7-64f7ac39b87d"; public static final String INCIDENT_CLASSIFIER_SET_TYPE_NAME = "IncidentClassifierSet"; /* Collection */ public static final String CLASSIFIER_LABEL_PROPERTY_NAME = "classifierLabel"; /* from IncidentClassifier entity */ public static final String CLASSIFIER_IDENTIFIER_PROPERTY_NAME = "classifierIdentifier"; /* from IncidentClassifier entity */ public static final String CLASSIFIER_NAME_PROPERTY_NAME = "classifierName"; /* from IncidentClassifier entity */ public static final String CLASSIFIER_DESCRIPTION_PROPERTY_NAME = "classifierDescription"; /* from IncidentClassifier entity */ public static final String INCIDENT_REPORT_TYPE_GUID = "072f252b-dea7-4b88-bb2e-8f741c9ca7f6e"; public static final String INCIDENT_REPORT_TYPE_NAME = "IncidentReport"; /* Referenceable */ public static final String BACKGROUND_PROPERTY_NAME = "background"; /* from IncidentReport entity */ public static final String INCIDENT_STATUS_PROPERTY_NAME = "incidentStatus"; /* from IncidentReport entity */ public static final String INCIDENT_ORIGINATOR_TYPE_GUID = "e490772e-c2c5-445a-aea6-1aab3499a76c"; public static final String INCIDENT_ORIGINATOR_TYPE_NAME = "IncidentOriginator"; /* End1 = Referenceable; End 2 = IncidentReport */ public static final String IMPACTED_RESOURCE_TYPE_GUID = "0908e153-e0fd-499c-8a30-5ea8b81395cd"; public static final String IMPACTED_RESOURCE_TYPE_NAME = "ImpactedResource"; /* End1 = Referenceable; End 2 = IncidentReport */ public static final String SEVERITY_LEVEL_IDENTIFIER_PROPERTY_NAME = "severityLevelIdentifier"; /* from Certification relationship */ public static final String INCIDENT_DEPENDENCY_TYPE_GUID = "017be6a8-0037-49d8-af5d-c45c41f25e0b"; public static final String INCIDENT_DEPENDENCY_TYPE_NAME = "IncidentDependency"; /* End1 = IncidentReport; End 2 = IncidentReport */ public static final String CERTIFICATION_TYPE_TYPE_GUID = "97f9ffc9-e2f7-4557-ac12-925257345eea"; public static final String CERTIFICATION_TYPE_TYPE_NAME = "CertificationType"; /* GovernanceDefinition */ public static final String DETAILS_PROPERTY_NAME = "details"; /* from CertificationType/LicenseType entity */ public static final String CERTIFICATION_OF_REFERENCEABLE_TYPE_GUID = "390559eb-6a0c-4dd7-bc95-b9074caffa7f"; public static final String CERTIFICATION_OF_REFERENCEABLE_TYPE_NAME = "Certification"; /* End1 = Referenceable; End 2 = CertificationType */ public static final String CERTIFICATE_GUID_PROPERTY_NAME = "certificateGUID"; /* from Certification relationship */ public static final String START_PROPERTY_NAME = "start"; /* from Certification relationship */ public static final String END_PROPERTY_NAME = "end"; /* from Certification relationship */ public static final String CONDITIONS_PROPERTY_NAME = "conditions"; /* from Certification relationship */ public static final String CERTIFIED_BY_PROPERTY_NAME = "certifiedBy"; /* from Certification relationship */ public static final String CERTIFIED_BY_TYPE_NAME_PROPERTY_NAME = "certifiedByTypeName"; /* from Certification relationship */ public static final String CERTIFIED_BY_PROPERTY_NAME_PROPERTY_NAME = "certifiedByPropertyName"; /* from Certification relationship */ public static final String CUSTODIAN_PROPERTY_NAME = "custodian"; /* from Certification and License relationship */ public static final String CUSTODIAN_TYPE_NAME_PROPERTY_NAME = "custodianTypeName"; /* from Certification and License relationship */ public static final String CUSTODIAN_PROPERTY_NAME_PROPERTY_NAME = "custodianPropertyName"; /* from Certification and License relationship */ public static final String RECIPIENT_PROPERTY_NAME = "recipient"; /* from Certification relationship */ public static final String RECIPIENT_TYPE_NAME_PROPERTY_NAME = "recipientTypeName"; /* from Certification relationship */ public static final String RECIPIENT_PROPERTY_NAME_PROPERTY_NAME = "recipientPropertyName"; /* from Certification relationship */ public static final String REFERENCEABLE_TO_LICENSE_TYPE_GUID = "35e53b7f-2312-4d66-ae90-2d4cb47901ee"; public static final String REFERENCEABLE_TO_LICENSE_TYPE_NAME = "License"; /* End1 = Referenceable; End 2 = LicenseType */ public static final String LICENSE_TYPE_TYPE_GUID = "046a049d-5f80-4e5b-b0ae-f3cf6009b513"; public static final String LICENSE_TYPE_TYPE_NAME = "LicenseType"; /* GovernanceDefinition */ public static final String LICENSE_OF_REFERENCEABLE_TYPE_GUID = "35e53b7f-2312-4d66-ae90-2d4cb47901ee"; public static final String LICENSE_OF_REFERENCEABLE_TYPE_NAME = "License"; /* End1 = Referenceable; End 2 = LicenseType */ public static final String LICENSE_GUID_PROPERTY_NAME = "licenseGUID"; /* from License relationship */ public static final String LICENSED_BY_PROPERTY_NAME = "licensedBy"; /* from License relationship */ public static final String LICENSED_BY_TYPE_NAME_PROPERTY_NAME = "licensedByTypeName"; /* from License relationship */ public static final String LICENSED_BY_PROPERTY_NAME_PROPERTY_NAME = "licensedByPropertyName"; /* from License relationship */ public static final String LICENSEE_PROPERTY_NAME = "licensee"; /* from License relationship */ public static final String LICENSEE_TYPE_NAME_PROPERTY_NAME = "licenseeTypeName"; /* from License relationship */ public static final String LICENSEE_PROPERTY_NAME_PROPERTY_NAME = "licenseePropertyName"; /* from License relationship */ /* ============================================================================================================================*/ /* Area 5 - Schemas and Models */ /* ============================================================================================================================*/ public static final String ASSET_TO_SCHEMA_TYPE_TYPE_GUID = "815b004d-73c6-4728-9dd9-536f4fe803cd"; /* from Area 5 */ public static final String ASSET_TO_SCHEMA_TYPE_TYPE_NAME = "AssetSchemaType"; /* End1 = Asset; End 2 = SchemaType */ public static final String SCHEMA_ELEMENT_TYPE_GUID = "718d4244-8559-49ed-ad5a-10e5c305a656"; /* from Area 5 */ public static final String SCHEMA_ELEMENT_TYPE_NAME = "SchemaElement"; /* Referenceable */ public static final String SCHEMA_DISPLAY_NAME_PROPERTY_NAME = "displayName"; /* from SchemaElement entity */ public static final String SCHEMA_DESCRIPTION_PROPERTY_NAME = "description"; /* from SchemaElement entity */ public static final String IS_DEPRECATED_PROPERTY_NAME = "isDeprecated"; /* from SchemaElement and ValidValueDefinition entity */ /* For Schema Type */ public static final String SCHEMA_TYPE_TYPE_GUID = "5bd4a3e7-d22d-4a3d-a115-066ee8e0754f"; /* from Area 5 */ public static final String SCHEMA_TYPE_TYPE_NAME = "SchemaType"; /* SchemaElement */ public static final String VERSION_NUMBER_PROPERTY_NAME = "versionNumber"; /* from SchemaType entity */ public static final String AUTHOR_PROPERTY_NAME = "author"; /* from SchemaType entity */ public static final String SCHEMA_USAGE_PROPERTY_NAME = "usage"; /* from SchemaType entity */ public static final String ENCODING_STANDARD_PROPERTY_NAME = "encodingStandard"; /* from SchemaType entity */ public static final String NAMESPACE_PROPERTY_NAME = "namespace"; /* from SchemaType entity */ /* For Complex Schema Type */ public static final String COMPLEX_SCHEMA_TYPE_TYPE_GUID = "786a6199-0ce8-47bf-b006-9ace1c5510e4"; /* from Area 5 */ public static final String COMPLEX_SCHEMA_TYPE_TYPE_NAME = "ComplexSchemaType"; /* SchemaType */ public static final String STRUCT_SCHEMA_TYPE_TYPE_GUID = "a13b409f-fd67-4506-8d94-14dfafd250a4"; /* from Area 5 */ public static final String STRUCT_SCHEMA_TYPE_TYPE_NAME = "StructSchemaType"; /* ComplexSchemaType */ public static final String TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_GUID = "86b176a2-015c-44a6-8106-54d5d69ba661"; /* from Area 5 */ public static final String TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_NAME = "AttributeForSchema"; /* End1 = ComplexSchemaType; End 2 = SchemaAttribute */ /* For Literal Schema Type */ public static final String LITERAL_SCHEMA_TYPE_TYPE_GUID = "520ebb91-c4eb-4d46-a3b1-974875cdcf0d"; /* from Area 5 */ public static final String LITERAL_SCHEMA_TYPE_TYPE_NAME = "LiteralSchemaType"; /* SchemaType */ /* For External Schema Type */ public static final String EXTERNAL_SCHEMA_TYPE_TYPE_GUID = "78de00ea-3d69-47ff-a6d6-767587526624"; /* from Area 5 */ public static final String EXTERNAL_SCHEMA_TYPE_TYPE_NAME = "ExternalSchemaType"; /* SchemaType */ public static final String LINKED_EXTERNAL_SCHEMA_TYPE_RELATIONSHIP_TYPE_GUID = "9a5d78c2-1716-4783-bfc6-c300a9e2d092"; /* from Area 5 */ public static final String LINKED_EXTERNAL_SCHEMA_TYPE_RELATIONSHIP_TYPE_NAME = "LinkedExternalSchemaType"; /* End1 = SchemaElement; End 2 = SchemaType */ /* For Schema Type Choice */ public static final String SCHEMA_TYPE_CHOICE_TYPE_GUID = "5caf954a-3e33-4cbd-b17d-8b8613bd2db8"; /* from Area 5 */ public static final String SCHEMA_TYPE_CHOICE_TYPE_NAME = "SchemaTypeChoice"; /* SchemaType */ public static final String SCHEMA_TYPE_OPTION_RELATIONSHIP_TYPE_GUID = "eb4f1f98-c649-4560-8a46-da17c02764a9"; /* from Area 5 */ public static final String SCHEMA_TYPE_OPTION_RELATIONSHIP_TYPE_NAME = "SchemaTypeOption"; /* End1 = SchemaTypeChoice; End 2 = SchemaType */ /* For Schema Type Choice */ public static final String SIMPLE_SCHEMA_TYPE_TYPE_GUID = "b5ec6e07-6419-4225-9dc4-fb55aba255c6"; /* from Area 5 */ public static final String SIMPLE_SCHEMA_TYPE_TYPE_NAME = "SimpleSchemaType"; /* SchemaType */ /* For Primitive Schema Type */ public static final String PRIMITIVE_SCHEMA_TYPE_TYPE_GUID = "f0f75fba-9136-4082-8352-0ad74f3c36ed"; /* from Area 5 */ public static final String PRIMITIVE_SCHEMA_TYPE_TYPE_NAME = "PrimitiveSchemaType"; /* SimpleSchemaType */ /* For Enum Schema Type */ public static final String ENUM_SCHEMA_TYPE_TYPE_GUID = "24b092ac-42e9-43dc-aeca-eb034ce307d9"; /* from Area 5 */ public static final String ENUM_SCHEMA_TYPE_TYPE_NAME = "EnumSchemaType"; /* SimpleSchemaType */ public static final String DATA_TYPE_PROPERTY_NAME = "dataType"; /* from SimpleSchemaType and LiteralSchemaType entity */ public static final String DEFAULT_VALUE_PROPERTY_NAME = "defaultValue"; /* from PrimitiveSchemaType entity */ public static final String FIXED_VALUE_PROPERTY_NAME = "fixedValue"; /* from LiteralSchemaType entity */ /* For Map Schema Type */ public static final String MAP_SCHEMA_TYPE_TYPE_GUID = "bd4c85d0-d471-4cd2-a193-33b0387a19fd"; /* from Area 5 */ public static final String MAP_SCHEMA_TYPE_TYPE_NAME = "MapSchemaType"; /* SchemaType */ public static final String MAP_TO_RELATIONSHIP_TYPE_GUID = "8b9856b3-451e-45fc-afc7-fddefd81a73a"; /* from Area 5 */ public static final String MAP_TO_RELATIONSHIP_TYPE_NAME = "MapToElementType"; /* End1 = MapSchemaType; End 2 = SchemaType */ public static final String MAP_FROM_RELATIONSHIP_TYPE_GUID = "6189d444-2da4-4cd7-9332-e48a1c340b44"; /* from Area 5 */ public static final String MAP_FROM_RELATIONSHIP_TYPE_NAME = "MapFromElementType"; /* End1 = MapSchemaType; End 2 = SchemaType */ /* For Bounded Schema Type (Deprecated) */ public static final String BOUNDED_SCHEMA_TYPE_TYPE_GUID = "77133161-37a9-43f5-aaa3-fd6d7ff92fdb"; /* from Area 5 */ public static final String BOUNDED_SCHEMA_TYPE_TYPE_NAME = "BoundedSchemaType"; public static final String MAX_ELEMENTS_PROPERTY_NAME = "maximumElements"; /* from BoundedSchemaType entity */ public static final String BOUNDED_ELEMENT_RELATIONSHIP_TYPE_GUID = "3e844049-e59b-45dd-8e62-cde1add59f9e"; /* from Area 5 */ public static final String BOUNDED_ELEMENT_RELATIONSHIP_TYPE_NAME = "BoundedSchemaElementType"; /* End1 = BoundedSchemaType; End 2 = SchemaType */ /* For Schema Attribute */ public static final String SCHEMA_ATTRIBUTE_TYPE_GUID = "1a5e159b-913a-43b1-95fe-04433b25fca9"; /* from Area 5 */ public static final String SCHEMA_ATTRIBUTE_TYPE_NAME = "SchemaAttribute"; /* SchemaElement */ public static final String ATTRIBUTE_NAME_PROPERTY_NAME = "displayName"; /* from SchemaAttribute entity */ public static final String OLD_ATTRIBUTE_NAME_PROPERTY_NAME = "name"; /* from SchemaAttribute entity */ public static final String ELEMENT_POSITION_PROPERTY_NAME = "position"; /* from SchemaAttribute entity */ public static final String CARDINALITY_PROPERTY_NAME = "cardinality"; /* from SchemaAttribute entity */ public static final String MAX_CARDINALITY_PROPERTY_NAME = "maxCardinality"; /* from SchemaAttribute entity */ public static final String MIN_CARDINALITY_PROPERTY_NAME = "minCardinality"; /* from SchemaAttribute entity */ public static final String DEFAULT_VALUE_OVERRIDE_PROPERTY_NAME = "defaultValueOverride"; /* from SchemaAttribute entity */ public static final String ALLOWS_DUPLICATES_PROPERTY_NAME = "allowsDuplicateValues"; /* from SchemaAttribute entity */ public static final String ORDERED_VALUES_PROPERTY_NAME = "orderedValues"; /* from SchemaAttribute entity */ public static final String NATIVE_CLASS_PROPERTY_NAME = "nativeClass"; /* from SchemaAttribute entity */ public static final String ALIASES_PROPERTY_NAME = "aliases"; /* from SchemaAttribute entity */ public static final String SORT_ORDER_PROPERTY_NAME = "sortOrder"; /* from SchemaAttribute entity */ public static final String MIN_LENGTH_PROPERTY_NAME = "minimumLength"; /* from SchemaAttribute entity */ public static final String LENGTH_PROPERTY_NAME = "length"; /* from SchemaAttribute entity */ public static final String SIGNIFICANT_DIGITS_PROPERTY_NAME = "significantDigits"; /* from SchemaAttribute entity */ public static final String PRECISION_PROPERTY_NAME = "precision"; /* from SchemaAttribute entity */ public static final String IS_NULLABLE_PROPERTY_NAME = "isNullable"; /* from SchemaAttribute entity */ public static final String ATTRIBUTE_TO_TYPE_RELATIONSHIP_TYPE_GUID = "2d955049-e59b-45dd-8e62-cde1add59f9e"; /* from Area 5 */ public static final String ATTRIBUTE_TO_TYPE_RELATIONSHIP_TYPE_NAME = "SchemaAttributeType"; /* End1 = SchemaAttribute; End 2 = SchemaType */ public static final String DATA_ITEM_SORT_ORDER_TYPE_GUID = "aaa4df8f-1aca-4de8-9abd-1ef2aadba300"; /* from Area 5 */ public static final String DATA_ITEM_SORT_ORDER_TYPE_NAME = "DataItemSortOrder"; public static final String NESTED_ATTRIBUTE_RELATIONSHIP_TYPE_GUID = "0ffb9d87-7074-45da-a9b0-ae0859611133"; /* from Area 5 */ public static final String NESTED_ATTRIBUTE_RELATIONSHIP_TYPE_NAME = "NestedSchemaAttribute"; /* End1 = SchemaAttribute; End 2 = SchemaAttribute */ public static final String TYPE_EMBEDDED_ATTRIBUTE_CLASSIFICATION_TYPE_GUID = "e2bb76bb-774a-43ff-9045-3a05f663d5d9"; /* from Area 5 */ public static final String TYPE_EMBEDDED_ATTRIBUTE_CLASSIFICATION_TYPE_NAME = "TypeEmbeddedAttribute"; /* Linked to SchemaAttribute */ public static final String TYPE_NAME_PROPERTY_NAME = "schemaTypeName"; /* from TypeEmbeddedAttribute classification */ /* For Schema Link */ public static final String SCHEMA_LINK_TYPE_GUID = "67e08705-2d2a-4df6-9239-1818161a41e0"; /* from Area 5 */ public static final String SCHEMA_LINK_TYPE_NAME = "SchemaLinkElement"; /* SchemaElement */ public static final String LINK_NAME_PROPERTY_NAME = "linkName"; /* from SchemaAttribute entity */ public static final String LINK_PROPERTIES_PROPERTY_NAME = "linkProperties"; /* from SchemaAttribute entity */ public static final String LINK_TO_TYPE_RELATIONSHIP_TYPE_GUID = "292125f7-5660-4533-a48a-478c5611922e"; /* from Area 5 */ public static final String LINK_TO_TYPE_RELATIONSHIP_TYPE_NAME = "LinkedType"; /* End1 = SchemaLinkElement; End 2 = SchemaType */ public static final String ATTRIBUTE_TO_LINK_RELATIONSHIP_TYPE_GUID = "db9583c5-4690-41e5-a580-b4e30a0242d3"; /* from Area 5 */ public static final String ATTRIBUTE_TO_LINK_RELATIONSHIP_TYPE_NAME = "SchemaLinkToType"; /* End1 = SchemaAttribute; End 2 = SchemaLinkElement */ public static final String SCHEMA_QUERY_TARGET_RELATIONSHIP_TYPE_GUID = "1c2622b7-ac21-413c-89e1-6f61f348cd19"; /* from Area 5 */ public static final String SCHEMA_QUERY_TARGET_RELATIONSHIP_TYPE_NAME = "DerivedSchemaTypeQueryTarget"; /* End1 = SchemaElement; End 2 = SchemaElement (target) */ public static final String QUERY_ID_PROPERTY_NAME = "queryId"; /* from DerivedSchemaTypeQueryTarget relationship */ public static final String QUERY_PROPERTY_NAME = "query"; /* from DerivedSchemaTypeQueryTarget relationship */ /* - Known Subtypes ------------------------------------------------------- */ public static final String ARRAY_SCHEMA_TYPE_TYPE_GUID = "ba8d29d2-a8a4-41f3-b29f-91ad924dd944"; /* from Area 5 */ public static final String ARRAY_SCHEMA_TYPE_TYPE_NAME = "ArraySchemaType"; /* BoundedSchemaType */ public static final String SET_SCHEMA_TYPE_TYPE_GUID = "b2605d2d-10cd-443c-b3e8-abf15fb051f0"; /* from Area 5 */ public static final String SET_SCHEMA_TYPE_TYPE_NAME = "SetSchemaType"; /* BoundedSchemaType */ public static final String PORT_SCHEMA_RELATIONSHIP_TYPE_GUID = "B216fA00-8281-F9CC-9911-Ae6377f2b457"; /* from Area 5 */ public static final String PORT_SCHEMA_RELATIONSHIP_TYPE_NAME = "PortSchema"; /* End1 = Port; End 2 = SchemaType */ public static final String TABULAR_SCHEMA_TYPE_TYPE_GUID = "248975ec-8019-4b8a-9caf-084c8b724233"; /* from Area 5 */ public static final String TABULAR_SCHEMA_TYPE_TYPE_NAME = "TabularSchemaType"; /* ComplexSchemaType */ public static final String TABULAR_COLUMN_TYPE_GUID = "d81a0425-4e9b-4f31-bc1c-e18c3566da10"; /* from Area 5 */ public static final String TABULAR_COLUMN_TYPE_NAME = "TabularColumn"; /* PrimitiveSchemaType */ public static final String TABULAR_FILE_COLUMN_TYPE_GUID = "af6265e7-5f58-4a9c-9ae7-8d4284be62bd"; /* from Area 5 */ public static final String TABULAR_FILE_COLUMN_TYPE_NAME = "TabularFileColumn"; /* TabularColumn */ public static final String DOCUMENT_SCHEMA_TYPE_TYPE_GUID = "33da99cd-8d04-490c-9457-c58908da7794"; /* from Area 5 */ public static final String DOCUMENT_SCHEMA_TYPE_TYPE_NAME = "DocumentSchemaType"; /* ComplexSchemaType */ public static final String DOCUMENT_SCHEMA_ATTRIBUTE_TYPE_GUID = "b5cefb7e-b198-485f-a1d7-8e661012499b"; /* from Area 5 */ public static final String DOCUMENT_SCHEMA_ATTRIBUTE_TYPE_NAME = "DocumentSchemaAttribute"; /* SchemaAttribute */ public static final String SIMPLE_DOCUMENT_TYPE_TYPE_GUID = "42cfccbf-cc68-4980-8c31-0faf1ee002d3"; /* from Area 5 */ public static final String SIMPLE_DOCUMENT_TYPE_TYPE_NAME = "SimpleDocumentType"; /* PrimitiveSchemaType */ public static final String STRUCT_DOCUMENT_TYPE_TYPE_GUID = "f6245c25-8f73-45eb-8fb5-fa17a5f27649"; /* from Area 5 */ public static final String STRUCT_DOCUMENT_TYPE_TYPE_NAME = "StructDocumentType"; /* StructSchemaType */ public static final String MAP_DOCUMENT_TYPE_TYPE_GUID = "b0f09598-ceb6-415b-befc-563ecadd5727"; /* from Area 5 */ public static final String MAP_DOCUMENT_TYPE_TYPE_NAME = "MapDocumentType"; /* MapSchemaType */ public static final String OBJECT_SCHEMA_TYPE_TYPE_GUID = "6920fda1-7c07-47c7-84f1-9fb044ae153e"; /* from Area 5 */ public static final String OBJECT_SCHEMA_TYPE_TYPE_NAME = "ObjectSchemaType"; /* ComplexSchemaType */ public static final String OBJECT_SCHEMA_ATTRIBUTE_TYPE_GUID = "ccb408c0-582e-4a3a-a926-7082d53bb669"; /* from Area 5 */ public static final String OBJECT_SCHEMA_ATTRIBUTE_TYPE_NAME = "ObjectSchemaAttribute"; /* SchemaAttribute */ public static final String GRAPH_SCHEMA_TYPE_TYPE_GUID = "983c5e72-801b-4e42-bc51-f109527f2317"; /* from Area 5 */ public static final String GRAPH_SCHEMA_TYPE_TYPE_NAME = "GraphSchemaType"; /* ComplexSchemaType */ public static final String GRAPH_VERTEX_TYPE_GUID = "1252ce12-540c-4724-ad70-f70940956de0"; /* from Area 5 */ public static final String GRAPH_VERTEX_TYPE_NAME = "GraphVertex"; /* SchemaAttribute */ public static final String GRAPH_EDGE_TYPE_GUID = "d4104eb3-4f2d-4d83-aca7-e58dd8d5e0b1"; /* from Area 5 */ public static final String GRAPH_EDGE_TYPE_NAME = "GraphEdge"; /* SchemaAttribute */ /* For Graph Edge/Vertex */ public static final String GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_GUID = "503b4221-71c8-4ba9-8f3d-6a035b27971c"; /* from Area 5 */ public static final String GRAPH_EDGE_LINK_RELATIONSHIP_TYPE_NAME = "GraphEdgeLink"; /* End1 = GraphEdge; End 2 = GraphVertex */ public static final String RELATIONAL_DB_SCHEMA_TYPE_TYPE_GUID = "f20f5f45-1afb-41c1-9a09-34d8812626a4"; /* from Area 5 */ public static final String RELATIONAL_DB_SCHEMA_TYPE_TYPE_NAME = "RelationalDBSchemaType"; /* ComplexSchemaType */ public static final String RELATIONAL_TABLE_TYPE_TYPE_GUID = "1321bcc0-dc6a-48ed-9ca6-0c6f934b0b98"; /* from Area 5 */ public static final String RELATIONAL_TABLE_TYPE_TYPE_NAME = "RelationalTableType"; /* TabularSchemaType */ public static final String RELATIONAL_TABLE_TYPE_GUID = "ce7e72b8-396a-4013-8688-f9d973067425"; /* from Area 5 */ public static final String RELATIONAL_TABLE_TYPE_NAME = "RelationalTable"; /* SchemaAttribute */ public static final String CALCULATED_VALUE_CLASSIFICATION_TYPE_GUID = "4814bec8-482d-463d-8376-160b0358e139"; public static final String CALCULATED_VALUE_CLASSIFICATION_TYPE_NAME = "CalculatedValue"; /* Linked to SchemaType */ public static final String RELATIONAL_COLUMN_TYPE_GUID = "aa8d5470-6dbc-4648-9e2f-045e5df9d2f9"; /* from Area 5 */ public static final String RELATIONAL_COLUMN_TYPE_NAME = "RelationalColumn"; /* TabularColumn */ public static final String PRIMARY_KEY_CLASSIFICATION_TYPE_GUID = "b239d832-50bd-471b-b17a-15a335fc7f40"; public static final String PRIMARY_KEY_CLASSIFICATION_TYPE_NAME = "PrimaryKey"; /* Linked to RelationalColumn */ public static final String PRIMARY_KEY_PATTERN_PROPERTY_NAME = "keyPattern"; /* from PrimaryKey classification */ public static final String PRIMARY_KEY_NAME_PROPERTY_NAME = "name"; /* from PrimaryKey classification */ public static final String FOREIGN_KEY_RELATIONSHIP_TYPE_GUID = "3cd4e0e7-fdbf-47a6-ae88-d4b3205e0c07"; /* from Area 5 */ public static final String FOREIGN_KEY_RELATIONSHIP_TYPE_NAME = "ForeignKey"; /* End1 = RelationalColumn; End 2 = RelationalColumn */ public static final String FOREIGN_KEY_NAME_PROPERTY_NAME = "name"; /* from ForeignKey relationship */ public static final String FOREIGN_KEY_DESCRIPTION_PROPERTY_NAME = "description"; /* from ForeignKey relationship */ public static final String FOREIGN_KEY_CONFIDENCE_PROPERTY_NAME = "confidence"; /* from ForeignKey relationship */ public static final String FOREIGN_KEY_STEWARD_PROPERTY_NAME = "steward"; /* from ForeignKey relationship */ public static final String FOREIGN_KEY_SOURCE_PROPERTY_NAME = "source"; /* from ForeignKey relationship */ /* For Event Types */ public static final String EVENT_TYPE_LIST_TYPE_GUID = "77ccda3d-c4c6-464c-a424-4b2cb27ac06c"; /* from Area 5 */ public static final String EVENT_TYPE_LIST_TYPE_NAME = "EventTypeList"; /* ComplexSchemaType */ public static final String EVENT_TYPE_TYPE_GUID = "bead9aa4-214a-4596-8036-aa78395bbfb1"; /* from Area 5 */ public static final String EVENT_TYPE_TYPE_NAME = "EventType"; /* ComplexSchemaType */ public static final String EVENT_SCHEMA_ATTRIBUTE_TYPE_GUID = "5be4ee8f-4d0c-45cd-a411-22a468950342"; /* from Area 5 */ public static final String EVENT_SCHEMA_ATTRIBUTE_TYPE_NAME = "EventSchemaAttribute"; /* SchemaAttribute */ public static final String EVENT_SET_TYPE_GUID = "8bc88aba-d7e4-4334-957f-cfe8e8eadc32"; /* from Area 5 */ public static final String EVENT_SET_TYPE_NAME = "EventSet"; /* Collection */ /* For API Schema Type */ public static final String API_SCHEMA_TYPE_TYPE_GUID = "b46cddb3-9864-4c5d-8a49-266b3fc95cb8"; /* from Area 5 */ public static final String API_SCHEMA_TYPE_TYPE_NAME = "APISchemaType"; /* SchemaType */ public static final String API_OPERATION_TYPE_GUID = "f1c0af19-2729-4fac-996e-a7badff3c21c"; /* from Area 5 */ public static final String API_OPERATION_TYPE_NAME = "APIOperation"; /* SchemaType */ public static final String API_PARAMETER_LIST_TYPE_GUID = "ba167b12-969f-49d3-8bea-d04228d9a44b"; /* from Area 5 */ public static final String API_PARAMETER_LIST_TYPE_NAME = "APIParameterList"; /* ComplexSchemaType */ public static final String ENCODING_PROPERTY_NAME = "encoding"; /* from APIParameter and APIParameterList entities */ public static final String REQUIRED_PROPERTY_NAME = "required"; /* from APIParameterList entity */ public static final String PARAMETER_TYPE_PROPERTY_NAME = "parameterType"; /* from APIParameter entity */ public static final String API_PARAMETER_TYPE_GUID = "10277b13-509c-480e-9829-bc16d0eafc53"; /* from Area 5 */ public static final String API_PARAMETER_TYPE_NAME = "APIParameter"; /* SchemaAttribute */ public static final String API_OPERATIONS_RELATIONSHIP_TYPE_GUID = "03737169-ceb5-45f0-84f0-21c5929945af"; /* from Area 5 */ public static final String API_OPERATIONS_RELATIONSHIP_TYPE_NAME = "APIOperations"; /* End1 = APISchemaType; End 2 = APIOperation */ public static final String API_HEADER_RELATIONSHIP_TYPE_GUID = "e8fb46d1-5f75-481b-aa66-f43ad44e2cc6"; /* from Area 5 */ public static final String API_HEADER_RELATIONSHIP_TYPE_NAME = "APIHeader"; /* End1 = APIOperation; End 2 = SchemaType */ public static final String API_REQUEST_RELATIONSHIP_TYPE_GUID = "4ab3b466-31bd-48ea-8aa2-75623476f2e2"; /* from Area 5 */ public static final String API_REQUEST_RELATIONSHIP_TYPE_NAME = "APIRequest"; /* End1 = APIOperation; End 2 = SchemaType */ public static final String API_RESPONSE_RELATIONSHIP_TYPE_GUID = "e8001de2-1bb1-442b-a66f-9addc3641eae"; /* from Area 5 */ public static final String API_RESPONSE_RELATIONSHIP_TYPE_NAME = "APIResponse"; /* End1 = APIOperation; End 2 = SchemaType */ public static final String REFERENCEABLE_TO_REFERENCE_VALUE_TYPE_GUID = "111e6d2e-94e9-43ed-b4ed-f0d220668cbf"; public static final String REFERENCEABLE_TO_REFERENCE_VALUE_TYPE_NAME = "ReferenceValueAssignment"; /* End1 = Referenceable; End 2 = ValidValueDefinition */ public static final String DISPLAY_DATA_SCHEMA_TYPE_TYPE_GUID = "2f5796f5-3fac-4501-9d0d-207aa8620d16"; /* from Area 5 */ public static final String DISPLAY_DATA_SCHEMA_TYPE_TYPE_NAME = "DisplayDataSchemaType"; /* ComplexSchemaType */ public static final String DISPLAY_DATA_CONTAINER_TYPE_GUID = "f2a4ff99-1954-48c0-8081-92d1a4dfd910"; /* from Area 5 */ public static final String DISPLAY_DATA_CONTAINER_TYPE_NAME = "DisplayDataContainer"; /* SchemaAttribute */ public static final String DISPLAY_DATA_FIELD_TYPE_GUID = "46f9ea33-996e-4c62-a67d-803df75ef9d4"; /* from Area 5 */ public static final String DISPLAY_DATA_FIELD_TYPE_NAME = "DisplayDataField"; /* SchemaAttribute */ public static final String INPUT_FIELD_PROPERTY_NAME = "inputField"; /* from DisplayDataField entity */ public static final String QUERY_SCHEMA_TYPE_TYPE_GUID = "4d11bdbb-5d4a-488b-9f16-bf1e34d34dd9"; /* from Area 5 */ public static final String QUERY_SCHEMA_TYPE_TYPE_NAME = "QuerySchemaType"; /* ComplexSchemaType */ public static final String QUERY_DATA_CONTAINER_TYPE_GUID = "0eb92215-52b1-4fac-92e7-ff02ff385a68"; /* from Area 5 */ public static final String QUERY_DATA_CONTAINER_TYPE_NAME = "QueryDataContainer"; /* SchemaAttribute */ public static final String QUERY_DATA_FIELD_TYPE_GUID = "0eb92215-52b1-4fac-92e7-ff02ff385a68"; /* from Area 5 */ public static final String QUERY_DATA_FIELD_TYPE_NAME = "QueryDataField"; /* SchemaAttribute */ public static final String VALID_VALUE_DEFINITION_TYPE_GUID = "09b2133a-f045-42cc-bb00-ee602b74c618"; /* from Area 5 */ public static final String VALID_VALUE_DEFINITION_TYPE_NAME = "ValidValueDefinition"; /* Referenceable */ public static final String VALID_VALUE_DISPLAY_NAME_PROPERTY_NAME = "name"; /* from ValidValueDefinition entity */ public static final String VALID_VALUE_DESCRIPTION_PROPERTY_NAME = "description"; /* from ValidValueDefinition entity */ public static final String VALID_VALUE_SCOPE_PROPERTY_NAME = "scope"; /* from ValidValueDefinition entity */ public static final String PREFERRED_VALUE_PROPERTY_NAME = "preferredValue"; /* from ValidValueDefinition entity */ public static final String VALID_VALUE_SET_TYPE_GUID = "7de10805-7c44-40e3-a410-ffc51306801b"; /* from Area 5 */ public static final String VALID_VALUE_SET_TYPE_NAME = "ValidValuesSet"; /* ValidValueDefinition */ public static final String REFERENCE_DATA_CLASSIFICATION_TYPE_GUID = "55e5ae33-39c6-4834-9d05-ef0ae4e0163b"; /* from Area 5 */ public static final String REFERENCE_DATA_CLASSIFICATION_TYPE_NAME = "ReferenceData"; /* Linked to Asset */ public static final String INSTANCE_METADATA_CLASSIFICATION_TYPE_GUID = "e6d5c097-a5e9-4bc4-a614-2506276059af"; /* from Area 5 */ public static final String INSTANCE_METADATA_CLASSIFICATION_TYPE_NAME = "InstanceMetadata"; /* Linked to SchemaElement */ public static final String INSTANCE_METADATA_TYPE_NAME_PROPERTY_NAME = "typeName"; /* from InstanceMetadata classification */ public static final String VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_GUID = "c5d48b73-eadd-47db-ab64-3be99b2fb32d"; /* from Area 5 */ public static final String VALID_VALUES_ASSIGNMENT_RELATIONSHIP_TYPE_NAME = "ValidValuesAssignment"; /* End1 = Referenceable; End 2 = ValidValuesDefinition */ public static final String IS_STRICT_REQUIREMENT_PROPERTY_NAME = "strictRequirement"; /* from ValidValuesAssignment relationship */ public static final String VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_GUID = "6337c9cd-8e5a-461b-97f9-5151bcb97a9e"; /* from Area 5 */ public static final String VALID_VALUES_MEMBER_RELATIONSHIP_TYPE_NAME = "ValidValueMember"; /* End1 = ValidValuesSet; End 2 = ValidValuesDefinition */ public static final String VALID_VALUES_IMPL_RELATIONSHIP_TYPE_GUID = "d9a39553-6a47-4477-a217-844300c07cf2"; /* from Area 5 */ public static final String VALID_VALUES_IMPL_RELATIONSHIP_TYPE_NAME = "ValidValuesImplementation"; /* End1 = ValidValuesDefinition; End 2 = Asset */ public static final String SYMBOLIC_NAME_PROPERTY_NAME = "symbolicName"; /* from ValidValuesImplementation relationship */ public static final String IMPLEMENTATION_VALUE_PROPERTY_NAME = "implementationValue"; /* from ValidValuesImplementation relationship */ public static final String ADDITIONAL_VALUES_PROPERTY_NAME = "additionalValues"; /* from ValidValuesImplementation relationship */ public static final String VALID_VALUES_MAP_RELATIONSHIP_TYPE_GUID = "203ce62c-3cbf-4542-bf82-81820cba718f"; /* from Area 5 */ public static final String VALID_VALUES_MAP_RELATIONSHIP_TYPE_NAME = "ValidValuesMapping"; /* End1 = ValidValuesDefinition; End 2 = ValidValuesDefinition */ public static final String VALID_VALUES_ASSOCIATION_DESCRIPTION_PROPERTY_NAME = "associationDescription"; /* from ValidValuesMapping relationship */ public static final String VALID_VALUES_CONFIDENCE_PROPERTY_NAME = "confidence"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ public static final String VALID_VALUES_STEWARD_PROPERTY_NAME = "steward"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ public static final String VALID_VALUES_NOTES_PROPERTY_NAME = "notes"; /* from ValidValuesMapping and ReferenceValueAssignment relationship */ public static final String REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_GUID = "111e6d2e-94e9-43ed-b4ed-f0d220668cbf"; /* from Area 5 */ public static final String REFERENCE_VALUE_ASSIGNMENT_RELATIONSHIP_TYPE_NAME = "ReferenceValueAssignment"; /* End1 = Referenceable; End 2 = ValidValuesDefinition */ /* ============================================================================================================================*/ /* Area 6 - Discovery */ /* ============================================================================================================================*/ public static final String DISCOVERY_ENGINE_TYPE_GUID = "be650674-790b-487a-a619-0a9002488055"; public static final String DISCOVERY_ENGINE_TYPE_NAME = "OpenDiscoveryEngine"; /* GovernanceEngine */ public static final String DISCOVERY_SERVICE_TYPE_GUID = "2f278dfc-4640-4714-b34b-303e84e4fc40"; public static final String DISCOVERY_SERVICE_TYPE_NAME = "OpenDiscoveryService"; /* GovernanceService */ public static final String DISCOVERY_PIPELINE_TYPE_GUID = "081abe00-740e-4143-b0d5-a1f55450fc22"; public static final String DISCOVERY_PIPELINE_TYPE_NAME = "OpenDiscoveryPipeline"; /* GovernanceService */ public static final String CONNECTION_TO_ASSET_TYPE_GUID = "e777d660-8dbe-453e-8b83-903771f054c0"; public static final String CONNECTION_TO_ASSET_TYPE_NAME = "ConnectionToAsset"; /* End1 = Connection; End 2 = Asset */ public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_GUID = "acc7cbc8-09c3-472b-87dd-f78459323dcb"; public static final String DISCOVERY_ANALYSIS_REPORT_TYPE_NAME = "OpenDiscoveryAnalysisReport"; /* Referenceable */ public static final String EXECUTION_DATE_PROPERTY_NAME = "executionDate"; /* from OpenDiscoveryAnalysisReport entity */ public static final String ANALYSIS_PARAMS_PROPERTY_NAME = "analysisParameters"; /* from OpenDiscoveryAnalysisReport entity */ public static final String ANALYSIS_STEP_PROPERTY_NAME = "discoveryRequestStep"; /* from OpenDiscoveryAnalysisReport entity */ public static final String DISCOVERY_SERVICE_STATUS_PROPERTY_NAME = "discoveryServiceStatus"; /* from OpenDiscoveryAnalysisReport entity */ public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_GUID = "b2fdeddd-24eb-4e9c-a2a4-2693828d4a69"; public static final String DISCOVERY_REQUEST_STATUS_ENUM_TYPE_NAME = "DiscoveryServiceRequestStatus"; public static final String REPORT_TO_ASSET_TYPE_GUID = "7eded424-f176-4258-9ae6-138a46b2845f"; /* from Area 6 */ public static final String REPORT_TO_ASSET_TYPE_NAME = "AssetDiscoveryReport"; /* End1 = Asset; End 2 = OpenDiscoveryAnalysisReport */ public static final String REPORT_TO_ENGINE_TYPE_GUID = "2c318c3a-5dc2-42cd-a933-0087d852f67f"; /* from Area 6 */ public static final String REPORT_TO_ENGINE_TYPE_NAME = "DiscoveryEngineReport"; /* End1 = OpenDiscoveryEngine; End 2 = OpenDiscoveryAnalysisReport */ public static final String REPORT_TO_SERVICE_TYPE_GUID = "1744d72b-903d-4273-9229-de20372a17e2"; /* from Area 6 */ public static final String REPORT_TO_SERVICE_TYPE_NAME = "DiscoveryInvocationReport"; /* End1 = OpenDiscoveryService; End 2 = OpenDiscoveryAnalysisReport */ public static final String REPORT_TO_ANNOTATIONS_TYPE_GUID = "51d386a3-3857-42e3-a3df-14a6cad08b93"; /* from Area 6 */ public static final String REPORT_TO_ANNOTATIONS_TYPE_NAME = "DiscoveredAnnotation"; /* End1 = Annotation; End 2 = OpenDiscoveryAnalysisReport */ public static final String ANNOTATION_TYPE_GUID = "6cea5b53-558c-48f1-8191-11d48db29fb4"; public static final String ANNOTATION_TYPE_NAME = "Annotation"; public static final String ANNOTATION_TYPE_PROPERTY_NAME = "annotationType"; /* from Annotation entity */ public static final String EXPLANATION_PROPERTY_NAME = "explanation"; /* from Annotation entity */ public static final String JSON_PROPERTIES_PROPERTY_NAME = "jsonProperties"; /* from Annotation entity */ public static final String ANNOTATION_TO_EXTENSION_TYPE_GUID = "605aaa6d-682e-405c-964b-ca6aaa94be1b"; /* from Area 6 */ public static final String ANNOTATION_TO_EXTENSION_TYPE_NAME = "Annotation"; /* End1 = (extended)Annotation; End 2 = Annotation(Extension) */ /* For AnnotationReview entity */ public static final String ANNOTATION_REVIEW_TYPE_GUID = "b893d6fc-642a-454b-beaf-809ee4dd876a"; public static final String ANNOTATION_REVIEW_TYPE_NAME = "AnnotationReview"; public static final String REVIEW_DATE_PROPERTY_NAME = "reviewDate"; /* from AnnotationReview entity */ public static final String COMMENT_PROPERTY_NAME = "comment"; /* from AnnotationReview entity */ /* For AnnotationReviewLink relationship */ public static final String ANNOTATION_REVIEW_LINK_TYPE_GUID = "5d3c2fb7-fa04-4d77-83cb-fd9216a07769"; public static final String ANNOTATION_REVIEW_LINK_TYPE_NAME = "AnnotationReviewLink"; /* End1 = Annotation; End 2 = AnnotationReview */ public static final String ANNOTATION_STATUS_PROPERTY_NAME = "annotationStatus"; /* from AnnotationReviewLink relationship */ /* Enum Type AnnotationStatus */ /* For SchemaAnalysisAnnotation entity */ public static final String SCHEMA_ANALYSIS_ANNOTATION_TYPE_GUID = "3c5aa68b-d562-4b04-b189-c7b7f0bf2ced"; public static final String SCHEMA_ANALYSIS_ANNOTATION_TYPE_NAME = "SchemaAnalysisAnnotation"; public static final String SCHEMA_NAME_PROPERTY_NAME = "schemaName"; /* from SchemaAnalysisAnnotation entity */ public static final String SCHEMA_TYPE_PROPERTY_NAME = "schemaType"; /* from SchemaAnalysisAnnotation entity */ /* For DataField entity */ public static final String DATA_FIELD_TYPE_GUID = "3c5bbc8b-d562-4b04-b189-c7b7f0bf2cea"; public static final String DATA_FIELD_TYPE_NAME = "DataField"; public static final String DATA_FIELD_NAME_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ public static final String DATA_FIELD_TYPE_PROPERTY_NAME = "dataFieldType"; /* from DataField entity */ public static final String DATA_FIELD_DESCRIPTION_PROPERTY_NAME = "dataFieldDescription"; /* from DataField entity */ public static final String DATA_FIELD_ALIASES_PROPERTY_NAME = "dataFieldAliases"; /* from DataField entity */ public static final String DATA_FIELD_SORT_ORDER_PROPERTY_NAME = "dataFieldName"; /* from DataField entity */ /* For DiscoveredDataField relationship */ public static final String DISCOVERED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e22222cd54"; public static final String DISCOVERED_DATA_FIELD_TYPE_NAME = "DiscoveredDataField"; /* End1 = SchemaAnalysisAnnotation; End 2 = DataField */ /* For DiscoveredDataField relationship */ public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_GUID = "60f2d263-e24d-4f20-8c0d-b5e12356cd54"; public static final String DISCOVERED_NESTED_DATA_FIELD_TYPE_NAME = "DiscoveredNestedDataField"; /* End1 = (parent)DataField; End 2 = DataField */ public static final String DATA_FIELD_POSITION_PROPERTY_NAME = "dataFieldPosition"; /* from DiscoveredDataField and DiscoveredNestedDataField relationship */ /* For DataFieldAnnotation entity */ public static final String DATA_FIELD_ANNOTATION_TYPE_GUID = "72ed6de6-79d9-4e7d-aefc-b969382fc4b0"; public static final String DATA_FIELD_ANNOTATION_TYPE_NAME = "DataFieldAnnotation"; /* Annotation */ /* For DataFieldAnalysis relationship */ public static final String DATA_FIELD_ANALYSIS_TYPE_GUID = "833e849d-eda2-40bb-9e6b-c3ca0b56d581"; public static final String DATA_FIELD_ANALYSIS_TYPE_NAME = "DataFieldAnalysis"; /* End1 = DataFieldAnnotation; End 2 = DataField */ /* For ClassificationAnnotation entity */ public static final String CLASSIFICATION_ANNOTATION_TYPE_GUID = "23e8287f-5c7e-4e03-8bd3-471fc7fc029c"; public static final String CLASSIFICATION_ANNOTATION_TYPE_NAME = "ClassificationAnnotation"; /* DataFieldAnnotation */ public static final String CANDIDATE_CLASSIFICATIONS_PROPERTY_NAME = "candidateClassifications"; /* from ClassificationAnnotation entity */ /* For DataProfileAnnotation entity */ public static final String DATA_PROFILE_ANNOTATION_TYPE_GUID = "bff1f694-afd0-4829-ab11-50a9fbaf2f5f"; public static final String DATA_PROFILE_ANNOTATION_TYPE_NAME = "DataProfileAnnotation"; /* DataFieldAnnotation */ public static final String INFERRED_DATA_TYPE_PROPERTY_NAME = "inferredDataType"; /* from DataProfileAnnotation entity */ public static final String INFERRED_FORMAT_PROPERTY_NAME = "inferredFormat"; /* from DataProfileAnnotation entity */ public static final String INFERRED_LENGTH_PROPERTY_NAME = "inferredLength"; /* from DataProfileAnnotation entity */ public static final String INFERRED_PRECISION_PROPERTY_NAME = "inferredPrecision"; /* from DataProfileAnnotation entity */ public static final String INFERRED_SCALE_PROPERTY_NAME = "inferredScale"; /* from DataProfileAnnotation entity */ public static final String PROFILE_PROPERTIES_PROPERTY_NAME = "profileProperties"; /* from DataProfileAnnotation entity */ public static final String PROFILE_FLAGS_PROPERTY_NAME = "profileFlags"; /* from DataProfileAnnotation entity */ public static final String PROFILE_COUNTS_PROPERTY_NAME = "profileCounts"; /* from DataProfileAnnotation entity */ public static final String VALUE_LIST_PROPERTY_NAME = "valueList"; /* from DataProfileAnnotation entity */ public static final String VALUE_COUNT_PROPERTY_NAME = "valueCount"; /* from DataProfileAnnotation entity */ public static final String VALUE_RANGE_FROM_PROPERTY_NAME = "valueRangeTo"; /* from DataProfileAnnotation entity */ public static final String VALUE_RANGE_TO_PROPERTY_NAME = "valueRangeTo"; /* from DataProfileAnnotation entity */ public static final String AVERAGE_VALUE_PROPERTY_NAME = "averageValue"; /* from DataProfileAnnotation entity */ /* For DataProfileLogAnnotation entity */ public static final String DATA_PROFILE_LOG_ANNOTATION_TYPE_GUID = "368e6fb3-7323-4f81-a723-5182491594bd"; public static final String DATA_PROFILE_LOG_ANNOTATION_TYPE_NAME = "DataProfileLogAnnotation"; /* DataFieldAnnotation */ /* For DiscoveredDataField relationship */ public static final String DATA_PROFILE_LOG_FILE_TYPE_GUID = "75026fac-f9e5-4da8-9ad1-e9c68d47f577"; public static final String DATA_PROFILE_LOG_FILE_TYPE_NAME = "DataProfileLogFile"; /* End1 = DataProfileLogAnnotation; End 2 = LogFile */ /* For DataClassAnnotation entity */ public static final String DATA_CLASS_ANNOTATION_TYPE_GUID = "0c8a3673-04ef-406f-899d-e88de67f6176"; public static final String DATA_CLASS_ANNOTATION_TYPE_NAME = "DataClassAnnotation"; /* DataFieldAnnotation */ public static final String CANDIDATE_DATA_CLASS_GUIDS_PROPERTY_NAME = "candidateDataClassGUIDs"; /* from DataClassAnnotation entity */ public static final String MATCHING_VALUES_PROPERTY_NAME = "matchingValues"; /* from DataClassAnnotation entity */ public static final String NON_MATCHING_VALUES_PROPERTY_NAME = "nonMatchingValues"; /* from DataClassAnnotation entity */ /* For SemanticAnnotation entity */ public static final String SEMANTIC_ANNOTATION_TYPE_GUID = "0b494819-28be-4604-b238-3af20963eea6"; public static final String SEMANTIC_ANNOTATION_TYPE_NAME = "SemanticAnnotation"; /* Annotation */ public static final String INFORMAL_TERM_PROPERTY_NAME = "informalTerm"; /* from SemanticAnnotation entity */ public static final String CANDIDATE_GLOSSARY_TERM_GUIDS_PROPERTY_NAME = "candidateGlossaryTermGUIDs"; /* from SemanticAnnotation entity */ public static final String INFORMAL_TOPIC_PROPERTY_NAME = "informalTopic"; /* from SemanticAnnotation entity */ public static final String CANDIDATE_GLOSSARY_CATEGORY_GUIDS_PROPERTY_NAME = "candidateGlossaryCategoryGUIDs"; /* from SemanticAnnotation entity */ /* For QualityAnnotation entity */ public static final String QUALITY_ANNOTATION_TYPE_GUID = "72e6473d-4ce0-4609-80a4-e6e949a7f520"; public static final String QUALITY_ANNOTATION_TYPE_NAME = "QualityAnnotation"; /* DataFieldAnnotation */ public static final String QUALITY_DIMENSION_PROPERTY_NAME = "qualityDimension"; /* from QualityAnnotation entity */ public static final String QUALITY_SCORE_PROPERTY_NAME = "qualityScore"; /* from QualityAnnotation entity */ /* For RelationshipAdviceAnnotation entity */ public static final String RELATIONSHIP_ADVICE_ANNOTATION_TYPE_GUID = "740f07dc-4ee8-4c2a-baba-efb55c73eb68"; public static final String RELATIONSHIP_ADVICE_ANNOTATION_TYPE_NAME = "RelationshipAdviceAnnotation"; /* DataFieldAnnotation */ public static final String RELATED_ENTITY_GUID_PROPERTY_NAME = "relatedEntityGUID"; /* from RelationshipAdviceAnnotation entity */ public static final String RELATIONSHIP_TYPE_NAME_PROPERTY_NAME = "relationshipTypeName"; /* from RelationshipAdviceAnnotation entity */ public static final String RELATIONSHIP_PROPERTIES_PROPERTY_NAME = "relationshipProperties"; /* from RelationshipAdviceAnnotation entity */ /* For SuspectDuplicateAnnotation entity */ public static final String SUSPECT_DUPLICATE_ANNOTATION_TYPE_GUID = "f703a621-4078-4c07-ab22-e7c334b94235"; public static final String SUSPECT_DUPLICATE_ANNOTATION_TYPE_NAME = "SuspectDuplicateAnnotation"; /* plus Annotation */ public static final String DUPLICATE_ANCHOR_GUIDS_PROPERTY_NAME = "duplicateAnchorGUIDs"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_PROPERTY_NAMES_PROPERTY_NAME = "matchingPropertyNames"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_CLASSIFICATION_NAMES_PROPERTY_NAME = "matchingClassificationNames"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_ATTACHMENT_GUIDS_PROPERTY_NAME = "matchingAttachmentGUIDS"; /* from SuspectDuplicateAnnotation entity */ public static final String MATCHING_RELATIONSHIP_GUIDS_PROPERTY_NAME = "matchingRelationshipGUIDs"; /* from SuspectDuplicateAnnotation entity */ /* For DivergentDuplicateAnnotation entity */ public static final String DIVERGENT_DUPLICATE_ANNOTATION_TYPE_GUID = "251e443c-dee0-47fa-8a73-1a9d511915a0"; public static final String DIVERGENT_DUPLICATE_ANNOTATION_TYPE_NAME = "DivergentDuplicateAnnotation"; /* plus Annotation */ /* For DivergentValueAnnotation entity */ public static final String DIVERGENT_VALUE_ANNOTATION_TYPE_GUID = "b86cdded-1078-4e42-b6ba-a718c2c67f62"; public static final String DIVERGENT_VALUE_ANNOTATION_TYPE_NAME = "DivergentValueAnnotation"; /* plus DivergentDuplicateAnnotation */ /* For DivergentClassificationAnnotation entity */ public static final String DIVERGENT_CLASSIFICATION_ANNOTATION_TYPE_GUID = "8efd6257-a53e-451d-abfc-8e4899c38b1f"; public static final String DIVERGENT_CLASSIFICATION_ANNOTATION_TYPE_NAME = "DivergentClassificationAnnotation"; /* plus DivergentDuplicateAnnotation */ /* For DivergentRelationshipAnnotation entity */ public static final String DIVERGENT_RELATIONSHIP_ANNOTATION_TYPE_GUID = "b6c6938a-fdc9-438f-893c-0b5b1d4a5bb3"; public static final String DIVERGENT_RELATIONSHIP_ANNOTATION_TYPE_NAME = "DivergentRelationshipAnnotation"; /* plus DivergentDuplicateAnnotation */ /* For DivergentAttachmentAnnotation entity */ public static final String DIVERGENT_ATTACHMENT_ANNOTATION_TYPE_GUID = "f3ed48bc-b0ea-4e1f-a8ab-75f9f3cf87a6"; public static final String DIVERGENT_ATTACHMENT_ANNOTATION_TYPE_NAME = "DivergentAttachmentAnnotation"; /* plus DivergentDuplicateAnnotation */ /* For DivergentAttachmentValueAnnotation entity */ public static final String DIVERGENT_ATTACHMENT_VALUE_ANNOTATION_TYPE_GUID = "e22a1ffe-bd90-4faf-b6a1-13fafb7948a2"; public static final String DIVERGENT_ATTACHMENT_VALUE_ANNOTATION_TYPE_NAME = "DivergentAttachmentValueAnnotation"; /* plus DivergentAttachmentAnnotation */ /* For DivergentAttachmentClassificationAnnotation entity */ public static final String DIVERGENT_ATTACHMENT_CLASS_ANNOTATION_TYPE_GUID = "a2a5cb74-f8e0-470f-be71-26b7e32166a6"; public static final String DIVERGENT_ATTACHMENT_CLASS_ANNOTATION_TYPE_NAME = "DivergentAttachmentClassificationAnnotation"; /* plus DivergentAttachmentAnnotation */ /* For DivergentAttachmentRelationshipAnnotation entity */ public static final String DIVERGENT_ATTACHMENT_REL_ANNOTATION_TYPE_GUID = "5613677a-865f-474e-8044-4167fa5a31b9"; public static final String DIVERGENT_ATTACHMENT_REL_ANNOTATION_TYPE_NAME = "DivergentAttachmentRelationshipAnnotation"; /* plus DivergentAttachmentAnnotation */ /* for divergent annotations */ public static final String DUPLICATE_ANCHOR_GUID_PROPERTY_NAME = "duplicateAnchorGUID"; // public static final String ATTACHMENT_GUID_PROPERTY_NAME = "attachmentGUID"; public static final String DUPLICATE_ATTACHMENT_GUID_PROPERTY_NAME = "duplicateAttachmentGUID"; public static final String DIVERGENT_PROPERTY_NAMES_PROPERTY_NAME = "divergentPropertyNames"; public static final String DIVERGENT_CLASSIFICATION_NAME_PROPERTY_NAME = "divergentClassificationName"; public static final String DIVERGENT_CLASSIFICATION_PROPERTY_NAMES_PROPERTY_NAME = "divergentClassificationPropertyNames"; public static final String DIVERGENT_RELATIONSHIP_GUID_PROPERTY_NAME = "divergentRelationshipGUID"; public static final String DIVERGENT_RELATIONSHIP_PROPERTY_NAMES_PROPERTY_NAME = "divergentRelationshipPropertyNames"; /* For DataSourceMeasurementAnnotation entity */ public static final String DATA_SOURCE_MEASUREMENT_ANNOTATION_TYPE_GUID = "c85bea73-d7af-46d7-8a7e-cb745910b1d"; public static final String DATA_SOURCE_MEASUREMENT_ANNOTATION_TYPE_NAME = "DataSourceMeasurementAnnotation"; /* plus Annotation */ public static final String DATA_SOURCE_PROPERTIES_PROPERTY_NAME = "dataSourceProperties"; /* from DataSourceMeasurementAnnotation entity */ /* For DataSourcePhysicalStatusAnnotation entity */ public static final String DS_PHYSICAL_STATUS_ANNOTATION_TYPE_GUID = "e9ba276e-6d9f-4999-a5a9-9ddaaabfae23"; public static final String DS_PHYSICAL_STATUS_ANNOTATION_TYPE_NAME = "DataSourcePhysicalStatusAnnotation"; /* plus DataSourceMeasurementAnnotation */ public static final String SOURCE_CREATE_TIME_PROPERTY_NAME = "sourceCreateTime"; /* from DataSourcePhysicalStatusAnnotation entity */ public static final String SOURCE_CREATE_TIME_PROPERTY_NAME_DEP = "createTime"; /* from DataSourcePhysicalStatusAnnotation entity */ public static final String SOURCE_UPDATE_TIME_PROPERTY_NAME = "sourceUpdateTime"; /* from DataSourcePhysicalStatusAnnotation entity */ public static final String SOURCE_UPDATE_TIME_PROPERTY_NAME_DEP = "updateTime"; /* from DataSourcePhysicalStatusAnnotation entity */ public static final String DS_PHYSICAL_SIZE_PROPERTY_NAME = "size"; /* from DataSourcePhysicalStatusAnnotation entity */ public static final String DS_PHYSICAL_ENCODING_PROPERTY_NAME = "encoding"; /* from DataSourcePhysicalStatusAnnotation entity */ /* For Request For Action Annotation entity */ public static final String REQUEST_FOR_ACTION_ANNOTATION_TYPE_GUID = "f45765a9-f3ae-4686-983f-602c348e020d"; public static final String REQUEST_FOR_ACTION_ANNOTATION_TYPE_NAME = "RequestForActionAnnotation"; /* plus DataFieldAnnotation */ public static final String DISCOVERY_ACTIVITY_PROPERTY_NAME = "discoveryActivity"; /* from RequestForActionAnnotation entity */ public static final String ACTION_REQUESTED_PROPERTY_NAME = "actionRequested"; /* from RequestForActionAnnotation entity */ public static final String ACTION_PROPERTIES_PROPERTY_NAME = "actionProperties"; /* from RequestForActionAnnotation entity */ /* For Discovery Activity relationship */ public static final String DISCOVERY_ACTIVITY_TYPE_GUID = "6cea5b53-558c-48f1-8191-11d48db29fb4"; public static final String DISCOVERY_ACTIVITY_TYPE_NAME = "DiscoveryActivity"; /* End1 = RequestForActionAnnotation; End 2 = RequestForAction */ /* ============================================================================================================================*/ /* Area 7 - Lineage */ /* ============================================================================================================================*/ public static final String DATA_FLOW_TYPE_GUID = "d2490c0c-06cc-458a-add2-33cf2f5dd724"; public static final String DATA_FLOW_TYPE_NAME = "DataFlow"; /* End1 = Referenceable - supplier; End 2 = Referenceable - consumer */ public static final String CONTROL_FLOW_TYPE_GUID = "35450726-1c32-4d41-b928-22db6d1ae2f4"; public static final String CONTROL_FLOW_TYPE_NAME = "ControlFlow"; /* End1 = Referenceable - currentStep; End 2 = Referenceable - nextStep */ public static final String PROCESS_CALL_TYPE_GUID = "af904501-6347-4f52-8378-da50e8d74828"; public static final String PROCESS_CALL_TYPE_NAME = "ProcessCall"; /* End1 = Referenceable - calls; End 2 = Referenceable - calledBy */ public static final String BUSINESS_SIGNIFICANCE_CLASSIFICATION_TYPE_GUID = "085febdd-f129-4f4b-99aa-01f3e6294e9f"; public static final String BUSINESS_SIGNIFICANCE_CLASSIFICATION_TYPE_NAME = "BusinessSignificance"; /* Linked to Referenceable */ public static final String BUSINESS_CAPABILITY_GUID_PROPERTY_NAME = "businessCapabilityGUID"; /* from BusinessSignificant entity */ public static final String LINEAGE_MAPPING_TYPE_GUID = "a5991bB2-660D-A3a1-2955-fAcDA2d5F4Ff"; public static final String LINEAGE_MAPPING_TYPE_NAME = "LineageMapping"; /* End1 = Referenceable - sourceElement; End 2 = Referenceable - targetElement */ }
72.629834
184
0.68143
2dbc690561a0b300c6b3946e89c42bd2949e76d7
8,111
package patient; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Vector; import dataBase.ConnexionOracle; /*** * Une classe qui represente un patient de maniere generale (soit les informations generales sur le patient) * */ public class Patient { private int code; private String nom; private String prenom; private String sexe; private String dateNaissance; private String adresse; private String telephone; private String email; private String dateInscription; public Patient(int code, String nom, String prenom, String sexe, String dateNaissance, String adresse, String telephone, String email, String dateInscription) { this.code = code; this.nom = nom; this.prenom = String.valueOf(prenom.charAt(0)).toUpperCase().concat(prenom.substring(1).toLowerCase()); this.sexe = sexe; this.dateNaissance = dateNaissance; this.adresse = adresse; this.telephone = telephone; this.email = email; this.dateInscription = dateInscription; } /*** * Consutucteur par copie * @param patient */ public Patient(Patient patient) { this.code = patient.code; this.nom = patient.nom; this.prenom = patient.prenom; this.sexe = patient.sexe; this.dateNaissance = patient.dateNaissance; this.adresse = patient.adresse; this.telephone = patient.telephone; this.email = patient.email; } /*** * Enregistrer le patient dans la base de donnes */ public void stocker() { String sql ="INSERT INTO Patient (code, nom, prenom, sexe, dateNaiss, adresse, tel , email, dateInscri, drConsu ) VALUES (?,?,?,?,?,?,?,?,?,?)"; Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; try { requete = connection.prepareStatement(sql); requete.setString(1, String.valueOf(this.code)); requete.setString(2, this.nom.toUpperCase()); requete.setString(3, this.prenom); requete.setString(4, this.sexe); requete.setString(5, this.dateNaissance); requete.setString(6, this.adresse.toUpperCase()); requete.setString(7, this.telephone.toLowerCase()); requete.setString(8, this.email); requete.setString(9, this.dateInscription); requete.setString(10, "01/01/1900"); requete.execute(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } } /*** * Savoir si le patient est existant dans la base de donnes * @return */ public boolean existe() { String sql = "SELECT * FROM Patient WHERE code = ?"; Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; ResultSet resultat; boolean trouver = false; try { requete = connection.prepareStatement(sql); requete.setString(1, String.valueOf(code)); resultat = requete.executeQuery(); trouver = resultat.next(); resultat.close(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } return trouver; } /*** * Retourner un vecteur de patient selon un model de recherche * @param model * @return */ public static Vector<Patient> rechercherPatient(String model) { Vector<Patient> patients = new Vector<Patient>(); String sql = "SELECT * FROM Patient WHERE ".concat(model); Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; ResultSet resultat; try { requete = connection.prepareStatement(sql); resultat = requete.executeQuery(); while(resultat.next()) { Patient p = new Patient(Integer.valueOf(resultat.getString(1)), resultat.getString(2), resultat.getString(3), resultat.getString(4),resultat.getString(5), resultat.getString(6), resultat.getString(7), resultat.getString(8),resultat.getString(9)); patients.addElement(p); } resultat.close(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } if(patients.size() == 0) { patients = null; } return patients; } /*** * Modifier un patient * @param patient */ public void modifier(Patient patient) { this.nom = patient.nom; this.prenom = patient.prenom; this.sexe = patient.sexe; this.dateNaissance = patient.dateNaissance; this.adresse = patient.adresse; this.telephone = patient.telephone; this.email = patient.email; Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; String sql = "UPDATE Patient set nom = ? ,prenom = ?,sexe = ?,DateNaiss = ? , adresse = ?, tel = ?, email = ? WHERE code = ?"; try { requete = connection.prepareStatement(sql); requete.setString(1, this.getNom().toUpperCase()); requete.setString(2, this.getPrenom().toLowerCase()); requete.setString(3, this.getSexe()); requete.setString(4, this.getDateNaissance()); requete.setString(5, this.getAdresse().toUpperCase()); requete.setString(6, this.getTelephone().toLowerCase()); requete.setString(7, this.getEmail()); requete.setString(8, String.valueOf(this.getCode())); requete.execute(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } } /*** * Savoir si le dossier medical d'un patient a ete ajoute * @return */ public boolean isDossierAjoute() { String sql = "SELECT * FROM Patient WHERE code = ? AND taille is not NULL"; Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; ResultSet resultat; boolean trouver = false; try { requete = connection.prepareStatement(sql); requete.setString(1, String.valueOf(getCode())); resultat = requete.executeQuery(); trouver = resultat.next(); resultat.close(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } return trouver; } /*** * Retourner toutes les informations generales d'un patient donne par son code * @param code * @return */ public static Patient getPatient(int code) { Vector<Patient> vec = Patient.rechercherPatient("code = ".concat(String.valueOf(code))); if(vec != null) { return vec.get(0); } return null; } /*** * Retourner la date de la derniere consultation d'un patient * @return */ public String getDrConsu() { String sql = "SELECT drConsu FROM Patient WHERE code = ?"; Connection connection = ConnexionOracle.connecteBD(); PreparedStatement requete; ResultSet resultat; String date = null; try { requete = connection.prepareStatement(sql); requete.setString(1, String.valueOf(code)); resultat = requete.executeQuery(); if(resultat.next()) { date = resultat.getString("drConsu"); } resultat.close(); requete.close(); connection.close(); } catch (SQLException e) { e.printStackTrace(); } return date; } /////////////////////////////////// GETTERS ET SETTERS ///////////////////////////////////////////// public int getCode() { return code; } public String getNom() { return nom; } public void setNom(String nom) { this.nom = nom; } public String getPrenom() { return prenom; } public void setPrenom(String prenom) { this.prenom = prenom; } public String getSexe() { return sexe; } public void setSexe(String sexe) { this.sexe = sexe; } public String getDateNaissance() { return dateNaissance; } public void setDateNaissance(String dateNaissance) { this.dateNaissance = dateNaissance; } public String getAdresse() { return adresse; } public void setAdresse(String adresse) { this.adresse = adresse; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getDateInscription() { return dateInscription; } }
27.218121
147
0.665763
3b6bcdb531dc34e99c6cd5c049780a96cad497ad
1,783
package com.example.kafka.streams; import java.util.concurrent.TimeUnit; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.apache.kafka.streams.KafkaStreams; import org.apache.kafka.streams.Topology; import org.apache.kafka.streams.TopologyDescription; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.example.kafka.config.IKafkaConfigRetriever; import com.example.kafka.topology.ITopology; public abstract class BaseStreamBuilder { private final Logger logger = LoggerFactory.getLogger(BaseStreamBuilder.class); @PostConstruct public void runStream() { Topology topology = getTopologyBuilder().defineTopology(); TopologyDescription description = topology.describe(); System.out.println(description.toString()); _stream = new KafkaStreams(topology, getConfig().getProps()); _stream.setUncaughtExceptionHandler((Thread thread, Throwable throwable) -> { logger.error("Uncaught exception: " + throwable.getMessage()); // this will exit the app, forcing a restart of the container it is running in // closeStream(); // Thread.currentThread().interrupt(); // Runtime.getRuntime().exit(1); }); _stream.start(); //Graceful shutdown Runtime.getRuntime().addShutdownHook(new Thread(this::closeStream)); } @PreDestroy public void closeStream() { if (_stream == null) return; _stream.close(1, TimeUnit.SECONDS); } protected abstract IKafkaConfigRetriever getConfig(); protected abstract ITopology getTopologyBuilder(); private KafkaStreams _stream; private static final String TAG = BaseStreamBuilder.class.getName(); }
31.839286
94
0.705552
f47d73f665b8139f8b9bce34e27d13fc47d84efd
2,971
package main; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; @Component public class MyRunner implements CommandLineRunner{ //@Autowired //private EntityManager em; @Override public void run(String... args) throws Exception { /* // TODO Auto-generated method stub List<User> usersInseres = new ArrayList<User>(); String[][] users = {{"1","1", null, "[email protected]", null, "rom", "0", null}}; String[][] produits = {{"1", "MMO", "Super Mario Bros. 35 sur Switch est un jeu de plateforme en ligne dans lequel vous devez rester le dernier en vie alors que les ennemis que vous éliminez iront envahir les stages des autres joueurs. Reprenant l'univers du premier Super Mario Bros, le jeu vous permet d'utiliser la roulette d'objets et quatre stratégies différentes pour devancer vos adversaires.","1", null, "75", "65","Super Mario Bros"},{"2", "ACTION", "star wars","1", null, "87", "36","star wars"}}; String[][] commandes = {{"1", null, null, "2020-12-01", "0", null, "0", "1"}}; String[][] lignes = {{"1", "10", "1", "2"},{"2", "24", "1", "1"}}; User user; for (int i=0;i<users.length;i++) { user=new User(); user.setId(Integer.parseInt(users[i][0])); user.setAdresseMail(users[i][3]); user.setIdentifiant(users[i][4]); user.setMdp(users[i][5]); user.setAdresse(users[i][2]); user.setPointsFidelite(Integer.parseInt(users[i][6])); user.setTelephone(users[i][7]); user.setAdmin(Byte.parseByte(users[i][1])); usersInseres.add(em.merge(user)); } Produit produit; for(int j=0;j<produits.length;j++) { produit = new Produit(); produit.setId(Integer.parseInt(produits[j][0])); produit.setCategorie(Categorie.valueOf(produits[j][1])); produit.setDescription(produits[j][2]); produit.setDisponibleEnVente(Byte.parseByte(produits[j][3])); produit.setImage(produits[j][4]); produit.setPrix(Double.parseDouble(produits[j][5])); produit.setQuantite(Integer.parseInt(produits[j][6])); em.persist(produit); } Commande commande; List<Commande> commandesInserees = new ArrayList<>(); for(int k=0;k<commandes.length;k++) { commande = new Commande(); commande.setId(Integer.parseInt(commandes[k][0])); commande.setAdresseFacturation(commandes[k][1]); commande.setAdresseLivraison(commandes[k][2]); commande.setDatePassageCommande(Date.(commandes[k][3])); commande.setExpédiée(Byte.parseByte(commandes[k][4])); commande.setNumCarteBancaire(commandes[k][5]); commande.setUser(usersInseres.get(Integer.parseInt(commandes[k][6]))); em.persist(commande); } LigneCommande ligne; List<LigneCommande> lignes = new ArrayList<LigneCommande>(); for(int l=0;k<lignes.length;l++) { ligne = new LigneCommande(); ligne.setId(Integer.parseInt(lignes[l][0])); ligne.setQuantite(lignes[l][1]); ligne.setCommande(lignes[l][2]); ligne.setProduit(lignes[l][3])); em.persist(ligne); } */ } }
39.092105
509
0.684281
90c4170ebc33c81b9ed0ebc3626f4ad5e89b2b7c
652
package array; /** * Problem link: https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/ * <p> * Time complexity: O(n) * <p> * Space complexity: O(1) */ public class _167 { public int[] twoSum(int[] numbers, int target) { int start = 0; int last = numbers.length - 1; while (start < last) { int sum = numbers[start] + numbers[last]; if (sum == target) { return new int[]{start + 1, last + 1}; } if (sum < target) { start++; } else { last--; } } return null; } }
21.733333
83
0.460123
70d1723bf7a9590d3c3cf32bdf803d4cdf946ec3
9,899
/* * * Copyright (c) 2007 ANDRE Sébastien (divxdede). All rights reserved. * DefaultBusyModel.java is a part of this JBusyComponent library * ==================================================================== * * JBusyComponent library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the License, * or any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ package org.divxdede.swing.busy; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.EventListenerList; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * Default Implementation of interface <code>BusyModel</code>. * <p> * It add <code>AutoCompletion</code> feature for determinate model. * This feature allow to move the current value to the minimum range when the busy * property is set to <code>true</code>.<br> * At the other side, when the current value reach the maximum bounded range, it set * automatically the busy property to <code>false</code>. * * @author André Sébastien (divxdede) */ public class DefaultBusyModel extends DefaultBoundedRangeModel implements BusyModel { private boolean busyState = false; private boolean determinateState = false; private boolean autoCompletionState = false; private boolean cancellableState = false; private String description = null; /** * Define if the model is on a "busy" state. * This method fire an {@link ActionEvent} of {@link #START_ACTION_ID} or {@link #STOP_ACTION_ID} following by a {@link ChangeEvent} * @param value true to going in a busy state */ public void setBusy(final boolean value) { // new Exception("PASS(" + value + ")").printStackTrace(); final boolean oldValue = isBusy(); this.busyState = value; if( oldValue != isBusy() ) { if( this.isBusy() && this.isDeterminate() && this.isAutoCompletionEnabled() ) { this.setValue( getMinimum() ); } try { if( isBusy() ) this.fireActionPerformed( new ActionEvent(this,START_ACTION_ID,START_ACTION_COMMAND,System.currentTimeMillis(),0) ); else this.fireActionPerformed( new ActionEvent(this,STOP_ACTION_ID,STOP_ACTION_COMMAND,System.currentTimeMillis(),0) ); } finally { this.fireStateChanged(); } } } /** * Returns true if the model is currently on a <code>busy</code> state * @return tue if the model is currently busy */ public boolean isBusy() { return this.busyState; } /** Manage auto completion */ @Override public void setValue(final int n) { super.setValue(n); if( isDeterminate() && isAutoCompletionEnabled() && getValue() >= getMaximum() ) { setBusy(false); } } /** * Define if the model is in a <code>determinate mode</code> or not * @param value true for change this model in a determinate mode */ public void setDeterminate(final boolean value) { final boolean oldValue = isDeterminate(); this.determinateState = value; if( oldValue != isDeterminate() ) this.fireStateChanged(); } /** * Returns true if the model is in a <code>determinate mode</code>. * @return true if the model is in a determinate mode. */ public boolean isDeterminate() { return this.determinateState; } /** * Define if the range value must manage the completion automatically. * This property is significant only when this model is <code>determinate</code>. * When the <code>busy</code> property is set to true the range <code>value</code> is set to the <code>minimum</code>. * When the range <code>value</code> reach the <code>maximum</code>, the <code>busy</code> property is set to <code>false</code>. */ public void setAutoCompletionEnabled(final boolean value) { final boolean oldValue = isAutoCompletionEnabled(); this.autoCompletionState = value; if( oldValue != this.isAutoCompletionEnabled() ) this.fireStateChanged(); } /** * Returns <code>true</code> if the range value must manage the completion automatically. * This property is significant only when this model is <code>determinate</code>. * When the <code>busy</code> property is set to true the range <code>value</code> is set to the <code>minimum</code>. * When the range <code>value</code> reach the <code>maximum</code>, the <code>busy</code> property is set to <code>false</code>. */ public boolean isAutoCompletionEnabled() { return this.autoCompletionState; } /** * Returns true if the model is <code>cancellable</code> the performing the job responsible on the <code>busy</code> state * @return true is the model is cancellable */ public boolean isCancellable() { return this.cancellableState; } /** * Default implementation that simply stop the <code>busy</code> state */ public void cancel() { if( ! isCancellable() ) throw new IllegalStateException("this model is not cancellable"); try { this.fireActionPerformed( new ActionEvent(this, CANCEL_ACTION_ID , CANCEL_ACTION_COMMAND , System.currentTimeMillis() , 0 ) ); } finally { setBusy(false); } } /** * Define if this model is <code>cancellable</code> * @param value true for set this model cancellable. */ public void setCancellable(final boolean value) { final boolean oldValue = isCancellable(); this.cancellableState = value; if( oldValue != isCancellable() ) { this.fireStateChanged(); } } /** Description to show by UI when the model is busy * Return null for let the UI render the native description * @return Description to show by UI when the model is busy */ public String getDescription() { return this.description; } /** Define the description to show by UI when the model is busy * @param s new description to show by UI, set null if you want to restore default value */ public void setDescription(String s) { String old = s; this.description = s; if( old != this.description ) { if( old != null && this.description != null ) { if( old.equals( this.description ) ) return; } fireStateChanged(); } } /** * Adds an <code>ActionListener</code> to the model. * @param l the <code>ActionListener</code> to be added * @since 1.2.2 */ public void addActionListener(ActionListener l) { listenerList.add(ActionListener.class, l); } /** * Removes an <code>ActionListener</code> from the model. * If the listener is the currently set <code>Action</code> * for the button, then the <code>Action</code> * is set to <code>null</code>. * * @param l the listener to be removed * @since 1.2.2 */ public void removeActionListener(ActionListener l) { listenerList.remove(ActionListener.class, l); } /** * Returns an array of all the <code>ActionListener</code>s added * to this Model with addActionListener(). * * @return all of the <code>ActionListener</code>s added or an empty * array if no listeners have been added * @since 1.2.2 */ public ActionListener[] getActionListeners() { return (ActionListener[])(listenerList.getListeners(ActionListener.class)); } @Override protected void fireStateChanged() { if( ! SwingUtilities.isEventDispatchThread() ) { final Runnable doRun = new Runnable() { public void run() { fireStateChanged(); } }; SwingUtilities.invokeLater(doRun); return; } super.fireStateChanged(); } /** * Notifies all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the <code>event</code> * parameter. * * @param event the <code>ActionEvent</code> object * @see EventListenerList * @since 1.2.2 */ protected void fireActionPerformed(final ActionEvent event) { // Ensure on EDT if( !SwingUtilities.isEventDispatchThread() ) { Runnable doRun = new Runnable() { public void run() { fireActionPerformed(event); } }; SwingUtilities.invokeLater(doRun); return; } // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==ActionListener.class) { ((ActionListener)listeners[i+1]).actionPerformed(event); } } } }
36.393382
147
0.615315
0545fdf18880a9e76739a3ba7eb16fa49868eedd
1,477
package com.google.android.apps.picview.data.parser; import java.util.HashMap; import java.util.Map; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class PicasaTagSaxHandler extends DefaultHandler{ private Map<String,String> tags = new HashMap<String,String>(); private String currentTag; private StringBuilder builderTag = new StringBuilder(); private StringBuilder builderID = new StringBuilder(); private boolean inID = false; private boolean inTitle = false; public Map<String, String> getTags() { return tags; } @Override public void characters(char[] ch, int start, int length) throws SAXException { if(inID) builderID.append(ch, start, length); if(inTitle) builderTag.append(ch, start, length); } @Override public void endElement(String uri, String localName, String qName) throws SAXException { if (localName.equals("entry")) { tags.put(builderTag.toString(), builderID.toString()); } inID = false; inTitle = false; } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (localName.equals("entry")) { currentTag = new String(); } else { if (currentTag != null) { if (localName.equals("id")) { inID = true; }else{ inID = false; } if (localName.equals("title")) { inTitle = true; }else{ inTitle = false; } } } } }
24.616667
79
0.69736
706e073dd14a6c60bb832daa87f0b498f7e21023
5,204
package com.xkcoding.orm.mybatis.MapperAndPage.mapper; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.util.IdUtil; import cn.hutool.crypto.SecureUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xkcoding.orm.mybatis.MapperAndPage.SpringBootDemoOrmMybatisMapperPageApplicationTests; import com.xkcoding.orm.mybatis.MapperAndPage.entity.User; import lombok.extern.slf4j.Slf4j; import org.assertj.core.util.Lists; import org.junit.Assert; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import tk.mybatis.mapper.entity.Example; import java.util.List; import java.util.stream.Collectors; /** * <p> * UserMapper 测试 * </p> * * @author yangkai.shen * @date Created in 2018-11-08 14:25 */ @Slf4j public class UserMapperTest extends SpringBootDemoOrmMybatisMapperPageApplicationTests { @Autowired private UserMapper userMapper; /** * 测试通用Mapper - 保存 */ @Test public void testInsert() { String salt = IdUtil.fastSimpleUUID(); User testSave3 = User.builder().name("testSave3").password(SecureUtil.md5("123456" + salt)).salt(salt).email("[email protected]").phoneNumber("17300000003").status(1).lastLoginTime(new DateTime()).createTime(new DateTime()).lastUpdateTime(new DateTime()).build(); userMapper.insertUseGeneratedKeys(testSave3); Assert.assertNotNull(testSave3.getId()); log.debug("【测试主键回写#testSave3.getId()】= {}", testSave3.getId()); } /** * 测试通用Mapper - 批量保存 */ @Test public void testInsertList() { List<User> userList = Lists.newArrayList(); for (int i = 4; i < 14; i++) { String salt = IdUtil.fastSimpleUUID(); User user = User.builder().name("testSave" + i).password(SecureUtil.md5("123456" + salt)).salt(salt).email("testSave" + i + "@xkcoding.com").phoneNumber("1730000000" + i).status(1).lastLoginTime(new DateTime()).createTime(new DateTime()).lastUpdateTime(new DateTime()).build(); userList.add(user); } int i = userMapper.insertList(userList); Assert.assertEquals(userList.size(), i); List<Long> ids = userList.stream().map(User::getId).collect(Collectors.toList()); log.debug("【测试主键回写#userList.ids】= {}", ids); } /** * 测试通用Mapper - 删除 */ @Test public void testDelete() { Long primaryKey = 1L; int i = userMapper.deleteByPrimaryKey(primaryKey); Assert.assertEquals(1, i); User user = userMapper.selectByPrimaryKey(primaryKey); Assert.assertNull(user); } /** * 测试通用Mapper - 更新 */ @Test public void testUpdate() { Long primaryKey = 1L; User user = userMapper.selectByPrimaryKey(primaryKey); user.setName("通用Mapper名字更新"); int i = userMapper.updateByPrimaryKeySelective(user); Assert.assertEquals(1, i); User update = userMapper.selectByPrimaryKey(primaryKey); Assert.assertNotNull(update); Assert.assertEquals("通用Mapper名字更新", update.getName()); log.debug("【update】= {}", update); } /** * 测试通用Mapper - 查询单个 */ @Test public void testQueryOne() { User user = userMapper.selectByPrimaryKey(1L); Assert.assertNotNull(user); log.debug("【user】= {}", user); } /** * 测试通用Mapper - 查询全部 */ @Test public void testQueryAll() { List<User> users = userMapper.selectAll(); Assert.assertTrue(CollUtil.isNotEmpty(users)); log.debug("【users】= {}", users); } /** * 测试分页助手 - 分页排序查询 */ @Test public void testQueryByPageAndSort() { initData(); int currentPage = 1; int pageSize = 5; String orderBy = "id desc"; int count = userMapper.selectCount(null); PageHelper.startPage(currentPage, pageSize, orderBy); List<User> users = userMapper.selectAll(); PageInfo<User> userPageInfo = new PageInfo<>(users); log.info("------------"); Assert.assertEquals(5, userPageInfo.getSize()); log.info("------------"); Assert.assertEquals(count, userPageInfo.getTotal()); log.debug("【userPageInfo】= {}", userPageInfo); } /** * 测试通用Mapper - 条件查询 */ @Test public void testQueryByCondition() { initData(); Example example = new Example(User.class); // 过滤 example.createCriteria().andLike("name", "%Save1%").orEqualTo("phoneNumber", "17300000001"); // 排序 example.setOrderByClause("id desc"); int count = userMapper.selectCountByExample(example); // 分页 PageHelper.startPage(1, 3); // 查询 List<User> userList = userMapper.selectByExample(example); PageInfo<User> userPageInfo = new PageInfo<>(userList); Assert.assertEquals(3, userPageInfo.getSize()); Assert.assertEquals(count, userPageInfo.getTotal()); log.debug("【userPageInfo】= {}", userPageInfo); } /** * 初始化数据 */ private void initData() { testInsertList(); } }
32.123457
289
0.632014
0b93f224fb923b49014b8b0a55f77543de8f36ae
5,100
package com.unnamed.b.atv.sample.activity; import java.io.Serializable; import java.util.Iterator; import java.util.List; import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; //import org.apache.commons.math3.linear.Array2DRowRealMatrix; //import org.apache.commons.math3.linear.EigenDecomposition; public class Criteria implements Comparable<Criteria>,Serializable{ SortedSet<Criteria> subcriteria=new TreeSet<Criteria>(); SortedMap<Criteria,Double> brothers=new TreeMap<Criteria,Double>(); SortedSet<String> names=new TreeSet<String>() ; private Criteria parent; private double consistency=0; private String name; private double preferableConsistency=10; public Criteria(String name){ this.name=name; } @Override public int compareTo(Criteria o) { if(name==null || o==null || o.name==null) return 1; return name.compareTo(o.name); } public void setProportion(double prop,Criteria target){ brothers.put(target, prop); target.brothers.put(this, 1/prop); parent.updatePerformance(); } public Criteria getParent(){ return parent; } public void diminish(){ Iterator<Criteria> tmp=subcriteria.iterator(); if(parent!=null) { parent.subcriteria.remove(this); parent.names.remove(this.getName()); } while (tmp.hasNext()) { tmp.next().diminish(); } subcriteria.clear(); tmp=brothers.keySet().iterator(); while(tmp.hasNext()) tmp.next().brothers.remove(this); brothers.clear(); if(parent!=null) parent.updatePerformance(); } public String[] getVector() { Iterator it = brothers.values().iterator(); String[] result = new String[brothers.values().size()]; int i = 0; while (it.hasNext()){ result[i] = it.next().toString(); i++; } return result; } public void addSubcriterium(Criteria c){ if(!names.contains(c.getName())){ subcriteria.add(c); c.setParent(this); Iterator<Criteria> it=subcriteria.iterator(); Criteria tmp; while(it.hasNext()){ tmp=it.next(); if(tmp==c) continue; tmp.addBrother(c); c.addBrother(tmp); } names.add(c.getName()); updatePerformance(); } else System.out.println("Error"); } public void setParent(Criteria c){ parent=c; } public String getName(){ return name; } public double getConsistency(){ return consistency; } public String toString(){ return name; } public void setPreferableConsistency(double preferableConsistency){ this.preferableConsistency=preferableConsistency; } public double getPreferableConsistency() { return preferableConsistency; } public void updatePerformance(){ double[][] matrix=makeMatrix(); double[] vector=getColumn(matrix); double consistency=getHCI(vector); setConsistency(consistency); } private void addBrother(Criteria c){ if(!brothers.containsKey(c)) brothers.put(c, (double) 1); else System.out.println("ErrorB"+c.getName()); } private double[] getColumn(double[][] matrix){ int size=subcriteria.size(); double[] vector=new double[size]; for(int i=0;i<size;i++){ for(int j=0;j<size;j++) vector[i]+=matrix[j][i]; } return vector; } private double getHCI(double[] tab){ double n=tab.length; if(n==1) return 0; double bottom=0; for(int i=0;i<tab.length;i++) bottom+=1/tab[i]; double HM=n/bottom; double HCI=((HM-n)*(n+1))/(n*(n-1)); return HCI*100; } private void setConsistency(double consistency){ this.consistency=consistency; } private double[] getVector(Criteria c){ int size=c.brothers.size(); Iterator<Double> it=c.brothers.values().iterator(); double[] tmp=new double[size]; for(int i=0;i<size;i++) tmp[i]=it.next().doubleValue(); return tmp; } private double[][] makeMatrix(){ int size=subcriteria.size(); double[][] matrix=new double[size][size]; Iterator<Criteria> it=subcriteria.iterator(); double[] vector; for(int i=0;i<size;i++){ vector=getVector(it.next()); for(int j=0;j<i;j++) matrix[i][j]=vector[j]; matrix[i][i]=1; for(int j=i+1;j<size;j++) matrix[i][j]=vector[j-1]; } /* for(int i=0;i<size;i++){ for(int j=0;j<size;j++) System.out.print(matrix[i][j]+" "); System.out.println(""); }*/ return matrix; } }
26.984127
71
0.567451
f6ba11f485424f5e681b5b94bc20da2bb0f79250
6,665
package org.ethereum.jsontestsuite; import org.json.simple.parser.ParseException; import org.junit.FixMethodOrder; import org.junit.Ignore; import org.junit.Test; import org.junit.runners.MethodSorters; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import static org.ethereum.jsontestsuite.JSONReader.getFileNamesForTreeSha; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class GitHubVMTest { //SHACOMMIT of tested commit, ethereum/tests.git //Last known good commit: 5af1002b96f34cd2c9252c1a6636826d47411ccd public String shacommit = "5af1002b96f34cd2c9252c1a6636826d47411ccd"; //@Ignore @Test public void runSingle() throws ParseException { String json = JSONReader.loadJSONFromCommit("VMTests/vmEnvironmentalInfoTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, "balance0"); } //@Ignore @Test public void testArithmeticFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); // TODO: these are excluded due to bad wrapping behavior in ADDMOD/DataWord.add excluded.add("addmod1_overflowDiff"); excluded.add("addmod1_overflow3"); excluded.add("addmodBigIntCast"); String json = JSONReader.loadJSONFromCommit("VMTests/vmArithmeticTest.json", shacommit); //String json = JSONReader.getTestBlobForTreeSha(shacommit, "vmArithmeticTest.json"); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testBitwiseLogicOperationFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmBitwiseLogicOperationTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testBlockInfoFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmBlockInfoTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore @Test // testing full suite public void testEnvironmentalInfoFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); excluded.add("env1"); String json = JSONReader.loadJSONFromCommit("VMTests/vmEnvironmentalInfoTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testIOandFlowOperationsFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmIOandFlowOperationsTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore //FIXME - 60M - need new fast downloader @Test public void testvmInputLimitsTest1FromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmInputLimits1.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore //FIXME - 50M - need to handle large filesizes @Test public void testvmInputLimitsTest2FromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmInputLimits2.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore //FIXME - 20M - possibly provide percentage indicator @Test public void testvmInputLimitsLightTestFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmInputLimitsLight.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testVMLogGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmLogTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore @Test // testing full suite public void testPerformanceFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmPerformanceTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testPushDupSwapFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmPushDupSwapTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testShaFromGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmSha3Test.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } @Ignore // // FIXME: as soon as possible @Test // testing full suite public void testvmSystemOperationsTestGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmSystemOperationsTest.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testVMGitHub() throws ParseException { Set<String> excluded = new HashSet<>(); String json = JSONReader.loadJSONFromCommit("VMTests/vmtests.json", shacommit); GitHubJSONTestSuite.runGitHubJsonVMTest(json, excluded); } //@Ignore @Test // testing full suite public void testRandomVMGitHub() throws ParseException { String sha = "c5eafb85390eee59b838a93ae31bc16a5fd4f7b1"; List<String> fileNames = getFileNamesForTreeSha(sha); List<String> excludedFiles = Arrays.asList( "" ); for (String fileName : fileNames) { if (excludedFiles.contains(fileName)) continue; System.out.println("Running: " + fileName); String json = JSONReader.loadJSON("VMTests//RandomTests/" + fileName); GitHubJSONTestSuite.runGitHubJsonVMTest(json); } } }
39.205882
107
0.703226
8d3aac5aafc919c952722dbea8e74d8ab0b7f176
378
package utils; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; public class FileUtils { public List<String> readFileAsList(String path) throws IOException { List<String> lines = Files.readAllLines(Paths.get(path), Charset.defaultCharset()); return lines; } }
23.625
91
0.732804
79c2f4fa353f7effe4acb69653670ea5666087d9
3,383
package org.hamgen; import org.hamgen.integrationtest.schemapackage.Company; import org.hamgen.integrationtest.schemapackage.Employee; import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.StringDescription; import org.hamgen.builder.CompanyBuilder; import org.hamgen.builder.EmployeeBuilder; import org.hamgen.builder.PersonNameStructBuilder; import org.junit.Test; import static org.hamgen.integrationtest.schemapackage.matcher.CompanyMatcher.isCompany; import static junit.framework.TestCase.assertFalse; import static org.junit.Assert.assertTrue; public class CompanyMatcherIT { @Test public void t1201_success() throws Exception { //Arrange Employee expectedEmployee1 = EmployeeBuilder.aDefaultEmployee().withPay(123).build(); Employee expectedEmployee2 = EmployeeBuilder.aDefaultEmployee().withPay(321).build(); Company expected = CompanyBuilder.aDefaultCompany().withEmployees(expectedEmployee1, expectedEmployee2).build(); Employee actualEmployee1 = EmployeeBuilder.aDefaultEmployee().withPay(123).build(); Employee actualEmployee2 = EmployeeBuilder.aDefaultEmployee().withPay(321).build(); Company actual = CompanyBuilder.aDefaultCompany().withEmployees(actualEmployee1, actualEmployee2).build(); //Act Matcher companyMatcher = isCompany(expected); boolean result = companyMatcher.matches(actual); //Assert String errorReason = getDescription("Not the same :(", companyMatcher, actual).toString(); assertTrue(errorReason, result); } @Test public void t1202_describeMismatchInList() throws Exception { //Arrange Employee expectedEmployee1 = EmployeeBuilder.aDefaultEmployee().withPay(123).build(); Employee expectedEmployee2 = EmployeeBuilder.aDefaultEmployee().withPay(321).build(); Company expected = CompanyBuilder.aDefaultCompany().withEmployees(expectedEmployee1, expectedEmployee2).build(); Employee actualEmployee1 = EmployeeBuilder.aDefaultEmployee().withPay(123).withPersonNameStruct(PersonNameStructBuilder.aDefaultPersonNameStruct().withFirstName("LOL").build()).build(); Employee actualEmployee2 = EmployeeBuilder.aDefaultEmployee().withPay(321).build(); Company actual = CompanyBuilder.aDefaultCompany().withEmployees(actualEmployee1, actualEmployee2).build(); //Act Matcher companyMatcher = isCompany(expected); StringDescription mismatchDescription = new StringDescription(); companyMatcher.describeMismatch(actual, mismatchDescription); //Assert String descriptionResult = mismatchDescription.toString(); assertTrue(descriptionResult, descriptionResult.equals("{employeeCollection {employee item 0: {personNameStruct {firstName was \"LOL\"}}}}")); } private Description getDescription(String reason, Matcher matcher, Object actual) { Description description = new StringDescription(); // Do the same magic as assertThat description.appendText(reason) .appendText("\nExpected: ") .appendDescriptionOf(matcher) .appendText("\n but: "); matcher.describeMismatch(actual, description); return description; } }
46.342466
194
0.72214
b3af2e50fca23fe4082946ea115ca3c34179e9ea
686
package com.bitdubai.fermat_cbp_api.layer.network_service.transaction_transmission.exceptions; import com.bitdubai.fermat_cbp_api.all_definition.exceptions.CBPException; /** * Created by Gabriel Araujo on 05/12/15. */ public class CantInitializeCommunicationNetworkServiceConnectionManagerException extends CBPException { public static final String DEFAULT_MESSAGE = "CAN'T INITIALIZE COMMUNICATION NETWORK SERVICE CONNECTION MANAGER"; public CantInitializeCommunicationNetworkServiceConnectionManagerException(final String message, final Exception cause, final String context, final String possibleReason) { super(message, cause, context, possibleReason); } }
45.733333
176
0.826531
67eca65b26273d843ed6d1af6ea031923dbfd5d5
1,425
package jet.opengl.demos.nvidia.hbaoplus; /** * [Optional] Input viewport.<p> * Remarks:<ul> * <li> The Viewport defines a sub-area of the input & output full-resolution textures to be sourced and rendered to. * Only the depth pixels within the viewport sub-area contribute to the RenderAO output. * <li> The Viewport's MinDepth and MaxDepth values are ignored except if DepthTextureType is HARDWARE_DEPTHS_SUB_RANGE. * <li> If Enable is false, a default input viewport is used with: * <pre> * TopLeftX = 0 * TopLeftY = 0 * Width = InputDepthTexture.Width * Height = InputDepthTexture.Height * MinDepth = 0.f * MaxDepth = 1.f * </pre> * </ul> */ public class GFSDK_SSAO_InputViewport { /** To use the provided viewport data (instead of the default viewport) */ public boolean enable; /** X coordinate of the top-left corner of the viewport rectangle, in pixels */ public int topLeftX; /** Y coordinate of the top-left corner of the viewport rectangle, in pixels */ public int topLeftY; /** The width of the viewport rectangle, in pixels */ public int width; /** The height of the viewport rectangle, in pixels */ public int height; /** The minimum depth for GFSDK_SSAO_HARDWARE_DEPTHS_SUB_RANGE */ public float minDepth = 0.0f; /** The maximum depth for GFSDK_SSAO_HARDWARE_DEPTHS_SUB_RANGE */ public float maxDepth = 1.0f; }
38.513514
120
0.698947
1c825531a7ff9bc85bb6f8b49e0b67ca3bc0e4fb
585
package projectTests; import models.User; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class DeleteContact extends TestBase{ @BeforeMethod public void precondition() { if(app.helperUser().isLogged()) { app.helperUser().login(new User().withEmail("[email protected]").withPassword("Sam1234$")); } } @Test public void removeOneContact() { app.contactHelper().removeContact(); } @Test public void removeAllContacts() { app.contactHelper().removeAllContacts(); } }
21.666667
99
0.659829
c317459d64e89bb0f158d129cb707c118a9f7e63
8,253
package com.xeed.cheapnsale.activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.afollestad.materialdialogs.MaterialDialog; import com.squareup.picasso.Picasso; import com.squareup.picasso.Target; import com.xeed.cheapnsale.Application; import com.xeed.cheapnsale.R; import com.xeed.cheapnsale.adapter.StoreMenuTabPagerAdapter; import com.xeed.cheapnsale.service.model.Cart; import com.xeed.cheapnsale.service.model.Store; import com.xeed.cheapnsale.util.CommonUtil; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class StoreDetailActivity extends AppCompatActivity implements TabLayout.OnTabSelectedListener { private final static int COLLAPS_LIMIT = -666; @Inject public Picasso picasso; @BindView(R.id.app_bar_store_detail) public AppBarLayout appBarStoreDetail; @BindView(R.id.pager_order_detail) public ViewPager pagerOrderDetail; @BindView(R.id.tab_store_detail) public TabLayout tabStoreDetail; @BindView(R.id.toolbar_store_detail) public Toolbar toolbarStoreDetail; @BindView(R.id.image_back_button_store_detail) public ImageView imageBackButtonStoreDetail; @BindView(R.id.text_title_order_detail) public TextView textTitleOrderDetail; @BindView(R.id.text_call_button_store_detail) public TextView textCallButtonStoreDetail; @BindView(R.id.text_map_button_store_detail) public TextView textMapButtonStoreDetail; @BindView(R.id.text_name_store_detail) public TextView textNameStoreDetail; @BindView(R.id.image_top_src_store_detail) public ImageView imageTopSrcStoreDetail; @BindView(R.id.text_address_store_detail) public TextView textAddressStoreDetail; @BindView(R.id.text_running_time_store_detail) public TextView textRunningTimeStoreDetail; Store store; public Target imageCallback; private StoreMenuTabPagerAdapter storeMenuTabPagerAdapter; private MaterialDialog orderCancelConfirmlDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((Application) getApplication()).getApplicationComponent().inject(this); setContentView(R.layout.activity_store_detail); ButterKnife.bind(this); store = (Store) getIntent().getSerializableExtra("store"); //actionbar에 들어갈 내용을 우리의 view인 toolbar에 적용.. setSupportActionBar(toolbarStoreDetail); tabStoreDetail.addTab(tabStoreDetail.newTab().setText("메뉴")); tabStoreDetail.addTab(tabStoreDetail.newTab().setText("가게정보")); tabStoreDetail.addTab(tabStoreDetail.newTab().setText("리뷰(21)")); tabStoreDetail.setTabGravity(TabLayout.GRAVITY_FILL); int arrivalTime = store.getDistanceToStore() / 60; storeMenuTabPagerAdapter = new StoreMenuTabPagerAdapter(store, getSupportFragmentManager(), tabStoreDetail.getTabCount()); pagerOrderDetail.setAdapter(storeMenuTabPagerAdapter); pagerOrderDetail.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabStoreDetail)); tabStoreDetail.addOnTabSelectedListener(this); //store 정보 세팅 시작 textNameStoreDetail.setText(store.getName()); textTitleOrderDetail.setText(store.getName()); textAddressStoreDetail.setText(store.getAddress()); textRunningTimeStoreDetail.setText(store.getOpenTime() + " - " + store.getCloseTime() + " (" + getResources().getString(R.string.txt_order_end_time) + " " + store.getEndTime() + ")"); imageCallback = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { imageTopSrcStoreDetail.setImageBitmap(bitmap); } @Override public void onBitmapFailed(Drawable errorDrawable) { } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { } }; picasso.load(store.getMainImageUrl()).into(imageCallback); setTabTextStyle(0, Typeface.BOLD); appBarStoreDetail.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { if (verticalOffset > COLLAPS_LIMIT) { textTitleOrderDetail.setVisibility(View.GONE); textCallButtonStoreDetail.setVisibility(View.GONE); textMapButtonStoreDetail.setVisibility(View.GONE); toolbarStoreDetail.setBackgroundColor(Color.TRANSPARENT); } else { textTitleOrderDetail.setVisibility(View.VISIBLE); textCallButtonStoreDetail.setVisibility(View.VISIBLE); textMapButtonStoreDetail.setVisibility(View.VISIBLE); toolbarStoreDetail.setBackgroundColor(Color.rgb(255, 255, 255)); } } }); } @Override public void onTabSelected(TabLayout.Tab tab) { //유저에 의해 tab button 눌린 순간 viewpager 화면 조정.. pagerOrderDetail.setCurrentItem(tab.getPosition()); setTabTextStyle(tab.getPosition(), Typeface.BOLD); } @Override public void onTabUnselected(TabLayout.Tab tab) { setTabTextStyle(tab.getPosition(), Typeface.NORMAL); } @Override public void onTabReselected(TabLayout.Tab tab) { } @Override public void onBackPressed() { Cart cart = ((Application) getApplication()).getCart(); if(cart.getTotalCount() > 0) { orderCancelConfirmlDialog = new MaterialDialog.Builder(this).customView(R.layout.dialog_store_detail_back_pressed, false).build(); orderCancelConfirmlDialog.show(); TextView noButton = (TextView) orderCancelConfirmlDialog.getView().findViewById(R.id.button_cancel_confirm_dialog_no); TextView yesButton = (TextView) orderCancelConfirmlDialog.getView().findViewById(R.id.button_cancel_confirm_dialog_yes); noButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { orderCancelConfirmlDialog.dismiss(); } }); yesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { orderCancelConfirmlDialog.dismiss(); finish(); } }); } else { finish(); } } @OnClick(R.id.image_back_button_store_detail) public void onClickBackButton(View view) { onBackPressed(); } @OnClick( { R.id.image_call_button_store_detail, R.id.text_call_button_store_detail }) public void onClickImageCallButton(View view) { CommonUtil.makePhoneCall(StoreDetailActivity.this, store.getPhoneNumber()); } @OnClick( { R.id.image_map_button_store_detail, R.id.text_map_button_store_detail } ) public void onClickImageMapButton(View view) { Intent nextIntent = new Intent(StoreDetailActivity.this, StoreDetailMapActivity.class); nextIntent.putExtra("store", store); startActivity(nextIntent); } private void setTabTextStyle(int position, int typeface) { LinearLayout linearLayout = (LinearLayout) ((ViewGroup) tabStoreDetail.getChildAt(0)).getChildAt(position); TextView tabTextView = (TextView) linearLayout.getChildAt(1); tabTextView.setTypeface(tabTextView.getTypeface(), typeface); } }
35.119149
191
0.703986
7a660439a308447d80beac8cd3435a0075a2f2c9
3,080
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See License.txt in the repository root. package com.microsoft.tfs.core.clients.versioncontrol.engines.internal; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.text.MessageFormat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.microsoft.tfs.core.clients.versioncontrol.specs.DownloadOutput; import com.microsoft.tfs.util.Check; import com.microsoft.tfs.util.IOUtils; /** * Implements {@link DownloadOutput} to write to a {@link FileOutputStream} at a * specified path. Supports reset and reopen of the stream after a failure. * * @threadsafety thread-safe */ public class FileDownloadOutput extends BaseDownloadOutput { private final static Log log = LogFactory.getLog(FileDownloadOutput.class); private final File outputFile; /** * The output stream in use. <code>null</code> when uninitialized or after a * reset. */ private FileOutputStream outputStream; /** * Constructs a {@link FileDownloadOutput} that writes to a file. * * @param outputFile * the output file where downloaded bytes are written (must not be * <code>null</code>) * @param autoGunzip * if <code>true</code> the bytes are gunzipped before being written * to outputstream; if <code>false</code> unprocessed bytes (could be * gzip, could be raw) are written to output stream */ public FileDownloadOutput(final File outputFile, final boolean autoGunzip) { super(autoGunzip); Check.notNull(outputFile, "outputFile"); //$NON-NLS-1$ this.outputFile = outputFile; } /** * {@inheritDoc} */ @Override public synchronized OutputStream getOutputStream() throws FileNotFoundException { if (outputStream == null) { if (!outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs()) { /* Double-check before logging to avoid mkdirs race condition */ if (!outputFile.getParentFile().isDirectory()) { log.warn(MessageFormat.format( "mkdirs() failed on {0}, output stream will probably fail", //$NON-NLS-1$ outputFile.getParentFile())); } } outputStream = new FileOutputStream(outputFile); } return outputStream; } /** * {@inheritDoc} */ @Override public synchronized void resetOutputStream() throws IOException { // Simply close and we're ready for another call to getOutputStream() closeOutputStream(); } /** * {@inheritDoc} */ @Override public void closeOutputStream() throws IOException { if (outputStream != null) { IOUtils.closeSafely(outputStream); outputStream = null; } } }
31.752577
97
0.649026
070c7bcfde0b66fd5437982a66dd59acaf19160d
555
package ru.lj.alamar.brainiac; import java.util.Random; /** * * @author ilyak * * http://www.javamex.com/tutorials/random_numbers/java_util_random_subclassing.shtml */ public class XorShiftRandom extends Random { private long acc; public XorShiftRandom(long seed) { this.acc = seed; } protected int next(int nbits) { // N.B. Not thread-safe! long x = this.acc; x ^= (x << 21); x ^= (x >>> 35); x ^= (x << 4); this.acc = x; x &= ((1L << nbits) - 1); return (int) x; } }
19.137931
85
0.556757
c334ae51d16ce3922486f1d6752de82d8bfe3303
1,224
package de.bluewolf.wolfbot.commands; import de.bluewolf.wolfbot.settings.BotSettings; import de.bluewolf.wolfbot.settings.Permissions; import de.bluewolf.wolfbot.utils.CustomMsg; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import java.awt.*; import java.sql.SQLException; public class CmdPing implements Command { @Override public boolean called(String[] args, MessageReceivedEvent event) throws SQLException { return Permissions.check(event, "ping"); } @Override public void action(String[] args, MessageReceivedEvent event) { event.getChannel().sendMessage( new EmbedBuilder().setColor(Color.GREEN).setDescription("Pong!").build() ).queue(); executed(true, event); } @Override public void executed(boolean success, MessageReceivedEvent event) { if (success) CustomMsg.COMMAND_EXECUTED(event, "ping"); else CustomMsg.HELP_MSG(event, help()); } @Override public String help() { return "Use ``" + BotSettings.PREFIX + "ping``. For more information use ``" + BotSettings.PREFIX + "help``."; } }
26.042553
118
0.672386
3c40c114ac7388a69d91e20956636757af8bc32b
938
package com.github.ladicek.oaken_ocean.core.timeout; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; public class ScheduledExecutorTimeoutWatcher implements TimeoutWatcher { private final ScheduledExecutorService executor; public ScheduledExecutorTimeoutWatcher(ScheduledExecutorService executor) { this.executor = executor; } @Override public TimeoutWatch schedule(TimeoutExecution execution) { ScheduledFuture<?> future = executor.schedule(execution::timeoutAndInterrupt, execution.timeoutInMillis(), TimeUnit.MILLISECONDS); return new TimeoutWatch() { @Override public boolean isRunning() { return !future.isDone(); } @Override public void cancel() { future.cancel(true); } }; } }
31.266667
138
0.682303
cb30c3ad2bbe1fed17e557fc4b39ef541fe94ada
1,814
import java.util.*; public class MaxSubarray { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int tests = stdin.nextInt(); for(int i = 0; i < tests; i++) { int elementCount = stdin.nextInt(); int[] arr = new int[elementCount]; for(int j = 0; j < elementCount; j++) { arr[j] = stdin.nextInt(); } int contiguousSum = kadane(arr); int nonContiguousSum; if(hasPositiveElement(arr)) { nonContiguousSum = sumPositiveElement(arr); } else { nonContiguousSum = max(arr); } System.out.println(contiguousSum + " " + nonContiguousSum); } stdin.close(); } private static int kadane(int[] arr) { int maxSoFar = arr[0]; int maxEndings = arr[0]; for(int j = 1; j < arr.length; j++) { int el = arr[j]; maxEndings = Math.max(el, maxEndings + el); maxSoFar = Math.max(maxSoFar, maxEndings); } return maxSoFar; } private static boolean hasPositiveElement(int[] arr) { for(int j = 0; j < arr.length; j++) { if(arr[j] > 0) { return true; } } return false; } private static int sumPositiveElement(int[] arr) { int sum = 0; for(int j = 0; j < arr.length; j++) { if(arr[j] > 0) { sum += arr[j]; } } return sum; } private static int max(int[] arr) { int max = Integer.MIN_VALUE; for(int j = 0; j < arr.length; j++) { if(arr[j] > max) { max = arr[j]; } } return max; } }
28.34375
71
0.464168
eb3b06a2db09e7c90485fa0deabd003626ea98ab
678
// Complete the reverse function below. /* * For your reference: * * DoublyLinkedListNode { * int data; * DoublyLinkedListNode next; * DoublyLinkedListNode prev; * } * */ static DoublyLinkedListNode reverse(DoublyLinkedListNode head) { DoublyLinkedListNode tmp=head; DoublyLinkedListNode temp=null; if(head.next==null) return head; while(tmp != null) { temp=tmp.prev; tmp.prev=tmp.next; tmp.next=temp; tmp=tmp.prev; } if(temp==null) return tmp; return temp.prev; }
21.1875
68
0.514749
f3d7d8cea7715fb467c1827cac134f90427df3e8
1,250
package com.mybatis; import java.util.List; import org.apache.ibatis.session.SqlSession; import com.vo.House; import com.vo.Orderdetail; import com.vo.Orders; public class HouseDaoMapperImpl implements HouseDaoMapperInf { private SqlSession session; public HouseDaoMapperImpl(SqlSession session) { super(); this.session = session; } public int getCountTiao() { return session.getMapper(HouseDaoMapperInf.class).getCountTiao(); } public House getHouseImg(int id) { return session.getMapper(HouseDaoMapperInf.class).getHouseImg(id); } public List<House> getHousePage(int start, int end) { return session.getMapper(HouseDaoMapperInf.class).getHousePage(start, end); } public List<House> listHouse() { return session.getMapper(HouseDaoMapperInf.class).listHouse(); } public void saveHouse(House house) { session.getMapper(HouseDaoMapperInf.class).saveHouse(house); } public void saveOrderdetail(Orderdetail orderdetail) { session.getMapper(HouseDaoMapperInf.class).saveOrderdetail(orderdetail); } public void saveOrders(Orders orders) { session.getMapper(HouseDaoMapperInf.class).saveOrders(orders); } public void setStatus(int id) { session.getMapper(HouseDaoMapperInf.class).setStatus(id); } }
23.148148
74
0.7728
830c448a18e2999d40065493e375f1028b8c92bd
3,146
package se.gustavkarlsson.rocketchat.jira_trigger.configuration; import com.moandjiezana.toml.Toml; import org.joda.time.Instant; import org.joda.time.ReadableInstant; import org.joda.time.format.DateTimeFormatter; import org.junit.Before; import org.junit.Test; import se.gustavkarlsson.rocketchat.jira_trigger.test.TomlUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static se.gustavkarlsson.rocketchat.jira_trigger.configuration.MessageConfiguration.*; public class MessageConfigurationTest { private static final ReadableInstant EPOCH = new Instant(0); private Toml minimal; private Toml defaults; @Before public void setUp() throws Exception { minimal = TomlUtils.getMinimalToml(); defaults = TomlUtils.getDefaultsToml(); } @Test(expected = NullPointerException.class) public void createWithNullTomlThrowsNPE() throws Exception { new MessageConfiguration(null, defaults); } @Test public void createWithMinimalToml() throws Exception { new MessageConfiguration(minimal, defaults); } @Test public void getDateFormat() throws Exception { new MessageConfiguration(minimal, defaults).getDateFormatter(); } @Test public void getUsername() throws Exception { new MessageConfiguration(minimal, defaults).getUsername(); } @Test public void getDefault() throws Exception { new MessageConfiguration(minimal, defaults).getDefaultColor(); } @Test public void getIconUrl() throws Exception { new MessageConfiguration(minimal, defaults).getIconUrl(); } @Test public void isPriorityColors() throws Exception { new MessageConfiguration(minimal, defaults).isPriorityColors(); } @Test public void getPrintDefault() throws Exception { new MessageConfiguration(minimal, defaults).getDefaultFields(); } @Test public void getPrintExtended() throws Exception { new MessageConfiguration(minimal, defaults).getExtendedFields(); } @Test(expected = ValidationException.class) public void createWithInvalidDateFormatTomlThrowsValidationException() throws Exception { Toml toml = mock(Toml.class); when(toml.getString(KEY_PREFIX + DATE_PATTERN_KEY)).thenReturn("MP)H(/FF/T/&%G%UJ"); new MessageConfiguration(toml, defaults); } @Test public void createWithSwedishDateLocaleTomlProducesSwedishDate() throws Exception { Toml toml = mock(Toml.class); when(toml.getString(KEY_PREFIX + DATE_LOCALE_KEY)).thenReturn("sv-SE"); when(toml.getString(KEY_PREFIX + DATE_PATTERN_KEY)).thenReturn("E"); DateTimeFormatter dateFormatter = new MessageConfiguration(toml, defaults).getDateFormatter(); assertThat(dateFormatter.print(EPOCH)).isEqualTo("to"); } @Test public void createWithUsEnglishDateLocaleTomlProducesSwedishDate() throws Exception { Toml toml = mock(Toml.class); when(toml.getString(KEY_PREFIX + DATE_LOCALE_KEY)).thenReturn("en-US"); when(toml.getString(KEY_PREFIX + DATE_PATTERN_KEY)).thenReturn("E"); DateTimeFormatter dateFormatter = new MessageConfiguration(toml, defaults).getDateFormatter(); assertThat(dateFormatter.print(EPOCH)).isEqualTo("Thu"); } }
32.102041
96
0.787031
48bbc7742e58db4d033939644f10aaa682ce5616
3,337
package spiffe.provider; import javax.net.ssl.SSLEngine; import javax.net.ssl.X509ExtendedTrustManager; import java.net.Socket; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import static spiffe.provider.CertificateUtils.checkSpiffeId; import static spiffe.provider.CertificateUtils.validate; /** * This class implements a SPIFFE based TrustManager * */ public class SpiffeTrustManager extends X509ExtendedTrustManager { private final SpiffeIdManager spiffeIdManager; SpiffeTrustManager() { spiffeIdManager = SpiffeIdManager.getInstance(); } /** * Given the partial or complete certificate chain provided by the peer, * build a certificate path to a trusted root and return if it can be validated * and is trusted for client SSL authentication based on the authentication type. * * @param chain the peer certificate chain * @param authType the authentication type based on the client certificate * @throws CertificateException */ @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { checkPeer(chain); } /** * Given the partial or complete certificate chain provided by the peer, * build a certificate path to a trusted root and return if it can be validated * and is trusted for server SSL authentication based on the authentication type. * * @param chain the peer certificate chain * @param authType the key exchange algorithm used * @throws CertificateException */ @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { checkPeer(chain); } /** * Return an array of certificate authority certificates which are trusted for authenticating peers. * * @return a non-null (possibly empty) array of acceptable CA issuer certificates */ @Override public X509Certificate[] getAcceptedIssuers() { return spiffeIdManager.getTrustedCerts().toArray(new X509Certificate[0]); } @Override public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { checkClientTrusted(chain, authType); } @Override public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { checkServerTrusted(chain, authType); } @Override public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine sslEngine) throws CertificateException { checkClientTrusted(chain, authType); } @Override public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine sslEngine) throws CertificateException { checkServerTrusted(chain, authType); } /** * Validates the peer's SVID * * @param chain an array of X509Certificate that contains the Peer's SVID to be validated * @throws CertificateException when either the Peer's certificate doesn't chain to any Trusted CA * */ private void checkPeer(X509Certificate[] chain) throws CertificateException { validate(chain, spiffeIdManager.getTrustedCerts()); checkSpiffeId(chain); } }
35.5
127
0.728199
752c0940b7455dfb93183958f49f545feb54d420
319
package com.techprimers.testing; public class FizzBuzz { public String play(int number) { if (number == 0) throw new IllegalArgumentException("Number must not be 0"); if (number % 3 == 0) return "Fizz"; if (number % 5 == 0) return "Buzz"; return String.valueOf(number); } }
21.266667
84
0.60815
01a8fb6f814b3681d10791f896e0d7884e8eab56
3,175
package com.examination.controller; import com.examination.component.AdminAuth; import com.examination.component.LoginAuth; import com.examination.controller.common.BaseController; import com.examination.controller.common.ResultEnum; import com.examination.entity.Admin; import com.examination.entity.Result; import com.examination.service.impl.AdminServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @LoginAuth @RestController @Api(tags = "管理员控制") public class AdminController { AdminServiceImpl adminService; @Autowired public AdminController(AdminServiceImpl adminService) { this.adminService = adminService; } @LoginAuth @ApiOperation("根据管理员编号查询") @ApiImplicitParam(value = "管理员编号",name = "adminId",dataType = "Integer",defaultValue = "88888") @GetMapping("/admin/{adminId}") public Result findById(@PathVariable("adminId") Integer adminId){ Admin admin = adminService.findById(adminId); if (admin != null){ return Result.success(admin); }else { return Result.fail("找不到管理员",BaseController.ADMIN_DO_NOT_EXIST); } } @AdminAuth @ApiOperation(value = "根据管理员编号删除",tags = "管理员权限") @ApiImplicitParam(value = "管理员编号",name = "adminId",dataType = "Integer") @DeleteMapping("/admin/{adminId}") public Result delete(@PathVariable("adminId") Integer adminId){ int res = adminService.deleteById(adminId); if (res == 1) { return Result.success(); }else { return Result.fail("删除失败",BaseController.DELETE_FAIL); } } @AdminAuth @ApiOperation(value = "更新管理员信息",tags = "管理员权限") @ApiImplicitParam(value = "管理员实体类",name = "admin",dataType = "Admin") @PutMapping("/admin") public Result update(@RequestBody Admin admin) { if(adminService.update(admin) != 0) return Result.success(); return Result.fail("更新失败",BaseController.UPDATE_FAIL); } @AdminAuth @ApiOperation(value = "添加管理员",tags = "管理员权限") @PostMapping("/admin") @ApiImplicitParam(value = "管理员实体类",name = "admin",dataType = "Admin") public Result add(@RequestBody Admin admin) { int res = adminService.add(admin); if (res == 1) { return Result.success(); }else { return Result.fail("添加失败", BaseController.INSERT_FAIL); } } // @ApiOperation("更改管理员密码") // @PutMapping("/admin/modify") // @ApiImplicitParams({ // @ApiImplicitParam(value = "管理员编号",name = "adminId"), // @ApiImplicitParam(value = "新密码",name="pwd") // }) // public ApiResult updatePwd(@RequestParam("adminId")Integer adminId,@RequestParam("pwd") String pwd){ // int res = adminService.updatePwd(adminId,pwd); // if (res == 1) { // return ApiResultHandler.buildApiResult(200,"更改成功",null); // }else { // return ApiResultHandler.buildApiResult(400,"更改失败",null); // } // } }
34.89011
106
0.661732
359735db94f06143db6332ce29c6e4d4c8aa7024
1,241
package org.mockenize.provider.mapper; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider; @Provider @Component public class JacksonProvider implements ContextResolver<ObjectMapper> { private final ObjectMapper objectMapper; @Autowired public JacksonProvider(ObjectMapper objectMapper) { this.objectMapper = objectMapper; configure(); } private void configure() { objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); objectMapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, true); objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true); objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); } @Override public ObjectMapper getContext(Class<?> type) { return objectMapper; } }
33.540541
90
0.782434
6164967cdb7c8c75ea24faf145c442de6d9de207
1,678
/* * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ package io.airbyte.integrations.source.oracle_strict_encrypt; import com.fasterxml.jackson.databind.node.ArrayNode; import io.airbyte.commons.json.Jsons; import io.airbyte.integrations.base.IntegrationRunner; import io.airbyte.integrations.base.Source; import io.airbyte.integrations.base.spec_modification.SpecModifyingSource; import io.airbyte.integrations.source.oracle.OracleSource; import io.airbyte.protocol.models.ConnectorSpecification; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class OracleStrictEncryptSource extends SpecModifyingSource implements Source { private static final Logger LOGGER = LoggerFactory.getLogger(OracleStrictEncryptSource.class); OracleStrictEncryptSource() { super(OracleSource.sshWrappedSource()); } @Override public ConnectorSpecification modifySpec(final ConnectorSpecification originalSpec) { final ConnectorSpecification spec = Jsons.clone(originalSpec); ((ArrayNode) spec.getConnectionSpecification().get("required")).add("encryption"); // We need to remove the first item from one Of, which is responsible for connecting to the source // without encrypted. ((ArrayNode) spec.getConnectionSpecification().get("properties").get("encryption").get("oneOf")).remove(0); return spec; } public static void main(final String[] args) throws Exception { final Source source = new OracleStrictEncryptSource(); LOGGER.info("starting source: {}", OracleStrictEncryptSource.class); new IntegrationRunner(source).run(args); LOGGER.info("completed source: {}", OracleStrictEncryptSource.class); } }
39.023256
111
0.782479
9ac1b8f9482ce2b1864b186c9505663784870331
2,486
/* * Copyright 2011-2018 B2i Healthcare Pte Ltd, http://b2i.sg * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.b2international.snowowl.fhir.core.model.dt; import java.util.Arrays; import java.util.Collection; import javax.validation.Valid; import com.b2international.snowowl.fhir.core.model.ValidatingBuilder; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; /** * { // from Element: extension "coding" : [{ Coding }], // Code defined by a terminology system "text" : "<string>" // Plain text representation of the concept } * @see <a href="http://hl7.org/fhir/datatypes.html#CodeableConcept">FHIR:Foundation:Data types</a> * @since 6.3 */ public class CodeableConcept { // Code defined by a terminology system 0..* @JsonProperty("coding") @Valid private Collection<Coding> codings; // Plain text representation of the concept 0..1 // same as display most of the time private String text; CodeableConcept(Collection<Coding> codings, String text) { this.codings = codings; this.text = text; } public Collection<Coding> getCodings() { return codings; } public String getText() { return text; } @Override public String toString() { return "CodeableConcept [codings=" + Arrays.toString(codings.toArray()) + ", text=" + text + "]"; } public static Builder builder() { return new Builder(); } public static class Builder extends ValidatingBuilder<CodeableConcept> { private Collection<Coding> codings = Lists.newArrayList(); private String text; public Builder addCoding(final Coding coding) { codings.add(coding); return this; } public Builder codings(final Collection<Coding> codings) { this.codings = codings; return this; } public Builder text(final String text) { this.text = text; return this; } @Override protected CodeableConcept doBuild() { return new CodeableConcept(codings, text); } } }
25.895833
99
0.716412
5a5b11581f427fe8e9d2e2fc4417bf179542f0e8
5,607
package com.veken0m.bitcoinium; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; import com.veken0m.utils.Constants; public class BalanceWidgetConfigureActivity extends PreferenceActivity implements Preference.OnPreferenceClickListener { private static final String PREF_ADDRESS_KEY = "address_"; private static final String PREF_NICKNAME_KEY = "nickname_"; private static final String PREF_CURRENCY_KEY = "currency_"; private int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID; public BalanceWidgetConfigureActivity() { super(); } // Read the prefix from the SharedPreferences object for this widget. // If there is no preference saved, get the default from a resource public static String loadAddressPref(Context context, int appWidgetId) { SharedPreferences prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0); return prefs.getString(PREF_ADDRESS_KEY + appWidgetId, null); } // Write the prefix to the SharedPreferences object for this widget private static void saveAddressPref(Context context, int appWidgetId, String exchange) { Editor prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0).edit(); prefs.putString(PREF_ADDRESS_KEY + appWidgetId, exchange); prefs.commit(); } // Read the prefix from the SharedPreferences object for this widget. // If there is no preference saved, get the default from a resource public static String loadCurrencyPref(Context context, int appWidgetId) { SharedPreferences prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0); return prefs.getString(PREF_CURRENCY_KEY + appWidgetId, null); } // Write the prefix to the SharedPreferences object for this widget private static void saveCurrencyPref(Context context, int appWidgetId, String exchange) { Editor prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0).edit(); prefs.putString(PREF_CURRENCY_KEY + appWidgetId, exchange); prefs.commit(); } // Read the prefix from the SharedPreferences object for this widget. // If there is no preference saved, get the default from a resource public static String loadNicknamePref(Context context, int appWidgetId) { SharedPreferences prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0); return prefs.getString(PREF_NICKNAME_KEY + appWidgetId, null); } // Write the prefix to the SharedPreferences object for this widget private static void saveNicknamePref(Context context, int appWidgetId, String exchange) { Editor prefs = context.getSharedPreferences(Constants.PREFS_WALLET_ADDRESS, 0).edit(); prefs.putString(PREF_NICKNAME_KEY + appWidgetId, exchange); prefs.commit(); } @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.pref_balance_widget); addPreferencesFromResource(R.xml.pref_widgets); addPreferencesFromResource(R.xml.pref_create_widget); // Set the result to CANCELED. This will cause the widget host to cancel // out of the widget placement if they press the back button. setResult(RESULT_CANCELED); // Find the widget id from the intent. Bundle extras = getIntent().getExtras(); if (extras != null) mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); // If they gave us an intent without the widget id, just bail. if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) finish(); Preference OKpref = findPreference("OKpref"); OKpref.setOnPreferenceClickListener(this); } @Override public void onStart() { super.onStart(); } @Override public void onStop() { super.onStop(); sendBroadcast(new Intent(this, BalanceWidgetProvider.class).setAction(Constants.REFRESH)); } @Override public boolean onPreferenceClick(Preference preference) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); String sAddress = prefs.getString("widgetAddressPref", "INVALID ADDRESS"); String sAddressNickname = prefs.getString("widgetAddressNicknamePref", ""); String sBalanceValue = prefs.getString("widgetBalanceValuePref", Constants.DEFAULT_CURRENCY_PAIR); // Save widget configuration saveAddressPref(this, mAppWidgetId, sAddress.trim()); saveNicknamePref(this, mAppWidgetId, sAddressNickname.trim()); saveCurrencyPref(this, mAppWidgetId, sBalanceValue); // Clear potentially sensitive information prefs.edit().remove("widgetAddressPref").commit(); prefs.edit().remove("widgetAddressNicknamePref").commit(); // Make sure we pass back the original appWidgetId Intent resultValue = new Intent(); resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId); setResult(RESULT_OK, resultValue); finish(); return true; } }
38.9375
118
0.724808
d7a4820441facee2534f35ec237f0dc7ab3c9bd9
352
package com.mars.junit; import com.mars.mybatis.init.InitJdbc; /** * junit */ public abstract class MarsJunit { /** * 加载项目启动的必要数据 * @param packName */ public void init(String packName){ MarsJunitStart.start(new InitJdbc(),packName,this,null); } /** * 单测开始前 */ public abstract void before(); }
15.304348
64
0.599432
f49ce8464246c66d2fbab45692325608de577ef0
7,798
package com.godcheese.tile.database; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; /** * @author godcheese [[email protected]] * @date 2018-04-21 */ public class SqlGenerateProperties { /** * 数据库类型,用语解析sql语句 */ private DatabaseType databaseType = DatabaseType.MYSQL; /** * sql 文件目录 */ private String sqlDirectory; /** * sql 文件后缀,一般为 .sql */ private String sqlFileSuffix = ".sql"; /** * 实体文件生成后保存目录 */ private String entityDirectory; /** * 实体文件前缀,一般为 Entity.java */ private String entityFileSuffix = "Entity.java"; /** * 实体所在的类包 */ private String entityPackage; /** * 实体代码的缩进空格,默认为四个空格 */ private String indentWhiteSpace = " "; /** * 附加 sql 字段 comment 为 javadoc */ private boolean appendComment = true; /** * 字段转成 java 实体属性 type 的规则 */ private Hashtable<String, Class<?>> fieldConvertRuleTable = new Hashtable<>(); /** * sql 字段类型转成 jdbcType 映射表 */ private Hashtable<String, String> jdbcTypeTable = new Hashtable<>(); /** * MyBatis Mapper XML 文件后缀,一般为 Mapper.xml */ private String myBatisMapperXmlFileSuffix = "Mapper.xml"; /** * 生成 MyBatis 相关文件, */ /** * MyBatis Mapper XML 文件生成后保存目录 */ private String myBatisMapperXmlDirectory; /** * mapper package */ private String myBatisMapperPackage; /** * MyBatis Mapper 文件后缀,一般为 Mapper.java */ private String myBatisMapperFileSuffix = "Mapper.java"; /** * MyBatis Mapper 文件生成后保存目录 */ private String myBatisMapperDirectory; public SqlGenerateProperties() { Map<String, Class<?>> fieldConvertRule = new Hashtable<>(5); Map<String, String> jdbcType = new HashMap<>(); switch (this.databaseType) { case MYSQL: // 数据库字段类型 => Java 属性类型 fieldConvertRule.put("BIGINT", Long.class); fieldConvertRule.put("INT", Integer.class); fieldConvertRule.put("TINYINT", Integer.class); fieldConvertRule.put("VARCHAR", String.class); fieldConvertRule.put("DATETIME", Date.class); fieldConvertRule.put("DOUBLE", Double.class); fieldConvertRule.put("TEXT", String.class); fieldConvertRule.put("DECIMAL", BigDecimal.class); // 数据库字段类型 => jdbcType jdbcType.put("BIGINT", "BIGINT"); jdbcType.put("INT", "INT"); jdbcType.put("TINYINT", "TINYINT"); jdbcType.put("VARCHAR", "VARCHAR"); jdbcType.put("DATE", "DATE"); jdbcType.put("DATETIME", "TIMESTAMP"); jdbcType.put("DOUBLE", "DOUBLE"); jdbcType.put("TEXT", "LONGVARCHAR"); jdbcType.put("DECIMAL", "DECIMAL"); break; case ORACLE: fieldConvertRule.put("NCLOB", String.class); break; default: break; } this.fieldConvertRuleTable.putAll(fieldConvertRule); this.jdbcTypeTable.putAll(jdbcType); } public DatabaseType getDatabaseType() { return databaseType; } public void setDatabaseType(DatabaseType databaseType) { this.databaseType = databaseType; } public String getSqlDirectory() { return sqlDirectory; } public void setSqlDirectory(String sqlDirectory) { this.sqlDirectory = sqlDirectory; } public String getSqlFileSuffix() { return sqlFileSuffix; } public void setSqlFileSuffix(String sqlFileSuffix) { this.sqlFileSuffix = sqlFileSuffix; } public String getEntityDirectory() { return entityDirectory; } public void setEntityDirectory(String entityDirectory) { this.entityDirectory = entityDirectory; } public String getEntityFileSuffix() { return entityFileSuffix; } public void setEntityFileSuffix(String entityFileSuffix) { this.entityFileSuffix = entityFileSuffix; } public String getEntityPackage() { return entityPackage; } public void setEntityPackage(String entityPackage) { this.entityPackage = entityPackage; } public String getIndentWhiteSpace() { return indentWhiteSpace; } public void setIndentWhiteSpace(String indentWhiteSpace) { this.indentWhiteSpace = indentWhiteSpace; } public boolean getAppendComment() { return appendComment; } public void setAppendComment(boolean appendComment) { this.appendComment = appendComment; } public Hashtable<String, Class<?>> getFieldConvertRuleTable() { return fieldConvertRuleTable; } public void setFieldConvertRuleTable(Hashtable<String, Class<?>> fieldConvertRuleTable) { this.fieldConvertRuleTable = fieldConvertRuleTable; } public Hashtable<String, String> getJdbcTypeTable() { return jdbcTypeTable; } public void setJdbcTypeTable(Hashtable<String, String> jdbcTypeTable) { this.jdbcTypeTable = jdbcTypeTable; } public String getMyBatisMapperXmlFileSuffix() { return myBatisMapperXmlFileSuffix; } public void setMyBatisMapperXmlFileSuffix(String myBatisMapperXmlFileSuffix) { this.myBatisMapperXmlFileSuffix = myBatisMapperXmlFileSuffix; } public String getMyBatisMapperXmlDirectory() { return myBatisMapperXmlDirectory; } public void setMyBatisMapperXmlDirectory(String myBatisMapperXmlDirectory) { this.myBatisMapperXmlDirectory = myBatisMapperXmlDirectory; } public String getMyBatisMapperPackage() { return myBatisMapperPackage; } public void setMyBatisMapperPackage(String myBatisMapperPackage) { this.myBatisMapperPackage = myBatisMapperPackage; } public String getMyBatisMapperFileSuffix() { return myBatisMapperFileSuffix; } public void setMyBatisMapperFileSuffix(String myBatisMapperFileSuffix) { this.myBatisMapperFileSuffix = myBatisMapperFileSuffix; } public String getMyBatisMapperDirectory() { return myBatisMapperDirectory; } public void setMyBatisMapperDirectory(String myBatisMapperDirectory) { this.myBatisMapperDirectory = myBatisMapperDirectory; } public enum DatabaseType { /** * MySQL */ MYSQL("mysql"), /** * Oracle */ ORACLE("oracle"), ; private String value; DatabaseType(String value) { this.value = value; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } } public enum MySqlFieldType { /** * bigint */ BIGINT("bigint"), /** * varchar */ VARCHAR("varchar"), /** * double */ DOUBLE("double"), /** * int */ INT("int"), /** * text */ TEXT("text"), /** * datetime */ DATETIME("datetime"), /** * timestamp */ TIMESTAMP("timestamp"); private String value; MySqlFieldType(String value) { this.value = value; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } } }
24.522013
93
0.594127
101d45b268e80591e1fef601f45bed17b9d1933a
3,157
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.registry.lifecycle.impl; import com.alipay.sofa.registry.lifecycle.Lifecycle; import com.alipay.sofa.registry.lifecycle.LifecycleController; import com.alipay.sofa.registry.lifecycle.LifecycleState; import com.alipay.sofa.registry.log.Logger; import com.alipay.sofa.registry.log.LoggerFactory; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; public class LifecycleTest { private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleTest.class); @Test public void testDefaultLifecycleState() { Lifecycle lifecycle = Mockito.mock(Lifecycle.class); LifecycleController controller = Mockito.mock(LifecycleController.class); DefaultLifecycleState state = new DefaultLifecycleState(lifecycle, controller, LOGGER); Assert.assertTrue(state.isEmpty()); Assert.assertFalse(state.isInitializing()); Assert.assertFalse(state.isInitialized()); Assert.assertFalse(state.isStarting()); Assert.assertFalse(state.isStarted()); Assert.assertFalse(state.isStopping()); // not init, state is stopped and disposed Assert.assertTrue(state.isStopped()); Assert.assertFalse(state.isDisposing()); Assert.assertTrue(state.isDisposed()); Assert.assertFalse(state.isPositivelyDisposed()); Assert.assertFalse(state.isPositivelyStopped()); state.setPhase(LifecycleState.LifecyclePhase.INITIALIZING); Assert.assertTrue(state.isInitializing()); Assert.assertFalse(state.isInitialized()); state.setPhase(LifecycleState.LifecyclePhase.STARTING); Assert.assertTrue(state.isStarting()); Assert.assertFalse(state.isStarted()); state.setPhase(LifecycleState.LifecyclePhase.STOPPING); Assert.assertTrue(state.isStopping()); Assert.assertFalse(state.isStopped()); state.setPhase(LifecycleState.LifecyclePhase.DISPOSING); Assert.assertTrue(state.isDisposing()); Assert.assertFalse(state.isDisposed()); state.setPhase(LifecycleState.LifecyclePhase.DISPOSED); Assert.assertTrue(state.isPositivelyDisposed()); Assert.assertTrue(state.isPositivelyStopped()); Assert.assertTrue(state.toString(), state.toString().contains("DISPOSED")); // rollback to DISPOSING state.rollback(new RuntimeException()); Assert.assertTrue(state.toString(), state.toString().contains("DISPOSING")); } }
39.4625
91
0.764333
5c4524e33bd0670f3009c47d43731fb81b8dc52c
45
empty body declaration empty body declaration
45
45
0.888889
e64697cfb9317c1f800beccd993d32d21e48e67f
1,162
import CGAL.Kernel.Point_3; import CGAL.Kernel.Weighted_point_3; import CGAL.Triangulation_3.Regular_triangulation_3; import java.util.Vector; public class regular_3 { public static void main(String arg[]){ // generate points on a 3D grid Vector<Weighted_point_3> P=new Vector<Weighted_point_3>(); int number_of_points = 0; for (int z=0 ; z<5 ; z++) for (int y=0 ; y<5 ; y++) for (int x=0 ; x<5 ; x++) { Point_3 p = new Point_3(x, y, z); double w = (x+y-z*y*x)*2.0; // let's say this is the weight. P.add(new Weighted_point_3(p, w)); ++number_of_points; } Regular_triangulation_3 T = new Regular_triangulation_3(); // insert all points in a row (this is faster than one insert() at a time). T.insert (P.iterator()); assert T.is_valid(); assert T.dimension() == 3; System.out.println("Number of vertices : " + T.number_of_vertices()); // removal of all vertices int count = 0; while (T.number_of_vertices() > 0) { T.remove (T.finite_vertices().next()); ++count; } assert count == number_of_points; } }
26.409091
79
0.610155
b9edae2126737e4f388783f47f1802381711139f
1,135
package com.teste.weecode.rows; public class UsuarioRow { private Long idUsuario; private String nome; private Long idPerfilAdm; private String tituloPerfilAdm; private String idAreaPadrao; private String token; public UsuarioRow() { } public UsuarioRow(String token) { this.token = token; } public Long getIdUsuario() { return idUsuario; } public void setIdUsuario(Long idUsuario) { this.idUsuario = idUsuario; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public Long getIdPerfilAdm() { return idPerfilAdm; } public void setIdPerfilAdm(Long idPerfilAdm) { this.idPerfilAdm = idPerfilAdm; } public String getTituloPerfilAdm() { return tituloPerfilAdm; } public void setTituloPerfilAdm(String tituloPerfilAdm) { this.tituloPerfilAdm = tituloPerfilAdm; } public String getIdAreaPadrao() { return idAreaPadrao; } public void setIdAreaPadrao(String idAreaPadrao) { this.idAreaPadrao = idAreaPadrao; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
16.940299
57
0.727753
07b0902fb59a204f6e247302104b23e0d92bde8d
44,642
/* * Copyright (c) 2015-2020 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.evolveum.polygon.connector.ldap.ad; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.net.ssl.HostnameVerifier; import com.evolveum.polygon.connector.ldap.sync.ModifyTimestampSyncStrategy; import org.apache.directory.api.ldap.model.constants.SchemaConstants; import org.apache.directory.api.ldap.model.entry.Entry; import org.apache.directory.api.ldap.model.entry.Modification; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException; import org.apache.directory.api.ldap.model.exception.LdapOperationException; import org.apache.directory.api.ldap.model.exception.LdapOtherException; import org.apache.directory.api.ldap.model.message.LdapResult; import org.apache.directory.api.ldap.model.message.ModifyResponse; import org.apache.directory.api.ldap.model.message.ResultCodeEnum; import org.apache.directory.api.ldap.model.message.SearchScope; import org.apache.directory.api.ldap.model.name.Dn; import org.apache.directory.api.ldap.model.name.Rdn; import org.apache.directory.api.ldap.model.schema.AttributeType; import org.apache.directory.api.ldap.model.schema.LdapComparator; import org.apache.directory.api.ldap.model.schema.LdapSyntax; import org.apache.directory.api.ldap.model.schema.MatchingRule; import org.apache.directory.api.ldap.model.schema.Normalizer; import org.apache.directory.api.ldap.model.schema.ObjectClass; import org.apache.directory.api.ldap.model.schema.SchemaErrorHandler; import org.apache.directory.api.ldap.model.schema.SchemaManager; import org.apache.directory.api.ldap.model.schema.SchemaObject; import org.apache.directory.api.ldap.model.schema.comparators.NormalizingComparator; import org.apache.directory.api.ldap.model.schema.comparators.StringComparator; import org.apache.directory.api.ldap.model.schema.normalizers.DeepTrimToLowerNormalizer; import org.apache.directory.api.ldap.model.schema.registries.AttributeTypeRegistry; import org.apache.directory.api.ldap.model.schema.registries.MatchingRuleRegistry; import org.apache.directory.api.ldap.model.schema.registries.ObjectClassRegistry; import org.apache.directory.api.ldap.model.schema.registries.Registries; import org.apache.directory.api.ldap.model.schema.registries.Schema; import org.apache.directory.api.ldap.model.schema.registries.SchemaObjectRegistry; import org.apache.directory.api.ldap.model.schema.syntaxCheckers.DirectoryStringSyntaxChecker; import org.apache.directory.api.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker; import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager; import org.apache.directory.ldap.client.api.DefaultSchemaLoader; import org.apache.directory.ldap.client.api.LdapNetworkConnection; import org.identityconnectors.common.logging.Log; import org.identityconnectors.common.security.GuardedString; import org.identityconnectors.framework.common.exceptions.ConfigurationException; import org.identityconnectors.framework.common.exceptions.ConnectorException; import org.identityconnectors.framework.common.exceptions.ConnectorIOException; import org.identityconnectors.framework.common.exceptions.ConnectorSecurityException; import org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException; import org.identityconnectors.framework.common.exceptions.UnknownUidException; import org.identityconnectors.framework.common.objects.Attribute; import org.identityconnectors.framework.common.objects.AttributeBuilder; import org.identityconnectors.framework.common.objects.AttributeDelta; import org.identityconnectors.framework.common.objects.AttributeDeltaBuilder; import org.identityconnectors.framework.common.objects.OperationOptions; import org.identityconnectors.framework.common.objects.OperationalAttributeInfos; import org.identityconnectors.framework.common.objects.OperationalAttributes; import org.identityconnectors.framework.common.objects.ResultsHandler; import org.identityconnectors.framework.common.objects.ScriptContext; import org.identityconnectors.framework.common.objects.Uid; import org.identityconnectors.framework.spi.Configuration; import org.identityconnectors.framework.spi.ConnectorClass; import org.identityconnectors.framework.spi.operations.ScriptOnResourceOp; import com.evolveum.polygon.common.GuardedStringAccessor; import com.evolveum.polygon.common.SchemaUtil; import com.evolveum.polygon.connector.ldap.AbstractLdapConfiguration; import com.evolveum.polygon.connector.ldap.AbstractLdapConnector; import com.evolveum.polygon.connector.ldap.LdapUtil; import com.evolveum.polygon.connector.ldap.OperationLog; import com.evolveum.polygon.connector.ldap.schema.LdapFilterTranslator; import com.evolveum.polygon.connector.ldap.schema.AbstractSchemaTranslator; import com.evolveum.polygon.connector.ldap.search.DefaultSearchStrategy; import com.evolveum.polygon.connector.ldap.search.SearchStrategy; @ConnectorClass(displayNameKey = "connector.ldap.ad.display", configurationClass = AdLdapConfiguration.class) public class AdLdapConnector extends AbstractLdapConnector<AdLdapConfiguration> { private static final Log LOG = Log.getLog(AdLdapConnector.class); private GlobalCatalogConnectionManager globalCatalogConnectionManager; @Override public void init(Configuration configuration) { super.init(configuration); globalCatalogConnectionManager = new GlobalCatalogConnectionManager(getConfiguration()); } @Override public void dispose() { super.dispose(); } @Override protected void extraTests() { super.extraTests(); } @Override protected void reconnectAfterTest() { } @Override protected AbstractSchemaTranslator<AdLdapConfiguration> createSchemaTranslator() { return new AdSchemaTranslator(getSchemaManager(), getConfiguration()); } @Override protected LdapFilterTranslator<AdLdapConfiguration> createLdapFilterTranslator(ObjectClass ldapObjectClass) { return new AdLdapFilterTranslator(getSchemaTranslator(), ldapObjectClass); } @Override protected DefaultSchemaManager createSchemaManager(boolean schemaQuirksMode) throws LdapException { if (getConfiguration().isNativeAdSchema()) { // Construction of SchemaLoader actually loads all the schemas from server. AdSchemaLoader schemaLoader = new AdSchemaLoader(getConnectionManager().getDefaultConnection()); if (LOG.isOk()) { LOG.ok("AD Schema loader: {0} schemas ({1} enabled)", schemaLoader.getAllSchemas().size(), schemaLoader.getAllEnabled().size()); for (Schema schema : schemaLoader.getAllSchemas()) { LOG.ok("AD Schema loader: schema {0}: enabled={1}, {2} objects", schema.getSchemaName(), schema.isEnabled(), schema.getContent().size()); } } return new AdSchemaManager(schemaLoader); } else { return super.createSchemaManager(schemaQuirksMode); } } @Override protected AdSchemaTranslator getSchemaTranslator() { return (AdSchemaTranslator)super.getSchemaTranslator(); } protected SchemaErrorHandler createSchemaErrorHandler() { // null by default. This means that a default logging error handler from directory API // will be used. May be overridden by subsclasses. return new MutedLoggingSchemaErrorHandler(); } @Override protected boolean isLogSchemaErrors() { // There are too many built-in schema errors in AD that this only pollutes the logs return false; } @Override protected Set<Attribute> prepareCreateConnIdAttributes(org.identityconnectors.framework.common.objects.ObjectClass connIdObjectClass, org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass, Set<Attribute> createAttributes) { if (getConfiguration().isRawUserAccountControlAttribute() || !getSchemaTranslator().isUserObjectClass(ldapStructuralObjectClass.getName())) { return super.prepareCreateConnIdAttributes(connIdObjectClass, ldapStructuralObjectClass, createAttributes); } Set<AdConstants.UAC> uacAddSet = new HashSet<AdConstants.UAC>(); Set<AdConstants.UAC> uacDelSet = new HashSet<AdConstants.UAC>(); Set<Attribute> newCreateAttributes = new HashSet<Attribute>(); for (Attribute createAttr : createAttributes) { //collect deltas affecting uac. Will be processed below String createAttrName = createAttr.getName(); if (createAttrName.equals(OperationalAttributes.ENABLE_NAME) || AdConstants.UAC.forName(createAttrName) != null) { //OperationalAttributes.ENABLE_NAME is replaced by dConstants.UAC.ADS_UF_ACCOUNTDISABLE.name() AdConstants.UAC uacVal = Enum.valueOf(AdConstants.UAC.class, createAttrName.equals(OperationalAttributes.ENABLE_NAME)? AdConstants.UAC.ADS_UF_ACCOUNTDISABLE.name() : createAttrName); List<Object> values = createAttr.getValue(); if (values != null && values.size() >0) { Object val = values.get(0); if (val instanceof Boolean) { //OperationalAttributes.ENABLE_NAME = true means AdConstants.UAC.ADS_UF_ACCOUNTDISABLE = false if (createAttrName.equals(OperationalAttributes.ENABLE_NAME)) { if ((Boolean)val) { val = new Boolean(false); } else val = new Boolean(true); } //value was changed to true if ((Boolean)val) { uacAddSet.add(uacVal); } //value was changed to false else uacDelSet.add(uacVal); } } } //all others remain unchanged else newCreateAttributes.add(createAttr); } //no uac attributes affected? we cannot return, we have to set at least AdConstants.UAC.ADS_UF_NORMAL_ACCOUNT Integer userAccountControl = AdConstants.UAC.ADS_UF_NORMAL_ACCOUNT.getBit(); //if bit is not set: add it for (AdConstants.UAC uac : uacAddSet) { if ((userAccountControl & uac.getBit()) == 0) { userAccountControl = userAccountControl + uac.getBit(); } } //if bit is set: remove it for (AdConstants.UAC uac : uacDelSet) { if ((userAccountControl & uac.getBit()) != 0) { userAccountControl = userAccountControl - uac.getBit(); } } //create new attribute for useraccountcontrol, having new value Attribute uacAttr = AttributeBuilder.build(AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, userAccountControl); newCreateAttributes.add(uacAttr); return newCreateAttributes; } @Override protected void prepareCreateLdapAttributes(org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass, Entry entry) { super.prepareCreateLdapAttributes(ldapStructuralObjectClass, entry); // objectCategory if (getConfiguration().isAddDefaultObjectCategory()) { if (ldapStructuralObjectClass instanceof AdObjectClass) { String existingObjectCategory = LdapUtil.getStringAttribute(entry, AdConstants.ATTRIBUTE_OBJECT_CATEGORY_NAME); if (existingObjectCategory == null) { String defaultObjectCategory = ((AdObjectClass)ldapStructuralObjectClass).getDefaultObjectCategory(); if (defaultObjectCategory == null) { LOG.warn("Requested to add default object class, but there is no default object category definition in object class {0}", ldapStructuralObjectClass.getName()); } else { try { entry.add(AdConstants.ATTRIBUTE_OBJECT_CATEGORY_NAME, defaultObjectCategory); } catch (LdapException e) { throw new IllegalStateException("Error adding attribute "+AdConstants.ATTRIBUTE_OBJECT_CATEGORY_NAME+" to entry: "+e.getMessage(), e); } } } } else { LOG.warn("Requested to add default object class, but native AD schema is not available for object class {0}", ldapStructuralObjectClass.getName()); } } } @Override public Set<AttributeDelta> updateDelta(org.identityconnectors.framework.common.objects.ObjectClass connIdObjectClass, Uid uid, Set<AttributeDelta> deltas, OperationOptions options) { if (getConfiguration().isRawUserAccountControlAttribute()) { return super.updateDelta(connIdObjectClass, uid, deltas, options); } else return super.updateDelta(connIdObjectClass, uid, prepareDeltas(uid, deltas), options); } private Set<AttributeDelta> prepareDeltas(Uid uid, Set<AttributeDelta> deltas) { Set<AdConstants.UAC> uacAddSet = new HashSet<AdConstants.UAC>(); Set<AdConstants.UAC> uacDelSet = new HashSet<AdConstants.UAC>(); Set<AttributeDelta> newDeltas = new HashSet<AttributeDelta>(); for (AttributeDelta delta : deltas) { //collect deltas affecting uac. Will be processed below String deltaName = delta.getName(); //if (deltaName.equals(OperationalAttributes.ENABLE_NAME) || Enum.valueOf(AdConstants.UAC.class, deltaName) != null) { if (deltaName.equals(OperationalAttributes.ENABLE_NAME) || AdConstants.UAC.forName(deltaName) != null) { //OperationalAttributes.ENABLE_NAME is replaced by dConstants.UAC.ADS_UF_ACCOUNTDISABLE.name() AdConstants.UAC uacVal = Enum.valueOf(AdConstants.UAC.class, deltaName.equals(OperationalAttributes.ENABLE_NAME)? AdConstants.UAC.ADS_UF_ACCOUNTDISABLE.name() : deltaName); List<Object> valuesToReplace = delta.getValuesToReplace(); if (valuesToReplace != null && valuesToReplace.size() >0) { Object val = valuesToReplace.get(0); if (val instanceof Boolean) { //OperationalAttributes.ENABLE_NAME = true means AdConstants.UAC.ADS_UF_ACCOUNTDISABLE = false if (deltaName.equals(OperationalAttributes.ENABLE_NAME)) { if ((Boolean)val) { val = new Boolean(false); } else val = new Boolean(true); } //value was changed to true if ((Boolean)val) { uacAddSet.add(uacVal); } //value was changed to false else uacDelSet.add(uacVal); } } } //all others remain unchanged else newDeltas.add(delta); } //no uac attributes affected: return original deltas if (uacDelSet.isEmpty() && uacAddSet.isEmpty()) { return deltas; } // We need original value Entry existingEntry; try { //TODO: (String)uid.getValue().get(0) uid: invaliddn existingEntry = searchSingleEntry(getConnectionManager(), new Dn((String)uid.getNameHintValue()), null, SearchScope.OBJECT, null, "pre-read of entry values for attribute "+AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, null); } catch (LdapInvalidDnException e) { throw new InvalidAttributeValueException("Cannot pre-read of entry for attribute "+ AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME + ": "+uid); } LOG.ok("Pre-read entry for {0}:\n{1}", AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, existingEntry); if (existingEntry == null) { throw new UnknownUidException("Cannot pre-read of entry for attribute "+ AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME + ": "+uid); } Integer userAccountControl = LdapUtil.getIntegerAttribute(existingEntry, AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, null); //if bit is not set: add it for (AdConstants.UAC uac : uacAddSet) { if ((userAccountControl & uac.getBit()) == 0) { userAccountControl = userAccountControl + uac.getBit(); } } //if bit is set: remove it for (AdConstants.UAC uac : uacDelSet) { if ((userAccountControl & uac.getBit()) != 0) { userAccountControl = userAccountControl - uac.getBit(); } } //create new delta for useraccountcontrol, having new value AttributeDelta uacAttrDelta = AttributeDeltaBuilder.build(AdConstants.ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, userAccountControl); newDeltas.add(uacAttrDelta); return newDeltas; } @Override protected void addAttributeModification(Dn dn, List<Modification> modifications, ObjectClass ldapStructuralObjectClass, org.identityconnectors.framework.common.objects.ObjectClass icfObjectClass, AttributeDelta delta) { Rdn firstRdn = dn.getRdns().get(0); String firstRdnAttrName = firstRdn.getAva().getType(); AttributeType modAttributeType = getSchemaTranslator().toLdapAttribute(ldapStructuralObjectClass, delta.getName()); if (firstRdnAttrName.equalsIgnoreCase(modAttributeType.getName())) { // Ignore this modification. It is already done by the rename operation. // Attempting to do it will result in an error. return; } else { super.addAttributeModification(dn, modifications, ldapStructuralObjectClass, icfObjectClass, delta); } } @Override protected SearchStrategy<AdLdapConfiguration> chooseSearchStrategy(org.identityconnectors.framework.common.objects.ObjectClass objectClass, ObjectClass ldapObjectClass, ResultsHandler handler, OperationOptions options) { SearchStrategy<AdLdapConfiguration> searchStrategy = super.chooseSearchStrategy(objectClass, ldapObjectClass, handler, options); searchStrategy.setAttributeHandler(new AdAttributeHandler(searchStrategy)); return searchStrategy; } @Override protected SearchStrategy<AdLdapConfiguration> getDefaultSearchStrategy(org.identityconnectors.framework.common.objects.ObjectClass objectClass, ObjectClass ldapObjectClass, ResultsHandler handler, OperationOptions options) { SearchStrategy<AdLdapConfiguration> searchStrategy = super.getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options); searchStrategy.setAttributeHandler(new AdAttributeHandler(searchStrategy)); return searchStrategy; } @Override protected SearchStrategy<AdLdapConfiguration> searchByUid(Uid uid, org.identityconnectors.framework.common.objects.ObjectClass objectClass, ObjectClass ldapObjectClass, final ResultsHandler handler, OperationOptions options) { final String uidValue = SchemaUtil.getSingleStringNonBlankValue(uid); // Trivial (but not really realistic) case: UID is DN if (LdapUtil.isDnAttribute(getConfiguration().getUidAttribute())) { return searchByDn(getSchemaTranslator().toDn(uidValue), objectClass, ldapObjectClass, handler, options); } if (uid.getNameHint() != null) { // First attempt: name hint, GUID search (last seen DN) // Name hint is the last DN that we have seen for this object. However, the object may have // been renamed or may have moved. Therefore use the name hint just to select the connection. // Once we have the connection then forget name hint and use GUID DN to get the entry. // This is the most efficient and still very reliable way to get the entry. Dn nameHintDn = getSchemaTranslator().toDn(uid.getNameHint()); SearchStrategy<AdLdapConfiguration> searchStrategy = getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options); LdapNetworkConnection connection = getConnectionManager().getConnection(nameHintDn, options); searchStrategy.setExplicitConnection(connection); Dn guidDn = getSchemaTranslator().getGuidDn(uidValue); String[] attributesToGet = getAttributesToGet(ldapObjectClass, options); try { searchStrategy.search(guidDn, null, SearchScope.OBJECT, attributesToGet); } catch (LdapException e) { throw LdapUtil.processLdapException("Error searching for DN '"+guidDn+"'", e); } if (searchStrategy.getNumberOfEntriesFound() > 0) { return searchStrategy; } } // Second attempt: global catalog if (AdLdapConfiguration.GLOBAL_CATALOG_STRATEGY_NONE.equals(getConfiguration().getGlobalCatalogStrategy())) { // Make search with <GUID=....> baseDn on default connection. Rely on referrals to point our head to // the correct domain controller in multi-domain environment. // We know that this can return at most one object. Therefore always use simple search. SearchStrategy<AdLdapConfiguration> searchStrategy = getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options); String[] attributesToGet = getAttributesToGet(ldapObjectClass, options); Dn guidDn = getSchemaTranslator().getGuidDn(uidValue); try { searchStrategy.search(guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, attributesToGet); } catch (LdapException e) { throw LdapUtil.processLdapException("Error searching for GUID '"+uidValue+"'", e); } if (searchStrategy.getNumberOfEntriesFound() > 0) { return searchStrategy; } } else if (AdLdapConfiguration.GLOBAL_CATALOG_STRATEGY_READ.equals(getConfiguration().getGlobalCatalogStrategy())) { // Make a search directly to the global catalog server. Present that as final result. // We know that this can return at most one object. Therefore always use simple search. SearchStrategy<AdLdapConfiguration> searchStrategy = new DefaultSearchStrategy<>(globalCatalogConnectionManager, getConfiguration(), getSchemaTranslator(), objectClass, ldapObjectClass, handler, options); String[] attributesToGet = getAttributesToGet(ldapObjectClass, options); Dn guidDn = getSchemaTranslator().getGuidDn(uidValue); try { searchStrategy.search(guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, attributesToGet); } catch (LdapException e) { throw LdapUtil.processLdapException("Error searching for GUID '"+uidValue+"'", e); } if (searchStrategy.getNumberOfEntriesFound() > 0) { return searchStrategy; } } else if (AdLdapConfiguration.GLOBAL_CATALOG_STRATEGY_RESOLVE.equals(getConfiguration().getGlobalCatalogStrategy())) { Dn guidDn = getSchemaTranslator().getGuidDn(uidValue); Entry entry = searchSingleEntry(globalCatalogConnectionManager, guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, new String[]{AbstractLdapConfiguration.PSEUDO_ATTRIBUTE_DN_NAME}, "global catalog entry for GUID "+uidValue, options); if (entry == null) { throw new UnknownUidException("Entry for GUID "+uidValue+" was not found in global catalog"); } LOG.ok("Resolved GUID {0} in glogbal catalog to DN {1}", uidValue, entry.getDn()); Dn dn = entry.getDn(); SearchStrategy<AdLdapConfiguration> searchStrategy = getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options); // We need to force the use of explicit connection here. The search is still using the <GUID=..> dn // The search strategy cannot use that to select a connection. So we need to select a connection // based on the DN returned from global catalog explicitly. // We also cannot use the DN from the global catalog as the base DN for the search. // The global catalog may not be replicated yet and it may not have the correct DN // (e.g. the case of quick read after rename) LdapNetworkConnection connection = getConnectionManager().getConnection(dn, options); searchStrategy.setExplicitConnection(connection); String[] attributesToGet = getAttributesToGet(ldapObjectClass, options); try { searchStrategy.search(guidDn, null, SearchScope.OBJECT, attributesToGet); } catch (LdapException e) { throw LdapUtil.processLdapException("Error searching for DN '"+guidDn+"'", e); } if (searchStrategy.getNumberOfEntriesFound() > 0) { return searchStrategy; } } else { throw new IllegalStateException("Unknown global catalog strategy '"+getConfiguration().getGlobalCatalogStrategy()+"'"); } // Third attempt: brutal search over all the servers if (getConfiguration().isAllowBruteForceSearch()) { LOG.ok("Cannot find object with GUID {0} by using name hint or global catalog. Resorting to brute-force search", uidValue); Dn guidDn = getSchemaTranslator().getGuidDn(uidValue); String[] attributesToGet = getAttributesToGet(ldapObjectClass, options); for (LdapNetworkConnection connection: getConnectionManager().getAllConnections()) { SearchStrategy<AdLdapConfiguration> searchStrategy = getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options); searchStrategy.setExplicitConnection(connection); try { searchStrategy.search(guidDn, null, SearchScope.OBJECT, attributesToGet); } catch (LdapException e) { throw LdapUtil.processLdapException("Error searching for DN '"+guidDn+"'", e); } if (searchStrategy.getNumberOfEntriesFound() > 0) { return searchStrategy; } } } else { LOG.ok("Cannot find object with GUID {0} by using name hint or global catalog. Brute-force search is disabled. Found nothing.", uidValue); } // Found nothing return null; } @Override protected Dn resolveDn(org.identityconnectors.framework.common.objects.ObjectClass objectClass, Uid uid, OperationOptions options) { String guid = uid.getUidValue(); if (uid.getNameHint() != null) { // Try to use name hint to select the correct server, but still search by GUID. The entry might // have been renamed since we looked last time and the name hint may be out of date. But it is // likely that it is still OK for selecting correct server. // Global catalog updates are quite lazy. Looking at global catalog can get even worse results // than name hint. String dnHintString = uid.getNameHintValue(); Dn dnHint = getSchemaTranslator().toDn(dnHintString); LOG.ok("Resolvig DN by using name hint {0} and guid", dnHint, guid); Dn guidDn = getSchemaTranslator().getGuidDn(guid); LOG.ok("Resolvig DN by search for {0} (no global catalog)", guidDn); Entry entry = searchSingleEntry(getConnectionManager(), guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, new String[]{AbstractLdapConfiguration.PSEUDO_ATTRIBUTE_DN_NAME}, "LDAP entry for GUID "+guid, dnHint, options); if (entry != null) { return entry.getDn(); } else { LOG.ok("Resolvig DN for name hint {0} returned no object", dnHintString); } } Dn guidDn = getSchemaTranslator().getGuidDn(guid); if (AdLdapConfiguration.GLOBAL_CATALOG_STRATEGY_NONE.equals(getConfiguration().getGlobalCatalogStrategy())) { LOG.ok("Resolvig DN by search for {0} (no global catalog)", guidDn); Entry entry = searchSingleEntry(getConnectionManager(), guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, new String[]{AbstractLdapConfiguration.PSEUDO_ATTRIBUTE_DN_NAME}, "LDAP entry for GUID "+guid, options); if (entry == null) { throw new UnknownUidException("Entry for GUID "+guid+" was not found"); } return entry.getDn(); } else { LOG.ok("Resolvig DN by search for {0} (global catalog)", guidDn); Entry entry = searchSingleEntry(globalCatalogConnectionManager, guidDn, LdapUtil.createAllSearchFilter(), SearchScope.OBJECT, new String[]{AbstractLdapConfiguration.PSEUDO_ATTRIBUTE_DN_NAME}, "LDAP entry for GUID "+guid, options); if (entry == null) { throw new UnknownUidException("Entry for GUID "+guid+" was not found in global catalog"); } LOG.ok("Resolved GUID {0} in glogbal catalog to DN {1}", guid, entry.getDn()); return entry.getDn(); } } @Override protected void postUpdate(org.identityconnectors.framework.common.objects.ObjectClass connIdObjectClass, Uid uid, Set<AttributeDelta> deltas, OperationOptions options, Dn dn, org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass, List<Modification> ldapModifications) { super.postUpdate(connIdObjectClass, uid, deltas, options, dn, ldapStructuralObjectClass, ldapModifications); AttributeDelta forcePasswordChangeDelta = SchemaUtil.findDelta(deltas, OperationalAttributes.FORCE_PASSWORD_CHANGE_NAME); if (forcePasswordChangeDelta != null) { Boolean forcePasswordChangeValue = SchemaUtil.getSingleReplaceValue(forcePasswordChangeDelta, Boolean.class); // This may not be entirely correct: TODO review & test later if (forcePasswordChangeValue != null && forcePasswordChangeValue) { List<Modification> modificationsPwdLastSet = new ArrayList<Modification>(); AttributeDelta attrPwdLastSetDelta = AttributeDeltaBuilder.build(AdConstants.ATTRIBUTE_PWD_LAST_SET_NAME, "0"); addAttributeModification(dn, modificationsPwdLastSet, ldapStructuralObjectClass, connIdObjectClass, attrPwdLastSetDelta); modify(dn, modificationsPwdLastSet, options); } } else if (getConfiguration().isForcePasswordChangeAtNextLogon() && isUserPasswordChanged(deltas, ldapStructuralObjectClass)) { List<Modification> modificationsPwdLastSet = new ArrayList<Modification>(); AttributeDelta attrPwdLastSetDelta = AttributeDeltaBuilder.build(AdConstants.ATTRIBUTE_PWD_LAST_SET_NAME, "0"); addAttributeModification(dn, modificationsPwdLastSet, ldapStructuralObjectClass, connIdObjectClass, attrPwdLastSetDelta); modify(dn, modificationsPwdLastSet, options); } } private boolean isUserPasswordChanged(Set<AttributeDelta> deltas, org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass) { //if password is in modifications set pwdLastSet=0 ("must change password at next logon") if (getSchemaTranslator().isUserObjectClass(ldapStructuralObjectClass.getName())) { for (AttributeDelta delta: deltas) { // coming from midpoint password is __PASSWORD__ // TODO: should we additionally ask for icfAttr.getName().equals(getConfiguration().getPasswordAttribute()? if (OperationalAttributeInfos.PASSWORD.is(delta.getName())) { return true; } } } return false; } @Override protected RuntimeException processModifyResult(Dn dn, List<Modification> modifications, ModifyResponse modifyResponse) { ResultCodeEnum resultCode = modifyResponse.getLdapResult().getResultCode(); if (ResultCodeEnum.CONSTRAINT_VIOLATION.equals(resultCode)) { if (modifyResponse.getLdapResult().getDiagnosticMessage().contains(getConfiguration().getPasswordAttribute())) { // This is in fact password policy error, e.g. attempt to set the same password as current password InvalidAttributeValueException e = new InvalidAttributeValueException("Error modifying LDAP entry "+dn+": "+LdapUtil.formatLdapMessage(modifyResponse.getLdapResult())); e.setAffectedAttributeNames(Collections.singleton(OperationalAttributes.PASSWORD_NAME)); throw e; } } return super.processModifyResult(dn, modifications, modifyResponse); } @Override protected void patchSchemaManager(SchemaManager schemaManager) { super.patchSchemaManager(schemaManager); if (!getConfiguration().isTweakSchema()) { return; } Registries registries = schemaManager.getRegistries(); MatchingRuleRegistry matchingRuleRegistry = registries.getMatchingRuleRegistry(); MatchingRule mrCaseIgnoreMatch = matchingRuleRegistry.get(SchemaConstants.CASE_IGNORE_MATCH_MR_OID); // Microsoft ignores matching rules. Completely. There is not even a single definition. if (mrCaseIgnoreMatch == null) { MatchingRule correctMrCaseIgnoreMatch = new MatchingRule(SchemaConstants.CASE_IGNORE_MATCH_MR_OID); correctMrCaseIgnoreMatch.setSyntaxOid(SchemaConstants.DIRECTORY_STRING_SYNTAX); Normalizer normalizer = new DeepTrimToLowerNormalizer(SchemaConstants.CASE_IGNORE_MATCH_MR_OID); correctMrCaseIgnoreMatch.setNormalizer(normalizer); LdapComparator<?> comparator = new NormalizingComparator(correctMrCaseIgnoreMatch.getOid(), normalizer, new StringComparator(correctMrCaseIgnoreMatch.getOid())); correctMrCaseIgnoreMatch.setLdapComparator(comparator); mrCaseIgnoreMatch = correctMrCaseIgnoreMatch; register(matchingRuleRegistry, correctMrCaseIgnoreMatch); } // Microsoft violates RFC4519 fixAttribute(schemaManager, SchemaConstants.CN_AT_OID, SchemaConstants.CN_AT, createStringSyntax(SchemaConstants.DIRECTORY_STRING_SYNTAX), mrCaseIgnoreMatch, false); fixAttribute(schemaManager, SchemaConstants.DOMAIN_COMPONENT_AT_OID, SchemaConstants.DC_AT, createStringSyntax(SchemaConstants.DIRECTORY_STRING_SYNTAX), mrCaseIgnoreMatch, false); fixAttribute(schemaManager, SchemaConstants.OU_AT_OID, SchemaConstants.OU_AT, createStringSyntax(SchemaConstants.DIRECTORY_STRING_SYNTAX), mrCaseIgnoreMatch, false); // unicodePwd is not detected as binary, but it should be fixAttribute(schemaManager, AdConstants.ATTRIBUTE_UNICODE_PWD_OID, AdConstants.ATTRIBUTE_UNICODE_PWD_NAME, createBinarySyntax(SchemaConstants.OCTET_STRING_SYNTAX), null, true); } private LdapSyntax createStringSyntax(String syntaxOid) { LdapSyntax syntax = new LdapSyntax(syntaxOid); syntax.setHumanReadable(true); syntax.setSyntaxChecker(DirectoryStringSyntaxChecker.INSTANCE); return syntax; } private LdapSyntax createBinarySyntax(String syntaxOid) { LdapSyntax syntax = new LdapSyntax(syntaxOid); syntax.setHumanReadable(false); syntax.setSyntaxChecker(OctetStringSyntaxChecker.INSTANCE); return syntax; } private void fixAttribute(SchemaManager schemaManager, String attrOid, String attrName, LdapSyntax syntax, MatchingRule equalityMr, boolean force) { Registries registries = schemaManager.getRegistries(); AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry(); ObjectClassRegistry objectClassRegistry = registries.getObjectClassRegistry(); AttributeType existingAttrType = attributeTypeRegistry.get(attrOid); if (force || existingAttrType == null || existingAttrType.getEquality() == null) { AttributeType correctAttrType; if (existingAttrType != null) { try { attributeTypeRegistry.unregister(existingAttrType); } catch (LdapException e) { throw new IllegalStateException("Error unregistering "+existingAttrType+": "+e.getMessage(), e); } correctAttrType = new AttributeType(existingAttrType.getOid()); correctAttrType.setNames(existingAttrType.getNames()); } else { correctAttrType = new AttributeType(attrOid); correctAttrType.setNames(attrName); } correctAttrType.setSyntax(syntax); if (equalityMr != null) { correctAttrType.setEquality(equalityMr); } correctAttrType.setSingleValued(true); LOG.ok("Registering replacement attributeType: {0}", correctAttrType); register(attributeTypeRegistry, correctAttrType); fixObjectClasses(objectClassRegistry, existingAttrType, correctAttrType); } } private void fixObjectClasses(ObjectClassRegistry objectClassRegistry, AttributeType oldAttributeType, AttributeType newAttributeType) { for (ObjectClass objectClass: objectClassRegistry) { fixOblectClassAttributes(objectClass.getMayAttributeTypes(), oldAttributeType, newAttributeType); fixOblectClassAttributes(objectClass.getMustAttributeTypes(), oldAttributeType, newAttributeType); } } private void fixOblectClassAttributes(List<AttributeType> attributeTypes, AttributeType oldAttributeType, AttributeType newAttributeType) { for (int i = 0; i < attributeTypes.size(); i++) { AttributeType current = attributeTypes.get(i); if (current.equals(oldAttributeType)) { attributeTypes.set(i, newAttributeType); break; } } } private <T extends SchemaObject> void register(SchemaObjectRegistry<T> registry, T object) { try { registry.register(object); } catch (LdapException e) { throw new IllegalStateException("Error registering "+object+": "+e.getMessage(), e); } } @Override protected RuntimeException processLdapResult(String connectorMessage, LdapResult ldapResult) { if (ldapResult.getResultCode() == ResultCodeEnum.UNWILLING_TO_PERFORM) { WillNotPerform willNotPerform = WillNotPerform.parseDiagnosticMessage(ldapResult.getDiagnosticMessage()); if (willNotPerform != null) { try { Class<? extends RuntimeException> exceptionClass = willNotPerform.getExceptionClass(); Constructor<? extends RuntimeException> exceptionConstructor; exceptionConstructor = exceptionClass.getConstructor(String.class); String exceptionMessage = LdapUtil.sanitizeString(ldapResult.getDiagnosticMessage()) + ": " + willNotPerform.name() + ": " + willNotPerform.getMessage(); RuntimeException exception = exceptionConstructor.newInstance(exceptionMessage); LdapUtil.logOperationError(connectorMessage, ldapResult, exceptionMessage); if (exception instanceof InvalidAttributeValueException) { ((InvalidAttributeValueException)exception).setAffectedAttributeNames(willNotPerform.getAffectedAttributes()); } throw exception; } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { LOG.error("Error during LDAP error handling: {0}: {1}", e.getClass(), e.getMessage(), e); // fallback return LdapUtil.processLdapResult(connectorMessage, ldapResult); } } } if (ldapResult.getResultCode() == ResultCodeEnum.OTHER) { RuntimeException otherExpression = processOtherError(connectorMessage, ldapResult.getDiagnosticMessage(), ldapResult, null); if (otherExpression != null) { return otherExpression; } } return LdapUtil.processLdapResult(connectorMessage, ldapResult); } @Override protected RuntimeException processLdapException(String connectorMessage, LdapException ldapException) { if (ldapException instanceof LdapOtherException) { RuntimeException otherExpression = processOtherError(connectorMessage, ldapException.getMessage(), null, (LdapOtherException) ldapException); if (otherExpression != null) { return otherExpression; } } return super.processLdapException(connectorMessage, ldapException); } /** * This is category of errors that we do not know anything just a string error message. * And we have to figure out what is going on just from the message. */ private RuntimeException processOtherError(String connectorMessage, String diagnosticMessage, LdapResult ldapResult, LdapOperationException ldapException) { WindowsErrorCode errorCode = WindowsErrorCode.parseDiagnosticMessage(diagnosticMessage); if (errorCode == null) { return null; } try { Class<? extends RuntimeException> exceptionClass = errorCode.getExceptionClass(); Constructor<? extends RuntimeException> exceptionConstructor; exceptionConstructor = exceptionClass.getConstructor(String.class); String exceptionMessage = LdapUtil.sanitizeString(diagnosticMessage) + ": " + errorCode.name() + ": " + errorCode.getMessage(); RuntimeException exception = exceptionConstructor.newInstance(exceptionMessage); if (ldapResult != null) { LdapUtil.logOperationError(connectorMessage, ldapResult, exceptionMessage); } else { LdapUtil.logOperationError(connectorMessage, ldapException, exceptionMessage); } return exception; } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { LOG.error("Error during LDAP error handling: {0}: {1}", e.getClass(), e.getMessage(), e); // fallback return null; } } @Override protected ModifyTimestampSyncStrategy<AdLdapConfiguration> createModifyTimestampSyncStrategy() { return new ModifyTimestampSyncStrategy<>(getConfiguration(), getConnectionManager(), getSchemaManager(), getSchemaTranslator(), true); } }
53.527578
198
0.686573
a213e36dd4d81a0b43a12bd0701882c08406024a
348
package org.elasticsoftware.elasticactors.tracing; import org.elasticsoftware.elasticactors.tracing.MessagingContextManager.MessagingScope; import javax.annotation.Nullable; public interface LogContextProcessor { void process(@Nullable MessagingScope current, @Nullable MessagingScope next); boolean isLogContextProcessingEnabled(); }
26.769231
88
0.836207
c16c9b885b3641ac8405fa640d2ac3ffcb31c2bd
931
/* * Copyright (c) 2013, Cloudera, Inc. All Rights Reserved. * * Cloudera, Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"). You may not use this file except in * compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for * the specific language governing permissions and limitations under the * License. */ package com.cloudera.oryx.common.math; /** * Superclass of exceptions related to solving a linear system. * * @author Sean Owen */ public abstract class SolverException extends RuntimeException { SolverException() { } SolverException(String message) { super(message); } SolverException(Throwable cause) { super(cause); } }
25.162162
74
0.708915
0c994199e6e9288b309de58538ec34adbd3e65a4
947
package io.fabric8.knative.client.demo; import io.fabric8.knative.client.KnativeClient; import io.fabric8.knative.serving.v1.Service; import io.fabric8.knative.serving.v1.ServiceBuilder; import io.fabric8.kubernetes.api.model.ContainerBuilder; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.KubernetesClient; public class KnativeAdaptDemo { public static void main(String[] args) { try (KubernetesClient client = new DefaultKubernetesClient()) { KnativeClient kn = null; if (client.isAdaptable(KnativeClient.class)) { System.out.println("Client is adaptable to Knative Client, adapting..."); kn = client.adapt(KnativeClient.class); // ... // Use kn for Knative operations } else { System.out.println("Sorry, could not adapt client"); } } } }
36.423077
89
0.662091
b7e950187ef5a2594be82ab357c25068035baa3d
3,831
/******************************************************************************* * Copyright (c) 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.pde.api.tools.util.tests; import junit.framework.TestCase; import org.eclipse.pde.api.tools.internal.util.TarEntry; /** * Test The {@link org.eclipse.pde.api.tools.internal.util.TarEntry} class * * @since 1.0.1 */ public class TarEntryTests extends TestCase { //$NON-NLS-1$ static final String TAR_NAME = "tar_file"; /** * Tests the constructor */ public void testConstructors() { TarEntry entry = new TarEntry(TAR_NAME); //$NON-NLS-1$ assertEquals("mode should be 0644", 0644, entry.getMode()); //$NON-NLS-1$ assertEquals("name sould be 'foo'", TAR_NAME, entry.getName()); } /** * Tests the {@link TarEntry#clone()} method */ public void testClone() { TarEntry entry = new TarEntry(TAR_NAME); TarEntry entry2 = (TarEntry) entry.clone(); //$NON-NLS-1$ assertNotNull("The object should have been cloned", entry2); //$NON-NLS-1$ assertEquals("the file type should be the same in the cloned entry", entry.getFileType(), entry2.getFileType()); //$NON-NLS-1$ assertEquals("the name should be the same in the cloned entry", entry.getName(), entry2.getName()); //$NON-NLS-1$ assertEquals("the mode should be the same in the cloned entry", entry.getMode(), entry2.getMode()); //$NON-NLS-1$ assertEquals("the size should be the same in the cloned entry", entry.getSize(), entry2.getSize()); //$NON-NLS-1$ assertEquals("the time should be the same in the cloned entry", entry.getTime(), entry2.getTime()); } /** * Tests the {@link TarEntry#setFileType(int)} method */ public void testSetFileType() { TarEntry entry = new TarEntry(TAR_NAME); //$NON-NLS-1$ assertEquals("type should be FILE by default", TarEntry.FILE, entry.getFileType()); entry.setFileType(TarEntry.DIRECTORY); //$NON-NLS-1$ assertEquals("type should be DIRECTORY", TarEntry.DIRECTORY, entry.getFileType()); } /** * Tests the {@link TarEntry#setMode(long)} method */ public void testSetMode() { TarEntry entry = new TarEntry(TAR_NAME); //$NON-NLS-1$ assertEquals("mode should be 0644 by default", 0644, entry.getMode()); entry.setMode(1L); //$NON-NLS-1$ assertEquals("type should be 1L", 1L, entry.getMode()); } /** * Tests the {@link TarEntry#setSize(long)} method */ public void testSetSize() { TarEntry entry = new TarEntry(TAR_NAME); //$NON-NLS-1$ assertEquals("size should be 0", 0, entry.getSize()); entry.setSize(1L); //$NON-NLS-1$ assertEquals("size should be 1L", 1L, entry.getSize()); } /** * Tests the {@link TarEntry#setTime(long)} method */ public void testSetTime() { TarEntry entry = new TarEntry(TAR_NAME); entry.setTime(1L); //$NON-NLS-1$ assertEquals("Time should be 1L", 1L, entry.getTime()); } /** * Tests the {@link TarEntry#toString()} method */ public void testToString() { TarEntry entry = new TarEntry(TAR_NAME); //$NON-NLS-1$ assertEquals("toString should return the name", TAR_NAME, entry.toString()); } }
34.205357
120
0.599843
4c3b9200b755dbe0acf07ed37ab854f8628bec03
1,773
/* * This Java source file was generated by the Gradle 'init' task. */ package one; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class AdventDayTwo { public List<String> readInputFile(String filename) { File file = makeFileFromResourceName(filename); List<String> lines = new ArrayList<>(); if (file != null) { BufferedReader br = createBufferedReader(file); if (br != null) { lines = br.lines().collect(Collectors.toList()); } } return lines; } private BufferedReader createBufferedReader(File file) { try { return new BufferedReader(new FileReader(file)); } catch (FileNotFoundException ex) { System.out.println("Error reading file"); return null; } } private File makeFileFromResourceName(String filename) { try { URL resource = getClass().getClassLoader().getResource(filename); return new File(resource.toURI()); } catch (URISyntaxException use) { System.out.println("Error creating URI from resource"); return null; } } public static void main(String[] args) { // this is for calculating an answer using the input resource AdventDayTwo day2 = new AdventDayTwo(); List<String> records = day2.readInputFile("input"); int numberOfValidPasswords = 0; for (String record : records) { PasswordSet set = new PasswordSet(record); if (set.verify()) { numberOfValidPasswords++; } } System.out.println("Number of Valid Passwords: " + numberOfValidPasswords); } }
27.276923
79
0.680767
4e0042ec8bb41ff41e98b9ab4dd2b301d3a49de2
952
package com.docuware.dev.schema._public.services.platform; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ImportEntryVersion") public class ImportEntryVersion { @XmlAttribute(name = "Id", required = true) protected int id; @XmlAttribute(name = "Status", required = true) protected ImportEntryVersionStatus status; /**Gets or sets the error message if the import operation fails.*/ public int getId() { return id; } public void setId(int value) { this.id = value; } /**Gets or sets the status of the document.*/ public ImportEntryVersionStatus getStatus() { return status; } public void setStatus(ImportEntryVersionStatus value) { this.status = value; } }
23.219512
70
0.702731
36f0bb2b44767461e75c641ea981f55110c73459
1,393
package com.dw.lib; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.Properties; public class OracleHelper extends DatabaseHelper { public OracleHelper() throws Exception { super("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:xe", "root", "123456"); } public OracleHelper(String url, String username, String password) throws Exception { super("oracle.jdbc.driver.OracleDriver", url, username, password); } public Connection getConnection() throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); Properties props = new Properties(); props.setProperty("user","root"); props.setProperty("password","123456"); return DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", props); } public Connection getConnection(String url, String username, String password) throws Exception { Class.forName("oracle.jdbc.driver.OracleDriver"); Properties props = new Properties(); props.setProperty("user",username); props.setProperty("password",password); return DriverManager.getConnection(url, props); } public static void main(String[] args) { // TODO Auto-generated method stub } }
30.955556
100
0.765255
ed8a6650194f40baa1c445bebc72faeaf463e392
371
package fr.pizzeria.exception; public class UpdatPizzaException extends StockageException { public UpdatPizzaException() { super(); } public UpdatPizzaException(String message, Throwable cause) { super(message, cause); } public UpdatPizzaException(String message) { super(message); } public UpdatPizzaException(Throwable cause) { super(cause); } }
16.863636
62
0.749326
bd53058c6f1015e3e5f3e1cd34c96a258132b331
3,273
package io.renren.modules.sys.controller; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import io.renren.common.validator.ValidatorUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import io.renren.modules.sys.entity.PlantLocationEntity; import io.renren.modules.sys.entity.SysRoleEntity; import io.renren.modules.sys.service.PlantLocationService; import io.renren.common.utils.PageUtils; import io.renren.common.utils.R; /** * * * @author chenshun * @email [email protected] * @date 2018-11-19 10:12:36 */ @RestController @RequestMapping("sys/plantlocation") public class PlantLocationController { @Autowired private PlantLocationService plantLocationService; /** * 列表 */ @RequestMapping("/list") @RequiresPermissions("sys:plantlocation:list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = plantLocationService.queryPage(params); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{id}") @RequiresPermissions("sys:plantlocation:info") public R info(@PathVariable("id") Integer id){ PlantLocationEntity plantLocation = plantLocationService.selectById(id); return R.ok().put("plantLocation", plantLocation); } /** * 保存 */ @RequestMapping("/save") @RequiresPermissions("sys:plantlocation:save") public R save(@RequestBody PlantLocationEntity plantLocation){ plantLocationService.insert(plantLocation); return R.ok(); } /** * 修改 */ @RequestMapping("/update") @RequiresPermissions("sys:plantlocation:update") public R update(@RequestBody PlantLocationEntity plantLocation){ ValidatorUtils.validateEntity(plantLocation); plantLocationService.updateAllColumnById(plantLocation);//全部更新 return R.ok(); } /** * 删除 */ @RequestMapping("/delete") @RequiresPermissions("sys:plantlocation:delete") public R delete(@RequestBody Integer[] ids){ plantLocationService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @RequestMapping("/getPlace") /*@RequiresPermissions("sys:role:select")*/ public R select(){ List<PlantLocationEntity> list = plantLocationService.selectList(null); return R.ok().put("place", list); } /* @RequestMapping(value = "/getPlace", method = RequestMethod.POST) @ResponseBody public Map<String, Object> getTerminalId() throws Exception { Map<String, Object> returnMap = new HashMap<String, Object>(); List<PlantLocationEntity> pageResult = plantLocationService.getPlace(); returnMap.put("place", pageResult); return returnMap; }*/ }
28.46087
80
0.717385
2ca2d34ea8a5cd55a0f2e3c7ae63e4978e0542b5
1,332
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package upv.edu.poo.TextFileGenerator; import java.io.FileNotFoundException; import java.util.Formatter; /** * * @author HARDCORE */ public class TextFileGenerator { public String Direccion; Formatter f = null; public TextFileGenerator(String Direccion){ this.Direccion = Direccion; } public void AddText(String Contenido) throws Exception{ try{ f = OpenFile(); }catch(SecurityException ex){ System.err.println("Access denied. " + ex.getMessage()); System.exit(1); }catch(FileNotFoundException ex){ System.err.println("File Not found "+ ex.getMessage()); System.exit(1); } f.format("%s\n", Contenido); } public void CloseFile(){ f.close(); } private Formatter OpenFile() throws Exception{ try{ return new Formatter(Direccion); }catch(SecurityException ex){ throw new Exception("Error de seguridad.", ex); }catch(FileNotFoundException ex){ throw new Exception("Archivo no encontrado ", ex); } } }
26.117647
79
0.61036
6a2bf1daa66f88cc7c44ae5a559260e7299603dd
4,906
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.schema.test.parser; import java.math.BigDecimal; import java.sql.Date; import java.sql.Time; import java.sql.Timestamp; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.apache.ignite.schema.model.PojoDescriptor; import org.apache.ignite.schema.model.PojoField; import org.apache.ignite.schema.test.AbstractSchemaImportTest; /** * Tests for metadata parsing. */ public class DbMetadataParserTest extends AbstractSchemaImportTest { /** * Check that field is correspond to expected. * * @param field Field descriptor. * @param name Expected field name. * @param primitive Expected field primitive type. * @param cls Expected field type. */ private void checkField(PojoField field, String name, boolean primitive, Class<?> cls) { assertEquals("Name of field should be " + name, name, field.javaName()); assertEquals("Type of field should be " + cls.getName(), cls.getName(), field.javaTypeName()); assertEquals("Field primitive should be " + primitive, primitive, field.primitive()); } /** * Check that type is correspond to expected. * * @param type Type descriptor. */ private void checkType(PojoDescriptor type) { assertFalse("Type key class name should be defined", type.keyClassName().isEmpty()); assertFalse("Type value class name should be defined", type.valueClassName().isEmpty()); Collection<PojoField> keyFields = type.keyFields(); assertEquals("Key type should have 1 field", 1, keyFields.size()); checkField(keyFields.iterator().next(), "pk", true, int.class); List<PojoField> fields = type.fields(); assertEquals("Value type should have 15 fields", 15, fields.size()); Iterator<PojoField> fieldsIt = fields.iterator(); checkField(fieldsIt.next(), "pk", true, int.class); if ("Objects".equals(type.valueClassName())) { checkField(fieldsIt.next(), "boolcol", false, Boolean.class); checkField(fieldsIt.next(), "bytecol", false, Byte.class); checkField(fieldsIt.next(), "shortcol", false, Short.class); checkField(fieldsIt.next(), "intcol", false, Integer.class); checkField(fieldsIt.next(), "longcol", false, Long.class); checkField(fieldsIt.next(), "floatcol", false, Float.class); checkField(fieldsIt.next(), "doublecol", false, Double.class); checkField(fieldsIt.next(), "doublecol2", false, Double.class); } else { checkField(fieldsIt.next(), "boolcol", true, boolean.class); checkField(fieldsIt.next(), "bytecol", true, byte.class); checkField(fieldsIt.next(), "shortcol", true, short.class); checkField(fieldsIt.next(), "intcol", true, int.class); checkField(fieldsIt.next(), "longcol", true, long.class); checkField(fieldsIt.next(), "floatcol", true, float.class); checkField(fieldsIt.next(), "doublecol", true, double.class); checkField(fieldsIt.next(), "doublecol2", true, double.class); } checkField(fieldsIt.next(), "bigdecimalcol", false, BigDecimal.class); checkField(fieldsIt.next(), "strcol", false, String.class); checkField(fieldsIt.next(), "datecol", false, Date.class); checkField(fieldsIt.next(), "timecol", false, Time.class); checkField(fieldsIt.next(), "tscol", false, Timestamp.class); checkField(fieldsIt.next(), "arrcol", false, Object.class); } /** * Test that metadata generated correctly. */ public void testCheckMetadata() { assertEquals("Metadata should contain 3 element", 3, pojos.size()); Iterator<PojoDescriptor> it = pojos.iterator(); PojoDescriptor schema = it.next(); assertTrue("First element is schema description. Its class name should be empty", schema.valueClassName().isEmpty()); checkType(it.next()); checkType(it.next()); } }
40.545455
102
0.665512
ce334b093026ee53d29907537ff33f3b178a747d
2,670
/** * * Generated by JaxbToStjsAssimilater. * Assimilation Date: Thu Sep 12 10:06:02 CDT 2019 * **/ package s3000l; import org.cassproject.schema.general.EcRemoteLinkedData; import org.stjs.javascript.Array; import s6000t.SubtaskTrainingLevelDecision; public class PeriodicTimeLimit extends EcRemoteLinkedData { protected Boolean harmoniz; protected TimeLimitDescription limitDescr; protected Array<InitialTimeLimit> initial; protected Array<RepeatTimeLimit> repeat; protected s3000l.DownTime.OrgInfos orgInfos; protected s3000l.ConditionInstance.Docs docs; protected s3000l.ConditionInstance.Rmks rmks; protected SubtaskTrainingLevelDecision.Applic applic; protected String uid; protected CrudCodeValues crud; public Boolean getHarmoniz() { return harmoniz; } public void setHarmoniz(Boolean value) { this.harmoniz = value; } public TimeLimitDescription getLimitDescr() { return limitDescr; } public void setLimitDescr(TimeLimitDescription value) { this.limitDescr = value; } public Array<InitialTimeLimit> getInitial() { if (initial == null) { initial = new Array<InitialTimeLimit>(); } return this.initial; } public Array<RepeatTimeLimit> getRepeat() { if (repeat == null) { repeat = new Array<RepeatTimeLimit>(); } return this.repeat; } public s3000l.DownTime.OrgInfos getOrgInfos() { return orgInfos; } public void setOrgInfos(s3000l.DownTime.OrgInfos value) { this.orgInfos = value; } public s3000l.ConditionInstance.Docs getDocs() { return docs; } public void setDocs(s3000l.ConditionInstance.Docs value) { this.docs = value; } public s3000l.ConditionInstance.Rmks getRmks() { return rmks; } public void setRmks(s3000l.ConditionInstance.Rmks value) { this.rmks = value; } public SubtaskTrainingLevelDecision.Applic getApplic() { return applic; } public void setApplic(SubtaskTrainingLevelDecision.Applic value) { this.applic = value; } public String getUid() { return uid; } public void setUid(String value) { this.uid = value; } public CrudCodeValues getCrud() { if (crud == null) { return CrudCodeValues.I; } else { return crud; } } public void setCrud(CrudCodeValues value) { this.crud = value; } public PeriodicTimeLimit() { super("http://www.asd-europe.org/s-series/s3000l", "PeriodicTimeLimit"); } }
23.421053
74
0.652434
ad0f3b613c731927aca9c4dc68686be6de9a3aeb
13,515
/*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2021 Nordix Foundation. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ package org.onap.policy.apex.tools.model.generator.model2event; import java.util.HashSet; import java.util.Properties; import java.util.Set; import org.apache.avro.Schema; import org.apache.avro.Schema.Field; import org.apache.avro.Schema.Type; import org.apache.commons.lang3.Validate; import org.onap.policy.apex.context.parameters.SchemaParameters; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.eventmodel.concepts.AxEvent; import org.onap.policy.apex.model.modelapi.ApexApiResult; import org.onap.policy.apex.model.modelapi.ApexModel; import org.onap.policy.apex.model.modelapi.ApexModelFactory; import org.onap.policy.apex.model.policymodel.concepts.AxPolicies; import org.onap.policy.apex.model.policymodel.concepts.AxPolicy; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.model.policymodel.concepts.AxState; import org.onap.policy.apex.model.policymodel.concepts.AxStateOutput; import org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters; import org.onap.policy.apex.service.engine.event.ApexEventException; import org.onap.policy.apex.tools.model.generator.SchemaUtils; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; import org.stringtemplate.v4.ST; import org.stringtemplate.v4.STGroup; import org.stringtemplate.v4.STGroupFile; /** * Takes a model and generates the JSON event schemas. * * @author Sven van der Meer ([email protected]) */ public class Model2JsonEventSchema { // Logger for this class private static final XLogger LOGGER = XLoggerFactory.getXLogger(Model2JsonEventSchema.class); // Recurring string constants private static final String TARGET = "target"; private static final String SOURCE = "source"; private static final String VERSION = "version"; private static final String NAME_SPACE = "nameSpace"; /** Application name, used as prompt. */ private final String appName; /** The file name of the policy model. */ private final String modelFile; /** The type of events to generate: stimuli, response, internal. */ private final String type; /** * Creates a new model to event schema generator. * * @param modelFile the model file to be used * @param type the type of events to generate, one of: stimuli, response, internal * @param appName application name for printouts */ public Model2JsonEventSchema(final String modelFile, final String type, final String appName) { Validate.notNull(modelFile, "Model2JsonEvent: given model file name was blank"); Validate.notNull(type, "Model2JsonEvent: given type was blank"); Validate.notNull(appName, "Model2JsonEvent: given application name was blank"); this.modelFile = modelFile; this.type = type; this.appName = appName; } /** * Adds a type to a field for a given schema. * * @param schema the schema to add a type for * @param stg the STG * @return a template with the type */ protected ST addFieldType(final Schema schema, final STGroup stg) { ST ret = null; if (isSimpleType(schema.getType())) { ret = stg.getInstanceOf("fieldTypeAtomic"); ret.add("type", schema.getType()); return ret; } switch (schema.getType()) { case ARRAY: ret = stg.getInstanceOf("fieldTypeArray"); ret.add("array", this.addFieldType(schema.getElementType(), stg)); break; case ENUM: ret = stg.getInstanceOf("fieldTypeEnum"); ret.add("symbols", schema.getEnumSymbols()); break; case MAP: ret = stg.getInstanceOf("fieldTypeMap"); ret.add("map", this.addFieldType(schema.getValueType(), stg)); break; case RECORD: ret = processRecord(schema, stg); break; case NULL: break; case UNION: break; default: break; } return ret; } /** * Check if a schema is a simple type. * * @param schemaType the type of the schema * @return true if the schema is a simple type */ private boolean isSimpleType(Type schemaType) { switch (schemaType) { case BOOLEAN: case BYTES: case DOUBLE: case FIXED: case FLOAT: case INT: case LONG: case STRING: return true; default: return false; } } /** * Process a record entry. * @param schema the schema to add a type for * @param stg the STG * @return a template with the type */ private ST processRecord(final Schema schema, final STGroup stg) { ST ret; ret = stg.getInstanceOf("fieldTypeRecord"); for (final Field field : schema.getFields()) { final ST st = stg.getInstanceOf("field"); st.add("name", field.name()); st.add("type", this.addFieldType(field.schema(), stg)); ret.add("fields", st); } return ret; } /** * Runs the application. * * * @return status of the application execution, 0 for success, positive integer for exit condition (such as help or * version), negative integer for errors * @throws ApexException if any problem occurred in the model */ public int runApp() throws ApexException { final STGroupFile stg = new STGroupFile("org/onap/policy/apex/tools/model/generator/event-json.stg"); final ST stEvents = stg.getInstanceOf("events"); final ApexModelFactory factory = new ApexModelFactory(); final ApexModel model = factory.createApexModel(new Properties(), true); final ApexApiResult result = model.loadFromFile(modelFile); if (result.isNok()) { String message = appName + ": " + result.getMessage(); LOGGER.error(message); return -1; } final AxPolicyModel policyModel = model.getPolicyModel(); policyModel.register(); new SchemaParameters().getSchemaHelperParameterMap().put("Avro", new AvroSchemaHelperParameters()); final Set<AxEvent> events = new HashSet<>(); final Set<AxArtifactKey> eventKeys = new HashSet<>(); final AxPolicies policies = policyModel.getPolicies(); switch (type) { case "stimuli": processStimuli(eventKeys, policies); break; case "response": processResponse(eventKeys, policies); break; case "internal": processInternal(eventKeys, policies); break; default: LOGGER.error("{}: unknown type <{}>, cannot proceed", appName, type); return -1; } for (final AxEvent event : policyModel.getEvents().getEventMap().values()) { for (final AxArtifactKey key : eventKeys) { if (event.getKey().equals(key)) { events.add(event); } } } String renderMessage = renderEvents(stg, stEvents, events); LOGGER.error(renderMessage); return 0; } /** * Render the events. * * @param stg the string template * @param stEvents the event template * @param events the events to render * @return the rendered events * @throws ApexEventException on rendering exceptions */ private String renderEvents(final STGroupFile stg, final ST stEvents, final Set<AxEvent> events) throws ApexEventException { for (final AxEvent event : events) { final ST stEvent = stg.getInstanceOf("event"); stEvent.add("name", event.getKey().getName()); stEvent.add(NAME_SPACE, event.getNameSpace()); stEvent.add(VERSION, event.getKey().getVersion()); stEvent.add(SOURCE, event.getSource()); stEvent.add(TARGET, event.getTarget()); final Schema avro = SchemaUtils.getEventSchema(event); for (final Field field : avro.getFields()) { // filter magic names switch (field.name()) { case "name": case NAME_SPACE: case VERSION: case SOURCE: case TARGET: break; default: stEvent.add("fields", this.setField(field, stg)); } } stEvents.add("event", stEvent); } return stEvents.render(); } /** * Process the "stimuli" keyword. * @param eventKeys the event keys * @param policies the policies to process */ private void processStimuli(final Set<AxArtifactKey> eventKeys, final AxPolicies policies) { for (final AxPolicy policy : policies.getPolicyMap().values()) { final String firsState = policy.getFirstState(); for (final AxState state : policy.getStateMap().values()) { if (state.getKey().getLocalName().equals(firsState)) { eventKeys.add(state.getTrigger()); } } } } /** * Process the "response" keyword. * @param eventKeys the event keys * @param policies the policies to process */ private void processResponse(final Set<AxArtifactKey> eventKeys, final AxPolicies policies) { for (final AxPolicy policy : policies.getPolicyMap().values()) { processState(eventKeys, policy); } } /** * Process the state in the response. * @param eventKeys the event keys * @param policy the policy to process */ private void processState(final Set<AxArtifactKey> eventKeys, final AxPolicy policy) { for (final AxState state : policy.getStateMap().values()) { if ("NULL".equals(state.getNextStateSet().iterator().next())) { for (final AxStateOutput output : state.getStateOutputs().values()) { eventKeys.add(output.getOutgoingEvent()); } } } } /** * Process the "internal" keyword. * @param eventKeys the event keys * @param policies the policies to process */ private void processInternal(final Set<AxArtifactKey> eventKeys, final AxPolicies policies) { for (final AxPolicy policy : policies.getPolicyMap().values()) { final String firsState = policy.getFirstState(); for (final AxState state : policy.getStateMap().values()) { processInternalState(eventKeys, firsState, state); } } } /** * Process the internal state. * @param eventKeys the event keys * @param firstState the first state to process * @param state the state to process */ private void processInternalState(final Set<AxArtifactKey> eventKeys, final String firstState, final AxState state) { if (state.getKey().getLocalName().equals(firstState)) { return; } if ("NULL".equals(state.getNextStateSet().iterator().next())) { return; } for (final AxStateOutput output : state.getStateOutputs().values()) { eventKeys.add(output.getOutgoingEvent()); } } /** * Adds a field to the output. * * @param field the field from the event * @param stg the STG * @return a template for the field */ protected ST setField(final Field field, final STGroup stg) { final ST st = stg.getInstanceOf("field"); switch (field.name()) { case "name": case NAME_SPACE: case VERSION: case SOURCE: case TARGET: break; default: st.add("name", field.name()); st.add("type", this.addFieldType(field.schema(), stg)); } return st; } }
36.136364
119
0.598002
42c40bb0598efb74c52ea9d7789b046ee43b7dda
657
package pcd.pinballs.worker; public abstract class Worker extends Thread { public Worker(int index) { super(); this.setName("Worker " + index); } protected void log(long millis, String message) { this.log(message); if (millis > 0) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } } public void log(String message) { /* Accesso sincronizzato alla risorsa */ synchronized (System.out) { System.out.println("["+this.getName()+"]: "+message); } } }
24.333333
65
0.525114
b0b0904aa68483fc05a07906ad0aab4277e08d15
1,723
package ariketa3; import java.util.Arrays; public class MergeSortClass { public static int[] mergeSort(int[] arr) { return sortuTxikitikHandira(arr, 0, arr.length-1); } public static int[] sortuTxikitikHandira( int[] arr,int lehena,int azkena) { int nElem=azkena-lehena+1; if (nElem>1) { int tar=(lehena+azkena)/2; sortuTxikitikHandira(arr,lehena, tar); sortuTxikitikHandira(arr,tar+1, azkena); banaketaTxikitikHandira(arr,lehena,tar+1,azkena); } return arr; } public static int [] banaketaTxikitikHandira(int[]arr,int ezkerLeh,int eskuinLeh,int azk) { int nElem=(azk-ezkerLeh)+1; int[] estra=new int[nElem]; int i=ezkerLeh; int j=eskuinLeh; //Estra bektorean sartu aldagaiak ordenaturik for (int k = 0; k < nElem; k++) { if (i >=eskuinLeh) { estra[k] = arr[j++]; } else if (j > azk) { estra[k] = arr[i++]; } else if (arr[i] <= arr[j]) { estra[k] = arr[i++]; } else { estra[k] = arr[j++]; } } //Estra bektoreko aldagaiak berriz sartu balioak bektorean ordenaturik for (int j2 = 0; j2 < estra.length; j2++) { arr[ezkerLeh+j2]=estra[j2]; } return arr; } // Complete the findMedian function below. static int findMedian(int[] arr) { arr=mergeSort(arr); return arr[(arr.length-1)/2]; } public static void main(String[] args) { int[] bektorea=new int[3]; for (int i = 0; i < bektorea.length; i++) { bektorea[i]=(int)(Math.random()*10); } System.out.println(Arrays.toString(bektorea)); bektorea=mergeSort(bektorea); System.out.println(Arrays.toString(bektorea)); System.out.println(findMedian(bektorea)); } }
22.089744
93
0.616947
fcffa18283fe29f5f95f37024554a1dbdac1e7a6
3,440
/* * Copyright (c) 2015 SONATA-NFV, UCL, NOKIA, NCSR Demokritos ALL RIGHTS RESERVED. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. * * Neither the name of the SONATA-NFV, UCL, NOKIA, NCSR Demokritos nor the names of its contributors * may be used to endorse or promote products derived from this software without specific prior * written permission. * * This work has been performed in the framework of the SONATA project, funded by the European * Commission under Grant number 671517 through the Horizon 2020 and 5G-PPP programmes. The authors * would like to acknowledge the contributions of their colleagues of the SONATA partner consortium * (www.sonata-nfv.eu). * * @author Dario Valocchi (Ph.D.), UCL * */ package sonata.kernel.adaptor.wrapper; import org.slf4j.LoggerFactory; import sonata.kernel.adaptor.wrapper.vtn.VtnWrapper; public class WrapperFactory { private static final org.slf4j.Logger Logger = LoggerFactory.getLogger(WrapperFactory.class); /** * Uses the parser configuration to create the relevant Wrapper. * * @param config the VimWrapperConfiguration object describing the wrapper to create. * @return the brand new wrapper */ public static Wrapper createWrapper(VimWrapperConfiguration config) { Wrapper output = null; Logger.debug("Factory - Creating wrapper..."); if (config.getWrapperType().equals(WrapperType.COMPUTE)) { Logger.debug("Factory - Creating Compute Wrapper."); output = createComputeWrapper(config); } if (config.getWrapperType().equals(WrapperType.NETWORK)) { Logger.debug("Factory - Creating Network Wrapper."); output = createNetworkWrapper(config); } if (config.getWrapperType().equals(WrapperType.STORAGE)) { Logger.debug("Factory - Creating Storage Wrapper."); output = createStorageWrapper(config); } if (output != null) { Logger.debug("Factory - Wrapper created."); } else { Logger.debug("Factory - Unable to create wrapper."); } return output; } /** * Uses the parser configuration to create the relevant Wim Wrapper. * * @param config the VimWrapperConfiguration object describing the wrapper to create. * @return the brand new wrapper */ public static Wrapper createWimWrapper(WimWrapperConfiguration config) { Wrapper output = null; System.out.println(" [WrapperFactory] - creating wrapper..."); if (config.getWimVendor().equals(WimVendor.VTN)) { output = new VtnWrapper(config); } System.out.println(" [WrapperFactory] - Wrapper created..."); return output; } private static ComputeWrapper createComputeWrapper(VimWrapperConfiguration config) { return null; } private static NetworkWrapper createNetworkWrapper(VimWrapperConfiguration config) {return null;} private static StorageWrapper createStorageWrapper(VimWrapperConfiguration config) { return null; } }
36.210526
100
0.727326
ee4d56cf422c5554275aab0f28c7a3c834cf3ed9
716
package com.zdcf.mum; import java.util.*; public class MainItemTesst { public static void main(String[] args) { Item t1 = new Item("Chilli", 100.0, new Date(2016, 12, 24)); Item t2 = new Item("Rice", 50.0, new Date(2015, 12, 24)); Item t3 = new Item("Beef", 80.0, new Date(2016, 10, 24)); Item t4 = new Item("Rice", 50.0, new Date(2016, 12, 24)); Item t5 = new Item("Chilli", 50.0, new Date(2016, 12, 24)); List<Item> itemList = new ArrayList<>(); itemList.add(t1); itemList.add(t2); itemList.add(t3); itemList.add(t4); itemList.add(t5); Collections.sort(itemList, new ItemComparator()); for(Item ls: itemList){ System.out.println(ls); } } }
24.689655
63
0.604749
282037cefa50800076fbb7833f87eb87ccec4a16
1,394
package de.patrickmetz.clear_8.emulator; import de.patrickmetz.clear_8.emulator.events.EmulatorEventListener; import de.patrickmetz.clear_8.emulator.input.Keyboard; import de.patrickmetz.clear_8.gui.output.Display; /** * The emulator is basically an endless loop. It continuously interprets * commands from a given game, while feeding the game keyboard input, and * displaying the game's graphical output on screen. It can be started, * stopped and paused and signals these state changes to interested listeners, * which react to those events, like buttons in a graphical user interface. */ public interface Emulator { // in- and output --------------------------------------------------------- void setKeyboard(Keyboard keyboard); void setDisplay(Display display); // game options ----------------------------------------------------------- String getGamePath(); void setGamePath(String gamePath); int getInstructionsPerSecond(); void setInstructionsPerSecond(int instructionsPerSecond); boolean getUseVipCpu(); void setUseVipCpu(boolean useVipCpu); // state control ---------------------------------------------------------- void start(); void stop(); void togglePause(); // state change events ---------------------------------------------------- void addStateListener(EmulatorEventListener listener); }
29.659574
79
0.623386
e0e72ecea8eded41c5de50e211d8572af1460484
6,362
package com.qixun.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.util.Map; public class HttpUtil2 { private static final Logger log = LoggerFactory.getLogger(HttpUtil2.class); public static ResponseEntity getResponse(String requrl, String paramStr, Map<String, String> headMap, int connectiontimeout, int readtimeout, String charset, boolean isMethodPost, boolean isHttps ) { if (connectiontimeout == 0) { connectiontimeout = 5000; } if (readtimeout == 0) { readtimeout = 5000; } log.info("请求地址为:" + requrl + ",请求参数为:" + paramStr); if (isHttps) { try { trustAllHttpsCertificates(); } catch (Exception e) { e.printStackTrace(); } } OutputStreamWriter out = null; BufferedReader in = null; HttpURLConnection connect = null; String result = ""; ResponseEntity responseEntity = new ResponseEntity(); String line = null; try { URL url = new URL(requrl); if (isHttps) { connect = (HttpsURLConnection) url.openConnection(); } else { connect = (HttpURLConnection) url.openConnection(); } connect.setConnectTimeout(connectiontimeout); connect.setReadTimeout(readtimeout); connect.setDoInput(true); connect.setRequestMethod(isMethodPost ? "POST" : "GET"); if (headMap != null && headMap.size() > 0) { for (Map.Entry<String, String> entry : headMap.entrySet()) { connect.setRequestProperty(entry.getKey(), entry.getValue()); } } if (paramStr != null && !"".equals(paramStr)) { connect.setDoOutput(true); out = new OutputStreamWriter(connect.getOutputStream(), charset); out.write(paramStr); out.flush(); } responseEntity.setResponseCode(connect.getResponseCode()); in = new BufferedReader(new InputStreamReader(connect .getInputStream(), charset)); StringBuilder content = new StringBuilder(); while ((line = in.readLine()) != null) { content.append(line); } result = content.toString(); log.info("请求地址为:" + requrl + ",响应信息为:" + result); } catch (Exception e) { log.info("访问服务器异常,原因:" + e.getMessage()); try { in = new BufferedReader(new InputStreamReader(connect .getErrorStream(), charset)); StringBuilder content = new StringBuilder(); while ((line = in.readLine()) != null) { content.append(line); } result = content.toString(); } catch (Exception e1) { log.info("读取服务器异常信息异常,原因:" + e1.getMessage()); } } finally { try { if (out != null) { out.close(); } if (in != null) { in.close(); } if (connect != null) { connect.disconnect(); } } catch (Exception e) { log.info("关闭资源异常,原因:" + e.getMessage()); } } responseEntity.setResponseStr(result); return responseEntity; } private static void trustAllHttpsCertificates() throws Exception { javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1]; javax.net.ssl.TrustManager tm = new miTM(); trustAllCerts[0] = tm; javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext .getInstance("SSL"); sc.init(null, trustAllCerts, null); HttpsURLConnection.setDefaultSSLSocketFactory(sc .getSocketFactory()); HostnameVerifier hv = new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { return true; } }; HttpsURLConnection.setDefaultHostnameVerifier(hv); } static class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public boolean isServerTrusted( java.security.cert.X509Certificate[] certs) { return true; } public boolean isClientTrusted( java.security.cert.X509Certificate[] certs) { return true; } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) throws java.security.cert.CertificateException { return; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) throws java.security.cert.CertificateException { return; } } public static class ResponseEntity { private int responseCode; private String responseStr; public int getResponseCode() { return responseCode; } public void setResponseCode(int responseCode) { this.responseCode = responseCode; } public String getResponseStr() { return responseStr; } public void setResponseStr(String responseStr) { this.responseStr = responseStr; } } }
34.204301
87
0.523892
f7d33970273f2ef1600372eda83ef9ab2921091d
7,279
// This file is part of PDQ (https://github.com/ProofDrivenQuerying/pdq) which is released under the MIT license. // See accompanying LICENSE for copyright notice and full details. package uk.ac.ox.cs.pdq.planner; import com.google.common.eventbus.EventBus; import uk.ac.ox.cs.pdq.cost.estimators.CostEstimator; import uk.ac.ox.cs.pdq.cost.estimators.CountNumberOfAccessedRelationsCostEstimator; import uk.ac.ox.cs.pdq.cost.estimators.OrderDependentCostEstimator; import uk.ac.ox.cs.pdq.cost.estimators.OrderIndependentCostEstimator; import uk.ac.ox.cs.pdq.db.Schema; import uk.ac.ox.cs.pdq.fol.ConjunctiveQuery; import uk.ac.ox.cs.pdq.planner.PlannerParameters.PlannerTypes; import uk.ac.ox.cs.pdq.planner.accessibleschema.AccessibleSchema; import uk.ac.ox.cs.pdq.planner.dag.explorer.DAGOptimizedMultiThread; import uk.ac.ox.cs.pdq.planner.dag.explorer.filters.Filter; import uk.ac.ox.cs.pdq.planner.dag.explorer.filters.FilterFactory; import uk.ac.ox.cs.pdq.planner.dag.explorer.validators.PairValidator; import uk.ac.ox.cs.pdq.planner.dag.explorer.validators.PairValidatorFactory; import uk.ac.ox.cs.pdq.planner.dominance.CostDominance; import uk.ac.ox.cs.pdq.planner.linear.cost.CostPropagator; import uk.ac.ox.cs.pdq.planner.linear.cost.OrderDependentCostPropagator; import uk.ac.ox.cs.pdq.planner.linear.cost.OrderIndependentCostPropagator; import uk.ac.ox.cs.pdq.planner.linear.explorer.LinearGeneric; import uk.ac.ox.cs.pdq.planner.linear.explorer.LinearKChase; import uk.ac.ox.cs.pdq.planner.linear.explorer.LinearOptimized; import uk.ac.ox.cs.pdq.reasoning.ReasoningParameters; import uk.ac.ox.cs.pdq.reasoning.chase.Chaser; import uk.ac.ox.cs.pdq.reasoningdatabase.DatabaseManager; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Creates an explorer given the input arguments. The following types of * explorers are available: * * -The LinearGeneric explores the space of linear proofs exhaustively. -The * LinearOptimized employs several heuristics to cut down the search space. The * first heuristic prunes the configurations that map to plans with cost >= to * the best plan found so far. The second heuristic prunes the cost dominated * configurations. A configuration c and c' is fact dominated by another * configuration c' if there exists an homomorphism from the facts of c to the * facts of c' and the input constants are preserved. A configuration c is cost * dominated by c' if it is fact dominated by c and maps to a plan with cost >= * the cost of the plan of c'. The LinearOptimized class also employs the notion * of equivalence in order not to revisit configurations already visited before. * Both the LinearGeneric and LinearOptimized perform reasoning every time a new * node is added to the plan tree. -The LinearKChase class works similarly to * the LinearOptimized class. However, it does not perform reasoning every time * a new node is added to the plan tree but every k steps. * * -The DAGGeneric explores the space of proofs exhaustively. -The DAGOptimized, * DAGSimpleDP and DAGChaseFriendlyDP employ two DP-like heuristics to cut down * the search space. The first heuristic prunes the configurations that map to * plans with cost >= to the best plan found so far. The second heuristic prunes * the cost dominated configurations. A configuration c and c' is fact dominated * by another configuration c' if there exists an homomorphism from the facts of * c to the facts of c' and the input constants are preserved. A configuration c * is cost dominated by c' if it is fact dominated by c and maps to a plan with * cost >= the cost of the plan of c'. -The DAGOptimized employs further * techniques to speed up the planning process like reasoning in parallel and * re-use of reasoning results. * * @author Efthymia Tsamoura * */ public class ExplorerFactory { /** * Creates a new Explorer object. * * @param <P> * the generic type * @param eventBus * the event bus * the collect stats * @param schema * the schema * @param accessibleSchema * the accessible schema * @param query * the query * @param chaser * the chaser * @param costEstimator * the cost estimator * @param parameters * the parameters * @return the explorer< p> * @throws Exception * the exception */ @SuppressWarnings("rawtypes") public static Explorer createExplorer(EventBus eventBus, Schema schema, AccessibleSchema accessibleSchema, ConjunctiveQuery query, Chaser chaser, DatabaseManager connection, CostEstimator costEstimator, PlannerParameters parameters, ReasoningParameters reasoningParameters) throws Exception { CostDominance successDominance = new CostDominance(new CountNumberOfAccessedRelationsCostEstimator()); CostPropagator costPropagator = null; List<PairValidator> validators = new ArrayList<>(); Filter filter = null; if (parameters.getPlannerType().equals(PlannerTypes.LINEAR_GENERIC) || parameters.getPlannerType().equals(PlannerTypes.LINEAR_KCHASE) || parameters.getPlannerType().equals(PlannerTypes.LINEAR_OPTIMIZED)) { if (costEstimator instanceof OrderIndependentCostEstimator) costPropagator = new OrderIndependentCostPropagator((OrderIndependentCostEstimator) costEstimator); else if (costEstimator instanceof OrderDependentCostEstimator) costPropagator = new OrderDependentCostPropagator((OrderDependentCostEstimator) costEstimator); else throw new IllegalStateException( "Attempting to get a propagator for a unknown cost estimator: " + costEstimator); } else { PairValidator[] validatorArray = new PairValidatorFactory(parameters.getValidatorType(), parameters.getDepthThreshold()).getInstance(); validators.addAll(Arrays.asList(validatorArray)); filter = (Filter) new FilterFactory(parameters.getFilterType()).getInstance(); } switch (parameters.getPlannerType()) { case LINEAR_GENERIC: return new LinearGeneric(eventBus, query, accessibleSchema, chaser, connection, costEstimator, parameters.getMaxDepth()); case LINEAR_OPTIMIZED: return new LinearOptimized(eventBus, query, accessibleSchema, chaser, connection, costEstimator, costPropagator, parameters.getMaxDepth(), parameters.getQueryMatchInterval()); case LINEAR_KCHASE: return new LinearKChase(eventBus, query, accessibleSchema, chaser, connection, costEstimator, costPropagator, parameters.getMaxDepth(), parameters.getChaseInterval()); case DAG_GENERIC: return new uk.ac.ox.cs.pdq.planner.dag.explorer.DAGGenericSimple(eventBus, parameters, query, accessibleSchema, chaser, connection, costEstimator, successDominance, filter, validators, parameters.getMaxDepth()); case DAG_OPTIMIZED: return new DAGOptimizedMultiThread(eventBus, parameters, query, accessibleSchema, chaser, connection, costEstimator, filter, parameters.getMaxDepth()); default: throw new IllegalStateException("Unsupported planner type " + parameters.getPlannerType()); } } }
48.526667
114
0.752988
8f5d19211d1ba606dd54032e4e0b7eef36a40c48
5,133
package org.apache.solr.request.uninverted; import java.io.IOException; import org.apache.lucene.index.IndexReader; import org.apache.solr.request.BlockBufferPool; import org.apache.solr.request.BlockBufferPool.BlockArray; import org.apache.solr.schema.FieldType; public class RamTermNumValue { private static long MIN_VALUE=Integer.MIN_VALUE; public static long TERMNUM_NAN_VALUE =MIN_VALUE+100; public static long TERMNUM_NAN_VALUE_FORCMP=TERMNUM_NAN_VALUE+10; public static long EMPTY_FOR_MARK = MIN_VALUE+2; public static long EMPTY_FOR_MARK_FORCMP =EMPTY_FOR_MARK+10; public BlockArray<Double> termValueDouble = null; public BlockArray<Long> termValueLong = null; public UnInvertedFieldUtils.FieldDatatype fieldDataType = null; public int nullTermNum = -1; public RamTermNumValue(UnInvertedFieldUtils.FieldDatatype fieldDataType) { this.fieldDataType=fieldDataType; } public void startInitValue(int maxDoc, IndexReader reader,boolean isReadDouble) { if (!isReadDouble) { return ; } int maxDocOffset = maxDoc + 2; if(this.fieldDataType.equals(UnInvertedFieldUtils.FieldDatatype.d_double)) { this.termValueDouble = BlockBufferPool.DOUBLE_POOL.calloc(maxDocOffset, BlockBufferPool.DOUBLE_CREATE,(double)RamTermNumValue.TERMNUM_NAN_VALUE); }else{ this.termValueLong = BlockBufferPool.LONG_POOL.calloc(maxDocOffset, BlockBufferPool.LONG_CREATE,RamTermNumValue.TERMNUM_NAN_VALUE); } } public void endInitValue(boolean isReadDouble, int maxTermNum) { this.nullTermNum = maxTermNum + 1; if (!isReadDouble) { return ; } int fillSize=nullTermNum+1; if(this.fieldDataType.equals(UnInvertedFieldUtils.FieldDatatype.d_double)) { this.termValueDouble = BlockBufferPool.DOUBLE_POOL.reCalloc(this.termValueDouble,fillSize, BlockBufferPool.DOUBLE_CREATE, (double)RamTermNumValue.TERMNUM_NAN_VALUE); this.termValueDouble.set(this.nullTermNum, (double)RamTermNumValue.TERMNUM_NAN_VALUE); }else{ this.termValueLong = BlockBufferPool.LONG_POOL.reCalloc(this.termValueLong,fillSize,BlockBufferPool.LONG_CREATE, RamTermNumValue.TERMNUM_NAN_VALUE); this.termValueLong.set(this.nullTermNum, (long)RamTermNumValue.TERMNUM_NAN_VALUE); } } public void free() { if (this.termValueDouble != null) { BlockBufferPool.DOUBLE_POOL.recycleByteBlocks(this.termValueDouble); this.termValueDouble=null; } if (this.termValueLong != null) { BlockBufferPool.LONG_POOL.recycleByteBlocks(this.termValueLong); this.termValueLong=null; } } public int getmemsize() { int sz = 0; if (termValueDouble != null) sz += termValueDouble.getMemSize() * 8; if (termValueLong != null) sz += termValueLong.getMemSize() * 8; return sz; } public String toString() { StringBuffer membuffer = new StringBuffer(); if (termValueDouble != null) { membuffer.append(",").append( "termValueDouble=" + termValueDouble.getMemSize() + "@" + termValueDouble.getSize()); } if (termValueLong != null) { membuffer.append(",").append( "termValueLong=" + termValueLong.getMemSize() + "@" + termValueLong.getSize()); } return membuffer.toString(); } public TermDoubleValue getTermDoubleValue() { if (fieldDataType.equals(UnInvertedFieldUtils.FieldDatatype.d_long)) { return new TermDoubleValue_long(this); } if (fieldDataType.equals(UnInvertedFieldUtils.FieldDatatype.d_string)) { return new TermDoubleValue_long(this); } if (fieldDataType.equals(UnInvertedFieldUtils.FieldDatatype.d_double)) { return new TermDoubleValue_double(this); } return new TermDoubleValue_nan(); } private static class TermDoubleValue_long extends TermDoubleValue { private BlockArray<Long> termValueLong; private RamTermNumValue tv; public TermDoubleValue_long( RamTermNumValue tv) { this.termValueLong = tv.termValueLong; this.tv=tv; } public double tm(int tm, FieldType ft, TermNumEnumerator te) { if(tm >= tv.nullTermNum) { return TERMNUM_NAN_VALUE; } return this.termValueLong.get(tm); } } private static class TermDoubleValue_double extends TermDoubleValue { private BlockArray<Double> termValueDouble; private RamTermNumValue tv; public TermDoubleValue_double(RamTermNumValue tv) { this.termValueDouble = tv.termValueDouble; this.tv=tv; } public double tm(int tm, FieldType ft, TermNumEnumerator te) { if(tm >= tv.nullTermNum) { return TERMNUM_NAN_VALUE; } return this.termValueDouble.get(tm); } } private static class TermDoubleValue_nan extends TermDoubleValue { public double tm(int tm, FieldType ft, TermNumEnumerator te) throws IOException { throw new RuntimeException("TermDoubleValue_nan"); // return TERMNUM_NAN_VALUE; } } public abstract static class TermDoubleValue { public abstract double tm(int tm, FieldType ft, TermNumEnumerator te) throws IOException; } }
27.303191
169
0.725307
514dd28d6ce5822943e63fb99c391f10c90ae9da
192
/** * CSV parsers and their factories providing the core functionality. * * @author Abdelmonaim Remani * @version 0.1.0 * @since 0.1.0 */ package com.polymathiccoder.yap4j.csv;
21.333333
69
0.677083
c5540ff51876e3ce597605859938a06513a19336
4,580
/* * Copyright 2019 NexCloud Co.,Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.nexcloud.tsdb.adapter; public interface HostDockerAdapter { public String getDockerCpuUsedByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerCpuUsedByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerMemoryAllocateByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedByteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedByteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerMemoryUsedPercentByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerMemoryUsedPercentByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerDiskioReadByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerDiskioReadByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerDiskioWriteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerDiskioWriteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxbyteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxdropByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxerrorByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxpacketByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxbyteByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxdropByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxerrorByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkTxpacketByContainerId (String clusterId, String hostIp, String containerId, String startTime, String time, int limit); public String getDockerNetworkRxbyteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxdropByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxerrorByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkRxpacketByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxbyteByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxdropByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxerrorByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); public String getDockerNetworkTxpacketByTaskId (String clusterId, String hostIp, String taskId, String startTime, String time, int limit); }
63.611111
151
0.812664
55b25ab25abd5ccb900ec118a9dd8a05cdfccbf6
5,947
package org.innovateuk.ifs.publiccontent.controller; import org.innovateuk.ifs.competition.publiccontent.resource.PublicContentResource; import org.innovateuk.ifs.competition.service.CompetitionRestService; import org.innovateuk.ifs.competitionsetup.core.service.CompetitionSetupService; import org.innovateuk.ifs.controller.ValidationHandler; import org.innovateuk.ifs.publiccontent.form.AbstractPublicContentForm; import org.innovateuk.ifs.publiccontent.formpopulator.PublicContentFormPopulator; import org.innovateuk.ifs.publiccontent.modelpopulator.PublicContentViewModelPopulator; import org.innovateuk.ifs.publiccontent.saver.PublicContentFormSaver; import org.innovateuk.ifs.publiccontent.service.PublicContentService; import org.innovateuk.ifs.publiccontent.viewmodel.AbstractPublicContentViewModel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import javax.validation.Valid; import java.util.Optional; import java.util.function.Supplier; import static org.innovateuk.ifs.competition.publiccontent.resource.PublicContentSectionType.DATES; import static org.innovateuk.ifs.competitionsetup.CompetitionSetupController.COMPETITION_ID_KEY; /** * Abstract controller for all public content sections. */ public abstract class AbstractPublicContentSectionController<M extends AbstractPublicContentViewModel, F extends AbstractPublicContentForm> { protected static final String TEMPLATE_FOLDER = "competition/"; protected static final String FORM_ATTR_NAME = "form"; private static final String COMPETITION_SETUP_PATH = "/competition/setup/"; private static final String COMPETITION_SETUP_PUBLIC_CONTENT_DATES_PATH = COMPETITION_SETUP_PATH + "public-content/dates/"; private static final String REDIRECT = "redirect:"; @Autowired protected PublicContentService publicContentService; @Autowired protected CompetitionRestService competitionRestService; @Autowired protected CompetitionSetupService competitionSetupService; protected abstract PublicContentViewModelPopulator<M> modelPopulator(); protected abstract PublicContentFormPopulator<F> formPopulator(); protected abstract PublicContentFormSaver<F> formSaver(); @GetMapping("/{competitionId}") public String readOnly(Model model, @PathVariable(COMPETITION_ID_KEY) long competitionId) { return readOnly(competitionId, model, Optional.empty()); } @GetMapping("/{competitionId}/edit") public String edit(Model model, @PathVariable(COMPETITION_ID_KEY) long competitionId) { return edit(competitionId, model, Optional.empty()); } @PostMapping(value = "/{competitionId}/edit") public String markAsComplete(Model model, @PathVariable(COMPETITION_ID_KEY) long competitionId, @Valid @ModelAttribute(FORM_ATTR_NAME) F form, BindingResult bindingResult, ValidationHandler validationHandler) { return markAsComplete(competitionId, model, form, validationHandler); } protected String getPage(long competitionId, Model model, Optional<F> form, boolean readOnly) { if (isIFSAndCompetitionNotSetup(competitionId)) { return redirectTo(COMPETITION_SETUP_PATH + competitionId); } PublicContentResource publicContent = publicContentService.getCompetitionById(competitionId); model.addAttribute("model", modelPopulator().populate(publicContent, readOnly)); model.addAttribute("form", form.orElseGet(() -> formPopulator().populate(publicContent))); return TEMPLATE_FOLDER + "public-content-form"; } private String readOnly(long competitionId, Model model, Optional<F> form) { return getPage(competitionId, model, form, true); } private String edit(long competitionId, Model model, Optional<F> form) { return getPage(competitionId, model, form, false); } private boolean isIFSAndCompetitionNotSetup(long competitionId) { return !competitionRestService.getCompetitionById(competitionId).getSuccess().isNonIfs() && !competitionSetupService.hasInitialDetailsBeenPreviouslySubmitted(competitionId); } private String markAsComplete(long competitionId, Model model, F form, ValidationHandler validationHandler) { if (isIFSAndCompetitionNotSetup(competitionId)) { return redirectTo(COMPETITION_SETUP_PATH + competitionId); } PublicContentResource publicContent = publicContentService.getCompetitionById(competitionId); M populatedViewModel = modelPopulator().populate(publicContent, true); Supplier<String> successView = getSuccessView(competitionId, model, form, populatedViewModel); Supplier<String> failureView = () -> getPage(competitionId, model, Optional.of(form), false); return validationHandler.performActionOrBindErrorsToField("", failureView, successView, () -> formSaver().markAsComplete(form, publicContent)); } private Supplier<String> getSuccessView(long competitionId, Model model, F form, M populatedViewModel) { return isInDatesSection(populatedViewModel) ? (() -> redirectTo(COMPETITION_SETUP_PUBLIC_CONTENT_DATES_PATH + competitionId)) : (() -> getPage(competitionId, model, Optional.of(form), true)); } private boolean isInDatesSection(M populatedViewModel) { return DATES == populatedViewModel.getSection().getType(); } private String redirectTo(String path) { return REDIRECT + path; } }
49.14876
151
0.759711
993337cab49338549f30036a4071eb16482775f0
468
/*L * Copyright Moxie Informatics. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/calims/LICENSE.txt for details. */ /** * */ package gov.nih.nci.calims2.ui.inventory.characteristics; import gov.nih.nci.calims2.domain.inventory.characteristics.Characteristics; import gov.nih.nci.calims2.ui.generic.crud.CRUDForm; /** * @author viseem * */ public class CharacteristicsForm extends CRUDForm<Characteristics> { }
20.347826
76
0.747863
1b377085f2b1f87875f26e3cbde98fd491604838
9,271
package com.example.zo.diara; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.example.zo.diara.ModelClasses.LoginModel; import com.example.zo.diara.ModelClasses.User; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import dmax.dialog.SpotsDialog; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class LoginActivity extends AppCompatActivity { private EditText dEmail; private EditText dPassword; private Button dProceed; private ConfigPref configPref; private android.app.AlertDialog alertDialog; private LayoutInflater layoutInflater; private View layout, layout_err; private Toast toast_green, toast_red; private TextView toastText, toastTextError; private FirebaseAuth mAuth; private String userImage=""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); dEmail = findViewById(R.id.txtEmail); dPassword = findViewById(R.id.txtPassword); dProceed = findViewById(R.id.btnProceedLogin); configPref = new ConfigPref(getApplicationContext()); alertDialog = new SpotsDialog.Builder().setContext(this).build(); mAuth = FirebaseAuth.getInstance(); layoutInflater = getLayoutInflater(); layout = layoutInflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.custom_toast_layout_id)); layout_err = layoutInflater.inflate(R.layout.toast_red, (ViewGroup) findViewById(R.id.layout_toast_red)); toastText = layout.findViewById(R.id.text); toastTextError = layout_err.findViewById(R.id.errText); toast_green = new Toast(this); toast_green.setGravity(Gravity.BOTTOM, 0, 150); toast_green.setDuration(Toast.LENGTH_SHORT); toast_red = new Toast(this); toast_red.setGravity(Gravity.BOTTOM, 0, 150); toast_red.setDuration(Toast.LENGTH_SHORT); dEmail.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if(!hasFocus) hideKeyboard(v); } }); dPassword.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { hideKeyboard(v); } }); dProceed.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int flag = 0; if (dEmail.length() == 0) { dEmail.setError("Please enter a valid Email address."); flag++; } if (dPassword.length() < 4 || dPassword.length() > 50) { dPassword.setError("Your password must contain between 4 and 50 characters."); flag++; } if (flag == 0) { alertDialog.show(); loginUserWithEmailAndPassword(); } } }); } public void hideKeyboard(View view) { InputMethodManager inputMethodManager =(InputMethodManager)getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0); } public void loginUserWithEmailAndPassword(){ Call<LoginModel> loginModelCall = ApiClient .getInstance() .getApi() .loginUserWithEmailAndPassword(dEmail.getText().toString(), dPassword.getText().toString()); loginModelCall.enqueue(new Callback<LoginModel>() { @Override public void onResponse(Call<LoginModel> call, Response<LoginModel> response) { if(response.isSuccessful() && response.body() !=null){ Log.i("diaraLoginSuccess","Found 1 User with email and password."); Log.i("diaraLog", response.body().getMessage()); userImage = response.body().getAuthUserImgUrl(); firebaseSignIn( dEmail.getText().toString(), dPassword.getText().toString(), response.body().getAuthUserId(), response.body().getAuthToken()); }else{ alertDialog.dismiss(); toastTextError.setText(getString(R.string.notestablished)); toast_red.setView(layout_err); toast_red.show(); } } @Override public void onFailure(Call<LoginModel> call, Throwable t) { alertDialog.dismiss(); toastTextError.setText("There's an error! More details: " + t.getMessage()); toast_red.setView(layout_err); toast_red.show(); } }); } public void performLogin(final String uid, final String pwd) { Call<User> call = ApiClient .getInstance() .getApi() .performLogin(uid, pwd); call.enqueue(new Callback<User>() { @Override public void onResponse(Call<User> call, Response<User> response) { String resp = ""; if (response.isSuccessful()) { if (response.body() != null) { try { resp = response.body().getStatus(); } catch (Exception ex) { resp = "error"; } if (resp.toLowerCase().equals("ok")) { firebaseSignIn(uid, pwd, response.body().getAuth_user_id(), response.body().getAuth_token()); } else { alertDialog.dismiss(); toastTextError.setText(response.body().getMessage()); toast_red.setView(layout_err); toast_red.show(); } }else{ alertDialog.dismiss(); toastTextError.setText(getString(R.string.unavailableacct)); toast_red.setView(layout_err); toast_red.show(); } }else{ alertDialog.dismiss(); toastTextError.setText(getString(R.string.internetConnPrompt)); toast_red.setView(layout_err); toast_red.show(); } } @Override public void onFailure(Call<User> call, Throwable t) { alertDialog.dismiss(); toastTextError.setText(t.getMessage()); toast_red.setView(layout_err); toast_red.show(); } }); } public void dismissAndPrompt(int type, String promptMessage, View view){ alertDialog.dismiss(); toastTextError.setText(promptMessage); toast_red.setView(view); toast_red.show(); } public void firebaseSignIn(final String email, String password, final long userID, final String token){ mAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if(task.isSuccessful()){ alertDialog.dismiss(); configPref.writeLoginStatus(true, userID, token, email, userImage); toMain(); }else{ alertDialog.dismiss(); toastTextError.setText(task.getException().toString()); toast_red.setView(layout_err); toast_red.show(); } } }); } public void toMain() { Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); finishAffinity(); } public void toSignUp(View view) { Intent intent = new Intent(getApplicationContext(), RegisterActivity.class); startActivity(intent); } @Override protected void onStart() { super.onStart(); } }
37.840816
121
0.565311
7abfaaa3d2490e92409975941351a4a443e5c404
108
package net.osnixer.automessage.object.interfaces; public interface Hoverable { String getHover(); }
13.5
50
0.759259
94fd71326e6dee4b736ae7916a4a37b3cce96ee1
5,817
package com.emprestimo.app.processor.options; import com.emprestimo.app.Script.options.EmpregadorSQL; import com.emprestimo.app.dto.contato.ContatoDto; import com.emprestimo.app.dto.dadosbancario.DadosBancarioDto; import com.emprestimo.app.dto.endereco.EnderecoDto; import com.emprestimo.app.dto.options.EmpregadorDto; import com.emprestimo.app.dto.pessoa.PessoaDto; import com.emprestimo.app.dto.registro.RegistroDto; import com.emprestimo.app.model.options.Empregador; import com.emprestimo.app.repository.contato.ContatoRepository; import com.emprestimo.app.repository.dadosbancario.DadosBancarioRepository; import com.emprestimo.app.repository.endereco.EnderecoRepository; import com.emprestimo.app.repository.options.EmpregadorRepository; import com.emprestimo.app.repository.pessoa.PessoaRepository; import com.emprestimo.app.repository.registro.RegistroRepository; import lombok.AllArgsConstructor; import javax.inject.Named; import java.util.ArrayList; import java.util.List; @Named @AllArgsConstructor public class EmpregadorProcessor { private final EmpregadorRepository empregadorRepository; private final PessoaRepository pessoaRepository; private final EnderecoRepository enderecoRepository; private final ContatoRepository contatoRepository; private final DadosBancarioRepository dadosBancarioRepository; private final RegistroRepository registroRepository; public List<EmpregadorDto> GetAllEmpregador(){ List<EmpregadorDto> empregadores = new ArrayList<>(); empregadorRepository.getAllEmpregador().forEach(produto -> { var prod = EmpregadorDto.builder() .idempregador(produto.getIdempregador()) .empregador(produto.getEmpregador()) .build(); empregadores.add(prod); }); return empregadores; } public void saveEmpregador(EmpregadorDto empregadorDto){ var empregador = Empregador.builder() .empregador(empregadorDto.getEmpregador()) .build(); empregadorRepository.saveEmpregador(empregador); } public void deleteEmpregador(EmpregadorDto empregadorDto){ var empregador = Empregador.builder() .idempregador(empregadorDto.getIdempregador()) .build(); empregadorRepository.deleteEmpregador(empregador.getIdempregador()); } public EmpregadorDto findByIdEmpregador(EmpregadorDto empregadorDto){ var empregador = empregadorRepository.findByIdEmpregador(empregadorDto.getIdempregador()); empregadorDto.setEmpregador(empregador.getEmpregador()); pessoaRepository.findByPessoaPorIdEmpregador(empregadorDto).forEach(p -> { var pessoa = PessoaDto.builder() .nome(p.getNome()) .cpf(p.getCpf()) .rg(p.getRg()) .dataemissaorg(p.getDataemissaorg()) .ufrg(p.getUfrg()) .renda(p.getRenda()) .datanascimento(p.getDatanascimento()) .naturalidae(p.getNaturalidae()) .estadonascimento(p.getEstadonascimento()) .estadocivil(p.getEstadocivil()) .nomepai(p.getNomepai()) .nomemae(p.getNomemae()) .email(p.getEmail()) .indicacao(p.getIndicacao()) .build(); enderecoRepository.GetEnderecoByIdPessoa(p.getIdpessoa()).forEach(endereco -> { var en = EnderecoDto.builder() .logradouro(endereco.getLogradouro()) .tipologradouro(endereco.getTipologradouro()) .numero(endereco.getNumero()) .cep(endereco.getCep()) .uf(endereco.getUf()) .bairro(endereco.getBairro()) .cidade(endereco.getCidade()) .estado(endereco.getEstado()) .build(); pessoa.getEnderecos().add(en); }); contatoRepository.getContatoByIdPessoa(p.getIdpessoa()).forEach(contato -> { var co = ContatoDto.builder() .descricao(contato.getDescricao()) .numero(contato.getNumero()) .tipocontato(contato.getTipocontato()) .build(); pessoa.getContatos().add(co); }); dadosBancarioRepository.GetBancoByIdPessoa(p.getIdpessoa()).forEach(dadosBancario -> { var dados = DadosBancarioDto.builder() .agencia(dadosBancario.getAgencia()) .digitoagencia(dadosBancario.getDigitoagencia()) .nomebanco(dadosBancario.getNomebanco()) .numbanco(dadosBancario.getNumbanco()) .numconta(dadosBancario.getNumconta()) .digitoconta(dadosBancario.getDigitoconta()) .statusconta(dadosBancario.getStatusconta()) .tipoconta(dadosBancario.getTipoconta()) .build(); pessoa.getDadosbancario().add(dados); }); registroRepository.GetRegistroByIdPessoa(p.getIdpessoa()).forEach(registro -> { var re = RegistroDto.builder() .numbeneficio(registro.getNumbeneficio()) .matricula(registro.getMatricula()) .build(); pessoa.getRegistros().add(re); }); empregadorDto.getPessoaDtoList().add(pessoa); }); return empregadorDto; } }
39.842466
98
0.607873
22e6c87bbf6def3c1fc6b44528f17f49d11ee6c2
4,687
/* * Copyright 2021 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.bigtable.beam.test_env; import com.google.cloud.bigtable.hbase.BigtableOptionsFactory; import com.google.common.base.Preconditions; import java.util.Optional; import java.util.UUID; import org.apache.beam.runners.dataflow.DataflowRunner; import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions; import org.apache.beam.sdk.extensions.gcp.options.GcpOptions; import org.apache.hadoop.conf.Configuration; public class TestProperties { private final String projectId; private final String instanceId; private final String dataflowRegion; private final String workdir; private final Optional<String> dataEndpoint; private final Optional<String> adminEndpoint; public TestProperties( String projectId, String instanceId, String dataflowRegion, String workdir, Optional<String> dataEndpoint, Optional<String> adminEndpoint) { this.projectId = projectId; this.instanceId = instanceId; this.dataflowRegion = dataflowRegion; this.workdir = workdir; this.dataEndpoint = dataEndpoint; this.adminEndpoint = adminEndpoint; } public String getProjectId() { return projectId; } public String getInstanceId() { return instanceId; } public String getDataflowRegion() { return dataflowRegion; } /** * Directory that will store ephemeral data that can be re-populated but the test * * <p>Expected Structure: * * <ul> * <li>staging - dataflow staged jars * <li>workdir-${uuid} - temporary workdir directory for the a test */ public String getWorkdir() { return workdir; } public String getDataflowStagingDir() { return ensureTrailingSlash(getWorkdir()) + "staging/"; } public String getTestWorkdir(UUID testId) { return ensureTrailingSlash(getWorkdir()) + "workdir-" + testId + "/"; } public Optional<String> getDataEndpoint() { return dataEndpoint; } public Optional<String> getAdminEndpoint() { return adminEndpoint; } /** Contains persistent fixture data */ public static TestProperties fromSystem() { // TODO: once all of the kokoro configs are updated replace this with // getProp("dataflow.work-dir") String workDirKey = "google.dataflow.work-dir"; String workDir = System.getProperty(workDirKey); // backwards compat for old setup if (workDir == null) { workDir = System.getProperty("google.dataflow.stagingLocation"); } Preconditions.checkNotNull(workDir, "The system property " + workDirKey + " must be specified"); return new TestProperties( getProp("google.bigtable.project.id"), getProp("google.bigtable.instance.id"), getProp("region"), ensureTrailingSlash(workDir), Optional.ofNullable(System.getProperty(BigtableOptionsFactory.BIGTABLE_HOST_KEY)), Optional.ofNullable(System.getProperty(BigtableOptionsFactory.BIGTABLE_ADMIN_HOST_KEY))); } public void applyTo(DataflowPipelineOptions opts) { opts.setRunner(DataflowRunner.class); opts.setProject(getProjectId()); opts.setRegion(getDataflowRegion()); opts.setStagingLocation(getDataflowStagingDir()); } public void applyTo(GcpOptions opts) { opts.setRunner(DataflowRunner.class); opts.setProject(getProjectId()); } public void applyTo(Configuration configuration) { configuration.set(BigtableOptionsFactory.PROJECT_ID_KEY, getProjectId()); configuration.set(BigtableOptionsFactory.INSTANCE_ID_KEY, getInstanceId()); dataEndpoint.ifPresent(e -> configuration.set(BigtableOptionsFactory.BIGTABLE_HOST_KEY, e)); adminEndpoint.ifPresent( e -> configuration.set(BigtableOptionsFactory.BIGTABLE_ADMIN_HOST_KEY, e)); } private static String getProp(String name) { String value = System.getProperty(name); Preconditions.checkNotNull(value, "The system property " + name + " must be specified"); return value; } private static String ensureTrailingSlash(String path) { if (path.endsWith("/")) { return path; } return path + "/"; } }
31.884354
100
0.725197
306229952555b23558259390f5286debc0a69939
5,298
package com.gl.vn.me.ko.pies.platform.server.rest; import static com.google.common.base.Preconditions.checkNotNull; import com.gl.vn.me.ko.pies.base.constant.Constant; import com.gl.vn.me.ko.pies.base.constant.Message; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.ServerSocketChannel; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; import java.net.InetSocketAddress; import java.util.Collection; import java.util.concurrent.ThreadFactory; import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; import javax.inject.Inject; import javax.json.JsonBuilderFactory; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A {@link RestServer} that responds by using JSON only. * <p> * HTTP responses MAY specify * <a href="http://tools.ietf.org/html/rfc2616#section-6.1.1">HTTP reason phrase</a> in the following format * (see {@link #JSON_RESPONSE_REASON_PHRASE_NVNAME}): * <pre><code> * { * "httpReasonPhrase": "a reason phrase" * } * </code></pre> */ @ThreadSafe public final class JsonRestServer extends RestServer<JsonRestRequestHandlerResult> { private static final Logger LOGGER = LoggerFactory.getLogger(JsonRestServer.class); /** * Name of a name-value JSON pair that specifies an * <a href="http://tools.ietf.org/html/rfc2616#section-6.1.1">HTTP reason phrase</a>. * <p> * Value of this constant is {@value}. */ public static final String JSON_RESPONSE_REASON_PHRASE_NVNAME = "httpReasonPhrase"; private final JsonBuilderFactory jsonBuilderFactory; /** * Constructs a new instance of {@link JsonRestServer}. * See {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)} * for details. * * @param address * See {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param name * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param maxBossThreads * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param maxWorkerThreads * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param maxPostResponseWorkerThreads * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param threadFactory * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param serverSocketChannelInitializer * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param restHandlers * {@link RestServer#RestServer( * InetSocketAddress, String, Integer, Integer, Integer, ThreadFactory, ChannelInitializer, Collection)}. * @param jsonBuilderFactory * An implementation of {@link JsonBuilderFactory}. */ @Inject public JsonRestServer( @RestServerAddress final InetSocketAddress address, @RestServerName final String name, @RestServerBoss final Integer maxBossThreads, @RestServerWorker final Integer maxWorkerThreads, @RestServerRequestHandling final Integer maxPostResponseWorkerThreads, @RestServerThreadFactory final ThreadFactory threadFactory, @RestServerBoss @Nullable final ChannelInitializer<ServerSocketChannel> serverSocketChannelInitializer, @RestServerRequestHandling @Nullable final Collection<? extends RestRequestHandler<? extends JsonRestRequestHandlerResult>> restHandlers, final JsonBuilderFactory jsonBuilderFactory) { super( address, name, maxBossThreads, maxWorkerThreads, maxPostResponseWorkerThreads, threadFactory, serverSocketChannelInitializer, restHandlers ); checkNotNull(jsonBuilderFactory, Message.ARGUMENT_NULL, "tenth", "jsonBuilderFactory"); this.jsonBuilderFactory = jsonBuilderFactory; } @Override protected final FullHttpResponse createServiceHttpResponse( final HttpResponseStatus httpResponseStatus, @Nullable final String httpReasonPhrase) { final FullHttpResponse result = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, httpResponseStatus); if (httpReasonPhrase != null) { final JsonObjectBuilder jsonBuilder = jsonBuilderFactory.createObjectBuilder(); jsonBuilder.add(JSON_RESPONSE_REASON_PHRASE_NVNAME, httpReasonPhrase); final JsonObject httpResponseContent = jsonBuilder.build(); result.content().writeBytes(httpResponseContent.toString().getBytes(Constant.CHARSET)); } final HttpHeaders responseHeaders = result.headers(); responseHeaders.set(HttpHeaders.Names.CONTENT_TYPE, "application/json; charset=" + Constant.CHARSET.name()); return result; } }
42.725806
110
0.784069
c768267c572fbbfc0ae0768de75599f59c9ade1c
117
package org.minimalj.example.library.model; public class ExampleFormats { public static final int NAME = 30; }
13
43
0.752137
e1aa88f46dcda9bdcae530e04fea56883d9041d7
982
/* * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.xd.dirt.server.options; /** * The Hadoop distribution to use. * * @author Thomas Risberg * */ public enum HadoopDistro { /** * Apache Hadoop 1.2 */ hadoop12, /** * Apache Hadoop 2.0 */ hadoop20, /** * Cloudera CDH 4 */ cdh4, /** * Hortonworks HDP 1.3 */ hdp13, /** * Pivotal HD 1.0 */ phd1; }
18.528302
75
0.674134
d53742f8665e96e646fef7ac1b0377131159257d
5,311
package gg.eris.uhc.customcraft.craft.vocation.duelist.craft; import gg.eris.commons.bukkit.player.ErisPlayer; import gg.eris.commons.bukkit.text.TextController; import gg.eris.commons.bukkit.text.TextType; import gg.eris.commons.bukkit.util.CC; import gg.eris.commons.bukkit.util.DataUtil; import gg.eris.commons.bukkit.util.ItemBuilder; import gg.eris.commons.bukkit.util.NBTUtil; import gg.eris.commons.bukkit.util.RomanNumeral; import gg.eris.uhc.core.event.UhcPlayerDeathEvent; import gg.eris.uhc.core.event.UhcTickEvent; import gg.eris.uhc.customcraft.craft.CraftHelper; import gg.eris.uhc.customcraft.craft.CraftTickable; import gg.eris.uhc.customcraft.craft.vocation.Craft; import gg.eris.uhc.customcraft.craft.vocation.CraftableInfo; import gg.eris.uhc.customcraft.craft.vocation.Vocation; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.inventory.ShapedRecipe; import org.bukkit.material.MaterialData; public final class SoulThirsterCraft extends Craft implements CraftTickable { private static final String NBT_KEY = "soul_thirster_decay"; private static final long DECAY_TIME = 1000 * 60 * 5; public SoulThirsterCraft() { super("soul_thirster", CraftableInfo.builder() .base(new ItemBuilder(Material.DIAMOND_SWORD) .withEnchantment(Enchantment.DAMAGE_ALL, 1) .build()) .color(CC.DARK_RED) .name("Soul Thirster") .quote("I want to suck your blood!") .quoteGiver("Dracula") .effects( "Sharpness I Diamond Sword", "Increases by 1 sharpness level each kill, up to Sharpness IV", "Decays a sharpness level every 5 minutes without a kill, down to Sharpness I" ).nonTransformable() .build() ); } @Override public Vocation getVocation() { return Vocation.DUELIST; } @Override public int getCraftableAmount() { return 1; } @Override public int getPrestigeCraftableAmount() { return 2; } @Override public Recipe getRecipe() { return new ShapedRecipe(getActualItem()) .shape( "xdx", "lsl", "xLx" ).setIngredient('x', Material.EXP_BOTTLE) .setIngredient('d', Material.DIAMOND) .setIngredient('l', new MaterialData(Material.INK_SACK, DataUtil.LAPIS_LAZULI)) .setIngredient('L', Material.LAPIS_BLOCK) .setIngredient('s', CraftHelper.durabilityIgnored(Material.DIAMOND_SWORD)); } @Override public String getName() { return "Soul Thirster"; } @EventHandler(priority = EventPriority.HIGHEST) public void onKill(UhcPlayerDeathEvent event) { if (event.getKiller() == null) { return; } Player killer = event.getKiller().getHandle(); if (killer == null) { return; } // Checking for arrows and switching hand if (event.getHandle() instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) event.getHandle()).getDamager().getType() != EntityType.PLAYER) { return; } else if (event.getKilled().getLastAttacker() == null || System.currentTimeMillis() - event.getKilled().getLastAttacker().getValue() > 1000) { // Only level up the sword if they log out within a second of last being hit // a not-100%-safe way of checking if they were last hit // TODO: Switch to storing data about the last damage event they took from the attacker // TOOD: and checking that return; } ItemStack item = killer.getItemInHand(); if (isItem(item)) { int sharpnessLevel = item.getEnchantmentLevel(Enchantment.DAMAGE_ALL); if (sharpnessLevel >= 4) { return; } sharpnessLevel++; item.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, sharpnessLevel); item = NBTUtil.setNbtData(item, NBT_KEY, System.currentTimeMillis()); killer.setItemInHand(item); TextController.send( killer, TextType.INFORMATION, "Your <h>{0}</h> has levelled up to <h>Sharpness {1}</h>.", getName(), RomanNumeral.toRoman(sharpnessLevel) ); } } @Override public void tick(UhcTickEvent event, ItemStack item, int itemSlot, ErisPlayer player) { int sharpnessLevel = item.getEnchantmentLevel(Enchantment.DAMAGE_ALL); if (sharpnessLevel == 1) { return; } long time = NBTUtil.getLongNbtData(item, NBT_KEY); if (time == 0) { return; } long current = System.currentTimeMillis(); if (current - DECAY_TIME > time) { sharpnessLevel--; item.addEnchantment(Enchantment.DAMAGE_ALL, sharpnessLevel); item = NBTUtil.setNbtData(item, NBT_KEY, System.currentTimeMillis()); player.getHandle().getInventory().setItem(itemSlot, item); TextController.send( player, TextType.INFORMATION, "Your <h>{0}</h> has decayed to <h>Sharpness {1}</h>", getName(), RomanNumeral.toRoman(sharpnessLevel) ); } } }
32.582822
96
0.682734
55528705745655d31976b9277c91cd03f4b9d90f
3,142
package searching; /** * Sparse Vector represents a dimensional mathematical vector. Vectors are mutable: * their values can be changed after they are created. * * Initialization: O(1) * Operations: Where n is the number of items. * dot, scale, plus, toString: O(n) * put, get: O(log n) * nnz, dimension, magnitude: O(1) * * Notes: * The implementation is a symbol table of indices and values for which the vector * coordinates are nonzero. This makes it efficient when most of the vector coordindates are zero. */ public class SparseVector { private int d; // dimension of vector private RedBlackBST<Integer, Double> st; // the vector, represented by index-value pairs public SparseVector(int d) { this.d = d; this.st = new RedBlackBST<Integer, Double>(); } public void put(int i, double value) { if (i < 0 || i >= d) throw new IllegalArgumentException("Illegal index"); if (value == 0.0) st.delete(i); else st.put(i, value); } public double get(int i) { if (i < 0 || i >= d) throw new IllegalArgumentException("Illegal index"); if (st.contains(i)) return st.get(i); else return 0.0; } public int size() { return st.size(); } public int dimension() { return d; } public double dot(SparseVector that) { if (this.d != that.d) throw new IllegalArgumentException("Vector lengths disagree"); double sum = 0.0; if (this.st.size() <= that.st.size()) { for (int i : this.st.keys()) if (that.st.contains(i)) sum += this.get(i) * that.get(i); } else { for (int i : that.st.keys()) if (this.st.contains(i)) sum += this.get(i) * that.get(i); } return sum; } public double dot(double[] that) { double sum = 0.0; for (int i : st.keys()) sum += that[i] * this.get(i); return sum; } public double magnitude() { // also known as the L2 norm or the Euclidean norm. return Math.sqrt(this.dot(this)); } public SparseVector scale(double alpha) { SparseVector c = new SparseVector(d); for (int i : this.st.keys()) { c.put(i, alpha * this.get(i)); } return c; } public SparseVector plus(SparseVector that) { if (this.d != that.d) throw new IllegalArgumentException("Vector lengths disagree"); SparseVector c = new SparseVector(d); for (int i : this.st.keys()) c.put(i, this.get(i)); // c = this for (int i : that.st.keys()) c.put(i, that.get(i) + c.get(i)); // c = c + that return c; } public String toString() { StringBuilder s = new StringBuilder(); for (int i : st.keys()) { s.append("(" + i + ", " + st.get(i) + ") "); } return s.toString(); } // TESTS ======================================================== public static void main(String[] args) { SparseVector a = new SparseVector(10); SparseVector b = new SparseVector(10); a.put(3, 0.50); a.put(9, 0.75); a.put(6, 0.11); a.put(6, 0.00); b.put(3, 0.60); b.put(4, 0.90); System.out.println("a = " + a); System.out.println("b = " + b); System.out.println("a dot b = " + a.dot(b)); System.out.println("a + b = " + a.plus(b)); } }
27.561404
101
0.598027
fd8343bd801e2cea07dccdbd18bf8d67412d3969
3,407
package com.lamfire.utils; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.Map; public class ObjectFactory<T> { private Class<T> claxx; public ObjectFactory(Class<T> clazz) { this.claxx = clazz; } public T newInstance() throws InstantiationException, IllegalAccessException { T obj = this.claxx.newInstance(); return obj; } public T newInstance(Object... args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Class<?>[] argsClasses = new Class[args.length]; int i = 0; for (Object arg : args) { argsClasses[i++] = arg.getClass(); } return newInstance(argsClasses, args); } public T newInstance(Class<?>[] argsClasses, Object[] constructorArgs) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Constructor<T> cons = this.claxx.getConstructor(argsClasses); return cons.newInstance(constructorArgs); } public T newInstanceAndBindProperties(Map<String, Object> propertys) throws InstantiationException, IllegalAccessException { T obj = this.claxx.newInstance(); ObjectUtils.setPropertiesValues(this.claxx, propertys); return obj; } public T newInstanceAndBindProperties(Class<?>[] argsClasses, Object[] constructorArgs, Map<String, Object> propertys) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Constructor<T> cons = this.claxx.getConstructor(argsClasses); T obj = cons.newInstance(constructorArgs); ObjectUtils.setPropertiesValues(this.claxx, propertys); return obj; } public Constructor<?> getConstructor(Class<?>[] argsClasses) throws SecurityException, NoSuchMethodException { return this.claxx.getConstructor(argsClasses); } public Constructor<?>[] getConstructor() throws SecurityException, NoSuchMethodException { return this.claxx.getConstructors(); } public void setProperties(T t, Map<String, Object> propertys) { ObjectUtils.setPropertiesValues(t, propertys); } public void setProperty(T t, String name, Object val) { ObjectUtils.setPropertyValue(t, name, val); } }
45.426667
120
0.535368
16506549002744d1c383739029f767ddcf73ab2c
9,960
package cn.edu.cug.cs.gtl.geom; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Arrays; /** * Created by ZhenwenHe on 2016/12/8. * 2017/02/12 finished and checked */ public class VectorImpl implements Vector { private static final long serialVersionUID = 1L; double[] coordinates; public VectorImpl() { this.coordinates = new double[3]; } public VectorImpl(int dim) { this.coordinates = new double[dim]; } public VectorImpl(double x, double y) { this.coordinates = new double[2]; this.coordinates[0] = x; this.coordinates[1] = y; } public VectorImpl(double x, double y, double z) { this.coordinates = new double[3]; this.coordinates[0] = x; this.coordinates[1] = y; this.coordinates[2] = z; } public VectorImpl(double x, double y, double z, double t) { this.coordinates = new double[4]; this.coordinates[0] = x; this.coordinates[1] = y; this.coordinates[2] = z; this.coordinates[3] = t; } public VectorImpl(double[] coordinates) { this.coordinates = new double[coordinates.length]; System.arraycopy(coordinates, 0, this.coordinates, 0, coordinates.length); } public VectorImpl(double[] coordinates, int beginPosition, int length) { this.coordinates = new double[length]; System.arraycopy(coordinates, beginPosition, this.coordinates, 0, length); } public double[] getCoordinates() { return coordinates; } public void setCoordinates(double[] coordinates) { this.coordinates = coordinates; } @Override public Object clone() { double[] td = new double[this.coordinates.length]; System.arraycopy(this.coordinates, 0, td, 0, td.length); return new VectorImpl(td); } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof VectorImpl)) return false; VectorImpl point = (VectorImpl) o; return Arrays.equals(getCoordinates(), point.getCoordinates()); } @Override public int hashCode() { return Arrays.hashCode(getCoordinates()); } @Override public String toString() { return "VectorImpl{" + "coordinates=" + Arrays.toString(coordinates) + '}'; } @Override public int getDimension() { return this.coordinates.length; } @Override public double getX() { return this.coordinates[0]; } @Override public void setX(double x) { this.coordinates[0] = x; } @Override public double getY() { return this.coordinates[1]; } @Override public void setY(double y) { this.coordinates[1] = y; } @Override public double getZ() { return this.coordinates[2]; } @Override public void setZ(double z) { this.coordinates[2] = z; } @Override public boolean load(DataInput dis) throws IOException { int dims = dis.readInt(); this.makeDimension(dims); for (int i = 0; i < dims; i++) { this.coordinates[i] = dis.readDouble(); } return true; } @Override public boolean store(DataOutput dos) throws IOException { int dims = this.getDimension(); dos.writeInt(dims); for (double d : this.coordinates) dos.writeDouble(d); return true; } @Override public long getByteArraySize() { return getDimension() * 8 + 4; } @Override public void makeInfinite(int dimension) { makeDimension(dimension); for (int cIndex = 0; cIndex < this.coordinates.length; ++cIndex) { this.coordinates[cIndex] = Double.MAX_VALUE; } } @Override public void makeDimension(int dimension) { if (this.getDimension() != dimension) { double[] newData = new double[dimension]; int minDims = Math.min(newData.length, this.coordinates.length); for (int i = 0; i < minDims; i++) { newData[i] = this.coordinates[i]; } this.coordinates = newData; } } @Override public double getOrdinate(int i) { if (i < this.getDimension()) return this.coordinates[i]; else return Vector.NULL_ORDINATE; } @Override public void copyFrom(Object i) { if (i instanceof Vector) { Vector v = (Vector) i; if (v.getCoordinates().length == this.coordinates.length) { System.arraycopy( v.getCoordinates(), 0, this.coordinates, 0, this.coordinates.length); } else { this.coordinates = new double[v.getCoordinates().length]; System.arraycopy( v.getCoordinates(), 0, this.coordinates, 0, this.coordinates.length); } } } @Override public void reset(double[] coordinates) { if (this.coordinates.length == coordinates.length) { System.arraycopy(this.coordinates, 0, coordinates, 0, coordinates.length); } else { this.coordinates = new double[coordinates.length]; System.arraycopy(this.coordinates, 0, coordinates, 0, coordinates.length); } } @Override public double normalize() { double dist = 0.0; double invDist = 0.0; dist = this.length(); if (dist > 0.0) { invDist = 1.0 / dist; for (int i = 0; i < this.coordinates.length; ++i) this.coordinates[i] *= invDist; } return dist; } @Override public double dotProduct(Vector v) { double dRtn = 0.0; double[] B = v.getCoordinates(); int i = 0; for (double d : this.coordinates) { dRtn += d * B[i]; ++i; } return dRtn; } @Override public Vector crossProduct(Vector b) { assert b.getDimension() == 3 && this.getDimension() == 3; Vector vRet = new VectorImpl(0.0, 0.0, 0.0); double[] V = vRet.getCoordinates(); double[] A = this.coordinates; double[] B = b.getCoordinates(); V[0] = A[1] * B[2] - A[2] * B[1]; V[1] = A[2] * B[0] - A[0] * B[2]; V[2] = A[0] * B[1] - A[1] * B[0]; return vRet; } @Override public double length() { double sum = 0; for (double d : this.coordinates) sum += d * d; return java.lang.Math.sqrt(sum); } /** * 求向量ao与bo的夹角 * * @param a 点坐标 * @param b 点坐标 * @return 返回弧度 */ @Override public double angle(Vector a, Vector b) { Vector ao = a.subtract(this); Vector bo = b.subtract(this); double lfRgn = ao.dotProduct(bo); double lfLA = ao.length(); double lfLB = bo.length(); double cosA = lfRgn / (lfLA * lfLB); return java.lang.Math.acos(cosA); } @Override public Vector subtract(Vector b) { assert b.getDimension() >= this.getDimension(); Vector v = (Vector) this.clone(); double[] dv = v.getCoordinates(); double[] bv = b.getCoordinates(); for (int i = 0; i < dv.length; ++i) { dv[i] -= bv[i]; } return v; } @Override public Vector add(Vector b) { assert b.getDimension() >= this.getDimension(); Vector v = (Vector) this.clone(); double[] dv = v.getCoordinates(); double[] bv = b.getCoordinates(); for (int i = 0; i < dv.length; ++i) { dv[i] += bv[i]; } return v; } @Override public void setOrdinate(int i, double d) { this.coordinates[i] = d; } @Override public Vector multiply(Scalar s) { VectorImpl v = new VectorImpl(this.coordinates); for (int i = 0; i < this.coordinates.length; ++i) { v.coordinates[i] *= s.getScalar(); } return v; } @Override public Vector multiply(double s) { VectorImpl v = new VectorImpl(this.coordinates); for (int i = 0; i < this.coordinates.length; ++i) { v.coordinates[i] *= s; } return v; } @Override public Vector divide(Scalar s) { VectorImpl v = new VectorImpl(this.coordinates); for (int i = 0; i < this.coordinates.length; ++i) { v.coordinates[i] /= s.scalar; } return v; } @Override public Vector divide(double s) { VectorImpl v = new VectorImpl(this.coordinates); for (int i = 0; i < this.coordinates.length; ++i) { v.coordinates[i] /= s; } return v; } /** * 按照X,Y,Z方向上的坐标分量大小比较,返回1,0,-1 * * @param o * @return */ @Override public int compareTo(Vector o) { OrdinateComparator<Vector> c = new OrdinateComparator<>(0); int dim = Math.min(getDimension(), o.getDimension()); for (int i = 0; i < dim; ++i) { c.setDimensionOrder(i); int r = c.compare(this, o); if (r != 0) return r; } return 0; } @Override public Vector2D flap() { return new Vector2D(this.coordinates[0], this.coordinates[1]); } @Override public Vector2D flapXY() { return new Vector2D(this.coordinates[0], this.coordinates[1]); } @Override public Vector2D flapYZ() { return new Vector2D(this.coordinates[1], this.coordinates[2]); } @Override public Vector2D flapXZ() { return new Vector2D(this.coordinates[0], this.coordinates[2]); } }
26.210526
82
0.544779
f86ebb513c335173264f7b76d90d645288331596
86
package com.csci.grammar; public class ListDef extends java.util.LinkedList<Def> { }
21.5
58
0.77907
31c0ae8cc3dc8b4e4ca44d038fe6bdd5a857d07f
4,636
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.ingest.common; import org.elasticsearch.ingest.AbstractProcessor; import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestDocument; import org.elasticsearch.ingest.Processor; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.elasticsearch.script.ScriptService; import static org.elasticsearch.ingest.ConfigurationUtils.newConfigurationException; import static org.elasticsearch.ingest.ConfigurationUtils.readBooleanProperty; import static org.elasticsearch.ingest.ConfigurationUtils.readMap; import static org.elasticsearch.ingest.ConfigurationUtils.readStringProperty; /** * A processor that for each value in a list executes a one or more processors. * * This can be useful in cases to do string operations on json array of strings, * or remove a field from objects inside a json array. * * Note that this processor is experimental. */ public final class ForEachProcessor extends AbstractProcessor { public static final String TYPE = "foreach"; private final String field; private final Processor processor; private final boolean ignoreMissing; ForEachProcessor(String tag, String field, Processor processor, boolean ignoreMissing) { super(tag); this.field = field; this.processor = processor; this.ignoreMissing = ignoreMissing; } boolean isIgnoreMissing() { return ignoreMissing; } @Override public void execute(IngestDocument ingestDocument) throws Exception { List<?> values = ingestDocument.getFieldValue(field, List.class, ignoreMissing); if (values == null) { if (ignoreMissing) { return; } throw new IllegalArgumentException("field [" + field + "] is null, cannot loop over its elements."); } List<Object> newValues = new ArrayList<>(values.size()); for (Object value : values) { Object previousValue = ingestDocument.getIngestMetadata().put("_value", value); try { processor.execute(ingestDocument); } finally { newValues.add(ingestDocument.getIngestMetadata().put("_value", previousValue)); } } ingestDocument.setFieldValue(field, newValues); } @Override public String getType() { return TYPE; } String getField() { return field; } Processor getProcessor() { return processor; } public static final class Factory implements Processor.Factory { private final ScriptService scriptService; Factory(ScriptService scriptService) { this.scriptService = scriptService; } @Override public ForEachProcessor create(Map<String, Processor.Factory> factories, String tag, Map<String, Object> config) throws Exception { String field = readStringProperty(TYPE, tag, config, "field"); boolean ignoreMissing = readBooleanProperty(TYPE, tag, config, "ignore_missing", false); Map<String, Map<String, Object>> processorConfig = readMap(TYPE, tag, config, "processor"); Set<Map.Entry<String, Map<String, Object>>> entries = processorConfig.entrySet(); if (entries.size() != 1) { throw newConfigurationException(TYPE, tag, "processor", "Must specify exactly one processor type"); } Map.Entry<String, Map<String, Object>> entry = entries.iterator().next(); Processor processor = ConfigurationUtils.readProcessor(factories, scriptService, entry.getKey(), entry.getValue()); return new ForEachProcessor(tag, field, processor, ignoreMissing); } } }
37.387097
115
0.686152
e2bfabc63775544a7e743fbbc25aca40fc9138b6
3,125
/* * Copyright (c) 2008, Rickard Öberg. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.qi4j.runtime.property; import org.qi4j.api.common.QualifiedName; import org.qi4j.functional.HierarchicalVisitor; import org.qi4j.functional.VisitableHierarchy; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Member; import java.util.*; /** * Base class for properties model */ public class PropertiesModel implements VisitableHierarchy<Object, Object> { protected final Map<AccessibleObject, PropertyModel> mapAccessiblePropertyModel = new LinkedHashMap<AccessibleObject,PropertyModel>(); public PropertiesModel() { } public void addProperty(PropertyModel property) { mapAccessiblePropertyModel.put( property.accessor(), property ); } @Override public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<? super Object, ? super Object, ThrowableType> visitor ) throws ThrowableType { if (visitor.visitEnter( this )) { for( PropertyModel propertyModel : mapAccessiblePropertyModel.values() ) { if (!propertyModel.accept(visitor)) break; } } return visitor.visitLeave( this ); } public Iterable<PropertyModel> properties() { return mapAccessiblePropertyModel.values(); } public PropertyModel getProperty(AccessibleObject accessor) { PropertyModel propertyModel = mapAccessiblePropertyModel.get( accessor ); if (propertyModel == null) throw new IllegalArgumentException( "No property found with name:"+((Member)accessor).getName() ); return propertyModel; } public PropertyModel getPropertyByName( String name ) throws IllegalArgumentException { for( PropertyModel propertyModel : mapAccessiblePropertyModel.values() ) { if( propertyModel.qualifiedName().name().equals( name ) ) { return propertyModel; } } throw new IllegalArgumentException( "No property found with name:"+name ); } public PropertyModel getPropertyByQualifiedName( QualifiedName name ) throws IllegalArgumentException { for( PropertyModel propertyModel : mapAccessiblePropertyModel.values() ) { if( propertyModel.qualifiedName().equals( name ) ) { return propertyModel; } } throw new IllegalArgumentException( "No property found with ualified name:"+name ); } }
33.244681
158
0.6816
94e7908f1008f82db81d6a2e463493eb5448dd0a
377
package org.edmcouncil.spec.fibo.weasel.model.property; import org.edmcouncil.spec.fibo.config.configuration.model.PairImpl; /** * @author Patrycja Miazek ([email protected]) */ public class OwlDirectedSubClassesProperty extends PropertyValueAbstract<PairImpl> { @Override public String toString() { return super.getValue().getValueA().toString(); } }
25.133333
84
0.769231
088a5083051801719764819752a12f48d8015682
5,136
/** * Copyright (c) 2009-2019, Yegor Bugayenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: 1) Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. 2) Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. 3) Neither the name of the rultor.com nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.rultor.agents; import com.jcabi.email.Envelope; import com.jcabi.email.Postman; import com.jcabi.manifests.Manifests; import com.jcabi.xml.XMLDocument; import com.rultor.spi.Agent; import com.rultor.spi.Profile; import com.rultor.spi.Talk; import java.io.IOException; import org.apache.commons.lang3.StringUtils; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.Ignore; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.xembly.Directives; /** * Tests for ${@link com.rultor.agents.Mails}. * * @author Yuriy Alevohin ([email protected]) * @version $Id: 088a5083051801719764819752a12f48d8015682 $ * @since 2.0 */ public final class MailsTest { /** * Mails can send a mail. * @throws Exception In case of error. */ @Test @Ignore public void sendsMail() throws Exception { final Postman postman = Mockito.spy(Postman.CONSOLE); final Agent agent = new Mails( this.profile(), postman ); agent.execute(MailsTest.talk()); final ArgumentCaptor<Envelope> captor = ArgumentCaptor.forClass(Envelope.class); Mockito.verify(postman).send(captor.capture()); final Envelope envelope = captor.getValue(); MatcherAssert.assertThat( envelope.unwrap().getContent().toString(), Matchers.allOf( Matchers.containsString("See #456, release log:"), Matchers.containsString("Released by Rultor"), Matchers.containsString(Manifests.read("Rultor-Version")), Matchers.containsString( "see [build log](https://www.rultor.com/t/123-abcdef)" ) ) ); MatcherAssert.assertThat( envelope.unwrap().getSubject(), Matchers.equalTo("user/repo v2.0 released!") ); } /** * Mails can send a mail to recipients. * @throws Exception In case of error. * @todo #748 Implement method sendsToRecipients. It must check that * mail is sent to all recipients. Recipients are defined in Profile. */ @Test @Ignore public void sendsToRecipients() throws Exception { // nothing here } /** * Profile for test. * @return Profile */ private Profile.Fixed profile() { return new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='release'>", "<entry key='email'>", "<item>test1@localhost</item>", "<item>test2@localhost</item>", "</entry>", "</entry></p>" ) ) ); } /** * Make a talk with this tag. * @return Talk * @throws java.io.IOException If fails */ private static Talk talk() throws IOException { final Talk talk = new Talk.InFile(); talk.modify( new Directives().xpath("/talk") .attr("number", "123") .add("wire") .add("github-issue").set("456") .add("github-repo").set("user/repo") .up() .up() .add("request").attr("id", "abcdef") .add("type").set("release").up() .add("success").set("true").up() .add("args").add("arg").attr("name", "tag").set("v2.0") ); return talk; } }
35.178082
74
0.624221
7b9d2573d9117c48f4648c8e64a53a899db2fa6f
1,914
package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { SinglyLinkedList <Mahasiswa> dataNilai = new SinglyLinkedList<>(); int pilih=4; //to do /*Lengkapi member main*/ Scanner in = new Scanner(System.in); do{ System.out.println("Program 1, Masukan Data Mahasiswa:"); System.out.println("1. Input Data"); System.out.println("2. Keluarkan nilai terendah mahasiswa"); System.out.println("3. Lihat data mahasiswa"); System.out.println("4. Keluar dari program"); System.out.println("Pilihan:"); pilih = in.nextInt(); switch (pilih){ case 1: //to do /*selesaikan bagian ini*/ System.out.print("MASUKAN NIM MAHASISWA"); String nim=in.next(); System.out.print("MASUKAN NAMA MAHASISWA"); String nama=in.next(); System.out.print("MASUKAN NILAI MAHASISWA"); int nilai=in.nextInt(); Mahasiswa input = new Mahasiswa(nim,nama,nilai); System.out.println(dataNilai.getPositionOf(nilai)); dataNilai.add(input,dataNilai.getPositionOf(nilai)); break; case 2: Mahasiswa nilaiTerendah = (Mahasiswa) dataNilai.removeFirst(); System.out.println("Mahasiswa dengan nilai terendah: "); System.out.println(nilaiTerendah); break; case 3: dataNilai.viewall(); break; default: System.out.println("Pilihan tidak tepat, ulangi pilihan"); break; } } while (pilih!=4); } }
32.440678
82
0.505747
f1e70f821e233f5907e32da4c69ff74a4f7c3c8b
2,030
/* 1: */ package com.jgoodies.looks.plastic.theme; /* 2: */ /* 3: */ import com.jgoodies.looks.plastic.PlasticLookAndFeel; /* 4: */ import javax.swing.plaf.ColorUIResource; /* 5: */ /* 6: */ public class SkyKrupp /* 7: */ extends AbstractSkyTheme /* 8: */ { /* 9: */ public String getName() /* 10: */ { /* 11:47 */ return "Sky Krupp"; /* 12: */ } /* 13: */ /* 14:50 */ private final ColorUIResource primary1 = new ColorUIResource(54, 54, 90); /* 15:51 */ private final ColorUIResource primary2 = new ColorUIResource(156, 156, 178); /* 16:52 */ private final ColorUIResource primary3 = new ColorUIResource(197, 197, 221); /* 17: */ /* 18: */ protected ColorUIResource getPrimary1() /* 19: */ { /* 20:55 */ return this.primary1; /* 21: */ } /* 22: */ /* 23: */ protected ColorUIResource getPrimary2() /* 24: */ { /* 25:58 */ return this.primary2; /* 26: */ } /* 27: */ /* 28: */ protected ColorUIResource getPrimary3() /* 29: */ { /* 30:61 */ return this.primary3; /* 31: */ } /* 32: */ /* 33: */ public ColorUIResource getMenuItemSelectedBackground() /* 34: */ { /* 35:65 */ return getPrimary1(); /* 36: */ } /* 37: */ /* 38: */ public ColorUIResource getMenuItemSelectedForeground() /* 39: */ { /* 40:68 */ return getWhite(); /* 41: */ } /* 42: */ /* 43: */ public ColorUIResource getMenuSelectedBackground() /* 44: */ { /* 45:71 */ return getSecondary2(); /* 46: */ } /* 47: */ /* 48: */ public ColorUIResource getFocusColor() /* 49: */ { /* 50:75 */ return PlasticLookAndFeel.getHighContrastFocusColorsEnabled() ? Colors.ORANGE_FOCUS : Colors.GRAY_DARK; /* 51: */ } /* 52: */ } /* Location: C:\Users\xi\Desktop\confluence_keygen\confluence_keygen.jar * Qualified Name: com.jgoodies.looks.plastic.theme.SkyKrupp * JD-Core Version: 0.7.0.1 */
35
120
0.540394
908137c29ee1028e60f8092177330bb9f62ca7a6
201
package com.redheads.arla.entities; // https://www.atlassian.com/incident-management/kpis/severity-levels // The different message severities public enum MessageType { INFO, MINOR, MAJOR, CRITICAL }
33.5
69
0.78607
af6e7e0b9c45642ba7307b23ee9e58e1ab28d57c
1,714
package io.github.phantomstr.testing.tool.config; import org.apache.commons.configuration2.Configuration; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.AssertJUnit.assertFalse; public class ConfigProviderTest { private static final String MERGED_CONFIG_NAME = "merge.properties"; private static final String OVERRIDES_CONFIG_NAME = "override.properties"; private static final String TEST = "TEST"; private static final String OTHER_CONFIG = "other.config"; @Test public void mergeConfiguration() { Configuration configuration = ConfigProvider.getConfiguration(TEST, MERGED_CONFIG_NAME); assertEquals(configuration.getInt("key1"), 1); assertEquals(configuration.getInt("key2"), 2); assertEquals(configuration.getInt("key3"), 3); assertEquals(configuration.getInt("key4"), 4); } @Test public void overrideConfiguration() { Configuration configuration = ConfigProvider.getConfiguration(TEST, OVERRIDES_CONFIG_NAME); assertEquals(configuration.getString("key1"), "root"); assertEquals(configuration.getString("key2"), "envRoot"); assertEquals(configuration.getString("key3"), "env"); } @Test public void getConfig() { Configuration configuration = ConfigProvider.getConfiguration(TEST, OTHER_CONFIG); assertEquals(configuration.getInt("int_value"), 123); assertEquals(configuration.getString("string_value"), "1x:!@#$%^&*(\""); assertTrue(configuration.getBoolean("boolean_value")); assertFalse(configuration.getBoolean("boolean_value2")); } }
41.804878
99
0.726954
59c9a97953195aec2fb721cb3e927f9e20215921
7,664
/* * (C) Copyright 2016-2018, by Dimitrios Michail and Contributors. * * JGraphT : a free Java graph-theory library * * See the CONTRIBUTORS.md file distributed with this work for additional * information regarding copyright ownership. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0, or the * GNU Lesser General Public License v2.1 or later * which is available at * http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html. * * SPDX-License-Identifier: EPL-2.0 OR LGPL-2.1-or-later */ package org.jgrapht.alg.scoring; import org.jgrapht.*; import org.jgrapht.alg.interfaces.*; import java.util.*; /** * PageRank implementation. * * <p> * The <a href="https://en.wikipedia.org/wiki/PageRank">wikipedia</a> article contains a nice * description of PageRank. The method can be found on the article: Sergey Brin and Larry Page: The * Anatomy of a Large-Scale Hypertextual Web Search Engine. Proceedings of the 7th World-Wide Web * Conference, Brisbane, Australia, April 1998. See also the following * <a href="http://infolab.stanford.edu/~backrub/google.html">page</a>. * </p> * * <p> * This is a simple iterative implementation of PageRank which stops after a given number of * iterations or if the PageRank values between two iterations do not change more than a predefined * value. The implementation uses the variant which divides by the number of nodes, thus forming a * probability distribution over graph nodes. * </p> * * <p> * Each iteration of the algorithm runs in linear time $O(n+m)$ when $n$ is the number of nodes and * $m$ the number of edges of the graph. The maximum number of iterations can be adjusted by the * caller. The default value is {@link PageRank#MAX_ITERATIONS_DEFAULT}. * </p> * * <p> * If the graph is a weighted graph, a weighted variant is used where the probability of following * an edge e out of node $v$ is equal to the weight of $e$ over the sum of weights of all outgoing * edges of $v$. * </p> * * @param <V> the graph vertex type * @param <E> the graph edge type * * @author Dimitrios Michail */ public final class PageRank<V, E> implements VertexScoringAlgorithm<V, Double> { /** * Default number of maximum iterations. */ public static final int MAX_ITERATIONS_DEFAULT = 100; /** * Default value for the tolerance. The calculation will stop if the difference of PageRank * values between iterations change less than this value. */ public static final double TOLERANCE_DEFAULT = 0.0001; /** * Damping factor default value. */ public static final double DAMPING_FACTOR_DEFAULT = 0.85d; private final Graph<V, E> g; private Map<V, Double> scores; /** * Create and execute an instance of PageRank. * * @param g the input graph */ public PageRank(Graph<V, E> g) { this(g, DAMPING_FACTOR_DEFAULT, MAX_ITERATIONS_DEFAULT, TOLERANCE_DEFAULT); } /** * Create and execute an instance of PageRank. * * @param g the input graph * @param dampingFactor the damping factor */ public PageRank(Graph<V, E> g, double dampingFactor) { this(g, dampingFactor, MAX_ITERATIONS_DEFAULT, TOLERANCE_DEFAULT); } /** * Create and execute an instance of PageRank. * * @param g the input graph * @param dampingFactor the damping factor * @param maxIterations the maximum number of iterations to perform */ public PageRank(Graph<V, E> g, double dampingFactor, int maxIterations) { this(g, dampingFactor, maxIterations, TOLERANCE_DEFAULT); } /** * Create and execute an instance of PageRank. * * @param g the input graph * @param dampingFactor the damping factor * @param maxIterations the maximum number of iterations to perform * @param tolerance the calculation will stop if the difference of PageRank values between * iterations change less than this value */ public PageRank(Graph<V, E> g, double dampingFactor, int maxIterations, double tolerance) { this.g = g; this.scores = new HashMap<>(); if (maxIterations <= 0) { throw new IllegalArgumentException("Maximum iterations must be positive"); } if (dampingFactor < 0.0 || dampingFactor > 1.0) { throw new IllegalArgumentException("Damping factor not valid"); } if (tolerance <= 0.0) { throw new IllegalArgumentException("Tolerance not valid, must be positive"); } run(dampingFactor, maxIterations, tolerance); } /** * {@inheritDoc} */ @Override public Map<V, Double> getScores() { return Collections.unmodifiableMap(scores); } /** * {@inheritDoc} */ @Override public Double getVertexScore(V v) { if (!g.containsVertex(v)) { throw new IllegalArgumentException("Cannot return score of unknown vertex"); } return scores.get(v); } private void run(double dampingFactor, int maxIterations, double tolerance) { // initialization int totalVertices = g.vertexSet().size(); boolean weighted = g.getType().isWeighted(); Map<V, Double> weights; if (weighted) { weights = new HashMap<>(totalVertices); } else { weights = Collections.emptyMap(); } double initScore = 1.0d / totalVertices; for (V v : g.vertexSet()) { scores.put(v, initScore); if (weighted) { double sum = 0; for (E e : g.outgoingEdgesOf(v)) { sum += g.getEdgeWeight(e); } weights.put(v, sum); } } // run PageRank Map<V, Double> nextScores = new HashMap<>(); double maxChange = tolerance; while (maxIterations > 0 && maxChange >= tolerance) { // compute next iteration scores double r = 0d; for (V v : g.vertexSet()) { if (g.outgoingEdgesOf(v).size() > 0) { r += (1d - dampingFactor) * scores.get(v); } else { r += scores.get(v); } } r /= totalVertices; maxChange = 0d; for (V v : g.vertexSet()) { double contribution = 0d; if (weighted) { for (E e : g.incomingEdgesOf(v)) { V w = Graphs.getOppositeVertex(g, e, v); contribution += dampingFactor * scores.get(w) * g.getEdgeWeight(e) / weights.get(w); } } else { for (E e : g.incomingEdgesOf(v)) { V w = Graphs.getOppositeVertex(g, e, v); contribution += dampingFactor * scores.get(w) / g.outgoingEdgesOf(w).size(); } } double vOldValue = scores.get(v); double vNewValue = r + contribution; maxChange = Math.max(maxChange, Math.abs(vNewValue - vOldValue)); nextScores.put(v, vNewValue); } // swap scores Map<V, Double> tmp = scores; scores = nextScores; nextScores = tmp; // progress maxIterations--; } } }
31.80083
100
0.594076
6c2c3f80535a5cf7e4b3bd535f90ffcc384de1f7
4,604
package de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.runner; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.config.Folder; import de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.config.Item; import de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.reports.TestFolderReport; import de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.reports.TestItemReport; import de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.reports.VariableStorage; /** * Runs tests contained in a folder. */ public class TestFolderRunner { private Folder folder; private String baseUrl; private VariableStorage storage; /** * Constructor * * @param baseUrl Base URL of the endpoint to be tested * @param folder Folder config instance */ public TestFolderRunner(String baseUrl, Folder folder, VariableStorage storage) { this.baseUrl = baseUrl; //Make sure there is no trailing slash; this.folder = folder; this.storage = storage; } /** * Runs the tests specified in the Folder config * @param doneTests * @param accessToken * * @return Test report. */ public TestFolderReport runTests(List<String> doneTests, String accessToken, boolean allowAdditional, Boolean singleTest) { TestFolderReport tcr = new TestFolderReport(this.baseUrl); tcr.setName(this.folder.getName()); tcr.setDescription(this.folder.getDescription()); List<Item> itemList = this.folder.getItem(); LinkedHashMap<String, Object> folderTests = new LinkedHashMap<String, Object>(); itemList.forEach(item -> { TestItemRunner tir = new TestItemRunner(item, storage); TestItemReport tiReport = tir.runTests(accessToken, allowAdditional, singleTest); tcr.addTestReport(tiReport); doneTests.add(item.getName()); folderTests.put(item.getName(), tiReport); }); tcr.setTestsShort(folderTests); return tcr; } /** * Runs the tests specified in the Folder config * @param accessToken * @param doneTests * * @return Test report. */ public TestFolderReport runTests(String accessToken, boolean allowAdditional) { return runTests(new ArrayList<String>(), accessToken, allowAdditional, false); } public TestFolderReport runTestsFromCall(List<String> doneTests, String accessToken, boolean allowAdditional, Boolean singleTest) { TestFolderReport tcr = new TestFolderReport(this.baseUrl); tcr.setName(this.folder.getName()); tcr.setDescription(this.folder.getDescription()); List<String> inCalls = new ArrayList<String>(); //V1 JsonNode calls = storage.getVariable("callResult"); if (calls != null && calls.isArray()) { ObjectMapper mapper = new ObjectMapper(); for (JsonNode call : calls) { inCalls.add("/" + mapper.convertValue(call.get("call"), String.class)); } } //V2 JsonNode services = storage.getVariable("serviceResult"); if (services != null && services.isArray()) { ObjectMapper mapper = new ObjectMapper(); for (JsonNode service : services) { inCalls.add("/" + mapper.convertValue(service.get("service"), String.class)); } } LinkedHashMap<String, Object> folderTests = new LinkedHashMap<String, Object>(); List<Item> itemList = this.folder.getItem(); itemList.forEach(item -> { if (inCalls.contains(item.getEndpoint())) { //Calls contains the call. Next test is check if the required tests have been done. if (storage.getKeys().containsAll(item.getRequires())) { TestItemRunner tir = new TestItemRunner(item, storage); TestItemReport tiReport = tir.runTests(accessToken, allowAdditional, singleTest); tcr.addTestReport(tiReport); doneTests.add(item.getName()); folderTests.put(item.getName(), tiReport); } else { folderTests.put(item.getName(), "missingReqs"); } } else { folderTests.put(item.getName(), "skipped"); } }); tcr.setTestsShort(folderTests); return tcr; } }
37.737705
132
0.643354
64cd98e23832e14b96f84b5c6984dbb82b8577bd
2,720
package forms; import static org.assertj.core.api.Assertions.assertThat; import java.util.Locale; import java.util.Optional; import org.junit.Test; import services.LocalizedStrings; import services.question.types.IdQuestionDefinition; import services.question.types.QuestionDefinition; import services.question.types.QuestionDefinitionBuilder; public class IdQuestionFormTest { @Test public void getBuilder_returnsCompleteBuilder() throws Exception { IdQuestionForm form = new IdQuestionForm(); form.setQuestionName("name"); form.setQuestionDescription("description"); form.setQuestionText("What is the question text?"); form.setQuestionHelpText(""); form.setMinLength("4"); form.setMaxLength("6"); QuestionDefinitionBuilder builder = form.getBuilder(); IdQuestionDefinition expected = new IdQuestionDefinition( "name", Optional.empty(), "description", LocalizedStrings.of(Locale.US, "What is the question text?"), LocalizedStrings.empty(), IdQuestionDefinition.IdValidationPredicates.create(4, 6)); QuestionDefinition actual = builder.build(); assertThat(actual).isEqualTo(expected); } @Test public void getBuilder_withQdConstructor_returnsCompleteBuilder() throws Exception { IdQuestionDefinition originalQd = new IdQuestionDefinition( "name", Optional.empty(), "description", LocalizedStrings.of(Locale.US, "What is the question text?"), LocalizedStrings.empty(), IdQuestionDefinition.IdValidationPredicates.create(4, 6)); IdQuestionForm form = new IdQuestionForm(originalQd); QuestionDefinitionBuilder builder = form.getBuilder(); QuestionDefinition actual = builder.build(); assertThat(actual).isEqualTo(originalQd); } @Test public void getBuilder_emptyStringMinMax_noPredicateSet() throws Exception { IdQuestionForm form = new IdQuestionForm(); form.setQuestionName("name"); form.setQuestionDescription("description"); form.setQuestionText("What is the question text?"); form.setQuestionHelpText(""); form.setMinLength(""); form.setMaxLength(""); QuestionDefinitionBuilder builder = form.getBuilder(); IdQuestionDefinition expected = new IdQuestionDefinition( "name", Optional.empty(), "description", LocalizedStrings.of(Locale.US, "What is the question text?"), LocalizedStrings.empty(), IdQuestionDefinition.IdValidationPredicates.create()); QuestionDefinition actual = builder.build(); assertThat(actual).isEqualTo(expected); } }
32.380952
86
0.699632