Skip to content
This repository was archived by the owner on Sep 16, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ public interface SymphonyClient {
*/
ShareClient getShareClient();

/**
* Provides instance of the Signals client. This client supports the management of signals.
*
* @return {@link SignalsClient}
*/
SignalsClient getSignalsClient();

/**
* If set, returns the custom http client set during initialization.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
*
*
* Copyright 2018 The Symphony Software Foundation
*
* Licensed to The Symphony Software Foundation (SSF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.symphonyoss.client.exceptions;

/**
* @author dovkatz on 03/13/2018
*/
public class SignalsException extends SymException {
@SuppressWarnings("unused")
public SignalsException(String message) {
super(message);
}

@SuppressWarnings("unused")
public SignalsException(Throwable cause) {
super(cause);
}

public SignalsException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class SymphonyBasicClient implements SymphonyClient {
private UsersClient usersClient;
private StreamsClient streamsClient;
private PresenceClient presenceClient;
private SignalsClient signalsClient;
private RoomMembershipClient roomMembershipClient;
private AttachmentsClient attachmentsClient;
private ConnectionsClient connectionsClient;
Expand Down Expand Up @@ -285,6 +286,7 @@ public void init(SymAuth symAuth, SymphonyClientConfig config) throws InitExcept
dataFeedClient = DataFeedFactory.getClient(this);
messagesClient = MessagesFactory.getClient(this);
presenceClient = PresenceFactory.getClient(this);
signalsClient = SignalsFactory.getClient(this);
streamsClient = StreamsFactory.getClient(this);
usersClient = UsersFactory.getClient(this);
shareClient = ShareFactory.getClient(this);
Expand Down Expand Up @@ -461,6 +463,10 @@ public ShareClient getShareClient() {
return shareClient;
}

@Override
public SignalsClient getSignalsClient() {
return signalsClient;
}
/**
* Provides the default http client if one is set.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
*
*
* Copyright 2018 The Symphony Software Foundation
*
* Licensed to The Symphony Software Foundation (SSF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

package org.symphonyoss.symphony.clients;


import java.math.BigDecimal;
import java.util.List;

import org.symphonyoss.client.exceptions.SignalsException;
import org.symphonyoss.symphony.agent.model.ChannelSubscriptionResponse;
import org.symphonyoss.symphony.clients.model.SymChannelSubscriberResponse;
import org.symphonyoss.symphony.clients.model.SymSignal;

/**
* @author dovkatz on 03/13/2018
*/
public interface SignalsClient {

public SymSignal createSignal(SymSignal signal) throws SignalsException;

public SymSignal updateSignal(String id, SymSignal signal) throws SignalsException;

public void deleteSignal(String id) throws SignalsException;

public SymSignal getSignal(String id) throws SignalsException;

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

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

public ChannelSubscriptionResponse subscribe(String id) throws SignalsException;

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

public ChannelSubscriptionResponse unsubscribe(String id) throws SignalsException;

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
*
* Copyright 20168 The Symphony Software Foundation
*
* Licensed to The Symphony Software Foundation (SSF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.symphonyoss.symphony.clients;

import org.symphonyoss.client.SymphonyClient;
import org.symphonyoss.client.SymphonyClientConfig;
import org.symphonyoss.client.model.SymAuth;
import org.symphonyoss.symphony.clients.impl.SignalsClientImpl;

/**
* @author dovkatz on 3/13/2018
*/
public class SignalsFactory {

public static SignalsClient getClient(SymphonyClient symClient){

return new SignalsClientImpl(symClient.getSymAuth(),symClient.getConfig(), symClient.getAgentHttpClient());

}

public static SignalsClient getClient(SymAuth symAuth, SymphonyClientConfig config){

return new SignalsClientImpl(symAuth, config);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.symphonyoss.symphony.agent.api.DatafeedApi;
import org.symphonyoss.symphony.agent.api.MessagesApi;
import org.symphonyoss.symphony.agent.api.ShareApi;
import org.symphonyoss.symphony.agent.api.SignalsApi;
import org.symphonyoss.symphony.pod.api.*;

/**
Expand Down Expand Up @@ -71,4 +72,6 @@ public interface SymphonyApis {
SecurityApi getSecurityApi();

SessionApi getSessionApi();

SignalsApi getSignalsApi();
}
Loading