GUAC-932: Get rid of APIConstants.

This commit is contained in:
Michael Jumper
2014-12-15 16:11:43 -08:00
parent 68d3b7741e
commit 4d255e21a1
3 changed files with 8 additions and 41 deletions

View File

@@ -1,37 +0,0 @@
/*
* Copyright (C) 2014 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.glyptodon.guacamole.net.basic.rest;
/**
* Useful constants for the REST API.
*
* @author James Muehlner
*/
public class APIConstants {
/**
* The identifier of the ROOT connection group.
*/
public static final String ROOT_CONNECTION_GROUP_IDENTIFIER = "ROOT";
}

View File

@@ -29,7 +29,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.net.auth.Connection;
import org.glyptodon.guacamole.net.auth.ConnectionRecord;
import org.glyptodon.guacamole.net.basic.rest.APIConstants;
import org.glyptodon.guacamole.net.basic.rest.connectiongroup.APIConnectionGroup;
import org.glyptodon.guacamole.protocol.GuacamoleConfiguration;
/**
@@ -91,7 +91,7 @@ public class APIConnection {
// Use the explicit ROOT group ID
if (this.parentIdentifier == null)
this.parentIdentifier = APIConstants.ROOT_CONNECTION_GROUP_IDENTIFIER;
this.parentIdentifier = APIConnectionGroup.ROOT_IDENTIFIER;
GuacamoleConfiguration configuration = connection.getConfiguration();

View File

@@ -25,7 +25,6 @@ package org.glyptodon.guacamole.net.basic.rest.connectiongroup;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.glyptodon.guacamole.net.auth.ConnectionGroup;
import org.glyptodon.guacamole.net.auth.ConnectionGroup.Type;
import org.glyptodon.guacamole.net.basic.rest.APIConstants;
/**
* A simple connection group to expose through the REST endpoints.
@@ -35,6 +34,11 @@ import org.glyptodon.guacamole.net.basic.rest.APIConstants;
@JsonIgnoreProperties(ignoreUnknown = true)
public class APIConnectionGroup {
/**
* The identifier of the root connection group.
*/
public static final String ROOT_IDENTIFIER = "ROOT";
/**
* The name of this connection group.
*/
@@ -73,7 +77,7 @@ public class APIConnectionGroup {
// Use the explicit ROOT group ID
if (this.parentIdentifier == null)
this.parentIdentifier = APIConstants.ROOT_CONNECTION_GROUP_IDENTIFIER;
this.parentIdentifier = ROOT_IDENTIFIER;
this.name = connectionGroup.getName();
this.type = connectionGroup.getType();