conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import com.j256.ormlite.misc.TransactionManager;
import com.j256.ormlite.support.ConnectionSource;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.concurrent.Callable;
import es.usc.citius.servando.calendula.database.DB;
import es.usc.citius.servando.calendula.persistence.Prescription;
=======
import es.usc.citius.servando.calendula.drugdb.model.persistence.Prescription;
>>>>>>>
import es.usc.citius.servando.calendula.drugdb.model.persistence.Prescription;
import com.j256.ormlite.misc.TransactionManager;
import com.j256.ormlite.support.ConnectionSource;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.concurrent.Callable;
import es.usc.citius.servando.calendula.database.DB;
<<<<<<<
=======
public Prescription fromCsv(String csvLine, String separator) {
String[] values = csvLine.split(separator);
if (values.length != 9) {
throw new RuntimeException("Invalid CSV. Input string must contain exactly 6 members. " + csvLine);
}
Prescription p = new Prescription();
p.setCode(Long.valueOf(values[0]));
p.setpID(values[1]);
p.setName(values[2]);
p.setDose(values[3]);
p.setContent(values[5]);
p.setGeneric(getBoolean(values[6]));
p.setAffectsDriving(getBoolean(values[7]));
try {
p.setPackagingUnits(Float.valueOf(values[4].replaceAll(",", ".")));
} catch (Exception e) {
Log.w("Prescription.class", "Unable to parse med " + p.getpID() + " packagingUnits");
p.setPackagingUnits(-1f);
}
return p;
}
@Override
>>>>>>> |
<<<<<<<
//Allergens DAO
private static PatientAllergenDao PatientAllergens;
=======
// Alerts DAO
private static PatientAlertDao PatientAlerts;
>>>>>>>
// Alerts DAO
private static PatientAlertDao PatientAlerts;
//Allergens DAO
private static PatientAllergenDao PatientAllergens;
<<<<<<<
PatientAllergens = new PatientAllergenDao(db);
=======
PatientAlerts = new PatientAlertDao(db);
>>>>>>>
PatientAlerts = new PatientAlertDao(db);
PatientAllergens = new PatientAllergenDao(db);
<<<<<<<
public static PatientAllergenDao patientAllergens() {
return PatientAllergens;
}
=======
public static PatientAlertDao alerts() { return PatientAlerts; }
>>>>>>>
public static PatientAlertDao alerts() { return PatientAlerts; }
public static PatientAllergenDao patientAllergens() {
return PatientAllergens;
} |
<<<<<<<
public static void main(String[] args) throws IOException, GeneralSecurityException, Session.SpotifyAuthenticationException, MercuryClient.MercuryException {
Session session = new Session.Builder(new FileConfiguration(new File("conf.properties"), args)).create();
=======
public static void main(String[] args) throws IOException, GeneralSecurityException, SpotifyIrc.IrcException, Session.SpotifyAuthenticationException {
Session session = new Session.Builder(new FileConfiguration(args)).create();
>>>>>>>
public static void main(String[] args) throws IOException, GeneralSecurityException, Session.SpotifyAuthenticationException, MercuryClient.MercuryException {
Session session = new Session.Builder(new FileConfiguration(args)).create(); |
<<<<<<<
private volatile boolean notifiedPlaybackReady = false;
private volatile boolean calledPreload = false;
=======
>>>>>>>
private volatile boolean calledPreload = false;
<<<<<<<
if (!notifiedPlaybackReady) {
listener.playbackReady();
notifiedPlaybackReady = true;
}
=======
>>>>>>>
<<<<<<<
void preloadNextTrack();
void playbackReady();
=======
>>>>>>>
void preloadNextTrack(); |
<<<<<<<
} catch (Session.SpotifyAuthenticationException | MercuryClient.MercuryException ex) {
=======
sessionListeners.forEach(l -> l.sessionChanged(session));
} catch (Session.SpotifyAuthenticationException | SpotifyIrc.IrcException ex) {
>>>>>>>
sessionListeners.forEach(l -> l.sessionChanged(session));
} catch (Session.SpotifyAuthenticationException | MercuryClient.MercuryException ex) { |
<<<<<<<
import java.util.HashMap;
import java.util.Map;
=======
import java.util.LinkedHashMap;
>>>>>>>
import java.util.HashMap;
import java.util.Map;
import java.util.LinkedHashMap; |
<<<<<<<
}
this.currentState = CURRENT_STATE_NORMAL;
=======
// if (isCurrentMediaListener()) {//这里没有设置listener//这代码干什么用的
// Log.i(TAG, "onScrollChange setup " + hashCode());
// startWindowTiny();//这里用不用检测是列表type的
// }
>>>>>>>
}
<<<<<<<
// 解决全屏模式下的CURRENT_STATE_ERROR状态下, 点击重新加载后退出了全屏模式.
// 间接解决因为mediaplayer状态混乱(全屏模式下会prepare, 全屏模式被退出后小窗口状态异常,被点击后容易导致)引起的App Crash问题
if (currentScreen != SCREEN_WINDOW_FULLSCREEN) {
if (JCVideoPlayerManager.listener() != null) {
JCVideoPlayerManager.listener().onCompletion();
}
}
JCVideoPlayerManager.setListener(this);
=======
JCVideoPlayerManager.completeAll();
JCVideoPlayerManager.putListener(this);
>>>>>>>
JCVideoPlayerManager.completeAll();
JCVideoPlayerManager.putListener(this);
<<<<<<<
setUiWitStateAndScreen(CURRENT_STATE_PREPARING);
=======
setUiWitStateAndScreen(CURRENT_STATE_PREPAREING);
if (currentState == SCREEN_LAYOUT_LIST) {
JCVideoPlayer.setCurrentScrollPlayerListener(this);
}
>>>>>>>
setUiWitStateAndScreen(CURRENT_STATE_PREPARING);
if (currentState == SCREEN_LAYOUT_LIST) {
JCVideoPlayer.setCurrentScrollPlayerListener(this);
}
<<<<<<<
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT);
=======
ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT);
>>>>>>>
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT);
<<<<<<<
JCVideoPlayerManager.setListener(null);//这里还不完全,
// JCVideoPlayerManager.setLastListener(null);
JCMediaManager.instance().currentVideoWidth = 0;
JCMediaManager.instance().currentVideoHeight = 0;
// 清理缓存变量
JCMediaManager.instance().bufferPercent = 0;
JCMediaManager.instance().videoRotation = 0;
=======
>>>>>>>
JCMediaManager.instance().currentVideoWidth = 0;
JCMediaManager.instance().currentVideoHeight = 0;
// 清理缓存变量
JCMediaManager.instance().bufferPercent = 0;
JCMediaManager.instance().videoRotation = 0;
<<<<<<<
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT);
=======
ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView();
//.findViewById(Window.ID_ANDROID_CONTENT);
>>>>>>>
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT);
<<<<<<<
JCMediaManager.textureView.setVideoSize(JCMediaManager.instance().getVideoSize());
}
@Override
public void goBackThisListener() {
Log.i(TAG, "goBackThisListener " + " [" + this.hashCode() + "] ");
currentState = JCMediaManager.instance().lastState;
setUiWitStateAndScreen(currentState);
addTextureView();
showSupportActionBar(getContext());
=======
JCMediaManager.textureView.requestLayout();
>>>>>>>
JCMediaManager.textureView.setVideoSize(JCMediaManager.instance().getVideoSize());
<<<<<<<
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).findViewById(Window.ID_ANDROID_CONTENT);
=======
ViewGroup vp = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT);
>>>>>>>
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(getContext())).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT);
<<<<<<<
ViewGroup vp = (ViewGroup) (JCUtils.getAppCompActivity(context)).findViewById(Window.ID_ANDROID_CONTENT);
=======
ViewGroup vp = (ViewGroup) ((AppCompatActivity) context).getWindow().getDecorView();
//.findViewById(Window.ID_ANDROID_CONTENT);
>>>>>>>
ViewGroup vp = (ViewGroup) (JCUtils.scanForActivity(context).getWindow().getDecorView();
// .findViewById(Window.ID_ANDROID_CONTENT); |
<<<<<<<
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
=======
import static org.fcrepo.utils.FedoraTypesUtils.getBinary;
>>>>>>>
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
import static org.fcrepo.utils.FedoraTypesUtils.getBinary;
<<<<<<<
=======
import org.fcrepo.utils.FedoraTypesUtils;
import org.fcrepo.utils.FixityResult;
import org.fcrepo.utils.LowLevelCacheEntry;
>>>>>>> |
<<<<<<<
resource().delete();
transaction.commitIfShortLived();
=======
deleteResourceService.perform(getTransaction(), resource());
session.commit();
>>>>>>>
deleteResourceService.perform(getTransaction(), resource());
transaction.commitIfShortLived(); |
<<<<<<<
=======
import org.fcrepo.kernel.api.exception.ConstraintViolationException;
>>>>>>>
import org.fcrepo.kernel.api.exception.ConstraintViolationException;
<<<<<<<
import org.fcrepo.kernel.api.exception.RepositoryRuntimeException;
=======
import org.fcrepo.kernel.api.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.api.models.FedoraBinary;
import org.fcrepo.kernel.api.models.NonRdfSourceDescription;
>>>>>>>
import org.fcrepo.kernel.api.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.api.models.FedoraBinary;
import org.fcrepo.kernel.api.models.NonRdfSourceDescription;
<<<<<<<
@Test
public void testFindOrCreateTimeMapLDPCv() throws RepositoryException {
final String pid = getRandomPid();
final Session jcrSession = getJcrSession(session);
final FedoraResource resource = containerService.findOrCreate(session, "/" + pid);
session.commit();
// Create TimeMap (LDPCv)
final FedoraResource ldpcvResource = resource.findOrCreateTimeMap();
assertNotNull(ldpcvResource);
assertEquals("/" + pid + "/" + LDPCV_TIME_MAP, ldpcvResource.getPath());
session.commit();
final javax.jcr.Node timeMapNode = jcrSession.getNode("/" + pid).getNode(LDPCV_TIME_MAP);
assertTrue(timeMapNode.isNodeType(FEDORA_TIME_MAP));
final FedoraResource timeMap = resource.getTimeMap();
assertTrue(timeMap instanceof FedoraTimeMap);
assertEquals(timeMapNode, ((FedoraResourceImpl)timeMap).getNode());
}
=======
>>>>>>>
@Test
public void testFindOrCreateTimeMapLDPCv() throws RepositoryException {
final String pid = getRandomPid();
final Session jcrSession = getJcrSession(session);
final FedoraResource resource = containerService.findOrCreate(session, "/" + pid);
session.commit();
// Create TimeMap (LDPCv)
final FedoraResource ldpcvResource = resource.findOrCreateTimeMap();
assertNotNull(ldpcvResource);
assertEquals("/" + pid + "/" + LDPCV_TIME_MAP, ldpcvResource.getPath());
session.commit();
final javax.jcr.Node timeMapNode = jcrSession.getNode("/" + pid).getNode(LDPCV_TIME_MAP);
assertTrue(timeMapNode.isNodeType(FEDORA_TIME_MAP));
final FedoraResource timeMap = resource.getTimeMap();
assertTrue(timeMap instanceof FedoraTimeMap);
assertEquals(timeMapNode, ((FedoraResourceImpl)timeMap).getNode());
} |
<<<<<<<
@Timed
=======
>>>>>>>
@Timed
<<<<<<<
copyOf(transform(datastreamService.getDatastreamsFor(pid),
ds2dsElement));
=======
copyOf(transform(datastreamService
.getDatastreamsForPath(path), ds2dsElement));
>>>>>>>
copyOf(transform(datastreamService
.getDatastreamsForPath(path), ds2dsElement));
<<<<<<<
@Timed
public Response modifyDatastreams(@PathParam("pid")
final String pid, @QueryParam("delete")
=======
public Response modifyDatastreams(@PathParam("path")
final List<PathSegment> pathList, @QueryParam("delete")
>>>>>>>
@Timed
public Response modifyDatastreams(@PathParam("path")
final List<PathSegment> pathList, @QueryParam("delete")
<<<<<<<
@Timed
public Response deleteDatastreams(@PathParam("pid")
final String pid, @QueryParam("dsid")
final List<String> dsidList) throws RepositoryException {
=======
public Response deleteDatastreams(
@PathParam("path") final List<PathSegment> pathList,
@QueryParam("dsid") final List<String> dsidList
) throws RepositoryException {
>>>>>>>
@Timed
public Response deleteDatastreams(
@PathParam("path") final List<PathSegment> pathList,
@QueryParam("dsid") final List<String> dsidList
) throws RepositoryException {
<<<<<<<
@Timed
public Response getDatastreamsContents(@PathParam("pid")
final String pid, @QueryParam("dsid")
=======
public Response getDatastreamsContents(@PathParam("path")
List<PathSegment> pathList, @QueryParam("dsid")
>>>>>>>
@Timed
public Response getDatastreamsContents(@PathParam("path")
List<PathSegment> pathList, @QueryParam("dsid")
<<<<<<<
* Create a new datastream with user provided checksum for validation
*
* @param pid
* persistent identifier of the digital object
* @param dsid
* datastream identifier
* @param contentType
* Content-Type header
* @param requestBodyStream
* Binary blob
* @return 201 Created
* @throws RepositoryException
* @throws IOException
* @throws InvalidChecksumException
*/
@POST
@Path("/{dsid}")
@Timed
public Response addDatastream(@PathParam("pid")
final String pid, @QueryParam("checksumType")
final String checksumType, @QueryParam("checksum")
final String checksum, @PathParam("dsid")
final String dsid, @HeaderParam("Content-Type")
final MediaType requestContentType, final InputStream requestBodyStream)
throws IOException, InvalidChecksumException, RepositoryException {
final MediaType contentType =
requestContentType != null ? requestContentType
: APPLICATION_OCTET_STREAM_TYPE;
final Session session = getAuthenticatedSession();
try {
final String dsPath = getDatastreamJcrNodePath(pid, dsid);
logger.debug("addDatastream {}", dsPath);
datastreamService.createDatastreamNode(session, dsPath, contentType
.toString(), requestBodyStream, checksumType, checksum);
session.save();
return created(uriInfo.getAbsolutePath()).build();
} finally {
session.logout();
}
}
/**
* Modify an existing datastream's content
*
* @param pid
* persistent identifier of the digital object
* @param dsid
* datastream identifier
* @param contentType
* Content-Type header
* @param requestBodyStream
* Binary blob
* @return 201 Created
* @throws RepositoryException
* @throws IOException
* @throws InvalidChecksumException
*/
@PUT
@Path("/{dsid}")
@Timed
public Response modifyDatastream(@PathParam("pid")
final String pid, @PathParam("dsid")
final String dsid, @HeaderParam("Content-Type")
final MediaType requestContentType, final InputStream requestBodyStream)
throws RepositoryException, IOException, InvalidChecksumException {
final Session session = getAuthenticatedSession();
try {
final MediaType contentType =
requestContentType != null ? requestContentType
: APPLICATION_OCTET_STREAM_TYPE;
final String dsPath = getDatastreamJcrNodePath(pid, dsid);
datastreamService.createDatastreamNode(session, dsPath, contentType
.toString(), requestBodyStream);
session.save();
return created(uriInfo.getRequestUri()).build();
} finally {
session.logout();
}
}
/**
* Get the datastream profile of a datastream
*
* @param pid
* persistent identifier of the digital object
* @param dsid
* datastream identifier
* @return 200
* @throws RepositoryException
* @throws IOException
* @throws TemplateException
*/
@GET
@Path("/{dsid}")
@Timed
@Produces({TEXT_XML, APPLICATION_JSON})
public DatastreamProfile getDatastream(@PathParam("pid")
final String pid, @PathParam("dsid")
final String dsId) throws RepositoryException, IOException {
logger.trace("Executing getDatastream() with dsId: " + dsId);
return getDSProfile(datastreamService.getDatastream(pid, dsId));
}
/**
* Get the binary content of a datastream
*
* @param pid
* persistent identifier of the digital object
* @param dsid
* datastream identifier
* @return Binary blob
* @throws RepositoryException
*/
@GET
@Path("/{dsid}/content")
public Response getDatastreamContent(@PathParam("pid")
final String pid, @PathParam("dsid")
final String dsid, @Context
final Request request) throws RepositoryException {
final Datastream ds = datastreamService.getDatastream(pid, dsid);
final EntityTag etag = new EntityTag(ds.getContentDigest().toString());
final Date date = ds.getLastModifiedDate();
final Date roundedDate = new Date();
roundedDate.setTime(date.getTime() - date.getTime() % 1000);
ResponseBuilder builder =
request.evaluatePreconditions(roundedDate, etag);
final CacheControl cc = new CacheControl();
cc.setMaxAge(0);
cc.setMustRevalidate(true);
if (builder == null) {
builder = Response.ok(ds.getContent(), ds.getMimeType());
}
return builder.cacheControl(cc).lastModified(date).tag(etag).build();
}
/**
=======
>>>>>>>
<<<<<<<
/**
* Purge the datastream
*
* @param pid
* persistent identifier of the digital object
* @param dsid
* datastream identifier
* @return 204
* @throws RepositoryException
*/
@DELETE
@Path("/{dsid}")
@Timed
public Response deleteDatastream(@PathParam("pid")
final String pid, @PathParam("dsid")
final String dsid) throws RepositoryException {
final Session session = getAuthenticatedSession();
try {
datastreamService.purgeDatastream(session, pid, dsid);
session.save();
return noContent().build();
} finally {
session.logout();
}
}
=======
>>>>>>> |
<<<<<<<
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockContainer);
=======
when(mockNodeService.exists(mockFedoraSession, "/some/path")).thenReturn(false);
// when(mockContainerService.findOrCreate(mockFedoraSession, "/some/path", null)).thenReturn(mockContainer);
>>>>>>>
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
// when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockContainer);
<<<<<<<
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockContainer);
=======
when(mockNodeService.exists(mockFedoraSession, "/some/path")).thenReturn(false);
// when(mockContainerService.findOrCreate(mockFedoraSession, "/some/path", null)).thenReturn(mockContainer);
>>>>>>>
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
// when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockContainer);
<<<<<<<
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
when(mockBinaryService.findOrCreate(mockTransaction, "/some/path")).thenReturn(mockBinary);
=======
when(mockNodeService.exists(mockFedoraSession, "/some/path")).thenReturn(false);
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/some/path")).thenReturn(mockBinary);
>>>>>>>
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(false);
// when(mockBinaryService.findOrCreate(mockTransaction, "/some/path")).thenReturn(mockBinary);
<<<<<<<
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(true);
when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockObject);
=======
when(mockNodeService.exists(mockFedoraSession, "/some/path")).thenReturn(true);
// when(mockContainerService.findOrCreate(mockFedoraSession, "/some/path", null)).thenReturn(mockObject);
>>>>>>>
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(true);
// when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockObject);
<<<<<<<
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(true);
when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockObject);
=======
when(mockNodeService.exists(mockFedoraSession, "/some/path")).thenReturn(true);
// when(mockContainerService.findOrCreate(mockFedoraSession, "/some/path", null)).thenReturn(mockObject);
>>>>>>>
when(mockNodeService.exists(mockTransaction, "/some/path")).thenReturn(true);
// when(mockContainerService.findOrCreate(mockTransaction, "/some/path", null)).thenReturn(mockObject);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/b", null))
.thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/b", null))
// .thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/b", null))
// .thenReturn(mockContainer);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/b", null)).thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/b", null)).thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/b", null)).thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/b", null)).thenReturn(mockContainer);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
=======
// when(mockBinaryService.findOrCreate(mockFedoraSession, "/b")).thenReturn(mockBinary);
>>>>>>>
// when(mockBinaryService.findOrCreate(mockTransaction, "/b")).thenReturn(mockBinary);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/x")).thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/x")).thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/x")).thenReturn(mockContainer);
<<<<<<<
when(mockContainerService.findOrCreate(mockTransaction, "/x", null)).thenReturn(mockContainer);
=======
// when(mockContainerService.findOrCreate(mockFedoraSession, "/x", null)).thenReturn(mockContainer);
>>>>>>>
// when(mockContainerService.findOrCreate(mockTransaction, "/x", null)).thenReturn(mockContainer); |
<<<<<<<
FedoraBinary createBinaryVersion(Transaction transaction,
FedoraBinary resource,
Instant dateTime,
InputStream contentStream,
Collection<URI> checksums,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
=======
Binary createBinaryVersion(FedoraSession session,
Binary resource,
Instant dateTime,
InputStream contentStream,
Collection<URI> checksums,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
>>>>>>>
Binary createBinaryVersion(Transaction transaction,
Binary resource,
Instant dateTime,
InputStream contentStream,
Collection<URI> checksums,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
<<<<<<<
FedoraBinary createBinaryVersion(Transaction transaction, FedoraBinary resource, Instant dateTime,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
=======
Binary createBinaryVersion(FedoraSession session, Binary resource, Instant dateTime,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
>>>>>>>
Binary createBinaryVersion(Transaction transaction, Binary resource, Instant dateTime,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
<<<<<<<
FedoraBinary createExternalBinaryVersion(final Transaction transaction,
final FedoraBinary resource,
final Instant dateTime,
final Collection<URI> checksums,
final String externalHandling,
final String externalUrl)
=======
Binary createExternalBinaryVersion(final FedoraSession session,
final Binary resource,
final Instant dateTime,
final Collection<URI> checksums,
final String externalHandling,
final String externalUrl)
>>>>>>>
Binary createExternalBinaryVersion(final Transaction transaction,
final Binary resource,
final Instant dateTime,
final Collection<URI> checksums,
final String externalHandling,
final String externalUrl) |
<<<<<<<
import static com.google.common.base.Joiner.on;
import static com.yammer.metrics.MetricRegistry.name;
import static org.fcrepo.services.RepositoryService.metrics;
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
import static org.fcrepo.utils.FedoraTypesUtils.isOwned;
import static org.fcrepo.utils.FedoraTypesUtils.map;
import static org.fcrepo.utils.FedoraTypesUtils.nodetype2name;
import static org.fcrepo.utils.FedoraTypesUtils.value2string;
=======
import static com.google.common.base.Joiner.on;
import static org.fcrepo.utils.FedoraJcrTypes.DC_TITLE;
import static org.fcrepo.utils.FedoraTypesUtils.map;
import static org.fcrepo.utils.FedoraTypesUtils.value2string;
>>>>>>>
import static com.google.common.base.Joiner.on;
import static com.yammer.metrics.MetricRegistry.name;
import static org.fcrepo.services.RepositoryService.metrics;
import static org.fcrepo.services.ServiceHelpers.getNodePropertySize;
import static org.fcrepo.utils.FedoraTypesUtils.isOwned;
import static org.fcrepo.utils.FedoraTypesUtils.map;
import static org.fcrepo.utils.FedoraTypesUtils.nodetype2name;
import static org.fcrepo.utils.FedoraTypesUtils.value2string;
<<<<<<<
import javax.jcr.NodeIterator;
import javax.jcr.Property;
=======
import javax.jcr.Property;
>>>>>>>
import javax.jcr.NodeIterator;
import javax.jcr.Property;
<<<<<<<
=======
import javax.jcr.ValueFormatException;
import javax.jcr.lock.LockException;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NoSuchNodeTypeException;
import javax.jcr.version.VersionException;
>>>>>>>
<<<<<<<
public String getOwnerId() throws RepositoryException {
if (isOwned.apply(node))
return node.getProperty(FEDORA_OWNERID).getString();
else
return null;
}
public void setOwnerId(String ownerId) throws RepositoryException {
if (isOwned.apply(node))
node.setProperty(FEDORA_OWNERID, ownerId);
else {
node.addMixin(FEDORA_OWNED);
node.setProperty(FEDORA_OWNERID, ownerId);
}
}
public String getLabel() throws RepositoryException {
if (node.hasProperty(DC_TITLE)) {
Property dcTitle = node.getProperty(DC_TITLE);
if (!dcTitle.isMultiple())
return node.getProperty(DC_TITLE).getString();
else {
return on('/').join(map(dcTitle.getValues(), value2string));
}
}
return null;
}
public String getCreated() throws RepositoryException {
return node.getProperty("jcr:created").getString();
}
public String getLastModified() throws RepositoryException {
return node.getProperty("jcr:lastModified").getString();
}
public long getSize() throws RepositoryException {
return getObjectSize(node);
}
public Collection<String> getModels() throws RepositoryException {
return map(node.getMixinNodeTypes(), nodetype2name);
}
/**
* @param obj
* @return object size in bytes
* @throws RepositoryException
*/
static Long getObjectSize(Node obj) throws RepositoryException {
return getNodePropertySize(obj) + getObjectDSSize(obj);
}
/**
* @param obj
* @return object's datastreams' total size in bytes
* @throws RepositoryException
*/
private static Long getObjectDSSize(Node obj) throws RepositoryException {
Long size = 0L;
NodeIterator i = obj.getNodes();
while (i.hasNext()) {
Datastream ds = new Datastream(i.nextNode());
size += ds.getSize();
}
return size;
}
=======
/**
* @return A label associated with this object. Normally stored in a String-valued dc:title property.
* @throws RepositoryException
*/
public String getLabel() throws RepositoryException {
if (node.hasProperty(DC_TITLE)) {
Property labels = node.getProperty(DC_TITLE);
String label;
if (!labels.isMultiple()) {
label = node.getProperty(DC_TITLE).getString();
} else {
label = on('/').join(map(labels.getValues(), value2string));
}
return label;
} else {
return "";
}
}
public void setLabel(String label) throws ValueFormatException,
VersionException, LockException, ConstraintViolationException,
RepositoryException {
node.setProperty(DC_TITLE, label);
node.getSession().save();
}
>>>>>>>
public String getOwnerId() throws RepositoryException {
if (isOwned.apply(node))
return node.getProperty(FEDORA_OWNERID).getString();
else
return null;
}
public void setOwnerId(String ownerId) throws RepositoryException {
if (isOwned.apply(node))
node.setProperty(FEDORA_OWNERID, ownerId);
else {
node.addMixin(FEDORA_OWNED);
node.setProperty(FEDORA_OWNERID, ownerId);
}
}
public String getLabel() throws RepositoryException {
if (node.hasProperty(DC_TITLE)) {
Property dcTitle = node.getProperty(DC_TITLE);
if (!dcTitle.isMultiple())
return node.getProperty(DC_TITLE).getString();
else {
return on('/').join(map(dcTitle.getValues(), value2string));
}
}
return null;
}
public void setLabel(String label) throws RepositoryException {
node.setProperty(DC_TITLE, label);
}
public String getCreated() throws RepositoryException {
return node.getProperty("jcr:created").getString();
}
public String getLastModified() throws RepositoryException {
return node.getProperty("jcr:lastModified").getString();
}
public long getSize() throws RepositoryException {
return getObjectSize(node);
}
public Collection<String> getModels() throws RepositoryException {
return map(node.getMixinNodeTypes(), nodetype2name);
}
/**
* @param obj
* @return object size in bytes
* @throws RepositoryException
*/
static Long getObjectSize(Node obj) throws RepositoryException {
return getNodePropertySize(obj) + getObjectDSSize(obj);
}
/**
* @param obj
* @return object's datastreams' total size in bytes
* @throws RepositoryException
*/
private static Long getObjectDSSize(Node obj) throws RepositoryException {
Long size = 0L;
NodeIterator i = obj.getNodes();
while (i.hasNext()) {
Datastream ds = new Datastream(i.nextNode());
size += ds.getSize();
}
return size;
} |
<<<<<<<
import static org.fcrepo.kernel.api.RdfLexicon.VERSIONED_RESOURCE;
import static org.fcrepo.kernel.api.RdfLexicon.VERSIONING_TIMEGATE_TYPE;
=======
import static org.fcrepo.kernel.api.RdfLexicon.WEBAC_ACCESS_CONTROL_VALUE;
>>>>>>>
import static org.fcrepo.kernel.api.RdfLexicon.VERSIONED_RESOURCE;
import static org.fcrepo.kernel.api.RdfLexicon.VERSIONING_TIMEGATE_TYPE;
import static org.fcrepo.kernel.api.RdfLexicon.WEBAC_ACCESS_CONTROL_VALUE;
<<<<<<<
public void testCreateVersionedRDFResource() throws IOException {
createVersionedRDFResource();
}
@Test
public void testGetVersionedResourceHeaders() throws IOException {
final String subjectURI = createVersionedRDFResource();
try (final CloseableHttpResponse response = execute(new HttpGet(subjectURI))) {
verifyVersionedResourceResponseHeaders(subjectURI, response);
}
}
@Test
public void testHeadVersionedResourceHeaders() throws IOException {
final String subjectURI = createVersionedRDFResource();
try (final CloseableHttpResponse response = execute(new HttpHead(subjectURI))) {
verifyVersionedResourceResponseHeaders(subjectURI, response);
}
}
private void verifyVersionedResourceResponseHeaders(final String subjectURI,
final CloseableHttpResponse response) {
assertEquals("Didn't get an OK (200) response!", OK.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
checkForMementoTimeGateLinkHeader(response);
checkForLinkHeader(response, subjectURI, "timegate");
checkForLinkHeader(response, subjectURI + "/" + FCR_VERSIONS, "timemap");
assertEquals(1, Arrays.asList(response.getHeaders("Vary")).stream().filter(x -> x.getValue().contains(
"Accept-Datetime")).count());
}
private String createVersionedRDFResource() throws IOException {
final String id = getRandomUniqueId();
final String subjectURI = serverAddress + id;
final HttpPost createMethod = postObjMethod();
createMethod.addHeader("Slug", id);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader(LINK, VERSIONED_RESOURCE_LINK_HEADER);
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
try (final CloseableHttpResponse response = execute(createMethod)) {
assertEquals("Didn't get a CREATED response!", CREATED.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
}
return subjectURI;
}
private void checkForVersionedResourceLinkHeader(final CloseableHttpResponse response) {
checkForLinkHeader(response,VERSIONED_RESOURCE.getURI(), "type");
}
private void checkForMementoTimeGateLinkHeader(final CloseableHttpResponse response) {
checkForLinkHeader(response,VERSIONING_TIMEGATE_TYPE, "type");
}
@Test
public void testCreateVersionedBinaryResource() throws IOException {
final HttpPost method = postObjMethod();
final String id = getRandomUniqueId();
method.addHeader("Slug", id);
method.addHeader(CONTENT_TYPE, "text/plain");
method.setEntity(new StringEntity("test content"));
method.addHeader(LINK, VERSIONED_RESOURCE_LINK_HEADER);
try (final CloseableHttpResponse response = execute(method)) {
assertEquals("Didn't get a CREATED response!", CREATED.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
}
}
@Test
=======
public void testPostCreateNonRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectPid = getRandomUniqueId();
final String subjectURI = serverAddress + subjectPid;
final HttpPost createMethod = new HttpPost(serverAddress);
createMethod.addHeader(CONTENT_TYPE, "text/plain");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.addHeader("Slug", subjectPid);
createMethod.setEntity(new StringEntity("test body"));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI + "/fcr:metadata");
}
@Test
public void testPutCreateNonRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/plain");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("test body"));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI + "/fcr:metadata");
}
@Test
public void testPostCreateRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectPid = getRandomUniqueId();
final String subjectURI = serverAddress + subjectPid;
final HttpPost createMethod = new HttpPost(serverAddress);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.addHeader("Slug", subjectPid);
createMethod.setEntity(new StringEntity("<> <info:test#label> \"foo\""));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI);
}
@Test
public void testPutCreateRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI);
}
@Test
public void testPutCreateRDFSourceWithNonExistentAcl() throws IOException {
final String aclURI = serverAddress + "non-existent-acl";
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
assertEquals(BAD_REQUEST.getStatusCode(), getStatus(createMethod));
}
private void verifyAccessControlTripleIsPresent(final String aclURI, final String subjectURI) throws IOException {
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI);
}
private void verifyAccessControlTripleIsPresent(final String aclURI, final String subjectURI,
final String resourceURI) throws IOException {
try (final CloseableDataset dataset = getDataset(new HttpGet(resourceURI))) {
final DatasetGraph graph = dataset.asDatasetGraph();
assertTrue("Didn't find an acl:accessControl triple!", graph.contains(ANY,
createURI(subjectURI), createURI(WEBAC_ACCESS_CONTROL_VALUE), createURI(aclURI)));
}
}
private String createAcl() {
final String aclPid = "acl";
final String aclURI = serverAddress + aclPid;
createObjectAndClose(aclPid);
return aclURI;
}
@Test
>>>>>>>
public void testCreateVersionedRDFResource() throws IOException {
createVersionedRDFResource();
}
@Test
public void testGetVersionedResourceHeaders() throws IOException {
final String subjectURI = createVersionedRDFResource();
try (final CloseableHttpResponse response = execute(new HttpGet(subjectURI))) {
verifyVersionedResourceResponseHeaders(subjectURI, response);
}
}
@Test
public void testHeadVersionedResourceHeaders() throws IOException {
final String subjectURI = createVersionedRDFResource();
try (final CloseableHttpResponse response = execute(new HttpHead(subjectURI))) {
verifyVersionedResourceResponseHeaders(subjectURI, response);
}
}
private void verifyVersionedResourceResponseHeaders(final String subjectURI,
final CloseableHttpResponse response) {
assertEquals("Didn't get an OK (200) response!", OK.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
checkForMementoTimeGateLinkHeader(response);
checkForLinkHeader(response, subjectURI, "timegate");
checkForLinkHeader(response, subjectURI + "/" + FCR_VERSIONS, "timemap");
assertEquals(1, Arrays.asList(response.getHeaders("Vary")).stream().filter(x -> x.getValue().contains(
"Accept-Datetime")).count());
}
private String createVersionedRDFResource() throws IOException {
final String id = getRandomUniqueId();
final String subjectURI = serverAddress + id;
final HttpPost createMethod = postObjMethod();
createMethod.addHeader("Slug", id);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader(LINK, VERSIONED_RESOURCE_LINK_HEADER);
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
try (final CloseableHttpResponse response = execute(createMethod)) {
assertEquals("Didn't get a CREATED response!", CREATED.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
}
return subjectURI;
}
private void checkForVersionedResourceLinkHeader(final CloseableHttpResponse response) {
checkForLinkHeader(response,VERSIONED_RESOURCE.getURI(), "type");
}
private void checkForMementoTimeGateLinkHeader(final CloseableHttpResponse response) {
checkForLinkHeader(response,VERSIONING_TIMEGATE_TYPE, "type");
}
@Test
public void testCreateVersionedBinaryResource() throws IOException {
final HttpPost method = postObjMethod();
final String id = getRandomUniqueId();
method.addHeader("Slug", id);
method.addHeader(CONTENT_TYPE, "text/plain");
method.setEntity(new StringEntity("test content"));
method.addHeader(LINK, VERSIONED_RESOURCE_LINK_HEADER);
try (final CloseableHttpResponse response = execute(method)) {
assertEquals("Didn't get a CREATED response!", CREATED.getStatusCode(), getStatus(response));
checkForVersionedResourceLinkHeader(response);
}
}
@Test
public void testPostCreateNonRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectPid = getRandomUniqueId();
final String subjectURI = serverAddress + subjectPid;
final HttpPost createMethod = new HttpPost(serverAddress);
createMethod.addHeader(CONTENT_TYPE, "text/plain");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.addHeader("Slug", subjectPid);
createMethod.setEntity(new StringEntity("test body"));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI + "/fcr:metadata");
}
@Test
public void testPutCreateNonRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/plain");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("test body"));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI + "/fcr:metadata");
}
@Test
public void testPostCreateRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectPid = getRandomUniqueId();
final String subjectURI = serverAddress + subjectPid;
final HttpPost createMethod = new HttpPost(serverAddress);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.addHeader("Slug", subjectPid);
createMethod.setEntity(new StringEntity("<> <info:test#label> \"foo\""));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI);
}
@Test
public void testPutCreateRDFSourceWithAcl() throws IOException {
final String aclURI = createAcl();
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
assertEquals(CREATED.getStatusCode(), getStatus(createMethod));
verifyAccessControlTripleIsPresent(aclURI, subjectURI);
}
@Test
public void testPutCreateRDFSourceWithNonExistentAcl() throws IOException {
final String aclURI = serverAddress + "non-existent-acl";
final String subjectURI = serverAddress + getRandomUniqueId();
final HttpPut createMethod = new HttpPut(subjectURI);
createMethod.addHeader(CONTENT_TYPE, "text/n3");
createMethod.addHeader("Link", "<" + aclURI + ">; rel=\"acl\"");
createMethod.setEntity(new StringEntity("<" + subjectURI + "> <info:test#label> \"foo\""));
assertEquals(BAD_REQUEST.getStatusCode(), getStatus(createMethod));
}
private void verifyAccessControlTripleIsPresent(final String aclURI, final String subjectURI) throws IOException {
verifyAccessControlTripleIsPresent(aclURI, subjectURI, subjectURI);
}
private void verifyAccessControlTripleIsPresent(final String aclURI, final String subjectURI,
final String resourceURI) throws IOException {
try (final CloseableDataset dataset = getDataset(new HttpGet(resourceURI))) {
final DatasetGraph graph = dataset.asDatasetGraph();
assertTrue("Didn't find an acl:accessControl triple!", graph.contains(ANY,
createURI(subjectURI), createURI(WEBAC_ACCESS_CONTROL_VALUE), createURI(aclURI)));
}
}
private String createAcl() {
final String aclPid = "acl";
final String aclURI = serverAddress + aclPid;
createObjectAndClose(aclPid);
return aclURI;
}
@Test |
<<<<<<<
=======
import org.graylog2.rest.resources.streams.outputs.OutputListResponse;
import org.graylog2.security.RestPermissions;
>>>>>>>
import org.graylog2.rest.resources.streams.outputs.OutputListResponse;
<<<<<<<
import org.graylog2.shared.security.RestPermissions;
import org.graylog2.streams.OutputImpl;
=======
>>>>>>>
import org.graylog2.shared.security.RestPermissions; |
<<<<<<<
import io.atlasmap.core.DefaultAtlasConversionService;
=======
import io.atlasmap.core.AtlasPath;
>>>>>>>
import io.atlasmap.core.AtlasPath;
import io.atlasmap.core.DefaultAtlasConversionService; |
<<<<<<<
import org.graylog2.shared.rest.resources.RestResource;
import org.graylog2.rest.models.tools.responses.SubstringTesterResponse;
=======
import org.graylog2.rest.resources.tools.requests.SubstringTestRequest;
import org.graylog2.rest.resources.tools.responses.SubstringTesterResponse;
import org.graylog2.shared.rest.resources.RestResource;
>>>>>>>
import org.graylog2.shared.rest.resources.RestResource;
import org.graylog2.rest.models.tools.responses.SubstringTesterResponse;
import org.graylog2.rest.resources.tools.requests.SubstringTestRequest; |
<<<<<<<
Long timestampDelayInterval
= config.getLong(JdbcSourceTaskConfig.TIMESTAMP_DELAY_INTERVAL_MS_CONFIG);
=======
boolean validateNonNulls
= config.getBoolean(JdbcSourceTaskConfig.VALIDATE_NON_NULL_CONFIG);
>>>>>>>
Long timestampDelayInterval
= config.getLong(JdbcSourceTaskConfig.TIMESTAMP_DELAY_INTERVAL_MS_CONFIG);
boolean validateNonNulls
= config.getBoolean(JdbcSourceTaskConfig.VALIDATE_NON_NULL_CONFIG); |
<<<<<<<
LOG.info("Index [{}] is empty but it is the current deflector target. Inserting dummy index range.", index);
ranges.add(getDeflectorIndexRange(index));
=======
emptyIndexRange.put("start", Tools.getUTCTimestamp());
>>>>>>>
LOG.info("Index [{}] is empty but it is the current deflector target. Inserting dummy index range.", index); |
<<<<<<<
} else {
=======
else if (dbProduct != null && dbProduct.startsWith("DB2"))
query = "select CURRENT_TIMESTAMP from sysibm.sysdummy1";
else
>>>>>>>
} else if (dbProduct != null && dbProduct.startsWith("DB2")) {
query = "select CURRENT_TIMESTAMP from sysibm.sysdummy1";
} else { |
<<<<<<<
import org.graylog2.agents.AgentService;
import org.graylog2.agents.AgentServiceImpl;
import org.graylog2.alarmcallbacks.AlarmCallbackConfigurationService;
import org.graylog2.alarmcallbacks.AlarmCallbackConfigurationServiceImpl;
=======
>>>>>>>
import org.graylog2.agents.AgentService;
import org.graylog2.agents.AgentServiceImpl;
<<<<<<<
bind(AlarmCallbackConfigurationService.class).to(AlarmCallbackConfigurationServiceImpl.class);
bind(AgentService.class).to(AgentServiceImpl.class);
=======
>>>>>>>
bind(AgentService.class).to(AgentServiceImpl.class); |
<<<<<<<
import io.confluent.connect.jdbc.dialect.DatabaseDialect;
import io.confluent.connect.jdbc.dialect.DatabaseDialects;
=======
import io.confluent.connect.jdbc.sink.dialect.DbDialect;
import io.confluent.connect.jdbc.util.Version;
>>>>>>>
import io.confluent.connect.jdbc.dialect.DatabaseDialect;
import io.confluent.connect.jdbc.dialect.DatabaseDialects;
import io.confluent.connect.jdbc.util.Version; |
<<<<<<<
import org.graylog2.shared.security.RestPermissions;
=======
import org.graylog2.security.RestPermissions;
import org.graylog2.shared.rest.resources.RestResource;
>>>>>>>
import org.graylog2.shared.rest.resources.RestResource;
import org.graylog2.shared.security.RestPermissions; |
<<<<<<<
import java.util.Date;
import java.util.ArrayList;
=======
>>>>>>>
import java.util.ArrayList;
<<<<<<<
throws IOException, SQLException {
=======
throws IOException, RestClientException, SQLException {
>>>>>>>
throws IOException, SQLException { |
<<<<<<<
import org.graylog2.indexer.searches.Searches;
import org.graylog2.indexer.searches.timeranges.*;
=======
import org.graylog2.indexer.Indexer;
import org.graylog2.indexer.searches.timeranges.AbsoluteRange;
import org.graylog2.indexer.searches.timeranges.InvalidRangeParametersException;
import org.graylog2.indexer.searches.timeranges.KeywordRange;
import org.graylog2.indexer.searches.timeranges.RelativeRange;
import org.graylog2.indexer.searches.timeranges.TimeRange;
>>>>>>>
import org.graylog2.indexer.searches.Searches;
import org.graylog2.indexer.searches.timeranges.AbsoluteRange;
import org.graylog2.indexer.searches.timeranges.InvalidRangeParametersException;
import org.graylog2.indexer.searches.timeranges.KeywordRange;
import org.graylog2.indexer.searches.timeranges.RelativeRange;
import org.graylog2.indexer.searches.timeranges.TimeRange;
<<<<<<<
switch (type) {
case SEARCH_RESULT_COUNT:
return new SearchResultCountWidget(metricRegistry, searches, id, awr.description, 0, awr.config, (String) awr.config.get("query"), timeRange, awr.creatorUserId);
case STREAM_SEARCH_RESULT_COUNT:
return new StreamSearchResultCountWidget(metricRegistry, searches, id, awr.description, 0, awr.config, (String) awr.config.get("query"), timeRange, awr.creatorUserId);
case FIELD_CHART:
return new FieldChartWidget(metricRegistry, searches, id, awr.description, 0, awr.config, (String) awr.config.get("query"), timeRange, awr.creatorUserId);
case QUICKVALUES:
return new QuickvaluesWidget(metricRegistry, searches, id, awr.description, 0, awr.config, (String) awr.config.get("query"), timeRange, awr.creatorUserId);
case SEARCH_RESULT_CHART:
return new SearchResultChartWidget(metricRegistry, searches, id, awr.description, 0, awr.config, (String) awr.config.get("query"), timeRange, awr.creatorUserId);
default:
throw new NoSuchWidgetTypeException();
}
=======
return buildDashboardWidget(type, metricRegistry, indexer, id, awr.description, 0, awr.config,
(String) awr.config.get("query"), timeRange, awr.creatorUserId);
>>>>>>>
return buildDashboardWidget(type, metricRegistry, searches, id, awr.description, 0, awr.config,
(String) awr.config.get("query"), timeRange, awr.creatorUserId);
<<<<<<<
return new SearchResultCountWidget(metricRegistry, searches, (String) fields.get("id"), description, cacheTime, config, (String) config.get("query"), timeRange, (String) fields.get("creator_user_id"));
=======
return new SearchResultCountWidget(metricRegistry, indexer,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
>>>>>>>
return new SearchResultCountWidget(metricRegistry, searches,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
<<<<<<<
return new StreamSearchResultCountWidget(metricRegistry, searches, (String) fields.get("id"), description, cacheTime, config, (String) config.get("query"), timeRange, (String) fields.get("creator_user_id"));
=======
return new StreamSearchResultCountWidget(metricRegistry, indexer,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
>>>>>>>
return new StreamSearchResultCountWidget(metricRegistry, searches,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
<<<<<<<
return new FieldChartWidget(metricRegistry, searches, (String) fields.get("id"), description, cacheTime, config, (String) config.get("query"), timeRange, (String) fields.get("creator_user_id"));
=======
return new FieldChartWidget(metricRegistry, indexer,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
>>>>>>>
return new FieldChartWidget(metricRegistry, searches,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
<<<<<<<
return new QuickvaluesWidget(metricRegistry, searches, (String) fields.get("id"), description, cacheTime, config, (String) config.get("query"), timeRange, (String) fields.get("creator_user_id"));
=======
return new QuickvaluesWidget(metricRegistry, indexer,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
>>>>>>>
return new QuickvaluesWidget(metricRegistry, searches,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
<<<<<<<
return new SearchResultChartWidget(metricRegistry, searches, (String) fields.get("id"), description, cacheTime, config, (String) config.get("query"), timeRange, (String) fields.get("creator_user_id"));
=======
return new SearchResultChartWidget(metricRegistry, indexer,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId);
>>>>>>>
return new SearchResultChartWidget(metricRegistry, searches,
widgetId,
description,
cacheTime,
config,
query,
timeRange,
creatorUserId); |
<<<<<<<
private final Timer parseTime;
public interface Factory {
public ProcessBuffer create(InputCache inputCache, AtomicInteger processBufferWatermark);
}
=======
>>>>>>>
private final Timer parseTime;
<<<<<<<
DecodingProcessor.Factory decodingProcessorFactory,
@Assisted InputCache inputCache,
@Assisted AtomicInteger processBufferWatermark) {
=======
InputCache inputCache) {
>>>>>>>
DecodingProcessor.Factory decodingProcessorFactory,
InputCache inputCache) {
<<<<<<<
public void initialize(ProcessBufferProcessor[] processors,
int ringBufferSize,
WaitStrategy waitStrategy) {
Disruptor<MessageEvent> disruptor = new Disruptor<>(
=======
public void initialize(ProcessBufferProcessor[] processors, int ringBufferSize, WaitStrategy waitStrategy, int processBufferProcessors) {
Disruptor<MessageEvent> disruptor = new Disruptor<>(
>>>>>>>
public void initialize(ProcessBufferProcessor[] processors,
int ringBufferSize,
WaitStrategy waitStrategy) {
Disruptor<MessageEvent> disruptor = new Disruptor<>( |
<<<<<<<
import org.graylog2.users.UserService;
import org.graylog2.users.UserServiceImpl;
=======
import org.joda.time.DateTime;
>>>>>>>
import org.graylog2.users.UserService;
import org.graylog2.users.UserServiceImpl;
import org.joda.time.DateTime;
<<<<<<<
try {
sb.append("Stream rules: ").append(streamRuleService.loadForStream(stream)).append("\n");
} catch (NotFoundException e) {
LOG.error("Unable to find stream rules for stream: " + stream.getId(), e);
}
=======
if (core.getConfiguration().getEmailTransportWebInterfaceUrl() != null)
sb.append("Stream URL: ").append(
buildStreamDetailsURL(core.getConfiguration().getEmailTransportWebInterfaceUrl(),
checkResult, stream));
sb.append("Stream rules: ").append(stream.getStreamRules()).append("\n");
>>>>>>>
if (core.getConfiguration().getEmailTransportWebInterfaceUrl() != null)
sb.append("Stream URL: ").append(
buildStreamDetailsURL(core.getConfiguration().getEmailTransportWebInterfaceUrl(),
checkResult, stream));
try {
sb.append("Stream rules: ").append(streamRuleService.loadForStream(stream)).append("\n");
} catch (NotFoundException e) {
LOG.error("Unable to find stream rules for stream: " + stream.getId(), e);
} |
<<<<<<<
import org.apache.kafka.common.config.ConfigException;
=======
import io.confluent.connect.jdbc.util.ColumnDefinition;
import io.confluent.connect.jdbc.util.TableDefinition;
import java.sql.Types;
>>>>>>>
import org.apache.kafka.common.config.ConfigException;
import io.confluent.connect.jdbc.util.ColumnDefinition;
import io.confluent.connect.jdbc.util.TableDefinition;
import java.sql.Types; |
<<<<<<<
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
=======
InsertModeEnum.INSERT,
10);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
>>>>>>>
InsertModeEnum.INSERT,
10);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
<<<<<<<
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
=======
InsertModeEnum.INSERT,
10
);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
>>>>>>>
InsertModeEnum.INSERT,
10
);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
<<<<<<<
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
=======
InsertModeEnum.INSERT,
10);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
>>>>>>>
InsertModeEnum.INSERT,
10);
JdbcDbWriter writer = JdbcDbWriter.from(settings);
InsertModeEnum.INSERT);
Map<String, DbTableColumn> columnMap = new HashMap<>();
columnMap.put("col1", new DbTableColumn("col1", true, false, 1));
columnMap.put("col2", new DbTableColumn("col2", false, true, 1));
final DbTable tableA = new DbTable("tableA", columnMap);
JdbcDbWriter writer = JdbcDbWriter.from(settings, new DbTableInfoProvider() {
@Override
public List<DbTable> getTables(String connectionUri, String user, String password) {
return Lists.newArrayList(tableA);
}
});
<<<<<<<
new BatchedPreparedStatementBuilder(map, new UpsertQueryBuilder(DbDialect.fromConnectionString(SQL_LITE_URI))),
new ThrowErrorHandlingPolicy());
=======
new BatchedPreparedStatementBuilder(map, new InsertQueryBuilder()),
new ThrowErrorHandlingPolicy(), 10);
>>>>>>>
new BatchedPreparedStatementBuilder(map, new UpsertQueryBuilder(DbDialect.fromConnectionString(SQL_LITE_URI))),
new ThrowErrorHandlingPolicy(),10);
<<<<<<<
new BatchedPreparedStatementBuilder(map, new UpsertQueryBuilder(DbDialect.fromConnectionString(SQL_LITE_URI))),
new ThrowErrorHandlingPolicy());
=======
new BatchedPreparedStatementBuilder(map, new InsertQueryBuilder()),
new ThrowErrorHandlingPolicy(), 10);
>>>>>>>
new BatchedPreparedStatementBuilder(map, new UpsertQueryBuilder(DbDialect.fromConnectionString(SQL_LITE_URI))),
new ThrowErrorHandlingPolicy(),10); |
<<<<<<<
import com.wyj.springboot.im.authorize.cache.keymodel.UserCacheKey;
import com.wyj.springboot.im.authorize.cookie.CookieFactory;
import com.wyj.springboot.im.authorize.cookie.UserCookieContainer;
=======
>>>>>>>
import com.wyj.springboot.im.authorize.cache.keymodel.UserCacheKey;
<<<<<<<
@Autowired
UserService userService;
@Resource(name=BeanIocConfig.USER_CACHE)
RedisCacheManager<UserCacheKey, User> userCache;
@Resource(name=BeanIocConfig.LOGIN_TIMES_CACHE)
LongRedisCacheManager<User> loginTimeCache;
@Resource
IRedisService redisService;
@Autowired
UserContext userContext;
@Autowired
Environment env;
@PostMapping(value="login")
public String login(HttpServletRequest request, HttpServletResponse response,
@RequestBody Map<String, String> model) {
if (model == null) {
return ResponseBean.crtParameterErrorResult();
}
String username = model.get("username");
String password = model.get("password");
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(password)) {
return ResponseBean.crtParameterErrorResult();
}
if (!userService.isExist(username)) {
return ResponseBean.crtFailureResult("该用户不存在");
}
User user = userService.getUser(username);
if (user.getPassword().equals(password)) {
ResponseBean bean = ResponseBean.crtSuccessBean();
bean.setContent(user);
return bean.toString();
} else {
return ResponseBean.crtFailureResult("密码错误");
}
}
// @PostMapping
// public String registe(HttpServletRequest request, HttpServletResponse response,
// )
@GetMapping("/userInfo")
public String userInfo(HttpServletRequest request, HttpServletResponse response) {
return JSON.toJSONString(userContext.get());
}
private void loginSuccess(HttpServletResponse response, User user) {
// 更新cookie
String uuid = UUID.randomUUID().toString();
response.addCookie(
CookieFactory.getUserCookie(new UserCookieContainer(uuid, user, System.currentTimeMillis())));
// 添加到cache中
userCache.set(new UserCacheKey(user.getId(), uuid), user);
loginTimeCache.increment(user);
response.addCookie(CookieFactory.getUsernameCookie(user.getName()));
}
public static void main(String[] args) {
String originStr = System.currentTimeMillis()+":"+"2"
=======
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
UserService userService;
@Resource(name = BeanIocConfig.USER_CACHE)
RedisCacheManager<String, User> userCache;
@Resource(name = BeanIocConfig.LOGIN_TIMES_CACHE)
LongRedisCacheManager<User> loginTimeCache;
@Resource
IRedisService redisService;
@Autowired
UserContext userContext;
@Autowired
Environment env;
@PostMapping(value = "login")
public String login(HttpServletRequest request, HttpServletResponse response,
@RequestBody Map<String, String> model) {
if (model == null) {
return ResponseBean.crtParameterErrorResult();
}
String username = model.get("username");
String password = model.get("password");
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(password)) {
return ResponseBean.crtParameterErrorResult();
}
if (!userService.isExist(username)) {
return ResponseBean.crtFailureResult("该用户不存在");
}
User user = userService.getUser(username);
if (user.getPassword().equals(password)) {
HeaderFactory.Header tokenHeader = loginSuccess(user.getId());
ResponseBean bean = ResponseBean.crtSuccessBean();
JSONObject content = new JSONObject();
content.put("wsServer", ZJHProperties.WEBSOCKET_SERVER_URL);
content.put(tokenHeader.key, tokenHeader.value);
return bean.toString();
} else {
return ResponseBean.crtFailureResult("密码错误");
}
}
@PostMapping
public String registe(HttpServletRequest request, HttpServletResponse response,
@RequestBody Map<String, String> model) {
if (model == null) {
return ResponseBean.crtParameterErrorResult();
}
String username = model.get("username");
String password = model.get("password");
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(password)) {
return ResponseBean.crtParameterErrorResult();
}
long userId = userService.addUser(username, password);
if (userId > 0) {
logger.info("username:{} 注册成功!! userId:{}", username, userId);
return ResponseBean.crtSuccessResult();
} else {
logger.error("注册过程出错!!username:{}, password:{}, userId:{}", username, password, userId);
return ResponseBean.crtFailureResult("注册失败,请稍后再试!");
}
}
@GetMapping("/userInfo")
public String userInfo(HttpServletRequest request, HttpServletResponse response) {
return JSON.toJSONString(userContext.get());
}
private HeaderFactory.Header loginSuccess(long userId) {
String token = "";
return HeaderFactory.getUserHeader(new UserHeaderContainer(userId, System.currentTimeMillis()));
}
public static void main(String[] args) {
String originStr = System.currentTimeMillis() + ":" + "2"
>>>>>>>
private static final Logger logger = LoggerFactory.getLogger(UserController.class);
@Autowired
UserService userService;
@Resource(name=BeanIocConfig.USER_CACHE)
RedisCacheManager<UserCacheKey, User> userCache;
@Resource(name=BeanIocConfig.LOGIN_TIMES_CACHE)
LongRedisCacheManager<User> loginTimeCache;
@Resource
IRedisService redisService;
@Autowired
UserContext userContext;
@Autowired
Environment env;
// private void loginSuccess(HttpServletResponse response, User user) {
// // 更新cookie
// String uuid = UUID.randomUUID().toString();
// response.addCookie(
// CookieFactory.getUserCookie(new UserCookieContainer(uuid, user, System.currentTimeMillis())));
// // 添加到cache中
// userCache.set(new UserCacheKey(user.getId(), uuid), user);
// loginTimeCache.increment(user);
//
// response.addCookie(CookieFactory.getUsernameCookie(user.getName()));
// }
@PostMapping(value = "login")
public String login(HttpServletRequest request, HttpServletResponse response,
@RequestBody Map<String, String> model) {
if (model == null) {
return ResponseBean.crtParameterErrorResult();
}
String username = model.get("username");
String password = model.get("password");
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(password)) {
return ResponseBean.crtParameterErrorResult();
}
if (!userService.isExist(username)) {
return ResponseBean.crtFailureResult("该用户不存在");
}
User user = userService.getUser(username);
if (user.getPassword().equals(password)) {
HeaderFactory.Header tokenHeader = loginSuccess(user);
ResponseBean bean = ResponseBean.crtSuccessBean();
JSONObject content = new JSONObject();
content.put("wsServer", ZJHProperties.WEBSOCKET_SERVER_URL);
content.put(tokenHeader.key, tokenHeader.value);
return bean.toString();
} else {
return ResponseBean.crtFailureResult("密码错误");
}
}
@PostMapping
public String registe(HttpServletRequest request, HttpServletResponse response,
@RequestBody Map<String, String> model) {
if (model == null) {
return ResponseBean.crtParameterErrorResult();
}
String username = model.get("username");
String password = model.get("password");
if (StringUtil.isEmpty(username) || StringUtil.isEmpty(password)) {
return ResponseBean.crtParameterErrorResult();
}
long userId = userService.addUser(username, password);
if (userId > 0) {
logger.info("username:{} 注册成功!! userId:{}", username, userId);
return ResponseBean.crtSuccessResult();
} else {
logger.error("注册过程出错!!username:{}, password:{}, userId:{}", username, password, userId);
return ResponseBean.crtFailureResult("注册失败,请稍后再试!");
}
}
@GetMapping("/userInfo")
public String userInfo(HttpServletRequest request, HttpServletResponse response) {
return JSON.toJSONString(userContext.get());
}
private HeaderFactory.Header loginSuccess(User user) {
String token = "";
String uuid = UUID.randomUUID().toString();
// response.addCookie(
// CookieFactory.getUserCookie(new UserCookieContainer(uuid, user, System.currentTimeMillis())));
// 添加到cache中
userCache.set(new UserCacheKey(user.getId(), uuid), user);
loginTimeCache.increment(user);
return HeaderFactory.getUserHeader(new UserHeaderContainer(user.getId(), System.currentTimeMillis()));
}
public static void main(String[] args) {
String originStr = System.currentTimeMillis() + ":" + "2" |
<<<<<<<
import gov.nysenate.openleg.processor.hearing.PublicHearingProcessService;
import gov.nysenate.openleg.processor.transcript.TranscriptProcessService;
=======
import gov.nysenate.openleg.processor.sobi.SobiProcessService;
import gov.nysenate.openleg.processor.transcript.TranscriptProcessService;
>>>>>>>
import gov.nysenate.openleg.processor.hearing.PublicHearingProcessService;
import gov.nysenate.openleg.processor.sobi.SobiProcessService;
import gov.nysenate.openleg.processor.transcript.TranscriptProcessService;
<<<<<<<
@Autowired
private TranscriptProcessService transcriptProcessService;
@Autowired
private PublicHearingProcessService publicHearingProcessService;
/** --- Main --- */
=======
@Autowired
private TranscriptProcessService transcriptProcessService;
/** --- Main Method --- */
>>>>>>>
@Autowired
private TranscriptProcessService transcriptProcessService;
@Autowired
private PublicHearingProcessService publicHearingProcessService;
/** --- Main Method --- */
<<<<<<<
publicHearingProcessService.collatePublicHearingFiles();
// sobiProcessService.collateSobiFiles();
// daybreakProcessService.collateDaybreakReports();
// TODO: Collate Transcripts / Public Hearings
=======
logger.info("Begin collating data");
sobiProcessService.collateSobiFiles();
daybreakProcessService.collateDaybreakReports();
transcriptProcessService.collateTranscriptFiles();
// TODO: Collate Public Hearings
>>>>>>>
logger.info("Begin collating data");
sobiProcessService.collateSobiFiles();
daybreakProcessService.collateDaybreakReports();
transcriptProcessService.collateTranscriptFiles();
publicHearingProcessService.collatePublicHearingFiles();
// TODO: Collate Public Hearings
<<<<<<<
public void ingest() throws IOException, ParseException { // TODO: Parse Exception???
publicHearingProcessService.processPendingPublicHearingFiles();
// sobiProcessService.processPendingFragments(SobiProcessOptions.builder().build());
// daybreakProcessService.processPendingFragments();
// TODO: Process Transcripts / Public Hearings
=======
public void ingest() throws IOException {
logger.info("Being ingesting data");
sobiProcessService.processPendingFragments(SobiProcessOptions.builder().build());
daybreakProcessService.processPendingFragments();
transcriptProcessService.processPendingTranscriptFiles();
// TODO: Process Public Hearings
>>>>>>>
public void ingest() throws IOException, ParseException {
logger.info("Being ingesting data");
sobiProcessService.processPendingFragments(SobiProcessOptions.builder().build());
daybreakProcessService.processPendingFragments();
transcriptProcessService.processPendingTranscriptFiles();
publicHearingProcessService.processPendingPublicHearingFiles();
// TODO: Process Public Hearings |
<<<<<<<
public void setId(AgendaId id) {
this.id = id;
this.setYear(id.getYear());
}
=======
/**
* @return A set of all addenda in this Agenda for either votes or info
*/
public ImmutableSet<String> getAddenda() {
return ImmutableSet.copyOf(Sets.union(
agendaInfoAddenda.keySet(),
agendaVoteAddenda.keySet()
));
}
>>>>>>>
/**
* @return A set of all addenda in this Agenda for either votes or info
*/
public ImmutableSet<String> getAddenda() {
return ImmutableSet.copyOf(Sets.union(
agendaInfoAddenda.keySet(),
agendaVoteAddenda.keySet()
));
}
public void setId(AgendaId id) {
this.id = id;
this.setYear(id.getYear());
} |
<<<<<<<
import gov.nysenate.openleg.model.base.SessionYear;
import gov.nysenate.openleg.model.bill.BaseBillId;
=======
>>>>>>> |
<<<<<<<
this.baseDir = new File(envDirPath);
this.stagingDir = new File(stagingDirPath);
this.archiveDir = new File(archiveDirPath);
=======
this.baseDirectory = new File(envDirPath);
this.stagingDirectory = new File(stagingDirPath);
this.archiveDirectory = new File(archiveDirPath);
this.calendarDirectory = new File(calendarDirPath);
this.assemblyAgendaDirectory = new File(assemblyAgendaDirPath);
this.senateAgendaDirectory = new File(senateAgendaDirPath);
>>>>>>>
this.baseDir = new File(envDirPath);
this.stagingDir = new File(stagingDirPath);
this.archiveDir = new File(archiveDirPath);
this.calendarDirectory = new File(calendarDirPath);
this.assemblyAgendaDirectory = new File(assemblyAgendaDirPath);
this.senateAgendaDirectory = new File(senateAgendaDirPath); |
<<<<<<<
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegAgendaReportService;
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegBillReportService;
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegCalendarReportService;
import gov.nysenate.openleg.service.spotcheck.senatesite.agenda.AgendaReportServices;
=======
import gov.nysenate.openleg.service.spotcheck.senatesite.agenda.SenSiteAgendaReportService;
>>>>>>>
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegAgendaReportService;
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegBillReportService;
import gov.nysenate.openleg.service.spotcheck.openleg.OpenlegCalendarReportService;
import gov.nysenate.openleg.service.spotcheck.senatesite.agenda.SenSiteAgendaReportService; |
<<<<<<<
public boolean getSobiProcessEnabled() {
return sobiProcessEnabled;
}
public String getRefApiKey() {
return refApiKey;
}
public void setRefApiKey(String refApiKey) {
this.refApiKey = refApiKey;
}
public String getRefUrl() {
return refUrl;
}
public void setRefUrl(String refUrl) {
this.refUrl = refUrl;
}
=======
public String getSenSiteUrl() {
return senSiteUrl;
}
public void setSenSiteUrl(String senSiteUrl) {
this.senSiteUrl = senSiteUrl;
}
public boolean isCheckmailEnabled() {
return checkmailEnabled;
}
public void setCheckmailEnabled(boolean checkmailEnabled) {
this.checkmailEnabled = checkmailEnabled;
}
>>>>>>>
public boolean getSobiProcessEnabled() {
return sobiProcessEnabled;
}
public String getRefApiKey() {
return refApiKey;
}
public void setRefApiKey(String refApiKey) {
this.refApiKey = refApiKey;
}
public String getRefUrl() {
return refUrl;
}
public void setRefUrl(String refUrl) {
this.refUrl = refUrl;
}
public String getSenSiteUrl() {
return senSiteUrl;
}
public void setSenSiteUrl(String senSiteUrl) {
this.senSiteUrl = senSiteUrl;
}
public boolean isCheckmailEnabled() {
return checkmailEnabled;
}
public void setCheckmailEnabled(boolean checkmailEnabled) {
this.checkmailEnabled = checkmailEnabled;
} |
<<<<<<<
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.Date;
=======
import com.google.bitcoin.core.Wallet;
import com.googlecode.jcsv.CSVStrategy;
import com.googlecode.jcsv.writer.CSVColumnJoiner;
import com.googlecode.jcsv.writer.internal.CSVColumnJoinerImpl;
>>>>>>>
import com.google.bitcoin.core.Wallet;
import com.googlecode.jcsv.CSVStrategy;
import com.googlecode.jcsv.writer.CSVColumnJoiner;
import com.googlecode.jcsv.writer.internal.CSVColumnJoinerImpl;
<<<<<<<
=======
>>>>>>> |
<<<<<<<
import org.graylog2.shared.journal.Journal;
=======
import org.graylog2.plugin.streams.Stream;
>>>>>>>
import org.graylog2.shared.journal.Journal;
import org.graylog2.plugin.streams.Stream; |
<<<<<<<
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
=======
>>>>>>>
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener; |
<<<<<<<
private int mSortMode = SORT_BY_NAME;
private int mSortOrder = 1;
private Comparator<ApplicationInfoEx> mSorter = new Comparator<ApplicationInfoEx>() {
@Override
public int compare(ApplicationInfoEx appInfo0, ApplicationInfoEx appInfo1) {
switch (mSortMode) {
case SORT_BY_NAME:
return mSortOrder * appInfo0.compareTo(appInfo1);
case SORT_BY_UID:
// default lowest first
return mSortOrder * (appInfo0.getUid() - appInfo1.getUid());
case SORT_BY_INSTALL_TIME:
// default newest first
Long iTime0 = appInfo0.getInstallTime(mContext);
Long iTime1 = appInfo1.getInstallTime(mContext);
return mSortOrder * iTime1.compareTo(iTime0);
case SORT_BY_UPDATE_TIME:
// default newest first
Long uTime0 = appInfo0.getUpdateTime(mContext);
Long uTime1 = appInfo1.getUpdateTime(mContext);
return mSortOrder * uTime1.compareTo(uTime0);
case SORT_BY_MODIF_TIME:
// default newest first
Long mTime0 = appInfo0.getModificationTime(mContext);
Long mTime1 = appInfo1.getModificationTime(mContext);
return mSortOrder * mTime1.compareTo(mTime0);
}
return 0;
}
};
=======
private AtomicInteger mFiltersRunning = new AtomicInteger(0);
private int mHighlightColor;
public final static int cSelectAppAll = 1;
public final static int cSelectAppNone = 2;
public final static int cSelectAppUser = 3;
>>>>>>>
private AtomicInteger mFiltersRunning = new AtomicInteger(0);
private int mHighlightColor;
public final static int cSelectAppAll = 1;
public final static int cSelectAppNone = 2;
public final static int cSelectAppUser = 3;
private int mSortMode = SORT_BY_NAME;
private int mSortOrder = 1;
private Comparator<ApplicationInfoEx> mSorter = new Comparator<ApplicationInfoEx>() {
@Override
public int compare(ApplicationInfoEx appInfo0, ApplicationInfoEx appInfo1) {
switch (mSortMode) {
case SORT_BY_NAME:
return mSortOrder * appInfo0.compareTo(appInfo1);
case SORT_BY_UID:
// default lowest first
return mSortOrder * (appInfo0.getUid() - appInfo1.getUid());
case SORT_BY_INSTALL_TIME:
// default newest first
Long iTime0 = appInfo0.getInstallTime(mContext);
Long iTime1 = appInfo1.getInstallTime(mContext);
return mSortOrder * iTime1.compareTo(iTime0);
case SORT_BY_UPDATE_TIME:
// default newest first
Long uTime0 = appInfo0.getUpdateTime(mContext);
Long uTime1 = appInfo1.getUpdateTime(mContext);
return mSortOrder * uTime1.compareTo(uTime0);
case SORT_BY_MODIF_TIME:
// default newest first
Long mTime0 = appInfo0.getModificationTime(mContext);
Long mTime1 = appInfo1.getModificationTime(mContext);
return mSortOrder * mTime1.compareTo(mTime0);
}
return 0;
}
};
<<<<<<<
setSortMode();
=======
TypedArray ta1 = context.getTheme().obtainStyledAttributes(
new int[] { android.R.attr.colorLongPressedHighlight });
mHighlightColor = ta1.getColor(0, 0xFF00FF);
ta1.recycle();
>>>>>>>
setSortMode();
TypedArray ta1 = context.getTheme().obtainStyledAttributes(
new int[] { android.R.attr.colorLongPressedHighlight });
mHighlightColor = ta1.getColor(0, 0xFF00FF);
ta1.recycle();
<<<<<<<
state = xAppInfo.getState(holder.row.getContext());
=======
state = Integer.parseInt(PrivacyManager.getSetting(null, xAppInfo.getUid(),
PrivacyManager.cSettingState, "1", false));
>>>>>>>
state = xAppInfo.getState(ActivityMain.this);
<<<<<<<
state = xAppInfo.getState(holder.row.getContext());
=======
state = Integer.parseInt(PrivacyManager.getSetting(null, xAppInfo.getUid(),
PrivacyManager.cSettingState, "1", false));
>>>>>>>
state = xAppInfo.getState(ActivityMain.this); |
<<<<<<<
import com.codahale.metrics.MetricRegistry;
=======
>>>>>>>
import com.codahale.metrics.MetricRegistry;
<<<<<<<
import org.graylog2.inputs.gelf.gelf.GELFChunkManager;
import org.graylog2.plugin.buffers.Buffer;
=======
import org.graylog2.inputs.network.PacketInformationDumper;
import org.graylog2.plugin.InputHost;
>>>>>>>
import org.graylog2.inputs.gelf.gelf.GELFChunkManager;
import org.graylog2.inputs.network.PacketInformationDumper;
import org.graylog2.plugin.buffers.Buffer;
<<<<<<<
import org.graylog2.plugin.inputs.util.ThroughputCounter;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
=======
import org.graylog2.plugin.inputs.util.ThroughputCounter;
import org.jboss.netty.channel.*;
>>>>>>>
import org.graylog2.plugin.inputs.util.ThroughputCounter;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels; |
<<<<<<<
import org.graylog.security.entities.EntityDependency;
import org.graylog2.plugin.rest.ValidationResult;
=======
import org.graylog.security.entities.EntityDescriptor;
>>>>>>>
import org.graylog.security.entities.EntityDescriptor;
import org.graylog2.plugin.rest.ValidationResult; |
<<<<<<<
import android.content.Intent;
import android.graphics.Typeface;
=======
>>>>>>>
import android.graphics.Typeface; |
<<<<<<<
=======
mActiveColor = Utils.fetchContextColor(getContext(), R.attr.colorAccent);
mBackgroundColor = Color.WHITE;
mInActiveColor = Color.LTGRAY;
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
this.setOutlineProvider(ViewOutlineProvider.BOUNDS);
} else {
//to do
}
>>>>>>>
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
this.setOutlineProvider(ViewOutlineProvider.BOUNDS);
} else {
//to do
} |
<<<<<<<
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
=======
import org.springframework.util.ResourceUtils;
>>>>>>>
import org.springframework.util.ResourceUtils;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
<<<<<<<
private RestTemplate restTemplate = new RestTemplate();
private ApiServiceProvider agiApiService;
private GroupServiceProvider groupService;
=======
private static Logger logger = LoggerFactory.getLogger(MagicWorkbenchController.class);
>>>>>>>
private static Logger logger = LoggerFactory.getLogger(MagicWorkbenchController.class);
private RestTemplate restTemplate = new RestTemplate();
private ApiServiceProvider agiApiService;
private GroupServiceProvider groupService;
<<<<<<<
private String validateRequest(SynchronizeRequest request) {
if (StringUtils.isBlank(request.getMode())) {
return "请求参数有误";
}
if (request.getMode().equals("1") && StringUtils.isBlank(request.getGroupId())) {
return "分组id不能为空";
}
if (request.getMode().equals("2") && (StringUtils.isBlank(request.getApiId()) || StringUtils.isBlank(request.getFunctionId()))) {
return "函数id或接口id不能同时为空";
}
return null;
}
@RequestMapping("/synchronize")
@ResponseBody
public JsonBean<SynchronizeResponse> synchronize(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.SYNC)) {
return new JsonBean<>(-10, "无权限执行同步方法");
}
String message = validateRequest(synchronizeRequest);
if (message == null) {
List<SynchronizeRequest.Info> infos = agiApiService.listForSync(null, synchronizeRequest.getApiId());
infos.forEach(it -> it.setGroupPath(groupService.getFullPath(it.getGroupId())));
synchronizeRequest.setInfos(infos);
return request(synchronizeRequest);
}
return new JsonBean<>(0, message);
}
@RequestMapping("/synchronize/pull")
@ResponseBody
public JsonBean<Void> pull(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.PULL)) {
return new JsonBean<>(-10, "无权限执行拉取方法");
}
return null;
}
@RequestMapping("/synchronize/push")
@ResponseBody
public JsonBean<Void> push(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.PUSH)) {
return new JsonBean<>(-10, "无权限执行推送方法");
}
return null;
}
private JsonBean<SynchronizeResponse> request(SynchronizeRequest request) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
String requestURL = String.format("%s/_synchronize?secret=%s", request.getRemote(), request.getSecret());
HttpEntity<Object> entity = new HttpEntity<>(request, headers);
return restTemplate.exchange(requestURL, HttpMethod.POST, entity, new ParameterizedTypeReference<JsonBean<SynchronizeResponse>>() {
}).getBody();
}
=======
@RequestMapping(value = "/config-js", produces = "application/javascript")
@ResponseBody
public Object configjs() {
if (configuration.getEditorConfig() != null) {
try {
File file = ResourceUtils.getFile(configuration.getEditorConfig());
return Files.readAllBytes(Paths.get(file.toURI()));
} catch (IOException e) {
logger.warn("读取编辑器配置文件{}失败", configuration.getEditorConfig());
}
}
return "var MAGIC_EDITOR_CONFIG = {}";
}
>>>>>>>
private String validateRequest(SynchronizeRequest request) {
if (StringUtils.isBlank(request.getMode())) {
return "请求参数有误";
}
if (request.getMode().equals("1") && StringUtils.isBlank(request.getGroupId())) {
return "分组id不能为空";
}
if (request.getMode().equals("2") && (StringUtils.isBlank(request.getApiId()) || StringUtils.isBlank(request.getFunctionId()))) {
return "函数id或接口id不能同时为空";
}
return null;
}
@RequestMapping("/synchronize")
@ResponseBody
public JsonBean<SynchronizeResponse> synchronize(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.SYNC)) {
return new JsonBean<>(-10, "无权限执行同步方法");
}
String message = validateRequest(synchronizeRequest);
if (message == null) {
List<SynchronizeRequest.Info> infos = agiApiService.listForSync(null, synchronizeRequest.getApiId());
infos.forEach(it -> it.setGroupPath(groupService.getFullPath(it.getGroupId())));
synchronizeRequest.setInfos(infos);
return request(synchronizeRequest);
}
return new JsonBean<>(0, message);
}
@RequestMapping("/synchronize/pull")
@ResponseBody
public JsonBean<Void> pull(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.PULL)) {
return new JsonBean<>(-10, "无权限执行拉取方法");
}
return null;
}
@RequestMapping("/synchronize/push")
@ResponseBody
public JsonBean<Void> push(SynchronizeRequest synchronizeRequest, HttpServletRequest request) {
if (!allowVisit(request, RequestInterceptor.Authorization.PUSH)) {
return new JsonBean<>(-10, "无权限执行推送方法");
}
return null;
}
private JsonBean<SynchronizeResponse> request(SynchronizeRequest request) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
String requestURL = String.format("%s/_synchronize?secret=%s", request.getRemote(), request.getSecret());
HttpEntity<Object> entity = new HttpEntity<>(request, headers);
return restTemplate.exchange(requestURL, HttpMethod.POST, entity, new ParameterizedTypeReference<JsonBean<SynchronizeResponse>>() {
}).getBody();
}
@RequestMapping(value = "/config-js", produces = "application/javascript")
@ResponseBody
public Object configjs() {
if (configuration.getEditorConfig() != null) {
try {
File file = ResourceUtils.getFile(configuration.getEditorConfig());
return Files.readAllBytes(Paths.get(file.toURI()));
} catch (IOException e) {
logger.warn("读取编辑器配置文件{}失败", configuration.getEditorConfig());
}
}
return "var MAGIC_EDITOR_CONFIG = {}";
} |
<<<<<<<
import org.mustbe.consulo.unity3d.Unity3dMetaFileType;
=======
import org.mustbe.consulo.unity3d.Unity3dBundle;
>>>>>>>
import org.mustbe.consulo.unity3d.Unity3dBundle;
import org.mustbe.consulo.unity3d.Unity3dMetaFileType;
<<<<<<<
=======
import com.intellij.util.ui.UIUtil;
>>>>>>>
import com.intellij.util.ui.UIUtil;
<<<<<<<
final ModifiableModuleModel newModel = fromProjectStructure ? originalModel : ApplicationManager.getApplication().runReadAction(new
Computable<ModifiableModuleModel>()
=======
final ModifiableModuleModel newModel = fromProjectStructure ? originalModel : ApplicationManager
.getApplication().runReadAction(new Computable<ModifiableModuleModel>()
>>>>>>>
final ModifiableModuleModel newModel = fromProjectStructure ? originalModel : ApplicationManager.getApplication().runReadAction(new Computable<ModifiableModuleModel>()
<<<<<<<
final String[] paths = new String[]{
=======
String[] paths = new String[]{
>>>>>>>
String[] paths = new String[]{
<<<<<<<
final String[] paths = new String[]{
=======
String[] paths = new String[]{
>>>>>>>
String[] paths = new String[]{
<<<<<<<
final String[] pathsAsArray = ArrayUtil.toStringArray(paths);
return createAndSetupModule("Assembly-CSharp-Editor", project, newModel, pathsAsArray, unityBundle, new Consumer<ModuleRootLayerImpl>()
=======
final String[] pathsAsArray = ArrayUtil.toStringArray(paths);
return createAndSetupModule("Assembly-CSharp-Editor", project, newModel, pathsAsArray, unityBundle,
new Consumer<ModuleRootLayerImpl>()
>>>>>>>
final String[] pathsAsArray = ArrayUtil.toStringArray(paths);
return createAndSetupModule("Assembly-CSharp-Editor", project, newModel, pathsAsArray, unityBundle, new Consumer<ModuleRootLayerImpl>()
<<<<<<<
final ModuleRootLayerImpl layer = (ModuleRootLayerImpl) modifiableModel.addLayer(unity3dTarget.getPresentation(), null, getDefaultTarget() == unity3dTarget);
=======
final ModuleRootLayerImpl layer = (ModuleRootLayerImpl) modifiableModel.addLayer(unity3dTarget
.getPresentation(), null, false);
>>>>>>>
final ModuleRootLayerImpl layer = (ModuleRootLayerImpl) modifiableModel.addLayer(unity3dTarget.getPresentation(), null, false); |
<<<<<<<
this.entityTracker = new CubicEntityTracker(this);
=======
this.theEntityTracker = new CubicEntityTracker(this);
CubicChunks.addConfigChangeListener(this);
}
@Override
public void onConfigUpdate(CubicChunks.Config config){
if(config.useFastEntitySpawner() && this.entitySpawner instanceof CubeWorldEntitySpawner)
this.entitySpawner = new FastCubeWorldEntitySpawner();
else if(!config.useFastEntitySpawner() && this.entitySpawner instanceof FastCubeWorldEntitySpawner)
this.entitySpawner = new CubeWorldEntitySpawner();
>>>>>>>
this.entityTracker = new CubicEntityTracker(this);
CubicChunks.addConfigChangeListener(this);
}
@Override
public void onConfigUpdate(CubicChunks.Config config){
if(config.useFastEntitySpawner() && this.entitySpawner instanceof CubeWorldEntitySpawner)
this.entitySpawner = new FastCubeWorldEntitySpawner();
else if(!config.useFastEntitySpawner() && this.entitySpawner instanceof FastCubeWorldEntitySpawner)
this.entitySpawner = new CubeWorldEntitySpawner(); |
<<<<<<<
bind(URI.class).annotatedWith(Names.named("ServerUri")).toInstance(configuration.getGraylog2ServerUri());
bind(URI.class).annotatedWith(Names.named("OurRadioUri")).toInstance(configuration.getRestTransportUri());
=======
bind(InputCache.class).to(BasicCache.class).in(Scopes.SINGLETON);
>>>>>>>
bind(URI.class).annotatedWith(Names.named("ServerUri")).toInstance(configuration.getGraylog2ServerUri());
bind(URI.class).annotatedWith(Names.named("OurRadioUri")).toInstance(configuration.getRestTransportUri());
bind(InputCache.class).to(BasicCache.class).in(Scopes.SINGLETON); |
<<<<<<<
// Make sure the cube does not keep any other cubes around.
this.worldServer.getGeneratorPipeline().getDependentCubeManager().unregister(cube);
=======
// Clear the cube's dependencies.
this.dependencyManager.unregister(cube);
>>>>>>>
// Make sure the cube does not keep any other cubes around.
this.worldServer.getGeneratorPipeline().getDependentCubeManager().unregister(cube);
<<<<<<<
}
// ... otherwise quit.
else {
=======
// ... or quit.
} else {
>>>>>>>
}
// ... or quit.
else {
<<<<<<<
=======
// Do not unload cubes which are required for generating currently loaded cubes.
if (dependencyManager.isRequired(new CubeCoords(cubeX, cubeY, cubeZ))) {
return;
}
>>>>>>> |
<<<<<<<
import cubicchunks.world.cube.Cube;
import cubicchunks.world.dependency.Dependency;
import cubicchunks.world.dependency.DependencyProvider;
import cubicchunks.worldgen.dependency.RegionDependency;
=======
import cubicchunks.worldgen.dependency.DependencyProvider;
import net.minecraft.world.World;
>>>>>>>
import cubicchunks.world.cube.Cube;
import cubicchunks.world.dependency.Dependency;
import cubicchunks.world.dependency.DependencyProvider;
import cubicchunks.worldgen.dependency.RegionDependency;
import net.minecraft.world.World; |
<<<<<<<
import cubicchunks.world.cube.Cube;
import cubicchunks.world.dependency.Dependency;
import cubicchunks.world.dependency.DependencyProvider;
import cubicchunks.worldgen.dependency.RegionDependency;
=======
import cubicchunks.worldgen.dependency.DependencyProvider;
import net.minecraft.world.World;
>>>>>>>
import cubicchunks.world.cube.Cube;
import cubicchunks.world.dependency.Dependency;
import cubicchunks.world.dependency.DependencyProvider;
import cubicchunks.worldgen.dependency.RegionDependency;
import net.minecraft.world.World; |
<<<<<<<
private int[] heightMap;
private Type type;
=======
>>>>>>>
private int[] heightMap;
<<<<<<<
this.type = type;
this.heightMap = new int[Cube.SIZE*Cube.SIZE];
IHeightMap heightmap = cube.getColumn().getOpacityIndex();
for (int localX = 0; localX < Cube.SIZE; localX++) {
for (int localZ = 0; localZ < Cube.SIZE; localZ++) {
this.heightMap[index(localX, localZ)] = heightmap.getTopBlockY(localX, localZ);
}
}
=======
>>>>>>>
this.heightMap = new int[Cube.SIZE*Cube.SIZE];
IHeightMap heightmap = cube.getColumn().getOpacityIndex();
for (int localX = 0; localX < Cube.SIZE; localX++) {
for (int localZ = 0; localZ < Cube.SIZE; localZ++) {
this.heightMap[index(localX, localZ)] = heightmap.getTopBlockY(localX, localZ);
}
}
<<<<<<<
public Type getType() {
return type;
}
public int height(int localX, int localZ) {
return heightMap[index(localX, localZ)];
}
=======
>>>>>>>
public int height(int localX, int localZ) {
return heightMap[index(localX, localZ)];
}
<<<<<<<
private static int index(int x, int z) {
return x << 4 | z;
}
public enum Type {
NEW_CUBE, UPDATE
}
=======
>>>>>>>
private static int index(int x, int z) {
return x << 4 | z;
} |
<<<<<<<
boolean success = watcher.getCube() != null;
if (success) {
boolean canGenerate = watcher.hasPlayerMatching(CAN_GENERATE_CHUNKS);
=======
boolean canGenerate = watcher.hasPlayerMatching(CAN_GENERATE_CHUNKS);
if (watcher.getCube() == null || (canGenerate && !watcher.getCube().isFullyPopulated())) {
>>>>>>>
boolean success = watcher.getCube() != null && watcher.getCube().isFullyPopulated();
if (!success) {
boolean canGenerate = watcher.hasPlayerMatching(CAN_GENERATE_CHUNKS);
<<<<<<<
if (cubeWatcher.getCube() == null) {
this.cubesToGenerate.add(cubeWatcher);
}
=======
>>>>>>> |
<<<<<<<
public BiomeProcessor(String name, CubeWorldServer worldServer, int batchSize) {
super(name, worldServer.getCubeCache(), batchSize);
=======
public BiomeProcessor(String name, WorldServer worldServer, CubeCache cubeCache, int batchSize) {
super(name, cubeCache, batchSize);
>>>>>>>
public BiomeProcessor(String name, WorldServer worldServer, CubeCache cubeCache, int batchSize) {
super(name, cubeCache, batchSize);
<<<<<<<
CubeCache cache = ((CubeWorld) cube.getWorld()).getCubeCache();
if (!CubeProviderTools.cubeAndNeighborsExist(cache, cube.getX(), cube.getY(), cube.getZ())) {
=======
if (!CubeProviderTools.cubeAndNeighborsExist(this.cache, cube.getX(), cube.getY(), cube.getZ())) {
>>>>>>>
if (!CubeProviderTools.cubeAndNeighborsExist(this.cache, cube.getX(), cube.getY(), cube.getZ())) {
<<<<<<<
=======
private void replaceBlocksForBiome_setBlock(Block block, Cube cube, Cube below, int xAbs, int yAbs, int zAbs) {
int xRel = xAbs & 15;
int yRel = yAbs & 15;
int zRel = zAbs & 15;
BlockPos newPos = new BlockPos(xRel, yRel, zRel);
// check if we're in the same cube as Cube
if (Coords.blockToCube(yAbs) == cube.getY()) {
// we are in the same cube
cube.setBlockForGeneration(newPos, block.getDefaultState());
} else {
// we're actually in the cube below
assert this.cache.cubeExists(Coords.blockToCube(xAbs), Coords.blockToCube(yAbs), Coords.blockToCube(zAbs));
below.setBlockForGeneration(newPos, block.getDefaultState());
}
}
>>>>>>> |
<<<<<<<
import java.util.Arrays;
import java.util.Iterator;
=======
>>>>>>>
import java.util.Arrays;
import java.util.Iterator;
<<<<<<<
private transient List<Entity> m_tempEntities;
private byte[] columnBlockBiomeArray;
=======
>>>>>>>
private byte[] columnBlockBiomeArray;
<<<<<<<
this.m_tempEntities = new ArrayList<Entity>();
=======
>>>>>>> |
<<<<<<<
import ic2.api.IReactorChamber;
import openccsensors.common.core.ISensorInterface;
import openccsensors.common.core.ISensorTarget;
import openccsensors.common.core.ITargetWrapper;
=======
import openccsensors.common.api.ISensorInterface;
import openccsensors.common.api.ISensorTarget;
import openccsensors.common.api.ITargetWrapper;
>>>>>>>
import ic2.api.IReactorChamber;
import openccsensors.common.api.ISensorInterface;
import openccsensors.common.api.ISensorTarget;
import openccsensors.common.api.ITargetWrapper; |
<<<<<<<
import com.quickblox.sample.groupchatwebrtc.R;
=======
import com.quickblox.sample.groupchatwebrtc.db.QbUsersDbManager;
>>>>>>>
import com.quickblox.sample.groupchatwebrtc.db.QbUsersDbManager;
import com.quickblox.sample.groupchatwebrtc.R;
<<<<<<<
=======
import com.quickblox.sample.groupchatwebrtc.utils.Consts;
import com.quickblox.sample.groupchatwebrtc.utils.WebRtcSessionManager;
>>>>>>>
import com.quickblox.sample.groupchatwebrtc.utils.Consts;
import com.quickblox.sample.groupchatwebrtc.utils.WebRtcSessionManager;
<<<<<<<
=======
private ArrayList<QBUser> opponents;
private int qbConferenceType;
private int startReason;
>>>>>>>
private ArrayList<QBUser> opponents;
private int qbConferenceType;
private int startReason;
<<<<<<<
=======
private ToggleButton micToggleVideoCall;
private ImageButton handUpVideoCall;
private View myCameraOff;
>>>>>>>
private ToggleButton micToggleVideoCall;
private ImageButton handUpVideoCall;
private View myCameraOff;
<<<<<<<
=======
private OnCallEventsController callEvents;
private ConversationFragmentCallbackListener conversationFragmentCallbackListener;
private boolean isIncomingCall;
private QBRTCSession currentSession;
>>>>>>>
private OnCallEventsController callEvents;
private ConversationFragmentCallbackListener conversationFragmentCallbackListener;
private boolean isIncomingCall;
private QBRTCSession currentSession;
<<<<<<<
=======
public static ConversationFragment newInstance(boolean isIncomingCall) {
ConversationFragment fragment = new ConversationFragment();
Bundle args = new Bundle();
args.putBoolean(Consts.EXTRA_IS_INCOMING_CALL, isIncomingCall);
>>>>>>>
<<<<<<<
=======
initFields();
>>>>>>>
<<<<<<<
=======
initViews(view);
initButtonsListener();
setUpUiByCallType(qbConferenceType);
>>>>>>>
<<<<<<<
@Override
int getFragmentLayout() {
return R.layout.fragment_conversation;
}
=======
private void initFields() {
QbUsersDbManager dbManager = QbUsersDbManager.getInstance(getActivity().getApplicationContext());
WebRtcSessionManager sessionManager = WebRtcSessionManager.getInstance(getActivity());
localViewOnClickListener = new LocalViewOnClickListener();
if (getArguments() != null) {
isIncomingCall = getArguments().getBoolean(Consts.EXTRA_IS_INCOMING_CALL);
}
currentSession = sessionManager.getCurrentSession();
opponents = dbManager.getUsersByIds(currentSession.getOpponents());
if (isIncomingCall) {
opponents.add(dbManager.getUserById(currentSession.getCallerID()));
opponents.remove(QBChatService.getInstance().getUser());
}
>>>>>>>
@Override
int getFragmentLayout() {
return R.layout.fragment_conversation;
}
<<<<<<<
=======
String callerName = dbManager.getUserNameById(currentSession.getCallerID());
qbConferenceType = currentSession.getConferenceType().ordinal();
>>>>>>>
String callerName = dbManager.getUserNameById(currentSession.getCallerID());
qbConferenceType = currentSession.getConferenceType().ordinal();
<<<<<<<
if (toolbar != null) {
QBUser user = QBChatService.getInstance().getUser();
Log.d(TAG, "user = "+ user.toString());
if (user != null) {
Log.d(TAG, "userFullName = "+ user.getFullName() + "AMOUNT_OPPONENTS = " + amountOpponents);
toolbar.setTitle(user.getFullName());
toolbar.setSubtitle(getString(R.string.opponents, amountOpponents));
}
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
=======
timerABWithTimer = (Chronometer) getActivity().findViewById(R.id.timer_chronometer);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
actionBar = ((AppCompatActivity) getActivity()).getDelegate().getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);
}
>>>>>>>
timerABWithTimer = (Chronometer) getActivity().findViewById(R.id.timer_chronometer);
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
actionBar = ((AppCompatActivity) getActivity()).getDelegate().getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);
}
<<<<<<<
@Override
protected void actionButtonsEnabled(boolean enability) {
super.actionButtonsEnabled(enability);
=======
private void setUpUiByCallType(int qbConferenceType) {
if (!isVideoCall) {
cameraToggle.setVisibility(View.GONE);
}
}
public void actionButtonsEnabled(boolean enability) {
>>>>>>>
private void setUpUiByCallType(int qbConferenceType) {
if (!isVideoCall) {
cameraToggle.setVisibility(View.GONE);
}
}
public void actionButtonsEnabled(boolean enability) {
@Override
protected void actionButtonsEnabled(boolean enability) {
super.actionButtonsEnabled(enability);
<<<<<<<
=======
micToggleVideoCall.setEnabled(enability);
>>>>>>>
<<<<<<<
=======
micToggleVideoCall.setActivated(enability);
>>>>>>>
<<<<<<<
=======
try {
callEvents = (OnCallEventsController) activity;
conversationFragmentCallbackListener = (ConversationFragmentCallbackListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnCallEventsController and ConversationFragmentCallbackListener");
}
>>>>>>>
<<<<<<<
}
protected void initButtonsListener() {
=======
if (currentSession != null) {
currentSession.removeVideoTrackCallbacksListener(this);
}
}
private void initButtonsListener() {
>>>>>>>
}
protected void initButtonsListener() {
<<<<<<<
}
private void toggleCamerainternal(QBMediaStreamManager mediaStreamManager) {
toggleCameraOnUiThread(false);
=======
if (CameraUtils.isCameraFront(currentSession.getMediaStreamManager().getCurrentCameraId())) {
Log.d(TAG, "CameraFront now!");
item.setIcon(R.drawable.ic_camera_front);
} else {
Log.d(TAG, "CameraRear now!");
item.setIcon(R.drawable.ic_camera_rear);
}
}
private void toggleCameraInternal(QBMediaStreamManager mediaStreamManager) {
>>>>>>>
if (CameraUtils.isCameraFront(currentSession.getMediaStreamManager().getCurrentCameraId())) {
Log.d(TAG, "CameraFront now!");
item.setIcon(R.drawable.ic_camera_front);
} else {
Log.d(TAG, "CameraRear now!");
item.setIcon(R.drawable.ic_camera_rear);
}
}
private void toggleCameraInternal(QBMediaStreamManager mediaStreamManager) {
<<<<<<<
=======
private void setLocalVideoView(QBRTCVideoTrack videoTrack) {
RTCGLVideoView.RendererConfig config = setRTCCameraMirrorConfig(true);
config.coordinates = getResources().getIntArray(R.array.local_view_coordinates_my_screen);
localVideoView.updateRenderer(RTCGLVideoView.RendererSurface.SECOND, config);
config = setRTCCameraMirrorConfig(false);
localVideoView.updateRenderer(RTCGLVideoView.RendererSurface.MAIN, config);
fillVideoView(localVideoView, videoTrack);
}
private void startTimer() {
if (!isStarted) {
timerABWithTimer.setVisibility(View.VISIBLE);
timerABWithTimer.setBase(SystemClock.elapsedRealtime());
timerABWithTimer.start();
isStarted = true;
}
}
private void stopTimer() {
if (timerABWithTimer != null) {
timerABWithTimer.stop();
isStarted = false;
}
}
>>>>>>>
private void setLocalVideoView(QBRTCVideoTrack videoTrack) {
RTCGLVideoView.RendererConfig config = setRTCCameraMirrorConfig(true);
config.coordinates = getResources().getIntArray(R.array.local_view_coordinates_my_screen);
localVideoView.updateRenderer(RTCGLVideoView.RendererSurface.SECOND, config);
config = setRTCCameraMirrorConfig(false);
localVideoView.updateRenderer(RTCGLVideoView.RendererSurface.MAIN, config);
fillVideoView(localVideoView, videoTrack);
}
private void startTimer() {
if (!isStarted) {
timerABWithTimer.setVisibility(View.VISIBLE);
timerABWithTimer.setBase(SystemClock.elapsedRealtime());
timerABWithTimer.start();
isStarted = true;
}
}
private void stopTimer() {
if (timerABWithTimer != null) {
timerABWithTimer.stop();
isStarted = false;
}
}
<<<<<<<
=======
public void enableDynamicToggle(boolean plugged) {
headsetPlugged = plugged;
}
>>>>>>>
public void enableDynamicToggle(boolean plugged) {
headsetPlugged = plugged;
}
<<<<<<<
conversationFragmentCallbackListener.onSwitchAudio();
=======
callEvents.onSwitchAudio();
if (!headsetPlugged) {
if (!item.isChecked()) {
item.setChecked(!item.isChecked());
item.setIcon(R.drawable.ic_speaker_phone);
} else {
item.setChecked(!item.isChecked());
item.setIcon(R.drawable.ic_phonelink_ring);
}
}
>>>>>>>
conversationFragmentCallbackListener.onSwitchAudio();
if (!headsetPlugged) {
if (!item.isChecked()) {
item.setChecked(!item.isChecked());
item.setIcon(R.drawable.ic_speaker_phone);
} else {
item.setChecked(!item.isChecked());
item.setIcon(R.drawable.ic_phonelink_ring);
}
}
<<<<<<<
=======
private class AudioStreamReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(AudioManager.ACTION_HEADSET_PLUG)) {
Log.d(TAG, "ACTION_HEADSET_PLUG " + intent.getIntExtra("state", -1));
} else if (intent.getAction().equals(AudioManager.ACTION_SCO_AUDIO_STATE_UPDATED)) {
Log.d(TAG, "ACTION_SCO_AUDIO_STATE_UPDATED " + intent.getIntExtra("EXTRA_SCO_AUDIO_STATE", -2));
}
}
}
>>>>>>> |
<<<<<<<
import com.quickblox.core.QBEntityCallback;
=======
import com.digits.sdk.android.AuthCallback;
import com.digits.sdk.android.Digits;
import com.digits.sdk.android.DigitsException;
import com.digits.sdk.android.DigitsOAuthSigning;
import com.digits.sdk.android.DigitsSession;
import com.quickblox.core.QBEntityCallbackImpl;
>>>>>>>
import com.quickblox.core.QBEntityCallback;
import com.digits.sdk.android.AuthCallback;
import com.digits.sdk.android.Digits;
import com.digits.sdk.android.DigitsException;
import com.digits.sdk.android.DigitsOAuthSigning;
import com.digits.sdk.android.DigitsSession;
import com.quickblox.core.QBEntityCallbackImpl;
<<<<<<<
=======
import java.util.List;
import java.util.Map;
import io.fabric.sdk.android.Fabric;
>>>>>>>
import java.util.List;
import java.util.Map;
import io.fabric.sdk.android.Fabric;
<<<<<<<
public void onError(QBResponseException e) {
handleErrors(e);
=======
public void onError(List<String> errors) {
Log.i(TAG, "session creation, error = " + errors);
handleErrors(errors);
>>>>>>>
public void onError(QBResponseException e) {
handleErrors(e); |
<<<<<<<
import com.quickblox.auth.QBAuth;
import com.quickblox.auth.session.QBSession;
=======
import com.quickblox.auth.session.QBSessionManager;
>>>>>>>
import com.quickblox.auth.session.QBSessionManager;
import com.quickblox.auth.QBAuth;
import com.quickblox.auth.session.QBSession; |
<<<<<<<
import com.quickblox.chat.QBChat;
=======
import com.quickblox.chat.QBChat;
import com.quickblox.chat.QBMessageStatusesManager;
import com.quickblox.chat.QBPingManager;
>>>>>>>
import com.quickblox.chat.QBChat;
<<<<<<<
import com.quickblox.chat.listeners.QBMessageSentListener;
=======
import com.quickblox.chat.listeners.QBMessageStatusListener;
>>>>>>>
import com.quickblox.chat.listeners.QBMessageSentListener;
import com.quickblox.chat.QBMessageStatusesManager;
import com.quickblox.chat.QBPingManager;
import com.quickblox.chat.listeners.QBMessageStatusListener;
<<<<<<<
import org.json.JSONObject;
=======
>>>>>>>
<<<<<<<
private QBIsTypingListener<QBPrivateChat> privateChatIsTypingListener;
private QBMessageSentListener<QBPrivateChat> privateChatMessageSentListener;
=======
//
private QBIsTypingListener<QBChat> isTypingListener;
// Message status manager & listener
private QBMessageStatusesManager messageStatusesManager;
private QBMessageStatusListener messageStatusListener;
>>>>>>>
private QBMessageSentListener<QBPrivateChat> privateChatMessageSentListener;
//
private QBIsTypingListener<QBChat> isTypingListener;
// Message status manager & listener
private QBMessageStatusesManager messageStatusesManager;
private QBMessageStatusListener messageStatusListener;
<<<<<<<
privateChat.addIsTypingListener(privateChatIsTypingListener);
privateChat.addMessageSentListener(privateChatMessageSentListener);
=======
privateChat.addIsTypingListener(isTypingListener);
>>>>>>>
privateChat.addMessageSentListener(privateChatMessageSentListener);
privateChat.addIsTypingListener(isTypingListener);
<<<<<<<
=======
>>>>>>>
<<<<<<<
privateChat.addIsTypingListener(privateChatIsTypingListener);
privateChat.addMessageSentListener(privateChatMessageSentListener);
=======
privateChat.addIsTypingListener(isTypingListener);
>>>>>>>
privateChat.addIsTypingListener(isTypingListener);
privateChat.addMessageSentListener(privateChatMessageSentListener);
<<<<<<<
} catch (SmackException.NotConnectedException e) {
=======
log("dialog id: " + privateChat.getDialogId());
} catch (XMPPException e) {
log("send message error: " + e.getLocalizedMessage());
} catch (SmackException.NotConnectedException e) {
>>>>>>>
} catch (SmackException.NotConnectedException e) {
<<<<<<<
privateChat.readMessage((QBChatMessage)null);
=======
privateChat.readMessage((QBChatMessage)null);
} catch (XMPPException e) {
log("read message error: " + e.getLocalizedMessage());
>>>>>>>
privateChat.readMessage((QBChatMessage)null);
<<<<<<<
log("Group chat: " + groupChat.getJid() + ", Error: " + error.getCondition().toString());
}
=======
log("Group chat: " + groupChat.getDialogId() + ", Error: " + error.getCondition().toString());
}
>>>>>>>
log("Group chat: " + groupChat.getDialogId() + ", Error: " + error.getCondition().toString());
}
<<<<<<<
currentChatRoom.addMessageSentListener(groupChatMessageSentListener);
=======
currentChatRoom.addIsTypingListener(isTypingListener);
>>>>>>>
currentChatRoom.addMessageSentListener(groupChatMessageSentListener);
currentChatRoom.addIsTypingListener(isTypingListener); |
<<<<<<<
public GrantDTO create(GrantDTO grantDTO, @Nullable User currentUser) {
return create(grantDTO, requireNonNull(currentUser, "currentUser cannot be null").getName());
}
public GrantDTO create(GrantDTO grantDTO, String creatorUsername) {
checkArgument(creatorUsername != null && !creatorUsername.trim().isEmpty(), "creatorUsername cannot be empty");
=======
public GrantDTO create(GrantDTO grantDTO, String userName) {
>>>>>>>
public GrantDTO create(GrantDTO grantDTO, @Nullable User currentUser) {
return create(grantDTO, requireNonNull(currentUser, "currentUser cannot be null").getName());
}
public GrantDTO create(GrantDTO grantDTO, String creatorUsername) {
checkArgument(isNotBlank(creatorUsername), "creatorUsername cannot be null or empty");
<<<<<<<
=======
checkArgument(isNotBlank(userName), "userName cannot be null or empty");
>>>>>>>
<<<<<<<
public GrantDTO create(GRN grantee, Capability capability, GRN target, String creatorUsername) {
checkArgument(grantee != null, "grantee cannot be null");
checkArgument(capability != null, "capability cannot be null");
checkArgument(target != null, "target cannot be null");
return create(GrantDTO.of(grantee, capability, target), creatorUsername);
}
=======
public GrantDTO create(GrantDTO grantDTO, @Nullable User currentUser) {
final String userName = requireNonNull(currentUser, "currentUser cannot be null").getName();
return create(grantDTO, userName);
}
>>>>>>>
public GrantDTO create(GRN grantee, Capability capability, GRN target, String creatorUsername) {
checkArgument(grantee != null, "grantee cannot be null");
checkArgument(capability != null, "capability cannot be null");
checkArgument(target != null, "target cannot be null");
return create(GrantDTO.of(grantee, capability, target), creatorUsername);
} |
<<<<<<<
// SharedPreferencesHelper.setLogin(getBaseContext(), "supersample-android");
// SharedPreferencesHelper.setPassword(getBaseContext(), "supersample-android");
=======
>>>>>>>
// SharedPreferencesHelper.setLogin(getBaseContext(), "supersample-android");
// SharedPreferencesHelper.setPassword(getBaseContext(), "supersample-android"); |
<<<<<<<
void onCallStoped();
void onOpponentsListUpdated(ArrayList<QBUser> newUsers);
=======
void onCallStopped();
>>>>>>>
void onCallStopped();
void onOpponentsListUpdated(ArrayList<QBUser> newUsers); |
<<<<<<<
private int startReason;
=======
>>>>>>>
private int startReason;
<<<<<<<
=======
private View myCameraOff;
>>>>>>>
private View myCameraOff;
<<<<<<<
private boolean isVideoEnabled = false;
=======
private boolean isVideoCall = false;
>>>>>>>
private boolean isVideoEnabled = false;
private boolean isVideoCall = false;
<<<<<<<
=======
private QbUsersDbManager dbManager;
>>>>>>>
<<<<<<<
QbUsersDbManager dbManager = QbUsersDbManager.getInstance(getActivity().getApplicationContext());
WebRtcSessionManager sessionManager = WebRtcSessionManager.getInstance();
localViewOnClickListener = new LocalViewOnClickListener();
=======
dbManager = QbUsersDbManager.getInstance(getActivity().getApplicationContext());
sessionManager = WebRtcSessionManager.getInstance(getActivity());
>>>>>>>
QbUsersDbManager dbManager = QbUsersDbManager.getInstance(getActivity().getApplicationContext());
WebRtcSessionManager sessionManager = WebRtcSessionManager.getInstance(getActivity());
localViewOnClickListener = new LocalViewOnClickListener();
<<<<<<<
String callerName = dbManager.getUserNameById(currentSession.getCallerID());
=======
>>>>>>>
String callerName = dbManager.getUserNameById(currentSession.getCallerID());
<<<<<<<
=======
if (switchCameraToggle != null) {
switchCameraToggle.setVisibility(View.INVISIBLE);
}
>>>>>>>
<<<<<<<
private void switchCamera() {
QBRTCSession currentSession = ((CallActivity) getActivity()).getCurrentSession();
=======
private void switchCamera(){
>>>>>>>
private void switchCamera() { |
<<<<<<<
import com.quickblox.auth.QBAuth;
import com.quickblox.auth.session.QBSession;
import com.quickblox.auth.session.QBSettings;
=======
import com.quickblox.auth.session.QBSettings;
>>>>>>>
import com.quickblox.auth.session.QBSettings;
import com.quickblox.auth.QBAuth;
import com.quickblox.auth.session.QBSession;
import com.quickblox.auth.session.QBSettings;
<<<<<<<
private static QBChatService.ConfigurationBuilder buildChatConfigs(){
Configs configs = ConfigUtils.getConfigs();
int port = configs.getChatPort();
int socketTimeout = configs.getChatSocketTimeout();
boolean useTls = configs.isUseTls();
boolean keepAlive = configs.isKeepAlive();
boolean autoJoinEnabled = configs.isAutoJoinEnabled();
boolean autoMarkDelivered = configs.isAutoMarkDelivered();
boolean reconnectionAllowed = configs.isReconnectionAllowed();
boolean allowListenNetwork = configs.isAllowListenNetwork();
=======
private static QBChatService.ConfigurationBuilder buildChatConfigs() {
>>>>>>>
private static QBChatService.ConfigurationBuilder buildChatConfigs(){
Configs configs = ConfigUtils.getConfigs();
int port = configs.getChatPort();
int socketTimeout = configs.getChatSocketTimeout();
boolean useTls = configs.isUseTls();
boolean keepAlive = configs.isKeepAlive();
boolean autoJoinEnabled = configs.isAutoJoinEnabled();
boolean autoMarkDelivered = configs.isAutoMarkDelivered();
boolean reconnectionAllowed = configs.isReconnectionAllowed();
boolean allowListenNetwork = configs.isAllowListenNetwork(); |
<<<<<<<
public Type value() { return publisher; }
public static type INSTANCE = publisher;
=======
public Type value() { return publisher; }
public static Type INSTANCE = publisher;
>>>>>>>
public Type value() { return publisher; } |
<<<<<<<
public interface Factory {
Searches create(Client client);
}
=======
private static final Logger log = LoggerFactory.getLogger(Searches.class);
>>>>>>>
private static final Logger log = LoggerFactory.getLogger(Searches.class);
public interface Factory {
Searches create(Client client);
}
<<<<<<<
if (configuration.isAllowHighlighting()) {
=======
if (highlight && server.getConfiguration().isAllowHighlighting()) {
>>>>>>>
if (highlight && configuration.isAllowHighlighting()) { |
<<<<<<<
=======
import org.graylog2.Core;
import org.graylog2.database.ValidationException;
import org.graylog2.inputs.Input;
>>>>>>>
import org.graylog2.database.ValidationException;
import org.graylog2.inputs.Input; |
<<<<<<<
import org.graylog.plugins.cef.CEFInputModule;
=======
import org.graylog.plugins.pipelineprocessor.PipelineConfig;
>>>>>>>
import org.graylog.plugins.cef.CEFInputModule;
import org.graylog.plugins.pipelineprocessor.PipelineConfig; |
<<<<<<<
import org.biojava.nbio.structure.chem.ChemCompGroupFactory;
import org.biojava.nbio.structure.chem.DownloadChemCompProvider;
=======
import org.junit.Ignore;
>>>>>>>
import org.biojava.nbio.structure.chem.ChemCompGroupFactory;
import org.biojava.nbio.structure.chem.DownloadChemCompProvider;
import org.junit.Ignore; |
<<<<<<<
import org.biojava.nbio.structure.geometry.CalcPoint;
import org.biojava.nbio.structure.geometry.MomentsOfInertia;
import org.biojava.nbio.structure.geometry.UnitQuaternions;
import org.biojava.nbio.structure.symmetry.geometry.DistanceBox;
import org.biojava.nbio.structure.symmetry.geometry.SphereSampler;
=======
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
>>>>>>>
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
<<<<<<<
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
=======
import org.biojava.nbio.structure.symmetry.geometry.DistanceBox;
import org.biojava.nbio.structure.symmetry.geometry.MomentsOfInertia;
import org.biojava.nbio.structure.symmetry.geometry.SphereSampler;
import org.biojava.nbio.structure.symmetry.geometry.SuperPosition;
>>>>>>>
import org.biojava.nbio.structure.geometry.CalcPoint;
import org.biojava.nbio.structure.geometry.MomentsOfInertia;
import org.biojava.nbio.structure.geometry.UnitQuaternions;
import org.biojava.nbio.structure.symmetry.geometry.DistanceBox;
import org.biojava.nbio.structure.symmetry.geometry.SphereSampler;
<<<<<<<
List<Integer> seqClusterId = subunits.getClusterIds();
=======
List<Integer> seqClusterId = subunits.getSequenceClusterIds();
int selfaligned = 0;
>>>>>>>
List<Integer> seqClusterId = subunits.getClusterIds();
int selfaligned = 0; |
<<<<<<<
private String parse(BufferedReader bufferedReader) {
=======
@SuppressWarnings("unchecked")
private String parse(BufferedReader bufferedReader) {
>>>>>>>
private String parse(BufferedReader bufferedReader) {
<<<<<<<
public String getSequence(BufferedReader bufferedReader, int sequenceLength) throws Exception {
featureCollection = new HashMap<String, ArrayList<AbstractFeature>>();
=======
public String getSequence(BufferedReader bufferedReader, int sequenceLength) throws IOException {
mapFeature = new TreeMap<String, AbstractFeature<AbstractSequence<C>, C>>();
>>>>>>>
public String getSequence(BufferedReader bufferedReader, int sequenceLength) throws IOException {
featureCollection = new HashMap<String, ArrayList<AbstractFeature>>(); |
<<<<<<<
=======
import java.util.Collections;
import java.util.HashMap;
>>>>>>>
import java.util.Collections; |
<<<<<<<
import org.biojava.bio.structure.quaternary.io.BioUnitDataProviderFactory;
=======
import org.biojava.bio.structure.io.util.FileDownloadUtils;
>>>>>>>
import org.biojava.bio.structure.io.util.FileDownloadUtils;
import org.biojava.bio.structure.quaternary.io.BioUnitDataProviderFactory;
<<<<<<<
this.path = pdbFilePath;
this.cachePath = cachePath;
=======
setPath(pdbFilePath);
String tmpCache = System.getProperty(AbstractUserArgumentProcessor.CACHE_DIR);
if (tmpCache == null || tmpCache.equals("")) {
tmpCache = pdbFilePath;
}
cachePath = tmpCache;
System.setProperty(AbstractUserArgumentProcessor.CACHE_DIR, cachePath);
>>>>>>>
setPath(pdbFilePath);
this.cachePath = cachePath;
<<<<<<<
this.path = path;
=======
this.path = FileDownloadUtils.expandUserHome(path);
System.setProperty(AbstractUserArgumentProcessor.PDB_DIR, this.path);
>>>>>>>
this.path = FileDownloadUtils.expandUserHome(path); |
<<<<<<<
@Override
@SuppressWarnings("rawtypes")
=======
>>>>>>>
@Override |
<<<<<<<
import org.biojava.nbio.structure.symmetry.core.QuatSymmetrySubunits;
import org.biojava.nbio.structure.symmetry.geometry.MomentsOfInertia;
import org.biojava.nbio.structure.symmetry.geometry.SuperPosition;
=======
import org.biojava.nbio.structure.symmetry.core.Subunits;
>>>>>>>
import org.biojava.nbio.structure.symmetry.core.QuatSymmetrySubunits; |
<<<<<<<
import heigit.ors.routing.graphhopper.extensions.storages.*;
=======
import heigit.ors.routing.graphhopper.extensions.storages.GraphStorageUtils;
import heigit.ors.routing.graphhopper.extensions.storages.WaySurfaceTypeGraphStorage;
import heigit.ors.routing.graphhopper.extensions.storages.WayCategoryGraphStorage;
import heigit.ors.routing.util.ElevationSmoother;
>>>>>>>
import heigit.ors.routing.graphhopper.extensions.storages.*;
import heigit.ors.routing.util.ElevationSmoother;
<<<<<<<
private HillIndexGraphStorage extHillIndex;
private GreenIndexGraphStorage extGreenIndex;
=======
>>>>>>>
private HillIndexGraphStorage extHillIndex;
private GreenIndexGraphStorage extGreenIndex; |
<<<<<<<
=======
import heigit.ors.common.TravelRangeType;
import heigit.ors.util.GeomUtility;
import org.apache.log4j.Logger;
import org.opensphere.geometry.algorithm.ConcaveHull;
import heigit.ors.isochrones.IsochroneSearchParameters;
>>>>>>>
import heigit.ors.common.TravelRangeType; |
<<<<<<<
=======
@Parameter(value = "transport_email_web_interface_url", required = false)
private URI emailTransportWebInterfaceUrl;
@Parameter(value = "rest_enable_cors", required = false)
private boolean restEnableCors = false;
@Parameter(value = "rest_enable_gzip", required = false)
private boolean restEnableGzip = false;
>>>>>>>
@Parameter(value = "transport_email_web_interface_url", required = false)
private URI emailTransportWebInterfaceUrl;
<<<<<<<
=======
public URI getEmailTransportWebInterfaceUrl() {
return emailTransportWebInterfaceUrl;
}
public boolean isRestEnableCors() {
return restEnableCors;
}
public boolean isRestEnableGzip() {
return restEnableGzip;
}
>>>>>>>
public URI getEmailTransportWebInterfaceUrl() {
return emailTransportWebInterfaceUrl;
} |
<<<<<<<
this.processNodeTags = (storage.getEncodingManager().supports("wheelchair"));
=======
// Look if we should do border processing - if so then we have to process the geometry
for(GraphStorageBuilder b : this._procCntx.getStorageBuilders()) {
if ( b instanceof BordersGraphStorageBuilder) {
this.processGeom = true;
}
}
>>>>>>>
// Look if we should do border processing - if so then we have to process the geometry
for(GraphStorageBuilder b : this._procCntx.getStorageBuilders()) {
if ( b instanceof BordersGraphStorageBuilder) {
this.processGeom = true;
}
if ( b instanceof WheelchairGraphStorageBuilder) {
this.processNodeTags = true;
}
}
<<<<<<<
// Pass through any nodes and their tags for processing
if(processNodeTags) {
LongArrayList osmNodeIds = way.getNodes();
int size = osmNodeIds.size();
HashMap<Long, HashMap<String, String>> nodeTags = new HashMap<>();
for(int i=0; i<size; i++) {
// find the node
}
}
_procCntx.processWay(way);
=======
if(processGeom) {
// We need to pass the geometry of the way aswell as the ReaderWay object
// This is slower so should only be done when needed
// First we need to generate the geometry
LongArrayList osmNodeIds = way.getNodes();
ArrayList<Coordinate> coords = new ArrayList<>();
if(osmNodeIds.size() > 1) {
for (int i=0; i<osmNodeIds.size(); i++) {
int id = getNodeMap().get(osmNodeIds.get(i));
try {
double lat = getLatitudeOfNode(id);
double lon = getLongitudeOfNode(id);
// Add the point to the line
// Check that we have a tower node
if(!(lat == 0 || lon == 0 || Double.isNaN(lat) || Double.isNaN(lon)))
if (lat != 0 || lon != 0)
coords.add(new Coordinate(lon, lat));
} catch (Exception e) {
LOGGER.error("Could not process node " + osmNodeIds.get(i) );
}
}
// Only process valid ways (with more than 1 valid node)
if(coords.size() > 1) {
//LineString ls = gf.createLineString(coords.toArray(new Coordinate[coords.size()]));
_procCntx.processWay(way, coords.toArray(new Coordinate[coords.size()]));
}
}
} else {
_procCntx.processWay(way);
}
>>>>>>>
// Pass through any nodes and their tags for processing
if(processNodeTags) {
LongArrayList osmNodeIds = way.getNodes();
int size = osmNodeIds.size();
HashMap<Long, HashMap<String, String>> nodeTags = new HashMap<>();
for(int i=0; i<size; i++) {
// find the node
}
}
if(processGeom) {
// We need to pass the geometry of the way aswell as the ReaderWay object
// This is slower so should only be done when needed
// First we need to generate the geometry
LongArrayList osmNodeIds = way.getNodes();
ArrayList<Coordinate> coords = new ArrayList<>();
if(osmNodeIds.size() > 1) {
for (int i=0; i<osmNodeIds.size(); i++) {
int id = getNodeMap().get(osmNodeIds.get(i));
try {
double lat = getLatitudeOfNode(id);
double lon = getLongitudeOfNode(id);
// Add the point to the line
// Check that we have a tower node
if(!(lat == 0 || lon == 0 || Double.isNaN(lat) || Double.isNaN(lon)))
if (lat != 0 || lon != 0)
coords.add(new Coordinate(lon, lat));
} catch (Exception e) {
LOGGER.error("Could not process node " + osmNodeIds.get(i) );
}
}
// Only process valid ways (with more than 1 valid node)
if(coords.size() > 1) {
//LineString ls = gf.createLineString(coords.toArray(new Coordinate[coords.size()]));
_procCntx.processWay(way, coords.toArray(new Coordinate[coords.size()]));
}
}
} else {
_procCntx.processWay(way);
} |
<<<<<<<
private RouteExtraInfo _roadAccessRestrictionsInfo;
private RouteExtraInfoBuilder _roadAccessRestrictionsBuilder;
private List<Integer> warningExtensions;
=======
private List<Integer> warningExtensions;
>>>>>>>
private RouteExtraInfo _roadAccessRestrictionsInfo;
private RouteExtraInfoBuilder _roadAccessRestrictionsBuilder;
private List<Integer> warningExtensions;
<<<<<<<
if (includeExtraInfo(extraInfo, RouteExtraInfoFlag.RoadAccessRestrictions)) {
_extRoadAccessRestrictions = GraphStorageUtils.getGraphExtension(graphHopper.getGraphHopperStorage(), RoadAccessRestrictionsGraphStorage.class);
if(_extRoadAccessRestrictions == null)
throw new Exception("RoadAccessRestrictions storage is not found");
_roadAccessRestrictionsInfo = new RouteExtraInfo("roadaccessrestrictions", _extRoadAccessRestrictions);
_roadAccessRestrictionsBuilder = new SimpleRouteExtraInfoBuilder(_roadAccessRestrictionsInfo);
}
=======
>>>>>>>
if (includeExtraInfo(extraInfo, RouteExtraInfoFlag.RoadAccessRestrictions)) {
_extRoadAccessRestrictions = GraphStorageUtils.getGraphExtension(graphHopper.getGraphHopperStorage(), RoadAccessRestrictionsGraphStorage.class);
if(_extRoadAccessRestrictions == null)
throw new Exception("RoadAccessRestrictions storage is not found");
_roadAccessRestrictionsInfo = new RouteExtraInfo("roadaccessrestrictions", _extRoadAccessRestrictions);
_roadAccessRestrictionsBuilder = new SimpleRouteExtraInfoBuilder(_roadAccessRestrictionsInfo);
}
<<<<<<<
private void applyWarningExtensions(ORSGraphHopper graphHopper) {
GraphExtension[] extensions = GraphStorageUtils.getGraphExtensions(graphHopper.getGraphHopperStorage());
for(GraphExtension ge : extensions) {
if (ge instanceof WarningGraphExtension) {
if(((WarningGraphExtension)ge).isUsedForWarning()) {
warningExtensions.add(RouteExtraInfoFlag.getFromString(((WarningGraphExtension) ge).getName()));
//warningExtensions.add(new RouteExtraInfoHolder(RouteExtraInfoFlag.getFromString(((WarningGraphExtension) ge).getName()), graphHopper));
}
}
}
}
private boolean includeExtraInfo(int encodedExtras, int infoFlag) {
boolean include = false;
if(RouteExtraInfoFlag.isSet(encodedExtras, infoFlag) || warningExtensions.contains(infoFlag))
include = true;
return include;
}
=======
/**
* Loop through the GraphExtensions of the storage and store in the warningExtensions object those that implement
* the WarningGraphExtension interface and are set to be used for generating warnings.
*
* @param graphHopper
*/
private void applyWarningExtensions(ORSGraphHopper graphHopper) {
GraphExtension[] extensions = GraphStorageUtils.getGraphExtensions(graphHopper.getGraphHopperStorage());
for(GraphExtension ge : extensions) {
if (ge instanceof WarningGraphExtension) {
if(((WarningGraphExtension)ge).isUsedForWarning()) {
warningExtensions.add(RouteExtraInfoFlag.getFromString(((WarningGraphExtension) ge).getName()));
}
}
}
}
/**
* Check if the extra info should be included in the generation or not by looking at the encoded extras value and
* the list of warning extras.
*
* @param encodedExtras The encoded value stating which extras were passed explicitly
* @param infoFlag The id of the extra info whos inclusion needs to be decided
*
* @return
*/
private boolean includeExtraInfo(int encodedExtras, int infoFlag) {
boolean include = false;
if(RouteExtraInfoFlag.isSet(encodedExtras, infoFlag) || warningExtensions.contains(infoFlag))
include = true;
return include;
}
>>>>>>>
/**
* Loop through the GraphExtensions of the storage and store in the warningExtensions object those that implement
* the WarningGraphExtension interface and are set to be used for generating warnings.
*
* @param graphHopper
*/
private void applyWarningExtensions(ORSGraphHopper graphHopper) {
GraphExtension[] extensions = GraphStorageUtils.getGraphExtensions(graphHopper.getGraphHopperStorage());
for(GraphExtension ge : extensions) {
if (ge instanceof WarningGraphExtension) {
if(((WarningGraphExtension)ge).isUsedForWarning()) {
warningExtensions.add(RouteExtraInfoFlag.getFromString(((WarningGraphExtension) ge).getName()));
}
}
}
}
/**
* Check if the extra info should be included in the generation or not by looking at the encoded extras value and
* the list of warning extras.
*
* @param encodedExtras The encoded value stating which extras were passed explicitly
* @param infoFlag The id of the extra info whos inclusion needs to be decided
*
* @return
*/
private boolean includeExtraInfo(int encodedExtras, int infoFlag) {
boolean include = false;
if(RouteExtraInfoFlag.isSet(encodedExtras, infoFlag) || warningExtensions.contains(infoFlag))
include = true;
return include;
}
<<<<<<<
if (_roadAccessRestrictionsInfo != null)
extras.add(_roadAccessRestrictionsInfo);
=======
>>>>>>>
if (_roadAccessRestrictionsInfo != null)
extras.add(_roadAccessRestrictionsInfo); |
<<<<<<<
if (configuration.isDisableIndexRangeCalculation() && oldTargetNumber != -1) {
addSingleIndexRanges(oldTarget);
addSingleIndexRanges(newTarget);
} else
updateIndexRanges();
=======
>>>>>>> |
<<<<<<<
import com.graphhopper.GHResponse;
import com.graphhopper.routing.util.EdgeFilter;
import com.graphhopper.routing.util.PathProcessor;
import com.graphhopper.util.DistanceCalc;
import com.graphhopper.util.Helper;
import com.graphhopper.util.PointList;
import com.vividsolutions.jts.geom.Coordinate;
import heigit.ors.exceptions.InternalServerException;
=======
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import heigit.ors.exceptions.PointNotFoundException;
>>>>>>>
import com.graphhopper.GHResponse;
import com.graphhopper.routing.util.EdgeFilter;
import com.graphhopper.routing.util.PathProcessor;
import com.graphhopper.util.DistanceCalc;
import com.graphhopper.util.Helper;
import com.graphhopper.util.PointList;
import com.vividsolutions.jts.geom.Coordinate;
import heigit.ors.exceptions.InternalServerException;
import heigit.ors.exceptions.PointNotFoundException;
<<<<<<<
import heigit.ors.exceptions.ServerLimitExceededException;
import heigit.ors.isochrones.IsochroneMap;
=======
import heigit.ors.util.StringUtility;
import org.apache.log4j.Logger;
import heigit.ors.routing.parameters.VehicleParameters;
import heigit.ors.routing.pathprocessors.ElevationSmoothPathProcessor;
import heigit.ors.routing.pathprocessors.ExtraInfoProcessor;
import heigit.ors.routing.configuration.RoutingManagerConfiguration;
import heigit.ors.routing.configuration.RouteProfileConfiguration;
import heigit.ors.routing.traffic.RealTrafficDataProvider;
import heigit.ors.services.routing.RoutingServiceSettings;
import heigit.ors.util.FormatUtility;
>>>>>>>
import heigit.ors.exceptions.ServerLimitExceededException;
import heigit.ors.isochrones.IsochroneMap; |
<<<<<<<
ExtraInfoProcessor extraInfoProcessor = null;
=======
if (req.getSearchParameters().getAlternativeRoutesCount() > 1 && coords.length > 2) {
throw new InternalServerException(RoutingErrorCodes.INVALID_PARAMETER_VALUE, "Alternative routes algorithm does not support more than two way points.");
}
if (req.getSearchParameters().getAlternativeRoutesCount() > 1 && coords.length > 2) {
throw new InternalServerException(RoutingErrorCodes.INVALID_PARAMETER_VALUE, "Alternative routes algorithm does not support more than two way points.");
}
>>>>>>>
if (req.getSearchParameters().getAlternativeRoutesCount() > 1 && coords.length > 2) {
throw new InternalServerException(RoutingErrorCodes.INVALID_PARAMETER_VALUE, "Alternative routes algorithm does not support more than two way points.");
}
if (req.getSearchParameters().getAlternativeRoutesCount() > 1 && coords.length > 2) {
throw new InternalServerException(RoutingErrorCodes.INVALID_PARAMETER_VALUE, "Alternative routes algorithm does not support more than two way points.");
}
ExtraInfoProcessor extraInfoProcessor = null;
<<<<<<<
List<RouteExtraInfo> extraInfos = extraInfoProcessor != null ? extraInfoProcessor.getExtras() : null;
return new RouteResultBuilder().createMergedRouteResultFromBestPaths(routes, req, extraInfos);
=======
return new RouteResultBuilder().createRouteResults(routes, req, (pathProcessor != null && (pathProcessor instanceof ExtraInfoProcessor)) ? ((ExtraInfoProcessor) pathProcessor).getExtras() : null);
>>>>>>>
List<RouteExtraInfo> extraInfos = extraInfoProcessor != null ? extraInfoProcessor.getExtras() : null;
return new RouteResultBuilder().createRouteResults(routes, req, extraInfos); |
<<<<<<<
// TODO use 1.652 use WorkspaceList.tempDir
private static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}
@Override public void stop(Throwable cause) throws Exception {
=======
@Override public void stop(@Nonnull Throwable cause) throws Exception {
>>>>>>>
// TODO use 1.652 use WorkspaceList.tempDir
private static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}
@Override public void stop(@Nonnull Throwable cause) throws Exception { |
<<<<<<<
import com.hazelcast.util.executor.ExecutorType;
=======
import com.hazelcast.util.ValidationUtil;
>>>>>>>
import com.hazelcast.util.ValidationUtil;
import com.hazelcast.util.executor.ExecutorType; |
<<<<<<<
// ExecutorManager executorManager = factory.node.executorManager;
// memberState.putInternalThroughputStats(executorManager.getInternalThroughputMap());
// memberState.putThroughputStats(executorManager.getThroughputMap());
=======
// ExecutorManager executorManager = instance.node.executorManager;
// memberState.putInternalThroughputStats(executorManager.getInternalThroughputMap());
// memberState.putThroughputStats(executorManager.getThroughputMap());
>>>>>>>
// ExecutorManager executorManager = factory.node.executorManager;
// ExecutorManager executorManager = instance.node.executorManager;
// memberState.putInternalThroughputStats(executorManager.getInternalThroughputMap());
// memberState.putThroughputStats(executorManager.getThroughputMap());
<<<<<<<
// private List<String> getExecutorNames() {
// ExecutorManager executorManager = factory.node.executorManager;
// List<String> executorNames = new ArrayList<String>(executorManager.getExecutorNames());
// Collections.sort(executorNames);
// return executorNames;
// }
=======
// private List<String> getExecutorNames() {
// ExecutorManager executorManager = instance.node.executorManager;
// List<String> executorNames = new ArrayList<String>(executorManager.getExecutorNames());
// Collections.sort(executorNames);
// return executorNames;
// }
>>>>>>>
// private List<String> getExecutorNames() {
// ExecutorManager executorManager = factory.node.executorManager;
// ExecutorManager executorManager = instance.node.executorManager;
// List<String> executorNames = new ArrayList<String>(executorManager.getExecutorNames());
// Collections.sort(executorNames);
// return executorNames;
// } |
<<<<<<<
periodicalBinder.addBinding().to(PurgeExpiredAgentsThread.class);
=======
periodicalBinder.addBinding().to(ClusterEventPeriodical.class);
periodicalBinder.addBinding().to(ClusterEventCleanupPeriodical.class);
periodicalBinder.addBinding().to(ClusterIdGeneratorPeriodical.class);
>>>>>>>
periodicalBinder.addBinding().to(ClusterEventPeriodical.class);
periodicalBinder.addBinding().to(ClusterEventCleanupPeriodical.class);
periodicalBinder.addBinding().to(ClusterIdGeneratorPeriodical.class);
periodicalBinder.addBinding().to(PurgeExpiredAgentsThread.class); |
<<<<<<<
private final ILogger logger;
final int partitionCount;
final int maxBackupCount;
=======
private final int PARTITION_COUNT;
private final int MAX_BACKUP_COUNT;
>>>>>>>
private final ILogger logger;
private final int partitionCount;
private final int maxBackupCount;
<<<<<<<
op.getOperationContext().setResponseHandler(new ResponseHandler() {
public void sendResponse(Object obj) {
inv.setResult(obj);
}
});
runLocally(partitionId, op, nonBlocking);
=======
if (!(op instanceof NoReply)) {
op.getOperationContext().setResponseHandler(new ResponseHandler() {
public void sendResponse(Object obj) {
inv.setResult(obj);
}
});
}
runLocally(partitionId, op, nonBlocking);
>>>>>>>
if (!(op instanceof NoReply)) {
op.getOperationContext().setResponseHandler(new ResponseHandler() {
public void sendResponse(Object obj) {
inv.setResult(obj);
}
});
}
runLocally(partitionId, op, nonBlocking);
<<<<<<<
public void runLocally(final int partitionId, final Operation op, final boolean nonBlocking) {
=======
void runLocally(final int partitionId, final Operation op, final boolean nonBlocking) {
>>>>>>>
void runLocally(final int partitionId, final Operation op, final boolean nonBlocking) {
<<<<<<<
op.getOperationContext().getResponseHandler().sendResponse(
new WrongTargetException(getThisAddress(), owner, partitionId, op.getClass().getName()));
return;
=======
op.getOperationContext().getResponseHandler().sendResponse(new WrongTargetException(getThisAddress(), owner));
return;
>>>>>>>
op.getOperationContext().getResponseHandler().sendResponse(
new WrongTargetException(getThisAddress(), owner, partitionId, op.getClass().getName()));
return;
<<<<<<<
setOperationContext(op, serviceName, caller, callId, partitionId).setConnection(packet.conn);
ResponseHandler responseHandler = new ResponseHandler() {
public void sendResponse(Object response) {
if (!(op instanceof NoReply)) {
if (!(response instanceof Operation)) {
response = new Response(response);
}
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = (response instanceof NonBlockingOperation) ? 1 : 0;
packet.setValue(toData(response));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn);
}
}
};
op.getOperationContext().setResponseHandler(responseHandler);
=======
setOperationContext(op, serviceName, caller, callId, partitionId);
final boolean noReply = (op instanceof NoReply);
if (!noReply) {
ResponseHandler responseHandler = new ResponseHandler() {
public void sendResponse(Object response) {
if (!noReply) {
if (!(response instanceof Operation)) {
response = new Response(response);
}
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = (response instanceof NonBlockingOperation) ? 1 : 0;
packet.setValue(toData(response));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn);
}
}
};
op.getOperationContext().setResponseHandler(responseHandler);
}
>>>>>>>
setOperationContext(op, serviceName, caller, callId, partitionId);
final boolean noReply = (op instanceof NoReply);
if (!noReply) {
ResponseHandler responseHandler = new ResponseHandler() {
public void sendResponse(Object response) {
if (!noReply) {
if (!(response instanceof Operation)) {
response = new Response(response);
}
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = (response instanceof NonBlockingOperation) ? 1 : 0;
packet.setValue(toData(response));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn);
}
}
};
op.getOperationContext().setResponseHandler(responseHandler);
}
<<<<<<<
logger.log(Level.SEVERE, e.getMessage(), e);
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = 1;
packet.setValue(toData(e));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn);
=======
e.printStackTrace();
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = 1;
packet.setValue(toData(e));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn);
>>>>>>>
logger.log(Level.SEVERE, e.getMessage(), e);
packet.clearForResponse();
packet.blockId = partitionId;
packet.callId = callId;
packet.longValue = 1;
packet.setValue(toData(e));
packet.name = serviceName;
node.concurrentMapManager.sendOrReleasePacket(packet, packet.conn); |
<<<<<<<
=======
import com.hazelcast.util.ResponseQueueFactory;
import com.hazelcast.util.Util;
>>>>>>>
import com.hazelcast.util.Util; |
<<<<<<<
private final ILogger logger;
=======
private final ConcurrencyUtil.ConstructorFunction<String, LocalQueueStatsImpl> localQueueStatsConstructorFunction = new ConcurrencyUtil.ConstructorFunction<String, LocalQueueStatsImpl>() {
public LocalQueueStatsImpl createNew(String key) {
return new LocalQueueStatsImpl();
}
};
>>>>>>>
private final ILogger logger;
private final ConcurrencyUtil.ConstructorFunction<String, LocalQueueStatsImpl> localQueueStatsConstructorFunction = new ConcurrencyUtil.ConstructorFunction<String, LocalQueueStatsImpl>() {
public LocalQueueStatsImpl createNew(String key) {
return new LocalQueueStatsImpl();
}
}; |
<<<<<<<
//import com.hazelcast.queue.QueueService;
import com.hazelcast.spi.ClientProtocolService;
=======
import com.hazelcast.queue.QueueService;
>>>>>>>
import com.hazelcast.queue.QueueService;
import com.hazelcast.spi.ClientProtocolService;
<<<<<<<
registerService(MapService.MAP_SERVICE_NAME, new MapService(nodeService));
// registerService(QueueService.NAME, new QueueService());
=======
registerService(MapService.MAP_SERVICE_NAME, new MapService(nodeEngine));
registerService(QueueService.NAME, new QueueService(nodeEngine));
registerService(AtomicNumberService.NAME, new AtomicNumberService());
>>>>>>>
registerService(MapService.MAP_SERVICE_NAME, new MapService(nodeEngine));
registerService(QueueService.NAME, new QueueService(nodeEngine));
registerService(AtomicNumberService.NAME, new AtomicNumberService()); |
<<<<<<<
private boolean isMavenVersionValid() throws Exception {
return MavenVersionHelper.isAtLeastResolutionCapableVersion(build, envVars, buildListener);
=======
private boolean isCheckoutPerformed() {
boolean checkoutWasPerformed = false;
try {
Field scmField = AbstractBuild.class.getDeclaredField("scm");
scmField.setAccessible(true);
Object scmObject = scmField.get(build);
if (scmObject != null) {
checkoutWasPerformed = !(scmObject instanceof NullChangeLogParser);
}
} catch (Exception e) {
buildListener.getLogger().println("[Warning] An error occurred while testing if the SCM checkout " +
"has already been performed: " + e.getMessage());
}
return checkoutWasPerformed;
}
private boolean isMavenVersionValid() {
try {
return MavenVersionHelper.isAtLeastResolutionCapableVersion(build, envVars, buildListener);
} catch (Exception e) {
throw new RuntimeException("Unable to determine Maven version", e);
}
>>>>>>>
private boolean isCheckoutPerformed() {
boolean checkoutWasPerformed = false;
try {
Field scmField = AbstractBuild.class.getDeclaredField("scm");
scmField.setAccessible(true);
Object scmObject = scmField.get(build);
if (scmObject != null) {
checkoutWasPerformed = !(scmObject instanceof NullChangeLogParser);
}
} catch (Exception e) {
buildListener.getLogger().println("[Warning] An error occurred while testing if the SCM checkout " +
"has already been performed: " + e.getMessage());
}
return checkoutWasPerformed;
}
private boolean isMavenVersionValid() throws Exception {
return MavenVersionHelper.isAtLeastResolutionCapableVersion(build, envVars, buildListener); |
<<<<<<<
import com.hazelcast.config.InMemoryFormat;
import com.hazelcast.core.*;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.DataSerializable;
=======
import com.hazelcast.config.MapConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.HazelcastInstanceAware;
import com.hazelcast.core.IMap;
import com.hazelcast.query.EntryObject;
import com.hazelcast.query.Predicate;
import com.hazelcast.query.PredicateBuilder;
import com.hazelcast.query.SampleObjects;
>>>>>>>
import com.hazelcast.config.InMemoryFormat;
import com.hazelcast.core.*;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.DataSerializable;
import com.hazelcast.query.EntryObject;
import com.hazelcast.query.Predicate;
import com.hazelcast.query.PredicateBuilder;
import com.hazelcast.query.SampleObjects; |
<<<<<<<
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.TreeMap;
=======
import java.text.SimpleDateFormat;
import java.util.*;
>>>>>>>
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
<<<<<<<
// TODO: really never used anymore... yank it?
=======
private static final byte[] ZERO = new byte[]{0};
>>>>>>>
// TODO: really never used anymore... yank it?
<<<<<<<
Counters(ResourceManager rm) throws IOException {
this.rm = rm;
=======
/**
* All possible statistics saved in columns in the table.
*/
public enum Category {
CLICK, COUNTRY;
}
/**
* Time frame for statistics.
*/
public enum TimeFrame {
DAY, WEEK, MONTH
}
/**
* The column qualifiers for the statistics table.
*/
public enum ColumnQualifier {
DAY("yyyyMMdd", TimeFrame.DAY),
WEEK("yyyyww", TimeFrame.WEEK),
MONTH("yyyyMM", TimeFrame.MONTH);
private final SimpleDateFormat formatter;
private final TimeFrame timeFrame;
ColumnQualifier(String format, TimeFrame timeFrame) {
this.formatter = new SimpleDateFormat(format);
this.timeFrame = timeFrame;
}
public byte[] getColumnName(Date date, Category type) {
return Bytes.add(Bytes.toBytes(formatter.format(date)), ZERO,
new byte[] { (byte)(type.ordinal() + 1) });
}
public TimeFrame getTimeFrame() {
return timeFrame;
}
public Date parseDate(String date) throws ParseException {
return formatter.parse(date);
}
>>>>>>>
Counters(ResourceManager rm) throws IOException {
this.rm = rm;
<<<<<<<
=======
* Container class to hold the details for the presentation layer.
*/
public class ShortUrlStatistics {
private final ShortUrl shortUrl;
private final TimeFrame timeFrame;
private Map<String, NavigableSet<?>>
counters = new HashMap<String, NavigableSet<?>>();
private ShortUrlStatistics(ShortUrl shortUrl, TimeFrame timeFrame) {
this.shortUrl = shortUrl;
this.timeFrame = timeFrame;
}
public ShortUrl getShortUrl() {
return shortUrl;
}
public TimeFrame getTimeFrame() {
return timeFrame;
}
public NavigableSet<?> getCounters(String name) {
return counters.get(name);
}
public void addCounters(String name, NavigableSet<?> counters) {
this.counters.put(name, counters);
}
}
/**
>>>>>>>
<<<<<<<
put.add(HushTable.COUNTERS_FAMILY, HushTable.ANONYMOUS_USER_ID,
Bytes.toBytes(parseLong("0", 62, false)));
=======
put.add(HushTable.COUNTERS_FAMILY, HushTable.ANONYMOUS_USER_ID,
Bytes.toBytes(parseLong("0", 62, false)));
>>>>>>>
put.add(HushTable.COUNTERS_FAMILY, HushTable.ANONYMOUS_USER_ID,
Bytes.toBytes(parseLong("0", 62, false)));
<<<<<<<
HushTable.ANONYMOUS_USER_ID));
=======
HushTable.ANONYMOUS_USER_ID));
>>>>>>>
HushTable.ANONYMOUS_USER_ID));
<<<<<<<
public void incrementUsage(ShortUrl shortUrl, RequestInfo info,
long incrBy) throws IOException {
=======
public void incrementUsage(ShortUrl shortUrl, RequestInfo info, long incrBy)
throws IOException {
>>>>>>>
public void incrementUsage(ShortUrl shortUrl, RequestInfo info, long incrBy)
throws IOException {
<<<<<<<
private void addIncrement(Increment increment, Category category,
Date date, String extra, long incrBy) {
byte[] qualifier = getQualifier(ColumnQualifier.Day, category,
date, extra);
increment.addColumn(UserShortUrlTable.DAILY_FAMILY, qualifier,
incrBy);
qualifier = getQualifier(ColumnQualifier.Week, category, date,
extra);
increment.addColumn(UserShortUrlTable.WEEKLY_FAMILY, qualifier,
incrBy);
qualifier = getQualifier(ColumnQualifier.Month, category, date,
extra);
increment.addColumn(UserShortUrlTable.MONTHLY_FAMILY, qualifier,
incrBy);
=======
private void addIncrement(Increment increment, Category category, Date date,
String extra, long incrBy) {
byte[] qualifier = getQualifier(ColumnQualifier.DAY, category, date, extra);
increment.addColumn(UserShortUrlTable.DAILY_FAMILY, qualifier, incrBy);
qualifier = getQualifier(ColumnQualifier.WEEK, category, date, extra);
increment.addColumn(UserShortUrlTable.WEEKLY_FAMILY, qualifier, incrBy);
qualifier = getQualifier(ColumnQualifier.MONTH, category, date, extra);
increment.addColumn(UserShortUrlTable.MONTHLY_FAMILY, qualifier, incrBy);
>>>>>>>
private void addIncrement(Increment increment, Category category,
Date date, String extra, long incrBy) {
byte[] qualifier = getQualifier(ColumnQualifier.DAY, category, date,
extra);
increment.addColumn(UserShortUrlTable.DAILY_FAMILY, qualifier, incrBy);
qualifier = getQualifier(ColumnQualifier.WEEK, category, date, extra);
increment.addColumn(UserShortUrlTable.WEEKLY_FAMILY, qualifier, incrBy);
qualifier = getQualifier(ColumnQualifier.MONTH, category, date, extra);
increment.addColumn(UserShortUrlTable.MONTHLY_FAMILY, qualifier, incrBy);
}
/**
* Helper to compute the row key for a shortened URL.
*
* @param shortUrl The current short URL details.
* @return The row key in byte[] format.
*/
public static byte[] getRowKey(ShortUrl shortUrl) {
return Bytes.add(
shortUrl.getUser() != null ? Bytes.toBytes(shortUrl.getUser())
: DEFAULT_USER, ResourceManager.ZERO,
Bytes.toBytes(shortUrl.getId()));
<<<<<<<
private byte[] getQualifier(ColumnQualifier qualifier,
Category category, Date date, String extra) {
=======
private byte[] getQualifier(ColumnQualifier qualifier, Category category,
Date date, String extra) {
>>>>>>>
private byte[] getQualifier(ColumnQualifier qualifier, Category category,
Date date, String extra) {
<<<<<<<
public ShortUrlStatistics getDailyStatistics(ShortUrl shortUrl,
int maxValues) throws IOException {
=======
public ShortUrlStatistics getDailyStatistics(ShortUrl shortUrl, int maxValues)
throws IOException {
>>>>>>>
public ShortUrlStatistics getDailyStatistics(ShortUrl shortUrl,
int maxValues) throws IOException {
<<<<<<<
// get short Id usage data
byte[] rowKey = Bytes.add(Bytes.toBytes(shortUrl.getUser()),
ResourceManager.ZERO, Bytes.toBytes(shortUrl.getId()));
Get get = new Get(rowKey);
=======
// get short Id to URL mapping
ShortUrl newShortUrl = manager.getUrlManager().getShortUrl(
shortUrl.getId());
// load that user statistics
byte[] rowKey = Bytes.add(Bytes.toBytes(newShortUrl.getUser()), ZERO,
Bytes.toBytes(newShortUrl.getId()));
Get get = new Get(rowKey);
>>>>>>>
// get short Id usage data
byte[] rowKey = Bytes.add(Bytes.toBytes(shortUrl.getUser()),
ResourceManager.ZERO, Bytes.toBytes(shortUrl.getId()));
Get get = new Get(rowKey);
<<<<<<<
maxValue = Math.max(maxValue, clickCount);
try {
clicks.put(
ColumnQualifier.Day.parseDate(Bytes.toString(entry.getKey())),
new Double(clickCount));
} catch (ParseException e) {
throw new IOException(e);
=======
switch (category) {
case CLICK:
maxValue = Math.max(maxValue, clickCount);
try {
clicks.add(
new Counter<Date, Double>(ColumnQualifier.DAY.parseDate(kp[0]),
new Double(clickCount), Counter.Sort.KeyDesc));
} catch (ParseException e) {
throw new IOException(e);
}
break;
case COUNTRY:
Counter<String, Long> countryCount = clicksByCountry.get(kp[2]);
if (countryCount == null) {
countryCount = new Counter<String, Long>(kp[2],
Math.round(clickCount), Counter.Sort.ValueDesc);
} else {
countryCount.setValue(new Long(
Math.round(clickCount) + countryCount.getValue().longValue()));
}
clicksByCountry.put(kp[2], countryCount);
>>>>>>>
switch (category) {
case CLICK:
maxValue = Math.max(maxValue, clickCount);
try {
clicks.add(new Counter<Date, Double>(
ColumnQualifier.DAY.parseDate(kp[0]), new Double(clickCount),
Counter.Sort.KeyDesc));
} catch (ParseException e) {
throw new IOException(e);
}
break;
case COUNTRY:
Counter<String, Long> countryCount = clicksByCountry.get(kp[2]);
if (countryCount == null) {
countryCount = new Counter<String, Long>(kp[2],
Math.round(clickCount), Counter.Sort.ValueDesc);
} else {
countryCount.setValue(new Long(Math.round(clickCount)
+ countryCount.getValue().longValue()));
}
clicksByCountry.put(kp[2], countryCount);
<<<<<<<
private NavigableMap<Date, Double> normalizeData(
Map<Date, Double> data, double normalize, double maxValue) {
NavigableMap<Date, Double> norms = new TreeMap<Date, Double>(
new ReverseDateComparator());
for (Map.Entry<Date, Double> entry : data.entrySet()) {
norms.put(entry.getKey(), new Double(entry.getValue() * normalize
/ maxValue));
=======
private void normalizeData(Set<Counter<Date, Double>> data, double normalize,
double maxValue) {
for (Counter<Date, Double> counter : data) {
counter.setValue(
new Double(counter.getValue().doubleValue() * normalize / maxValue));
>>>>>>>
private void normalizeData(Set<Counter<Date, Double>> data,
double normalize, double maxValue) {
for (Counter<Date, Double> counter : data) {
counter.setValue(new Double(counter.getValue().doubleValue()
* normalize / maxValue)); |
<<<<<<<
=======
import com.hbasebook.hush.servlet.security.HBaseLoginService;
>>>>>>>
<<<<<<<
import com.hbasebook.hush.servlet.security.HBaseLoginService;
=======
>>>>>>>
import com.hbasebook.hush.servlet.security.HBaseLoginService; |
<<<<<<<
// additionalScope, not @Profiled, see concrete aspect in aop.xml
profiledObject.simpleTestUnprofiled(50);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[simpleTestUnprofiled]") >= 0);
// false assertion - this method should not be advised/logged, see aop.xml
profiledObject.simpleTestUnprofiledNotAdvised(50);
assertFalse("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[simpleTestUnprofiledNotAdvised]") >= 0);
=======
profiledObject.simpleTestDefaultTagMessageFromProperties(5);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[customTag]") >= 0);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("message[customMessage]") >= 0);
profiledObject.simpleTestDefaultTagMessageFromPropertiesJexl(5);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[org.perf4j.aop.ProfiledObject#simpleTestDefaultTagMessageFromPropertiesJexl]") >= 0);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("message[simpleTestDefaultTagMessageFromPropertiesJexl(5)]") >= 0);
>>>>>>>
// additionalScope, not @Profiled, see concrete aspect in aop.xml
profiledObject.simpleTestUnprofiled(50);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[simpleTestUnprofiled]") >= 0);
// false assertion - this method should not be advised/logged, see aop.xml
profiledObject.simpleTestUnprofiledNotAdvised(50);
assertFalse("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[simpleTestUnprofiledNotAdvised]") >= 0);
profiledObject.simpleTestDefaultTagMessageFromProperties(5);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[customTag]") >= 0);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("message[customMessage]") >= 0);
profiledObject.simpleTestDefaultTagMessageFromPropertiesJexl(5);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("tag[org.perf4j.aop.ProfiledObject#simpleTestDefaultTagMessageFromPropertiesJexl]") >= 0);
assertTrue("Expected tag not found in " + InMemoryTimingAspect.getLastLoggedString(),
InMemoryTimingAspect.getLastLoggedString().indexOf("message[simpleTestDefaultTagMessageFromPropertiesJexl(5)]") >= 0); |
<<<<<<<
final SizeEstimator sizeEstimator;
private volatile long heapCost;
=======
final AtomicBoolean loaded = new AtomicBoolean(false);
>>>>>>>
final SizeEstimator sizeEstimator;
private volatile long heapCost;
final AtomicBoolean loaded = new AtomicBoolean(false);
<<<<<<<
lockService.createLockStore(partitionContainer.getPartitionId(), new DefaultObjectNamespace(MapService.SERVICE_NAME, name));
this.sizeEstimator = SizeEstimators.createMapSizeEstimator();
=======
lockService.createLockStore(partitionId, new DefaultObjectNamespace(MapService.SERVICE_NAME, name));
if (nodeEngine.getThisAddress().equals(nodeEngine.getPartitionService().getPartitionOwner(partitionId))) {
if (mapContainer.getStore() != null && !loaded.get()) {
Map<Data, Object> loadedKeys = mapContainer.getInitialKeys();
if (loadedKeys != null && !loadedKeys.isEmpty()) {
Map<Data, Object> partitionKeys = new HashMap<Data, Object>();
Iterator<Data> iterator = loadedKeys.keySet().iterator();
while(iterator.hasNext()) {
Data data = iterator.next();
if (partitionId == nodeEngine.getPartitionService().getPartitionId(data)) {
partitionKeys.put(data, loadedKeys.get(data));
iterator.remove();
}
}
try {
nodeEngine.getExecutionService().submit("hz:map-load", new MapLoadAllTask(partitionKeys));
} catch (Throwable t) {
ExceptionUtil.rethrow(t);
}
} else {
loaded.set(true);
}
}
} else {
loaded.set(true);
}
}
public boolean isLoaded() {
return loaded.get();
}
public void setLoaded(boolean isLoaded) {
loaded.set(isLoaded);
}
private void checkIfLoaded() {
if (mapContainer.getStore() != null && !loaded.get()) {
ExceptionUtil.rethrow(new RetryableHazelcastException("Map is not ready!!!"));
}
>>>>>>>
lockService.createLockStore(partitionId, new DefaultObjectNamespace(MapService.SERVICE_NAME, name));
this.sizeEstimator = SizeEstimators.createMapSizeEstimator();
if (nodeEngine.getThisAddress().equals(nodeEngine.getPartitionService().getPartitionOwner(partitionId))) {
if (mapContainer.getStore() != null && !loaded.get()) {
Map<Data, Object> loadedKeys = mapContainer.getInitialKeys();
if (loadedKeys != null && !loadedKeys.isEmpty()) {
Map<Data, Object> partitionKeys = new HashMap<Data, Object>();
Iterator<Data> iterator = loadedKeys.keySet().iterator();
while(iterator.hasNext()) {
Data data = iterator.next();
if (partitionId == nodeEngine.getPartitionService().getPartitionId(data)) {
partitionKeys.put(data, loadedKeys.get(data));
iterator.remove();
}
}
try {
nodeEngine.getExecutionService().submit("hz:map-load", new MapLoadAllTask(partitionKeys));
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
} else {
loaded.set(true);
}
}
} else {
loaded.set(true);
}
}
public boolean isLoaded() {
return loaded.get();
}
public void setLoaded(boolean isLoaded) {
loaded.set(isLoaded);
}
private void checkIfLoaded() {
if (mapContainer.getStore() != null && !loaded.get()) {
throw ExceptionUtil.rethrow(new RetryableHazelcastException("Map is not ready!!!"));
}
<<<<<<<
updateSizeEstimator(calculateRecordSize(record));
=======
updateSizeEstimator(calculateRecordSize(record));
updateTtl(record, ttl);
}
saveIndex(record);
}
public void putFromLoad(Data dataKey, Object value, long ttl) {
Record record = records.get(dataKey);
if (record == null) {
value = mapService.interceptPut(name, null, value);
record = mapService.createRecord(name, dataKey, value, ttl);
records.put(dataKey, record);
updateSizeEstimator(calculateRecordSize(record));
} else {
value = mapService.interceptPut(name, record.getValue(), value);
updateSizeEstimator(-calculateRecordSize(record));
setRecordValue(record, value);
updateSizeEstimator(calculateRecordSize(record));
>>>>>>>
updateSizeEstimator(calculateRecordSize(record));
updateTtl(record, ttl);
}
saveIndex(record);
}
public void putFromLoad(Data dataKey, Object value, long ttl) {
Record record = records.get(dataKey);
if (record == null) {
value = mapService.interceptPut(name, null, value);
record = mapService.createRecord(name, dataKey, value, ttl);
records.put(dataKey, record);
updateSizeEstimator(calculateRecordSize(record));
} else {
value = mapService.interceptPut(name, record.getValue(), value);
updateSizeEstimator(-calculateRecordSize(record));
setRecordValue(record, value);
updateSizeEstimator(calculateRecordSize(record)); |
<<<<<<<
JButton exportDirButton;
=======
private JButton exportDirChooseButton;
>>>>>>>
protected JButton exportDirChooseButton;
<<<<<<<
JButton pemFileChooseButton;
JButton pemFileClearButton;
=======
private JButton pemFileChooseButton;
private JButton pemFileClearButton;
private JPanel exportDirButtons;
private JButton exportDirCleanButton;
>>>>>>>
protected JButton pemFileChooseButton;
protected JButton pemFileClearButton;
private JPanel exportDirButtons;
private JButton exportDirCleanButton;
<<<<<<<
ConfigurationPanelForm() {
startDatePicker = createDatePicker();
endDatePicker = createDatePicker();
=======
ConfigurationPanelForm(boolean clearableExportDir) {
this.clearableExportDir = clearableExportDir;
startDateField = createDatePicker();
endDateField = createDatePicker();
>>>>>>>
ConfigurationPanelForm(boolean clearableExportDir) {
this.clearableExportDir = clearableExportDir;
startDatePicker = createDatePicker();
endDatePicker = createDatePicker();
<<<<<<<
showError("Invalid date range: \"From\" date must be before \"To\" date.", "Export configuration error");
startDatePicker.clear();
=======
showError(MessageStrings.INVALID_DATE_RANGE_MESSAGE, "Export configuration error");
startDateField.clear();
>>>>>>>
showError(MessageStrings.INVALID_DATE_RANGE_MESSAGE, "Export configuration error");
startDatePicker.clear();
<<<<<<<
showError("Invalid date range: \"From\" date must be before \"To\" date.", "Export configuration error");
endDatePicker.clear();
=======
showError(MessageStrings.INVALID_DATE_RANGE_MESSAGE, "Export configuration error");
endDateField.clear();
>>>>>>>
showError(MessageStrings.INVALID_DATE_RANGE_MESSAGE, "Export configuration error");
endDatePicker.clear();
<<<<<<<
container.add(endDatePicker, gbc);
exportDirButton = new JButton();
exportDirButton.setText("Choose...");
gbc = new GridBagConstraints();
gbc.gridx = 3;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
container.add(exportDirButton, gbc);
=======
container.add(endDateField, gbc);
>>>>>>>
container.add(endDatePicker, gbc); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.