Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sleepiq] Removed Jersey dependencies #7562

Merged
merged 1 commit into from
May 7, 2020
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
6 changes: 4 additions & 2 deletions bundles/org.openhab.binding.sleepiq/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<classpathentry kind="src" path="src/3rdparty/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/3rdparty/test">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
Expand Down
9 changes: 4 additions & 5 deletions bundles/org.openhab.binding.sleepiq/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ https://github.com/openhab/openhab-addons

== Third-party Content

libsleepiq-java
The sources of libsleepiq-java are included in src/3rdparty/java and have been slightly adapted.
* License: Apache 2.0 License
* Project: https://github.com/syphr42/libsleepiq-java
* Source: https://github.com/syphr42/libsleepiq-java

provider-gson
* License: EPL 1.0 License
* Project: https://github.com/hstaudacher/osgi-jax-rs-connector
* Source: https://github.com/hstaudacher/osgi-jax-rs-connector
This binding includes a class from Jersey in the src/3rdparty/java folder.
* License: CDDL License
* Project: https://eclipse-ee4j.github.io/jersey/
48 changes: 38 additions & 10 deletions bundles/org.openhab.binding.sleepiq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,45 @@

<dependencies>
<dependency>
<groupId>org.syphr</groupId>
<artifactId>sleepiq-api</artifactId>
<version>0.3.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.eclipsesource.jaxrs</groupId>
<artifactId>provider-gson</artifactId>
<version>2.3</version>
<scope>compile</scope>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>add-source</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<sources>
<source>src/3rdparty/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-test-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/3rdparty/test</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2017 Gregory Moyer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openhab.binding.sleepiq.api;

import org.openhab.binding.sleepiq.api.model.Failure;

public class BedNotFoundException extends SleepIQException
{
private static final long serialVersionUID = 1L;

public BedNotFoundException(Failure failure)
{
super(failure);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/*
* Copyright 2017 Gregory Moyer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openhab.binding.sleepiq.api;

import java.net.URI;
import java.util.logging.Level;

/**
* This class represents configuration parameters for using {@link SleepIQ}.
*
* @author Gregory Moyer
*/
public class Configuration
{
private String username;
private String password;

private URI baseUri = URI.create("https://api.sleepiq.sleepnumber.com/rest");

private boolean logging = false;

/**
* Get the username on the account.
*
* @return the username
*/
public String getUsername()
{
return username;
}

/**
* Set the username on the account. This should be the username used to
* register with SleepIQ.
*
* @param username
* the value to set
*/
public void setUsername(String username)
{
this.username = username;
}

/**
* Set the username on the account. This should be the username used to
* register with SleepIQ.
*
* @param username
* the value to set
* @return this configuration instance
*/
public Configuration withUsername(String username)
{
setUsername(username);
return this;
}

/**
* Get the password on the account.
*
* @return the password
*/
public String getPassword()
{
return password;
}

/**
* Set the password on the account. This should be the password used to
* register with SleepIQ.
*
* @param password
* the value to set
*/
public void setPassword(String password)
{
this.password = password;
}

/**
* Set the password on the account. This should be the password used to
* register with SleepIQ.
*
* @param password
* the value to set
* @return this configuration instance
*/
public Configuration withPassword(String password)
{
setPassword(password);
return this;
}

/**
* Get the base URI of the SleepIQ cloud service.
*
* @return the base URI
*/
public URI getBaseUri()
{
return baseUri;
}

/**
* Set the base URI of the SleepIQ cloud service. It is unlikely that this
* will need to be changed from its default value.
*
* @param baseUri
* the value to set
*/
public void setBaseUri(URI baseUri)
{
this.baseUri = baseUri;
}

/**
* Set the base URI of the SleepIQ cloud service. It is unlikely that this
* will need to be changed from its default value.
*
* @param baseUri
* the value to set
* @return this configuration instance
*/
public Configuration withBaseUri(URI baseUri)
{
setBaseUri(baseUri);
return this;
}

/**
* Get the logging flag.
*
* @return the logging flag
*/
public boolean isLogging()
{
return logging;
}

/**
* Set the logging flag. When this is set to <code>true</code>, all requests
* and responses will be logged at the {@link Level#INFO} level. <b>This
* includes usernames and passwords!</b>
*
* @param logging
* the value to set
*/
public void setLogging(boolean logging)
{
this.logging = logging;
}

/**
* Set the logging flag. When this is set to <code>true</code>, all requests
* and responses will be logged at the {@link Level#INFO} level. <b>This
* includes usernames and passwords!</b>
*
* @param logging
* the value to set
* @return this configuration instance
*/
public Configuration withLogging(boolean logging)
{
setLogging(logging);
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2017 Gregory Moyer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openhab.binding.sleepiq.api;

import org.openhab.binding.sleepiq.api.model.Failure;

public class LoginException extends SleepIQException
{
private static final long serialVersionUID = 1L;

public LoginException(Failure failure)
{
super(failure);
}
}
Loading