diff options
author | BrettyWhite <geekman3454@protonmail.com> | 2019-07-12 13:40:51 -0400 |
---|---|---|
committer | BrettyWhite <geekman3454@protonmail.com> | 2019-07-12 13:40:51 -0400 |
commit | 7fe807f4421053f6e62ea6694dc842990f7f8407 (patch) | |
tree | 49a622e12ea3d5b94e245e1b373a6bf8a4d8e48c | |
parent | 2d19c039710b3d47802cea4afe07c5e2caf94d85 (diff) | |
download | sdl_android-7fe807f4421053f6e62ea6694dc842990f7f8407.tar.gz |
add in RPCs, still need tests
3 files changed, 189 insertions, 31 deletions
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java index e2e28f72c..a7678f29e 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java +++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.protocol.enums;
import java.util.EnumSet;
@@ -100,6 +100,7 @@ public enum FunctionID{ GET_APP_SERVICE_DATA(53, "GetAppServiceData"),
GET_FILE(54, "GetFile"),
PERFORM_APP_SERVICES_INTERACTION(55, "PerformAppServiceInteraction"),
+ UNPUBLISH_APP_SERVICE(56, "UnpublishAppService"),
CLOSE_APPLICATION(58, "CloseApplication"),
// NOTIFICATIONS
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java new file mode 100644 index 000000000..cfff223a9 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2019 Livio, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Livio Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Created by brettywhite on 7/12/19 11:36 AM + * + */ + +package com.smartdevicelink.proxy.rpc; + +import android.support.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCRequest; + +import java.util.Hashtable; + +/** + * Unpublish an existing service published by this application. + */ +public class UnpublishAppService extends RPCRequest { + + public static final String KEY_SERVICE_ID = "serviceID"; + + /** + * Constructs a new UnpublishAppService object + */ + public UnpublishAppService() { + super(FunctionID.UNPUBLISH_APP_SERVICE.toString()); + } + + /** + * Constructs a new UnpublishAppService object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public UnpublishAppService(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new UnpublishAppService object with the required serviceID + * @param serviceID - set the service ID for the service to be unpublished + */ + public UnpublishAppService(@NonNull String serviceID){ + this(); + setServiceID(serviceID); + } + + // SETTERS AND GETTERS + + /** + * The ID of the service to be unpublished. + * @param serviceID - set the service ID for the service to be unpublished + */ + public void setServiceID(String serviceID){ + setValue(KEY_SERVICE_ID, serviceID); + } + + /** + * The ID of the service to be unpublished. + * @return - get the service ID for the service to be unpublished + */ + public String getServiceID(){ + return getString(KEY_SERVICE_ID); + } + +}
\ No newline at end of file diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java new file mode 100644 index 000000000..06f2f13ae --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppServiceResponse.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019 Livio, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Livio Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Created by brettywhite on 7/12/19 11:37 AM + * + */ + +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCResponse; + +import java.util.Hashtable; + +/** + * The response to UnpublishAppService + */ +public class UnpublishAppServiceResponse extends RPCResponse { + /** + * Constructs a new UnpublishAppServiceResponse object + */ + public UnpublishAppServiceResponse() { + super(FunctionID.UNPUBLISH_APP_SERVICE.toString()); + } + + /** + * Constructs a new UnpublishAppServiceResponse object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public UnpublishAppServiceResponse(Hashtable<String, Object> hash) { + super(hash); + } +} |