Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Upgrading SJC to 1.52 spec and fixed Signals clients and objects to r…
Browse files Browse the repository at this point in the history
…eflect changes.
  • Loading branch information
ftbb committed May 22, 2018
1 parent d0d83e3 commit 2c32705
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 49 deletions.
2 changes: 1 addition & 1 deletion symphony-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<properties>
<jsoup-version>1.11.2</jsoup-version>
<symphony-api-version>1.50.1</symphony-api-version>
<symphony-api-version>1.51.0-SNAPSHOT</symphony-api-version>
<gson-version>2.8.2</gson-version>
<org-javassist>3.22.0-GA</org-javassist>
<failsafe.jvm.args>-Dlog4j.configurationFile=src/test/resources/log4j.properties -Xmx1024m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ private void updateMentionUidToEmail(SymphonyClient symClient, List<Node> nodesL
}

}
updateMentionUidToEmail(symClient, node.childNodes());

if(node.childNodeSize() > 0)
updateMentionUidToEmail(symClient, node.childNodes());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public interface SignalsClient {

public List<SymSignal> listSignals(int skip, int limit) throws SignalsException;

public SymChannelSubscriberResponse listSubscribers(String id, BigDecimal skip, BigDecimal limit) throws SignalsException;
public SymChannelSubscriberResponse listSubscribers(String id, Integer skip, Integer limit) throws SignalsException;

public ChannelSubscriptionResponse subscribe(String id) throws SignalsException;

public ChannelSubscriptionResponse bulkSubscribe(String id, boolean pushed, List<BigDecimal> userIds) throws SignalsException;
public ChannelSubscriptionResponse bulkSubscribe(String id, boolean pushed, List<Long> userIds) throws SignalsException;

public ChannelSubscriptionResponse unsubscribe(String id) throws SignalsException;

public ChannelSubscriptionResponse bulkUnsubscribe(String id, List<BigDecimal> userIds) throws SignalsException;
public ChannelSubscriptionResponse bulkUnsubscribe(String id, List<Long> userIds) throws SignalsException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public List<SymSignal> listSignals(int skip, int limit) throws SignalsException
*
*/
@Override
public SymChannelSubscriberResponse listSubscribers(String id, BigDecimal skip, BigDecimal limit)
public SymChannelSubscriberResponse listSubscribers(String id, Integer skip, Integer limit)
throws SignalsException {
SignalsApi api = createSignalsApi();
try {
Expand Down Expand Up @@ -275,7 +275,7 @@ public ChannelSubscriptionResponse subscribe(String id) throws SignalsException
*
*/
@Override
public ChannelSubscriptionResponse bulkSubscribe(String id, boolean pushed, List<BigDecimal> userIds)
public ChannelSubscriptionResponse bulkSubscribe(String id, boolean pushed, List<Long> userIds)
throws SignalsException {
SignalsApi api = createSignalsApi();
try {
Expand Down Expand Up @@ -320,8 +320,8 @@ public ChannelSubscriptionResponse unsubscribe(String id) throws SignalsExceptio
*
*/
@Override
public ChannelSubscriptionResponse bulkUnsubscribe(String id, List<BigDecimal> userIds) throws SignalsException {
SignalsApi api = createSignalsApi();
public ChannelSubscriptionResponse bulkUnsubscribe(String id, List<Long> userIds) throws SignalsException {
SignalsApi api = new SignalsApi(apiClient);
try {
return api.v1SignalsIdUnsubscribePost(symAuth.getSessionToken().getToken(), id,
symAuth.getKeyToken().getToken(), userIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public SymStream getStream(UserIdList userIdList) throws StreamsException {
}

StreamsApi streamsApi = new StreamsApi(apiClient);

try {
return SymStream.toSymStream(streamsApi.v1ImCreatePost(userIdList, symAuth.getSessionToken().getToken()));
} catch (ApiException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ private static SymAdminStreamInfo toStreamInfo(AdminStreamInfo adminStreamInfo)

SymAdminStreamInfo symAdminStreamInfo = new SymAdminStreamInfo();
symAdminStreamInfo.setId(adminStreamInfo.getId());
symAdminStreamInfo.setIsActive(adminStreamInfo.getIsActive());
symAdminStreamInfo.setIsExternal(adminStreamInfo.getIsExternal());
symAdminStreamInfo.setIsPublic(adminStreamInfo.getIsPublic());
symAdminStreamInfo.setIsActive(adminStreamInfo.isIsActive());
symAdminStreamInfo.setIsExternal(adminStreamInfo.isIsExternal());
symAdminStreamInfo.setIsPublic(adminStreamInfo.isIsPublic());
symAdminStreamInfo.setType(adminStreamInfo.getType());
symAdminStreamInfo.setAttributes(SymAdminStreamAttributes.toAdminStreamAttributes(adminStreamInfo.getAttributes()));
return symAdminStreamInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public static SymAgentHealthCheck toSymAgentHealthCheck(V2HealthCheckResponse v2

symAgentHealthCheck.setAgentVersion(v2HealthCheckResponse.getAgentVersion());
symAgentHealthCheck.setEncryptDecryptError(v2HealthCheckResponse.getEncryptDecryptError());
symAgentHealthCheck.setEncryptDecryptSuccess(v2HealthCheckResponse.getEncryptDecryptSuccess());
symAgentHealthCheck.setKeyManagerConnectivity(v2HealthCheckResponse.getKeyManagerConnectivity());
symAgentHealthCheck.setEncryptDecryptSuccess(v2HealthCheckResponse.isEncryptDecryptSuccess());
symAgentHealthCheck.setKeyManagerConnectivity(v2HealthCheckResponse.isKeyManagerConnectivity());
symAgentHealthCheck.setKeyManagerConnectivityError(v2HealthCheckResponse.getKeyManagerConnectivityError());
symAgentHealthCheck.setPodConnectivity(v2HealthCheckResponse.getPodConnectivity());
symAgentHealthCheck.setPodConnectivity(v2HealthCheckResponse.isPodConnectivity());
symAgentHealthCheck.setPodConnectivityError(v2HealthCheckResponse.getPodConnectivityError());
symAgentHealthCheck.setPodVersion(v2HealthCheckResponse.getPodVersion());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public static ChannelSubscriber toChannelSubscriber(SymChannelSubscriber symSub)

public static SymChannelSubscriber toSymChannelSubscriber(ChannelSubscriber sub) {
SymChannelSubscriber symSub=new SymChannelSubscriber();
symSub.setOwner(sub.getOwner());
symSub.setPushed(sub.getPushed());
symSub.setOwner(sub.isOwner());
symSub.setPushed(sub.isPushed());
symSub.setSubscriberName(sub.getSubscriberName());
symSub.setUserId(sub.getUserId());
symSub.setTimestamp(sub.getTimestamp());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void setHasMore(Boolean hasMore) {

public static SymChannelSubscriberResponse toSymChannelSubscriberResponse(ChannelSubscriberResponse response) {
SymChannelSubscriberResponse symResponse=new SymChannelSubscriberResponse();
symResponse.setHasMore(response.getHasMore());
symResponse.setHasMore(response.isHasMore());
symResponse.setTotal(response.getTotal());
symResponse.setOffset(response.getOffset());
List<SymChannelSubscriber> list=new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static List<Feature> toFeatures(SymFeatureList symFeatures) {
private static SymFeature toSymFeature(Feature feature) {
SymFeature symFeature = new SymFeature();
symFeature.setEntitlement(feature.getEntitlment());
symFeature.setEnabled(feature.getEnabled());
symFeature.setEnabled(feature.isEnabled());
return symFeature;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public class SymMessage {

private ApiVersion apiVersion = null;

private String userAgent = null;

private String originalFormat = null;


public SymUser getSymUser() {
return symUser;
}
Expand Down Expand Up @@ -177,6 +182,21 @@ public void setAttachementThumbnail(File attachementThumbnail) {
this.attachementThumbnail = attachementThumbnail;
}

public String getUserAgent() {
return userAgent;
}

public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}

public String getOriginalFormat() {
return originalFormat;
}

public void setOriginalFormat(String originalFormat) {
this.originalFormat = originalFormat;
}

public ApiVersion getApiVersion() {

Expand Down Expand Up @@ -221,6 +241,8 @@ public static SymMessage toSymMessage(V4Message v4Message) {
symMessage.setSymUser(SymUser.toSymUser(v4Message.getUser()));
symMessage.setMessage(v4Message.getMessage());
symMessage.setStream(SymStream.toSymStream(v4Message.getStream()));
symMessage.setUserAgent(v4Message.getUserAgent());
symMessage.setOriginalFormat(v4Message.getOriginalFormat());

if (v4Message.getAttachments() != null)
symMessage.setAttachments(SymAttachmentInfo.toAttachmentsInfos(v4Message.getAttachments()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ public void setMultiLateralRoom(Boolean multiLateralRoom) {
public static SymRoomAttributes toSymRoomAttributes(V2RoomAttributes roomAttributes) {

SymRoomAttributes symRoomAttributes = new SymRoomAttributes();
symRoomAttributes.setPublic(roomAttributes.getPublic());
symRoomAttributes.setCopyProtected(roomAttributes.getCopyProtected());
symRoomAttributes.setPublic(roomAttributes.isPublic());
symRoomAttributes.setCopyProtected(roomAttributes.isCopyProtected());
symRoomAttributes.setDescription(roomAttributes.getDescription());
symRoomAttributes.setDiscoverable(roomAttributes.getDiscoverable());
symRoomAttributes.setDiscoverable(roomAttributes.isDiscoverable());
symRoomAttributes.setKeywords(SymRoomTag.toSymRoomTagsV2(roomAttributes.getKeywords()));
symRoomAttributes.setMembersCanInvite(roomAttributes.getMembersCanInvite());
symRoomAttributes.setMembersCanInvite(roomAttributes.isMembersCanInvite());
symRoomAttributes.setName(roomAttributes.getName());
symRoomAttributes.setReadOnly(roomAttributes.getReadOnly());
symRoomAttributes.setReadOnly(roomAttributes.isReadOnly());
symRoomAttributes.setKeywords(SymRoomTag.toSymRoomTagsV2(roomAttributes.getKeywords()));

return symRoomAttributes;
Expand All @@ -197,18 +197,18 @@ public static V2RoomAttributes toV2RoomAttributes(SymRoomAttributes roomAttribut
public static SymRoomAttributes toSymRoomAttributes(V3RoomAttributes roomAttributes) {

SymRoomAttributes symRoomAttributes = new SymRoomAttributes();
symRoomAttributes.setPublic(roomAttributes.getPublic());
symRoomAttributes.setCopyProtected(roomAttributes.getCopyProtected());
symRoomAttributes.setPublic(roomAttributes.isPublic());
symRoomAttributes.setCopyProtected(roomAttributes.isCopyProtected());
symRoomAttributes.setDescription(roomAttributes.getDescription());
symRoomAttributes.setDiscoverable(roomAttributes.getDiscoverable());
symRoomAttributes.setDiscoverable(roomAttributes.isDiscoverable());
symRoomAttributes.setKeywords(SymRoomTag.toSymRoomTagsV2(roomAttributes.getKeywords()));
symRoomAttributes.setMembersCanInvite(roomAttributes.getMembersCanInvite());
symRoomAttributes.setMembersCanInvite(roomAttributes.isMembersCanInvite());
symRoomAttributes.setName(roomAttributes.getName());
symRoomAttributes.setReadOnly(roomAttributes.getReadOnly());
symRoomAttributes.setCrossPod(roomAttributes.getCrossPod());
symRoomAttributes.setViewHistory(roomAttributes.getViewHistory());
if (roomAttributes.getMultiLateralRoom() != null)
symRoomAttributes.setMultiLateralRoom(roomAttributes.getMultiLateralRoom());
symRoomAttributes.setReadOnly(roomAttributes.isReadOnly());
symRoomAttributes.setCrossPod(roomAttributes.isCrossPod());
symRoomAttributes.setViewHistory(roomAttributes.isViewHistory());
if (roomAttributes.isMultiLateralRoom() != null)
symRoomAttributes.setMultiLateralRoom(roomAttributes.isMultiLateralRoom());

return symRoomAttributes;
}
Expand Down Expand Up @@ -237,15 +237,15 @@ public static SymRoomAttributes toSymRoomAttributes(V4RoomProperties roomPropert


SymRoomAttributes symRoomAttributes = new SymRoomAttributes();
symRoomAttributes.setPublic(roomProperties.getPublic());
symRoomAttributes.setCopyProtected(roomProperties.getCopyProtected());
symRoomAttributes.setPublic(roomProperties.isPublic());
symRoomAttributes.setCopyProtected(roomProperties.isCopyProtected());
symRoomAttributes.setDescription(roomProperties.getDescription());
symRoomAttributes.setDiscoverable(roomProperties.getDiscoverable());
symRoomAttributes.setDiscoverable(roomProperties.isDiscoverable());
//Seems like keywords is missing
symRoomAttributes.setKeywords(SymRoomTag.toSymRoomTags(roomProperties.getKeywords()));
symRoomAttributes.setMembersCanInvite(roomProperties.getMembersCanInvite());
symRoomAttributes.setMembersCanInvite(roomProperties.isMembersCanInvite());
symRoomAttributes.setName(roomProperties.getName());
symRoomAttributes.setReadOnly(roomProperties.getReadOnly());
symRoomAttributes.setReadOnly(roomProperties.isReadOnly());
symRoomAttributes.setCreatorUser(SymUser.toSymUser(roomProperties.getCreatorUser()));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setActive(Boolean active) {
public static SymRoomSystemInfo toSymRoomSystemInfo(RoomSystemInfo roomSystemInfo){

SymRoomSystemInfo symRoomSystemInfo = new SymRoomSystemInfo();
symRoomSystemInfo.setActive(roomSystemInfo.getActive());
symRoomSystemInfo.setActive(roomSystemInfo.isActive());
symRoomSystemInfo.setCreatedByUserId(roomSystemInfo.getCreatedByUserId());
symRoomSystemInfo.setCreationDate(roomSystemInfo.getCreationDate());
symRoomSystemInfo.setId(roomSystemInfo.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ public static Signal toSignal(SymSignal symSignal) {

public static SymSignal toSymSignal(Signal signal) {
SymSignal symSignal=new SymSignal();
symSignal.setCompanyWide(signal.getCompanyWide());
symSignal.setCompanyWide(signal.isCompanyWide());
symSignal.setId(signal.getId());
symSignal.setName(signal.getName());
symSignal.setQuery(signal.getQuery());
symSignal.setVisibleOnProfile(signal.getVisibleOnProfile());
symSignal.setVisibleOnProfile(signal.isVisibleOnProfile());
symSignal.setTimestamp(signal.getTimestamp());
return symSignal;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public String getStreamId() {
return streamId;
}


public void setStreamId(String streamId) {
this.streamId = streamId;
}
Expand Down Expand Up @@ -84,10 +85,17 @@ public void setMembers(List<SymUser> members) {
this.members = members;
}

/**
* @deprecated Replaced by {{@link #isExternal()}}
* @return boolean external
*/
public Boolean getExternal() {
return external;
}


public Boolean isExternal() { return external; }

public void setExternal(Boolean external) {
this.external = external;
}
Expand All @@ -100,7 +108,8 @@ public static SymStream toSymStream(V4Stream stream) {

SymStream symStream = new SymStream();

symStream.setExternal(stream.getExternal());
symStream.setExternal(stream.isExternal());


if(stream.getMembers() != null)
symStream.setMembers(stream.getMembers().stream().map(SymUser::toSymUser).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public void setSymRoomSpecificStreamAttributes(SymRoomSpecificStreamAttributes s
public static SymStreamAttributes toStreamAttributes(StreamAttributes streamAttributes) {

SymStreamAttributes symStreamAttributes = new SymStreamAttributes();
symStreamAttributes.setActive(streamAttributes.getActive());
symStreamAttributes.setCrossPod(streamAttributes.getCrossPod());
symStreamAttributes.setActive(streamAttributes.isActive());
symStreamAttributes.setCrossPod(streamAttributes.isCrossPod());
symStreamAttributes.setId(streamAttributes.getId());

SymRoomSpecificStreamAttributes symRoomSpecificStreamAttributes = new SymRoomSpecificStreamAttributes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static SymStreamFilter toSymStreamFilter(StreamFilter streamFilter) {

SymStreamFilter symStreamFilter = new SymStreamFilter();

symStreamFilter.setIncludeInactiveStreams(streamFilter.getIncludeInactiveStreams());
symStreamFilter.setIncludeInactiveStreams(streamFilter.isIncludeInactiveStreams());

if (streamFilter.getStreamTypes() != null) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public void compareSignalToSymSignal(Signal sig, SymSignal symSig) {
assertEquals(sig.getId(), symSig.getId());
assertEquals(sig.getName(), symSig.getName());
assertEquals(sig.getQuery(), symSig.getQuery());
assertEquals(sig.getCompanyWide(), symSig.getCompanyWide());
assertEquals(sig.getVisibleOnProfile(), symSig.getVisibleOnProfile());
assertEquals(sig.isCompanyWide(), symSig.getCompanyWide());
assertEquals(sig.isVisibleOnProfile(), symSig.getVisibleOnProfile());
}

public void compareBaseSignalToSymSignal(BaseSignal sig, SymSignal symSig) {
assertEquals(sig.getName(), symSig.getName());
assertEquals(sig.getQuery(), symSig.getQuery());
assertEquals(sig.getCompanyWide(), symSig.getCompanyWide());
assertEquals(sig.getVisibleOnProfile(), symSig.getVisibleOnProfile());
assertEquals(sig.isCompanyWide(), symSig.getCompanyWide());
assertEquals(sig.isVisibleOnProfile(), symSig.getVisibleOnProfile());
}

@Test
Expand Down

0 comments on commit 2c32705

Please sign in to comment.