diff options
693 files changed, 15832 insertions, 0 deletions
diff --git a/com.gluster.storage.management.client/.classpath b/com.gluster.storage.management.client/.classpath new file mode 100644 index 00000000..4422c8d9 --- /dev/null +++ b/com.gluster.storage.management.client/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry exported="true" kind="lib" path="lib/jersey-client-1.4.jar"/> + <classpathentry exported="true" kind="lib" path="lib/jersey-core-1.4.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/com.gluster.storage.management.client/.project b/com.gluster.storage.management.client/.project new file mode 100644 index 00000000..647c8a91 --- /dev/null +++ b/com.gluster.storage.management.client/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.client</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.client/.settings/org.eclipse.jdt.core.prefs b/com.gluster.storage.management.client/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f8b5cc38 --- /dev/null +++ b/com.gluster.storage.management.client/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Dec 29 15:47:13 IST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.gluster.storage.management.client/META-INF/MANIFEST.MF b/com.gluster.storage.management.client/META-INF/MANIFEST.MF new file mode 100644 index 00000000..a5cc4530 --- /dev/null +++ b/com.gluster.storage.management.client/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Gluster Storage Platform Client +Bundle-SymbolicName: com.gluster.storage.management.client +Bundle-Version: 1.0.0 +Bundle-Vendor: GLUSTER +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: com.gluster.storage.management.core;bundle-version="1.0.0", + com.sun.jersey;bundle-version="1.4.0" +Export-Package: com.gluster.storage.management.client +Bundle-ClassPath: lib/jersey-client-1.4.jar, + lib/jersey-core-1.4.jar, + . diff --git a/com.gluster.storage.management.client/build.properties b/com.gluster.storage.management.client/build.properties new file mode 100644 index 00000000..d16687f5 --- /dev/null +++ b/com.gluster.storage.management.client/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = .,\ + lib/jersey-client-1.4.jar,\ + lib/jersey-core-1.4.jar,\ + META-INF/ +src.includes = lib/jersey-client-1.4.jar,\ + lib/jersey-core-1.4.jar diff --git a/com.gluster.storage.management.client/lib/jersey-client-1.4.jar b/com.gluster.storage.management.client/lib/jersey-client-1.4.jar Binary files differnew file mode 100644 index 00000000..e7debb0f --- /dev/null +++ b/com.gluster.storage.management.client/lib/jersey-client-1.4.jar diff --git a/com.gluster.storage.management.client/lib/jersey-core-1.4.jar b/com.gluster.storage.management.client/lib/jersey-core-1.4.jar Binary files differnew file mode 100644 index 00000000..ae78fe33 --- /dev/null +++ b/com.gluster.storage.management.client/lib/jersey-core-1.4.jar diff --git a/com.gluster.storage.management.client/src/com/gluster/storage/management/client/AuthManager.java b/com.gluster.storage.management.client/src/com/gluster/storage/management/client/AuthManager.java new file mode 100644 index 00000000..3adae9d0 --- /dev/null +++ b/com.gluster.storage.management.client/src/com/gluster/storage/management/client/AuthManager.java @@ -0,0 +1,32 @@ +package com.gluster.storage.management.client; + +import java.net.URI; + +import javax.ws.rs.core.UriBuilder; + +import com.gluster.storage.management.core.model.ConnectionDetails; + +public class AuthManager { + public boolean authenticate(ConnectionDetails connectionDetails) { +// WebResource service = Client.create(new DefaultClientConfig()).resource(getBaseURI()); +// +// AuthStatus authStatus = service.path("services").path("login") +// .queryParam("user", connectionDetails.getUserId()) +// .queryParam("password", connectionDetails.getPassword()).accept(MediaType.TEXT_XML) +// .get(AuthStatus.class); +// +// return authStatus.getIsAuthenticated(); + + // Dummy authentication for demo application + return (connectionDetails.getPassword().equals("gluster") ? true : false); + } + + public static void main(String[] args) { + AuthManager authManager = new AuthManager(); + System.out.println(authManager.authenticate(new ConnectionDetails("", "gluster", "gluster"))); + } + + private static URI getBaseURI() { + return UriBuilder.fromUri("http://localhost:8080/glustersp").build(); + } +} diff --git a/com.gluster.storage.management.client/src/com/gluster/storage/management/client/RESTClientTest.java b/com.gluster.storage.management.client/src/com/gluster/storage/management/client/RESTClientTest.java new file mode 100644 index 00000000..0afb488f --- /dev/null +++ b/com.gluster.storage.management.client/src/com/gluster/storage/management/client/RESTClientTest.java @@ -0,0 +1,24 @@ +package com.gluster.storage.management.client; + +import java.net.URI; + +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.UriBuilder; + +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.DefaultClientConfig; + +public class RESTClientTest { + public static void main(String args[]) { + WebResource service = Client.create(new DefaultClientConfig()).resource(getBaseURI()); + String name = service.path("services").path("name").accept(MediaType.TEXT_PLAIN).get(String.class); + System.out.println(name); + name = service.path("services").path("name/xml").accept(MediaType.TEXT_XML).get(String.class); + System.out.println(name); + } + + private static URI getBaseURI() { + return UriBuilder.fromUri("http://localhost:8080/glustermc").build(); + } +} diff --git a/com.gluster.storage.management.core/.classpath b/com.gluster.storage.management.core/.classpath new file mode 100644 index 00000000..1bdfad39 --- /dev/null +++ b/com.gluster.storage.management.core/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/com.gluster.storage.management.core/.project b/com.gluster.storage.management.core/.project new file mode 100644 index 00000000..6c8fbb5c --- /dev/null +++ b/com.gluster.storage.management.core/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.core</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.core/.settings/org.eclipse.jdt.core.prefs b/com.gluster.storage.management.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..f22cedf1 --- /dev/null +++ b/com.gluster.storage.management.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Dec 22 11:18:01 IST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.gluster.storage.management.core/META-INF/MANIFEST.MF b/com.gluster.storage.management.core/META-INF/MANIFEST.MF new file mode 100644 index 00000000..b5a2a830 --- /dev/null +++ b/com.gluster.storage.management.core/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Gluster Storage Platform Core +Bundle-SymbolicName: com.gluster.storage.management.core +Bundle-Version: 1.0.0 +Bundle-Vendor: GLUSTER +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Export-Package: com.gluster.storage.management.core.constants, + com.gluster.storage.management.core.exceptions, + com.gluster.storage.management.core.model, + com.gluster.storage.management.core.utils +Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0" diff --git a/com.gluster.storage.management.core/build.properties b/com.gluster.storage.management.core/build.properties new file mode 100644 index 00000000..34d2e4d2 --- /dev/null +++ b/com.gluster.storage.management.core/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java new file mode 100644 index 00000000..bb8f0b33 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> + * This file is part of GlusterFS. + * + * Gluster Storage Platform is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, + * or (at your option) any later version. + * + * GlusterFS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ + +package com.gluster.storage.management.core.constants; + +/** + * + */ +public class CoreConstants { + public static final String NEWLINE = System.getProperty("line.separator"); +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/GlusterRuntimeException.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/GlusterRuntimeException.java new file mode 100644 index 00000000..cf815989 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/exceptions/GlusterRuntimeException.java @@ -0,0 +1,12 @@ +package com.gluster.storage.management.core.exceptions; + +public class GlusterRuntimeException extends RuntimeException { + + public GlusterRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + public GlusterRuntimeException(String message) { + super(message); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/AuthStatus.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/AuthStatus.java new file mode 100644 index 00000000..b95fa804 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/AuthStatus.java @@ -0,0 +1,17 @@ +package com.gluster.storage.management.core.model; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class AuthStatus { + private boolean isAuthenticated; + + public boolean getIsAuthenticated() { + return isAuthenticated; + } + + public void setIsAuthenticated(boolean authenticated) { + this.isAuthenticated = authenticated; + } + +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Cluster.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Cluster.java new file mode 100644 index 00000000..5ae07fd4 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Cluster.java @@ -0,0 +1,52 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.List; + +public class Cluster extends Entity { + private List<IClusterListener> listeners = new ArrayList<IClusterListener>(); + List<GlusterServer> servers = new ArrayList<GlusterServer>(); + List<Server> autoDiscoveredServers = new ArrayList<Server>(); + List<Volume> volumes = new ArrayList<Volume>(); + + public List<GlusterServer> getServers() { + return servers; + } + + public void setServers(List<GlusterServer> servers) { + this.servers = servers; + children.add(new EntityGroup<GlusterServer>("Servers", GlusterServer.class, this, servers)); + } + + public List<Server> getAutoDiscoveredServers() { + return autoDiscoveredServers; + } + + public void setAutoDiscoveredServers(List<Server> autoDiscoveredServers) { + this.autoDiscoveredServers = autoDiscoveredServers; + children.add(new EntityGroup<Server>("Discovered Servers", Server.class, this, autoDiscoveredServers)); + } + + public List<Volume> getVolumes() { + return volumes; + } + + public void setVolumes(List<Volume> volumes) { + this.volumes = volumes; + children.add(new EntityGroup<Volume>("Volumes", Volume.class, this, volumes)); + } + + public Cluster(String name, Entity parent) { + super(name, parent); + } + + public Cluster(String name, Entity parent, List<GlusterServer> servers, List<Volume> volumes) { + super(name, parent); + setServers(servers); + setVolumes(volumes); + } + + public void addClusterListener(IClusterListener listener) { + listeners.add(listener); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/ConnectionDetails.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/ConnectionDetails.java new file mode 100644 index 00000000..5d7e2d09 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/ConnectionDetails.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2004, 2005 Jean-Michel Lemieux, Jeff McAffer and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Hyperbola is an RCP application developed for the book + * Eclipse Rich Client Platform - + * Designing, Coding, and Packaging Java Applications + * + * Contributors: + * Jean-Michel Lemieux and Jeff McAffer - initial implementation + *******************************************************************************/ +package com.gluster.storage.management.core.model; + +public class ConnectionDetails { + private String userId, server, password; + + public ConnectionDetails() { + + } + + public ConnectionDetails(String server, String userId, String password) { + this.userId = userId; + this.server = server; + this.password = password; + } + + public String getUserId() { + return userId; + } + + public String getServer() { + return server; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/DefaultClusterListener.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/DefaultClusterListener.java new file mode 100644 index 00000000..66d4e891 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/DefaultClusterListener.java @@ -0,0 +1,32 @@ +package com.gluster.storage.management.core.model; + +/** + * Default listener - doesn't do anything. Sub-class and override the method for + * the event you want to handle. + */ +public class DefaultClusterListener implements IClusterListener { + + @Override + public void serverAdded(GlusterServer server) { + } + + @Override + public void serverRemoved(GlusterServer server) { + } + + @Override + public void serverChanged(GlusterServer server, Event event) { + } + + @Override + public void volumeAdded(Volume volume) { + } + + @Override + public void volumeRemoved(Volume volume) { + } + + @Override + public void volumeChanged(Volume volume, Event event) { + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Disk.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Disk.java new file mode 100644 index 00000000..b5093627 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Disk.java @@ -0,0 +1,81 @@ +package com.gluster.storage.management.core.model; + +import com.gluster.storage.management.core.utils.StringUtils; + +public class Disk extends Entity { + public enum DISK_STATUS { + READY, UNINITIALIZED, INITIALIZING, OFFLINE + }; + + private String[] DISK_STATUS_STR = { "Ready", "Uninitialized", "Initializing", "Offline" }; + + private Server server; + private Double space; + private Double spaceInUse; + private DISK_STATUS status; + + public Double getSpace() { + return space; + } + + public void setSpace(Double space) { + this.space = space; + } + + public boolean isUninitialized() { + return getStatus() == DISK_STATUS.UNINITIALIZED; + } + + public boolean isOffline() { + return getStatus() == DISK_STATUS.OFFLINE; + } + + public boolean isReady() { + return getStatus() == DISK_STATUS.READY; + } + + public DISK_STATUS getStatus() { + return status; + } + + public String getStatusStr() { + return DISK_STATUS_STR[getStatus().ordinal()]; + } + + public void setStatus(DISK_STATUS status) { + this.status = status; + } + + public Double getSpaceInUse() { + return spaceInUse; + } + + public void setSpaceInUse(Double spaceInUse) { + this.spaceInUse = spaceInUse; + } + + public Server getServer() { + return server; + } + + public void setServer(Server server) { + this.server = server; + } + + public Disk(Server server, String name, Double space, Double spaceInUse, DISK_STATUS status) { + super(name, server); + setServer(server); + setSpace(space); + setSpaceInUse(spaceInUse); + setStatus(status); + } + + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getServer().getName() + getName() + getStatusStr(), filterString, caseSensitive); + } + + public String getQualifiedName() { + return getServer().getName() + ":" + getName(); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Entity.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Entity.java new file mode 100644 index 00000000..8c56a035 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Entity.java @@ -0,0 +1,56 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.PlatformObject; + +import com.gluster.storage.management.core.utils.StringUtils; + +public class Entity extends PlatformObject implements Filterable { + private static final long serialVersionUID = 1L; + + protected String name; + protected List<Entity> children = new ArrayList<Entity>(); + private Entity parent; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Entity getParent() { + return parent; + } + + public void setParent(Entity parent) { + this.parent = parent; + } + + public List<? extends Entity> getChildren() { + return children; + } + + public void setChildren(List<Entity> children) { + this.children = children; + } + + public Entity(String name, Entity parent) { + this.name = name; + this.parent = parent; + } + + public Entity(String name, Entity parent, List<Entity> children) { + this.name = name; + this.parent = parent; + this.children = children; + } + + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getName(), filterString, caseSensitive); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/EntityGroup.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/EntityGroup.java new file mode 100644 index 00000000..18b72488 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/EntityGroup.java @@ -0,0 +1,28 @@ +package com.gluster.storage.management.core.model; + +import java.util.List; + +public class EntityGroup<T> extends Entity { + private Class<? extends Entity> type; + + public EntityGroup(String name, Class<? extends Entity> type, Cluster cluster) { + this(name, type, cluster, null); + } + + public EntityGroup(String name, Class<? extends Entity> type, Cluster cluster, List<T> entities) { + super(name, cluster, (List<Entity>)entities); + this.type = type; + } + + public List<? extends Entity> getEntities() { + return children; + } + + public void setEntities(List<T> entities) { + children = (List<Entity>)entities; + } + + public Class<? extends Entity> getEntityType() { + return type; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Event.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Event.java new file mode 100644 index 00000000..5b0a0019 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Event.java @@ -0,0 +1,18 @@ +package com.gluster.storage.management.core.model; + +public class Event { + public enum EVENT_TYPE { + DISK_ADDED, + DISK_REMOVED, + NETWORK_INTERFACE_ADDED, + NETWORK_INTERFACE_REMOVED + } + + private EVENT_TYPE eventType; + private Object eventData; + + public Event(EVENT_TYPE eventType, Object eventData) { + this.eventType = eventType; + this.eventData = eventData; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Filterable.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Filterable.java new file mode 100644 index 00000000..52b61b6b --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Filterable.java @@ -0,0 +1,19 @@ +package com.gluster.storage.management.core.model; + +/** + * By default, the {@link EntityViewerFilter} filters the objects by parsing the + * output of {@link Object#toString()} with the filter string. Classes that need + * specific filtering logic can implement this interface. The default logic will + * then be overridden by the method {@link Filterable#filter(String)}. + */ +public interface Filterable { + /** + * @param filterString + * String to be used for filtering + * @param caseSensitive + * Flag indicating whether the filtering should be case sensitive + * @return true if the object can be selected using the filter string, else + * false + */ + public boolean filter(String filterString, boolean caseSensitive); +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDataModel.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDataModel.java new file mode 100644 index 00000000..4256bd9c --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDataModel.java @@ -0,0 +1,24 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.List; + +public class GlusterDataModel extends Entity { + public GlusterDataModel(String name, List<Cluster> clusters) { + super(name, null); + children.addAll(clusters); + } + + public GlusterDataModel(String name) { + this(name, new ArrayList<Cluster>()); + } + + public void setClusters(List<Cluster> clusters) { + children.clear(); + children.addAll(clusters); + } + + public void addCluster(Cluster cluster) { + children.add(cluster); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDummyModel.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDummyModel.java new file mode 100644 index 00000000..23b25ee5 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterDummyModel.java @@ -0,0 +1,264 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.core.model.GlusterServer.SERVER_STATUS; +import com.gluster.storage.management.core.model.Volume.TRANSPORT_TYPE; +import com.gluster.storage.management.core.model.Volume.VOLUME_STATUS; +import com.gluster.storage.management.core.model.Volume.VOLUME_TYPE; + +public class GlusterDummyModel { + // private Server discoveredServer1, discoveredServer2, discoveredServer3, discoveredServer4, discoveredServer5; + private GlusterServer server1, server2, server3, server4, server5; + private Volume volume1, volume2, volume3, volume4, volume5; + private Disk s1da, s1db, s2da, s2db, s2dc, s2dd, s3da, s4da, s5da, s5db; + private static List<LogMessage> logMessages = new ArrayList<LogMessage>(); + private static GlusterDummyModel instance = new GlusterDummyModel(); + private GlusterDataModel model; + + private GlusterDummyModel() { + model = initializeModel(); + } + + public GlusterDataModel getModel() { + return model; + } + + public static GlusterDummyModel getInstance() { + return instance; + } + + private GlusterServer addGlusterServer(List<GlusterServer> servers, Entity parent, String name, + SERVER_STATUS status, String preferredInterfaceName, int numOfCPUs, double cpuUsage, double totalMemory, + double memoryInUse) { + GlusterServer glusterServer = new GlusterServer(name, parent, status, numOfCPUs, cpuUsage, totalMemory, + memoryInUse); + NetworkInterface networkInterface = addNetworkInterface(glusterServer, preferredInterfaceName); + glusterServer.setPreferredNetworkInterface(networkInterface); + + servers.add(glusterServer); + return glusterServer; + } + + private NetworkInterface addNetworkInterface(Server server, String interfaceName) { + NetworkInterface networkInterface = new NetworkInterface(interfaceName, server, "192.168.1." + + Math.round(Math.random() * 255), "255.255.255.0", "192.168.1.1"); + server.setNetworkInterfaces(Arrays.asList(new NetworkInterface[] { networkInterface })); + return networkInterface; + } + + private void addDiscoveredServer(List<Server> servers, Entity parent, String name, int numOfCPUs, double cpuUsage, + double totalMemory, double memoryInUse, double totalDiskSpace, double diskSpaceInUse) { + Server server = new Server(name, parent, numOfCPUs, cpuUsage, totalMemory, memoryInUse); + server.addDisk(new Disk(server, "sda", totalDiskSpace, diskSpaceInUse, DISK_STATUS.READY)); + addNetworkInterface(server, "eth0"); + + servers.add(server); + } + + private GlusterDataModel initializeModel() { + // Create the dummy data model for demo + GlusterDataModel model = new GlusterDataModel("Clusters"); + Cluster cluster = new Cluster("Home", model); + + initializeGlusterServers(cluster); + initializeVolumes(cluster); + initializeAutoDiscoveredServers(cluster); + initializeDisks(); + addDisksToServers(); + addDisksToVolumes(); + addVolumeOptions(); + + createDummyLogMessages(); + + model.addCluster(cluster); + return model; + } + + private void addVolumeOptions() { + for (Volume vol : new Volume[] { volume1, volume2, volume3, volume4, volume5 }) { + for (int i = 1; i <= 5; i++) { + String key = vol.getName() + "key" + i; + String value = vol.getName() + "value" + i; + vol.setOption(key, value); + } + } + } + + private Volume addVolume(List<Volume> volumes, String name, Cluster cluster, VOLUME_TYPE volumeType, + TRANSPORT_TYPE transportType, VOLUME_STATUS status) { + Volume volume = new Volume(name, cluster, volumeType, transportType, status); + volumes.add(volume); + + return volume; + } + + private void initializeVolumes(Cluster cluster) { + List<Volume> volumes = new ArrayList<Volume>(); + + volume1 = addVolume(volumes, "Volume1", cluster, VOLUME_TYPE.PLAIN_DISTRIBUTE, TRANSPORT_TYPE.ETHERNET, + VOLUME_STATUS.ONLINE); + + volume2 = addVolume(volumes, "Volume2", cluster, VOLUME_TYPE.PLAIN_DISTRIBUTE, TRANSPORT_TYPE.ETHERNET, + VOLUME_STATUS.ONLINE); + + volume3 = addVolume(volumes, "Volume3", cluster, VOLUME_TYPE.DISTRIBUTED_MIRROR, TRANSPORT_TYPE.ETHERNET, + VOLUME_STATUS.OFFLINE); + volume3.setReplicaCount(2); + + volume4 = addVolume(volumes, "Volume4", cluster, VOLUME_TYPE.PLAIN_DISTRIBUTE, TRANSPORT_TYPE.ETHERNET, + VOLUME_STATUS.ONLINE); + + volume5 = addVolume(volumes, "Volume5", cluster, VOLUME_TYPE.DISTRIBUTED_STRIPE, TRANSPORT_TYPE.INFINIBAND, + VOLUME_STATUS.OFFLINE); + volume5.setStripeCount(3); + + cluster.setVolumes(volumes); + } + + private void initializeDisks() { + s1da = new Disk(server1, "sda", 100d, 80d, DISK_STATUS.READY); + s1db = new Disk(server1, "sdb", 100d, 67.83, DISK_STATUS.READY); + + s2da = new Disk(server2, "sda", 200d, 157.12, DISK_STATUS.READY); + s2db = new Disk(server2, "sdb", 200d, 182.27, DISK_STATUS.READY); + s2dc = new Disk(server2, "sdc", 200d, -1d, DISK_STATUS.UNINITIALIZED); + s2dd = new Disk(server2, "sdd", 200d, 124.89, DISK_STATUS.READY); + + s3da = new Disk(server3, "NA", -1d, -1d, DISK_STATUS.OFFLINE); // disk name unavailable since server is offline + + s4da = new Disk(server4, "sda", 100d, 85.39, DISK_STATUS.READY); + + s5da = new Disk(server5, "sda", 100d, 92.83, DISK_STATUS.READY); + s5db = new Disk(server5, "sdb", 200d, 185.69, DISK_STATUS.READY); + } + + private void addDisksToServers() { + server1.addDisk(s1da); + server1.addDisk(s1db); + + server2.addDisk(s2da); + server2.addDisk(s2db); + server2.addDisk(s2dc); + server2.addDisk(s2dd); + + // server3.addDisk(s3da); + + server4.addDisk(s4da); + + server5.addDisk(s5da); + server5.addDisk(s5db); + } + + private void addDisksToVolumes() { + volume1.addDisk(s1da); + + volume2.addDisk(s2da); + volume2.addDisk(s1db); + volume2.addDisk(s3da); + volume2.addDisk(s4da); + + volume3.addDisk(s2db); + volume3.addDisk(s4da); + volume3.addDisk(s5da); + + volume4.addDisk(s1da); + volume4.addDisk(s3da); + volume4.addDisk(s4da); + volume4.addDisk(s5db); + + volume5.addDisk(s2da); + volume5.addDisk(s5db); + } + + private void initializeGlusterServers(Cluster cluster) { + List<GlusterServer> servers = new ArrayList<GlusterServer>(); + server1 = addGlusterServer(servers, cluster, "Server1", SERVER_STATUS.ONLINE, "eth0", 4, 56.3, 16, 8.4); + server2 = addGlusterServer(servers, cluster, "Server2", SERVER_STATUS.ONLINE, "eth1", 8, 41.92, 32, 18.76); + server3 = addGlusterServer(servers, cluster, "Server3", SERVER_STATUS.OFFLINE, "eth0", -1, -1, -1, -1); + server4 = addGlusterServer(servers, cluster, "Server4", SERVER_STATUS.ONLINE, "eth0", 1, 92.83, 4, 3.18); + server5 = addGlusterServer(servers, cluster, "Server5", SERVER_STATUS.ONLINE, "inf0", 2, 87.24, 8, 7.23); + + cluster.setServers(servers); + } + + private void initializeAutoDiscoveredServers(Cluster cluster) { + List<Server> servers = new ArrayList<Server>(); + addDiscoveredServer(servers, cluster, "ADServer1", 4, 56.3, 16, 8.4, 200, 147.83); + addDiscoveredServer(servers, cluster, "ADServer2", 8, 41.92, 32, 18.76, 800, 464.28); + addDiscoveredServer(servers, cluster, "ADServer3", 2, 84.28, 2, 1.41, 120, 69.93); + addDiscoveredServer(servers, cluster, "ADServer4", 1, 92.83, 4, 3.18, 100, 85.39); + addDiscoveredServer(servers, cluster, "ADServer5", 2, 87.24, 8, 7.23, 250, 238.52); + cluster.setAutoDiscoveredServers(servers); + } + + private void addMessages(List<LogMessage> messages, Disk disk, String severity, int count) { + for (int i = 1; i <= count; i++) { + String message = severity + "message" + i; + messages.add(new LogMessage(new Date(), disk, severity, message)); + } + } + + private void addMessagesForDisk(List<LogMessage> logMessages, Disk disk) { + addMessages(logMessages, disk, "SEVERE", 5); + addMessages(logMessages, disk, "WARNING", 5); + addMessages(logMessages, disk, "DEBUG", 5); + addMessages(logMessages, disk, "INFO", 5); + } + + public List<LogMessage> createDummyLogMessages() { + addMessagesForDisk(logMessages, s1da); + addMessagesForDisk(logMessages, s1db); + addMessagesForDisk(logMessages, s2da); + addMessagesForDisk(logMessages, s2db); + addMessagesForDisk(logMessages, s2dc); + addMessagesForDisk(logMessages, s2dd); + addMessagesForDisk(logMessages, s4da); + addMessagesForDisk(logMessages, s5da); + addMessagesForDisk(logMessages, s5db); + return logMessages; + } + + public static List<LogMessage> getDummyLogMessages() { + return logMessages; + } + + public List<Disk> getReadyDisksOfVolume(Volume volume) { + List<Disk> disks = new ArrayList<Disk>(); + for (Disk disk : volume.getDisks()) { + if (disk.isReady()) { + disks.add(disk); + } + } + return disks; + } + + public List<Disk> getReadyDisksOfAllVolumes() { + List<Disk> disks = new ArrayList<Disk>(); + for (Volume volume : ((Cluster) model.getChildren().get(0)).getVolumes()) { + disks.addAll(getReadyDisksOfVolume(volume)); + } + return disks; + } + + public List<Disk> getReadyDisksOfAllServers() { + return getReadyDisksOfAllServersExcluding(new ArrayList<Disk>()); + } + + public List<Disk> getReadyDisksOfAllServersExcluding(List<Disk> excludeDisks) { + List<Disk> disks = new ArrayList<Disk>(); + + for (Server server : ((Cluster) model.getChildren().get(0)).getServers()) { + for (Disk disk : server.getDisks()) { + if (disk.isReady() && !excludeDisks.contains(disk)) { + disks.add(disk); + } + } + } + return disks; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterServer.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterServer.java new file mode 100644 index 00000000..ee065032 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/GlusterServer.java @@ -0,0 +1,65 @@ +package com.gluster.storage.management.core.model; + +import com.gluster.storage.management.core.utils.StringUtils; + +public class GlusterServer extends Server { + public enum SERVER_STATUS { + ONLINE, OFFLINE + }; + private static final String[] STATUS_STR = new String[] { "Online", "Offline" }; + + private SERVER_STATUS status; + private NetworkInterface preferredNetworkInterface; + private Cluster cluster; + + public GlusterServer(String name, Entity parent, SERVER_STATUS status, int numOfCPUs, double cpuUsage, double totalMemory, + double memoryInUse) { + super(name, parent, numOfCPUs, cpuUsage, totalMemory, memoryInUse); + setStatus(status); + } + + public GlusterServer(String name, Entity parent, SERVER_STATUS status, int numOfCPUs, double cpuUsage, double totalMemory, + double memoryInUse, Cluster cluster) { + this(name, parent, status, numOfCPUs, cpuUsage, totalMemory, memoryInUse); + setCluster(cluster); + } + + public String getStatusStr() { + return STATUS_STR[getStatus().ordinal()]; + } + + public SERVER_STATUS getStatus() { + return status; + } + + public void setStatus(SERVER_STATUS status) { + this.status = status; + } + + public NetworkInterface getPreferredNetworkInterface() { + return preferredNetworkInterface; + } + + public void setPreferredNetworkInterface(NetworkInterface preferredNetworkInterface) { + this.preferredNetworkInterface = preferredNetworkInterface; + preferredNetworkInterface.setPreferred(true); + } + + public Cluster getCluster() { + return cluster; + } + + public void setCluster(Cluster cluster) { + this.cluster = cluster; + } + + /** + * Filter matches if any of the properties name, status, preferred network interface, and primary/secondary/third + * DNS contains the filter string + */ + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getName() + getStatusStr() + getPreferredNetworkInterface().getName(), + filterString, caseSensitive); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/IClusterListener.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/IClusterListener.java new file mode 100644 index 00000000..32454b59 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/IClusterListener.java @@ -0,0 +1,19 @@ +package com.gluster.storage.management.core.model; + +/** + * Interface for a cluster listener. Every registered listener will be notified + * on various events happening on the cluster. + */ +public interface IClusterListener { + public void serverAdded(GlusterServer server); + + public void serverRemoved(GlusterServer server); + + public void serverChanged(GlusterServer server, Event event); + + public void volumeAdded(Volume volume); + + public void volumeRemoved(Volume volume); + + public void volumeChanged(Volume volume, Event event); +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/LogMessage.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/LogMessage.java new file mode 100644 index 00000000..fc324b03 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/LogMessage.java @@ -0,0 +1,57 @@ +package com.gluster.storage.management.core.model; + +import java.util.Date; + +import com.gluster.storage.management.core.utils.StringUtils; + +public class LogMessage implements Filterable { + private Date timestamp; + private Disk disk; + private String severity; + private String message; + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public Disk getDisk() { + return disk; + } + + public void setDisk(Disk disk) { + this.disk = disk; + } + + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public LogMessage(Date timestamp, Disk disk, String severity, String message) { + setTimestamp(timestamp); + setDisk(disk); + setSeverity(severity); + setMessage(message); + } + + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getSeverity() + getTimestamp() + getDisk().getServer().getName() + + getDisk().getQualifiedName() + getMessage(), filterString, caseSensitive); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/NetworkInterface.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/NetworkInterface.java new file mode 100644 index 00000000..375b1971 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/NetworkInterface.java @@ -0,0 +1,48 @@ +package com.gluster.storage.management.core.model; + +public class NetworkInterface extends Entity { + private String ipAddress; + private String netMask; + private String defaultGateway; + private boolean isPreferred; + + public boolean isPreferred() { + return isPreferred; + } + + public void setPreferred(boolean isPreferred) { + this.isPreferred = isPreferred; + } + + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public String getNetMask() { + return netMask; + } + + public void setNetMask(String netMask) { + this.netMask = netMask; + } + + public String getDefaultGateway() { + return defaultGateway; + } + + public void setDefaultGateway(String defaultGateway) { + this.defaultGateway = defaultGateway; + } + + public NetworkInterface(String name, Entity parent, String ipAddress, String netMask, String defaultGateway) { + super(name, parent); + setIpAddress(ipAddress); + setNetMask(netMask); + setDefaultGateway(defaultGateway); + } + +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Server.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Server.java new file mode 100644 index 00000000..b7e56ba4 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Server.java @@ -0,0 +1,126 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.List; + +import com.gluster.storage.management.core.utils.StringUtils; + +public class Server extends Entity { + private List<NetworkInterface> networkInterfaces = new ArrayList<NetworkInterface>(); + private int numOfCPUs; + private double cpuUsage; + private double totalMemory; + private double memoryInUse; + private double totalDiskSpace = 0; + private double diskSpaceInUse = 0; + private List<Disk> disks = new ArrayList<Disk>(); + + public Server(String name, Entity parent, int numOfCPUs, double cpuUsage, double totalMemory, double memoryInUse) { + super(name, parent); + setNumOfCPUs(numOfCPUs); + setCpuUsage(cpuUsage); + setTotalMemory(totalMemory); + setMemoryInUse(memoryInUse); + } + + public int getNumOfCPUs() { + return numOfCPUs; + } + + public void setNumOfCPUs(int numOfCPUs) { + this.numOfCPUs = numOfCPUs; + } + + public double getCpuUsage() { + return cpuUsage; + } + + public void setCpuUsage(double cpuUsage) { + this.cpuUsage = cpuUsage; + } + + public double getTotalMemory() { + return totalMemory; + } + + public void setTotalMemory(double totalMemory) { + this.totalMemory = totalMemory; + } + + public double getMemoryInUse() { + return memoryInUse; + } + + public void setMemoryInUse(double memoryInUse) { + this.memoryInUse = memoryInUse; + } + + public double getTotalDiskSpace() { + return totalDiskSpace; + } + + public double getDiskSpaceInUse() { + return diskSpaceInUse; + } + + public List<NetworkInterface> getNetworkInterfaces() { + return networkInterfaces; + } + + public void setNetworkInterfaces(List<NetworkInterface> networkInterfaces) { + this.networkInterfaces = networkInterfaces; + } + + public List<Disk> getDisks() { + return disks; + } + + public void addDisk(Disk disk) { + if (disks.add(disk)) { + totalDiskSpace += disk.getSpace(); + diskSpaceInUse += disk.getSpaceInUse(); + } + } + + public void addDisks(List<Disk> disks) { + for(Disk disk : disks) { + addDisk(disk); + } + } + + public void removeDisk(Disk disk) { + if (disks.remove(disk)) { + totalDiskSpace -= disk.getSpace(); + diskSpaceInUse -= disk.getSpaceInUse(); + } + } + + public void removeAllDisks() { + disks.clear(); + totalDiskSpace = 0; + diskSpaceInUse = 0; + } + + public void setDisks(List<Disk> disks) { + removeAllDisks(); + addDisks(disks); + } + + public int getNumOfDisks() { + return disks.size(); + } + + public String getIpAddressesAsString() { + String ipAddresses = ""; + for (NetworkInterface networkInterface : getNetworkInterfaces()) { + String ipAddr = networkInterface.getIpAddress(); + ipAddresses += (ipAddresses.isEmpty() ? ipAddr : ", " + ipAddr); + } + return ipAddresses; + } + + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getName() + getIpAddressesAsString(), filterString, caseSensitive); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/User.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/User.java new file mode 100644 index 00000000..3043126d --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/User.java @@ -0,0 +1,22 @@ +package com.gluster.storage.management.core.model; + +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement +public class User { + private String userId; + private String password; + + public String getUserId() { + return userId; + } + public void setUserId(String userId) { + this.userId = userId; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java new file mode 100644 index 00000000..2dd7bc3d --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java @@ -0,0 +1,228 @@ +package com.gluster.storage.management.core.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.bind.annotation.XmlRootElement; + +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.core.utils.StringUtils; + +public class Volume extends Entity { + public enum VOLUME_STATUS { + ONLINE, OFFLINE + }; + + public enum VOLUME_TYPE { + PLAIN_DISTRIBUTE, DISTRIBUTED_MIRROR, DISTRIBUTED_STRIPE + }; + + public enum TRANSPORT_TYPE { + ETHERNET, INFINIBAND + }; + + public enum NAS_PROTOCOL { + GLUSTERFS, NFS + }; + + private static final String[] VOLUME_TYPE_STR = new String[] { "Plain Distribute", "Distributed Mirror", + "Distributed Stripe" }; + private static final String[] TRANSPORT_TYPE_STR = new String[] { "Ethernet", "Infiniband" }; + private static final String[] STATUS_STR = new String[] { "Online", "Offline" }; + private static final String[] NAS_PROTOCOL_STR = new String[] { "Gluster", "NFS" }; + + private Cluster cluster; + private VOLUME_TYPE volumeType; + private TRANSPORT_TYPE transportType; + private VOLUME_STATUS status; + private int replicaCount; + private int stripeCount; + private Map<String, String> options = new LinkedHashMap<String, String>(); + + private double totalDiskSpace = 0; + private List<Disk> disks = new ArrayList<Disk>(); + + // GlusterFS export is always enabled + private Set<NAS_PROTOCOL> nasProtocols = new LinkedHashSet<NAS_PROTOCOL>( + Arrays.asList(new NAS_PROTOCOL[] { NAS_PROTOCOL.GLUSTERFS })); + + private String accessControlList = "*"; + + public String getVolumeTypeStr() { + return getVolumeTypeStr(getVolumeType()); + } + + public static String getVolumeTypeStr(VOLUME_TYPE volumeType) { + return VOLUME_TYPE_STR[volumeType.ordinal()]; + } + + public String getTransportTypeStr() { + return TRANSPORT_TYPE_STR[getTransportType().ordinal()]; + } + + public String getStatusStr() { + return STATUS_STR[getStatus().ordinal()]; + } + + public int getNumOfDisks() { + return disks.size(); + } + + public VOLUME_TYPE getVolumeType() { + return volumeType; + } + + public void setVolumeType(VOLUME_TYPE volumeType) { + this.volumeType = volumeType; + } + + public TRANSPORT_TYPE getTransportType() { + return transportType; + } + + public void setTransportType(TRANSPORT_TYPE transportType) { + this.transportType = transportType; + } + + public VOLUME_STATUS getStatus() { + return status; + } + + public int getReplicaCount() { + return replicaCount; + } + + public void setReplicaCount(int replicaCount) { + this.replicaCount = replicaCount; + } + + public int getStripeCount() { + return stripeCount; + } + + public void setStripeCount(int stripeCount) { + this.stripeCount = stripeCount; + } + + public void setStatus(VOLUME_STATUS status) { + this.status = status; + } + + public Cluster getCluster() { + return cluster; + } + + public void setCluster(Cluster cluster) { + this.cluster = cluster; + } + + public Set<NAS_PROTOCOL> getNASProtocols() { + return nasProtocols; + } + + public void setNASProtocols(Set<NAS_PROTOCOL> nasProtocols) { + this.nasProtocols = nasProtocols; + } + + public String getNASProtocolsStr() { + String protocolsStr = ""; + for (NAS_PROTOCOL protocol : nasProtocols) { + String protocolStr = NAS_PROTOCOL_STR[protocol.ordinal()]; + protocolsStr += (protocolsStr.isEmpty() ? protocolStr : ", " + protocolStr); + } + return protocolsStr; + } + + public String getAccessControlList() { + return accessControlList; + } + + public void setAccessControlList(String accessControlList) { + this.accessControlList = accessControlList; + } + + public Map<String, String> getOptions() { + return options; + } + + public void setOption(String key, String value) { + options.put(key, value); + } + + public void setOptions(Map<String, String> options) { + this.options = options; + } + + public double getTotalDiskSpace() { + return totalDiskSpace; + } + + public List<Disk> getDisks() { + return disks; + } + + public void addDisk(Disk disk) { + if (disks.add(disk) && disk.getStatus() != DISK_STATUS.OFFLINE) { + totalDiskSpace += disk.getSpace(); + } + } + + public void addDisks(List<Disk> disks) { + for (Disk disk : disks) { + addDisk(disk); + } + } + + public void removeDisk(Disk disk) { + if (disks.remove(disk)) { + totalDiskSpace -= disk.getSpace(); + } + } + + public void removeAllDisks() { + disks.clear(); + totalDiskSpace = 0; + } + + public void setDisks(List<Disk> disks) { + removeAllDisks(); + addDisks(disks); + } + + public void enableNFS() { + nasProtocols.add(NAS_PROTOCOL.NFS); + } + + public void disableNFS() { + nasProtocols.remove(NAS_PROTOCOL.NFS); + } + + public Volume(String name, Entity parent, VOLUME_TYPE volumeType, TRANSPORT_TYPE transportType, VOLUME_STATUS status) { + super(name, parent); + setVolumeType(volumeType); + setTransportType(transportType); + setStatus(status); + } + + public Volume(String name, Entity parent, Cluster cluster, VOLUME_TYPE volumeType, TRANSPORT_TYPE transportType, + VOLUME_STATUS status) { + this(name, parent, volumeType, transportType, status); + + setCluster(cluster); + } + + /** + * Filter matches if any of the properties name, volume type, transport type, status and number of disks contains + * the filter string + */ + @Override + public boolean filter(String filterString, boolean caseSensitive) { + return StringUtils.filterString(getName() + getVolumeTypeStr() + getTransportTypeStr() + getStatusStr() + + getNumOfDisks(), filterString, caseSensitive); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/Crypt.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/Crypt.java new file mode 100644 index 00000000..adafd477 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/Crypt.java @@ -0,0 +1,560 @@ +/**************************************************************************** + * Java-based implementation of the unix crypt(3) command + * + * Based upon C source code written by Eric Young, eay@psych.uq.oz.au + * Java conversion by John F. Dumas, jdumas@zgs.com + * + * Found at http://locutus.kingwoodcable.com/jfd/crypt.html + * Minor optimizations by Wes Biggs, wes@cacas.org + * + * Eric's original code is licensed under the BSD license. As this is + * derivative, the same license applies. + * + * Note: Crypt.class is much smaller when compiled with javac -O + ****************************************************************************/ +package com.gluster.storage.management.core.utils; + +public class Crypt { + private Crypt() {} // defined so class can't be instantiated. + + private static final int ITERATIONS = 16; + + private static final boolean shifts2[] = { + false, false, true, true, true, true, true, true, + false, true, true, true, true, true, true, false + }; + + private static final int skb[][] = { + { + /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ + 0x00000000, 0x00000010, 0x20000000, 0x20000010, + 0x00010000, 0x00010010, 0x20010000, 0x20010010, + 0x00000800, 0x00000810, 0x20000800, 0x20000810, + 0x00010800, 0x00010810, 0x20010800, 0x20010810, + 0x00000020, 0x00000030, 0x20000020, 0x20000030, + 0x00010020, 0x00010030, 0x20010020, 0x20010030, + 0x00000820, 0x00000830, 0x20000820, 0x20000830, + 0x00010820, 0x00010830, 0x20010820, 0x20010830, + 0x00080000, 0x00080010, 0x20080000, 0x20080010, + 0x00090000, 0x00090010, 0x20090000, 0x20090010, + 0x00080800, 0x00080810, 0x20080800, 0x20080810, + 0x00090800, 0x00090810, 0x20090800, 0x20090810, + 0x00080020, 0x00080030, 0x20080020, 0x20080030, + 0x00090020, 0x00090030, 0x20090020, 0x20090030, + 0x00080820, 0x00080830, 0x20080820, 0x20080830, + 0x00090820, 0x00090830, 0x20090820, 0x20090830, + }, + { + /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ + 0x00000000, 0x02000000, 0x00002000, 0x02002000, + 0x00200000, 0x02200000, 0x00202000, 0x02202000, + 0x00000004, 0x02000004, 0x00002004, 0x02002004, + 0x00200004, 0x02200004, 0x00202004, 0x02202004, + 0x00000400, 0x02000400, 0x00002400, 0x02002400, + 0x00200400, 0x02200400, 0x00202400, 0x02202400, + 0x00000404, 0x02000404, 0x00002404, 0x02002404, + 0x00200404, 0x02200404, 0x00202404, 0x02202404, + 0x10000000, 0x12000000, 0x10002000, 0x12002000, + 0x10200000, 0x12200000, 0x10202000, 0x12202000, + 0x10000004, 0x12000004, 0x10002004, 0x12002004, + 0x10200004, 0x12200004, 0x10202004, 0x12202004, + 0x10000400, 0x12000400, 0x10002400, 0x12002400, + 0x10200400, 0x12200400, 0x10202400, 0x12202400, + 0x10000404, 0x12000404, 0x10002404, 0x12002404, + 0x10200404, 0x12200404, 0x10202404, 0x12202404, + }, + { + /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ + 0x00000000, 0x00000001, 0x00040000, 0x00040001, + 0x01000000, 0x01000001, 0x01040000, 0x01040001, + 0x00000002, 0x00000003, 0x00040002, 0x00040003, + 0x01000002, 0x01000003, 0x01040002, 0x01040003, + 0x00000200, 0x00000201, 0x00040200, 0x00040201, + 0x01000200, 0x01000201, 0x01040200, 0x01040201, + 0x00000202, 0x00000203, 0x00040202, 0x00040203, + 0x01000202, 0x01000203, 0x01040202, 0x01040203, + 0x08000000, 0x08000001, 0x08040000, 0x08040001, + 0x09000000, 0x09000001, 0x09040000, 0x09040001, + 0x08000002, 0x08000003, 0x08040002, 0x08040003, + 0x09000002, 0x09000003, 0x09040002, 0x09040003, + 0x08000200, 0x08000201, 0x08040200, 0x08040201, + 0x09000200, 0x09000201, 0x09040200, 0x09040201, + 0x08000202, 0x08000203, 0x08040202, 0x08040203, + 0x09000202, 0x09000203, 0x09040202, 0x09040203, + }, + { + /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ + 0x00000000, 0x00100000, 0x00000100, 0x00100100, + 0x00000008, 0x00100008, 0x00000108, 0x00100108, + 0x00001000, 0x00101000, 0x00001100, 0x00101100, + 0x00001008, 0x00101008, 0x00001108, 0x00101108, + 0x04000000, 0x04100000, 0x04000100, 0x04100100, + 0x04000008, 0x04100008, 0x04000108, 0x04100108, + 0x04001000, 0x04101000, 0x04001100, 0x04101100, + 0x04001008, 0x04101008, 0x04001108, 0x04101108, + 0x00020000, 0x00120000, 0x00020100, 0x00120100, + 0x00020008, 0x00120008, 0x00020108, 0x00120108, + 0x00021000, 0x00121000, 0x00021100, 0x00121100, + 0x00021008, 0x00121008, 0x00021108, 0x00121108, + 0x04020000, 0x04120000, 0x04020100, 0x04120100, + 0x04020008, 0x04120008, 0x04020108, 0x04120108, + 0x04021000, 0x04121000, 0x04021100, 0x04121100, + 0x04021008, 0x04121008, 0x04021108, 0x04121108, + }, + { + /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ + 0x00000000, 0x10000000, 0x00010000, 0x10010000, + 0x00000004, 0x10000004, 0x00010004, 0x10010004, + 0x20000000, 0x30000000, 0x20010000, 0x30010000, + 0x20000004, 0x30000004, 0x20010004, 0x30010004, + 0x00100000, 0x10100000, 0x00110000, 0x10110000, + 0x00100004, 0x10100004, 0x00110004, 0x10110004, + 0x20100000, 0x30100000, 0x20110000, 0x30110000, + 0x20100004, 0x30100004, 0x20110004, 0x30110004, + 0x00001000, 0x10001000, 0x00011000, 0x10011000, + 0x00001004, 0x10001004, 0x00011004, 0x10011004, + 0x20001000, 0x30001000, 0x20011000, 0x30011000, + 0x20001004, 0x30001004, 0x20011004, 0x30011004, + 0x00101000, 0x10101000, 0x00111000, 0x10111000, + 0x00101004, 0x10101004, 0x00111004, 0x10111004, + 0x20101000, 0x30101000, 0x20111000, 0x30111000, + 0x20101004, 0x30101004, 0x20111004, 0x30111004, + }, + { + /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ + 0x00000000, 0x08000000, 0x00000008, 0x08000008, + 0x00000400, 0x08000400, 0x00000408, 0x08000408, + 0x00020000, 0x08020000, 0x00020008, 0x08020008, + 0x00020400, 0x08020400, 0x00020408, 0x08020408, + 0x00000001, 0x08000001, 0x00000009, 0x08000009, + 0x00000401, 0x08000401, 0x00000409, 0x08000409, + 0x00020001, 0x08020001, 0x00020009, 0x08020009, + 0x00020401, 0x08020401, 0x00020409, 0x08020409, + 0x02000000, 0x0A000000, 0x02000008, 0x0A000008, + 0x02000400, 0x0A000400, 0x02000408, 0x0A000408, + 0x02020000, 0x0A020000, 0x02020008, 0x0A020008, + 0x02020400, 0x0A020400, 0x02020408, 0x0A020408, + 0x02000001, 0x0A000001, 0x02000009, 0x0A000009, + 0x02000401, 0x0A000401, 0x02000409, 0x0A000409, + 0x02020001, 0x0A020001, 0x02020009, 0x0A020009, + 0x02020401, 0x0A020401, 0x02020409, 0x0A020409, + }, + { + /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ + 0x00000000, 0x00000100, 0x00080000, 0x00080100, + 0x01000000, 0x01000100, 0x01080000, 0x01080100, + 0x00000010, 0x00000110, 0x00080010, 0x00080110, + 0x01000010, 0x01000110, 0x01080010, 0x01080110, + 0x00200000, 0x00200100, 0x00280000, 0x00280100, + 0x01200000, 0x01200100, 0x01280000, 0x01280100, + 0x00200010, 0x00200110, 0x00280010, 0x00280110, + 0x01200010, 0x01200110, 0x01280010, 0x01280110, + 0x00000200, 0x00000300, 0x00080200, 0x00080300, + 0x01000200, 0x01000300, 0x01080200, 0x01080300, + 0x00000210, 0x00000310, 0x00080210, 0x00080310, + 0x01000210, 0x01000310, 0x01080210, 0x01080310, + 0x00200200, 0x00200300, 0x00280200, 0x00280300, + 0x01200200, 0x01200300, 0x01280200, 0x01280300, + 0x00200210, 0x00200310, 0x00280210, 0x00280310, + 0x01200210, 0x01200310, 0x01280210, 0x01280310, + }, + { + /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ + 0x00000000, 0x04000000, 0x00040000, 0x04040000, + 0x00000002, 0x04000002, 0x00040002, 0x04040002, + 0x00002000, 0x04002000, 0x00042000, 0x04042000, + 0x00002002, 0x04002002, 0x00042002, 0x04042002, + 0x00000020, 0x04000020, 0x00040020, 0x04040020, + 0x00000022, 0x04000022, 0x00040022, 0x04040022, + 0x00002020, 0x04002020, 0x00042020, 0x04042020, + 0x00002022, 0x04002022, 0x00042022, 0x04042022, + 0x00000800, 0x04000800, 0x00040800, 0x04040800, + 0x00000802, 0x04000802, 0x00040802, 0x04040802, + 0x00002800, 0x04002800, 0x00042800, 0x04042800, + 0x00002802, 0x04002802, 0x00042802, 0x04042802, + 0x00000820, 0x04000820, 0x00040820, 0x04040820, + 0x00000822, 0x04000822, 0x00040822, 0x04040822, + 0x00002820, 0x04002820, 0x00042820, 0x04042820, + 0x00002822, 0x04002822, 0x00042822, 0x04042822, + } + }; + + private static final int SPtrans[][] = { + { + /* nibble 0 */ + 0x00820200, 0x00020000, 0x80800000, 0x80820200, + 0x00800000, 0x80020200, 0x80020000, 0x80800000, + 0x80020200, 0x00820200, 0x00820000, 0x80000200, + 0x80800200, 0x00800000, 0x00000000, 0x80020000, + 0x00020000, 0x80000000, 0x00800200, 0x00020200, + 0x80820200, 0x00820000, 0x80000200, 0x00800200, + 0x80000000, 0x00000200, 0x00020200, 0x80820000, + 0x00000200, 0x80800200, 0x80820000, 0x00000000, + 0x00000000, 0x80820200, 0x00800200, 0x80020000, + 0x00820200, 0x00020000, 0x80000200, 0x00800200, + 0x80820000, 0x00000200, 0x00020200, 0x80800000, + 0x80020200, 0x80000000, 0x80800000, 0x00820000, + 0x80820200, 0x00020200, 0x00820000, 0x80800200, + 0x00800000, 0x80000200, 0x80020000, 0x00000000, + 0x00020000, 0x00800000, 0x80800200, 0x00820200, + 0x80000000, 0x80820000, 0x00000200, 0x80020200, + }, + { + /* nibble 1 */ + 0x10042004, 0x00000000, 0x00042000, 0x10040000, + 0x10000004, 0x00002004, 0x10002000, 0x00042000, + 0x00002000, 0x10040004, 0x00000004, 0x10002000, + 0x00040004, 0x10042000, 0x10040000, 0x00000004, + 0x00040000, 0x10002004, 0x10040004, 0x00002000, + 0x00042004, 0x10000000, 0x00000000, 0x00040004, + 0x10002004, 0x00042004, 0x10042000, 0x10000004, + 0x10000000, 0x00040000, 0x00002004, 0x10042004, + 0x00040004, 0x10042000, 0x10002000, 0x00042004, + 0x10042004, 0x00040004, 0x10000004, 0x00000000, + 0x10000000, 0x00002004, 0x00040000, 0x10040004, + 0x00002000, 0x10000000, 0x00042004, 0x10002004, + 0x10042000, 0x00002000, 0x00000000, 0x10000004, + 0x00000004, 0x10042004, 0x00042000, 0x10040000, + 0x10040004, 0x00040000, 0x00002004, 0x10002000, + 0x10002004, 0x00000004, 0x10040000, 0x00042000, + }, + { + /* nibble 2 */ + 0x41000000, 0x01010040, 0x00000040, 0x41000040, + 0x40010000, 0x01000000, 0x41000040, 0x00010040, + 0x01000040, 0x00010000, 0x01010000, 0x40000000, + 0x41010040, 0x40000040, 0x40000000, 0x41010000, + 0x00000000, 0x40010000, 0x01010040, 0x00000040, + 0x40000040, 0x41010040, 0x00010000, 0x41000000, + 0x41010000, 0x01000040, 0x40010040, 0x01010000, + 0x00010040, 0x00000000, 0x01000000, 0x40010040, + 0x01010040, 0x00000040, 0x40000000, 0x00010000, + 0x40000040, 0x40010000, 0x01010000, 0x41000040, + 0x00000000, 0x01010040, 0x00010040, 0x41010000, + 0x40010000, 0x01000000, 0x41010040, 0x40000000, + 0x40010040, 0x41000000, 0x01000000, 0x41010040, + 0x00010000, 0x01000040, 0x41000040, 0x00010040, + 0x01000040, 0x00000000, 0x41010000, 0x40000040, + 0x41000000, 0x40010040, 0x00000040, 0x01010000, + }, + { + /* nibble 3 */ + 0x00100402, 0x04000400, 0x00000002, 0x04100402, + 0x00000000, 0x04100000, 0x04000402, 0x00100002, + 0x04100400, 0x04000002, 0x04000000, 0x00000402, + 0x04000002, 0x00100402, 0x00100000, 0x04000000, + 0x04100002, 0x00100400, 0x00000400, 0x00000002, + 0x00100400, 0x04000402, 0x04100000, 0x00000400, + 0x00000402, 0x00000000, 0x00100002, 0x04100400, + 0x04000400, 0x04100002, 0x04100402, 0x00100000, + 0x04100002, 0x00000402, 0x00100000, 0x04000002, + 0x00100400, 0x04000400, 0x00000002, 0x04100000, + 0x04000402, 0x00000000, 0x00000400, 0x00100002, + 0x00000000, 0x04100002, 0x04100400, 0x00000400, + 0x04000000, 0x04100402, 0x00100402, 0x00100000, + 0x04100402, 0x00000002, 0x04000400, 0x00100402, + 0x00100002, 0x00100400, 0x04100000, 0x04000402, + 0x00000402, 0x04000000, 0x04000002, 0x04100400, + }, + { + /* nibble 4 */ + 0x02000000, 0x00004000, 0x00000100, 0x02004108, + 0x02004008, 0x02000100, 0x00004108, 0x02004000, + 0x00004000, 0x00000008, 0x02000008, 0x00004100, + 0x02000108, 0x02004008, 0x02004100, 0x00000000, + 0x00004100, 0x02000000, 0x00004008, 0x00000108, + 0x02000100, 0x00004108, 0x00000000, 0x02000008, + 0x00000008, 0x02000108, 0x02004108, 0x00004008, + 0x02004000, 0x00000100, 0x00000108, 0x02004100, + 0x02004100, 0x02000108, 0x00004008, 0x02004000, + 0x00004000, 0x00000008, 0x02000008, 0x02000100, + 0x02000000, 0x00004100, 0x02004108, 0x00000000, + 0x00004108, 0x02000000, 0x00000100, 0x00004008, + 0x02000108, 0x00000100, 0x00000000, 0x02004108, + 0x02004008, 0x02004100, 0x00000108, 0x00004000, + 0x00004100, 0x02004008, 0x02000100, 0x00000108, + 0x00000008, 0x00004108, 0x02004000, 0x02000008, + }, + { + /* nibble 5 */ + 0x20000010, 0x00080010, 0x00000000, 0x20080800, + 0x00080010, 0x00000800, 0x20000810, 0x00080000, + 0x00000810, 0x20080810, 0x00080800, 0x20000000, + 0x20000800, 0x20000010, 0x20080000, 0x00080810, + 0x00080000, 0x20000810, 0x20080010, 0x00000000, + 0x00000800, 0x00000010, 0x20080800, 0x20080010, + 0x20080810, 0x20080000, 0x20000000, 0x00000810, + 0x00000010, 0x00080800, 0x00080810, 0x20000800, + 0x00000810, 0x20000000, 0x20000800, 0x00080810, + 0x20080800, 0x00080010, 0x00000000, 0x20000800, + 0x20000000, 0x00000800, 0x20080010, 0x00080000, + 0x00080010, 0x20080810, 0x00080800, 0x00000010, + 0x20080810, 0x00080800, 0x00080000, 0x20000810, + 0x20000010, 0x20080000, 0x00080810, 0x00000000, + 0x00000800, 0x20000010, 0x20000810, 0x20080800, + 0x20080000, 0x00000810, 0x00000010, 0x20080010, + }, + { + /* nibble 6 */ + 0x00001000, 0x00000080, 0x00400080, 0x00400001, + 0x00401081, 0x00001001, 0x00001080, 0x00000000, + 0x00400000, 0x00400081, 0x00000081, 0x00401000, + 0x00000001, 0x00401080, 0x00401000, 0x00000081, + 0x00400081, 0x00001000, 0x00001001, 0x00401081, + 0x00000000, 0x00400080, 0x00400001, 0x00001080, + 0x00401001, 0x00001081, 0x00401080, 0x00000001, + 0x00001081, 0x00401001, 0x00000080, 0x00400000, + 0x00001081, 0x00401000, 0x00401001, 0x00000081, + 0x00001000, 0x00000080, 0x00400000, 0x00401001, + 0x00400081, 0x00001081, 0x00001080, 0x00000000, + 0x00000080, 0x00400001, 0x00000001, 0x00400080, + 0x00000000, 0x00400081, 0x00400080, 0x00001080, + 0x00000081, 0x00001000, 0x00401081, 0x00400000, + 0x00401080, 0x00000001, 0x00001001, 0x00401081, + 0x00400001, 0x00401080, 0x00401000, 0x00001001, + }, + { + /* nibble 7 */ + 0x08200020, 0x08208000, 0x00008020, 0x00000000, + 0x08008000, 0x00200020, 0x08200000, 0x08208020, + 0x00000020, 0x08000000, 0x00208000, 0x00008020, + 0x00208020, 0x08008020, 0x08000020, 0x08200000, + 0x00008000, 0x00208020, 0x00200020, 0x08008000, + 0x08208020, 0x08000020, 0x00000000, 0x00208000, + 0x08000000, 0x00200000, 0x08008020, 0x08200020, + 0x00200000, 0x00008000, 0x08208000, 0x00000020, + 0x00200000, 0x00008000, 0x08000020, 0x08208020, + 0x00008020, 0x08000000, 0x00000000, 0x00208000, + 0x08200020, 0x08008020, 0x08008000, 0x00200020, + 0x08208000, 0x00000020, 0x00200020, 0x08008000, + 0x08208020, 0x00200000, 0x08200000, 0x08000020, + 0x00208000, 0x00008020, 0x08008020, 0x08200000, + 0x00000020, 0x08208000, 0x00208020, 0x00000000, + 0x08000000, 0x08200020, 0x00008000, 0x00208020 + } + }; + + private static final int byteToUnsigned(byte b) { + int value = (int) b; + return (value >= 0) ? value : value + 256; + } + + private static int fourBytesToInt(byte b[], int offset) { + return byteToUnsigned(b[offset++]) + | (byteToUnsigned(b[offset++]) << 8) + | (byteToUnsigned(b[offset++]) << 16) + | (byteToUnsigned(b[offset]) << 24); + } + + private static final void intToFourBytes(int iValue, byte b[], int offset) { + b[offset++] = (byte)((iValue) & 0xff); + b[offset++] = (byte)((iValue >>> 8 ) & 0xff); + b[offset++] = (byte)((iValue >>> 16) & 0xff); + b[offset] = (byte)((iValue >>> 24) & 0xff); + } + + private static final void PERM_OP(int a, int b, int n, int m, int results[]) { + int t; + + t = ((a >>> n) ^ b) & m; + a ^= t << n; + b ^= t; + + results[0] = a; + results[1] = b; + } + + private static final int HPERM_OP(int a, int n, int m) { + int t; + + t = ((a << (16 - n)) ^ a) & m; + a = a ^ t ^ (t >>> (16 - n)); + + return a; + } + + private static int [] des_set_key(byte key[]) { + int schedule[] = new int [ITERATIONS * 2]; + + int c = fourBytesToInt(key, 0); + int d = fourBytesToInt(key, 4); + + int results[] = new int[2]; + + PERM_OP(d, c, 4, 0x0f0f0f0f, results); + d = results[0]; c = results[1]; + + c = HPERM_OP(c, -2, 0xcccc0000); + d = HPERM_OP(d, -2, 0xcccc0000); + + PERM_OP(d, c, 1, 0x55555555, results); + d = results[0]; c = results[1]; + + PERM_OP(c, d, 8, 0x00ff00ff, results); + c = results[0]; d = results[1]; + + PERM_OP(d, c, 1, 0x55555555, results); + d = results[0]; c = results[1]; + + d = (((d & 0x000000ff) << 16) | (d & 0x0000ff00) | + ((d & 0x00ff0000) >>> 16) | ((c & 0xf0000000) >>> 4)); + c &= 0x0fffffff; + + int s, t; + int j = 0; + + for(int i = 0; i < ITERATIONS; i ++) { + if(shifts2[i]) { + c = (c >>> 2) | (c << 26); + d = (d >>> 2) | (d << 26); + } else { + c = (c >>> 1) | (c << 27); + d = (d >>> 1) | (d << 27); + } + + c &= 0x0fffffff; + d &= 0x0fffffff; + + s = skb[0][ (c ) & 0x3f ]| + skb[1][((c >>> 6) & 0x03) | ((c >>> 7) & 0x3c)]| + skb[2][((c >>> 13) & 0x0f) | ((c >>> 14) & 0x30)]| + skb[3][((c >>> 20) & 0x01) | ((c >>> 21) & 0x06) | + ((c >>> 22) & 0x38)]; + + t = skb[4][ (d ) & 0x3f ]| + skb[5][((d >>> 7) & 0x03) | ((d >>> 8) & 0x3c)]| + skb[6][ (d >>>15) & 0x3f ]| + skb[7][((d >>>21) & 0x0f) | ((d >>> 22) & 0x30)]; + + schedule[j++] = ((t << 16) | (s & 0x0000ffff)) & 0xffffffff; + s = ((s >>> 16) | (t & 0xffff0000)); + + s = (s << 4) | (s >>> 28); + schedule[j++] = s & 0xffffffff; + } + return schedule; + } + + private static final int D_ENCRYPT(int L, int R, int S, int E0, int E1, int s[]) { + int t, u, v; + + v = R ^ (R >>> 16); + u = v & E0; + v = v & E1; + u = (u ^ (u << 16)) ^ R ^ s[S]; + t = (v ^ (v << 16)) ^ R ^ s[S + 1]; + t = (t >>> 4) | (t << 28); + + L ^= SPtrans[1][(t ) & 0x3f] | + SPtrans[3][(t >>> 8) & 0x3f] | + SPtrans[5][(t >>> 16) & 0x3f] | + SPtrans[7][(t >>> 24) & 0x3f] | + SPtrans[0][(u ) & 0x3f] | + SPtrans[2][(u >>> 8) & 0x3f] | + SPtrans[4][(u >>> 16) & 0x3f] | + SPtrans[6][(u >>> 24) & 0x3f]; + + return L; + } + + private static final int [] body(int schedule[], int Eswap0, int Eswap1) { + int left = 0; + int right = 0; + int t = 0; + + for (int j = 0; j < 25; j ++) { + for (int i = 0; i < ITERATIONS * 2; i += 4) { + left = D_ENCRYPT(left, right, i, Eswap0, Eswap1, schedule); + right = D_ENCRYPT(right, left, i + 2, Eswap0, Eswap1, schedule); + } + t = left; + left = right; + right = t; + } + + t = right; + + right = (left >>> 1) | (left << 31); + left = (t >>> 1) | (t << 31); + + left &= 0xffffffff; + right &= 0xffffffff; + + int results[] = new int[2]; + + PERM_OP(right, left, 1, 0x55555555, results); + right = results[0]; left = results[1]; + + PERM_OP(left, right, 8, 0x00ff00ff, results); + left = results[0]; right = results[1]; + + PERM_OP(right, left, 2, 0x33333333, results); + right = results[0]; left = results[1]; + + PERM_OP(left, right, 16, 0x0000ffff, results); + left = results[0]; right = results[1]; + + PERM_OP(right, left, 4, 0x0f0f0f0f, results); + right = results[0]; left = results[1]; + + int out[] = new int[2]; + + out[0] = left; + out[1] = right; + + return out; + } + + public static final String alphabet = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + public static final String crypt(String salt, String original) { + // wwb -- Should do some sanity checks: salt needs to be 2 chars, in alpha. + while(salt.length() < 2) + salt += "A"; + + char[] buffer = new char [13]; + + char charZero = salt.charAt(0); + char charOne = salt.charAt(1); + + buffer[0] = charZero; + buffer[1] = charOne; + + int Eswap0 = alphabet.indexOf(charZero); + int Eswap1 = alphabet.indexOf(charOne) << 4; + byte key[] = new byte[8]; + + for(int i = 0; i < key.length; i ++) + key[i] = (byte)0; + + for(int i = 0; i < key.length && i < original.length(); i ++) + key[i] = (byte) (((int) original.charAt(i)) << 1); + + int schedule[] = des_set_key(key); + int out[] = body(schedule, Eswap0, Eswap1); + + byte b[] = new byte[9]; + + intToFourBytes(out[0], b, 0); + intToFourBytes(out[1], b, 4); + b[8] = 0; + + for(int i = 2, y = 0, u = 0x80; i < 13; i ++) { + for(int j = 0, c = 0; j < 6; j ++) { + c <<= 1; + + if(((int)b[y] & u) != 0) + c |= 1; + + u >>>= 1; + + if (u == 0) { + y++; + u = 0x80; + } + buffer[i] = alphabet.charAt(c); + } + } + return new String(buffer); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/DateUtil.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/DateUtil.java new file mode 100644 index 00000000..5d0e240d --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/DateUtil.java @@ -0,0 +1,17 @@ +package com.gluster.storage.management.core.utils; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class DateUtil { + public static final String formatDate(Date inputDate) { + DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); + return formatter.format(inputDate); + } + + public static final String formatTime(Date inputDate) { + DateFormat formatter = new SimpleDateFormat("HH:mm:ss z"); + return formatter.format(inputDate); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/FileUtil.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/FileUtil.java new file mode 100644 index 00000000..f3296c5c --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/FileUtil.java @@ -0,0 +1,22 @@ +package com.gluster.storage.management.core.utils; + +import java.io.File; +import java.io.FileInputStream; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; + +public class FileUtil { + public String readFileAsString(File file) { + try { + FileInputStream fileInputStream = new FileInputStream(file); + byte[] data = new byte[fileInputStream.available()]; + fileInputStream.read(data); + fileInputStream.close(); + + return new String(data); + } catch (Exception e) { + e.printStackTrace(); + throw new GlusterRuntimeException("Could not read file [" + file + "]", e); + } + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5.java new file mode 100644 index 00000000..c4d6abb8 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5.java @@ -0,0 +1,505 @@ +package com.gluster.storage.management.core.utils; + +/* + * MD5 in Java JDK Beta-2 + * written Santeri Paavolainen, Helsinki Finland 1996 + * (c) Santeri Paavolainen, Helsinki Finland 1996 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * + * See http://www.cs.hut.fi/~santtu/java/ for more information on this + * class. + * + * This is rather straight re-implementation of the reference implementation + * given in RFC1321 by RSA. + * + * Passes MD5 test suite as defined in RFC1321. + * + * + * This Java class has been derivedfrom the RSA Data Security, Inc. MD5 + * Message-Digest Algorithm and its reference implementation. + * + * + * $Log: MD5.java,v $ + * Revision 1.1 2004/07/12 13:35:20 aubryp + * initial commit + * + * Revision 1.3 2002/03/16 01:46:39 broccol + * Moved the MD5 classes into the md5 package to make 1.4 javac happy + * + * Revision 1.2 1999/11/04 21:38:00 broccol + * Got MD5Crypt calculating the same hash as the OpenBSD md5crypt.c routine. + * + * Revision 1.1 1999/08/05 22:07:03 broccol + * Added support for the MD5 classes. + * + * Revision 1.3 1996/04/15 07:28:09 santtu + * Added GPL statements, and RSA derivate statements. + * + * Revision 1.2 1996/03/04 08:05:48 santtu + * Added offsets to Update method + * + * Revision 1.1 1996/01/07 20:51:59 santtu + * Initial revision + * + */ + +/** + * Contains internal state of the MD5 class + * + * @author Santeri Paavolainen <sjpaavol@cc.helsinki.fi> + */ + +class MD5State { + /** + * 128-byte state + */ + int state[]; + + /** + * 64-bit character count (could be true Java long?) + */ + int count[]; + + /** + * 64-byte buffer (512 bits) for storing to-be-hashed characters + */ + byte buffer[]; + + public MD5State() { + buffer = new byte[64]; + count = new int[2]; + state = new int[4]; + + state[0] = 0x67452301; + state[1] = 0xefcdab89; + state[2] = 0x98badcfe; + state[3] = 0x10325476; + + count[0] = count[1] = 0; + } + + /** Create this State as a copy of another state */ + public MD5State(MD5State from) { + this (); + + int i; + + for (i = 0; i < buffer.length; i++) + this .buffer[i] = from.buffer[i]; + + for (i = 0; i < state.length; i++) + this .state[i] = from.state[i]; + + for (i = 0; i < count.length; i++) + this .count[i] = from.count[i]; + } +}; + +/** + * Implementation of RSA's MD5 hash generator + * + * @version $Revision: 1.1 $ + * @author Santeri Paavolainen <sjpaavol@cc.helsinki.fi> + */ + +public class MD5 { + /** + * MD5 state + */ + MD5State state; + + /** + * If Final() has been called, finals is set to the current finals + * state. Any Update() causes this to be set to null. + */ + MD5State finals; + + /** + * Padding for Final() + */ + static byte padding[] = { (byte) 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + /** + * Initialize MD5 internal state (object can be reused just by + * calling Init() after every Final() + */ + public synchronized void Init() { + state = new MD5State(); + finals = null; + } + + /** + * Class constructor + */ + public MD5() { + this .Init(); + } + + /** + * Initialize class, and update hash with ob.toString() + * + * @param ob Object, ob.toString() is used to update hash + * after initialization + */ + public MD5(Object ob) { + this (); + Update(ob.toString()); + } + + public String debugDump() { + return asHex(); + } + + private int rotate_left(int x, int n) { + return (x << n) | (x >>> (32 - n)); + } + + /* I wonder how many loops and hoops you'll have to go through to + get unsigned add for longs in java */ + + private int uadd(int a, int b) { + long aa, bb; + aa = ((long) a) & 0xffffffffL; + bb = ((long) b) & 0xffffffffL; + + aa += bb; + + return (int) (aa & 0xffffffffL); + } + + private int uadd(int a, int b, int c) { + return uadd(uadd(a, b), c); + } + + private int uadd(int a, int b, int c, int d) { + return uadd(uadd(a, b, c), d); + } + + private int FF(int a, int b, int c, int d, int x, int s, int ac) { + a = uadd(a, ((b & c) | (~b & d)), x, ac); + return uadd(rotate_left(a, s), b); + } + + private int GG(int a, int b, int c, int d, int x, int s, int ac) { + a = uadd(a, ((b & d) | (c & ~d)), x, ac); + return uadd(rotate_left(a, s), b); + } + + private int HH(int a, int b, int c, int d, int x, int s, int ac) { + a = uadd(a, (b ^ c ^ d), x, ac); + return uadd(rotate_left(a, s), b); + } + + private int II(int a, int b, int c, int d, int x, int s, int ac) { + a = uadd(a, (c ^ (b | ~d)), x, ac); + return uadd(rotate_left(a, s), b); + } + + private int[] Decode(byte buffer[], int len, int shift) { + int out[]; + int i, j; + + out = new int[16]; + + for (i = j = 0; j < len; i++, j += 4) { + out[i] = ((int) (buffer[j + shift] & 0xff)) + | (((int) (buffer[j + 1 + shift] & 0xff)) << 8) + | (((int) (buffer[j + 2 + shift] & 0xff)) << 16) + | (((int) (buffer[j + 3 + shift] & 0xff)) << 24); + } + + return out; + } + + private void Transform(MD5State state, byte buffer[], int shift) { + int a = state.state[0], b = state.state[1], c = state.state[2], d = state.state[3], x[]; + + x = Decode(buffer, 64, shift); + + /* Round 1 */ + a = FF(a, b, c, d, x[0], 7, 0xd76aa478); /* 1 */ + d = FF(d, a, b, c, x[1], 12, 0xe8c7b756); /* 2 */ + c = FF(c, d, a, b, x[2], 17, 0x242070db); /* 3 */ + b = FF(b, c, d, a, x[3], 22, 0xc1bdceee); /* 4 */ + a = FF(a, b, c, d, x[4], 7, 0xf57c0faf); /* 5 */ + d = FF(d, a, b, c, x[5], 12, 0x4787c62a); /* 6 */ + c = FF(c, d, a, b, x[6], 17, 0xa8304613); /* 7 */ + b = FF(b, c, d, a, x[7], 22, 0xfd469501); /* 8 */ + a = FF(a, b, c, d, x[8], 7, 0x698098d8); /* 9 */ + d = FF(d, a, b, c, x[9], 12, 0x8b44f7af); /* 10 */ + c = FF(c, d, a, b, x[10], 17, 0xffff5bb1); /* 11 */ + b = FF(b, c, d, a, x[11], 22, 0x895cd7be); /* 12 */ + a = FF(a, b, c, d, x[12], 7, 0x6b901122); /* 13 */ + d = FF(d, a, b, c, x[13], 12, 0xfd987193); /* 14 */ + c = FF(c, d, a, b, x[14], 17, 0xa679438e); /* 15 */ + b = FF(b, c, d, a, x[15], 22, 0x49b40821); /* 16 */ + + /* Round 2 */ + a = GG(a, b, c, d, x[1], 5, 0xf61e2562); /* 17 */ + d = GG(d, a, b, c, x[6], 9, 0xc040b340); /* 18 */ + c = GG(c, d, a, b, x[11], 14, 0x265e5a51); /* 19 */ + b = GG(b, c, d, a, x[0], 20, 0xe9b6c7aa); /* 20 */ + a = GG(a, b, c, d, x[5], 5, 0xd62f105d); /* 21 */ + d = GG(d, a, b, c, x[10], 9, 0x2441453); /* 22 */ + c = GG(c, d, a, b, x[15], 14, 0xd8a1e681); /* 23 */ + b = GG(b, c, d, a, x[4], 20, 0xe7d3fbc8); /* 24 */ + a = GG(a, b, c, d, x[9], 5, 0x21e1cde6); /* 25 */ + d = GG(d, a, b, c, x[14], 9, 0xc33707d6); /* 26 */ + c = GG(c, d, a, b, x[3], 14, 0xf4d50d87); /* 27 */ + b = GG(b, c, d, a, x[8], 20, 0x455a14ed); /* 28 */ + a = GG(a, b, c, d, x[13], 5, 0xa9e3e905); /* 29 */ + d = GG(d, a, b, c, x[2], 9, 0xfcefa3f8); /* 30 */ + c = GG(c, d, a, b, x[7], 14, 0x676f02d9); /* 31 */ + b = GG(b, c, d, a, x[12], 20, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ + a = HH(a, b, c, d, x[5], 4, 0xfffa3942); /* 33 */ + d = HH(d, a, b, c, x[8], 11, 0x8771f681); /* 34 */ + c = HH(c, d, a, b, x[11], 16, 0x6d9d6122); /* 35 */ + b = HH(b, c, d, a, x[14], 23, 0xfde5380c); /* 36 */ + a = HH(a, b, c, d, x[1], 4, 0xa4beea44); /* 37 */ + d = HH(d, a, b, c, x[4], 11, 0x4bdecfa9); /* 38 */ + c = HH(c, d, a, b, x[7], 16, 0xf6bb4b60); /* 39 */ + b = HH(b, c, d, a, x[10], 23, 0xbebfbc70); /* 40 */ + a = HH(a, b, c, d, x[13], 4, 0x289b7ec6); /* 41 */ + d = HH(d, a, b, c, x[0], 11, 0xeaa127fa); /* 42 */ + c = HH(c, d, a, b, x[3], 16, 0xd4ef3085); /* 43 */ + b = HH(b, c, d, a, x[6], 23, 0x4881d05); /* 44 */ + a = HH(a, b, c, d, x[9], 4, 0xd9d4d039); /* 45 */ + d = HH(d, a, b, c, x[12], 11, 0xe6db99e5); /* 46 */ + c = HH(c, d, a, b, x[15], 16, 0x1fa27cf8); /* 47 */ + b = HH(b, c, d, a, x[2], 23, 0xc4ac5665); /* 48 */ + + /* Round 4 */ + a = II(a, b, c, d, x[0], 6, 0xf4292244); /* 49 */ + d = II(d, a, b, c, x[7], 10, 0x432aff97); /* 50 */ + c = II(c, d, a, b, x[14], 15, 0xab9423a7); /* 51 */ + b = II(b, c, d, a, x[5], 21, 0xfc93a039); /* 52 */ + a = II(a, b, c, d, x[12], 6, 0x655b59c3); /* 53 */ + d = II(d, a, b, c, x[3], 10, 0x8f0ccc92); /* 54 */ + c = II(c, d, a, b, x[10], 15, 0xffeff47d); /* 55 */ + b = II(b, c, d, a, x[1], 21, 0x85845dd1); /* 56 */ + a = II(a, b, c, d, x[8], 6, 0x6fa87e4f); /* 57 */ + d = II(d, a, b, c, x[15], 10, 0xfe2ce6e0); /* 58 */ + c = II(c, d, a, b, x[6], 15, 0xa3014314); /* 59 */ + b = II(b, c, d, a, x[13], 21, 0x4e0811a1); /* 60 */ + a = II(a, b, c, d, x[4], 6, 0xf7537e82); /* 61 */ + d = II(d, a, b, c, x[11], 10, 0xbd3af235); /* 62 */ + c = II(c, d, a, b, x[2], 15, 0x2ad7d2bb); /* 63 */ + b = II(b, c, d, a, x[9], 21, 0xeb86d391); /* 64 */ + + state.state[0] += a; + state.state[1] += b; + state.state[2] += c; + state.state[3] += d; + } + + /** + * Updates hash with the bytebuffer given (using at maximum length bytes from + * that buffer) + * + * @param stat Which state is updated + * @param buffer Array of bytes to be hashed + * @param offset Offset to buffer array + * @param length Use at maximum `length' bytes (absolute + * maximum is buffer.length) + */ + public void Update(MD5State stat, byte buffer[], int offset, + int length) { + int index, partlen, i, start; + + finals = null; + + /* Length can be told to be shorter, but not inter */ + if ((length - offset) > buffer.length) + length = buffer.length - offset; + + /* compute number of bytes mod 64 */ + index = (int) (stat.count[0] >>> 3) & 0x3f; + + if ((stat.count[0] += (length << 3)) < (length << 3)) + stat.count[1]++; + + stat.count[1] += length >>> 29; + + partlen = 64 - index; + + if (length >= partlen) { + for (i = 0; i < partlen; i++) + stat.buffer[i + index] = buffer[i + offset]; + + Transform(stat, stat.buffer, 0); + + for (i = partlen; (i + 63) < length; i += 64) + Transform(stat, buffer, i); + + index = 0; + } else + i = 0; + + /* buffer remaining input */ + if (i < length) { + start = i; + for (; i < length; i++) + stat.buffer[index + i - start] = buffer[i + offset]; + } + } + + /* + * Update()s for other datatypes than byte[] also. Update(byte[], int) + * is only the main driver. + */ + + /** + * Plain update, updates this object + */ + + public void Update(byte buffer[], int offset, int length) { + Update(this .state, buffer, offset, length); + } + + public void Update(byte buffer[], int length) { + Update(this .state, buffer, 0, length); + } + + /** + * Updates hash with given array of bytes + * + * @param buffer Array of bytes to use for updating the hash + */ + public void Update(byte buffer[]) { + Update(buffer, 0, buffer.length); + } + + /** + * Updates hash with a single byte + * + * @param b Single byte to update the hash + */ + public void Update(byte b) { + byte buffer[] = new byte[1]; + buffer[0] = b; + + Update(buffer, 1); + } + + /** + * Update buffer with given string. + * + * @param s String to be update to hash (is used as + * s.getBytes()) + */ + public void Update(String s) { + byte chars[]; + + chars = s.getBytes(); + + Update(chars, chars.length); + } + + private byte[] Encode(int input[], int len) { + int i, j; + byte out[]; + + out = new byte[len]; + + for (i = j = 0; j < len; i++, j += 4) { + out[j] = (byte) (input[i] & 0xff); + out[j + 1] = (byte) ((input[i] >>> 8) & 0xff); + out[j + 2] = (byte) ((input[i] >>> 16) & 0xff); + out[j + 3] = (byte) ((input[i] >>> 24) & 0xff); + } + + return out; + } + + /** + * Returns array of bytes (16 bytes) representing hash as of the + * current state of this object. Note: getting a hash does not + * invalidate the hash object, it only creates a copy of the real + * state which is finalized. + * + * @return Array of 16 bytes, the hash of all updated bytes + */ + public synchronized byte[] Final() { + byte bits[]; + int index, padlen; + MD5State fin; + + if (finals == null) { + fin = new MD5State(state); + + bits = Encode(fin.count, 8); + + index = (int) ((fin.count[0] >>> 3) & 0x3f); + padlen = (index < 56) ? (56 - index) : (120 - index); + + Update(fin, padding, 0, padlen); + /**/ + Update(fin, bits, 0, 8); + + /* Update() sets finalds to null */ + finals = fin; + } + + return Encode(finals.state, 16); + } + + /** + * Turns array of bytes into string representing each byte as + * unsigned hex number. + * + * @param hash Array of bytes to convert to hex-string + * @return Generated hex string + */ + public static String asHex(byte hash[]) { + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) { + if (((int) hash[i] & 0xff) < 0x10) + buf.append("0"); + + buf.append(Long.toString((int) hash[i] & 0xff, 16)); + } + + return buf.toString(); + } + + /** + * Returns 32-character hex representation of this objects hash + * + * @return String of this object's hash + */ + public String asHex() { + return asHex(this .Final()); + } + + /** + * One-stop md5 string encrypting. + */ + + public static String md5crypt(String input) { + MD5 md5 = new MD5(); + md5.Init(); + md5.Update(input); + return md5.asHex(); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5Crypt.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5Crypt.java new file mode 100644 index 00000000..443053b2 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/MD5Crypt.java @@ -0,0 +1,341 @@ +package com.gluster.storage.management.core.utils; + + +/*------------------------------------------------------------------------------ + class + MD5Crypt + + ------------------------------------------------------------------------------*/ + +/** + * <p>This class defines a method, + * {@link MD5Crypt#crypt(java.lang.String, java.lang.String) crypt()}, which + * takes a password and a salt string and generates an OpenBSD/FreeBSD/Linux-compatible + * md5-encoded password entry.</p> + * + * <p>Created: 3 November 1999</p> + * <p>Release: $Name: $</p> + * <p>Version: $Revision: 1.1 $</p> + * <p>Last Mod Date: $Date: 2004/07/12 13:35:20 $</p> + * <p>Java Code By: Jonathan Abbey, jonabbey@arlut.utexas.edu</p> + * <p>Original C Version:<pre> + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + * </pre></p> + * + * @author Jonathan Abbey <jonabbey at arlut.utexas.edu> + */ + +public final class MD5Crypt { + + /** + * + * Command line test rig. + * + */ + + static public void main(String argv[]) { + if ((argv.length < 1) || (argv.length > 3)) { + System.err + .println("Usage: MD5Crypt [-apache] password salt"); + System.exit(1); + } + + if (argv.length == 3) { + System.err.println(MD5Crypt.apacheCrypt(argv[1], argv[2])); + } else if (argv.length == 2) { + System.err.println(MD5Crypt.crypt(argv[0], argv[1])); + } else { + System.err.println(MD5Crypt.crypt(argv[0])); + } + + System.exit(0); + } + + static private final String SALTCHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; + + static private final String itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + static private final String to64(long v, int size) { + StringBuffer result = new StringBuffer(); + + while (--size >= 0) { + result.append(itoa64.charAt((int) (v & 0x3f))); + v >>>= 6; + } + + return result.toString(); + } + + static private final void clearbits(byte bits[]) { + for (int i = 0; i < bits.length; i++) { + bits[i] = 0; + } + } + + /** + * convert an encoded unsigned byte value into a int + * with the unsigned value. + */ + + static private final int bytes2u(byte inp) { + return (int) inp & 0xff; + } + + /** + * <p>This method actually generates a OpenBSD/FreeBSD/Linux PAM compatible + * md5-encoded password hash from a plaintext password and a + * salt.</p> + * + * <p>The resulting string will be in the form '$1$<salt>$<hashed mess></p> + * + * @param password Plaintext password + * + * @return An OpenBSD/FreeBSD/Linux-compatible md5-hashed password field. + */ + + static public final String crypt(String password) { + StringBuffer salt = new StringBuffer(); + java.util.Random randgen = new java.util.Random(); + + /* -- */ + + while (salt.length() < 8) { + int index = (int) (randgen.nextFloat() * SALTCHARS.length()); + salt.append(SALTCHARS.substring(index, index + 1)); + } + + return MD5Crypt.crypt(password, salt.toString()); + } + + /** + * <p>This method actually generates a OpenBSD/FreeBSD/Linux PAM compatible + * md5-encoded password hash from a plaintext password and a + * salt.</p> + * + * <p>The resulting string will be in the form '$1$<salt>$<hashed mess></p> + * + * @param password Plaintext password + * @param salt A short string to use to randomize md5. May start with $1$, which + * will be ignored. It is explicitly permitted to pass a pre-existing + * MD5Crypt'ed password entry as the salt. crypt() will strip the salt + * chars out properly. + * + * @return An OpenBSD/FreeBSD/Linux-compatible md5-hashed password field. + */ + + static public final String crypt(String password, String salt) { + return MD5Crypt.crypt(password, salt, "$1$"); + } + + /** + * <p>This method generates an Apache MD5 compatible + * md5-encoded password hash from a plaintext password and a + * salt.</p> + * + * <p>The resulting string will be in the form '$apr1$<salt>$<hashed mess></p> + * + * @param password Plaintext password + * + * @return An Apache-compatible md5-hashed password string. + */ + + static public final String apacheCrypt(String password) { + StringBuffer salt = new StringBuffer(); + java.util.Random randgen = new java.util.Random(); + + /* -- */ + + while (salt.length() < 8) { + int index = (int) (randgen.nextFloat() * SALTCHARS.length()); + salt.append(SALTCHARS.substring(index, index + 1)); + } + + return MD5Crypt.apacheCrypt(password, salt.toString()); + } + + /** + * <p>This method actually generates an Apache MD5 compatible + * md5-encoded password hash from a plaintext password and a + * salt.</p> + * + * <p>The resulting string will be in the form '$apr1$<salt>$<hashed mess></p> + * + * @param password Plaintext password + * @param salt A short string to use to randomize md5. May start with $apr1$, which + * will be ignored. It is explicitly permitted to pass a pre-existing + * MD5Crypt'ed password entry as the salt. crypt() will strip the salt + * chars out properly. + * + * @return An Apache-compatible md5-hashed password string. + */ + + static public final String apacheCrypt(String password, String salt) { + return MD5Crypt.crypt(password, salt, "$apr1$"); + } + + /** + * <p>This method actually generates md5-encoded password hash from + * a plaintext password, a salt, and a magic string.</p> + * + * <p>There are two magic strings that make sense to use here.. '$1$' is the + * magic string used by the FreeBSD/Linux/OpenBSD MD5Crypt algorithm, and + * '$apr1$' is the magic string used by the Apache MD5Crypt algorithm.</p> + * + * <p>The resulting string will be in the form '<magic><salt>$<hashed mess></p> + * + * @param password Plaintext password @param salt A short string to + * use to randomize md5. May start with the magic string, which + * will be ignored. It is explicitly permitted to pass a + * pre-existing MD5Crypt'ed password entry as the salt. crypt() + * will strip the salt chars out properly. + * + * @return An md5-hashed password string. + */ + + static public final String crypt(String password, String salt, + String magic) { + /* This string is magic for this algorithm. Having it this way, + * we can get get better later on */ + + byte finalState[]; + MD5 ctx, ctx1; + long l; + + /* -- */ + + /* Refine the Salt first */ + + /* If it starts with the magic string, then skip that */ + + if (salt.startsWith(magic)) { + salt = salt.substring(magic.length()); + } + + /* It stops at the first '$', max 8 chars */ + + if (salt.indexOf('$') != -1) { + salt = salt.substring(0, salt.indexOf('$')); + } + + if (salt.length() > 8) { + salt = salt.substring(0, 8); + } + + ctx = new MD5(); + + ctx.Update(password); // The password first, since that is what is most unknown + ctx.Update(magic); // Then our magic string + ctx.Update(salt); // Then the raw salt + + /* Then just as many characters of the MD5(pw,salt,pw) */ + + ctx1 = new MD5(); + ctx1.Update(password); + ctx1.Update(salt); + ctx1.Update(password); + finalState = ctx1.Final(); + + for (int pl = password.length(); pl > 0; pl -= 16) { + ctx.Update(finalState, pl > 16 ? 16 : pl); + } + + /* the original code claimed that finalState was being cleared + to keep dangerous bits out of memory, but doing this is also + required in order to get the right output. */ + + clearbits(finalState); + + /* Then something really weird... */ + + for (int i = password.length(); i != 0; i >>>= 1) { + if ((i & 1) != 0) { + ctx.Update(finalState, 1); + } else { + ctx.Update(password.getBytes(), 1); + } + } + + finalState = ctx.Final(); + + /* + * and now, just to make sure things don't run too fast + * On a 60 Mhz Pentium this takes 34 msec, so you would + * need 30 seconds to build a 1000 entry dictionary... + * + * (The above timings from the C version) + */ + + for (int i = 0; i < 1000; i++) { + ctx1 = new MD5(); + + if ((i & 1) != 0) { + ctx1.Update(password); + } else { + ctx1.Update(finalState, 16); + } + + if ((i % 3) != 0) { + ctx1.Update(salt); + } + + if ((i % 7) != 0) { + ctx1.Update(password); + } + + if ((i & 1) != 0) { + ctx1.Update(finalState, 16); + } else { + ctx1.Update(password); + } + + finalState = ctx1.Final(); + } + + /* Now make the output string */ + + StringBuffer result = new StringBuffer(); + + result.append(magic); + result.append(salt); + result.append("$"); + + l = (bytes2u(finalState[0]) << 16) + | (bytes2u(finalState[6]) << 8) + | bytes2u(finalState[12]); + result.append(to64(l, 4)); + + l = (bytes2u(finalState[1]) << 16) + | (bytes2u(finalState[7]) << 8) + | bytes2u(finalState[13]); + result.append(to64(l, 4)); + + l = (bytes2u(finalState[2]) << 16) + | (bytes2u(finalState[8]) << 8) + | bytes2u(finalState[14]); + result.append(to64(l, 4)); + + l = (bytes2u(finalState[3]) << 16) + | (bytes2u(finalState[9]) << 8) + | bytes2u(finalState[15]); + result.append(to64(l, 4)); + + l = (bytes2u(finalState[4]) << 16) + | (bytes2u(finalState[10]) << 8) + | bytes2u(finalState[5]); + result.append(to64(l, 4)); + + l = bytes2u(finalState[11]); + result.append(to64(l, 2)); + + /* Don't leave anything around in vm they could use. */ + clearbits(finalState); + + return result.toString(); + } +} + diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/NumberUtil.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/NumberUtil.java new file mode 100644 index 00000000..fb32121e --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/NumberUtil.java @@ -0,0 +1,12 @@ +package com.gluster.storage.management.core.utils; + +import java.text.NumberFormat; + +public class NumberUtil { + public static final String formatNumber(double num) { + NumberFormat formatter = NumberFormat.getNumberInstance(); + formatter.setMinimumFractionDigits(2); + formatter.setMaximumFractionDigits(2); + return formatter.format(num); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessResult.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessResult.java new file mode 100644 index 00000000..32cd53ba --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessResult.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> + * This file is part of GlusterFS. + * + * Gluster Storage Platform is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, + * or (at your option) any later version. + * + * GlusterFS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ +package com.gluster.storage.management.core.utils; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Represents the result of a command execution in a separate process. + * Consists of the "exit status" of the process and output from the process. + * The output includes stdout as well as stderr streams + */ +@XmlRootElement +public class ProcessResult { + + public static final int SUCCESS = 0; + private int exitValue; + private String output; + + // Required for JAXB de-serialization + public ProcessResult() { + + } + + public ProcessResult(int exitValue, String output) { + this.exitValue = exitValue; + this.output = output; + } + + public int getExitValue() { + return exitValue; + } + + public void setExitValue(int exitValue) { + this.exitValue = exitValue; + } + + public String getOutput() { + return output; + } + + public void setOutput(String output) { + this.output = output; + } + + public boolean isSuccess() { + return exitValue == SUCCESS; + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessUtil.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessUtil.java new file mode 100644 index 00000000..2ec8e8a4 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/ProcessUtil.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> + * This file is part of GlusterFS. + * + * GlusterFS is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, + * or (at your option) any later version. + * + * GlusterFS is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ +package com.gluster.storage.management.core.utils; + +import static com.gluster.storage.management.core.constants.CoreConstants.NEWLINE; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; + +/** + * Utility class for creating processes (foreground/background) with given + * command and checking the output/exit status + */ +public class ProcessUtil { + + private static final ProcessUtil instance = new ProcessUtil(); + + public ProcessResult executeCommand(List<String> command) { + return executeCommand(true, command); + } + + /** + * Executes given command in a separate process in FOREGROUND + * @param command + * @return {@link ProcessResult} object + */ + public ProcessResult executeCommand(String... command) { + ArrayList<String> commandList = new ArrayList<String>(); + for (String part : command) { + commandList.add(part); + } + return executeCommand(commandList); + } + + /** + * Executes given command in foreground/background + * @param command + * @param runInForeground Boolean flag indicating whether the command should + * be executed in foreground + * @return {@link ProcessResult} object + */ + public ProcessResult executeCommand(boolean runInForeground, List<String> command) { + StringBuilder output = new StringBuilder(); + try { + Process process = new ProcessBuilder(command).redirectErrorStream(true).start(); + + if (runInForeground) { + process.waitFor(); // Wait for process to finish + + InputStream is = process.getInputStream(); + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + String line; + + while ((line = br.readLine()) != null) { + output.append(line); + output.append(NEWLINE); + } + } else { + output.append("Command ["); + output.append(command); + output.append("] triggerred in background."); + } + + return new ProcessResult(process.exitValue(), output.toString()); + } catch (Throwable e) { + throw new GlusterRuntimeException("Exception while executing command [" + command + "]", e); + } + } + + public static void main(String args[]) { + ProcessResult result = new ProcessUtil().executeCommand("ls", "-lrt", "/"); + System.out.println(result.getExitValue()); + System.out.println(result.getOutput()); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtils.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtils.java new file mode 100644 index 00000000..356fe007 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtils.java @@ -0,0 +1,10 @@ +package com.gluster.storage.management.core.utils; + +public class StringUtils { + public static boolean filterString(String sourceString, + String filterString, boolean caseSensitive) { + return caseSensitive ? sourceString.contains(filterString) + : sourceString.toLowerCase().contains( + filterString.toLowerCase()); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/UnixCrypt.java b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/UnixCrypt.java new file mode 100644 index 00000000..693ce621 --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/UnixCrypt.java @@ -0,0 +1,684 @@ +/** + * This class provides us with the ability to encrypt passwords when sent + * over the network stream + * + * <P>Contains static methods to encrypt and compare + * passwords with Unix encrypted passwords.</P> + * + * <P>See <A HREF="http://www.zeh.com/local/jfd/crypt.html"> + * John Dumas's Java Crypt page</A> for the original source.</P> + * + * @author jdumas@zgs.com (John Dumas) + */ +package com.gluster.storage.management.core.utils; + +public class UnixCrypt extends Object +{ + // + // Null constructor - can't instantiate class + private UnixCrypt() + { + } + + private static final char[] saltChars = + ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./".toCharArray()); + + private static final int ITERATIONS = 16; + + private static final int con_salt[] = + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0A, 0x0B, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, + 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, + 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, + 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, + 0x23, 0x24, 0x25, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, + 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, + 0x3D, 0x3E, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + + private static final boolean shifts2[] = + { + false, false, true, true, true, true, true, true, + false, true, true, true, true, true, true, false + }; + + private static final int skb[][] = + { + { + /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ + 0x00000000, 0x00000010, 0x20000000, 0x20000010, + 0x00010000, 0x00010010, 0x20010000, 0x20010010, + 0x00000800, 0x00000810, 0x20000800, 0x20000810, + 0x00010800, 0x00010810, 0x20010800, 0x20010810, + 0x00000020, 0x00000030, 0x20000020, 0x20000030, + 0x00010020, 0x00010030, 0x20010020, 0x20010030, + 0x00000820, 0x00000830, 0x20000820, 0x20000830, + 0x00010820, 0x00010830, 0x20010820, 0x20010830, + 0x00080000, 0x00080010, 0x20080000, 0x20080010, + 0x00090000, 0x00090010, 0x20090000, 0x20090010, + 0x00080800, 0x00080810, 0x20080800, 0x20080810, + 0x00090800, 0x00090810, 0x20090800, 0x20090810, + 0x00080020, 0x00080030, 0x20080020, 0x20080030, + 0x00090020, 0x00090030, 0x20090020, 0x20090030, + 0x00080820, 0x00080830, 0x20080820, 0x20080830, + 0x00090820, 0x00090830, 0x20090820, 0x20090830, + }, + { + /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ + 0x00000000, 0x02000000, 0x00002000, 0x02002000, + 0x00200000, 0x02200000, 0x00202000, 0x02202000, + 0x00000004, 0x02000004, 0x00002004, 0x02002004, + 0x00200004, 0x02200004, 0x00202004, 0x02202004, + 0x00000400, 0x02000400, 0x00002400, 0x02002400, + 0x00200400, 0x02200400, 0x00202400, 0x02202400, + 0x00000404, 0x02000404, 0x00002404, 0x02002404, + 0x00200404, 0x02200404, 0x00202404, 0x02202404, + 0x10000000, 0x12000000, 0x10002000, 0x12002000, + 0x10200000, 0x12200000, 0x10202000, 0x12202000, + 0x10000004, 0x12000004, 0x10002004, 0x12002004, + 0x10200004, 0x12200004, 0x10202004, 0x12202004, + 0x10000400, 0x12000400, 0x10002400, 0x12002400, + 0x10200400, 0x12200400, 0x10202400, 0x12202400, + 0x10000404, 0x12000404, 0x10002404, 0x12002404, + 0x10200404, 0x12200404, 0x10202404, 0x12202404, + }, + { + /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ + 0x00000000, 0x00000001, 0x00040000, 0x00040001, + 0x01000000, 0x01000001, 0x01040000, 0x01040001, + 0x00000002, 0x00000003, 0x00040002, 0x00040003, + 0x01000002, 0x01000003, 0x01040002, 0x01040003, + 0x00000200, 0x00000201, 0x00040200, 0x00040201, + 0x01000200, 0x01000201, 0x01040200, 0x01040201, + 0x00000202, 0x00000203, 0x00040202, 0x00040203, + 0x01000202, 0x01000203, 0x01040202, 0x01040203, + 0x08000000, 0x08000001, 0x08040000, 0x08040001, + 0x09000000, 0x09000001, 0x09040000, 0x09040001, + 0x08000002, 0x08000003, 0x08040002, 0x08040003, + 0x09000002, 0x09000003, 0x09040002, 0x09040003, + 0x08000200, 0x08000201, 0x08040200, 0x08040201, + 0x09000200, 0x09000201, 0x09040200, 0x09040201, + 0x08000202, 0x08000203, 0x08040202, 0x08040203, + 0x09000202, 0x09000203, 0x09040202, 0x09040203, + }, + { + /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ + 0x00000000, 0x00100000, 0x00000100, 0x00100100, + 0x00000008, 0x00100008, 0x00000108, 0x00100108, + 0x00001000, 0x00101000, 0x00001100, 0x00101100, + 0x00001008, 0x00101008, 0x00001108, 0x00101108, + 0x04000000, 0x04100000, 0x04000100, 0x04100100, + 0x04000008, 0x04100008, 0x04000108, 0x04100108, + 0x04001000, 0x04101000, 0x04001100, 0x04101100, + 0x04001008, 0x04101008, 0x04001108, 0x04101108, + 0x00020000, 0x00120000, 0x00020100, 0x00120100, + 0x00020008, 0x00120008, 0x00020108, 0x00120108, + 0x00021000, 0x00121000, 0x00021100, 0x00121100, + 0x00021008, 0x00121008, 0x00021108, 0x00121108, + 0x04020000, 0x04120000, 0x04020100, 0x04120100, + 0x04020008, 0x04120008, 0x04020108, 0x04120108, + 0x04021000, 0x04121000, 0x04021100, 0x04121100, + 0x04021008, 0x04121008, 0x04021108, 0x04121108, + }, + { + /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ + 0x00000000, 0x10000000, 0x00010000, 0x10010000, + 0x00000004, 0x10000004, 0x00010004, 0x10010004, + 0x20000000, 0x30000000, 0x20010000, 0x30010000, + 0x20000004, 0x30000004, 0x20010004, 0x30010004, + 0x00100000, 0x10100000, 0x00110000, 0x10110000, + 0x00100004, 0x10100004, 0x00110004, 0x10110004, + 0x20100000, 0x30100000, 0x20110000, 0x30110000, + 0x20100004, 0x30100004, 0x20110004, 0x30110004, + 0x00001000, 0x10001000, 0x00011000, 0x10011000, + 0x00001004, 0x10001004, 0x00011004, 0x10011004, + 0x20001000, 0x30001000, 0x20011000, 0x30011000, + 0x20001004, 0x30001004, 0x20011004, 0x30011004, + 0x00101000, 0x10101000, 0x00111000, 0x10111000, + 0x00101004, 0x10101004, 0x00111004, 0x10111004, + 0x20101000, 0x30101000, 0x20111000, 0x30111000, + 0x20101004, 0x30101004, 0x20111004, 0x30111004, + }, + { + /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ + 0x00000000, 0x08000000, 0x00000008, 0x08000008, + 0x00000400, 0x08000400, 0x00000408, 0x08000408, + 0x00020000, 0x08020000, 0x00020008, 0x08020008, + 0x00020400, 0x08020400, 0x00020408, 0x08020408, + 0x00000001, 0x08000001, 0x00000009, 0x08000009, + 0x00000401, 0x08000401, 0x00000409, 0x08000409, + 0x00020001, 0x08020001, 0x00020009, 0x08020009, + 0x00020401, 0x08020401, 0x00020409, 0x08020409, + 0x02000000, 0x0A000000, 0x02000008, 0x0A000008, + 0x02000400, 0x0A000400, 0x02000408, 0x0A000408, + 0x02020000, 0x0A020000, 0x02020008, 0x0A020008, + 0x02020400, 0x0A020400, 0x02020408, 0x0A020408, + 0x02000001, 0x0A000001, 0x02000009, 0x0A000009, + 0x02000401, 0x0A000401, 0x02000409, 0x0A000409, + 0x02020001, 0x0A020001, 0x02020009, 0x0A020009, + 0x02020401, 0x0A020401, 0x02020409, 0x0A020409, + }, + { + /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ + 0x00000000, 0x00000100, 0x00080000, 0x00080100, + 0x01000000, 0x01000100, 0x01080000, 0x01080100, + 0x00000010, 0x00000110, 0x00080010, 0x00080110, + 0x01000010, 0x01000110, 0x01080010, 0x01080110, + 0x00200000, 0x00200100, 0x00280000, 0x00280100, + 0x01200000, 0x01200100, 0x01280000, 0x01280100, + 0x00200010, 0x00200110, 0x00280010, 0x00280110, + 0x01200010, 0x01200110, 0x01280010, 0x01280110, + 0x00000200, 0x00000300, 0x00080200, 0x00080300, + 0x01000200, 0x01000300, 0x01080200, 0x01080300, + 0x00000210, 0x00000310, 0x00080210, 0x00080310, + 0x01000210, 0x01000310, 0x01080210, 0x01080310, + 0x00200200, 0x00200300, 0x00280200, 0x00280300, + 0x01200200, 0x01200300, 0x01280200, 0x01280300, + 0x00200210, 0x00200310, 0x00280210, 0x00280310, + 0x01200210, 0x01200310, 0x01280210, 0x01280310, + }, + { + /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ + 0x00000000, 0x04000000, 0x00040000, 0x04040000, + 0x00000002, 0x04000002, 0x00040002, 0x04040002, + 0x00002000, 0x04002000, 0x00042000, 0x04042000, + 0x00002002, 0x04002002, 0x00042002, 0x04042002, + 0x00000020, 0x04000020, 0x00040020, 0x04040020, + 0x00000022, 0x04000022, 0x00040022, 0x04040022, + 0x00002020, 0x04002020, 0x00042020, 0x04042020, + 0x00002022, 0x04002022, 0x00042022, 0x04042022, + 0x00000800, 0x04000800, 0x00040800, 0x04040800, + 0x00000802, 0x04000802, 0x00040802, 0x04040802, + 0x00002800, 0x04002800, 0x00042800, 0x04042800, + 0x00002802, 0x04002802, 0x00042802, 0x04042802, + 0x00000820, 0x04000820, 0x00040820, 0x04040820, + 0x00000822, 0x04000822, 0x00040822, 0x04040822, + 0x00002820, 0x04002820, 0x00042820, 0x04042820, + 0x00002822, 0x04002822, 0x00042822, 0x04042822, + }, + }; + + private static final int SPtrans[][] = + { + { + /* nibble 0 */ + 0x00820200, 0x00020000, 0x80800000, 0x80820200, + 0x00800000, 0x80020200, 0x80020000, 0x80800000, + 0x80020200, 0x00820200, 0x00820000, 0x80000200, + 0x80800200, 0x00800000, 0x00000000, 0x80020000, + 0x00020000, 0x80000000, 0x00800200, 0x00020200, + 0x80820200, 0x00820000, 0x80000200, 0x00800200, + 0x80000000, 0x00000200, 0x00020200, 0x80820000, + 0x00000200, 0x80800200, 0x80820000, 0x00000000, + 0x00000000, 0x80820200, 0x00800200, 0x80020000, + 0x00820200, 0x00020000, 0x80000200, 0x00800200, + 0x80820000, 0x00000200, 0x00020200, 0x80800000, + 0x80020200, 0x80000000, 0x80800000, 0x00820000, + 0x80820200, 0x00020200, 0x00820000, 0x80800200, + 0x00800000, 0x80000200, 0x80020000, 0x00000000, + 0x00020000, 0x00800000, 0x80800200, 0x00820200, + 0x80000000, 0x80820000, 0x00000200, 0x80020200, + }, + { + /* nibble 1 */ + 0x10042004, 0x00000000, 0x00042000, 0x10040000, + 0x10000004, 0x00002004, 0x10002000, 0x00042000, + 0x00002000, 0x10040004, 0x00000004, 0x10002000, + 0x00040004, 0x10042000, 0x10040000, 0x00000004, + 0x00040000, 0x10002004, 0x10040004, 0x00002000, + 0x00042004, 0x10000000, 0x00000000, 0x00040004, + 0x10002004, 0x00042004, 0x10042000, 0x10000004, + 0x10000000, 0x00040000, 0x00002004, 0x10042004, + 0x00040004, 0x10042000, 0x10002000, 0x00042004, + 0x10042004, 0x00040004, 0x10000004, 0x00000000, + 0x10000000, 0x00002004, 0x00040000, 0x10040004, + 0x00002000, 0x10000000, 0x00042004, 0x10002004, + 0x10042000, 0x00002000, 0x00000000, 0x10000004, + 0x00000004, 0x10042004, 0x00042000, 0x10040000, + 0x10040004, 0x00040000, 0x00002004, 0x10002000, + 0x10002004, 0x00000004, 0x10040000, 0x00042000, + }, + { + /* nibble 2 */ + 0x41000000, 0x01010040, 0x00000040, 0x41000040, + 0x40010000, 0x01000000, 0x41000040, 0x00010040, + 0x01000040, 0x00010000, 0x01010000, 0x40000000, + 0x41010040, 0x40000040, 0x40000000, 0x41010000, + 0x00000000, 0x40010000, 0x01010040, 0x00000040, + 0x40000040, 0x41010040, 0x00010000, 0x41000000, + 0x41010000, 0x01000040, 0x40010040, 0x01010000, + 0x00010040, 0x00000000, 0x01000000, 0x40010040, + 0x01010040, 0x00000040, 0x40000000, 0x00010000, + 0x40000040, 0x40010000, 0x01010000, 0x41000040, + 0x00000000, 0x01010040, 0x00010040, 0x41010000, + 0x40010000, 0x01000000, 0x41010040, 0x40000000, + 0x40010040, 0x41000000, 0x01000000, 0x41010040, + 0x00010000, 0x01000040, 0x41000040, 0x00010040, + 0x01000040, 0x00000000, 0x41010000, 0x40000040, + 0x41000000, 0x40010040, 0x00000040, 0x01010000, + }, + { + /* nibble 3 */ + 0x00100402, 0x04000400, 0x00000002, 0x04100402, + 0x00000000, 0x04100000, 0x04000402, 0x00100002, + 0x04100400, 0x04000002, 0x04000000, 0x00000402, + 0x04000002, 0x00100402, 0x00100000, 0x04000000, + 0x04100002, 0x00100400, 0x00000400, 0x00000002, + 0x00100400, 0x04000402, 0x04100000, 0x00000400, + 0x00000402, 0x00000000, 0x00100002, 0x04100400, + 0x04000400, 0x04100002, 0x04100402, 0x00100000, + 0x04100002, 0x00000402, 0x00100000, 0x04000002, + 0x00100400, 0x04000400, 0x00000002, 0x04100000, + 0x04000402, 0x00000000, 0x00000400, 0x00100002, + 0x00000000, 0x04100002, 0x04100400, 0x00000400, + 0x04000000, 0x04100402, 0x00100402, 0x00100000, + 0x04100402, 0x00000002, 0x04000400, 0x00100402, + 0x00100002, 0x00100400, 0x04100000, 0x04000402, + 0x00000402, 0x04000000, 0x04000002, 0x04100400, + }, + { + /* nibble 4 */ + 0x02000000, 0x00004000, 0x00000100, 0x02004108, + 0x02004008, 0x02000100, 0x00004108, 0x02004000, + 0x00004000, 0x00000008, 0x02000008, 0x00004100, + 0x02000108, 0x02004008, 0x02004100, 0x00000000, + 0x00004100, 0x02000000, 0x00004008, 0x00000108, + 0x02000100, 0x00004108, 0x00000000, 0x02000008, + 0x00000008, 0x02000108, 0x02004108, 0x00004008, + 0x02004000, 0x00000100, 0x00000108, 0x02004100, + 0x02004100, 0x02000108, 0x00004008, 0x02004000, + 0x00004000, 0x00000008, 0x02000008, 0x02000100, + 0x02000000, 0x00004100, 0x02004108, 0x00000000, + 0x00004108, 0x02000000, 0x00000100, 0x00004008, + 0x02000108, 0x00000100, 0x00000000, 0x02004108, + 0x02004008, 0x02004100, 0x00000108, 0x00004000, + 0x00004100, 0x02004008, 0x02000100, 0x00000108, + 0x00000008, 0x00004108, 0x02004000, 0x02000008, + }, + { + /* nibble 5 */ + 0x20000010, 0x00080010, 0x00000000, 0x20080800, + 0x00080010, 0x00000800, 0x20000810, 0x00080000, + 0x00000810, 0x20080810, 0x00080800, 0x20000000, + 0x20000800, 0x20000010, 0x20080000, 0x00080810, + 0x00080000, 0x20000810, 0x20080010, 0x00000000, + 0x00000800, 0x00000010, 0x20080800, 0x20080010, + 0x20080810, 0x20080000, 0x20000000, 0x00000810, + 0x00000010, 0x00080800, 0x00080810, 0x20000800, + 0x00000810, 0x20000000, 0x20000800, 0x00080810, + 0x20080800, 0x00080010, 0x00000000, 0x20000800, + 0x20000000, 0x00000800, 0x20080010, 0x00080000, + 0x00080010, 0x20080810, 0x00080800, 0x00000010, + 0x20080810, 0x00080800, 0x00080000, 0x20000810, + 0x20000010, 0x20080000, 0x00080810, 0x00000000, + 0x00000800, 0x20000010, 0x20000810, 0x20080800, + 0x20080000, 0x00000810, 0x00000010, 0x20080010, + }, + { + /* nibble 6 */ + 0x00001000, 0x00000080, 0x00400080, 0x00400001, + 0x00401081, 0x00001001, 0x00001080, 0x00000000, + 0x00400000, 0x00400081, 0x00000081, 0x00401000, + 0x00000001, 0x00401080, 0x00401000, 0x00000081, + 0x00400081, 0x00001000, 0x00001001, 0x00401081, + 0x00000000, 0x00400080, 0x00400001, 0x00001080, + 0x00401001, 0x00001081, 0x00401080, 0x00000001, + 0x00001081, 0x00401001, 0x00000080, 0x00400000, + 0x00001081, 0x00401000, 0x00401001, 0x00000081, + 0x00001000, 0x00000080, 0x00400000, 0x00401001, + 0x00400081, 0x00001081, 0x00001080, 0x00000000, + 0x00000080, 0x00400001, 0x00000001, 0x00400080, + 0x00000000, 0x00400081, 0x00400080, 0x00001080, + 0x00000081, 0x00001000, 0x00401081, 0x00400000, + 0x00401080, 0x00000001, 0x00001001, 0x00401081, + 0x00400001, 0x00401080, 0x00401000, 0x00001001, + }, + { + /* nibble 7 */ + 0x08200020, 0x08208000, 0x00008020, 0x00000000, + 0x08008000, 0x00200020, 0x08200000, 0x08208020, + 0x00000020, 0x08000000, 0x00208000, 0x00008020, + 0x00208020, 0x08008020, 0x08000020, 0x08200000, + 0x00008000, 0x00208020, 0x00200020, 0x08008000, + 0x08208020, 0x08000020, 0x00000000, 0x00208000, + 0x08000000, 0x00200000, 0x08008020, 0x08200020, + 0x00200000, 0x00008000, 0x08208000, 0x00000020, + 0x00200000, 0x00008000, 0x08000020, 0x08208020, + 0x00008020, 0x08000000, 0x00000000, 0x00208000, + 0x08200020, 0x08008020, 0x08008000, 0x00200020, + 0x08208000, 0x00000020, 0x00200020, 0x08008000, + 0x08208020, 0x00200000, 0x08200000, 0x08000020, + 0x00208000, 0x00008020, 0x08008020, 0x08200000, + 0x00000020, 0x08208000, 0x00208020, 0x00000000, + 0x08000000, 0x08200020, 0x00008000, 0x00208020 + } + }; + + private static final int cov_2char[] = + { + 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, + 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, + 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x61, 0x62, + 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, + 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, + 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A + }; + + private static final int byteToUnsigned(byte b) + { + int value = (int)b; + + return(value >= 0 ? value : value + 256); + } + + private static int fourBytesToInt(byte b[], int offset) + { + int value; + + value = byteToUnsigned(b[offset++]); + value |= (byteToUnsigned(b[offset++]) << 8); + value |= (byteToUnsigned(b[offset++]) << 16); + value |= (byteToUnsigned(b[offset++]) << 24); + + return(value); + } + + private static final void intToFourBytes(int iValue, byte b[], int offset) + { + b[offset++] = (byte)((iValue) & 0xff); + b[offset++] = (byte)((iValue >>> 8 ) & 0xff); + b[offset++] = (byte)((iValue >>> 16) & 0xff); + b[offset++] = (byte)((iValue >>> 24) & 0xff); + } + + private static final void PERM_OP(int a, int b, int n, int m, int results[]) + { + int t; + + t = ((a >>> n) ^ b) & m; + a ^= t << n; + b ^= t; + + results[0] = a; + results[1] = b; + } + + private static final int HPERM_OP(int a, int n, int m) + { + int t; + + t = ((a << (16 - n)) ^ a) & m; + a = a ^ t ^ (t >>> (16 - n)); + + return(a); + } + + private static int [] des_set_key(byte key[]) + { + int schedule[] = new int[ITERATIONS * 2]; + + int c = fourBytesToInt(key, 0); + int d = fourBytesToInt(key, 4); + + int results[] = new int[2]; + + PERM_OP(d, c, 4, 0x0f0f0f0f, results); + d = results[0]; c = results[1]; + + c = HPERM_OP(c, -2, 0xcccc0000); + d = HPERM_OP(d, -2, 0xcccc0000); + + PERM_OP(d, c, 1, 0x55555555, results); + d = results[0]; c = results[1]; + + PERM_OP(c, d, 8, 0x00ff00ff, results); + c = results[0]; d = results[1]; + + PERM_OP(d, c, 1, 0x55555555, results); + d = results[0]; c = results[1]; + + d = (((d & 0x000000ff) << 16) | (d & 0x0000ff00) | + ((d & 0x00ff0000) >>> 16) | ((c & 0xf0000000) >>> 4)); + c &= 0x0fffffff; + + int s, t; + int j = 0; + + for(int i = 0; i < ITERATIONS; i ++) + { + if(shifts2[i]) + { + c = (c >>> 2) | (c << 26); + d = (d >>> 2) | (d << 26); + } + else + { + c = (c >>> 1) | (c << 27); + d = (d >>> 1) | (d << 27); + } + + c &= 0x0fffffff; + d &= 0x0fffffff; + + s = skb[0][ (c ) & 0x3f ]| + skb[1][((c >>> 6) & 0x03) | ((c >>> 7) & 0x3c)]| + skb[2][((c >>> 13) & 0x0f) | ((c >>> 14) & 0x30)]| + skb[3][((c >>> 20) & 0x01) | ((c >>> 21) & 0x06) | + ((c >>> 22) & 0x38)]; + + t = skb[4][ (d ) & 0x3f ]| + skb[5][((d >>> 7) & 0x03) | ((d >>> 8) & 0x3c)]| + skb[6][ (d >>>15) & 0x3f ]| + skb[7][((d >>>21) & 0x0f) | ((d >>> 22) & 0x30)]; + + schedule[j++] = ((t << 16) | (s & 0x0000ffff)) & 0xffffffff; + s = ((s >>> 16) | (t & 0xffff0000)); + + s = (s << 4) | (s >>> 28); + schedule[j++] = s & 0xffffffff; + } + return(schedule); + } + + private static final int D_ENCRYPT + ( + int L, int R, int S, int E0, int E1, int s[] + ) + { + int t, u, v; + + v = R ^ (R >>> 16); + u = v & E0; + v = v & E1; + u = (u ^ (u << 16)) ^ R ^ s[S]; + t = (v ^ (v << 16)) ^ R ^ s[S + 1]; + t = (t >>> 4) | (t << 28); + + L ^= SPtrans[1][(t ) & 0x3f] | + SPtrans[3][(t >>> 8) & 0x3f] | + SPtrans[5][(t >>> 16) & 0x3f] | + SPtrans[7][(t >>> 24) & 0x3f] | + SPtrans[0][(u ) & 0x3f] | + SPtrans[2][(u >>> 8) & 0x3f] | + SPtrans[4][(u >>> 16) & 0x3f] | + SPtrans[6][(u >>> 24) & 0x3f]; + + return(L); + } + + private static final int [] body(int schedule[], int Eswap0, int Eswap1) + { + int left = 0; + int right = 0; + int t = 0; + + for(int j = 0; j < 25; j ++) + { + for(int i = 0; i < ITERATIONS * 2; i += 4) + { + left = D_ENCRYPT(left, right, i, Eswap0, Eswap1, schedule); + right = D_ENCRYPT(right, left, i + 2, Eswap0, Eswap1, schedule); + } + t = left; + left = right; + right = t; + } + + t = right; + + right = (left >>> 1) | (left << 31); + left = (t >>> 1) | (t << 31); + + left &= 0xffffffff; + right &= 0xffffffff; + + int results[] = new int[2]; + + PERM_OP(right, left, 1, 0x55555555, results); + right = results[0]; left = results[1]; + + PERM_OP(left, right, 8, 0x00ff00ff, results); + left = results[0]; right = results[1]; + + PERM_OP(right, left, 2, 0x33333333, results); + right = results[0]; left = results[1]; + + PERM_OP(left, right, 16, 0x0000ffff, results); + left = results[0]; right = results[1]; + + PERM_OP(right, left, 4, 0x0f0f0f0f, results); + right = results[0]; left = results[1]; + + int out[] = new int[2]; + + out[0] = left; out[1] = right; + + return(out); + } + + /** + * <P>Encrypt a password given the cleartext password and a "salt".</P> + * @param salt A two-character string representing the salt used to + * iterate the encryption engine in lots of different ways. If you + * are generating a new encryption then this value should be + * randomised. + * @param original The password to be encrypted. + * @return A string consisting of the 2-character salt followed by the + * encrypted password. + */ + public static final String crypt(String salt, String original) + { + while(salt.length() < 2) + salt += "A"; + + StringBuffer buffer = new StringBuffer(" "); + + char charZero = salt.charAt(0); + char charOne = salt.charAt(1); + + buffer.setCharAt(0, charZero); + buffer.setCharAt(1, charOne); + + int Eswap0 = con_salt[(int)charZero]; + int Eswap1 = con_salt[(int)charOne] << 4; + + byte key[] = new byte[8]; + + for(int i = 0; i < key.length; i ++) + key[i] = (byte)0; + + for(int i = 0; i < key.length && i < original.length(); i ++) + { + int iChar = (int)original.charAt(i); + + key[i] = (byte)(iChar << 1); + } + + int schedule[] = des_set_key(key); + int out[] = body(schedule, Eswap0, Eswap1); + + byte b[] = new byte[9]; + + intToFourBytes(out[0], b, 0); + intToFourBytes(out[1], b, 4); + b[8] = 0; + + for(int i = 2, y = 0, u = 0x80; i < 13; i ++) + { + for(int j = 0, c = 0; j < 6; j ++) + { + c <<= 1; + + if(((int)b[y] & u) != 0) + c |= 1; + + u >>>= 1; + + if(u == 0) + { + y++; + u = 0x80; + } + buffer.setCharAt(i, (char)cov_2char[c]); + } + } + return(buffer.toString()); + } + + /** + * <P>Encrypt a password given the cleartext password. This method + * generates a random salt using the 'java.util.Random' class.</P> + * @param original The password to be encrypted. + * @return A string consisting of the 2-character salt followed by the + * encrypted password. + */ + public static final String crypt(String original) + { + java.util.Random randomGenerator = new java.util.Random(); + int numSaltChars = saltChars.length; + String salt; + + salt = (new StringBuffer()).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars]).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars]).toString(); + + return crypt(salt, original); + } + + /** + * <P>Check that <I>enteredPassword</I> encrypts to + * <I>encryptedPassword</I>.</P> + * @param encryptedPassword The <I>encryptedPassword</I>. The first + * two characters are assumed to be the salt. This string would + * be the same as one found in a Unix <U>/etc/passwd</U> file. + * @param enteredPassword The password as entered by the user (or + * otherwise aquired). + * @return <B>true</B> if the password should be considered correct. + */ + public final static boolean matches(String encryptedPassword, String enteredPassword) + { + String salt = encryptedPassword.substring(0, 3); + String newCrypt = crypt(salt, enteredPassword); + + return newCrypt.equals(encryptedPassword); + } + + public static void main(String args[]) { + String encryptedPassword = "$6$BFpYzdUp$RH1M4rlc/.dXSsNJQTklT9z8lKQFwRYh7sSoFTFFgqdC596gB4Kvzh/ZlusL0EU6E9tpW8SnDOYlqPph8NBBP."; + String salt = encryptedPassword.substring(0, 3); + String newCrypt = crypt("BF", "gluster"); + System.out.println(newCrypt); + + + System.out.println("$6$BFpYzdUp$RH1M4rlc/.dXSsNJQTklT9z8lKQFwRYh7sSoFTFFgqdC596gB4Kvzh/ZlusL0EU6E9tpW8SnDOYlqPph8NBBP."); + } +} diff --git a/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/sample_jaas.config b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/sample_jaas.config new file mode 100644 index 00000000..c9e3878c --- /dev/null +++ b/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/sample_jaas.config @@ -0,0 +1,3 @@ +Sample { + sample.module.SampleLoginModule required debug=true; +}; diff --git a/com.gluster.storage.management.gui.feature.webstart/.project b/com.gluster.storage.management.gui.feature.webstart/.project new file mode 100644 index 00000000..03adbe4c --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.gui.feature.webstart</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.gui.feature.webstart/build.properties b/com.gluster.storage.management.gui.feature.webstart/build.properties new file mode 100644 index 00000000..322a3114 --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/build.properties @@ -0,0 +1,2 @@ +#bin.includes = feature.xml +root=rootfiles diff --git a/com.gluster.storage.management.gui.feature.webstart/feature.xml b/com.gluster.storage.management.gui.feature.webstart/feature.xml new file mode 100644 index 00000000..4d43f5c0 --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/feature.xml @@ -0,0 +1,236 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="com.gluster.storage.management.gui.feature.webstart" + label="Gluster Management Console - GUI Feature for Webstart" + version="1.0.0" + provider-name="Gluster Inc." + os="linux,win32" + ws="gtk,win32" + arch="x86,x86_64"> + + <description url="http://www.example.com/description"> + [Enter Feature Description here.] + </description> + + <copyright url="http://www.example.com/copyright"> + [Enter Copyright Description here.] + </copyright> + + <license url="http://www.example.com/license"> + [Enter License Description here.] + </license> + + <includes + id="com.gluster.storage.management.gui.feature" + version="0.0.0"/> + + <requires> + <import plugin="org.eclipse.core.runtime" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.4.200" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.jface" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.observable" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.property" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.core.commands" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.jface" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.ui.workbench" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.equinox.preferences" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.5.0" match="equivalent"/> + <import plugin="org.eclipse.help" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.jface.databinding" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.property" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.observable" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.osgi" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.jobs" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.preferences" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.core.contenttype" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.equinox.app" version="1.0.0" match="compatible"/> + </requires> + + <plugin + id="org.eclipse.help" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi.services" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jface.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jface" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.registry" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.app" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.expressions" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.observable" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime.compatibility.auth" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.contenttype" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.swt" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime.compatibility.registry" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="org.eclipse.equinox.preferences" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.commands" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui.workbench" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="javax.servlet" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.jobs" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.ibm.icu" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.common" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.property" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.sun.jersey" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/com.gluster.storage.management.gui.feature.webstart/rootfiles/gluster-management-console.jnlp b/com.gluster.storage.management.gui.feature.webstart/rootfiles/gluster-management-console.jnlp new file mode 100644 index 00000000..13562315 --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/rootfiles/gluster-management-console.jnlp @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<jnlp spec="1.0+" codebase="http://192.168.1.123:8080/glustersp-webstart/linux.gtk.x86_64" href="gluster-management-console.jnlp"> + <information> + <title>Gluster Management Console</title> + <vendor>Gluster Inc.</vendor> + <homepage href="http://192.168.1.123:8080/glustersp-webstart/linux.gtk.x86_64" /> + <description>Gluster Management Console</description> + <icon kind="splash" href="splash.bmp"/> + </information> + <security> + <all-permissions/> + </security> + <resources> + <j2se version="1.5+" /> + <jar href="plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar" main="true"/> + <extension + name="Gluster Storage Platform Feature" + href="features/com.gluster.storage.management.gui.feature_1.0.0.jnlp"/> + <property + name="osgi.instance.area" + value="@user.home/Application Data/glustermc"/> + <property + name="osgi.configuration.area" + value="@user.home/Application Data/glustermc"/> + <property + name="eclipse.product" + value="com.gluster.storage.management.gui.product"/> + </resources> + <resources os="Linux"> + <property name="osgi.ws" value="gtk"/> + </resources> + <application-desc main-class="org.eclipse.equinox.launcher.WebStartMain"> + <argument>-nosplash</argument> + </application-desc> +</jnlp>
\ No newline at end of file diff --git a/com.gluster.storage.management.gui.feature.webstart/rootfiles/index.html b/com.gluster.storage.management.gui.feature.webstart/rootfiles/index.html new file mode 100644 index 00000000..70f47279 --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/rootfiles/index.html @@ -0,0 +1,8 @@ +<html> +<head> +<title>Gluster Storage Platform</title> +</head> +<body> +<a href="http://192.168.1.123:8080/glustersp-webstart/linux.gtk.x86_64/gluster-management-console.jnlp">Gluster Storage Platform</a> +</body> +</html> diff --git a/com.gluster.storage.management.gui.feature.webstart/rootfiles/splash.bmp b/com.gluster.storage.management.gui.feature.webstart/rootfiles/splash.bmp Binary files differnew file mode 100644 index 00000000..059c28f9 --- /dev/null +++ b/com.gluster.storage.management.gui.feature.webstart/rootfiles/splash.bmp diff --git a/com.gluster.storage.management.gui.feature/.project b/com.gluster.storage.management.gui.feature/.project new file mode 100644 index 00000000..c93780b5 --- /dev/null +++ b/com.gluster.storage.management.gui.feature/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.gui.feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.gui.feature/build.properties b/com.gluster.storage.management.gui.feature/build.properties new file mode 100644 index 00000000..64f93a9f --- /dev/null +++ b/com.gluster.storage.management.gui.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/com.gluster.storage.management.gui.feature/feature.xml b/com.gluster.storage.management.gui.feature/feature.xml new file mode 100644 index 00000000..e8521d13 --- /dev/null +++ b/com.gluster.storage.management.gui.feature/feature.xml @@ -0,0 +1,735 @@ +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="com.gluster.storage.management.gui.feature" + label="Gluster Storage Platform - GUI Feature" + version="1.0.0" + provider-name="GLUSTER" + os="linux,win32" + ws="gtk,win32" + arch="x86,x86_64"> + + <description url="http://www.example.com/description"> + [Enter Feature Description here.] + </description> + + <copyright url="http://www.example.com/copyright"> + [Enter Copyright Description here.] + </copyright> + + <license url="http://www.example.com/license"> + [Enter License Description here.] + </license> + + <requires> + <import plugin="org.eclipse.core.runtime" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.jface" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.4.200" match="compatible"/> + <import plugin="org.eclipse.equinox.p2.core" version="2.0.0" match="compatible"/> + <import plugin="org.eclipse.core.net" version="1.1.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.swt" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.core.commands" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.observable" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.property" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.ui.ide" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.ui" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.jface.text" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.ui.workbench.texteditor" version="3.6.0" match="compatible"/> + <import plugin="org.eclipse.core.filebuffers" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.resources" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.filesystem" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.jface" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.ui.workbench" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.equinox.preferences" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.5.0" match="equivalent"/> + <import plugin="org.eclipse.ui" version="3.6.1" match="greaterOrEqual"/> + <import plugin="org.eclipse.core.runtime" version="3.6.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.ui.editors" version="3.6.1" match="greaterOrEqual"/> + <import plugin="org.eclipse.ui.forms" version="3.5.2" match="greaterOrEqual"/> + <import plugin="org.eclipse.rcp" version="3.6.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.equinox.concurrent"/> + <import plugin="org.eclipse.text" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.variables" version="3.1.0" match="compatible"/> + <import plugin="org.eclipse.osgi" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.jobs" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.preferences" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.core.contenttype" version="3.3.0" match="compatible"/> + <import plugin="org.eclipse.equinox.app" version="1.0.0" match="compatible"/> + <import plugin="org.eclipse.core.commands" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.filesystem" version="1.1.0" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.jface" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.compare.core" version="3.5.0" match="compatible"/> + <import plugin="org.eclipse.core.expressions" version="3.4.100" match="compatible"/> + <import plugin="org.eclipse.ecf.provider.filetransfer" version="2.0.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.core.filesystem" version="1.0.0" match="compatible"/> + <import plugin="org.eclipse.help" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.jface.text" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.p2.engine" version="2.0.0" match="compatible"/> + <import plugin="org.eclipse.equinox.p2.metadata" version="2.0.0" match="compatible"/> + <import plugin="org.eclipse.jface.databinding" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.property" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.core.databinding.observable" version="1.2.0" match="compatible"/> + <import plugin="org.eclipse.equinox.registry" version="3.3.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.ecf.provider.filetransfer" version="3.0.1" match="greaterOrEqual"/> + <import plugin="org.eclipse.equinox.p2.metadata.repository" version="1.0.100" match="greaterOrEqual"/> + <import plugin="org.eclipse.core.jobs" version="3.4.0" match="compatible"/> + <import plugin="org.eclipse.equinox.p2.repository" version="2.0.0" match="equivalent"/> + <import plugin="org.eclipse.equinox.p2.metadata" version="2.0.0" match="equivalent"/> + <import plugin="org.eclipse.equinox.p2.core" version="2.0.0" match="equivalent"/> + <import plugin="org.eclipse.ecf.filetransfer" version="2.0.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.equinox.security" version="1.0.0" match="compatible"/> + <import plugin="org.eclipse.equinox.common" version="3.4.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.equinox.preferences" version="3.2.200" match="greaterOrEqual"/> + <import plugin="org.eclipse.osgi" version="3.4.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.equinox.registry" version="3.4.0" match="greaterOrEqual"/> + <import plugin="org.eclipse.osgi" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.filesystem" version="1.3.0" match="compatible"/> + <import plugin="org.eclipse.swt" version="3.0.0" match="compatible"/> + <import plugin="org.eclipse.equinox.launcher" version="1.0.0"/> + </requires> + + <plugin + id="org.eclipse.ui.forms" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.help" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.p2.metadata" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.net.linux.x86_64" + os="linux" + ws="gtk" + arch="x86_64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.jface" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.app" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.expressions" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.observable" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.swt" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.contenttype" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime.compatibility.registry" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="org.eclipse.ecf.ssl" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.compare.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ecf.provider.filetransfer" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.gluster.storage.management.gui" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="javax.servlet" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ecf" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.filebuffers" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ant.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.ibm.icu" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.jobs" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.property" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.text" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.resources" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osgi.services" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jface.databinding" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.variables" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.registry" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ecf.identity" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.runtime.compatibility.auth" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ecf.filetransfer" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui.workbench.texteditor" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ecf.provider.filetransfer.ssl" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.security" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.preferences" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.commands" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui.views" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.ui.workbench" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.jface.text" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.p2.repository" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.p2.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.p2.engine" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.common" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.p2.metadata.repository" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.net" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.rcp" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.launcher" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.filesystem" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.filesystem.linux.x86" + os="linux" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.filesystem.linux.x86_64" + os="linux" + arch="x86_64, amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.filesystem.win32.x86" + os="win32" + ws="win32" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.filesystem.win32.x86_64" + os="win32" + ws="win32" + arch="x86_64, amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.net.linux.x86" + os="linux" + ws="gtk" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.net.win32.x86" + os="win32" + ws="win32" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.core.net.win32.x86_64" + os="win32" + ws="win32" + arch="x86_64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.swt.gtk.linux.x86" + os="linux" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.swt.gtk.linux.x86_64" + os="linux" + arch="x86_64, amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.swt.win32.win32.x86" + os="win32" + ws="win32" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.swt.win32.win32.x86_64" + os="win32" + ws="win32" + arch="x86_64,amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true" + unpack="false"/> + + <plugin + id="org.eclipse.equinox.launcher.gtk.linux.x86" + os="linux" + ws="gtk" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="org.eclipse.equinox.launcher.gtk.linux.x86_64" + os="linux" + ws="gtk" + arch="x86_64, amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="org.eclipse.equinox.launcher.win32.win32.x86" + os="win32" + ws="win32" + arch="x86" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="org.eclipse.equinox.launcher.win32.win32.x86_64" + os="win32" + ws="win32" + arch="x86_64, amd64" + download-size="0" + install-size="0" + version="0.0.0" + fragment="true"/> + + <plugin + id="com.gluster.storage.management.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.birt.chart.device.extension" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.birt.chart.engine" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.birt.chart.engine.extension" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.birt.core" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.emf.common" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.emf.ecore" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.emf.ecore.xmi" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.mozilla.javascript" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.apache.commons.codec" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.gluster.storage.management.client" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.core.databinding.beans" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.sun.jersey" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.birt.chart.device.swt" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="com.richclientgui.rcptoolbox" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/com.gluster.storage.management.gui/.classpath b/com.gluster.storage.management.gui/.classpath new file mode 100644 index 00000000..f9a8d357 --- /dev/null +++ b/com.gluster.storage.management.gui/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="lib" path="/data/downloads/xstream/xstream-1.3.1/lib/xstream-1.3.1.jar"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/com.gluster.storage.management.gui/.project b/com.gluster.storage.management.gui/.project new file mode 100644 index 00000000..84ab78e4 --- /dev/null +++ b/com.gluster.storage.management.gui/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.gui</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.gui/.settings/org.eclipse.jdt.core.prefs b/com.gluster.storage.management.gui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..abf7cf5a --- /dev/null +++ b/com.gluster.storage.management.gui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Thu Nov 11 15:40:30 IST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.gluster.storage.management.gui/META-INF/MANIFEST.MF b/com.gluster.storage.management.gui/META-INF/MANIFEST.MF new file mode 100644 index 00000000..7c0ba23a --- /dev/null +++ b/com.gluster.storage.management.gui/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: glustersp-gui +Bundle-SymbolicName: com.gluster.storage.management.gui;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: com.gluster.storage.management.gui.Activator +Bundle-Vendor: Gluster +Require-Bundle: org.eclipse.ui;bundle-version="3.6.1", + org.eclipse.core.runtime;bundle-version="3.6.0", + org.eclipse.ui.forms;bundle-version="3.5.2", + org.eclipse.rcp;bundle-version="3.6.0", + com.gluster.storage.management.core;bundle-version="1.0.0", + com.gluster.storage.management.client;bundle-version="1.0.0", + org.eclipse.core.databinding;bundle-version="1.3.100", + org.eclipse.jface.databinding;bundle-version="1.4.0", + org.eclipse.core.databinding.property;bundle-version="1.3.0", + org.eclipse.core.databinding.beans;bundle-version="1.2.100", + org.eclipse.birt.chart.engine;bundle-version="2.6.1", + org.eclipse.birt.chart.engine.extension;bundle-version="2.6.1", + org.eclipse.birt.chart.device.extension;bundle-version="2.6.1", + org.eclipse.birt.chart.device.swt;bundle-version="2.6.1", + com.ibm.icu;bundle-version="4.2.1", + com.richclientgui.rcptoolbox;bundle-version="1.0.5", + org.eclipse.core.resources +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: lib/jersey-client-1.4.jar, + lib/jersey-core-1.4.jar, + . diff --git a/com.gluster.storage.management.gui/build.properties b/com.gluster.storage.management.gui/build.properties new file mode 100644 index 00000000..83944c06 --- /dev/null +++ b/com.gluster.storage.management.gui/build.properties @@ -0,0 +1,17 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + icons/,\ + product_lg.gif,\ + splash.bmp,\ + lib/jersey-client-1.4.jar,\ + lib/jersey-core-1.4.jar,\ + splash/,\ + images/,\ + plugin.xml,\ + preferences.ini +src.includes = icons/,\ + splash.bmp,\ + images/,\ + preferences.ini diff --git a/com.gluster.storage.management.gui/icons/arrow-down.png b/com.gluster.storage.management.gui/icons/arrow-down.png Binary files differnew file mode 100644 index 00000000..7f23e3f4 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/arrow-down.png diff --git a/com.gluster.storage.management.gui/icons/arrow-up.png b/com.gluster.storage.management.gui/icons/arrow-up.png Binary files differnew file mode 100644 index 00000000..b8ad3050 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/arrow-up.png diff --git a/com.gluster.storage.management.gui/icons/cluster.png b/com.gluster.storage.management.gui/icons/cluster.png Binary files differnew file mode 100644 index 00000000..c9348a21 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/cluster.png diff --git a/com.gluster.storage.management.gui/icons/disk-migrate.png b/com.gluster.storage.management.gui/icons/disk-migrate.png Binary files differnew file mode 100644 index 00000000..2de348dc --- /dev/null +++ b/com.gluster.storage.management.gui/icons/disk-migrate.png diff --git a/com.gluster.storage.management.gui/icons/disk-uninitialized.png b/com.gluster.storage.management.gui/icons/disk-uninitialized.png Binary files differnew file mode 100644 index 00000000..b982d118 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/disk-uninitialized.png diff --git a/com.gluster.storage.management.gui/icons/disk.png b/com.gluster.storage.management.gui/icons/disk.png Binary files differnew file mode 100644 index 00000000..99d532e8 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/disk.png diff --git a/com.gluster.storage.management.gui/icons/disks.png b/com.gluster.storage.management.gui/icons/disks.png Binary files differnew file mode 100644 index 00000000..fc5a52f5 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/disks.png diff --git a/com.gluster.storage.management.gui/icons/folder.png b/com.gluster.storage.management.gui/icons/folder.png Binary files differnew file mode 100644 index 00000000..784e8fa4 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/folder.png diff --git a/com.gluster.storage.management.gui/icons/gluster_icon.png b/com.gluster.storage.management.gui/icons/gluster_icon.png Binary files differnew file mode 100644 index 00000000..f92e472d --- /dev/null +++ b/com.gluster.storage.management.gui/icons/gluster_icon.png diff --git a/com.gluster.storage.management.gui/icons/group.png b/com.gluster.storage.management.gui/icons/group.png Binary files differnew file mode 100644 index 00000000..7fb4e1f1 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/group.png diff --git a/com.gluster.storage.management.gui/icons/gsn.png b/com.gluster.storage.management.gui/icons/gsn.png Binary files differnew file mode 100644 index 00000000..68f21d30 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/gsn.png diff --git a/com.gluster.storage.management.gui/icons/mail.ico b/com.gluster.storage.management.gui/icons/mail.ico Binary files differnew file mode 100644 index 00000000..b0000611 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/mail.ico diff --git a/com.gluster.storage.management.gui/icons/minus-white.png b/com.gluster.storage.management.gui/icons/minus-white.png Binary files differnew file mode 100644 index 00000000..8efd5d33 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/minus-white.png diff --git a/com.gluster.storage.management.gui/icons/network-interface.png b/com.gluster.storage.management.gui/icons/network-interface.png Binary files differnew file mode 100644 index 00000000..24ca7370 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/network-interface.png diff --git a/com.gluster.storage.management.gui/icons/network-interfaces.png b/com.gluster.storage.management.gui/icons/network-interfaces.png Binary files differnew file mode 100644 index 00000000..752968bb --- /dev/null +++ b/com.gluster.storage.management.gui/icons/network-interfaces.png diff --git a/com.gluster.storage.management.gui/icons/network-interfaces1.png b/com.gluster.storage.management.gui/icons/network-interfaces1.png Binary files differnew file mode 100644 index 00000000..af438028 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/network-interfaces1.png diff --git a/com.gluster.storage.management.gui/icons/plus-white.png b/com.gluster.storage.management.gui/icons/plus-white.png Binary files differnew file mode 100644 index 00000000..c765946e --- /dev/null +++ b/com.gluster.storage.management.gui/icons/plus-white.png diff --git a/com.gluster.storage.management.gui/icons/preferences.png b/com.gluster.storage.management.gui/icons/preferences.png Binary files differnew file mode 100644 index 00000000..7b93eb05 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/preferences.png diff --git a/com.gluster.storage.management.gui/icons/progress-bar.png b/com.gluster.storage.management.gui/icons/progress-bar.png Binary files differnew file mode 100644 index 00000000..c7db00ae --- /dev/null +++ b/com.gluster.storage.management.gui/icons/progress-bar.png diff --git a/com.gluster.storage.management.gui/icons/question.png b/com.gluster.storage.management.gui/icons/question.png Binary files differnew file mode 100644 index 00000000..30a47032 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/question.png diff --git a/com.gluster.storage.management.gui/icons/sample.gif b/com.gluster.storage.management.gui/icons/sample.gif Binary files differnew file mode 100644 index 00000000..34fb3c9d --- /dev/null +++ b/com.gluster.storage.management.gui/icons/sample.gif diff --git a/com.gluster.storage.management.gui/icons/sample.icns b/com.gluster.storage.management.gui/icons/sample.icns Binary files differnew file mode 100644 index 00000000..1e92ccce --- /dev/null +++ b/com.gluster.storage.management.gui/icons/sample.icns diff --git a/com.gluster.storage.management.gui/icons/sample2.gif b/com.gluster.storage.management.gui/icons/sample2.gif Binary files differnew file mode 100644 index 00000000..252d7ebc --- /dev/null +++ b/com.gluster.storage.management.gui/icons/sample2.gif diff --git a/com.gluster.storage.management.gui/icons/sample3.gif b/com.gluster.storage.management.gui/icons/sample3.gif Binary files differnew file mode 100644 index 00000000..b949ac94 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/sample3.gif diff --git a/com.gluster.storage.management.gui/icons/search.png b/com.gluster.storage.management.gui/icons/search.png Binary files differnew file mode 100644 index 00000000..b4b23129 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/search.png diff --git a/com.gluster.storage.management.gui/icons/server-add-big.png b/com.gluster.storage.management.gui/icons/server-add-big.png Binary files differnew file mode 100644 index 00000000..d96b8175 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/server-add-big.png diff --git a/com.gluster.storage.management.gui/icons/server-add.png b/com.gluster.storage.management.gui/icons/server-add.png Binary files differnew file mode 100644 index 00000000..db604ee3 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/server-add.png diff --git a/com.gluster.storage.management.gui/icons/server-remove.png b/com.gluster.storage.management.gui/icons/server-remove.png Binary files differnew file mode 100644 index 00000000..5e9b2683 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/server-remove.png diff --git a/com.gluster.storage.management.gui/icons/server.png b/com.gluster.storage.management.gui/icons/server.png Binary files differnew file mode 100644 index 00000000..9bc37dce --- /dev/null +++ b/com.gluster.storage.management.gui/icons/server.png diff --git a/com.gluster.storage.management.gui/icons/servers.png b/com.gluster.storage.management.gui/icons/servers.png Binary files differnew file mode 100644 index 00000000..b18a74d9 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/servers.png diff --git a/com.gluster.storage.management.gui/icons/star-small.png b/com.gluster.storage.management.gui/icons/star-small.png Binary files differnew file mode 100644 index 00000000..fef14263 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/star-small.png diff --git a/com.gluster.storage.management.gui/icons/status-offline-circle.png b/com.gluster.storage.management.gui/icons/status-offline-circle.png Binary files differnew file mode 100644 index 00000000..20d6f5ea --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-offline-circle.png diff --git a/com.gluster.storage.management.gui/icons/status-offline-small.png b/com.gluster.storage.management.gui/icons/status-offline-small.png Binary files differnew file mode 100644 index 00000000..39d47690 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-offline-small.png diff --git a/com.gluster.storage.management.gui/icons/status-offline.png b/com.gluster.storage.management.gui/icons/status-offline.png Binary files differnew file mode 100644 index 00000000..6b9fa6dd --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-offline.png diff --git a/com.gluster.storage.management.gui/icons/status-online-circle.png b/com.gluster.storage.management.gui/icons/status-online-circle.png Binary files differnew file mode 100644 index 00000000..210b1a6c --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-online-circle.png diff --git a/com.gluster.storage.management.gui/icons/status-online-small.png b/com.gluster.storage.management.gui/icons/status-online-small.png Binary files differnew file mode 100644 index 00000000..8e87f2e5 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-online-small.png diff --git a/com.gluster.storage.management.gui/icons/status-online.png b/com.gluster.storage.management.gui/icons/status-online.png Binary files differnew file mode 100644 index 00000000..2414885b --- /dev/null +++ b/com.gluster.storage.management.gui/icons/status-online.png diff --git a/com.gluster.storage.management.gui/icons/stop.png b/com.gluster.storage.management.gui/icons/stop.png Binary files differnew file mode 100644 index 00000000..0cfd5859 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/stop.png diff --git a/com.gluster.storage.management.gui/icons/ui-check-box-mix.png b/com.gluster.storage.management.gui/icons/ui-check-box-mix.png Binary files differnew file mode 100644 index 00000000..3c961711 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/ui-check-box-mix.png diff --git a/com.gluster.storage.management.gui/icons/ui-check-box-uncheck.png b/com.gluster.storage.management.gui/icons/ui-check-box-uncheck.png Binary files differnew file mode 100644 index 00000000..ba447358 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/ui-check-box-uncheck.png diff --git a/com.gluster.storage.management.gui/icons/ui-check-box.png b/com.gluster.storage.management.gui/icons/ui-check-box.png Binary files differnew file mode 100644 index 00000000..07f3522a --- /dev/null +++ b/com.gluster.storage.management.gui/icons/ui-check-box.png diff --git a/com.gluster.storage.management.gui/icons/volume-create-big.png b/com.gluster.storage.management.gui/icons/volume-create-big.png Binary files differnew file mode 100644 index 00000000..231bae5b --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-create-big.png diff --git a/com.gluster.storage.management.gui/icons/volume-create.png b/com.gluster.storage.management.gui/icons/volume-create.png Binary files differnew file mode 100644 index 00000000..9c8a9da4 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-create.png diff --git a/com.gluster.storage.management.gui/icons/volume-delete.png b/com.gluster.storage.management.gui/icons/volume-delete.png Binary files differnew file mode 100644 index 00000000..86f7fbc2 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-delete.png diff --git a/com.gluster.storage.management.gui/icons/volume-edit.png b/com.gluster.storage.management.gui/icons/volume-edit.png Binary files differnew file mode 100644 index 00000000..291bfc76 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-edit.png diff --git a/com.gluster.storage.management.gui/icons/volume-rebalance.png b/com.gluster.storage.management.gui/icons/volume-rebalance.png Binary files differnew file mode 100644 index 00000000..e213cd5b --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-rebalance.png diff --git a/com.gluster.storage.management.gui/icons/volume-start.png b/com.gluster.storage.management.gui/icons/volume-start.png Binary files differnew file mode 100644 index 00000000..aace63ad --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-start.png diff --git a/com.gluster.storage.management.gui/icons/volume-stop-1.png b/com.gluster.storage.management.gui/icons/volume-stop-1.png Binary files differnew file mode 100644 index 00000000..0cfd5859 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-stop-1.png diff --git a/com.gluster.storage.management.gui/icons/volume-stop.png b/com.gluster.storage.management.gui/icons/volume-stop.png Binary files differnew file mode 100644 index 00000000..7af3a518 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume-stop.png diff --git a/com.gluster.storage.management.gui/icons/volume.png b/com.gluster.storage.management.gui/icons/volume.png Binary files differnew file mode 100644 index 00000000..46b7564a --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume.png diff --git a/com.gluster.storage.management.gui/icons/volume1.png b/com.gluster.storage.management.gui/icons/volume1.png Binary files differnew file mode 100644 index 00000000..5e23dbc8 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volume1.png diff --git a/com.gluster.storage.management.gui/icons/volumes.png b/com.gluster.storage.management.gui/icons/volumes.png Binary files differnew file mode 100644 index 00000000..80dfa195 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volumes.png diff --git a/com.gluster.storage.management.gui/icons/volumes1.png b/com.gluster.storage.management.gui/icons/volumes1.png Binary files differnew file mode 100644 index 00000000..448e46fd --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volumes1.png diff --git a/com.gluster.storage.management.gui/icons/volumes2.png b/com.gluster.storage.management.gui/icons/volumes2.png Binary files differnew file mode 100644 index 00000000..0905f933 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volumes2.png diff --git a/com.gluster.storage.management.gui/icons/volumes3.png b/com.gluster.storage.management.gui/icons/volumes3.png Binary files differnew file mode 100644 index 00000000..7e90d397 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/volumes3.png diff --git a/com.gluster.storage.management.gui/icons/world.png b/com.gluster.storage.management.gui/icons/world.png Binary files differnew file mode 100644 index 00000000..68f21d30 --- /dev/null +++ b/com.gluster.storage.management.gui/icons/world.png diff --git a/com.gluster.storage.management.gui/images/gauge.png b/com.gluster.storage.management.gui/images/gauge.png Binary files differnew file mode 100644 index 00000000..6f5764ea --- /dev/null +++ b/com.gluster.storage.management.gui/images/gauge.png diff --git a/com.gluster.storage.management.gui/images/gauge_small.png b/com.gluster.storage.management.gui/images/gauge_small.png Binary files differnew file mode 100644 index 00000000..71e424fe --- /dev/null +++ b/com.gluster.storage.management.gui/images/gauge_small.png diff --git a/com.gluster.storage.management.gui/images/progress_image_empty.png b/com.gluster.storage.management.gui/images/progress_image_empty.png Binary files differnew file mode 100644 index 00000000..590097ad --- /dev/null +++ b/com.gluster.storage.management.gui/images/progress_image_empty.png diff --git a/com.gluster.storage.management.gui/images/progress_image_filled_danger.png b/com.gluster.storage.management.gui/images/progress_image_filled_danger.png Binary files differnew file mode 100644 index 00000000..97704230 --- /dev/null +++ b/com.gluster.storage.management.gui/images/progress_image_filled_danger.png diff --git a/com.gluster.storage.management.gui/images/progress_image_filled_safe.png b/com.gluster.storage.management.gui/images/progress_image_filled_safe.png Binary files differnew file mode 100644 index 00000000..ae4e3c69 --- /dev/null +++ b/com.gluster.storage.management.gui/images/progress_image_filled_safe.png diff --git a/com.gluster.storage.management.gui/images/progress_image_left.png b/com.gluster.storage.management.gui/images/progress_image_left.png Binary files differnew file mode 100644 index 00000000..97704230 --- /dev/null +++ b/com.gluster.storage.management.gui/images/progress_image_left.png diff --git a/com.gluster.storage.management.gui/images/progress_image_right.png b/com.gluster.storage.management.gui/images/progress_image_right.png Binary files differnew file mode 100644 index 00000000..97704230 --- /dev/null +++ b/com.gluster.storage.management.gui/images/progress_image_right.png diff --git a/com.gluster.storage.management.gui/plugin.xml b/com.gluster.storage.management.gui/plugin.xml new file mode 100644 index 00000000..8097f4ef --- /dev/null +++ b/com.gluster.storage.management.gui/plugin.xml @@ -0,0 +1,824 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + + <extension + id="application" + point="org.eclipse.core.runtime.applications"> + <application> + <run + class="com.gluster.storage.management.gui.Application"> + </run> + </application> + </extension> + <extension + point="org.eclipse.ui.perspectives"> + <perspective + name="Gluster Perspective" + class="com.gluster.storage.management.gui.Perspective" + id="com.gluster.storage.management.gui.perspective"> + </perspective> + </extension> + <extension + point="org.eclipse.ui.views"> + <view + class="com.gluster.storage.management.gui.views.navigator.NavigationView" + icon="icons/world.png" + id="com.gluster.storage.management.gui.views.navigator" + name="Cluster Navigation Tree" + restorable="true"> + </view> + <view + allowMultiple="false" + class="com.gluster.storage.management.gui.views.details.DetailsView" + icon="icons/gluster_icon.png" + id="com.gluster.storage.management.gui.views.details" + name="Details" + restorable="true"> + </view> + <view + category="org.eclipse.ui" + class="org.eclipse.ui.ExtensionFactory:progressView" + icon="icons/progress-bar.png" + id="org.eclipse.ui.views.ProgressView" + name="Tasks in Progress" + restorable="true"> + </view> + </extension> + <extension + point="org.eclipse.ui.commands"> + <category + name="Gluster Commands" + id="com.gluster.storage.management.gui.category"> + </category> + <command + name="Create Volume" + description="Create a new Volume" + categoryId="com.gluster.storage.management.gui.category" + id="com.gluster.storage.management.gui.commands.CreateVolume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Delete Volume" + id="com.gluster.storage.management.gui.commands.DeleteVolume" + name="Delete Volume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Start Volume" + id="com.gluster.storage.management.gui.commands.StartVolume" + name="Start Volume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Stop Volume" + id="com.gluster.storage.management.gui.commands.StopVolume" + name="Stop Volume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Edit Volume" + id="com.gluster.storage.management.gui.commands.EditVolume" + name="Edit Volume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Rebalance Volume" + id="com.gluster.storage.management.gui.commands.RebalanceVolume" + name="Rebalance Volume"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Add Server(s) to Cluster" + id="com.gluster.storage.management.gui.commands.AddServer" + name="Add Server(s)"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Remove Server(s) from Cluster" + id="com.gluster.storage.management.gui.commands.RemoveServer" + name="Remove Server(s)"> + </command> + <command + categoryId="com.gluster.storage.management.gui.category" + description="Migrate Disk" + id="com.gluster.storage.management.gui.commands.MigrateDisk" + name="Migrate Disk"> + </command> + </extension> + <extension + point="org.eclipse.ui.bindings"> + <key + commandId="com.gluster.storage.management.gui.commands.CreateVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+C"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.DeleteVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+D"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.StartVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+S"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.StopVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+T"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.EditVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+E"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.RebalanceVolume" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+B"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.AddServer" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+A"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.RemoveServer" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+R"> + </key> + <key + commandId="com.gluster.storage.management.gui.commands.MigrateDisk" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+M"> + </key> + <key + commandId="org.eclipse.ui.window.preferences" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+P"> + </key> + <key + commandId="org.eclipse.ui.window.showKeyAssist" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="CTRL+SHIFT+L"> + </key> + <key + commandId="org.eclipse.ui.navigate.nextTab" + contextId="org.eclipse.ui.contexts.window" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="ALT+ARROW_RIGHT"> + </key> + <key + commandId="org.eclipse.ui.navigate.previousTab" + contextId="org.eclipse.ui.contexts.window" + schemeId="com.gluster.storage.management.gui.KeyConfig" + sequence="ALT+ARROW_LEFT"> + </key> + <scheme + description="Default Key Bindings Scheme for Gluster Management Console" + id="com.gluster.storage.management.gui.KeyConfig" + name="Gluster"> + </scheme> + </extension> + <extension + id="product" + name="Gluster Management Console" + point="org.eclipse.core.runtime.products"> + <product + application="com.gluster.storage.management.gui.application" + name="Gluster Management Console"> + <property + name="aboutText" + value="GlusterFS is an open source clustered storage solution. The software is a powerful and flexible solution that simplifies the task of managing unstructured file data whether you have a few terabytes of storage or multiple petabytes. Gluster Management Console is a powerful GUI management interface for the GlusterFS."> + </property> + <property + name="windowImages" + value="icons/gluster_icon.png"> + </property> + <property + name="aboutImage" + value="splash/gluster_about.jpg"> + </property> + <property + name="appName" + value="about"> + </property> + <property + name="preferenceCustomization" + value="preferences.ini"> + </property> + </product> + </extension> + <extension + point="org.eclipse.ui.editors"> + <editor + class="com.gluster.storage.management.gui.editor.GlusterMultiPageEditor" + default="false" + icon="icons/gluster_icon.png" + id="com.gluster.storage.management.gui.editor.GlusterMultiPageEditor" + name="Gluster Storage Platform"> + </editor> + </extension> + <extension + point="org.eclipse.ui.actionSets"> + <actionSet + description="Set of Actions in "Edit" menu" + id="com.gluster.storage.management.gui.actionsets.edit" + label="Edit Action Set" + visible="true"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.PreferencesAction" + definitionId="org.eclipse.ui.window.preferences" + icon="icons/preferences.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="&Preferences" + menubarPath="com.gluster.storage.management.gui.menu.edit/edit" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Preferences"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.edit" + label="&Edit" + path="additions"> + <groupMarker + name="edit"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed on multiple Volumes" + id="com.gluster.storage.management.gui.actionsets.volumes" + label="Volumes Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.DeleteVolume" + icon="icons/volume-delete.png" + id="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + label="&Delete Volume(s)" + menubarPath="com.gluster.storage.management.gui.menu.volumes/volumes" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Delete Volume(s)"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StopVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StopVolume" + icon="icons/volume-stop.png" + id="com.gluster.storage.management.gui.actions.StopVolumeAction" + label="S&top Volume(s)" + menubarPath="com.gluster.storage.management.gui.menu.volumes/volumes" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Stop Volume(s)"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StartVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StartVolume" + icon="icons/volume-start.png" + id="com.gluster.storage.management.gui.actions.StartVolumeAction" + label="&Start Volume(s)" + menubarPath="com.gluster.storage.management.gui.menu.volumes/volumes" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Start Volume(s)"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.CreateVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.CreateVolume" + icon="icons/volume-create.png" + id="com.gluster.storage.management.gui.actions.CreateVolumeAction" + label="&Create Volume" + menubarPath="com.gluster.storage.management.gui.menu.volumes/volumes" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Create a new Volume"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.volumes" + label="&Gluster" + path="additions"> + <groupMarker + name="volumes"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed on a single volume" + id="com.gluster.storage.management.gui.actionsets.volume" + label="Volume Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.MigrateDiskAction" + definitionId="com.gluster.storage.management.gui.commands.MigrateDisk" + icon="icons/disk-migrate.png" + id="com.gluster.storage.management.gui.actions.MigrateDiskAction" + label="&Migrate Disk" + menubarPath="com.gluster.storage.management.gui.menu.glusterserver/glusterserver" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Migrate Disk"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.DeleteVolume" + icon="icons/volume-delete.png" + id="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + label="&Delete Volume" + menubarPath="com.gluster.storage.management.gui.menu.volume/volume" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Delete Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.RebalanceVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.RebalanceVolume" + icon="icons/volume-rebalance.png" + id="com.gluster.storage.management.gui.actions.RebalanceVolumeAction" + label="&Rebalance Volume" + menubarPath="com.gluster.storage.management.gui.menu.volume/volume" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Rebalance Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StopVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StopVolume" + icon="icons/volume-stop.png" + id="com.gluster.storage.management.gui.actions.StopVolumeAction" + label="S&top Volume" + menubarPath="com.gluster.storage.management.gui.menu.volume/volume" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Stop Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StartVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StartVolume" + icon="icons/volume-start.png" + id="com.gluster.storage.management.gui.actions.StartVolumeAction" + label="&Start Volume" + menubarPath="com.gluster.storage.management.gui.menu.volume/volume" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Start Volume"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.volume" + label="&Gluster" + path="additions"> + <groupMarker + name="volume"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed from "Cluster" context" + id="com.gluster.storage.management.gui.actionsets.gluster" + label="Cluster Action Set" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.CreateVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.CreateVolume" + icon="icons/volume-create.png" + id="com.gluster.storage.management.gui.actions.CreateVolumeAction" + label="Create &Volume" + menubarPath="com.gluster.storage.management.gui.menu.cluster/cluster" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Create a new Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.AddServerAction" + definitionId="com.gluster.storage.management.gui.commands.AddServer" + icon="icons/server-add.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="Add &Server(s)" + menubarPath="com.gluster.storage.management.gui.menu.cluster/cluster" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Add Server(s) to Cluster"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.cluster" + label="&Gluster"> + <groupMarker + name="cluster"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed on multiple Gluster Servers" + id="com.gluster.storage.management.gui.actionsets.glusterservers" + label="Gluster Servers Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.RemoveServerAction" + definitionId="com.gluster.storage.management.gui.commands.RemoveServer" + icon="icons/server-remove.png" + id="com.gluster.storage.management.gui.actions.RemoveServerAction" + label="&Remove Server(s)" + menubarPath="com.gluster.storage.management.gui.menu.servers/servers" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Remove Server(s)"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.AddServerAction" + definitionId="com.gluster.storage.management.gui.commands.AddServer" + icon="icons/server-add.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="&Add Server(s)" + menubarPath="com.gluster.storage.management.gui.menu.servers/servers" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Add Server(s) to Cluster"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.servers" + label="&Gluster" + path="additions"> + <groupMarker + name="servers"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed in the "Gluster Server" contextt; context" + id="com.gluster.storage.management.gui.actionsets.glusterserver" + label="Gluster Server Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.RemoveServerAction" + definitionId="com.gluster.storage.management.gui.commands.RemoveServer" + icon="icons/server-remove.png" + id="com.gluster.storage.management.gui.actions.RemoveServerAction" + label="&Remove Server" + menubarPath="com.gluster.storage.management.gui.menu.glusterserver/glusterserver" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Remove Server"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.glusterserver" + label="&Gluster" + path="additions"> + <groupMarker + name="glusterserver"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed on multiple Discovered Servers" + id="com.gluster.storage.management.gui.actionsets.serversdiscovered" + label="Discovered Servers Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.AddServerAction" + definitionId="com.gluster.storage.management.gui.commands.AddServer" + icon="icons/server-add.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="&Add Server(s)" + menubarPath="com.gluster.storage.management.gui.menu.discoveredservers/discoveredservers" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Add Server(s) to Cluster"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.discoveredservers" + label="&Gluster" + path="additions"> + <groupMarker + name="discoveredservers"> + </groupMarker> + </menu> + </actionSet> + <actionSet + description="Set of actions that can be performed on single Discovered Server" + id="com.gluster.storage.management.gui.actionsets.serverdiscovered" + label="Discovered Server Actions" + visible="false"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.AddServerAction" + definitionId="com.gluster.storage.management.gui.commands.AddServer" + icon="icons/server-add.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="&Add Server" + menubarPath="com.gluster.storage.management.gui.menu.discoveredserver/discoveredserver" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Add Server(s) to Cluster"> + </action> + <menu + id="com.gluster.storage.management.gui.menu.discoveredserver" + label="&Gluster" + path="additions"> + <groupMarker + name="discoveredserver"> + </groupMarker> + </menu> + </actionSet> + </extension> + <extension + point="org.eclipse.ui.perspectiveExtensions"> + <perspectiveExtension + targetID="*"> + <view + closeable="false" + id="com.gluster.storage.management.gui.views.navigator" + minimized="false" + moveable="false" + ratio="0.30f" + relationship="left" + relative="org.eclipse.ui.editorss" + showTitle="false" + standalone="true" + visible="true"> + </view> + <view + closeable="false" + id="com.gluster.storage.management.gui.views.details" + minimized="false" + moveable="false" + ratio="0.70f" + relationship="right" + relative="org.eclipse.ui.editorss" + showTitle="false" + standalone="true" + visible="true"> + </view> + <view + closeable="true" + id="org.eclipse.ui.views.ProgressView" + minimized="false" + moveable="false" + ratio="0.80f" + relationship="bottom" + relative="com.gluster.storage.management.gui.views.details" + showTitle="true" + standalone="true" + visible="false"> + </view> + </perspectiveExtension> + </extension> + <extension + point="org.eclipse.ui.decorators"> + <decorator + adaptable="false" + class="com.gluster.storage.management.gui.views.navigator.NavigationTreeLabelDecorator" + id="com.gluster.storage.management.gui.views.navigator.decorator" + label="Navigation Tree Decorator" + lightweight="true" + location="BOTTOM_LEFT" + state="true"> + </decorator> + </extension> + <extension + point="org.eclipse.ui.preferencePages"> + <page + class="com.gluster.storage.management.gui.preferences.GlusterPreferencePage" + id="com.gluster.storage.management.gui.preferences.GlusterPreferencePage" + name="Gluster"> + </page> + <page + category="com.gluster.storage.management.gui.preferences.GlusterPreferencePage" + class="com.gluster.storage.management.gui.preferences.ClusterPreferencePage" + id="com.gluster.storage.management.gui.preferences.ClusterPreferencePage" + name="Cluster"> + </page> + <page + category="com.gluster.storage.management.gui.preferences.GlusterPreferencePage" + class="com.gluster.storage.management.gui.preferences.ConsolePreferencePage" + id="com.gluster.storage.management.gui.preferences.ConsolePreferencePage" + name="Console"> + </page> + <page + category="com.gluster.storage.management.gui.preferences.GlusterPreferencePage" + class="org.eclipse.ui.ExtensionFactory:newKeysPreferencePage" + id="org.eclipse.ui.NewKeysPreferencePage" + name="Keys"> + </page> + </extension> + <extension + point="org.eclipse.core.runtime.preferences"> + <initializer + class="com.gluster.storage.management.gui.preferences.PreferenceInitializer"> + </initializer> + </extension> + <extension + point="org.eclipse.ui.popupMenus"> + <objectContribution + id="gluster.context.menu.glusterserver" + objectClass="com.gluster.storage.management.core.model.GlusterServer"> + <action + class="com.gluster.storage.management.gui.actions.RemoveServerAction" + definitionId="com.gluster.storage.management.gui.commands.RemoveServer" + enablesFor="1" + icon="icons/server-remove.png" + id="com.gluster.storage.management.gui.actions.RemoveServerAction" + label="&Remove Server" + menubarPath="additions"> + </action> + </objectContribution> + <objectContribution + id="gluster.context.menu.volume" + objectClass="com.gluster.storage.management.core.model.Volume"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.MigrateDiskAction" + definitionId="com.gluster.storage.management.gui.commands.MigrateDisk" + icon="icons/disk-migrate.png" + id="com.gluster.storage.management.gui.actions.MigrateDiskAction" + label="&Migrate Disk" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Migrate Disk"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.DeleteVolume" + icon="icons/volume-delete.png" + id="com.gluster.storage.management.gui.actions.DeleteVolumeAction" + label="&Delete Volume" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Delete Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.RebalanceVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.RebalanceVolume" + icon="icons/volume-rebalance.png" + id="com.gluster.storage.management.gui.actions.RebalanceVolumeAction" + label="&Rebalance Volume" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Rebalance Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StopVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StopVolume" + icon="icons/volume-stop.png" + id="com.gluster.storage.management.gui.actions.StopVolumeAction" + label="S&top Volume" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Stop Volume"> + </action> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.StartVolumeAction" + definitionId="com.gluster.storage.management.gui.commands.StartVolume" + icon="icons/volume-start.png" + id="com.gluster.storage.management.gui.actions.StartVolumeAction" + label="&Start Volume" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Start Volume"> + </action> + </objectContribution> + <objectContribution + id="gluster.context.menu.server" + objectClass="com.gluster.storage.management.core.model.Server"> + <action + allowLabelUpdate="false" + class="com.gluster.storage.management.gui.actions.AddServerAction" + definitionId="com.gluster.storage.management.gui.commands.AddServer" + enablesFor="+" + icon="icons/server-add.png" + id="com.gluster.storage.management.gui.actions.AddServerAction" + label="&Add Server(s)" + menubarPath="additions" + mode="FORCE_TEXT" + pulldown="false" + retarget="false" + state="false" + style="push" + toolbarPath="Normal" + tooltip="Add Server(s) to Cluster"> + </action> + <visibility> + <not> + <objectClass + name="com.gluster.storage.management.core.model.GlusterServer"> + </objectClass> + </not> + </visibility> + </objectContribution> + </extension> + +</plugin> diff --git a/com.gluster.storage.management.gui/preferences.ini b/com.gluster.storage.management.gui/preferences.ini new file mode 100644 index 00000000..91228592 --- /dev/null +++ b/com.gluster.storage.management.gui/preferences.ini @@ -0,0 +1 @@ +org.eclipse.ui/KEY_CONFIGURATION_ID = com.gluster.storage.management.gui.KeyConfig
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/splash.bmp b/com.gluster.storage.management.gui/splash.bmp Binary files differnew file mode 100644 index 00000000..059c28f9 --- /dev/null +++ b/com.gluster.storage.management.gui/splash.bmp diff --git a/com.gluster.storage.management.gui/splash/gluster_about.jpg b/com.gluster.storage.management.gui/splash/gluster_about.jpg Binary files differnew file mode 100644 index 00000000..242fa560 --- /dev/null +++ b/com.gluster.storage.management.gui/splash/gluster_about.jpg diff --git a/com.gluster.storage.management.gui/splash/splash-dialog.bmp b/com.gluster.storage.management.gui/splash/splash-dialog.bmp Binary files differnew file mode 100644 index 00000000..2de2897f --- /dev/null +++ b/com.gluster.storage.management.gui/splash/splash-dialog.bmp diff --git a/com.gluster.storage.management.gui/splash/splash-dialog.png b/com.gluster.storage.management.gui/splash/splash-dialog.png Binary files differnew file mode 100644 index 00000000..789eafb0 --- /dev/null +++ b/com.gluster.storage.management.gui/splash/splash-dialog.png diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Activator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Activator.java new file mode 100644 index 00000000..44b4a061 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Activator.java @@ -0,0 +1,65 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "com.gluster.storage.management.gui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public void editorOpened() { + System.err.println("Editor opened!"); + } + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Application.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Application.java new file mode 100644 index 00000000..70e1f2bb --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Application.java @@ -0,0 +1,98 @@ +package com.gluster.storage.management.gui; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.eclipse.core.databinding.observable.Realm; +import org.eclipse.equinox.app.IApplication; +import org.eclipse.equinox.app.IApplicationContext; +import org.eclipse.jface.databinding.swt.SWTObservables; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.gui.login.LoginDialog; + +/** + * This class controls all aspects of the application's execution + */ +public class Application implements IApplication { + + public static final String PLUGIN_ID = "com.gluster.storage.management.gui"; + private static Application instance; + private List<IEntityListener> entityListeners = Collections.synchronizedList(new ArrayList<IEntityListener>()); + + public Application() { + instance = this; + } + + public static Application getApplication() { + return instance; + } + + private boolean login() { + LoginDialog loginDialog = new LoginDialog(new Shell(Display.getDefault())); + return (loginDialog.open() == Window.OK); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) + */ + public Object start(IApplicationContext context) { + Display display = PlatformUI.createDisplay(); + + final boolean[] loginSuccess = new boolean[1]; + Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() { + public void run() { + loginSuccess[0] = login(); + } + }); + + if (!loginSuccess[0]) { + return IApplication.EXIT_OK; + } + try { + int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); + if (returnCode == PlatformUI.RETURN_RESTART) { + return IApplication.EXIT_RESTART; + } + return IApplication.EXIT_OK; + } finally { + display.dispose(); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.equinox.app.IApplication#stop() + */ + public void stop() { + if (!PlatformUI.isWorkbenchRunning()) + return; + final IWorkbench workbench = PlatformUI.getWorkbench(); + final Display display = workbench.getDisplay(); + display.syncExec(new Runnable() { + public void run() { + if (!display.isDisposed()) + workbench.close(); + } + }); + } + + public void addEntityListener(IEntityListener listener) { + entityListeners.add(listener); + } + + public void entityChanged(Entity entity, String[] paremeters) { + for (IEntityListener listener : entityListeners) { + listener.entityChanged(entity, paremeters); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationActionBarAdvisor.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationActionBarAdvisor.java new file mode 100644 index 00000000..1910da79 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationActionBarAdvisor.java @@ -0,0 +1,79 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.ICoolBarManager; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; +import org.eclipse.ui.application.ActionBarAdvisor; +import org.eclipse.ui.application.IActionBarConfigurer; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.gluster.storage.management.gui.utils.GUIHelper; + +/** + * An action bar advisor is responsible for creating, adding, and disposing of the actions added to a workbench window. + * Each window will be populated with new actions. + */ +public class ApplicationActionBarAdvisor extends ActionBarAdvisor { + private IWorkbenchWindow window; + /* + * Actions - important to allocate these only in makeActions, and then use them in the fill methods. This ensures + * that the actions aren't recreated when fillActionBars is called with FILL_PROXY. + */ + private IWorkbenchAction exitAction; + private IWorkbenchAction aboutAction; + + private GUIHelper guiHelper = GUIHelper.getInstance(); + + public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { + super(configurer); + } + + protected void makeActions(final IWorkbenchWindow window) { + this.window = window; + /* + * Creates the actions and registers them. Registering is needed to ensure that key bindings work. The + * corresponding commands keybindings are defined in the plugin.xml file. Registering also provides automatic + * disposal of the actions when the window is closed. + */ + exitAction = ActionFactory.QUIT.create(window); + register(exitAction); + + aboutAction = ActionFactory.ABOUT.create(window); + aboutAction.setText("&About"); + aboutAction.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.HELP)); + register(aboutAction); + } + + protected void fillMenuBar(IMenuManager menuBar) { + // File + MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); + fileMenu.add(new Separator()); + fileMenu.add(exitAction); + + // Help + MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP); + helpMenu.add(aboutAction); + + menuBar.add(fileMenu); + // Add a group marker indicating where action set menus will appear. + // All action sets from plugin.xml will get added here + menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); + menuBar.add(helpMenu); + + MenuManager addMenu = new MenuManager("&New"); + fileMenu.add(addMenu); + } + + protected void fillCoolBar(ICoolBarManager coolBar) { + // All our actions are added to toolbar through the extension point org.eclipse.ui.actionSets + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchAdvisor.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchAdvisor.java new file mode 100644 index 00000000..2f345902 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchAdvisor.java @@ -0,0 +1,27 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.ui.application.IWorkbenchConfigurer; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.application.WorkbenchAdvisor; +import org.eclipse.ui.application.WorkbenchWindowAdvisor; + +/** + * This workbench advisor creates the window advisor, and specifies + * the perspective id for the initial window. + */ +public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { + + public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { + return new ApplicationWorkbenchWindowAdvisor(configurer); + } + + public String getInitialWindowPerspectiveId() { + return Perspective.ID; + } + + @Override + public void initialize(IWorkbenchConfigurer configurer) { + super.initialize(configurer); + configurer.setSaveAndRestore(false); // we don't need save/restore as of now + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchWindowAdvisor.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchWindowAdvisor.java new file mode 100644 index 00000000..1d9d1537 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ApplicationWorkbenchWindowAdvisor.java @@ -0,0 +1,42 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.ui.application.ActionBarAdvisor; +import org.eclipse.ui.application.IActionBarConfigurer; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.application.WorkbenchWindowAdvisor; + +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { + private final static int DEFAULT_WIDTH = 1024; + private final static int DEFAULT_HEIGHT = 768; + private final GUIHelper guiHelper = GUIHelper.getInstance(); + + public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { + super(configurer); + } + + @Override + public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { + return new ApplicationActionBarAdvisor(configurer); + } + + @Override + public void preWindowOpen() { + super.preWindowOpen(); + + IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); + configurer.setInitialSize(new Point(DEFAULT_WIDTH, DEFAULT_HEIGHT)); + configurer.setShowCoolBar(true); + configurer.setShowStatusLine(true); + configurer.setShowMenuBar(true); + configurer.setShowProgressIndicator(true); // shows progress indicator in status bar + } + + @Override + public void postWindowCreate() { + super.postWindowCreate(); + guiHelper.centerShellInScreen(getWindowConfigurer().getWindow().getShell()); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/DiskTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/DiskTableLabelProvider.java new file mode 100644 index 00000000..308b5f1c --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/DiskTableLabelProvider.java @@ -0,0 +1,70 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.swt.graphics.Image; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.DisksPage.DISK_TABLE_COLUMN_INDICES; + +public class DiskTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public Image getColumnImage(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + Disk disk = (Disk) element; + if (columnIndex == DISK_TABLE_COLUMN_INDICES.STATUS.ordinal()) { + DISK_STATUS status = disk.getStatus(); + switch (status) { + case READY: + return guiHelper.getImage(IImageKeys.STATUS_ONLINE); + case OFFLINE: + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + case UNINITIALIZED: + return guiHelper.getImage(IImageKeys.DISK_UNINITIALIZED); + case INITIALIZING: + return guiHelper.getImage(IImageKeys.WORK_IN_PROGRESS); + default: + throw new GlusterRuntimeException("Invalid disk status [" + status + "]"); + } + } + + return null; + } + + private String getDiskSpaceInUse(Disk disk) { + if (disk.isReady()) { + return NumberUtil.formatNumber(disk.getSpaceInUse()); + } else { + return "NA"; + } + } + + private String getDiskSpace(Disk disk) { + if (disk.isOffline()) { + return "NA"; + } else { + return NumberUtil.formatNumber(disk.getSpace()); + } + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + Disk disk = (Disk) element; + return (columnIndex == DISK_TABLE_COLUMN_INDICES.SERVER.ordinal() ? disk.getServer().getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.DISK.ordinal() ? disk.getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE.ordinal() ? getDiskSpace(disk) + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE.ordinal() ? getDiskSpaceInUse(disk) + : columnIndex == DISK_TABLE_COLUMN_INDICES.STATUS.ordinal() ? disk.getStatusStr() : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/EntityGroupContentProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/EntityGroupContentProvider.java new file mode 100644 index 00000000..d5dfe3d3 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/EntityGroupContentProvider.java @@ -0,0 +1,26 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.Viewer; + +import com.gluster.storage.management.core.model.EntityGroup; + +public class EntityGroupContentProvider<T> implements + IStructuredContentProvider { + @Override + public void dispose() { + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + + } + + @Override + public Object[] getElements(Object inputElement) { + if (inputElement instanceof EntityGroup) { + return ((EntityGroup) inputElement).getChildren().toArray(); + } + return null; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterServerTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterServerTableLabelProvider.java new file mode 100644 index 00000000..2346b99c --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/GlusterServerTableLabelProvider.java @@ -0,0 +1,57 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.swt.graphics.Image; + +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.GlusterServer.SERVER_STATUS; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.GlusterServersPage.GLUSTER_SERVER_TABLE_COLUMN_INDICES; + +public class GlusterServerTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public Image getColumnImage(Object element, int columnIndex) { + if (!(element instanceof GlusterServer)) { + return null; + } + + GlusterServer server = (GlusterServer) element; + if(columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.STATUS.ordinal()) { + SERVER_STATUS status = server.getStatus(); + if(status == SERVER_STATUS.ONLINE) { + return guiHelper.getImage(IImageKeys.STATUS_ONLINE); + } else { + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + } + } + + return null; + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof GlusterServer)) { + return null; + } + + GlusterServer server = (GlusterServer) element; + + if (server.getStatus() == SERVER_STATUS.OFFLINE + && columnIndex != GLUSTER_SERVER_TABLE_COLUMN_INDICES.NAME.ordinal() + && columnIndex != GLUSTER_SERVER_TABLE_COLUMN_INDICES.STATUS.ordinal()) { + return "NA"; + } + + return (columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.NAME.ordinal() ? server.getName() + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.STATUS.ordinal() ? server.getStatusStr() + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.PREFERRED_NETWORK.ordinal() ? server.getPreferredNetworkInterface().getName() + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.NUM_OF_CPUS.ordinal() ? "" + server.getNumOfCPUs() + //: columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.CPU_USAGE.ordinal() ? "" + server.getCpuUsage() + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.TOTAL_MEMORY.ordinal() ? "" + server.getTotalMemory() + //: columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.MEMORY_IN_USE.ordinal() ? "" + server.getMemoryInUse() + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.TOTAL_DISK_SPACE.ordinal() ? NumberUtil.formatNumber(server.getTotalDiskSpace()) + : columnIndex == GLUSTER_SERVER_TABLE_COLUMN_INDICES.IP_ADDRESSES.ordinal() ? server.getIpAddressesAsString() : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ICommandIds.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ICommandIds.java new file mode 100644 index 00000000..0c94dc8f --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ICommandIds.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui; + +/** + * Interface defining the application's command IDs. + * Key bindings can be defined for specific commands. + * To associate an action with a command, use IAction.setActionDefinitionId(commandId). + * + * @see org.eclipse.jface.action.IAction#setActionDefinitionId(String) + */ +public interface ICommandIds { + + public static final String CMD_OPEN = "com.gluster.storage.management.gui.open"; + public static final String CMD_OPEN_MESSAGE = "com.gluster.storage.management.gui.openMessage"; + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IEntityListener.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IEntityListener.java new file mode 100644 index 00000000..46f12962 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IEntityListener.java @@ -0,0 +1,19 @@ +package com.gluster.storage.management.gui; + +import com.gluster.storage.management.core.model.Entity; + +/** + * Any class that is interested in changes to entities in application scope should implement this interface and register + * with the application using {@link Application#addEntityListener(IEntityListener)} + * + * @author root + * + */ +public interface IEntityListener { + /** + * This method is called whenever any attribute of an entity in application scope changes + * @param entity Entity that has changed + * @param paremeters List of attribute names that have changed. This can be null. + */ + public void entityChanged(Entity entity, String[] paremeters); +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IImageKeys.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IImageKeys.java new file mode 100644 index 00000000..cef276a9 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/IImageKeys.java @@ -0,0 +1,44 @@ +package com.gluster.storage.management.gui; + +public interface IImageKeys { + public static final String CLUSTER = "icons/cluster.png"; + public static final String VOLUMES = "icons/volumes.png"; + public static final String SERVERS = "icons/servers.png"; + public static final String VOLUME = "icons/volume.png"; + public static final String SERVER = "icons/server.png"; + public static final String GSN = "icons/gsn.png"; + public static final String SETTINGS = "icons/settings.png"; + public static final String ADD = "icons/plus-white.png"; + public static final String REMOVE = "icons/minus-white.png"; + public static final String CREATE_VOLUME = "icons/volume-create.png"; + public static final String CREATE_VOLUME_BIG = "icons/volume-create-big.png"; + public static final String REMOVE_VOLUME = "icons/volume-delete.png"; + public static final String ADD_SERVER = "icons/server-add.png"; + public static final String ADD_SERVER_BIG = "icons/server-add-big.png"; + public static final String REMOVE_SERVER = "icons/server-remove.png"; + public static final String HELP = "icons/question.png"; + public static final String STATUS_OFFLINE = "icons/status-offline.png"; + public static final String STATUS_ONLINE = "icons/status-online.png"; + public static final String STATUS_CANCELLED = "icons/status-offline.png"; + public static final String STATUS_SUCCESS = "icons/status-online.png"; + public static final String WORK_IN_PROGRESS = "icons/progress-bar.png"; + public static final String CHECKBOX_UNCHECKED = "icons/ui-check-box-uncheck.png"; + public static final String CHECKBOX_CHECKED = "icons/ui-check-box.png"; + public static final String DISK_UNINITIALIZED = "icons/disk-uninitialized.png"; + public static final String SEARCH = "icons/search.png"; + public static final String ARROW_UP = "icons/arrow-up.png"; + public static final String ARROW_DOWN = "icons/arrow-down.png"; + + public static final String OVERLAY_OFFLINE = "icons/status-offline-small.png"; + public static final String OVERLAY_ONLINE = "icons/status-online-small.png"; + public static final String OVERLAY_STAR = "icons/star-small.png"; + + public static final String SPLASH_IMAGE = "splash.bmp"; + public static final String DIALOG_SPLASH_IMAGE = "splash/splash-dialog.bmp"; + + public static final String PROGRESS_BAR_LEFT = "images/progress_image_left.png"; + public static final String PROGRESS_BAR_RIGHT = "images/progress_image_right.png"; + public static final String PROGRESS_BAR_FILLED = "images/progress_image_filled_safe.png"; + public static final String PROGRESS_BAR_EMPTY = "images/progress_image_empty.png"; + public static final String GAUGE_SMALL = "images/gauge_small.png"; +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/NetworkInterfaceTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/NetworkInterfaceTableLabelProvider.java new file mode 100644 index 00000000..1292cb9a --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/NetworkInterfaceTableLabelProvider.java @@ -0,0 +1,22 @@ +package com.gluster.storage.management.gui; + + +import com.gluster.storage.management.core.model.NetworkInterface; +import com.gluster.storage.management.gui.views.details.tabcreators.GlusterServerTabCreator.NETWORK_INTERFACE_TABLE_COLUMN_INDICES; + +public class NetworkInterfaceTableLabelProvider extends TableLabelProviderAdapter { + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof NetworkInterface)) { + return null; + } + + NetworkInterface networkInterface = (NetworkInterface) element; + return (columnIndex == NETWORK_INTERFACE_TABLE_COLUMN_INDICES.INTERFACE.ordinal() ? networkInterface.getName() + : columnIndex == NETWORK_INTERFACE_TABLE_COLUMN_INDICES.IP_ADDRESS.ordinal() ? networkInterface.getIpAddress() + : columnIndex == NETWORK_INTERFACE_TABLE_COLUMN_INDICES.NETMASK.ordinal() ? networkInterface.getNetMask() + : columnIndex == NETWORK_INTERFACE_TABLE_COLUMN_INDICES.GATEWAY.ordinal() ? networkInterface.getDefaultGateway() + : columnIndex == NETWORK_INTERFACE_TABLE_COLUMN_INDICES.PREFERRED.ordinal() ? (networkInterface.isPreferred() ? "Yes" : "No") + : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Perspective.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Perspective.java new file mode 100644 index 00000000..5b0c6e19 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/Perspective.java @@ -0,0 +1,21 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; + +import com.gluster.storage.management.gui.views.details.DetailsView; +import com.gluster.storage.management.gui.views.navigator.NavigationView; + +public class Perspective implements IPerspectiveFactory { + + /** + * The ID of the perspective as specified in the extension. + */ + public static final String ID = "com.gluster.storage.management.gui.perspective"; + + public void createInitialLayout(IPageLayout layout) { + layout.setEditorAreaVisible(false); + //layout.addStandaloneView(ClusterView.ID, false, IPageLayout.LEFT, 0.30f, layout.getEditorArea()); + //layout.addStandaloneView(DetailsView.ID, false, IPageLayout.RIGHT, 0.70f, layout.getEditorArea()); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerDiskTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerDiskTableLabelProvider.java new file mode 100644 index 00000000..889bf771 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerDiskTableLabelProvider.java @@ -0,0 +1,72 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.swt.graphics.Image; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.ServerDisksPage.SERVER_DISK_TABLE_COLUMN_INDICES; + +public class ServerDiskTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + + @Override + public Image getColumnImage(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + Disk disk = (Disk) element; + if (columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.STATUS.ordinal()) { + DISK_STATUS status = disk.getStatus(); + switch (status) { + case READY: + return guiHelper.getImage(IImageKeys.STATUS_ONLINE); + case OFFLINE: + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + case UNINITIALIZED: + return guiHelper.getImage(IImageKeys.DISK_UNINITIALIZED); + case INITIALIZING: + return guiHelper.getImage(IImageKeys.WORK_IN_PROGRESS); + default: + throw new GlusterRuntimeException("Invalid disk status [" + status + "]"); + } + } + + return null; + } + + private String getDiskSpaceInUse(Disk disk) { + if(disk.isReady()) { + return NumberUtil.formatNumber(disk.getSpaceInUse()); + } else { + return "NA"; + } + } + + private String getDiskSpace(Disk disk) { + if(disk.isOffline()) { + return "NA"; + } else { + return NumberUtil.formatNumber(disk.getSpace()); + } + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + + Disk disk = (Disk) element; + return (columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.DISK.ordinal() ? disk.getName() + : columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.SPACE.ordinal() ? getDiskSpace(disk) + : columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE.ordinal() ? getDiskSpaceInUse(disk) + : columnIndex == SERVER_DISK_TABLE_COLUMN_INDICES.STATUS.ordinal() ? disk.getStatusStr() + : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerTableLabelProvider.java new file mode 100644 index 00000000..d002c15f --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/ServerTableLabelProvider.java @@ -0,0 +1,30 @@ +package com.gluster.storage.management.gui; + + +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.ServersPage.SERVER_TABLE_COLUMN_INDICES; + +public class ServerTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Server)) { + return null; + } + + Server server = (Server) element; + return (columnIndex == SERVER_TABLE_COLUMN_INDICES.NAME.ordinal() ? server.getName() + : columnIndex == SERVER_TABLE_COLUMN_INDICES.IP_ADDRESSES.ordinal() ? server.getIpAddressesAsString() + : columnIndex == SERVER_TABLE_COLUMN_INDICES.NUM_OF_DISKS.ordinal() ? "" + server.getNumOfDisks() + : columnIndex == SERVER_TABLE_COLUMN_INDICES.TOTAL_DISK_SPACE.ordinal() ? NumberUtil.formatNumber(server.getTotalDiskSpace()) +// : columnIndex == SERVER_TABLE_COLUMN_INDICES.NUM_OF_CPUS.ordinal() ? "" + server.getNumOfCPUs() +// : columnIndex == SERVER_TABLE_COLUMN_INDICES.CPU_USAGE.ordinal() ? "" + server.getCpuUsage() +// : columnIndex == SERVER_TABLE_COLUMN_INDICES.TOTAL_MEMORY.ordinal() ? "" + server.getTotalMemory() +// : columnIndex == SERVER_TABLE_COLUMN_INDICES.MEMORY_IN_USE.ordinal() ? "" + server.getMemoryInUse() +// : columnIndex == SERVER_TABLE_COLUMN_INDICES.DISK_SPACE_IN_USE.ordinal() ? "" + server.getDiskSpaceInUse() + : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/TableLabelProviderAdapter.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/TableLabelProviderAdapter.java new file mode 100644 index 00000000..54bc5ce6 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/TableLabelProviderAdapter.java @@ -0,0 +1,40 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; + +public class TableLabelProviderAdapter implements ITableLabelProvider { + + @Override + public void addListener(ILabelProviderListener listener) { + // do nothing + + } + + @Override + public void dispose() { + // do nothing + } + + @Override + public boolean isLabelProperty(Object element, String property) { + return true; + } + + @Override + public void removeListener(ILabelProviderListener listener) { + // do nothing + } + + @Override + public Image getColumnImage(Object element, int columnIndex) { + return null; + } + + @Override + public String getColumnText(Object element, int columnIndex) { + return null; + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeLogTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeLogTableLabelProvider.java new file mode 100644 index 00000000..8685a965 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeLogTableLabelProvider.java @@ -0,0 +1,30 @@ +package com.gluster.storage.management.gui; + + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.LogMessage; +import com.gluster.storage.management.core.utils.DateUtil; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.VolumeLogsPage.LOG_TABLE_COLUMN_INDICES; + +public class VolumeLogTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + private String getFormattedDiskName(Disk disk) { + return disk.getServer().getName() + ":" + disk.getName(); + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof LogMessage)) { + return null; + } + + LogMessage logMessage = (LogMessage) element; + return (columnIndex == LOG_TABLE_COLUMN_INDICES.DATE.ordinal() ? DateUtil.formatDate(logMessage.getTimestamp()) + : columnIndex == LOG_TABLE_COLUMN_INDICES.TIME.ordinal() ? DateUtil.formatTime(logMessage.getTimestamp()) + : columnIndex == LOG_TABLE_COLUMN_INDICES.DISK.ordinal() ? getFormattedDiskName(logMessage.getDisk()) + : columnIndex == LOG_TABLE_COLUMN_INDICES.SEVERITY.ordinal() ? "" + logMessage.getSeverity() + : columnIndex == LOG_TABLE_COLUMN_INDICES.MESSAGE.ordinal() ? logMessage.getMessage() : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeOptionsTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeOptionsTableLabelProvider.java new file mode 100644 index 00000000..3c24b3f4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeOptionsTableLabelProvider.java @@ -0,0 +1,24 @@ +package com.gluster.storage.management.gui; + +import java.util.Map.Entry; + +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.VolumeOptionsPage.OPTIONS_TABLE_COLUMN_INDICES; + +public class VolumeOptionsTableLabelProvider extends TableLabelProviderAdapter { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Entry)) { + return null; + } + + Entry<String, String> entry = (Entry) element; + String key = entry.getKey(); + String value = entry.getValue(); + return (columnIndex == OPTIONS_TABLE_COLUMN_INDICES.OPTION_KEY.ordinal() ? key + : columnIndex == OPTIONS_TABLE_COLUMN_INDICES.OPTION_VALUE.ordinal() ? value + : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeTableLabelProvider.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeTableLabelProvider.java new file mode 100644 index 00000000..63241961 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/VolumeTableLabelProvider.java @@ -0,0 +1,64 @@ +package com.gluster.storage.management.gui; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; + +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.model.Volume.VOLUME_STATUS; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.VolumesPage.VOLUME_TABLE_COLUMN_INDICES; + +public class VolumeTableLabelProvider implements ITableLabelProvider { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public void addListener(ILabelProviderListener listener) { + } + + @Override + public void dispose() { + } + + @Override + public boolean isLabelProperty(Object element, String property) { + return false; + } + + @Override + public void removeListener(ILabelProviderListener listener) { + } + + @Override + public Image getColumnImage(Object element, int columnIndex) { + if (!(element instanceof Volume)) { + return null; + } + + Volume volume = (Volume) element; + if(columnIndex == VOLUME_TABLE_COLUMN_INDICES.VOLUME_STATUS.ordinal()) { + VOLUME_STATUS status = volume.getStatus(); + if(status == VOLUME_STATUS.ONLINE) { + return guiHelper.getImage(IImageKeys.STATUS_ONLINE); + } else { + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + } + } + + return null; + } + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Volume)) { + return null; + } + + Volume volume = (Volume) element; + return (columnIndex == VOLUME_TABLE_COLUMN_INDICES.NAME.ordinal() ? volume.getName() + : columnIndex == VOLUME_TABLE_COLUMN_INDICES.VOLUME_TYPE.ordinal() ? volume.getVolumeTypeStr() + : columnIndex == VOLUME_TABLE_COLUMN_INDICES.TRANSPORT_TYPE.ordinal() ? volume.getTransportTypeStr() + : columnIndex == VOLUME_TABLE_COLUMN_INDICES.NUM_OF_DISKS.ordinal() ? "" + volume.getNumOfDisks() + : columnIndex == VOLUME_TABLE_COLUMN_INDICES.VOLUME_STATUS.ordinal() ? volume.getStatusStr() : "Invalid"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AbstractActionDelegate.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AbstractActionDelegate.java new file mode 100644 index 00000000..ddcb91c0 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AbstractActionDelegate.java @@ -0,0 +1,38 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +import com.gluster.storage.management.core.model.Entity; + +/** + * All action delegates in the application should extend from this class. It provides common functionality of grabbing + * the Window object on initialization and extracting the selected entity in case of selection change on the navigation + * tree. + */ +public abstract class AbstractActionDelegate implements IWorkbenchWindowActionDelegate { + protected IWorkbenchWindow window; + protected Entity selectedEntity; + + @Override + public void selectionChanged(IAction action, ISelection selection) { + if (selection instanceof StructuredSelection) { + Entity selectedEntity = (Entity) ((StructuredSelection) selection).getFirstElement(); + + if (this.selectedEntity == selectedEntity) { + // entity selection has not changed. do nothing. + return; + } + + this.selectedEntity = selectedEntity; + } + } + + @Override + public void init(IWorkbenchWindow window) { + this.window = window; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AddServerAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AddServerAction.java new file mode 100644 index 00000000..9a278c74 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AddServerAction.java @@ -0,0 +1,18 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +public class AddServerAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/CreateVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/CreateVolumeAction.java new file mode 100644 index 00000000..ea5ac084 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/CreateVolumeAction.java @@ -0,0 +1,23 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.wizard.WizardDialog; + +import com.gluster.storage.management.gui.dialogs.CreateVolumeWizard; + +public class CreateVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + CreateVolumeWizard wizard = new CreateVolumeWizard(); + + WizardDialog dialog = new WizardDialog(window.getShell(), wizard); + dialog.create(); + dialog.getShell().setSize(500, 550); + dialog.open(); + } + + @Override + public void dispose() { + window = null; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DeleteVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DeleteVolumeAction.java new file mode 100644 index 00000000..d9446238 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/DeleteVolumeAction.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; + +public class DeleteVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/EditVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/EditVolumeAction.java new file mode 100644 index 00000000..47a0cc56 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/EditVolumeAction.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; + +public class EditVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/IActionSetIDs.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/IActionSetIDs.java new file mode 100644 index 00000000..cdc05128 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/IActionSetIDs.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +public interface IActionSetIDs { + public static final String ACTION_SET_CLUSTER = "com.gluster.storage.management.gui.actionsets.gluster"; + public static final String ACTION_SET_VOLUMES = "com.gluster.storage.management.gui.actionsets.volumes"; + public static final String ACTION_SET_VOLUME = "com.gluster.storage.management.gui.actionsets.volume"; + public static final String ACTION_SET_DISKS = "com.gluster.storage.management.gui.actionsets.disks"; + public static final String ACTION_SET_DISK = "com.gluster.storage.management.gui.actionsets.disk"; + public static final String ACTION_SET_GLUSTER_SERVERS = "com.gluster.storage.management.gui.actionsets.glusterservers"; + public static final String ACTION_SET_GLUSTER_SERVER = "com.gluster.storage.management.gui.actionsets.glusterserver"; + public static final String ACTION_SET_DISCOVERED_SERVERS = "com.gluster.storage.management.gui.actionsets.serversdiscovered"; + public static final String ACTION_SET_DISCOVERED_SERVER = "com.gluster.storage.management.gui.actionsets.serverdiscovered"; + + public static final String ACTION_SET_EDIT = "com.gluster.storage.management.gui.actionsets.edit"; +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateDiskAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateDiskAction.java new file mode 100644 index 00000000..3d59f179 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateDiskAction.java @@ -0,0 +1,53 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.WizardDialog; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.dialogs.MigrateDiskWizard; + +public class MigrateDiskAction extends AbstractActionDelegate { + private Volume volume; + private Disk disk; + + @Override + public void run(IAction action) { +// MigrateDiskDialog dialog = new MigrateDiskDialog(window.getShell(), volume, disk); +// dialog.create(); +// dialog.open(); + MigrateDiskWizard wizard = new MigrateDiskWizard(volume, disk); + + WizardDialog dialog = new WizardDialog(window.getShell(), wizard); + dialog.create(); + dialog.getShell().setSize(1024, 600); + dialog.open(); + } + + @Override + public void selectionChanged(IAction action, ISelection selection) { + super.selectionChanged(action, selection); + + if(selectedEntity == null) { + // this happens when user clicks on the "Disks" tab + return; + } + + action.setEnabled(false); + if (selectedEntity instanceof Volume) { + volume = (Volume) selectedEntity; + action.setEnabled(true); + } else if (selectedEntity instanceof Disk) { + disk = (Disk) selectedEntity; + action.setEnabled(((StructuredSelection) selection).size() <= 1); + } + } + + @Override + public void dispose() { + // TODO Auto-generated method stub + + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateVolumeAction.java new file mode 100644 index 00000000..ebe961b4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/MigrateVolumeAction.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; + +public class MigrateVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/PreferencesAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/PreferencesAction.java new file mode 100644 index 00000000..482d8c8c --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/PreferencesAction.java @@ -0,0 +1,18 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.ui.actions.ActionFactory; + +public class PreferencesAction extends AbstractActionDelegate { + + @Override + public void dispose() { + + } + + @Override + public void run(IAction action) { + ActionFactory.PREFERENCES.create(window).run(); + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RebalanceVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RebalanceVolumeAction.java new file mode 100644 index 00000000..dfdc6724 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RebalanceVolumeAction.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; + +public class RebalanceVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RemoveServerAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RemoveServerAction.java new file mode 100644 index 00000000..7bd81038 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/RemoveServerAction.java @@ -0,0 +1,18 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +public class RemoveServerAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StartVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StartVolumeAction.java new file mode 100644 index 00000000..1492a890 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StartVolumeAction.java @@ -0,0 +1,18 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + +public class StartVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StopVolumeAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StopVolumeAction.java new file mode 100644 index 00000000..7c3b75dc --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/StopVolumeAction.java @@ -0,0 +1,15 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; + +public class StopVolumeAction extends AbstractActionDelegate { + @Override + public void run(IAction action) { + System.out.println("Running [" + this.getClass().getSimpleName() + "]"); + } + + @Override + public void dispose() { + System.out.println("Disposing [" + this.getClass().getSimpleName() + "]"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/TestPopupMenuAction.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/TestPopupMenuAction.java new file mode 100644 index 00000000..daadb76c --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/TestPopupMenuAction.java @@ -0,0 +1,44 @@ +package com.gluster.storage.management.gui.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IObjectActionDelegate; +import org.eclipse.ui.IWorkbenchPart; + +public class TestPopupMenuAction implements IObjectActionDelegate { + + private Shell shell; + + /** + * Constructor for Action1. + */ + public TestPopupMenuAction() { + super(); + } + + /** + * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) + */ + public void setActivePart(IAction action, IWorkbenchPart targetPart) { + shell = targetPart.getSite().getShell(); + } + + /** + * @see IActionDelegate#run(IAction) + */ + public void run(IAction action) { + MessageDialog.openInformation( + shell, + "glustersp-gui", + "New Action was executed."); + } + + /** + * @see IActionDelegate#selectionChanged(IAction, ISelection) + */ + public void selectionChanged(IAction action, ISelection selection) { + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeDisksPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeDisksPage.java new file mode 100644 index 00000000..a238fca5 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeDisksPage.java @@ -0,0 +1,159 @@ +package com.gluster.storage.management.gui.dialogs; + +import java.util.List; + +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.TableLabelProviderAdapter; +import com.gluster.storage.management.gui.utils.EntityViewerFilter; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.richclientgui.toolbox.duallists.CustomTableDualListComposite; +import com.richclientgui.toolbox.duallists.RemovableContentProvider; +import com.richclientgui.toolbox.duallists.TableColumnData; + +public class CreateVolumeDisksPage extends Composite { + private enum DISK_TABLE_COLUMN_INDICES { + SERVER, DISK, SPACE, SPACE_USED + } + + private static final String[] DISK_TABLE_COLUMNS_NAMES = { "Server", "Disk", "Space (GB)", "Used Space (GB)" }; + + private GUIHelper guiHelper = GUIHelper.getInstance(); + private CustomTableDualListComposite<Disk> dualTableViewer; + private Text filterText; + + public CreateVolumeDisksPage(final Composite parent, int style, List<Disk> disks) { + super(parent, style); + + createPage(disks); + + parent.layout(); + } + + private TableLabelProviderAdapter getDiskLabelProvider() { + return new TableLabelProviderAdapter() { + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + Disk disk = (Disk) element; + return (columnIndex == DISK_TABLE_COLUMN_INDICES.SERVER.ordinal() ? disk.getServer().getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.DISK.ordinal() ? disk.getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE.ordinal() ? NumberUtil.formatNumber(disk.getSpace()) + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE_USED.ordinal() ? NumberUtil.formatNumber(disk.getSpaceInUse()) + : "Invalid"); + } + }; + } + + private void createPage(List<Disk> disks) { + setupPageLayout(); + + filterText = guiHelper.createFilterText(this); + new Label(this, SWT.NONE); + + createDualTableViewer(disks); + createFilter(filterText, false); // attach filter text to the dual table viewer for auto-filtering + + Composite buttonContainer = new Composite(this, SWT.NONE); + buttonContainer.setLayout(new GridLayout(1, false)); + GridData buttonContainerData = new GridData(SWT.FILL, SWT.CENTER, true, true); + buttonContainerData.minimumWidth = 40; + buttonContainer.setLayoutData(buttonContainerData); + + Button btnUp = new Button(buttonContainer, SWT.TOGGLE); + GridData btnUpData = new GridData(SWT.LEFT, SWT.BOTTOM, true, false); + btnUpData.minimumWidth = 30; + btnUp.setLayoutData(btnUpData); + btnUp.setImage(guiHelper.getImage(IImageKeys.ARROW_UP)); + + Button btnDown = new Button(buttonContainer, SWT.TOGGLE); + btnDown.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false)); + btnDown.setImage(guiHelper.getImage(IImageKeys.ARROW_DOWN)); + } + + private void createFilter(final Text filterText, boolean caseSensitive) { + final String initialFilterString = filterText.getText(); + + final EntityViewerFilter filter = new EntityViewerFilter(initialFilterString, caseSensitive); + // On every keystroke inside the text field, update the filter string + filterText.addKeyListener(new KeyAdapter() { + private String filterString = initialFilterString; + + @Override + public void keyReleased(KeyEvent e) { + String enteredString = filterText.getText(); + if (enteredString.equals(filterString)) { + // Filter string has not changed. don't do anything + return; + } + + // Update filter string + filterString = enteredString; + filter.setFilterString(filterString); + + // Refresh viewer with newly filtered content + dualTableViewer.refreshAvailableViewer(); + dualTableViewer.refreshChosenViewer(); + } + }); + + dualTableViewer.setAvailableViewerFilter(filter); + dualTableViewer.setChosenViewerFilter(filter); + } + + private void createDualTableViewer(List<Disk> disks) { + TableColumnData[] columnData = createColumnData(); + ITableLabelProvider diskLabelProvider = getDiskLabelProvider(); + + dualTableViewer = new CustomTableDualListComposite<Disk>(this, SWT.NONE, + columnData, columnData); + + dualTableViewer.setViewerLabels("Available:", "Chosen:"); + + dualTableViewer.setAvailableTableLinesVisible(false); + dualTableViewer.setAvailableTableHeaderVisible(true); + dualTableViewer.setAvailableContentProvider(new RemovableContentProvider<Disk>()); + dualTableViewer.setAvailableLabelProvider(diskLabelProvider); + + dualTableViewer.setChosenTableLinesVisible(true); + dualTableViewer.setChosenTableHeaderVisible(true); + dualTableViewer.setChosenContentProvider(new RemovableContentProvider<Disk>(disks)); + dualTableViewer.setChosenLabelProvider(diskLabelProvider); + } + + private TableColumnData[] createColumnData() { + DISK_TABLE_COLUMN_INDICES[] columns = DISK_TABLE_COLUMN_INDICES.values(); + TableColumnData[] columnData = new TableColumnData[columns.length]; + + for (DISK_TABLE_COLUMN_INDICES column : columns) { + int columnNum = column.ordinal(); + columnData[columnNum] = new TableColumnData(columnNum, DISK_TABLE_COLUMNS_NAMES[columnNum], 100); + } + return columnData; + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(2, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + + setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java new file mode 100644 index 00000000..21edd368 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumePage1.java @@ -0,0 +1,131 @@ +package com.gluster.storage.management.gui.dialogs; + +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ComboViewer; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Text; + +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.model.Volume.VOLUME_TYPE; + +public class CreateVolumePage1 extends WizardPage { + private static final String PAGE_NAME = "create.volume.page.1"; + private Text txtName; + private Text txtAccessControl; + + /** + * Create the wizard. + */ + public CreateVolumePage1() { + super(PAGE_NAME); + setTitle("Create Volume"); + setDescription("Create a new Volume by choosing disks from the cluster servers and configuring the volume properties."); + } + + /** + * Create contents of the wizard. + * @param parent + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + + setControl(container); + GridLayout gl_container = new GridLayout(2, false); + gl_container.verticalSpacing = 10; + gl_container.marginHeight = 10; + gl_container.marginLeft = 20; + gl_container.horizontalSpacing = 10; + container.setLayout(gl_container); + + new Label(container, SWT.NONE); + new Label(container, SWT.NONE); + + Label lblName = new Label(container, SWT.NONE); + lblName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblName.setText("Name: "); + + txtName = new Text(container, SWT.BORDER); + GridData txtNameData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); + txtNameData.widthHint = 300; + txtName.setLayoutData(txtNameData); + + Label lblType = new Label(container, SWT.NONE); + lblType.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblType.setText("Type: "); + + ComboViewer typeComboViewer = new ComboViewer(container, SWT.READ_ONLY); + Combo typeCombo = typeComboViewer.getCombo(); + GridData typeComboData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); + typeCombo.setLayoutData(typeComboData); + typeComboViewer.setContentProvider(new ArrayContentProvider()); + typeComboViewer.setInput(Volume.VOLUME_TYPE.values()); + typeCombo.select(VOLUME_TYPE.PLAIN_DISTRIBUTE.ordinal()); // default type = Plain Distribute + typeComboViewer.setLabelProvider(new LabelProvider() { + @Override + public String getText(Object element) { + VOLUME_TYPE volumeType = (VOLUME_TYPE)element; + return Volume.getVolumeTypeStr(volumeType); + } + }); + + Label lblTransportType = new Label(container, SWT.NONE); + lblTransportType.setText("Transport Type: "); + + Label lblEthernet = new Label(container, SWT.NONE); + lblEthernet.setText("Ethernet"); + + Label lblDisks = new Label(container, SWT.RIGHT); + lblDisks.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblDisks.setText("Disks: "); + + Link linkCustomize = new Link(container, SWT.UNDERLINE_LINK); + linkCustomize.setText("All Disks (<A>customize</A>)"); + linkCustomize.addListener (SWT.Selection, new Listener () { + public void handleEvent(Event event) { + SelectDisksDialog dialog = new SelectDisksDialog(getShell()); + dialog.create(); + dialog.open(); + } + }); + + Label lblNasProtocol = new Label(container, SWT.RIGHT); + lblNasProtocol.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblNasProtocol.setText("NAS Protocol: "); + + Button btnGluster = new Button(container, SWT.CHECK); + btnGluster.setEnabled(false); + btnGluster.setSelection(true); + btnGluster.setText("Gluster"); + new Label(container, SWT.NONE); + + Button btnNfs = new Button(container, SWT.CHECK); + btnNfs.setSelection(true); + btnNfs.setText("NFS"); + + Label lblAccessControl = new Label(container, SWT.NONE); + lblAccessControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblAccessControl.setText("Access Control: "); + + txtAccessControl = new Text(container, SWT.BORDER); + txtAccessControl.setText("*"); + GridData accessControlData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); + accessControlData.widthHint = 300; + txtAccessControl.setLayoutData(accessControlData); + + new Label(container, SWT.NONE); + Label lblAccessControlInfo = new Label(container, SWT.TOP); + lblAccessControlInfo.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1)); + lblAccessControlInfo.setText("(Comma separated list of IP addresses)"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeWizard.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeWizard.java new file mode 100644 index 00000000..1b22cc77 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/CreateVolumeWizard.java @@ -0,0 +1,23 @@ +package com.gluster.storage.management.gui.dialogs; + +import org.eclipse.jface.wizard.Wizard; + +public class CreateVolumeWizard extends Wizard { + + public CreateVolumeWizard() { + setWindowTitle("Gluster Management Console - Create Volume"); + setHelpAvailable(false); // TODO: Introduce wizard help + } + + @Override + public void addPages() { + addPage(new CreateVolumePage1()); + } + + @Override + public boolean performFinish() { + System.out.println("Finishing volume creation!"); + // TODO: Add code to create volume + return true; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskPage1.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskPage1.java new file mode 100644 index 00000000..47b43090 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskPage1.java @@ -0,0 +1,185 @@ +package com.gluster.storage.management.gui.dialogs; + +import java.util.List; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.GlusterDummyModel; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.TableLabelProviderAdapter; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class MigrateDiskPage1 extends WizardPage { + private static final String PAGE_NAME = "migrate.disk.page.1"; + private enum DISK_TABLE_COLUMN_INDICES { + SERVER, DISK, SPACE, SPACE_IN_USE + } + private static final String[] DISK_TABLE_COLUMN_NAMES = { "Server", "Disk", "Space (GB)", "Used Space (GB)" }; + + private Volume volume; + private Disk fromDisk; + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + private ITableLabelProvider getDiskLabelProvider() { + return new TableLabelProviderAdapter() { + + @Override + public String getColumnText(Object element, int columnIndex) { + if (!(element instanceof Disk)) { + return null; + } + + Disk disk = (Disk) element; + return (columnIndex == DISK_TABLE_COLUMN_INDICES.SERVER.ordinal() ? disk.getServer().getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.DISK.ordinal() ? disk.getName() + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE.ordinal() ? NumberUtil.formatNumber(disk.getSpace()) + : columnIndex == DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE.ordinal() ? NumberUtil.formatNumber(disk.getSpaceInUse()) + : "Invalid"); + } + }; + } + + private void setupDiskTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, DISK_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SERVER, SWT.CENTER, 100); + setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.DISK, SWT.CENTER, 100); + setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SPACE, SWT.CENTER, 90); + setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE, SWT.CENTER, 90); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, DISK_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } + + + /** + * Create the wizard. + */ + public MigrateDiskPage1(Volume volume, Disk disk) { + super(PAGE_NAME); + this.volume = volume; + this.fromDisk = disk; + setTitle("Migrate Disk [" + volume.getName() + "]"); +// setDescription("Migrate data from one disk to another for the chosen Volume. " + +// "This will copy all data present in the \"from disk\" of the volume " + +// "to \"to disk\", remove \"from disk\" from the volume, and " + +// "add \"to disk\" to the volume"); + setDescription("Migrate volume data from \"From Disk\" to \"To Disk\""); + } + + private void setupPageLayout(Composite container) { + final GridLayout layout = new GridLayout(2, false); + layout.verticalSpacing = 10; + layout.horizontalSpacing = 10; + layout.marginTop = 10; + layout.marginLeft = 10; + layout.marginRight = 10; + container.setLayout(layout); + } + + private Composite createTableViewerComposite(Composite parent) { + Composite tableViewerComposite = new Composite(parent, SWT.NONE); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + /** + * Create contents of the wizard. + * + * @param parent + */ + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + setControl(container); + + setupPageLayout(container); + + GridData labelLayoutData = new GridData(SWT.LEFT, SWT.BOTTOM, true, false); + labelLayoutData.minimumWidth = 100; + labelLayoutData.verticalAlignment = SWT.BOTTOM; + //labelLayoutData.verticalIndent = 10; + + Label lblFromDisk = new Label(container, SWT.NONE); + lblFromDisk.setText("From Disk:"); + lblFromDisk.setLayoutData(labelLayoutData); + Label lblToDisk = new Label(container, SWT.NONE); + lblToDisk.setText("To Disk:"); + lblToDisk.setLayoutData(labelLayoutData); + + Text txtFilterFrom = guiHelper.createFilterText(container); + Text txtFilterTo = guiHelper.createFilterText(container); + + ITableLabelProvider diskLabelProvider = getDiskLabelProvider(); + + GlusterDummyModel glusterDummyModel = GlusterDummyModel.getInstance(); + List<Disk> fromDisks = glusterDummyModel.getReadyDisksOfVolume(volume); + List<Disk> toDisks = glusterDummyModel.getReadyDisksOfAllServersExcluding(volume.getDisks()); + + TableViewer tableViewerFrom = createTableViewer(container, diskLabelProvider, fromDisks, txtFilterFrom); + if(fromDisk != null) { + setFromDisk(tableViewerFrom, fromDisk); + } + + createTableViewer(container, diskLabelProvider, toDisks, txtFilterTo); + } + + private void setFromDisk(TableViewer tableViewer, Disk diskToSelect) { + Table table = tableViewer.getTable(); + for(int i = 0 ; i < table.getItemCount(); i++) { + TableItem item = table.getItem(i); + if(item.getData() == diskToSelect) { + table.select(i); + return; + } + } + } + + private TableViewer createTableViewer(Composite container, ITableLabelProvider diskLabelProvider, List<Disk> fromDisks, Text txtFilterText) { + Composite tableViewerComposite = createTableViewerComposite(container); + + TableViewer tableViewer = new TableViewer(tableViewerComposite, SWT.SINGLE); + tableViewer.setContentProvider(new ArrayContentProvider()); + tableViewer.setLabelProvider(diskLabelProvider); + + setupDiskTable(tableViewerComposite, tableViewer.getTable()); + guiHelper.createFilter(tableViewer, txtFilterText, false); + + tableViewer.setInput(fromDisks.toArray()); + return tableViewer; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskWizard.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskWizard.java new file mode 100644 index 00000000..f9416c9f --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/MigrateDiskWizard.java @@ -0,0 +1,30 @@ +package com.gluster.storage.management.gui.dialogs; + +import org.eclipse.jface.wizard.Wizard; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Volume; + +public class MigrateDiskWizard extends Wizard { + private Volume volume; + private Disk disk; + + public MigrateDiskWizard(Volume volume, Disk disk) { + setWindowTitle("Gluster Management Console - Migrate Disk [" + volume.getName() + "]"); + this.volume = volume; + this.disk = disk; + setHelpAvailable(false); // TODO: Introduce wizard help + } + + @Override + public void addPages() { + addPage(new MigrateDiskPage1(volume, disk)); + } + + @Override + public boolean performFinish() { + System.out.println("Triggered Disk Migration!"); + // TODO: Add code to migrate disk + return true; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/SelectDisksDialog.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/SelectDisksDialog.java new file mode 100644 index 00000000..57caa8e4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/SelectDisksDialog.java @@ -0,0 +1,77 @@ +package com.gluster.storage.management.gui.dialogs; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +import com.gluster.storage.management.core.model.GlusterDummyModel; + +public class SelectDisksDialog extends Dialog { + + /** + * Create the dialog. + * + * @param parentShell + */ + public SelectDisksDialog(Shell parentShell) { + super(parentShell); + setShellStyle(getShellStyle() | SWT.RESIZE); + } + + /** + * Create contents of the dialog. + * + * @param parent + */ + @Override + protected Control createDialogArea(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + GridLayout containerLayout = new GridLayout(2, false); + container.setLayout(containerLayout); + GridData containerLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); + container.setLayoutData(containerLayoutData); + + getShell().setText("Create Volume - Select Disks"); + CreateVolumeDisksPage disksPage = new CreateVolumeDisksPage(container, SWT.NONE, GlusterDummyModel + .getInstance().getReadyDisksOfAllServers()); + + return container; + } + + /** + * Create contents of the button bar. + * + * @param parent + */ + @Override + protected void createButtonsForButtonBar(Composite parent) { + createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); + createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); + } + + /** + * Return the initial size of the dialog. + */ + @Override + protected Point getInitialSize() { + return new Point(1024, 600); + } + + @Override + protected void cancelPressed() { + // TODO Auto-generated method stub + super.cancelPressed(); + } + + @Override + protected void okPressed() { + // TODO Auto-generated method stub + super.okPressed(); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/Messages.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/Messages.java new file mode 100644 index 00000000..57293228 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/Messages.java @@ -0,0 +1,23 @@ +package com.gluster.storage.management.gui.editor;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "com.gluster.storage.management.gui.editor.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ // TODO Auto-generated method stub
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage.java new file mode 100644 index 00000000..7b87aba4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage.java @@ -0,0 +1,158 @@ +package com.gluster.storage.management.gui.editor; + +import org.eclipse.jface.bindings.keys.KeyStroke; +import org.eclipse.jface.bindings.keys.ParseException; +import org.eclipse.jface.fieldassist.ComboContentAdapter; +import org.eclipse.jface.fieldassist.ContentProposalAdapter; +import org.eclipse.jface.fieldassist.SimpleContentProposalProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CCombo; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.forms.IManagedForm; +import org.eclipse.ui.forms.editor.FormEditor; +import org.eclipse.ui.forms.editor.FormPage; +import org.eclipse.ui.forms.events.ExpansionAdapter; +import org.eclipse.ui.forms.events.ExpansionEvent; +import org.eclipse.ui.forms.widgets.ColumnLayout; +import org.eclipse.ui.forms.widgets.FormText; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; +import org.eclipse.ui.forms.widgets.Section; + +import com.swtdesigner.SWTResourceManager; + +public class SettingsPage extends FormPage { + + public static final String ID = "com.gluster.storage.management.gui.editor.ClusterSummaryPage"; + + /** + * Create the form page. + * + * @param id + * @param title + */ + public SettingsPage(String title) { + super(ID, title); + } + + /** + * Create the form page. + * + * @param editor + * @param id + * @param title + * @wbp.parser.constructor + * @wbp.eval.method.parameter title "Some title" + */ + public SettingsPage(FormEditor editor, String title) { + super(editor, ID, title); + } + + private void setupForm(FormToolkit toolkit, final ScrolledForm form) { + form.setText("Settings"); + toolkit.decorateFormHeading(form.getForm()); + + ColumnLayout layout = new ColumnLayout(); + + // layout.topMargin = 0; + // layout.bottomMargin = 5; + // layout.leftMargin = 10; + // layout.rightMargin = 10; + // layout.horizontalSpacing = 10; + // layout.verticalSpacing = 10; + // layout.maxNumColumns = 4; + // layout.minNumColumns = 1; + + form.getBody().setLayout(layout); + } + + /** + * Create contents of the form. + * + * @param managedForm + */ + @Override + protected void createFormContent(IManagedForm managedForm) { + FormToolkit toolkit = managedForm.getToolkit(); + final ScrolledForm form = managedForm.getForm(); + + setupForm(toolkit, form); + createClusterSettingsSection(toolkit, form); + } + + private Composite createSection(final ScrolledForm form, + FormToolkit toolkit, String title, String desc, int numColumns, + boolean collapsible) { + int style = Section.TITLE_BAR | Section.EXPANDED; + if (desc != null && !desc.isEmpty()) { + style |= Section.DESCRIPTION; + } + if (collapsible) { + style |= Section.TWISTIE; + } + + Section section = toolkit.createSection(form.getBody(), style); + section.setText(title); + section.setDescription(desc); + + // toolkit.createCompositeSeparator(section); + Composite client = toolkit.createComposite(section); + GridLayout layout = new GridLayout(); + layout.marginWidth = layout.marginHeight = 0; + layout.numColumns = numColumns; + client.setLayout(layout); + section.setClient(client); + new Label(client, SWT.NONE); + section.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(false); + } + }); + return client; + } + + private void createClusterSettingsSection(FormToolkit toolkit, + final ScrolledForm form) { + Composite sectionClient = createSection(form, toolkit, "Volumes", null, + 2, false); + + Label lblNumberOfVolumes = toolkit.createLabel(sectionClient, + "Number of Volumes: ", SWT.NONE); + Label lblVolumeCount = toolkit.createLabel(sectionClient, "12", + SWT.NONE); + Label lblOnline = toolkit.createLabel(sectionClient, "Online: ", + SWT.NONE); + Label labelOnlineCount = toolkit.createLabel(sectionClient, "9", + SWT.NONE); + labelOnlineCount.setForeground(SWTResourceManager + .getColor(SWT.COLOR_DARK_GREEN)); + Label lblOffline = toolkit.createLabel(sectionClient, "Offline: ", + SWT.NONE); + Label lblOfflineCount = toolkit.createLabel(sectionClient, "3", + SWT.NONE); + lblOfflineCount.setForeground(SWTResourceManager + .getColor(SWT.COLOR_RED)); + /*CCombo cboTimeZone = new CCombo(sectionClient, SWT.FLAT); + cboTimeZone.setData(FormToolkit.KEY_DRAW_BORDER, + FormToolkit.TEXT_BORDER);*/ + /*toolkit.paintBordersFor(sectionClient); + + cboTimeZone.add("Asia/Calcutta"); + try { + ContentProposalAdapter proposalAdapter = new ContentProposalAdapter( + cboTimeZone, new ComboContentAdapter(), + new SimpleContentProposalProvider( + new String[] { "Asia/Calcutta" }), + KeyStroke.getInstance("Ctrl+Space"), null); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + }*/ + + /*Label lblTimeServer = toolkit.createLabel(sectionClient, "Network Time GlusterServer", + SWT.NONE);*/ + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage1.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage1.java new file mode 100644 index 00000000..146e2fa4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/SettingsPage1.java @@ -0,0 +1,173 @@ +package com.gluster.storage.management.gui.editor; + +import org.eclipse.jface.fieldassist.ComboContentAdapter; +import org.eclipse.jface.fieldassist.ContentProposalAdapter; +import org.eclipse.jface.fieldassist.SimpleContentProposalProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.IManagedForm; +import org.eclipse.ui.forms.editor.FormEditor; +import org.eclipse.ui.forms.editor.FormPage; +import org.eclipse.ui.forms.events.ExpansionAdapter; +import org.eclipse.ui.forms.events.ExpansionEvent; +import org.eclipse.ui.forms.widgets.ColumnLayout; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; +import org.eclipse.ui.forms.widgets.Section; + +public class SettingsPage1 extends FormPage { + + public static final String ID = "com.gluster.storage.management.gui.editor.ClusterSummaryPage"; + + /** + * Create the form page. + * + * @param id + * @param title + */ + public SettingsPage1(String title) { + super(ID, title); + } + + /** + * Create the form page. + * + * @param editor + * @param id + * @param title + * @wbp.parser.constructor + * @wbp.eval.method.parameter title "Some title" + */ + public SettingsPage1(FormEditor editor, String title) { + super(editor, ID, title); + } + + private void setupForm(FormToolkit toolkit, final ScrolledForm form) { + form.setText("Settings"); + toolkit.decorateFormHeading(form.getForm()); + + ColumnLayout layout = new ColumnLayout(); + + // layout.topMargin = 0; + // layout.bottomMargin = 5; + // layout.leftMargin = 10; + // layout.rightMargin = 10; + // layout.horizontalSpacing = 10; + // layout.verticalSpacing = 10; + // layout.maxNumColumns = 4; + // layout.minNumColumns = 1; + + form.getBody().setLayout(layout); + } + + /** + * Create contents of the form. + * + * @param managedForm + */ + @Override + protected void createFormContent(IManagedForm managedForm) { + FormToolkit toolkit = managedForm.getToolkit(); + final ScrolledForm form = managedForm.getForm(); + + setupForm(toolkit, form); + createClusterSettingsSection(toolkit, form); + createAppSettingsSection(toolkit, form); + } + + private Composite createSection(final ScrolledForm form, + FormToolkit toolkit, String title, String desc, int numColumns, + boolean collapsible) { + int style = Section.TITLE_BAR | Section.EXPANDED; + if (desc != null && !desc.isEmpty()) { + style |= Section.DESCRIPTION; + } + if (collapsible) { + style |= Section.TWISTIE; + } + + Section section = toolkit.createSection(form.getBody(), style); + section.setText(title); + section.setDescription(desc); + + //toolkit.createCompositeSeparator(section); + Composite client = toolkit.createComposite(section); + GridLayout layout = new GridLayout(); + layout.marginWidth = layout.marginHeight = 10; + layout.numColumns = numColumns; + layout.verticalSpacing = 20; + client.setLayout(layout); + section.setClient(client); + section.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(false); + } + }); + return client; + } + + private void createAppSettingsSection(FormToolkit toolkit, + final ScrolledForm form) { + GridData layoutData = createDefaultLayoutData(); + + Composite sectionClient = createSection(form, toolkit, "Application Settings", null, + 2, false); + + toolkit.createButton(sectionClient, "Enable Remote CLI?", SWT.CHECK | SWT.FLAT); + toolkit.paintBordersFor(sectionClient); + } + + private void createClusterSettingsSection(FormToolkit toolkit, + final ScrolledForm form) { + GridData layoutData = createDefaultLayoutData(); + + Composite sectionClient = createSection(form, toolkit, "Cluster Settings", null, + 2, false); + + Label lblTimeZone = toolkit.createLabel(sectionClient, + "Time Zone: ", SWT.NONE); + Combo cboTimeZone = createTimeZoneCombo(sectionClient, layoutData); + + Label lblTimeServer = toolkit.createLabel(sectionClient, + "Network Time GlusterServer: ", SWT.NONE); + Text txtTimeServer = toolkit.createText(sectionClient, "pool.ntp.org", SWT.BORDER_SOLID); + txtTimeServer.setLayoutData(layoutData); + + toolkit.paintBordersFor(sectionClient); + } + + private GridData createDefaultLayoutData() { + GridData layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace=true; + layoutData.minimumWidth=200; + return layoutData; + } + + private Combo createTimeZoneCombo(Composite sectionClient, GridData layoutData) { + Combo cboTimeZone = new Combo(sectionClient, SWT.FLAT); + cboTimeZone.setData(FormToolkit.KEY_DRAW_BORDER, + FormToolkit.TEXT_BORDER); + cboTimeZone.setLayoutData(layoutData); + + for(String timeZone : TimeZones.timeZones) { + cboTimeZone.add(timeZone); + } + cboTimeZone.setText("Asia/Calcutta"); + + SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider( + TimeZones.timeZones); + proposalProvider.setFiltering(true); + ContentProposalAdapter proposalAdapter = new ContentProposalAdapter( + cboTimeZone, new ComboContentAdapter(), proposalProvider, null, + null); + proposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); + + return cboTimeZone; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/ThirdPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/ThirdPage.java new file mode 100644 index 00000000..921624ec --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/ThirdPage.java @@ -0,0 +1,147 @@ +/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package com.gluster.storage.management.gui.editor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+/**
+ * @author dejan
+ *
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class ThirdPage extends FormPage {
+ /**
+ * @param id
+ * @param title
+ */
+ public ThirdPage(FormEditor editor) {
+ super(editor, "third", Messages.getString("ThirdPage.label")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ //FormToolkit toolkit = managedForm.getToolkit();
+ form.setText(Messages.getString("ThirdPage.title")); //$NON-NLS-1$
+ ColumnLayout layout = new ColumnLayout();
+ layout.topMargin = 0;
+ layout.bottomMargin = 5;
+ layout.leftMargin = 10;
+ layout.rightMargin = 10;
+ layout.horizontalSpacing = 10;
+ layout.verticalSpacing = 10;
+ layout.maxNumColumns = 4;
+ layout.minNumColumns = 1;
+ form.getBody().setLayout(layout);
+ //form.getBody().setBackground(
+ // form.getBody().getDisplay().getSystemColor(SWT.COLOR_GREEN));
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.ls1.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ls1.desc"), 2); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.ls2.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ls2.desc"), 2); //$NON-NLS-1$
+ createMixedSection(managedForm, Messages.getString("ThirdPage.ms1.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ms1.desc")); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.ls3.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ls3.desc"), 4); //$NON-NLS-1$
+ createSectionWithControls(managedForm, Messages.getString("ThirdPage.cs1.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.cs1.desc")); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.ls4.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ls4.desc"), 3); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.ls5.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ls5.desc"), 5); //$NON-NLS-1$
+ createMixedSection(managedForm, Messages.getString("ThirdPage.ms2.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.ms2.desc")); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.l6.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.l6.desc"), 2); //$NON-NLS-1$
+ createSectionWithControls(managedForm, Messages.getString("ThirdPage.cs2.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.cs2.desc")); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.l7.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.l7.desc"), 4); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.l8.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.l8.desc"), 2); //$NON-NLS-1$
+ createMixedSection(managedForm, Messages.getString("ThirdPage.m3.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.m3.desc")); //$NON-NLS-1$
+ createSectionWithLinks(managedForm, Messages.getString("ThirdPage.l9.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.l9.desc"), 2); //$NON-NLS-1$
+ createSectionWithControls(managedForm, Messages.getString("ThirdPage.c3.name"), //$NON-NLS-1$
+ Messages.getString("ThirdPage.c3.desc")); //$NON-NLS-1$
+ }
+ private void createSectionWithLinks(IManagedForm mform, String title,
+ String desc, int nlinks) {
+ Composite client = createSection(mform, title, desc, 1);
+ FormToolkit toolkit = mform.getToolkit();
+ for (int i = 1; i <= nlinks; i++)
+ toolkit.createHyperlink(client, Messages.getString("ThirdPage.link") + i, SWT.WRAP); //$NON-NLS-1$
+ }
+ private void createSectionWithControls(IManagedForm mform, String title,
+ String desc) {
+ Composite client = createSection(mform, title, desc, 1);
+ FormToolkit toolkit = mform.getToolkit();
+ toolkit.createButton(client, Messages.getString("ThirdPage.button1"), SWT.RADIO); //$NON-NLS-1$
+ toolkit.createButton(client, Messages.getString("ThirdPage.button2"), SWT.RADIO); //$NON-NLS-1$
+ toolkit.createButton(client, Messages.getString("ThirdPage.button3"), //$NON-NLS-1$
+ SWT.RADIO);
+ toolkit.createButton(client, Messages.getString("ThirdPage.checkbox"), SWT.CHECK); //$NON-NLS-1$
+ }
+ private void createMixedSection(IManagedForm mform, String title, String desc) {
+ Composite client = createSection(mform, title, desc, 2);
+ FormToolkit toolkit = mform.getToolkit();
+ Hyperlink link = toolkit.createHyperlink(client,
+ Messages.getString("ThirdPage.longlink"), SWT.WRAP); //$NON-NLS-1$
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ link.setLayoutData(gd);
+ link = toolkit.createHyperlink(client, Messages.getString("ThirdPage.link2"), //$NON-NLS-1$
+ SWT.WRAP);
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ link.setLayoutData(gd);
+ toolkit.createLabel(client, Messages.getString("ThirdPage.textLabel")); //$NON-NLS-1$
+ Text text = toolkit.createText(client, "", SWT.SINGLE); //$NON-NLS-1$
+ gd = new GridData();
+ gd.widthHint = 150;
+ text.setLayoutData(gd);
+ //toolkit.paintBordersFor(client);
+ }
+ private Composite createSection(IManagedForm mform, String title,
+ String desc, int numColumns) {
+ final ScrolledForm form = mform.getForm();
+ FormToolkit toolkit = mform.getToolkit();
+ Section section = toolkit.createSection(form.getBody(), Section.TWISTIE
+ | Section.TITLE_BAR | Section.DESCRIPTION | Section.EXPANDED);
+ section.setText(title);
+ section.setDescription(desc);
+ //toolkit.createCompositeSeparator(section);
+ Composite client = toolkit.createComposite(section);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = layout.marginHeight = 0;
+ layout.numColumns = numColumns;
+ client.setLayout(layout);
+ section.setClient(client);
+ section.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ form.reflow(false);
+ }
+ });
+ return client;
+ }
+}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/TimeZones.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/TimeZones.java new file mode 100644 index 00000000..278c0830 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/TimeZones.java @@ -0,0 +1,161 @@ +package com.gluster.storage.management.gui.editor; + +public interface TimeZones { + public String[] timeZones = { "Africa/Abidjan", "Africa/Accra", + "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", + "Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", + "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", + "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", + "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", + "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", + "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", + "Africa/Harare", "Africa/Johannesburg", "Africa/Kampala", + "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", + "Africa/Lagos", "Africa/Libreville", "Africa/Lome", + "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", + "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", + "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", + "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", + "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", + "Africa/Sao_Tome", "Africa/Timbuktu", "Africa/Tripoli", + "Africa/Tunis", "Africa/Windhoek", "America/Adak", + "America/Anchorage", "America/Anguilla", "America/Antigua", + "America/Araguaina", "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", + "America/Argentina/San_Juan", "America/Argentina/San_Luis", + "America/Argentina/Tucuman", "America/Argentina/Ushuaia", + "America/Aruba", "America/Asuncion", "America/Atikokan", + "America/Atka", "America/Bahia", "America/Barbados", + "America/Belem", "America/Belize", "America/Blanc-Sablon", + "America/Boa_Vista", "America/Bogota", "America/Boise", + "America/Buenos_Aires", "America/Cambridge_Bay", + "America/Campo_Grande", "America/Cancun", "America/Caracas", + "America/Catamarca", "America/Cayenne", "America/Cayman", + "America/Chicago", "America/Chihuahua", "America/Coral_Harbour", + "America/Cordoba", "America/Costa_Rica", "America/Cuiaba", + "America/Curacao", "America/Danmarkshavn", "America/Dawson", + "America/Dawson_Creek", "America/Denver", "America/Detroit", + "America/Dominica", "America/Edmonton", "America/Eirunepe", + "America/El_Salvador", "America/Ensenada", "America/Fortaleza", + "America/Fort_Wayne", "America/Glace_Bay", "America/Godthab", + "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", + "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", + "America/Guyana", "America/Halifax", "America/Havana", + "America/Hermosillo", "America/Indianapolis", + "America/Indiana/Indianapolis", "America/Indiana/Knox", + "America/Indiana/Marengo", "America/Indiana/Petersburg", + "America/Indiana/Tell_City", "America/Indiana/Vevay", + "America/Indiana/Vincennes", "America/Indiana/Winamac", + "America/Inuvik", "America/Iqaluit", "America/Jamaica", + "America/Jujuy", "America/Juneau", "America/Kentucky/Louisville", + "America/Kentucky/Monticello", "America/Knox_IN", "America/La_Paz", + "America/Lima", "America/Los_Angeles", "America/Louisville", + "America/Maceio", "America/Managua", "America/Manaus", + "America/Marigot", "America/Martinique", "America/Mazatlan", + "America/Mendoza", "America/Menominee", "America/Merida", + "America/Mexico_City", "America/Miquelon", "America/Moncton", + "America/Monterrey", "America/Montevideo", "America/Montreal", + "America/Montserrat", "America/Nassau", "America/New_York", + "America/Nipigon", "America/Nome", "America/Noronha", + "America/North_Dakota/Center", "America/North_Dakota/New_Salem", + "America/Panama", "America/Pangnirtung", "America/Paramaribo", + "America/Phoenix", "America/Porto_Acre", "America/Porto_Velho", + "America/Port-au-Prince", "America/Port_of_Spain", + "America/Puerto_Rico", "America/Rainy_River", + "America/Rankin_Inlet", "America/Recife", "America/Regina", + "America/Resolute", "America/Rio_Branco", "America/Rosario", + "America/Santarem", "America/Santiago", "America/Santo_Domingo", + "America/Sao_Paulo", "America/Scoresbysund", "America/Shiprock", + "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", + "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", + "America/Swift_Current", "America/Tegucigalpa", "America/Thule", + "America/Thunder_Bay", "America/Tijuana", "America/Toronto", + "America/Tortola", "America/Vancouver", "America/Virgin", + "America/Whitehorse", "America/Winnipeg", "America/Yakutat", + "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", + "Antarctica/DumontDUrville", "Antarctica/Mawson", + "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", + "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Vostok", + + "Arctic/Longyearbyen", + + "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", + "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", + "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", + "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Calcutta", + "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", + "Asia/Colombo", "Asia/Dacca", "Asia/Damascus", "Asia/Dhaka", + "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Gaza", + "Asia/Harbin", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Ho_Chi_Minh", + "Asia/Irkutsk", "Asia/Istanbul", "Asia/Jakarta", "Asia/Jayapura", + "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", + "Asia/Kashgar", "Asia/Kathmandu", "Asia/Katmandu", "Asia/Kolkata", + "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", + "Asia/Kuwait", "Asia/Macao", "Asia/Macau", "Asia/Magadan", + "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", + "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", + "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", + "Asia/Qatar", "Asia/Qyzylorda", "Asia/Rangoon", "Asia/Riyadh", + "Asia/Riyadh87", "Asia/Riyadh88", "Asia/Riyadh89", "Asia/Saigon", + "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", + "Asia/Singapore", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", + "Asia/Tehran", "Asia/Tel_Aviv", "Asia/Thimbu", "Asia/Thimphu", + "Asia/Tokyo", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", "Asia/Urumqi", "Asia/Vientiane", + "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yekaterinburg", + "Asia/Yerevan", + + "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", + "Atlantic/Cape_Verde", "Atlantic/Faeroe", "Atlantic/Faroe", + "Atlantic/Jan_Mayen", "Atlantic/Madeira", "Atlantic/Reykjavik", + "Atlantic/South_Georgia", "Atlantic/Stanley", "Atlantic/St_Helena", + "Australia/ACT", "Australia/Adelaide", "Australia/Brisbane", + "Australia/Broken_Hill", "Australia/Canberra", "Australia/Currie", + "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", + "Australia/LHI", "Australia/Lindeman", "Australia/Lord_Howe", + "Australia/Melbourne", "Australia/NSW", "Australia/North", + "Australia/Perth", "Australia/Queensland", "Australia/South", + "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", + "Australia/West", "Australia/Yancowinna", + + "Europe/Amsterdam", "Europe/Andorra", "Europe/Athens", + "Europe/Belfast", "Europe/Belgrade", "Europe/Berlin", + "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", + "Europe/Budapest", "Europe/Chisinau", "Europe/Copenhagen", + "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", + "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", + "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", + "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", + "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", + "Europe/Moscow", "Europe/Nicosia", "Europe/Oslo", "Europe/Paris", + "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", + "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", + "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", + "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", + "Europe/Tiraspol", "Europe/Uzhgorod", "Europe/Vaduz", + "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", + "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", + "Europe/Zaporozhye", "Europe/Zurich", + + "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", + "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", + "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", + "Indian/Reunion", "Pacific/Apia", "Pacific/Auckland", + "Pacific/Chatham", "Pacific/Easter", "Pacific/Efate", + "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", + "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", + "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", + "Pacific/Johnston", "Pacific/Kiritimati", "Pacific/Kosrae", + "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", + "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", + "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", + "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Ponape", + "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", + "Pacific/Samoa", "Pacific/Tahiti", "Pacific/Tarawa", + "Pacific/Tongatapu", "Pacific/Truk", "Pacific/Wake", + "Pacific/Wallis", "Pacific/Yap", "UTC" }; +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/messages_en_IN.properties b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/messages_en_IN.properties new file mode 100644 index 00000000..e0ff7a02 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/editor/messages_en_IN.properties @@ -0,0 +1,96 @@ +FreeFormPage.label=First Page
+FreeFormPage.title=Free-form text with links
+FreeFormPage.link=Sample hyperlink with longer text.
+FreeFormPage.button=Button
+FreeFormPage.sectionTitle1=Expandable Section with a longer title
+FreeFormPage.sectionTitle2=Section title
+FreeFormPage.sectionDescription=This is a section description that should be rendered below the separator.
+FreeFormPage.mtitle=Eclipse Forms
+FreeFormPage.mtext=Link activated: href=
+SecondPage.label=Section Page
+SecondPage.title=Title for the second page
+SecondPage.firstSection=First Table Section
+SecondPage.secondSection=Second Table Section
+SecondPage.add=Add...
+SecondPage.desc=This section has a tree and a button.
+ScrolledPropertiesBlock.sname=Model Objects
+ScrolledPropertiesBlock.sdesc=The list contains objects from the model whose details are editable on the right
+ScrolledPropertiesBlock.add=Add...
+ScrolledPropertiesBlock.horizontal=Horizontal orientation
+ScrolledPropertiesBlock.vertical=Vertical orientation
+TypeOneDetailsPage.name=Set the properties of the selected TypeOne object.
+TypeTwoDetailsPage.name=Type Two Details
+TypeTwoDetailsPage.desc=Set the properties of the selected TypeTwo object.
+TypeOneDetailsPage.check=Value of the flag property
+TypeOneDetailsPage.label=Text property:
+TypeTwoDetailsPage.flag1=Value of the flag1 property
+TypeTwoDetailsPage.flag2=Value of the flag2 property
+OpenSimpleFormEditorAction.name=Simple Editor
+SimpleModel.t1_i1=TypeOne instance 1
+SimpleModel.text1=Some text
+SimpleModel.t1_i2=TypeOne instance 2
+SimpleModel.text2=Different text
+SimpleModel.t1_i3=TypeOne instance 3
+SimpleModel.text3=Text
+SimpleModel.t1_i4=TypeOne instance 4
+SimpleModel.text4=Longer text
+SimpleModel.t1_i5=TypeOne instance 5
+SimpleModel.text5=Sample
+SimpleModel.t2_i1=TypeTwo instance 1
+SimpleModel.t2_i2=TypeTwo instance 2
+MasterDetailsPage.label=Master Details
+MasterDetailsPage.title=Form with scrolled sections
+ThirdPage.label=Flow Page
+ThirdPage.title=Form with wrapped controls
+ThirdPage.ls1.name=Link Section
+ThirdPage.ls1.desc=An example of a section with links
+ThirdPage.ls2.name=Link Section
+ThirdPage.ls2.desc=An example of a section with links
+ThirdPage.ms1.name=Mixed Section
+ThirdPage.ms1.desc=An example of a section with both links and form controls
+ThirdPage.ls3.name=Link Section
+ThirdPage.ls3.desc=An example of a section with links
+ThirdPage.cs1.name=Control Section
+ThirdPage.cs1.desc=An example of a section with form controls
+ThirdPage.ls4.name=Sample Section
+ThirdPage.ls4.desc=An example of a section with links
+ThirdPage.ls5.name=Sample Section
+ThirdPage.ls5.desc=An example of a section with links
+ThirdPage.ms2.name=Mixed Section
+ThirdPage.ms2.desc=An example of a section with both links and form controls
+ThirdPage.l6.name=Sample Section
+ThirdPage.l6.desc=An example of a section with links
+ThirdPage.cs2.name=Control Section
+ThirdPage.cs2.desc=An example of a section with links
+ThirdPage.l7.name=Sample Section
+ThirdPage.l7.desc=An example of a section with links
+ThirdPage.l8.name=Sample Section
+ThirdPage.l8.desc=An example of a section with links
+ThirdPage.m3.name=Mixed Section
+ThirdPage.m3.desc=An example of a section with both links and form controls
+ThirdPage.l9.name=Sample Section
+ThirdPage.l9.desc=An example of a section with links
+ThirdPage.c3.name=Control Section
+ThirdPage.c3.desc=An example of a section with form controls
+ThirdPage.link=Hyperlink text
+ThirdPage.button1=A radio button 1
+ThirdPage.button2=A radio button 2
+ThirdPage.button3=A radio button with a longer text
+ThirdPage.checkbox=A checkbox button
+ThirdPage.longlink=A longer hyperlink text example
+ThirdPage.link2=Another hyperlink text
+ThirdPage.textLabel=A text label:
+PageWithSubPages.label=Composite Page
+PageWithSubPages.title=Form with subpages
+PageWithSubPages.copyright.tab=Copyright
+PageWithSubPages.copyright.text=Copyright 2004 IBM and others.
+PageWithSubPages.license.tab=License Agreement
+PageWithSubPages.license.text=LICENSE AGREEMENT\n\nUse this feature any way you want.
+PageWithSubPages.desc.tab=Description
+PageWithSubPages.desc.text=A simple description of the feature
+PageWithSubPages.apply=Apply
+PageWithSubPages.reset=Reset
+TypeOne.c1=Choice 1
+TypeOne.c2=Choice 2
+TypeOne.c3=Choice 3
+TypeOne.c4=Choice 4
diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/jobs/InitializeDiskJob.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/jobs/InitializeDiskJob.java new file mode 100644 index 00000000..7614a06d --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/jobs/InitializeDiskJob.java @@ -0,0 +1,66 @@ +package com.gluster.storage.management.gui.jobs; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.ui.progress.IProgressConstants; +import org.eclipse.ui.progress.IProgressConstants2; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class InitializeDiskJob extends Job { + private Disk disk; + private Application app = Application.getApplication(); + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + public InitializeDiskJob(Disk disk) { + super("Initialize Disk [" + disk.getQualifiedName() + "]"); + this.disk = disk; + setProperty(IProgressConstants2.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE); + setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); + setProperty(IProgressConstants.ICON_PROPERTY, guiHelper.getImageDescriptor(IImageKeys.WORK_IN_PROGRESS)); + } + + private void updateStatus(final DISK_STATUS status) { + disk.setStatus(status); + disk.setSpaceInUse(0d); + app.entityChanged(disk, new String[] { "status", "spaceInUse" }); + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + monitor.beginTask("Formatting the disk...", 100); + boolean cancelRequested = false; + String msgPrefix = ""; + try { + for (int i = 1; i <= 5; i++) { + if (!cancelRequested && monitor.isCanceled()) { + cancelRequested = true; // come only once here + + msgPrefix = "This task cannot be cancelled! "; + monitor.setTaskName(msgPrefix); +// setProperty(IProgressConstants.ICON_PROPERTY, guiHelper.getImageDescriptor(IImageKeys.STATUS_CANCELLED)); +// +// updateStatus(DISK_STATUS.UNINITIALIZED); +// return new Status(Status.CANCEL, Application.PLUGIN_ID, "Cancelled"); + } + Thread.sleep(2000); + monitor.worked(20); + monitor.setTaskName(msgPrefix + "[" + 20 * i + "%] completed"); + } + monitor.done(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + updateStatus(DISK_STATUS.READY); + setProperty(IProgressConstants.ICON_PROPERTY, guiHelper.getImageDescriptor(IImageKeys.STATUS_SUCCESS)); + + return new Status(Status.OK, Application.PLUGIN_ID, "Task Completed!"); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/login/LoginDialog.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/login/LoginDialog.java new file mode 100644 index 00000000..230832e1 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/login/LoginDialog.java @@ -0,0 +1,192 @@ +/******************************************************************************* + * Copyright (c) 2004, 2005 Jean-Michel Lemieux, Jeff McAffer and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Hyperbola is an RCP application developed for the book + * Eclipse Rich Client Platform - + * Designing, Coding, and Packaging Java Applications + * Addison-Wesley, Summer 2005 + * + * Contributors: + * Jean-Michel Lemieux and Jeff McAffer - initial implementation + * Nick Edgar and Pascal Rapicault - additional work for EclipseCon 2005 tutorial + * http://www.eclipsecon.org/presentations/EclipseCon2005_Tutorial26.pdf + *******************************************************************************/ +package com.gluster.storage.management.gui.login; + +import org.eclipse.core.databinding.DataBindingContext; +import org.eclipse.core.databinding.UpdateValueStrategy; +import org.eclipse.core.databinding.beans.PojoProperties; +import org.eclipse.jface.databinding.swt.SWTObservables; +import org.eclipse.jface.databinding.swt.WidgetProperties; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.TraverseEvent; +import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +import com.gluster.storage.management.client.AuthManager; +import com.gluster.storage.management.core.model.ConnectionDetails; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.validators.StringRequiredValidator; + +/** + * Login dialog, which prompts for the user's account info, and has Login and Cancel buttons. + */ +public class LoginDialog extends Dialog { + + private Text userIdText = null; + private Text passwordText = null; + private Button okButton; + + private final ConnectionDetails connectionDetails = new ConnectionDetails("", "gluster", ""); + private final GUIHelper guiHelper = GUIHelper.getInstance(); + private Composite composite; + + public LoginDialog(Shell parentShell) { + super(parentShell); + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + + newShell.setText("Gluster Management Console"); + addEscapeListener(newShell); + } + + private void addEscapeListener(Shell shell) { + shell.addTraverseListener(new TraverseListener() { + + @Override + public void keyTraversed(TraverseEvent e) { + if (e.keyCode == SWT.ESC) { + cancelPressed(); + } + } + }); + } + + private void createUserIdLabel(Composite composite) { + Label userIdLabel = new Label(composite, SWT.NONE); + userIdLabel.setText("&User ID:"); + userIdLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false)); + } + + private void createUserIdText(Composite composite) { + userIdText = new Text(composite, SWT.BORDER); + userIdText.setText("gluster"); + userIdText.setEnabled(false); + + GridData layoutData = new GridData(SWT.FILL, GridData.FILL, true, false); + ; + layoutData.widthHint = convertWidthInCharsToPixels(32); + userIdText.setLayoutData(layoutData); + } + + private void createPasswordLabel(Composite composite) { + Label passwordLabel = new Label(composite, SWT.NONE); + passwordLabel.setText("&Password:"); + passwordLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false)); + } + + private void createPasswordText(Composite composite) { + passwordText = new Text(composite, SWT.BORDER | SWT.PASSWORD); + + GridData layoutData = new GridData(SWT.FILL, GridData.FILL, true, false); + ; + layoutData.widthHint = convertWidthInCharsToPixels(32); + passwordText.setLayoutData(layoutData); + } + + private void configureDialogLayout(Composite composite) { + GridLayout layout = (GridLayout) composite.getLayout(); + layout.numColumns = 2; + layout.marginLeft = 20; + layout.marginRight = 20; + layout.marginTop = 20; + layout.horizontalSpacing = 20; + layout.verticalSpacing = 20; + } + + /** + * Overriding to make sure that the dialog is centered in screen + */ + @Override + protected void initializeBounds() { + super.initializeBounds(); + + guiHelper.centerShellInScreen(getShell()); + } + + @Override + protected Control createDialogArea(Composite parent) { + parent.setBackgroundImage(guiHelper.getImage(IImageKeys.DIALOG_SPLASH_IMAGE)); + parent.setBackgroundMode(SWT.INHERIT_FORCE); // Makes sure that child composites inherit the same background + + composite = (Composite) super.createDialogArea(parent); + configureDialogLayout(composite); + + createUserIdLabel(composite); + createUserIdText(composite); + + createPasswordLabel(composite); + createPasswordText(composite); + + return composite; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + okButton = createButton(parent, IDialogConstants.OK_ID, "&Login", true); + createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); + + setupDataBinding(); + } + + /** + * Sets up data binding between the text fields and the connection details object. Also attaches a "string required" + * validator to the "password" text field. This validator is configured to do the following on validation failure<br> + * <li>show an ERROR decorator</li><li>disable the "Login" button + */ + private void setupDataBinding() { + DataBindingContext dataBindingContext = new DataBindingContext(SWTObservables.getRealm(Display.getCurrent())); + UpdateValueStrategy passwordBindingStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE); + + // The Validator shows error decoration and disables OK button on validation failure + passwordBindingStrategy.setBeforeSetValidator(new StringRequiredValidator("Please enter password!", guiHelper + .createErrorDecoration(passwordText), okButton)); + + dataBindingContext.bindValue(WidgetProperties.text(SWT.Modify).observe(passwordText), + PojoProperties.value("password").observe(connectionDetails), passwordBindingStrategy, + passwordBindingStrategy); + + UpdateValueStrategy userIdBindingStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE); + dataBindingContext + .bindValue(WidgetProperties.text(SWT.Modify).observe(userIdText), PojoProperties.value("userId") + .observe(connectionDetails), userIdBindingStrategy, userIdBindingStrategy); + } + + protected void okPressed() { + if (new AuthManager().authenticate(connectionDetails)) { + super.okPressed(); + } else { + MessageDialog.openError(getShell(), "Authentication Failed", "Invalid User ID or password"); + return; + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ClusterPreferencePage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ClusterPreferencePage.java new file mode 100644 index 00000000..afec45b9 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ClusterPreferencePage.java @@ -0,0 +1,65 @@ +package com.gluster.storage.management.gui.preferences; + +import org.eclipse.jface.preference.*; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.IWorkbench; + +import com.gluster.storage.management.gui.Activator; + +/** + * This class represents a preference page that + * is contributed to the Preferences dialog. By + * subclassing <samp>FieldEditorPreferencePage</samp>, we + * can use the field support built into JFace that allows + * us to create a page that is small and knows how to + * save, restore and apply itself. + * <p> + * This page is used to modify preferences only. They + * are stored in the preference store that belongs to + * the main plug-in class. That way, preferences can + * be accessed directly via the preference store. + */ + +public class ClusterPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public ClusterPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("A demonstration of a preference page implementation"); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + public void createFieldEditors() { + addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, + "&Directory preference:", getFieldEditorParent())); + addField( + new BooleanFieldEditor( + PreferenceConstants.P_BOOLEAN, + "&An example of a boolean preference", + getFieldEditorParent())); + + addField(new RadioGroupFieldEditor( + PreferenceConstants.P_CHOICE, + "An example of a multiple-choice preference", + 1, + new String[][] { { "&Choice 1", "choice1" }, { + "C&hoice 2", "choice2" } + }, getFieldEditorParent())); + addField( + new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) { + } + +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ConsolePreferencePage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ConsolePreferencePage.java new file mode 100644 index 00000000..c06d385a --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/ConsolePreferencePage.java @@ -0,0 +1,65 @@ +package com.gluster.storage.management.gui.preferences; + +import org.eclipse.jface.preference.*; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.IWorkbench; + +import com.gluster.storage.management.gui.Activator; + +/** + * This class represents a preference page that + * is contributed to the Preferences dialog. By + * subclassing <samp>FieldEditorPreferencePage</samp>, we + * can use the field support built into JFace that allows + * us to create a page that is small and knows how to + * save, restore and apply itself. + * <p> + * This page is used to modify preferences only. They + * are stored in the preference store that belongs to + * the main plug-in class. That way, preferences can + * be accessed directly via the preference store. + */ + +public class ConsolePreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public ConsolePreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("A demonstration of a preference page implementation"); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + public void createFieldEditors() { + addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, + "&Directory preference:", getFieldEditorParent())); + addField( + new BooleanFieldEditor( + PreferenceConstants.P_BOOLEAN, + "&An example of a boolean preference", + getFieldEditorParent())); + + addField(new RadioGroupFieldEditor( + PreferenceConstants.P_CHOICE, + "An example of a multiple-choice preference", + 1, + new String[][] { { "&Choice 1", "choice1" }, { + "C&hoice 2", "choice2" } + }, getFieldEditorParent())); + addField( + new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) { + } + +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/GlusterPreferencePage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/GlusterPreferencePage.java new file mode 100644 index 00000000..3d25e992 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/GlusterPreferencePage.java @@ -0,0 +1,65 @@ +package com.gluster.storage.management.gui.preferences; + +import org.eclipse.jface.preference.*; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.IWorkbench; + +import com.gluster.storage.management.gui.Activator; + +/** + * This class represents a preference page that + * is contributed to the Preferences dialog. By + * subclassing <samp>FieldEditorPreferencePage</samp>, we + * can use the field support built into JFace that allows + * us to create a page that is small and knows how to + * save, restore and apply itself. + * <p> + * This page is used to modify preferences only. They + * are stored in the preference store that belongs to + * the main plug-in class. That way, preferences can + * be accessed directly via the preference store. + */ + +public class GlusterPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public GlusterPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("A demonstration of a preference page implementation"); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + public void createFieldEditors() { + addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, + "&Directory preference:", getFieldEditorParent())); + addField( + new BooleanFieldEditor( + PreferenceConstants.P_BOOLEAN, + "&An example of a boolean preference", + getFieldEditorParent())); + + addField(new RadioGroupFieldEditor( + PreferenceConstants.P_CHOICE, + "An example of a multiple-choice preference", + 1, + new String[][] { { "&Choice 1", "choice1" }, { + "C&hoice 2", "choice2" } + }, getFieldEditorParent())); + addField( + new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + public void init(IWorkbench workbench) { + } + +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceConstants.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceConstants.java new file mode 100644 index 00000000..3903eb6e --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceConstants.java @@ -0,0 +1,16 @@ +package com.gluster.storage.management.gui.preferences; + +/** + * Constant definitions for plug-in preferences + */ +public class PreferenceConstants { + + public static final String P_PATH = "pathPreference"; + + public static final String P_BOOLEAN = "booleanPreference"; + + public static final String P_CHOICE = "choicePreference"; + + public static final String P_STRING = "stringPreference"; + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceInitializer.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceInitializer.java new file mode 100644 index 00000000..5263a5a1 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/preferences/PreferenceInitializer.java @@ -0,0 +1,26 @@ +package com.gluster.storage.management.gui.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; + +import com.gluster.storage.management.gui.Activator; + +/** + * Class used to initialize default preference values. + */ +public class PreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(PreferenceConstants.P_BOOLEAN, true); + store.setDefault(PreferenceConstants.P_CHOICE, "choice2"); + store.setDefault(PreferenceConstants.P_STRING, + "Default value"); + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/IToolbarManager.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/IToolbarManager.java new file mode 100644 index 00000000..93319be4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/IToolbarManager.java @@ -0,0 +1,17 @@ +package com.gluster.storage.management.gui.toolbar; + +import com.gluster.storage.management.core.model.Entity; + +/** + * Whenever the current selection/action demands changes to the toolbar, the toolbar manager is used to update the + * toolbar. + */ +public interface IToolbarManager { + /** + * Updates the toolbar for given entity. This typically means that user is working with the given entity, and hence + * the toolbar actions related to that entity should be made visible, and other un-related actions should be hidden. + * + * @param entity + */ + public void updateToolbar(Entity entity); +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/ToolbarManager.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/ToolbarManager.java new file mode 100644 index 00000000..56831267 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/toolbar/ToolbarManager.java @@ -0,0 +1,84 @@ +package com.gluster.storage.management.gui.toolbar; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; + +import com.gluster.storage.management.core.model.Cluster; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.actions.IActionSetIDs; + +public class ToolbarManager implements IToolbarManager { + private enum ENTITY_TYPE { + CLUSTER, VOLUMES, VOLUME, GLUSTER_SERVERS, GLUSTER_SERVER, DISCOVERED_SERVERS, DISCOVERED_SERVER + }; + + private IWorkbenchWindow window; + private final Map<Class<? extends Entity>, ENTITY_TYPE> entityTypeMap = createEntityTypeMap(); + private final Map<ENTITY_TYPE, String> actionSetMap = createActionSetMap(); + + private Map<Class<? extends Entity>, ENTITY_TYPE> createEntityTypeMap() { + Map<Class<? extends Entity>, ENTITY_TYPE> entityTypeMap = new HashMap<Class<? extends Entity>, ToolbarManager.ENTITY_TYPE>(); + entityTypeMap.put(Cluster.class, ENTITY_TYPE.CLUSTER); + entityTypeMap.put(Volume.class, ENTITY_TYPE.VOLUME); + entityTypeMap.put(Server.class, ENTITY_TYPE.DISCOVERED_SERVER); + entityTypeMap.put(GlusterServer.class, ENTITY_TYPE.GLUSTER_SERVER); + + return entityTypeMap; + } + + private Map<ENTITY_TYPE, String> createActionSetMap() { + Map<ENTITY_TYPE, String> actionSetMap = new HashMap<ToolbarManager.ENTITY_TYPE, String>(); + actionSetMap.put(ENTITY_TYPE.CLUSTER, IActionSetIDs.ACTION_SET_CLUSTER); + actionSetMap.put(ENTITY_TYPE.VOLUMES, IActionSetIDs.ACTION_SET_VOLUMES); + actionSetMap.put(ENTITY_TYPE.VOLUME, IActionSetIDs.ACTION_SET_VOLUME); + actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVERS, IActionSetIDs.ACTION_SET_GLUSTER_SERVERS); + actionSetMap.put(ENTITY_TYPE.GLUSTER_SERVER, IActionSetIDs.ACTION_SET_GLUSTER_SERVER); + actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVERS, IActionSetIDs.ACTION_SET_DISCOVERED_SERVERS); + actionSetMap.put(ENTITY_TYPE.DISCOVERED_SERVER, IActionSetIDs.ACTION_SET_DISCOVERED_SERVER); + + return actionSetMap; + } + + public ToolbarManager(IWorkbenchWindow window) { + this.window = window; + } + + @SuppressWarnings("rawtypes") + private ENTITY_TYPE getEntityType(Entity entity) { + if (entity instanceof EntityGroup) { + EntityGroup entityGroup = (EntityGroup) entity; + if (entityGroup.getEntityType() == Volume.class) { + return ENTITY_TYPE.VOLUMES; + } else if (entityGroup.getEntityType() == GlusterServer.class) { + return ENTITY_TYPE.GLUSTER_SERVERS; + } else { + return ENTITY_TYPE.DISCOVERED_SERVERS; + } + } + + return entityTypeMap.get(entity.getClass()); + } + + @Override + public void updateToolbar(Entity entity) { + ENTITY_TYPE entityType = getEntityType(entity); + IWorkbenchPage page = window.getActivePage(); + + for (ENTITY_TYPE targetEntityType : actionSetMap.keySet()) { + String actionSetId = actionSetMap.get(targetEntityType); + if (entityType == targetEntityType) { + // show only the action set mapped to given entity + page.showActionSet(actionSetId); + } else { + page.hideActionSet(actionSetId); + } + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePicker.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePicker.java new file mode 100644 index 00000000..77ec58f7 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePicker.java @@ -0,0 +1,513 @@ +package com.gluster.storage.management.gui.utils;
+
+import java.text.DateFormatSymbols;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TypedListener;
+
+/**
+ * The date picker panel
+ *
+ * changes by sebthom
+ * ~ setDate will fire the Selection event
+ * + you can use setDate(null) to clear the selection,
+ * the calendar will display the current date, but
+ * getDate will return null until the user explicitely
+ * selects a date from the control
+ *
+ * @author <a href="mailto:andy@tiff.ru">Andrey Onistchuk</a>
+ */
+public class DatePicker extends Composite {
+
+ //~ Inner Classes
+ // ----------------------------------------------------------
+ private class DatePanel extends Canvas {
+ //~ Instance fields
+ // ----------------------------------------------------
+ private int colSize;
+ private Display display = Display.getCurrent();
+ private int rowSize;
+ private Calendar temp = Calendar.getInstance();
+
+ //~ Constructors
+ // -------------------------------------------------------
+ public DatePanel(Composite parent, int style) {
+ super(parent, style | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE);
+
+ GC gc = new GC(this);
+ Point p = gc.stringExtent("Q");
+ gc.dispose();
+ colSize = p.x * 3;
+ rowSize = (int) (p.y * 1.2);
+
+ addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent event) {
+ onPaint(event);
+ }
+ });
+ addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ redraw();
+ }
+ });
+ addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ onKeyDown(e);
+ }
+ });
+ addMouseListener(new MouseAdapter() {
+ public void mouseDoubleClick(MouseEvent e) {
+ doubleClick();
+ }
+ public void mouseDown(MouseEvent e) {
+ onMouseDown(e);
+ }
+ });
+ addMouseMoveListener(new MouseMoveListener() {
+ public void mouseMove(MouseEvent e) {
+ onMouseMove(e);
+ }
+ });
+ }
+
+ //~ Methods
+ // ------------------------------------------------------------
+ private int computeOffset(int day) {
+ switch (day) {
+ case Calendar.MONDAY :
+ return 1;
+ case Calendar.TUESDAY :
+ return 2;
+ case Calendar.WEDNESDAY :
+ return 3;
+ case Calendar.THURSDAY :
+ return 4;
+ case Calendar.FRIDAY :
+ return 5;
+ case Calendar.SATURDAY :
+ return 6;
+ case Calendar.SUNDAY :
+ return 7;
+ }
+ return -1;
+ }
+
+ public Point computeSize(int wHint, int hHint, boolean changed) {
+ return new Point(colSize * 7, rowSize * 7);
+ }
+
+ /**
+ * Method drawTextImage.
+ *
+ * @param gc
+ * @param string
+ * @param object
+ * @param i
+ * @param i1
+ * @param i2
+ * @param colSize
+ * @param rowSize
+ */
+ private void drawTextImage(GC gc, String string, int x, int y,
+ int colSize, int rowSize) {
+ gc.fillRectangle(x, y, colSize, rowSize);
+ gc.drawString(string, x, y, true);
+ }
+
+ private int getDayFromPoint(int x, int y) {
+ int result = -1;
+
+ for (int i = 1; i <= 31; i++) {
+ Point p = getDayPoint(i);
+ Rectangle r = new Rectangle(p.x, p.y, colSize, rowSize);
+ if (r.contains(x, y)) {
+ result = i;
+ break;
+ }
+ }
+ return result;
+ }
+
+ private String getDayName(int day) {
+ return dateSymbols.getShortWeekdays()[day];
+ }
+
+ private Point getDayPoint(int day) {
+ syncTime();
+ temp.set(Calendar.DAY_OF_MONTH, 1);
+
+ int firstDayOffset = computeOffset(temp.get(Calendar.DAY_OF_WEEK))
+ - 1;
+ temp.set(Calendar.DAY_OF_MONTH, day);
+ int dayOffset = computeOffset(temp.get(Calendar.DAY_OF_WEEK));
+ int x = (dayOffset - 1) * colSize;
+ int y = (1 + (((firstDayOffset + day) - 1) / 7)) * rowSize;
+
+ return new Point(x, y);
+ }
+
+ private int getMaxDay() {
+ syncTime();
+
+ int day = 28;
+
+ for (int i = 0; i < 10; i++) {
+ temp.set(Calendar.DAY_OF_MONTH, day);
+
+ if (temp.get(Calendar.MONTH) != cal.get(Calendar.MONTH)) {
+ return day - 1;
+ }
+ day++;
+ }
+ return -1;
+ }
+
+ private void onKeyDown(KeyEvent e) {
+ if (e.character == SWT.ESC) {
+ dateSelected(false);
+ return;
+ }
+
+ if ((e.character == ' ') || (e.character == '\r')) {
+ dateSelected(true);
+ return;
+ }
+
+ int day = cal.get(Calendar.DAY_OF_MONTH);
+ int month = cal.get(Calendar.MONTH);
+ int oldDay = day;
+ int oldMonth = month;
+
+ if (e.keyCode == SWT.ARROW_LEFT) {
+ day--;
+ }
+
+ if (e.keyCode == SWT.ARROW_RIGHT) {
+ day++;
+ }
+
+ if (e.keyCode == SWT.ARROW_UP) {
+ day = ((day - 7) < 1 ? oldDay : day - 7);
+ }
+
+ if (e.keyCode == SWT.ARROW_DOWN) {
+ day = ((day + 7) > getMaxDay() ? oldDay : day + 7);
+ }
+
+ if (e.keyCode == SWT.PAGE_UP) {
+ month--;
+ }
+
+ if (e.keyCode == SWT.PAGE_DOWN) {
+ month++;
+ }
+
+ cal.set(Calendar.MONTH, month);
+ cal.set(Calendar.DAY_OF_MONTH, day);
+
+ if ((day != oldDay) || (month != oldMonth)) {
+ redraw();
+
+ if (month != oldMonth) {
+ updateMonthLabel();
+ }
+ }
+ }
+
+ private void onMouseDown(MouseEvent e) {
+ int day = getDayFromPoint(e.x, e.y);
+
+ if (day > 0) {
+ cal.set(Calendar.DAY_OF_MONTH, day);
+ dateSelected(true);
+ updateDate();
+ }
+ }
+
+ private void onMouseMove(MouseEvent e) {
+ int day = getDayFromPoint(e.x, e.y);
+ selection = day;
+ updateDate();
+ }
+
+ private void onPaint(PaintEvent event) {
+ Rectangle rect = getClientArea();
+ GC gc0 = event.gc;
+ Image image = new Image(display, rect.width, rect.height);
+ GC gc = new GC(image);
+ gc.setBackground(display
+ .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ gc.fillRectangle(rect);
+
+ int x = 0;
+ int y = 0;
+
+ for (int i = 0; i < 7; i++) {
+ if (i == 6) {
+ gc.setForeground(display.getSystemColor(SWT.COLOR_RED));
+ }
+ drawTextImage(gc, getDayName(1 + i), x, 0, colSize, rowSize);
+ x += colSize;
+ }
+
+ gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
+ y += rowSize;
+ gc.drawLine(0, 0, rect.width, 0);
+ gc.drawLine(0, y - 1, rect.width, y - 1);
+
+ syncTime();
+
+ int day = 1;
+
+ while (true) {
+ temp.set(Calendar.DAY_OF_MONTH, day);
+
+ if (temp.get(Calendar.MONTH) != cal.get(Calendar.MONTH)) {
+ break;
+ }
+
+ int dayOffset = computeOffset(temp.get(Calendar.DAY_OF_WEEK));
+ Point p = getDayPoint(day);
+
+ if (day == cal.get(Calendar.DAY_OF_MONTH)) {
+ gc.setForeground(display.getSystemColor(
+ SWT.COLOR_LIST_SELECTION_TEXT));
+ gc.setBackground(display.getSystemColor(
+ SWT.COLOR_LIST_SELECTION));
+ } else if (day == selection) {
+ gc.setForeground(display.getSystemColor(
+ SWT.COLOR_LIST_SELECTION_TEXT));
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ } else {
+ gc.setBackground(display.getSystemColor(
+ SWT.COLOR_WIDGET_BACKGROUND));
+ gc.setForeground(display.getSystemColor(dayOffset == 7
+ ? SWT.COLOR_RED
+ : SWT.COLOR_BLACK));
+ }
+
+ drawTextImage(gc, "" + day, p.x, p.y, colSize, rowSize);
+ day++;
+ }
+
+ gc0.drawImage(image, 0, 0);
+ gc.dispose();
+ image.dispose();
+ }
+
+ private void syncTime() {
+ temp.setTimeInMillis(cal.getTimeInMillis());
+ }
+ }
+
+ //~ Instance fields
+ // --------------------------------------------------------
+ private Calendar cal = Calendar.getInstance();
+
+ // sebthom
+ private Date selectedDate;
+
+ private DatePanel datePanel;
+ private DateFormatSymbols dateSymbols = new DateFormatSymbols();
+ private Label monthLabel;
+ private int selection = -1;
+
+ //~ Constructors
+ // -----------------------------------------------------------
+ public DatePicker(Composite parent, int style) {
+ super(parent, style);
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 5;
+ gridLayout.verticalSpacing = gridLayout.horizontalSpacing = 0;
+ gridLayout.marginHeight = gridLayout.marginWidth = 0;
+ setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_CYAN));
+ setLayout(gridLayout);
+
+ GridData gridData;
+
+ // previous year
+ Button prevYear = new Button(this, SWT.FLAT);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gridData.heightHint = gridData.widthHint = 20;
+ prevYear.setLayoutData(gridData);
+ prevYear.setText("<<");
+ prevYear.setSelection(false);
+ prevYear.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ cal.roll(Calendar.YEAR, -1);
+ updateDate();
+ }
+ });
+
+ // previous month
+ Button prevMonth = new Button(this, SWT.FLAT);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gridData.heightHint = gridData.widthHint = 20;
+ prevMonth.setLayoutData(gridData);
+ prevMonth.setText("<");
+ prevMonth.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ cal.roll(Calendar.MONTH, -1);
+ updateDate();
+ }
+ });
+
+ // current month
+ monthLabel = new Label(this, SWT.CENTER);
+ gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.CENTER);
+ gridData.heightHint = prevYear.computeSize(20, 20).y;
+ gridData.grabExcessHorizontalSpace = true;
+ monthLabel.setLayoutData(gridData);
+
+ // next month
+ Button nextMonth = new Button(this, SWT.FLAT);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gridData.heightHint = gridData.widthHint = 20;
+ nextMonth.setLayoutData(gridData);
+ nextMonth.setText(">");
+ nextMonth.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ cal.roll(Calendar.MONTH, 1);
+ updateDate();
+ }
+ });
+
+ // next year
+ Button nextYear = new Button(this, SWT.FLAT);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gridData.heightHint = gridData.widthHint = 20;
+ nextYear.setLayoutData(gridData);
+ nextYear.setText(">>");
+ nextYear.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ cal.roll(Calendar.YEAR, 1);
+ updateDate();
+ }
+ });
+
+ // a panel
+ datePanel = new DatePanel(this, SWT.NONE);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gridData.horizontalSpan = 5;
+ datePanel.setLayoutData(gridData);
+
+ updateDate();
+ }
+
+ //~ Methods
+ // ----------------------------------------------------------------
+ public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+
+ if (listener == null) {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection, typedListener);
+ addListener(SWT.DefaultSelection, typedListener);
+ }
+
+ public Point computeSize(int wHint, int hHint, boolean changed) {
+ Point pSize = datePanel.computeSize(wHint, hHint, changed);
+ Point labelSize = monthLabel.computeSize(wHint, hHint, changed);
+
+ int x = (pSize.x < (labelSize.x + 80) ? labelSize.x + 80 : pSize.x);
+ int y = (pSize.y < (labelSize.y + 20) ? labelSize.y + 20 : pSize.y);
+ return new Point(x, y);
+ }
+
+ private void dateSelected(boolean good) {
+ // sebthom
+ if (good)
+ selectedDate = cal.getTime();
+
+ Event event = new Event();
+ event.doit = good;
+ notifyListeners(SWT.Selection, event);
+ }
+
+ private void doubleClick() {
+ Event event = new Event();
+ event.doit = true;
+ notifyListeners(SWT.MouseDoubleClick, event);
+ }
+
+ private String getCurrentMonthName() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(getMonthName(cal.get(Calendar.MONTH)));
+ sb.append(", ");
+ sb.append(cal.get(Calendar.YEAR));
+ return sb.toString();
+ }
+
+ public Date getDate() {
+ // sebthom
+ //return cal.getTime();
+ return selectedDate;
+ }
+
+ private String getMonthName(int month) {
+ return dateSymbols.getMonths()[month];
+ }
+
+ public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+
+ if (listener == null) {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+ removeListener(SWT.Selection, listener);
+ removeListener(SWT.DefaultSelection, listener);
+ }
+
+ public void reset() {
+ cal = Calendar.getInstance();
+ updateDate();
+ }
+
+ public void setDate(Date date) {
+ // sebthom
+ //cal.setTime(date);
+ selectedDate = date;
+ cal.setTime(selectedDate == null ? new Date() : date);
+
+ updateMonthLabel();
+ redraw();
+ }
+
+ private void updateDate() {
+ datePanel.redraw();
+ updateMonthLabel();
+ }
+
+ private void updateMonthLabel() {
+ monthLabel.setText(getCurrentMonthName());
+ }
+}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePickerCombo.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePickerCombo.java new file mode 100644 index 00000000..2f57f792 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DatePickerCombo.java @@ -0,0 +1,1124 @@ +package com.gluster.storage.management.gui.utils;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+
+/**
+ * The combo widget with drop-down date-picker panel.
+ *
+ * changes by sebthom
+ * ~ declared package accessible methods as private
+ * ~ declared getEditable() as public
+ * + added useSingleMouseClickToCommit behaviour
+ * + manually modifying the date in the text field is reflected in the date picker
+ * + setDate(null) clears the date.
+ * + added getText & setText()
+ *
+ * @author <a href="mailto:andy@tiff.ru">Andrey Onistchuk</a>
+ *
+ */
+public final class DatePickerCombo extends Composite
+{
+ //~ Static Methods ---------------------------------------------------------
+ public static int checkStyle(int style)
+ {
+ int mask = SWT.BORDER | SWT.READ_ONLY | SWT.FLAT;
+
+ return style & mask;
+ }
+
+ //~ Instance fields --------------------------------------------------------
+ private Button arrow;
+ private DatePicker dp;
+ private boolean hasFocus;
+
+ /**
+ * @author sebthom
+ */
+ private boolean isClosePopupWithSingleMouseClick = false;
+ private Shell popup;
+ private Text text;
+
+ //~ Constructors -----------------------------------------------------------
+ public DatePickerCombo(Composite parent, int style)
+ {
+ super(parent, checkStyle(style));
+
+ style = getStyle();
+
+ int textStyle = SWT.SINGLE;
+
+ if ((style & SWT.READ_ONLY) != 0)
+ {
+ textStyle |= SWT.READ_ONLY;
+ }
+
+ if ((style & SWT.FLAT) != 0)
+ {
+ textStyle |= SWT.FLAT;
+ }
+
+ text = new Text(this, textStyle);
+
+ popup = new Shell(getShell(), SWT.NO_TRIM);
+
+ int pickerStyle = SWT.SINGLE;
+
+ if ((style & SWT.FLAT) != 0)
+ {
+ pickerStyle |= SWT.FLAT;
+ }
+
+ dp = new DatePicker(popup, pickerStyle);
+
+ int arrowStyle = SWT.ARROW | SWT.DOWN;
+
+ if ((style & SWT.FLAT) != 0)
+ {
+ arrowStyle |= SWT.FLAT;
+ }
+
+ arrow = new Button(this, arrowStyle);
+
+ Listener listener = new Listener()
+ {
+ public void handleEvent(Event event)
+ {
+ if (popup == event.widget)
+ {
+ popupEvent(event);
+ return;
+ }
+
+ if (text == event.widget)
+ {
+ textEvent(event);
+ return;
+ }
+
+ if (dp == event.widget)
+ {
+ dpEvent(event);
+ return;
+ }
+
+ if (arrow == event.widget)
+ {
+ arrowEvent(event);
+ return;
+ }
+
+ if (DatePickerCombo.this == event.widget)
+ {
+ comboEvent(event);
+ return;
+ }
+ }
+ };
+
+ int[] comboEvents = { SWT.Dispose, SWT.Move, SWT.Resize };
+
+ for (int i = 0; i < comboEvents.length; i++)
+ this.addListener(comboEvents[i], listener);
+
+ int[] popupEvents = { SWT.Close, SWT.Paint, SWT.Deactivate };
+
+ for (int i = 0; i < popupEvents.length; i++)
+ popup.addListener(popupEvents[i], listener);
+
+ int[] textEvents =
+ { SWT.KeyDown, SWT.KeyUp, SWT.Modify, SWT.MouseDown, SWT.MouseUp, SWT.Traverse, SWT.FocusIn, SWT.FocusOut };
+
+ for (int i = 0; i < textEvents.length; i++)
+ text.addListener(textEvents[i], listener);
+
+ int[] dpEvents =
+ {
+ SWT.MouseUp,
+ SWT.MouseDoubleClick,
+ SWT.Selection,
+ SWT.Traverse,
+ SWT.KeyDown,
+ SWT.KeyUp,
+ SWT.FocusIn,
+ SWT.FocusOut };
+
+ for (int i = 0; i < dpEvents.length; i++)
+ dp.addListener(dpEvents[i], listener);
+
+ int[] arrowEvents = { SWT.Selection, SWT.FocusIn, SWT.FocusOut };
+
+ for (int i = 0; i < arrowEvents.length; i++)
+ arrow.addListener(arrowEvents[i], listener);
+
+ initAccessible();
+ }
+
+ //~ Methods ----------------------------------------------------------------
+
+ /**
+ * Adds the listener to receive events.
+ *
+ * @param listener
+ * the listener
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_NULL_ARGUMENT)
+ * when listener is null
+ */
+ public void addModifyListener(ModifyListener listener)
+ {
+ checkWidget();
+
+ if (listener == null)
+ {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Modify, typedListener);
+ }
+
+ /**
+ * Adds the listener to receive events.
+ *
+ * @param listener
+ * the listener
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_NULL_ARGUMENT)
+ * when listener is null
+ */
+ public void addSelectionListener(SelectionListener listener)
+ {
+ checkWidget();
+
+ if (listener == null)
+ {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection, typedListener);
+ addListener(SWT.DefaultSelection, typedListener);
+ }
+
+ private void arrowEvent(Event event)
+ {
+ switch (event.type)
+ {
+ case SWT.FocusIn :
+ {
+ if (hasFocus)
+ {
+ return;
+ }
+
+ hasFocus = true;
+
+ if (getEditable())
+ {
+ text.selectAll();
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+
+ case SWT.FocusOut :
+ {
+ Control focusControl = getDisplay().getFocusControl();
+
+ if ((focusControl == dp) || (focusControl == text))
+ {
+ return;
+ }
+
+ hasFocus = false;
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusOut, e);
+ break;
+ }
+
+ case SWT.Selection :
+ {
+ dropDown(!isDropped());
+ break;
+ }
+ }
+ }
+
+ /**
+ * Clears the current selection.
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ */
+ public void clearSelection()
+ {
+ checkWidget();
+ text.clearSelection();
+ dp.reset();
+ }
+
+ private void comboEvent(Event event)
+ {
+ switch (event.type)
+ {
+ case SWT.Dispose :
+
+ if ((popup != null) && !popup.isDisposed())
+ {
+ popup.dispose();
+ }
+
+ popup = null;
+ text = null;
+ dp = null;
+ arrow = null;
+ break;
+
+ case SWT.Move :
+ dropDown(false);
+ break;
+
+ case SWT.Resize :
+ internalLayout();
+ break;
+ }
+ }
+
+ public Point computeSize(int wHint, int hHint, boolean changed)
+ {
+ checkWidget();
+
+ int width = 0;
+ int height = 0;
+ Point textSize = text.computeSize(wHint, SWT.DEFAULT, changed);
+ Point arrowSize = arrow.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
+ Point listSize = dp.computeSize(wHint, SWT.DEFAULT, changed);
+ int borderWidth = getBorderWidth();
+
+ height = Math.max(hHint, Math.max(textSize.y, arrowSize.y) + (2 * borderWidth));
+ width = Math.max(wHint, Math.max(textSize.x + arrowSize.x + (2 * borderWidth), listSize.x + 2));
+
+ return new Point(width, height);
+ }
+
+ private void dpEvent(Event event)
+ {
+ switch (event.type)
+ {
+ case SWT.FocusIn :
+ {
+ if (hasFocus)
+ {
+ return;
+ }
+
+ hasFocus = true;
+
+ if (getEditable())
+ {
+ text.selectAll();
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+
+ case SWT.FocusOut :
+ {
+ Control focusControl = getDisplay().getFocusControl();
+
+ if ((focusControl == text) || (focusControl == arrow))
+ {
+ return;
+ }
+
+ hasFocus = false;
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusOut, e);
+ break;
+ }
+
+ case SWT.MouseDown :
+ {
+ if (event.button != 1)
+ {
+ return;
+ }
+
+ dropDown(false);
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.DefaultSelection, e);
+ break;
+ }
+
+ case SWT.Selection :
+ {
+ // sebthom
+ if (!isClosePopupWithSingleMouseClick)
+ {
+ Date date = dp.getDate();
+ text.setText(DateFormat.getDateInstance().format(date));
+ text.selectAll();
+
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ e.doit = event.doit;
+ notifyListeners(SWT.Selection, e);
+ event.doit = e.doit;
+
+ break;
+ }
+ // otherwise perform the code of SWT.MouseDoubleClick
+ }
+
+ case SWT.MouseDoubleClick :
+ {
+ dropDown(false);
+
+ Date date = dp.getDate();
+
+ // sebthom
+ if (date == null)
+ {
+ text.setText("");
+ }
+ else
+ {
+ text.setText(DateFormat.getDateInstance().format(date));
+ text.selectAll();
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ e.doit = event.doit;
+ notifyListeners(SWT.Selection, e);
+ event.doit = e.doit;
+ break;
+ }
+
+ case SWT.Traverse :
+ {
+ switch (event.detail)
+ {
+ case SWT.TRAVERSE_TAB_NEXT :
+ case SWT.TRAVERSE_RETURN :
+ case SWT.TRAVERSE_ESCAPE :
+ case SWT.TRAVERSE_ARROW_PREVIOUS :
+ case SWT.TRAVERSE_ARROW_NEXT :
+ event.doit = false;
+ break;
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ e.detail = event.detail;
+ e.doit = event.doit;
+ e.keyCode = event.keyCode;
+ notifyListeners(SWT.Traverse, e);
+ event.doit = e.doit;
+ break;
+ }
+
+ case SWT.KeyUp :
+ {
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyUp, e);
+ break;
+ }
+
+ case SWT.KeyDown :
+ {
+ if (event.character == SWT.ESC)
+ {
+ // escape key cancels popup dp
+ dropDown(false);
+ }
+
+ if ((event.character == SWT.CR) || (event.character == '\t'))
+ {
+ // Enter and Tab cause default selection
+ dropDown(false);
+
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.DefaultSelection, e);
+ }
+
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed())
+ {
+ break;
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyDown, e);
+ break;
+ }
+ }
+ }
+
+ private void dropDown(boolean drop)
+ {
+ if (drop == isDropped())
+ {
+ return;
+ }
+
+ if (!drop)
+ {
+ popup.setVisible(false);
+ text.setFocus();
+ return;
+ }
+
+ Rectangle listRect = dp.getBounds();
+ Point point = getParent().toDisplay(getLocation());
+ Point comboSize = getSize();
+ int width = Math.max(comboSize.x, listRect.width + 2);
+ popup.setBounds(point.x, point.y + comboSize.y, width, listRect.height + 2);
+ popup.setVisible(true);
+ dp.setFocus();
+ }
+
+ public Control[] getChildren()
+ {
+ checkWidget();
+
+ return new Control[0];
+ }
+
+ public Date getDate()
+ {
+ checkWidget();
+
+ return dp.getDate();
+ }
+
+ public boolean getEditable()
+ {
+ return text.getEditable();
+ }
+
+ /**
+ * @author sebthom
+ */
+ public String getText()
+ {
+ return text.getText();
+ }
+
+ public void setText(String txt)
+ {
+ text.setText(txt);
+ }
+
+ public int getTextHeight()
+ {
+ checkWidget();
+ return text.getLineHeight();
+ }
+
+ private void initAccessible()
+ {
+ getAccessible().addAccessibleListener(new AccessibleAdapter()
+ {
+ public void getHelp(AccessibleEvent e)
+ {
+ e.result = getToolTipText();
+ }
+ });
+
+ getAccessible().addAccessibleControlListener(new AccessibleControlAdapter()
+ {
+ public void getChildAtPoint(AccessibleControlEvent e)
+ {
+ Point testPoint = toControl(new Point(e.x, e.y));
+
+ if (getBounds().contains(testPoint))
+ {
+ e.childID = ACC.CHILDID_SELF;
+ }
+ }
+
+ public void getChildCount(AccessibleControlEvent e)
+ {
+ e.detail = 0;
+ }
+
+ public void getLocation(AccessibleControlEvent e)
+ {
+ Rectangle location = getBounds();
+ Point pt = toDisplay(new Point(location.x, location.y));
+ e.x = pt.x;
+ e.y = pt.y;
+ e.width = location.width;
+ e.height = location.height;
+ }
+
+ public void getRole(AccessibleControlEvent e)
+ {
+ e.detail = ACC.ROLE_COMBOBOX;
+ }
+
+ public void getState(AccessibleControlEvent e)
+ {
+ e.detail = ACC.STATE_NORMAL;
+ }
+
+ public void getValue(AccessibleControlEvent e)
+ {
+ e.result = text.getText();
+ }
+ });
+ }
+
+ private void internalLayout()
+ {
+ if (isDropped())
+ {
+ dropDown(false);
+ }
+
+ Rectangle rect = getClientArea();
+ int width = rect.width;
+ int height = rect.height;
+ Point arrowSize = arrow.computeSize(SWT.DEFAULT, height);
+ text.setBounds(0, 0, width - arrowSize.x, height);
+ arrow.setBounds(width - arrowSize.x, 0, arrowSize.x, arrowSize.y);
+
+ Point size = getSize();
+ int itemHeight = dp.getBounds().height;
+ Point listSize = dp.computeSize(SWT.DEFAULT, itemHeight);
+ dp.setBounds(1, 1, Math.max(size.x - 2, listSize.x), listSize.y);
+ }
+
+ /**
+ * determines if you need to double click a date in the expanded calender control to hide it
+ * default is false meaning you have to double click a date
+ *
+ * @author sebthom
+ *
+ * @param useSingleMouseClickToCommit
+ */
+ public boolean isClosePopupWithSingleMouseClick()
+ {
+ return isClosePopupWithSingleMouseClick;
+ }
+
+ private boolean isDropped()
+ {
+ return popup.getVisible();
+ }
+
+ public boolean isFocusControl()
+ {
+ checkWidget();
+
+ if (text.isFocusControl() || arrow.isFocusControl() || dp.isFocusControl() || popup.isFocusControl())
+ {
+ return true;
+ }
+ else
+ {
+ return super.isFocusControl();
+ }
+ }
+
+ private void popupEvent(Event event)
+ {
+ switch (event.type)
+ {
+ case SWT.Paint :
+
+ // draw black rectangle around dp
+ Rectangle listRect = dp.getBounds();
+ Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
+ event.gc.setForeground(black);
+ event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
+ break;
+
+ case SWT.Close :
+ event.doit = false;
+ dropDown(false);
+ break;
+
+ case SWT.Deactivate :
+ dropDown(false);
+ break;
+ }
+ }
+
+ public void redraw(int x, int y, int width, int height, boolean all)
+ {
+ checkWidget();
+
+ if (!all)
+ {
+ return;
+ }
+
+ Point location = text.getLocation();
+ text.redraw(x - location.x, y - location.y, width, height, all);
+ location = dp.getLocation();
+ dp.redraw(x - location.x, y - location.y, width, height, all);
+
+ if (arrow != null)
+ {
+ location = arrow.getLocation();
+ arrow.redraw(x - location.x, y - location.y, width, height, all);
+ }
+ }
+
+ /**
+ * Removes the listener.
+ *
+ * @param listener
+ * the listener
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_NULL_ARGUMENT)
+ * when listener is null
+ */
+ public void removeModifyListener(ModifyListener listener)
+ {
+ checkWidget();
+
+ if (listener == null)
+ {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+
+ removeListener(SWT.Modify, listener);
+ }
+
+ /**
+ * Removes the listener.
+ *
+ * @param listener
+ * the listener
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_NULL_ARGUMENT)
+ * when listener is null
+ */
+ public void removeSelectionListener(SelectionListener listener)
+ {
+ checkWidget();
+
+ if (listener == null)
+ {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+
+ removeListener(SWT.Selection, listener);
+ removeListener(SWT.DefaultSelection, listener);
+ }
+
+ public void setBackground(Color color)
+ {
+ super.setBackground(color);
+
+ if (text != null)
+ {
+ text.setBackground(color);
+ }
+
+ if (dp != null)
+ {
+ dp.setBackground(color);
+ }
+
+ if (arrow != null)
+ {
+ arrow.setBackground(color);
+ }
+ }
+
+ /**
+ * set if you need to double click a date in the expanded calender control to hide it
+ * default is false meaning you have to double click a date
+ *
+ * @author sebthom
+ *
+ * @param useSingleMouseClickToCommit
+ */
+ public void setClosePopupWithSingleMouseClick(boolean isClosePopupWithSingleMouseClick)
+ {
+ this.isClosePopupWithSingleMouseClick = isClosePopupWithSingleMouseClick;
+ }
+
+ /**
+ * Selects an item.
+ * <p>
+ * If the item at an index is not selected, it is selected. Indices that
+ * are out of range are ignored. Indexing is zero based.
+ *
+ * @param index
+ * the index of the item
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ */
+ public void setDate(Date date)
+ {
+ checkWidget();
+
+ //sebthom
+ if (date != null)
+ {
+ text.setText(DateFormat.getDateInstance().format(date));
+ text.selectAll();
+ }
+ else
+ {
+ text.setText("");
+ }
+
+ dp.setDate(date);
+ }
+
+ public boolean setFocus()
+ {
+ checkWidget();
+ return text.setFocus();
+ }
+
+ public void setFont(Font font)
+ {
+ super.setFont(font);
+ text.setFont(font);
+ dp.setFont(font);
+ internalLayout();
+ }
+
+ public void setForeground(Color color)
+ {
+ super.setForeground(color);
+
+ if (text != null)
+ {
+ text.setForeground(color);
+ }
+
+ if (dp != null)
+ {
+ dp.setForeground(color);
+ }
+
+ if (arrow != null)
+ {
+ arrow.setForeground(color);
+ }
+ }
+
+ /**
+ * Sets the new selection.
+ *
+ * @param selection
+ * point representing the start and the end of the new selection
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_NULL_ARGUMENT)
+ * when selection is null
+ */
+ public void setSelection(Point selection)
+ {
+ checkWidget();
+
+ if (selection == null)
+ {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+
+ text.setSelection(selection.x, selection.y);
+ }
+
+ /**
+ * Sets the text limit
+ *
+ * @param limit
+ * new text limit
+ *
+ * @exception SWTError(ERROR_THREAD_INVALID_ACCESS)
+ * when called from the wrong thread
+ * @exception SWTError(ERROR_WIDGET_DISPOSED)
+ * when the widget has been disposed
+ * @exception SWTError(ERROR_CANNOT_BE_ZERO)
+ * when limit is 0
+ */
+ public void setTextLimit(int limit)
+ {
+ checkWidget();
+ text.setTextLimit(limit);
+ }
+
+ public void setToolTipText(String string)
+ {
+ checkWidget();
+ super.setToolTipText(string);
+ arrow.setToolTipText(string);
+ text.setToolTipText(string);
+ }
+
+ public void setVisible(boolean visible)
+ {
+ super.setVisible(visible);
+
+ if (!visible)
+ {
+ popup.setVisible(false);
+ }
+ }
+
+ private void textEvent(Event event)
+ {
+ switch (event.type)
+ {
+ case SWT.FocusIn :
+ {
+ if (hasFocus)
+ {
+ return;
+ }
+
+ hasFocus = true;
+
+ if (getEditable())
+ {
+ text.selectAll();
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusIn, e);
+ break;
+ }
+
+ case SWT.FocusOut :
+ {
+ Control focusControl = getDisplay().getFocusControl();
+
+ if ((focusControl == dp) || (focusControl == arrow))
+ {
+ return;
+ }
+
+ hasFocus = false;
+
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.FocusOut, e);
+ break;
+ }
+
+ case SWT.KeyDown :
+ {
+ if (event.character == SWT.ESC)
+ {
+ // escape key cancels popup dp
+ dropDown(false);
+ }
+
+ if (event.character == SWT.CR)
+ {
+ dropDown(false);
+
+ Event e = new Event();
+ e.time = event.time;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.DefaultSelection, e);
+ }
+
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed())
+ {
+ break;
+ }
+
+ if ((event.keyCode == SWT.ARROW_UP) || (event.keyCode == SWT.ARROW_DOWN))
+ {
+ //Date oldDate = getDate();
+
+ //At this point the widget may have been disposed.
+ // If so, do not continue.
+ if (isDisposed())
+ {
+ break;
+ }
+ }
+
+ // Further work : Need to add support for incremental
+ // search in
+ // pop up dp as characters typed in text widget
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyDown, e);
+ break;
+ }
+
+ case SWT.KeyUp :
+ {
+ Event e = new Event();
+ e.time = event.time;
+ e.character = event.character;
+ e.keyCode = event.keyCode;
+ e.stateMask = event.stateMask;
+ notifyListeners(SWT.KeyUp, e);
+ break;
+ }
+
+ case SWT.Modify :
+ {
+ // sebthom
+ if (!popup.isVisible())
+ {
+ if (text.getText().length() == 0)
+ {
+ dp.setDate(null);
+ }
+ else
+ {
+ try
+ {
+ dp.setDate(SimpleDateFormat.getDateInstance().parse(text.getText()));
+ }
+ catch (ParseException pe)
+ {
+ dp.setDate(null);
+ }
+ }
+ }
+ // dp.deselectAll ();
+ Event e = new Event();
+ e.time = event.time;
+ notifyListeners(SWT.Modify, e);
+ break;
+ }
+
+ case SWT.MouseDown :
+ {
+ if (event.button != 1 || text.getEditable())
+ {
+ return;
+ }
+
+ boolean dropped = isDropped();
+ text.selectAll();
+
+ if (!dropped)
+ {
+ setFocus();
+ }
+ dropDown(!dropped);
+
+ break;
+ }
+
+ case SWT.MouseUp :
+ {
+ if (event.button != 1 || text.getEditable())
+ {
+ return;
+ }
+ text.selectAll();
+ break;
+ }
+
+ case SWT.Traverse :
+ {
+ switch (event.detail)
+ {
+ case SWT.TRAVERSE_RETURN :
+ case SWT.TRAVERSE_ARROW_PREVIOUS :
+ case SWT.TRAVERSE_ARROW_NEXT :
+ // The enter causes default selection and
+ // the arrow keys are used to manipulate the dp
+ // contents so do not use them for traversal.
+ event.doit = false;
+ break;
+ }
+
+ Event e = new Event();
+ e.time = event.time;
+ e.detail = event.detail;
+ e.doit = event.doit;
+ e.keyCode = event.keyCode;
+ notifyListeners(SWT.Traverse, e);
+ event.doit = e.doit;
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DiskViewerEditingSupport.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DiskViewerEditingSupport.java new file mode 100644 index 00000000..85f6edce --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/DiskViewerEditingSupport.java @@ -0,0 +1,39 @@ +package com.gluster.storage.management.gui.utils; + +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.jface.viewers.EditingSupport; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.Disk; + +public class DiskViewerEditingSupport extends EditingSupport { + private FormToolkit toolkit; + + public DiskViewerEditingSupport(FormToolkit toolkit, TableViewer viewer) { + super(viewer); + this.toolkit = toolkit; + } + + @Override + protected CellEditor getCellEditor(Object element) { + return new HyperlinkCellEditor(toolkit, (TableViewer)getViewer(), (Disk) element); + } + + @Override + protected boolean canEdit(Object element) { + Disk disk = (Disk) element; + return (disk.isUninitialized()); + } + + @Override + protected Object getValue(Object element) { + return ((Disk) element).getStatus(); + } + + @Override + protected void setValue(Object element, Object value) { + getViewer().update(element, new String[] { "status" }); + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/EntityViewerFilter.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/EntityViewerFilter.java new file mode 100644 index 00000000..c4774f34 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/EntityViewerFilter.java @@ -0,0 +1,60 @@ +package com.gluster.storage.management.gui.utils; + +import java.util.Map.Entry; + +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; + +import com.gluster.storage.management.core.model.Filterable; +import com.gluster.storage.management.core.utils.StringUtils; + +public class EntityViewerFilter extends ViewerFilter { + + private String filterString; + private boolean caseSensitive = false; + + public EntityViewerFilter(String filterString, boolean caseSensitive) { + this.filterString = filterString; + this.caseSensitive = caseSensitive; + } + + public boolean isCaseSensitive() { + return caseSensitive; + } + + public void setCaseSensitive(boolean caseSensitive) { + this.caseSensitive = caseSensitive; + } + + public String getFilterString() { + return filterString; + } + + public void setFilterString(String filterString) { + this.filterString = filterString; + } + + @SuppressWarnings("unchecked") + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) { + if (filterString == null || filterString.isEmpty()) { + // No filter string. select everything + return true; + } + + if (element instanceof Filterable) { + return ((Filterable) element).filter(filterString, caseSensitive); + } + + if(element instanceof Entry) { + Entry<String, String> entry = (Entry<String, String>)element; + return StringUtils.filterString(entry.getKey() + entry.getValue(), filterString, caseSensitive); + } + + if(element instanceof String) { + return StringUtils.filterString((String)element, filterString, caseSensitive); + } + + return false; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java new file mode 100644 index 00000000..1d4a2a00 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java @@ -0,0 +1,313 @@ +package com.gluster.storage.management.gui.utils; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuCreator; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.fieldassist.ControlDecoration; +import org.eclipse.jface.fieldassist.FieldDecorationRegistry; +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ColumnLayoutData; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IViewReference; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.forms.events.ExpansionAdapter; +import org.eclipse.ui.forms.events.ExpansionEvent; +import org.eclipse.ui.forms.widgets.ColumnLayout; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; +import org.eclipse.ui.forms.widgets.Section; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IImageKeys; + +public class GUIHelper { + private static final GUIHelper instance = new GUIHelper(); + + private GUIHelper() { + + } + + public static GUIHelper getInstance() { + return instance; + } + + public ScrolledForm setupForm(Composite parent, FormToolkit toolkit, final String formName) { + return setupForm(toolkit, formName, toolkit.createScrolledForm(parent)); + } + + public ScrolledForm setupForm(FormToolkit toolkit, final String formName, ScrolledForm form) { + form.setText(formName); + toolkit.decorateFormHeading(form.getForm()); + + ColumnLayout layout = new ColumnLayout(); + + // layout.topMargin = 0; + // layout.bottomMargin = 5; + // layout.leftMargin = 10; + // layout.rightMargin = 10; + // layout.horizontalSpacing = 10; + // layout.verticalSpacing = 10; + // layout.maxNumColumns = 4; + // layout.minNumColumns = 1; + + form.getBody().setLayout(layout); + return form; + } + + public Composite createSection(final ScrolledForm form, FormToolkit toolkit, String title, String desc, + int numColumns, boolean collapsible) { + int style = Section.TITLE_BAR | Section.EXPANDED; + if (desc != null && !desc.isEmpty()) { + style |= Section.DESCRIPTION; + } + if (collapsible) { + style |= Section.TWISTIE; + } + + Section section = toolkit.createSection(form.getBody(), style); + section.setText(title); + section.setDescription(desc); + + // toolkit.createCompositeSeparator(section); + Composite client = toolkit.createComposite(section); + GridLayout layout = new GridLayout(); + layout.marginWidth = layout.marginHeight = 0; + layout.numColumns = numColumns; + layout.verticalSpacing = 15; + layout.marginBottom = 20; + layout.marginTop = 5; + + client.setLayout(layout); + section.setClient(client); + + section.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(false); + } + }); + return client; + } + + public Composite createTab(TabFolder tabFolder, String title, String imageKey) { + TabItem item = new TabItem(tabFolder, SWT.NONE); + item.setText(title); + item.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, imageKey).createImage()); + + Composite composite = new Composite(tabFolder, SWT.NONE); + composite.setLayout(new FillLayout()); + + item.setControl(composite); + + return composite; + } + + public ImageDescriptor getImageDescriptor(String imagePath) { + return AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, imagePath); + } + + public Image getImage(String imagePath) { + return getImageDescriptor(imagePath).createImage(); + } + + public Action createPullDownMenu(String menuName, String iconPath, final MenuManager menuManager) { + Action action = new Action(menuName, IAction.AS_DROP_DOWN_MENU) { + public void run() { + } + }; + action.setMenuCreator(new IMenuCreator() { + + @Override + public Menu getMenu(Menu menu) { + return null; + } + + @Override + public Menu getMenu(Control control) { + return menuManager.createContextMenu(control); + } + + @Override + public void dispose() { + } + }); + action.setImageDescriptor(getImageDescriptor(iconPath)); + return action; + } + + public TableColumnLayout createTableColumnLayout(Table table, String[] columns) { + TableColumnLayout tableColumnLayout = new TableColumnLayout(); + ColumnLayoutData defaultColumnLayoutData = new ColumnWeightData(100); + + for (String columnName : columns) { + TableColumn column = new TableColumn(table, SWT.LEFT); + column.setText(columnName); + + tableColumnLayout.setColumnData(column, defaultColumnLayoutData); + } + + return tableColumnLayout; + } + + /** + * Creates a filter for given structured viewer that will filter the contents of the viewer based on the current + * text of the text field + * + * @param viewer + * Structured viewer for which the filter is to be created + * @param filterText + * The text field whose contents are to be used for filtering + * @param caseSensitive + * Flag indicating whether the filtering should be case sensitive + * @return The newly created filter + */ + public EntityViewerFilter createFilter(final StructuredViewer viewer, final Text filterText, boolean caseSensitive) { + final String initialFilterString = filterText.getText(); + + final EntityViewerFilter filter = new EntityViewerFilter(initialFilterString, caseSensitive); + // On every keystroke inside the text field, update the filter string + filterText.addKeyListener(new KeyAdapter() { + private String filterString = initialFilterString; + + @Override + public void keyReleased(KeyEvent e) { + String enteredString = filterText.getText(); + if (enteredString.equals(filterString)) { + // Filter string has not changed. don't do anything + return; + } + + // Update filter string + filterString = enteredString; + filter.setFilterString(filterString); + + // Refresh viewer with newly filtered content + viewer.refresh(true); + } + }); + + viewer.addFilter(filter); + return filter; + } + + public IViewPart getView(String viewId) { + IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() + .getViewReferences(); + for (IViewReference view : views) { + if (view.getId().equals(viewId)) { + return view.getView(false); + } + } + return null; + } + + public ControlDecoration createErrorDecoration(Control control) { + ControlDecoration passwordErrorDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP); + passwordErrorDecoration.setImage(FieldDecorationRegistry.getDefault() + .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage()); + return passwordErrorDecoration; + } + + public void centerShellInScreen(Shell shell) { + Rectangle monitorBounds = shell.getMonitor().getBounds(); + Rectangle myBounds = shell.getBounds(); + + int x = monitorBounds.x + (monitorBounds.width - myBounds.width) / 2; + int y = monitorBounds.y + (monitorBounds.height - myBounds.height) / 2; + shell.setLocation(x, y); + } + + public Text createFilterText(FormToolkit toolkit, Composite parent) { + final String tooltipMessage = "Start typing to filter table contents."; + final Text filterText = toolkit.createText(parent, "", SWT.FLAT); + + GridData data = new GridData(SWT.LEFT, SWT.CENTER, false, false); + data.widthHint = 300; + filterText.setLayoutData(data); + + ControlDecoration searchDecoration = new ControlDecoration(filterText, SWT.RIGHT); + searchDecoration.setImage(getImage(IImageKeys.SEARCH)); + searchDecoration.show(); + searchDecoration.setShowHover(true); + searchDecoration.setDescriptionText(tooltipMessage); + + filterText.setToolTipText(tooltipMessage); + return filterText; + } + + public Text createFilterText(Composite parent) { + final String tooltipMessage = "Start typing to filter table contents."; + final Text filterText = new Text(parent, SWT.FLAT); + + GridData data = new GridData(SWT.LEFT, SWT.CENTER, false, false); + data.widthHint = 300; + filterText.setLayoutData(data); + + ControlDecoration searchDecoration = new ControlDecoration(filterText, SWT.RIGHT); + searchDecoration.setImage(getImage(IImageKeys.SEARCH)); + searchDecoration.show(); + searchDecoration.setShowHover(true); + searchDecoration.setDescriptionText(tooltipMessage); + + filterText.setToolTipText(tooltipMessage); + return filterText; + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, int columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + * + * @return The table viewer column created + */ + public TableViewerColumn setColumnProperties(TableViewer tableViewer, int columnIndex, int style, int weight) { + TableViewerColumn column = new TableViewerColumn(tableViewer, style, columnIndex); + TableColumnLayout tableColumnLayout = (TableColumnLayout)tableViewer.getTable().getParent().getLayout(); + tableColumnLayout.setColumnData(column.getColumn(), new ColumnWeightData(weight)); + column.setLabelProvider(new ColumnLabelProvider()); + return column; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/HyperlinkCellEditor.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/HyperlinkCellEditor.java new file mode 100644 index 00000000..48b7117d --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/HyperlinkCellEditor.java @@ -0,0 +1,50 @@ +package com.gluster.storage.management.gui.utils; + +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ImageHyperlink; + +import com.gluster.storage.management.core.model.Disk; + +public class HyperlinkCellEditor extends CellEditor { + private FormToolkit toolkit; + private Disk disk; + private ImageHyperlink link; + private TableViewer viewer; + + public HyperlinkCellEditor(FormToolkit toolkit, TableViewer viewer, Disk disk) { + this.toolkit = toolkit; + this.viewer = viewer; + this.disk = disk; + } + + @Override + protected Control createControl(Composite parent) { + link = toolkit.createImageHyperlink(viewer.getTable(), SWT.NONE); + // link.setImage(guiHelper.getImage(IImageKeys.DISK_UNINITIALIZED)); + link.setText("Initialize"); + return link; + } + + @Override + protected Object doGetValue() { + return disk.getStatus(); + } + + @Override + protected void doSetFocus() { + link.setFocus(); + } + + @Override + protected void doSetValue(Object value) { + if(!disk.isUninitialized()) { + this.deactivate(); + this.dispose(); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/validators/StringRequiredValidator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/validators/StringRequiredValidator.java new file mode 100644 index 00000000..cbe352c3 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/validators/StringRequiredValidator.java @@ -0,0 +1,41 @@ +package com.gluster.storage.management.gui.validators; + +import org.eclipse.core.databinding.validation.IValidator; +import org.eclipse.core.databinding.validation.ValidationStatus; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.fieldassist.ControlDecoration; +import org.eclipse.swt.widgets.Control; + +public class StringRequiredValidator implements IValidator { + private final String errorText; + private final ControlDecoration controlDecoration; + private final Control linkedControl; + + public StringRequiredValidator(String errorText, ControlDecoration controlDecoration, Control linkedControl) { + super(); + this.errorText = errorText; + this.controlDecoration = controlDecoration; + this.linkedControl = linkedControl; + } + + public StringRequiredValidator(String errorText, ControlDecoration controlDecoration) { + this(errorText, controlDecoration, null); + } + + public IStatus validate(Object value) { + if (value instanceof String) { + if (((String) value).isEmpty()) { + controlDecoration.setDescriptionText(errorText); + controlDecoration.show(); + if (linkedControl != null) { + linkedControl.setEnabled(false); + } + return ValidationStatus.error(errorText); + } + } + linkedControl.setEnabled(true); + controlDecoration.hide(); + return Status.OK_STATUS; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/AbstractDisksPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/AbstractDisksPage.java new file mode 100644 index 00000000..c76d8582 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/AbstractDisksPage.java @@ -0,0 +1,297 @@ +package com.gluster.storage.management.gui.views.details; + +import java.util.List; + +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.TableEditor; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.forms.events.HyperlinkAdapter; +import org.eclipse.ui.forms.events.HyperlinkEvent; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ImageHyperlink; +import org.eclipse.ui.progress.IProgressConstants; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.Disk.DISK_STATUS; +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IEntityListener; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.jobs.InitializeDiskJob; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public abstract class AbstractDisksPage extends Composite implements IEntityListener { + protected final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + protected TableViewer tableViewer; + private IWorkbenchSite site; + protected static final GUIHelper guiHelper = GUIHelper.getInstance(); + + /** + * Setup properties of the table e.g. column headers, widths, etc. + * + * @param parent + * The parent composite. (TableColumnLayout has to be set on this) + * @param table + * The table to be set up + */ + protected abstract void setupDiskTable(Composite parent, Table table); + + /** + * @return The label provider to be used with the disk table viewer + */ + protected abstract ITableLabelProvider getTableLabelProvider(); + + /** + * @return Index of the "status" column in the table. Return -1 if status column is not displayed + */ + protected abstract int getStatusColumnIndex(); + + private void init(final Composite parent, IWorkbenchSite site, List<Disk> disks) { + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + this.site = site; + + setupPageLayout(); + Text filterText = guiHelper.createFilterText(toolkit, this); + setupDiskTableViewer(createTableViewerComposite(), filterText); + + tableViewer.setInput(disks); + setupStatusCellEditor(); // creates hyperlinks for "unitialized" disks + + site.setSelectionProvider(tableViewer); + Application.getApplication().addEntityListener(this); + + parent.layout(); // Important - this actually paints the table + + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + /** + * Ideally not required. However the table viewer is not getting laid out properly on performing + * "maximize + restore" So this is a hack to make sure that the table is laid out again on re-size of the window + */ + addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + parent.layout(); + } + }); + } + + public AbstractDisksPage(final Composite parent, int style, IWorkbenchSite site, List<Disk> disks) { + super(parent, style); + init(parent, site, disks); + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(1, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + } + + private void createInitializeLink(final TableItem item, final int rowNum, final Disk disk) { + final Table table = tableViewer.getTable(); + final TableEditor editor = new TableEditor(table); + editor.grabHorizontal = true; + editor.horizontalAlignment = SWT.RIGHT; + + table.addPaintListener(new PaintListener() { + private TableItem myItem = item; + private int myRowNum = rowNum; + private ImageHyperlink myLink = null; + private TableEditor myEditor = null; + + private void createLinkFor(Disk disk1, TableItem item1, int rowNum1) { + myItem = item1; + myRowNum = rowNum1; + + myEditor = new TableEditor(table); + myEditor.grabHorizontal = true; + myEditor.horizontalAlignment = SWT.RIGHT; + + myLink = toolkit.createImageHyperlink(table, SWT.NONE); + // link.setImage(guiHelper.getImage(IImageKeys.DISK_UNINITIALIZED)); + myLink.setText("Initialize"); + myLink.addHyperlinkListener(new StatusLinkListener(myLink, myEditor, myItem, tableViewer, disk1, site)); + + myEditor.setEditor(myLink, item1, getStatusColumnIndex()); + + myItem.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent e) { + myLink.dispose(); + myEditor.dispose(); + } + }); + } + + @Override + public void paintControl(PaintEvent e) { + int itemCount = table.getItemCount(); + + // Find the table item corresponding to our disk + Disk disk1 = null; + int rowNum1 = -1; + TableItem item1 = null; + for (int i = 0; i < itemCount; i++) { + item1 = table.getItem(i); + disk1 = (Disk) item1.getData(); + if (disk1 != null && disk1 == disk) { + rowNum1 = i; + break; + } + } + + if (rowNum1 == -1) { + // item disposed and disk not visible. nothing to do. + return; + } + + if (myEditor == null || myItem.isDisposed()) { + // item visible, and + // either editor never created, OR + // old item disposed. create the link for it + createLinkFor(disk1, item1, rowNum1); + } + + if (rowNum1 != myRowNum) { + // disk visible, but at a different row num. re-create the link + myLink.dispose(); + myEditor.dispose(); + createLinkFor(disk1, item1, rowNum1); + } + + myEditor.layout(); // IMPORTANT. Without this, the link location goes for a toss on maximize + restore + } + }); + } + + private void setupStatusCellEditor() { + final TableViewer viewer = tableViewer; + final Table table = viewer.getTable(); + for (int i = 0; i < table.getItemCount(); i++) { + final TableItem item = table.getItem(i); + if (item.isDisposed() || item.getData() == null) { + continue; + } + final Disk disk = (Disk) item.getData(); + if (disk.isUninitialized()) { + createInitializeLink(item, i, disk); + } + } + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + private TableViewer createDiskTableViewer(Composite parent) { + tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + + tableViewer.setLabelProvider(getTableLabelProvider()); + tableViewer.setContentProvider(new ArrayContentProvider()); + + setupDiskTable(parent, tableViewer.getTable()); + + return tableViewer; + } + + private void setupDiskTableViewer(Composite parent, final Text filterText) { + tableViewer = createDiskTableViewer(parent); + // Create a case insensitive filter for the table viewer using the filter text field + guiHelper.createFilter(tableViewer, filterText, false); + } + + private final class StatusLinkListener extends HyperlinkAdapter { + private final Disk disk; + private final TableEditor myEditor; + private final ImageHyperlink myLink; + private final TableViewer viewer; + private final IWorkbenchSite site; + + private StatusLinkListener(ImageHyperlink link, TableEditor editor, TableItem item, TableViewer viewer, + Disk disk, IWorkbenchSite site) { + this.disk = disk; + this.viewer = viewer; + this.myEditor = editor; + this.myLink = link; + this.site = site; + } + + private void updateStatus(final DISK_STATUS status, final boolean disposeEditor) { + if (disposeEditor) { + myLink.dispose(); + myEditor.dispose(); + } + disk.setStatus(status); + viewer.update(disk, new String[] { "status" }); + Application.getApplication().entityChanged(disk, new String[] { "status" }); + } + + @Override + public void linkActivated(HyperlinkEvent e) { + updateStatus(DISK_STATUS.INITIALIZING, true); + + try { + site.getWorkbenchWindow().getActivePage().showView(IProgressConstants.PROGRESS_VIEW_ID); + } catch (PartInitException e1) { + e1.printStackTrace(); + throw new GlusterRuntimeException("Could not open the progress view!", e1); + } + + new InitializeDiskJob(disk).schedule(); + } + } + + @Override + public void entityChanged(final Entity entity, final String[] paremeters) { + if (!(entity instanceof Disk)) { + return; + } + final Disk disk = (Disk) entity; + + Display.getDefault().syncExec(new Runnable() { + public void run() { + tableViewer.update(disk, paremeters); + + if (disk.isUninitialized()) { + Table table = tableViewer.getTable(); + + for (int rowNum = 0; rowNum < table.getItemCount(); rowNum++) { + TableItem item = table.getItem(rowNum); + if (item.getData() == disk) { + createInitializeLink(item, rowNum, disk); + } + } + } + } + }); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DetailsView.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DetailsView.java new file mode 100644 index 00000000..ff40d1ea --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DetailsView.java @@ -0,0 +1,93 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchPartSite; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.contexts.IContextService; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.part.ViewPart; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.toolbar.ToolbarManager; +import com.gluster.storage.management.gui.views.navigator.NavigationView; + +/** + * This view is displayed on the right hand side of the platform UI. It updates itself with appropriate tabs + * whenever selection changes on the navigation view (cluster tree) on the left hand side of the UI. + */ +public class DetailsView extends ViewPart implements ISelectionListener { + public static final String ID = "com.gluster.storage.management.gui.views.details"; + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private TabFolder tabFolder; + private Entity entity; + private TabCreatorFactory tabCreatorFactory = new TabCreatorFactoryImpl(); + private ToolbarManager toolbarManager; + private IWorkbenchPartSite site; + + public DetailsView() { + super(); + } + + @Override + public void createPartControl(final Composite parent) { + parent.addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + tabFolder = new TabFolder(parent, SWT.TOP); + + // listen to selection event on the navigation tree view + IWorkbenchWindow window = getViewSite().getWorkbenchWindow(); + window.getSelectionService().addSelectionListener(this); + + // Create the toolbar manager + toolbarManager = new ToolbarManager(window); + site = getSite(); + } + + @Override + public void setFocus() { + tabFolder.setFocus(); + } + + private void removeAllTabs() { + for (TabItem item : tabFolder.getItems()) { + item.getControl().dispose(); + item.dispose(); + } + } + + @Override + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + if (part instanceof NavigationView && selection instanceof TreeSelection) { + Entity selectedEntity = (Entity) ((TreeSelection) selection).getFirstElement(); + + if (entity == selectedEntity || selectedEntity == null) { + // entity selection has not changed. do nothing. + return; + } + + entity = selectedEntity; + removeAllTabs(); + + // Create tabs for newly selected entity + tabCreatorFactory.getTabCreator(entity).createTabs(entity, tabFolder, toolkit, site); + + // update toolbar buttons visibility based on selected entity + toolbarManager.updateToolbar(entity); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DisksPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DisksPage.java new file mode 100644 index 00000000..cdd3ebb5 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/DisksPage.java @@ -0,0 +1,53 @@ +package com.gluster.storage.management.gui.views.details; + +import java.util.List; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.ui.IWorkbenchSite; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.gui.DiskTableLabelProvider; +import com.gluster.storage.management.gui.utils.DiskViewerEditingSupport; + +public class DisksPage extends AbstractDisksPage { + + public enum DISK_TABLE_COLUMN_INDICES { + SERVER, DISK, SPACE, SPACE_IN_USE, STATUS + }; + + private static final String[] DISK_TABLE_COLUMN_NAMES = new String[] { "Server", "Disk", "Space (GB)", + "Space in Use (GB)", "Status" }; + + public DisksPage(final Composite parent, int style, IWorkbenchSite site, List<Disk> disks) { + super(parent, style, site, disks); + } + + @Override + protected void setupDiskTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, DISK_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + guiHelper.setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SERVER.ordinal(), SWT.CENTER, 100); + guiHelper.setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.DISK.ordinal(), SWT.CENTER, 100); + guiHelper.setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SPACE.ordinal(), SWT.CENTER, 90); + guiHelper.setColumnProperties(table, DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE.ordinal(), SWT.CENTER, 90); + } + + @Override + protected ITableLabelProvider getTableLabelProvider() { + return new DiskTableLabelProvider(); + } + + @Override + protected int getStatusColumnIndex() { + return DISK_TABLE_COLUMN_INDICES.STATUS.ordinal(); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/GlusterServersPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/GlusterServersPage.java new file mode 100644 index 00000000..c4d03b7d --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/GlusterServersPage.java @@ -0,0 +1,146 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.gui.EntityGroupContentProvider; +import com.gluster.storage.management.gui.GlusterServerTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class GlusterServersPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private TableViewer tableViewer; + private GUIHelper guiHelper = GUIHelper.getInstance(); + + public enum GLUSTER_SERVER_TABLE_COLUMN_INDICES { + NAME, PREFERRED_NETWORK, IP_ADDRESSES, NUM_OF_CPUS, TOTAL_MEMORY, TOTAL_DISK_SPACE, STATUS + }; + + private static final String[] GLUSTER_SERVER_TABLE_COLUMN_NAMES = new String[] { "Name", "Preferred\nNetwork", + "IP Address(es)", "Number\nof CPUs", "Total\nMemory (GB)", "Total Disk\n Space (GB)", "Status" }; + + public GlusterServersPage(Composite parent, int style) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setupPageLayout(); + Text filterText = guiHelper.createFilterText(toolkit, this); + setupServerTableViewer(filterText); + } + + public GlusterServersPage(final Composite parent, int style, EntityGroup<GlusterServer> servers) { + this(parent, style); + + tableViewer.setInput(servers); + parent.layout(); // Important - this actually paints the table + + /** + * Ideally not required. However the table viewer is not getting laid out properly on performing + * "maximize + restore" So this is a hack to make sure that the table is laid out again on re-size of the window + */ + addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + parent.layout(); + } + }); + } + + public void addDoubleClickListener(IDoubleClickListener listener) { + tableViewer.addDoubleClickListener(listener); + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(1, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + } + + private void setupServerTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, GLUSTER_SERVER_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.NAME, SWT.CENTER, 100); + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.STATUS, SWT.CENTER, 70); + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.PREFERRED_NETWORK, SWT.CENTER, 90); + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.NUM_OF_CPUS, SWT.CENTER, 90); + //setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.CPU_USAGE, SWT.CENTER, 90); + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.TOTAL_MEMORY, SWT.CENTER, 90); + //setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.MEMORY_IN_USE, SWT.CENTER, 90); + setColumnProperties(table, GLUSTER_SERVER_TABLE_COLUMN_INDICES.TOTAL_DISK_SPACE, SWT.CENTER, 90); + //setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.DISK_SPACE_IN_USE, SWT.CENTER, 90); + } + + private TableViewer createServerTableViewer(Composite parent) { + TableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + //TableViewer tableViewer = new TableViewer(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new GlusterServerTableLabelProvider()); + tableViewer.setContentProvider(new EntityGroupContentProvider<GlusterServer>()); + + setupServerTable(parent, tableViewer.getTable()); + + return tableViewer; + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + private void setupServerTableViewer(final Text filterText) { + Composite tableViewerComposite = createTableViewerComposite(); + tableViewer = createServerTableViewer(tableViewerComposite); + // Create a case insensitive filter for the table viewer using the filter text field + guiHelper.createFilter(tableViewer, filterText, false); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, GLUSTER_SERVER_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerDisksPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerDisksPage.java new file mode 100644 index 00000000..f65ddc0c --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerDisksPage.java @@ -0,0 +1,50 @@ +package com.gluster.storage.management.gui.views.details; + +import java.util.List; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.ui.IWorkbenchSite; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.gui.ServerDiskTableLabelProvider; +import com.gluster.storage.management.gui.TableLabelProviderAdapter; + +public class ServerDisksPage extends AbstractDisksPage { + public ServerDisksPage(Composite parent, int style, IWorkbenchSite site, List<Disk> disks) { + super(parent, style, site, disks); + } + + public enum SERVER_DISK_TABLE_COLUMN_INDICES { + DISK, SPACE, SPACE_IN_USE, STATUS + }; + + private static final String[] SERVER_DISK_TABLE_COLUMN_NAMES = new String[] { "Disk", "Space (GB)", + "Space in Use (GB)", "Status" }; + + @Override + protected void setupDiskTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, SERVER_DISK_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + guiHelper.setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.DISK.ordinal(), SWT.CENTER, 100); + guiHelper.setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.SPACE.ordinal(), SWT.CENTER, 90); + guiHelper.setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.SPACE_IN_USE.ordinal(), SWT.CENTER, 90); + guiHelper.setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.STATUS.ordinal(), SWT.LEFT, 90); + } + + @Override + protected int getStatusColumnIndex() { + return SERVER_DISK_TABLE_COLUMN_INDICES.STATUS.ordinal(); + } + + @Override + protected TableLabelProviderAdapter getTableLabelProvider() { + return new ServerDiskTableLabelProvider(); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerLogsPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerLogsPage.java new file mode 100644 index 00000000..4d867e58 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServerLogsPage.java @@ -0,0 +1,161 @@ +package com.gluster.storage.management.gui.views.details; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class ServerLogsPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private final GUIHelper guiHelper = GUIHelper.getInstance(); + private Text text; + private Table table; + + public enum LOG_TABLE_COLUMN_INDICES { + DATE, TIME, DISK, SEVERITY, MESSAGE + }; + + private static final String[] LOG_TABLE_COLUMN_NAMES = new String[] { "Date", "Time", "Disk", "Severity", "Message" }; + + /** + * Create the composite. + * + * @param parent + * @param style + */ + public ServerLogsPage(Composite parent, int style, GlusterServer server) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setLayout(new GridLayout(1, false)); + GridData layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + setLayoutData(layoutData); + + Composite composite = toolkit.createComposite(this, SWT.NONE); + toolkit.paintBordersFor(composite); + + Label lblScanLast = toolkit.createLabel(composite, "Scan last", SWT.NONE); + lblScanLast.setBounds(0, 15, 80, 20); + + text = toolkit.createText(composite, "100", SWT.NONE); + text.setBounds(85, 15, 60, 20); + + Label lblMessagesAndFilter = toolkit.createLabel(composite, " messages from ", SWT.CENTER); + lblMessagesAndFilter.setBounds(160, 15, 110, 20); + + Combo combo = new Combo(composite, SWT.CENTER); + combo.setBounds(295, 15, 100, 20); + combo.setItems(new String[] { "syslog", "dmesg" }); + toolkit.adapt(combo); + toolkit.paintBordersFor(combo); + combo.select(0); + + Button btngo = toolkit.createButton(composite, "&Go", SWT.NONE); + btngo.setBounds(410, 13, 50, 30); + + Label separator = toolkit.createLabel(composite, "", SWT.SEPARATOR | SWT.HORIZONTAL | SWT.FILL); + separator.setBounds(0, 50, 500, 2); + + Label lblFilterString = toolkit.createLabel(composite, "Filter String", SWT.LEFT); + lblFilterString.setBounds(0, 65, 100, 20); + + text = guiHelper.createFilterText(toolkit, composite); + text.setBounds(105, 65, 250, 20); + + Composite logContentsComposite = createLogContentsComposite(toolkit); + // Text logContentsText = toolkit.createText(logContentsComposite, "", SWT.MULTI | SWT.FLAT | SWT.BORDER); + // logContentsText.setEditable(false); + // populateDummyLogContent(logContentsText); + + ListViewer logViewer = new ListViewer(logContentsComposite, SWT.BORDER | SWT.V_SCROLL | SWT.NO); + logViewer.setContentProvider(new ArrayContentProvider()); + guiHelper.createFilter(logViewer, text, false); + logViewer.setInput(getDummyLogContents()); + + // TODO: Link the filter string with the contents text + } + + private Composite createLogContentsComposite(FormToolkit toolkit) { + Composite tableViewerComposite = toolkit.createComposite(this, SWT.NONE); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); + layoutData.verticalIndent = 10; + tableViewerComposite.setLayoutData(layoutData); + return tableViewerComposite; + } + + private String[] getDummyLogContents() { + + String[] logMessages = { + "Jan 19 13:43:08 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:44:08 shireesh-laptop dhclient: last message repeated 5 times", + "Jan 19 13:44:47 shireesh-laptop dhclient: last message repeated 2 times", + "Jan 19 13:44:47 shireesh-laptop dhclient: DHCPREQUEST of 192.168.1.174 on eth1 to 255.255.255.255 port 67", + "Jan 19 13:45:49 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:46:59 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:48:01 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:49:02 shireesh-laptop dhclient: last message repeated 5 times", + "Jan 19 13:50:08 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:51:08 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:52:08 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:53:08 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:54:08 shireesh-laptop dhclient: last message repeated 5 times", + "Jan 19 13:55:08 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:56:08 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:57:08 shireesh-laptop dhclient: last message repeated 3 times", + "Jan 19 13:58:08 shireesh-laptop dhclient: last message repeated 6 times", + "Jan 19 13:59:08 shireesh-laptop dhclient: last message repeated 4 times", + "Jan 19 13:59:40 shireesh-laptop dhclient: last message repeated 3 times", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> DHCP: device eth1 state changed bound -> expire", + "Jan 19 13:59:40 shireesh-laptop dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> DHCP: device eth1 state changed expire -> preinit", + "Jan 19 13:59:40 shireesh-laptop dhclient: DHCPOFFER of 192.168.1.174 from 192.168.1.1", + "Jan 19 13:59:40 shireesh-laptop dhclient: DHCPREQUEST of 192.168.1.174 on eth1 to 255.255.255.255 port 67", + "Jan 19 13:59:40 shireesh-laptop dhclient: DHCPACK of 192.168.1.174 from 192.168.1.1", + "Jan 19 13:59:40 shireesh-laptop dhclient: bound to 192.168.1.174 -- renewal in 3205 seconds.", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> DHCP: device eth1 state changed preinit -> bound", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> address 192.168.1.174", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> prefix 24 (255.255.255.0)", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> gateway 192.168.1.1", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> nameserver '192.168.1.1'", + "Jan 19 13:59:40 shireesh-laptop NetworkManager: <info> domain name 'in.gluster.com'", + "Jan 19 14:03:53 shireesh-laptop avahi-daemon[1098]: Invalid legacy unicast query packet.", + "Jan 19 14:03:53 shireesh-laptop avahi-daemon[1098]: Received response from host 192.168.1.155 with invalid source port 37219 on interface 'eth0.0'", + "Jan 19 14:03:54 shireesh-laptop avahi-daemon[1098]: Invalid legacy unicast query packet.", + "Jan 19 14:03:54 shireesh-laptop avahi-daemon[1098]: Invalid legacy unicast query packet.", + "Jan 19 14:03:54 shireesh-laptop avahi-daemon[1098]: Received response from host 192.168.1.155 with invalid source port 37219 on interface 'eth0.0'", + "Jan 19 14:05:09 shireesh-laptop avahi-daemon[1098]: last message repeated 8 times", + "Jan 19 14:12:48 shireesh-laptop NetworkManager: <debug> [1295426568.002642] periodic_update(): Roamed from BSSID E0:CB:4E:C0:0B:7F (glfs) to (none) ((none))", + "Jan 19 14:12:54 shireesh-laptop NetworkManager: <debug> [1295426574.002448] periodic_update(): Roamed from BSSID (none) ((none)) to E0:CB:4E:C0:0B:7F (glfs)", + "Jan 19 14:17:01 shireesh-laptop CRON[5321]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)" }; + + return logMessages; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServersPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServersPage.java new file mode 100644 index 00000000..43a64ffc --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/ServersPage.java @@ -0,0 +1,153 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.gui.EntityGroupContentProvider; +import com.gluster.storage.management.gui.ServerTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class ServersPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private TableViewer tableViewer; + private GUIHelper guiHelper = GUIHelper.getInstance(); + + public enum SERVER_TABLE_COLUMN_INDICES { + NAME, IP_ADDRESSES, NUM_OF_DISKS, TOTAL_DISK_SPACE + }; + + private static final String[] SERVER_TABLE_COLUMN_NAMES = new String[] { "Name", "IP Address(es)", "Number of Disks", "Total Disk Space (GB)" }; + + // public enum SERVER_DISK_TABLE_COLUMN_INDICES { + // NAME, NUM_OF_CPUS, CPU_USAGE, TOTAL_MEMORY, MEMORY_IN_USE, TOTAL_DISK_SPACE, DISK_SPACE_IN_USE + // }; + // + // private static final String[] SERVER_TABLE_COLUMN_NAMES = new String[] { "Name", + // "Number\nof CPUs", "CPU\nUsage (%)", "Total\nMemory (GB)", "Memory\nIn Use (GB)", + // "Total Disk\n Space (GB)", "Disk Space\nin Use (GB)"}; + + public ServersPage(Composite parent, int style) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setupPageLayout(); + Text filterText = guiHelper.createFilterText(toolkit, this); + setupServerTableViewer(filterText); + } + + public ServersPage(final Composite parent, int style, EntityGroup<Server> servers) { + this(parent, style); + + tableViewer.setInput(servers); + parent.layout(); // Important - this actually paints the table + + /** + * Ideally not required. However the table viewer is not getting laid out properly on performing + * "maximize + restore" So this is a hack to make sure that the table is laid out again on re-size of the window + */ + addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + parent.layout(); + } + }); + } + + public void addDoubleClickListener(IDoubleClickListener listener) { + tableViewer.addDoubleClickListener(listener); + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(1, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + } + + private void setupServerTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, SERVER_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, SERVER_TABLE_COLUMN_INDICES.NAME, SWT.CENTER, 70); + setColumnProperties(table, SERVER_TABLE_COLUMN_INDICES.IP_ADDRESSES, SWT.CENTER, 100); + setColumnProperties(table, SERVER_TABLE_COLUMN_INDICES.NUM_OF_DISKS, SWT.CENTER, 70); + setColumnProperties(table, SERVER_TABLE_COLUMN_INDICES.TOTAL_DISK_SPACE, SWT.CENTER, 70); + // setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.NUM_OF_CPUS, SWT.CENTER, 90); + // setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.CPU_USAGE, SWT.CENTER, 90); + // setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.TOTAL_MEMORY, SWT.CENTER, 90); + // setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.MEMORY_IN_USE, SWT.CENTER, 90); + // setColumnProperties(table, SERVER_DISK_TABLE_COLUMN_INDICES.DISK_SPACE_IN_USE, SWT.CENTER, 90); + } + + private TableViewer createServerTableViewer(Composite parent) { + TableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + // TableViewer tableViewer = new TableViewer(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new ServerTableLabelProvider()); + tableViewer.setContentProvider(new EntityGroupContentProvider<Server>()); + + setupServerTable(parent, tableViewer.getTable()); + + return tableViewer; + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NONE); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + private void setupServerTableViewer(final Text filterText) { + Composite tableViewerComposite = createTableViewerComposite(); + tableViewer = createServerTableViewer(tableViewerComposite); + // Create a case insensitive filter for the table viewer using the filter text field + guiHelper.createFilter(tableViewer, filterText, false); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + private void setColumnProperties(Table table, SERVER_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/SmartControlAdapter.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/SmartControlAdapter.java new file mode 100644 index 00000000..0cf60af0 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/SmartControlAdapter.java @@ -0,0 +1,35 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +/** + * This is an extended version of the regular ControlAdapter. + * It is used to get only the real resize events and excludes all resize + * events of the text size determination. + * + */ +public abstract class SmartControlAdapter extends ControlAdapter { + + public void controlResized( ControlEvent e ) { + Shell shell = ( ( Control )e.widget ).getShell(); + Point shellSize = shell.getSize(); + Point previousSize = ( Point )e.widget.getData( "previousShellSize" + + this.hashCode() ); + e.widget.setData( "previousShellSize" + this.hashCode(), shellSize ); + if( previousSize != null ) { + int dx = Math.abs( Math.abs( shellSize.x - previousSize.x ) - 1000 ); + int dy = Math.abs( Math.abs( shellSize.y - previousSize.y ) - 1000 ); + if( ( dx <= 2 || dy <= 2 ) ) { + // This came from the TextSizeDetermination + return; + } + } + handleControlResized( e ); + } + + protected abstract void handleControlResized( ControlEvent e ); +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreator.java new file mode 100644 index 00000000..d6d9c77b --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreator.java @@ -0,0 +1,31 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.Entity; + +/** + * For every entity that can be selected from the navigation view (cluster tree), a set of tabs are created on the + * details view. Each entity has a corresponding tab creator that creates these tabs. These tab creators must implement + * this interface. + * <p> + * <b>Important:</b> Tab creators are cached for performance reasons. Hence they should not store any state information + * in class level variables. + */ +public interface TabCreator { + /** + * Creates tabs for the given entity + * + * @param entity + * Entity for which tabs are to be created + * @param tabFolder + * The tab folder in which the tabs are to be created + * @param toolkit + * The form toolkit that can be used for create components using Forms API + * @param site + * The workbench site that can be used to register as a selection provider + */ + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site); +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactory.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactory.java new file mode 100644 index 00000000..0bafdf1a --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactory.java @@ -0,0 +1,14 @@ +package com.gluster.storage.management.gui.views.details; + +import com.gluster.storage.management.core.model.Entity; + +/** + * Interface for tab creator factory. + */ +public interface TabCreatorFactory { + /** + * @param entity The entity for which tab creator factory is to be returned + * @return A tab creator factory for given entity + */ + public TabCreator getTabCreator(Entity entity); +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactoryImpl.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactoryImpl.java new file mode 100644 index 00000000..640d72e8 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TabCreatorFactoryImpl.java @@ -0,0 +1,53 @@ +package com.gluster.storage.management.gui.views.details; + +import java.util.HashMap; +import java.util.Map; + +import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; + +public class TabCreatorFactoryImpl implements TabCreatorFactory { + + private Map<String, TabCreator> tabCreatorCache = new HashMap<String, TabCreator>(); + + /** + * Returns tab creator for given entity. The logic is as follows: <br> + * 1) Check if an tab creator is already created for the "class" of the entity. In case of {@link EntityGroup}, + * append the class name with entity type <br> + * 2) If the tab creator is found in the cache, return it <br> + * 3) If not found, create one by instantiating the class "<current package>.tabcreators.<class name>TabCreator". + * Again, "class name" includes "entity type" in case of {@link EntityGroup} <br> + * 4) Add the newly created tab creator to the cache and return it + */ + @Override + public TabCreator getTabCreator(Entity entity) { + Class entityClass = entity.getClass(); + String key = entityClass.getSimpleName(); + if (entityClass == EntityGroup.class) { + // If it's an entity group, add the entity type to the key + key += ((EntityGroup) entity).getEntityType().getSimpleName(); + } + + TabCreator tabCreator = tabCreatorCache.get(key); + if (tabCreator == null) { + // Not created yet. Create one and add to the cache + String className = getClass().getPackage().getName() + ".tabcreators." + key + "TabCreator"; + try { + Class<TabCreator> creatorFactoryClass = (Class<TabCreator>) Class.forName(className); + tabCreator = creatorFactoryClass.newInstance(); + tabCreatorCache.put(key, tabCreator); + } catch (ClassNotFoundException e) { + throw new GlusterRuntimeException("Could not load creator factory class [" + className + "]", e); + } catch (InstantiationException e) { + throw new GlusterRuntimeException("Could not create instance of creator factory class [" + className + + "]", e); + } catch (IllegalAccessException e) { + throw new GlusterRuntimeException("Could not create instance of creator factory class [" + className + + "]", e); + } + } + + return tabCreator; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TestComposite.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TestComposite.java new file mode 100644 index 00000000..e9cff399 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/TestComposite.java @@ -0,0 +1,67 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Table; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.jface.viewers.TableViewerColumn; +import com.swtdesigner.ResourceManager; + +public class TestComposite extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private Table table; + + /** + * Create the composite. + * @param parent + * @param style + */ + public TestComposite(Composite parent, int style) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + Composite composite = new Composite(this, SWT.NONE); + composite.setBounds(10, 10, 430, 280); + toolkit.adapt(composite); + toolkit.paintBordersFor(composite); + + TableViewer tableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION); + table = tableViewer.getTable(); + table.setBounds(10, 10, 410, 260); + toolkit.paintBordersFor(table); + + TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); + TableColumn tableColumn = tableViewerColumn.getColumn(); + tableColumn.setImage(ResourceManager.getPluginImage("com.gluster.storage.management.gui", "icons/cluster.png")); + tableColumn.setWidth(100); + tableColumn.setText("New Column"); + + TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewer, SWT.NONE); + TableColumn tableColumn_3 = tableViewerColumn_3.getColumn(); + tableColumn_3.setWidth(100); + tableColumn_3.setText("New Column"); + + TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE); + TableColumn tableColumn_2 = tableViewerColumn_2.getColumn(); + tableColumn_2.setWidth(100); + tableColumn_2.setText("New Column"); + + TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE); + TableColumn tableColumn_1 = tableViewerColumn_1.getColumn(); + tableColumn_1.setWidth(100); + tableColumn_1.setText("New Column"); + + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeLogsPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeLogsPage.java new file mode 100644 index 00000000..8aee564a --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeLogsPage.java @@ -0,0 +1,178 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DateTime; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.GlusterDummyModel; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.VolumeLogTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class VolumeLogsPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private final GUIHelper guiHelper = GUIHelper.getInstance(); + private Text text; + public enum LOG_TABLE_COLUMN_INDICES { + DATE, TIME, DISK, SEVERITY, MESSAGE + }; + + private static final String[] LOG_TABLE_COLUMN_NAMES = new String[] { "Date", "Time", "Disk", "Severity", "Message" }; + + /** + * Create the composite. + * @param parent + * @param style + */ + public VolumeLogsPage(Composite parent, int style, Volume volume) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setLayout(new GridLayout(1, false)); + GridData layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + //layoutData.verticalIndent = 10; + setLayoutData(layoutData); + + Composite composite = toolkit.createComposite(this, SWT.NONE); + toolkit.paintBordersFor(composite); + + Label lblScanLast = toolkit.createLabel(composite, "Scan last", SWT.NONE); + lblScanLast.setBounds(0, 15, 80, 20); + + text = toolkit.createText(composite, "100", SWT.NONE); + text.setBounds(85, 15, 60, 20); + + Label lblMessagesAndFilter = toolkit.createLabel(composite, "messages, and filter on disk", SWT.NONE); + lblMessagesAndFilter.setBounds(160, 15, 200, 20); + + Combo combo = new Combo(composite, SWT.NONE); + combo.setBounds(365, 15, 100, 20); + combo.setItems(new String[] {"ALL", "sda", "sdb", "sdc", "sdd"}); + toolkit.adapt(combo); + toolkit.paintBordersFor(combo); + combo.select(0); + + Label lblSeverity = toolkit.createLabel(composite, "Severity", SWT.NONE); + lblSeverity.setBounds(480, 15, 70, 20); + + Combo combo_1 = new Combo(composite, SWT.NONE); + combo_1.setBounds(555, 15, 110, 20); + combo_1.setItems(new String[] {"ALL", "SEVERE", "WARNING", "DEBUG", "INFO"}); + toolkit.adapt(combo_1); + toolkit.paintBordersFor(combo_1); + combo_1.select(1); + + Label lblFrom = toolkit.createLabel(composite, "from", SWT.NONE); + lblFrom.setBounds(0, 60, 40, 20); + + DateTime dateTime = new DateTime(composite, SWT.BORDER | SWT.DROP_DOWN); + dateTime.setBounds(45, 60, 120, 20); + toolkit.adapt(dateTime); + toolkit.paintBordersFor(dateTime); + + DateTime dateTime_1 = new DateTime(composite, SWT.BORDER | SWT.TIME); + dateTime_1.setBounds(171, 60, 120, 20); + toolkit.adapt(dateTime_1); + toolkit.paintBordersFor(dateTime_1); + + Label lblTo = toolkit.createLabel(composite, "To", SWT.NONE); + lblTo.setBounds(329, 60, 26, 20); + + DateTime dateTime_2 = new DateTime(composite, SWT.BORDER | SWT.DROP_DOWN); + dateTime_2.setBounds(355, 60, 120, 20); + toolkit.adapt(dateTime_2); + toolkit.paintBordersFor(dateTime_2); + + DateTime dateTime_3 = new DateTime(composite, SWT.BORDER | SWT.TIME); + dateTime_3.setBounds(480, 60, 120, 20); + toolkit.adapt(dateTime_3); + toolkit.paintBordersFor(dateTime_3); + + Button btngo = toolkit.createButton(composite, "&Go", SWT.NONE); + btngo.setBounds(605, 55, 60, 30); + + Label separator = toolkit.createLabel(composite, "", SWT.SEPARATOR | SWT.HORIZONTAL | SWT.FILL); + separator.setBounds(0, 95, 680, 2); + + Label lblFilterString = toolkit.createLabel(composite, "Filter String", SWT.LEFT); + lblFilterString.setBounds(0, 105, 85, 20); + + text = guiHelper.createFilterText(toolkit, composite); + text.setBounds(90, 105, 250, 20); + + Composite tableViewerComposite = createTableViewerComposite(); + + TableViewer tableViewer = new TableViewer(tableViewerComposite, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new VolumeLogTableLabelProvider()); + tableViewer.setContentProvider(new ArrayContentProvider()); + + setupLogsTable(tableViewerComposite, tableViewer.getTable()); + guiHelper.createFilter(tableViewer, text, false); + tableViewer.setInput(GlusterDummyModel.getDummyLogMessages().toArray()); + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); + layoutData.verticalIndent = 10; + tableViewerComposite.setLayoutData(layoutData); + return tableViewerComposite; + } + + private void setupLogsTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, LOG_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, LOG_TABLE_COLUMN_INDICES.DATE, SWT.CENTER, 50); + setColumnProperties(table, LOG_TABLE_COLUMN_INDICES.TIME, SWT.CENTER, 50); + setColumnProperties(table, LOG_TABLE_COLUMN_INDICES.DISK, SWT.CENTER, 50); + setColumnProperties(table, LOG_TABLE_COLUMN_INDICES.SEVERITY, SWT.CENTER, 50); + setColumnProperties(table, LOG_TABLE_COLUMN_INDICES.MESSAGE, SWT.LEFT, 100); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + private void setColumnProperties(Table table, LOG_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeOptionsPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeOptionsPage.java new file mode 100644 index 00000000..be94b52e --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumeOptionsPage.java @@ -0,0 +1,134 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.VolumeOptionsTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class VolumeOptionsPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private TableViewer tableViewer; + private GUIHelper guiHelper = GUIHelper.getInstance(); + + public enum OPTIONS_TABLE_COLUMN_INDICES { + OPTION_KEY, OPTION_VALUE + }; + + private static final String[] OPTIONS_TABLE_COLUMN_NAMES = new String[] { "Option Key", "Option Value" }; + + public VolumeOptionsPage(Composite parent, int style) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setupPageLayout(); + Text filterText = guiHelper.createFilterText(toolkit, this); + setupDiskTableViewer(filterText); + } + + public VolumeOptionsPage(final Composite parent, int style, Volume volume) { + this(parent, style); + + tableViewer.setInput(volume.getOptions().entrySet().toArray()); + + parent.layout(); // Important - this actually paints the table + + /** + * Ideally not required. However the table viewer is not getting laid out properly on performing + * "maximize + restore" So this is a hack to make sure that the table is laid out again on re-size of the window + */ + addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + parent.layout(); + } + }); + + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(1, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + } + + private void setupDiskTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, OPTIONS_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, OPTIONS_TABLE_COLUMN_INDICES.OPTION_KEY, SWT.CENTER, 100); + setColumnProperties(table, OPTIONS_TABLE_COLUMN_INDICES.OPTION_VALUE, SWT.CENTER, 100); + } + + private TableViewer createDiskTableViewer(Composite parent) { + TableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + // TableViewer tableViewer = new TableViewer(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new VolumeOptionsTableLabelProvider()); + tableViewer.setContentProvider(new ArrayContentProvider()); + + setupDiskTable(parent, tableViewer.getTable()); + + return tableViewer; + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + private void setupDiskTableViewer(final Text filterText) { + Composite tableViewerComposite = createTableViewerComposite(); + tableViewer = createDiskTableViewer(tableViewerComposite); + // Create a case insensitive filter for the table viewer using the filter text field + guiHelper.createFilter(tableViewer, filterText, false); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, OPTIONS_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumesPage.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumesPage.java new file mode 100644 index 00000000..c86d8a28 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/VolumesPage.java @@ -0,0 +1,139 @@ +package com.gluster.storage.management.gui.views.details; + +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.EntityGroupContentProvider; +import com.gluster.storage.management.gui.VolumeTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; + +public class VolumesPage extends Composite { + + private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); + private TableViewer tableViewer; + private GUIHelper guiHelper = GUIHelper.getInstance(); + + public enum VOLUME_TABLE_COLUMN_INDICES { + NAME, VOLUME_TYPE, NUM_OF_DISKS, TRANSPORT_TYPE, VOLUME_STATUS + }; + + private static final String[] VOLUME_TABLE_COLUMN_NAMES = new String[] { "Name", + "Volume Type", "Number of\nDisks", "Transport Type", "Status" }; + + public VolumesPage(Composite parent, int style) { + super(parent, style); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + toolkit.dispose(); + } + }); + + toolkit.adapt(this); + toolkit.paintBordersFor(this); + + setupPageLayout(); + Text filterText = guiHelper.createFilterText(toolkit, this); + setupVolumeTableViewer(filterText); + } + + public VolumesPage(final Composite parent, int style, EntityGroup<Volume> volumes) { + this(parent, style); + + tableViewer.setInput(volumes); + parent.layout(); // Important - this actually paints the table + + /** + * Ideally not required. However the table viewer is not getting laid out properly on performing + * "maximize + restore" So this is a hack to make sure that the table is laid out again on re-size of the window + */ + addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + parent.layout(); + } + }); + } + + public void addDoubleClickListener(IDoubleClickListener listener) { + tableViewer.addDoubleClickListener(listener); + } + + private void setupPageLayout() { + final GridLayout layout = new GridLayout(1, false); + layout.verticalSpacing = 10; + layout.marginTop = 10; + setLayout(layout); + } + + private void setupVolumeTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumnLayout columnLayout = guiHelper.createTableColumnLayout(table, VOLUME_TABLE_COLUMN_NAMES); + parent.setLayout(columnLayout); + + setColumnProperties(table, VOLUME_TABLE_COLUMN_INDICES.VOLUME_STATUS, SWT.CENTER, 50); + setColumnProperties(table, VOLUME_TABLE_COLUMN_INDICES.NUM_OF_DISKS, SWT.CENTER, 50); + setColumnProperties(table, VOLUME_TABLE_COLUMN_INDICES.TRANSPORT_TYPE, SWT.CENTER, 70); + } + + private TableViewer createVolumeTableViewer(Composite parent) { + TableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new VolumeTableLabelProvider()); + tableViewer.setContentProvider(new EntityGroupContentProvider<Volume>()); + + setupVolumeTable(parent, tableViewer.getTable()); + + return tableViewer; + } + + private Composite createTableViewerComposite() { + Composite tableViewerComposite = new Composite(this, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + tableViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + return tableViewerComposite; + } + + private void setupVolumeTableViewer(final Text filterText) { + Composite tableViewerComposite = createTableViewerComposite(); + tableViewer = createVolumeTableViewer(tableViewerComposite); + // Create a case insensitive filter for the table viewer using the filter text field + guiHelper.createFilter(tableViewer, filterText, false); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, VOLUME_TABLE_COLUMN_INDICES columnIndex, int alignment, int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ClusterTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ClusterTabCreator.java new file mode 100644 index 00000000..90c782eb --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ClusterTabCreator.java @@ -0,0 +1,190 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import org.eclipse.jface.fieldassist.ComboContentAdapter; +import org.eclipse.jface.fieldassist.ContentProposalAdapter; +import org.eclipse.jface.fieldassist.SimpleContentProposalProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.events.HyperlinkAdapter; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ImageHyperlink; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Cluster; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.model.GlusterServer.SERVER_STATUS; +import com.gluster.storage.management.core.model.Volume.VOLUME_STATUS; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.editor.TimeZones; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.TabCreator; + +public class ClusterTabCreator implements TabCreator { + private GUIHelper guiHelper = GUIHelper.getInstance(); + + private int getVolumeCountByStatus(Cluster cluster, VOLUME_STATUS status) { + int count = 0; + for (Volume volume : cluster.getVolumes()) { + if (volume.getStatus() == status) { + count++; + } + } + return count; + } + + private int getServerCountByStatus(Cluster cluster, SERVER_STATUS status) { + int count = 0; + for (GlusterServer server : cluster.getServers()) { + if (server.getStatus() == status) { + count++; + } + } + return count; + } + + private void createVolumesSection(Cluster cluster, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Volumes", null, 1, false); + + // toolkit.createLabel(sectionClient, "Number of Volumes: ", SWT.NONE); + // toolkit.createLabel(sectionClient, "12", SWT.NONE); + // + // toolkit.createLabel(sectionClient, "Online: ", SWT.NONE); + // Label labelOnlineCount = toolkit.createLabel(sectionClient, "9", SWT.NONE); + // labelOnlineCount.setForeground(SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN)); + // + // toolkit.createLabel(sectionClient, "Offline: ", SWT.NONE); + // Label lblOfflineCount = toolkit.createLabel(sectionClient, "3", SWT.NONE); + // lblOfflineCount.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED)); + + Double[] values = new Double[] { Double.valueOf(getVolumeCountByStatus(cluster, VOLUME_STATUS.ONLINE)), + Double.valueOf(getVolumeCountByStatus(cluster, VOLUME_STATUS.OFFLINE)) }; + createStatusChart(toolkit, section, values); + } + + private void createServersSection(Cluster cluster, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Servers", null, 1, false); + +// toolkit.createLabel(sectionClient, "Number of Servers: ", SWT.NONE); +// toolkit.createLabel(sectionClient, "7", SWT.NONE); +// +// toolkit.createLabel(sectionClient, "Online: ", SWT.NONE); +// Label labelOnlineCount = toolkit.createLabel(sectionClient, "6", SWT.NONE); +// labelOnlineCount.setForeground(SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN)); +// +// toolkit.createLabel(sectionClient, "Offline: ", SWT.NONE); +// Label lblOfflineCount = toolkit.createLabel(sectionClient, "1", SWT.NONE); +// lblOfflineCount.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED)); + + Double[] values = new Double[] { Double.valueOf(getServerCountByStatus(cluster, SERVER_STATUS.ONLINE)), + Double.valueOf(getServerCountByStatus(cluster, SERVER_STATUS.OFFLINE)) }; + + createStatusChart(toolkit, section, values); + } + + private void createStatusChart(FormToolkit toolkit, Composite section, Double[] values) { + String[] categories = new String[] { "Online", "Offline" }; + PieChartViewerComposite chartViewerComposite = new PieChartViewerComposite(section, SWT.NONE, categories, values); + + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + data.widthHint = 250; + data.heightHint = 250; + chartViewerComposite.setLayoutData(data); + } + + private void createAppSettingsSection(FormToolkit toolkit, final ScrolledForm form) { + Composite sectionClient = guiHelper.createSection(form, toolkit, "Application Settings", null, 2, false); + toolkit.createButton(sectionClient, "Enable Remote CLI?", SWT.CHECK | SWT.FLAT); + } + + private Combo createTimeZoneCombo(Composite sectionClient, GridData layoutData) { + Combo cboTimeZone = new Combo(sectionClient, SWT.FLAT); + cboTimeZone.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); + cboTimeZone.setLayoutData(layoutData); + + for (String timeZone : TimeZones.timeZones) { + cboTimeZone.add(timeZone); + } + cboTimeZone.setText("Asia/Calcutta"); + + SimpleContentProposalProvider proposalProvider = new SimpleContentProposalProvider(TimeZones.timeZones); + proposalProvider.setFiltering(true); + ContentProposalAdapter proposalAdapter = new ContentProposalAdapter(cboTimeZone, new ComboContentAdapter(), + proposalProvider, null, null); + proposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); + + return cboTimeZone; + } + + private GridData createDefaultLayoutData() { + GridData layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.minimumWidth = 200; + return layoutData; + } + + private void createClusterSettingsSection(final FormToolkit toolkit, final ScrolledForm form) { + GridData layoutData = createDefaultLayoutData(); + + Composite section = guiHelper.createSection(form, toolkit, "Cluster Settings", null, 2, false); + + toolkit.createLabel(section, "Time Zone: ", SWT.NONE); + createTimeZoneCombo(section, layoutData); + + toolkit.createLabel(section, "Network Time GlusterServer: ", SWT.NONE); + Text txtTimeServer = toolkit.createText(section, "pool.ntp.org", SWT.BORDER_SOLID); + txtTimeServer.setLayoutData(layoutData); + } + + private void createActionsSection(final Cluster cluster, final FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Actions", null, 1, false); + + ImageHyperlink imageHyperlink = toolkit.createImageHyperlink(section, SWT.NONE); + imageHyperlink.setText("Create Volume"); + imageHyperlink.setImage(guiHelper.getImage(IImageKeys.CREATE_VOLUME_BIG)); + imageHyperlink.addHyperlinkListener(new HyperlinkAdapter() { + // TODO: Override appropriate method and handle hyperlink event + }); + + imageHyperlink = toolkit.createImageHyperlink(section, SWT.NONE); + imageHyperlink.setText("Add Server(s)"); + imageHyperlink.setImage(guiHelper.getImage(IImageKeys.ADD_SERVER_BIG)); + imageHyperlink.addHyperlinkListener(new HyperlinkAdapter() { + // TODO: Override appropriate method and handle hyperlink event + }); + } + + private void createClusterSummaryTab(final Cluster cluster, final TabFolder tabFolder, final FormToolkit toolkit) { + Composite summaryTab = guiHelper.createTab(tabFolder, cluster.getName(), IImageKeys.CLUSTER); + + final ScrolledForm form = guiHelper.setupForm(summaryTab, toolkit, "Cluster Summary"); + createVolumesSection(cluster, toolkit, form); + createServersSection(cluster, toolkit, form); + createActionsSection(cluster, toolkit, form); + + summaryTab.layout(); // IMP: lays out the form properly + } + + private void createSettingsTab(final Cluster cluster, final TabFolder tabFolder, final FormToolkit toolkit) { + Composite settingsTab = guiHelper.createTab(tabFolder, "Settings", IImageKeys.SETTINGS); + + final ScrolledForm form = guiHelper.setupForm(settingsTab, toolkit, "Settings"); + createClusterSettingsSection(toolkit, form); + createAppSettingsSection(toolkit, form); + + settingsTab.layout(); // IMP: lays out the form properly + } + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createClusterSummaryTab((Cluster) entity, tabFolder, toolkit); + //createSettingsTab((Cluster) entity, tabFolder, toolkit); + } + +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupGlusterServerTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupGlusterServerTabCreator.java new file mode 100644 index 00000000..493e17d2 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupGlusterServerTabCreator.java @@ -0,0 +1,118 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Disk; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.GlusterServer.SERVER_STATUS; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.DisksPage; +import com.gluster.storage.management.gui.views.details.GlusterServersPage; +import com.gluster.storage.management.gui.views.details.TabCreator; +import com.gluster.storage.management.gui.views.navigator.NavigationView; + +public class EntityGroupGlusterServerTabCreator implements TabCreator, IDoubleClickListener { + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + private int getServerCountByStatus(EntityGroup<GlusterServer> servers, SERVER_STATUS status) { + int count = 0; + for (GlusterServer server : (List<GlusterServer>)servers.getEntities()) { + if (server.getStatus() == status) { + count++; + } + } + return count; + } + + private void createAlertsSection(final EntityGroup<GlusterServer> servers, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Alerts", null, 2, false); + + toolkit.createLabel(section, "Any alerts related to servers\nwill be displayed here."); + } + + private void createRunningTasksSection(final EntityGroup<GlusterServer> servers, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Running Tasks", null, 2, false); + + toolkit.createLabel(section, "List of running tasks related to\nservers will be displayed here."); + } + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createSummaryTab((EntityGroup<GlusterServer>)entity, tabFolder, toolkit); + createServersTab((EntityGroup<GlusterServer>)entity, tabFolder, toolkit); + createDisksTab((EntityGroup<GlusterServer>)entity, tabFolder, toolkit, site); + } + + private void createServersTab(EntityGroup<GlusterServer> servers, TabFolder tabFolder, FormToolkit toolkit) { + Composite serversTab = guiHelper.createTab(tabFolder, "Servers", IImageKeys.SERVERS); + GlusterServersPage page = new GlusterServersPage(serversTab, SWT.NONE, servers); + page.addDoubleClickListener(this); + } + + private void createSummaryTab(EntityGroup<GlusterServer> servers, TabFolder tabFolder, FormToolkit toolkit) { + Composite summaryTab = guiHelper.createTab(tabFolder, "Summary", IImageKeys.SERVERS); + final ScrolledForm form = guiHelper.setupForm(summaryTab, toolkit, "Servers - Summary"); + createSummarySection(servers, toolkit, form); + createRunningTasksSection(servers, toolkit, form); + createAlertsSection(servers, toolkit, form); + + summaryTab.layout(); // IMP: lays out the form properly + } + + private void createSummarySection(final EntityGroup<GlusterServer> servers, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Availability", null, 2, false); + + Double[] values = new Double[] { Double.valueOf(getServerCountByStatus(servers, SERVER_STATUS.ONLINE)), + Double.valueOf(getServerCountByStatus(servers, SERVER_STATUS.OFFLINE)) }; + createStatusChart(toolkit, section, values); + } + + private void createStatusChart(FormToolkit toolkit, Composite section, Double[] values) { + String[] categories = new String[] { "Online", "Offline" }; + PieChartViewerComposite chartViewerComposite = new PieChartViewerComposite(section, SWT.NONE, categories, values); + + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + data.widthHint = 250; + data.heightHint = 250; + chartViewerComposite.setLayoutData(data); + } + + + private void createDisksTab(EntityGroup<GlusterServer> servers, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + Composite disksTab = guiHelper.createTab(tabFolder, "Disks", IImageKeys.SERVERS); + DisksPage page = new DisksPage(disksTab, SWT.NONE, site, getAllDisks(servers)); + + disksTab.layout(); // IMP: lays out the form properly + } + + private List<Disk> getAllDisks(EntityGroup<GlusterServer> servers) { + List<Disk> disks = new ArrayList<Disk>(); + for(GlusterServer server : (List<GlusterServer>)servers.getEntities()) { + disks.addAll(server.getDisks()); + } + return disks; + } + + @Override + public void doubleClick(DoubleClickEvent event) { + NavigationView clusterView = (NavigationView) guiHelper.getView(NavigationView.ID); + if (clusterView != null) { + clusterView.selectEntity((Entity) ((StructuredSelection) event.getSelection()).getFirstElement()); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupServerTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupServerTabCreator.java new file mode 100644 index 00000000..92ac6bb4 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupServerTabCreator.java @@ -0,0 +1,42 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.ServersPage; +import com.gluster.storage.management.gui.views.details.TabCreator; +import com.gluster.storage.management.gui.views.navigator.NavigationView; + +public class EntityGroupServerTabCreator implements TabCreator, IDoubleClickListener { + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createServersTab((EntityGroup<Server>) entity, tabFolder); + } + + private void createServersTab(EntityGroup<Server> servers, TabFolder tabFolder) { + Composite serversTab = guiHelper.createTab(tabFolder, "Discovered Servers", IImageKeys.SERVERS); + ServersPage page = new ServersPage(serversTab, SWT.NONE, servers); + page.addDoubleClickListener(this); + } + + @Override + public void doubleClick(DoubleClickEvent event) { + NavigationView clusterView = (NavigationView) guiHelper.getView(NavigationView.ID); + if (clusterView != null) { + clusterView.selectEntity((Entity) ((StructuredSelection) event.getSelection()).getFirstElement()); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupVolumeTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupVolumeTabCreator.java new file mode 100644 index 00000000..377e781b --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/EntityGroupVolumeTabCreator.java @@ -0,0 +1,99 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import java.util.List; + +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.model.Volume.VOLUME_STATUS; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.TabCreator; +import com.gluster.storage.management.gui.views.details.VolumesPage; +import com.gluster.storage.management.gui.views.navigator.NavigationView; + +public class EntityGroupVolumeTabCreator implements TabCreator, IDoubleClickListener { + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createSummaryTab((EntityGroup<Volume>) entity, tabFolder, toolkit); + createVolumesTab((EntityGroup<Volume>) entity, tabFolder, toolkit); + } + + private int getVolumeCountByStatus(EntityGroup<Volume> volumes, VOLUME_STATUS status) { + int count = 0; + for (Volume volume : (List<Volume>) volumes.getEntities()) { + if (volume.getStatus() == status) { + count++; + } + } + return count; + } + + private void createStatusChart(FormToolkit toolkit, Composite section, Double[] values) { + String[] categories = new String[] { "Online", "Offline" }; + PieChartViewerComposite chartViewerComposite = new PieChartViewerComposite(section, SWT.NONE, categories, + values); + + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + data.widthHint = 250; + data.heightHint = 250; + chartViewerComposite.setLayoutData(data); + } + + private void createAlertsSection(final EntityGroup<Volume> volumes, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Alerts", null, 2, false); + + toolkit.createLabel(section, "Any alerts related to volumes\nwill be displayed here."); + } + + private void createRunningTasksSection(final EntityGroup<Volume> volumes, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Running Tasks", null, 2, false); + + toolkit.createLabel(section, "List of running tasks related to\nvolumes will be displayed here."); + } + + private void createSummarySection(final EntityGroup<Volume> volumes, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Availability", null, 2, false); + + Double[] values = new Double[] { Double.valueOf(getVolumeCountByStatus(volumes, VOLUME_STATUS.ONLINE)), + Double.valueOf(getVolumeCountByStatus(volumes, VOLUME_STATUS.OFFLINE)) }; + createStatusChart(toolkit, section, values); + } + + private void createSummaryTab(final EntityGroup<Volume> volumes, TabFolder tabFolder, FormToolkit toolkit) { + Composite summaryTab = guiHelper.createTab(tabFolder, "Summary", IImageKeys.VOLUMES); + final ScrolledForm form = guiHelper.setupForm(summaryTab, toolkit, "Volumes - Summary"); + createSummarySection(volumes, toolkit, form); + createRunningTasksSection(volumes, toolkit, form); + createAlertsSection(volumes, toolkit, form); + + summaryTab.layout(); // IMP: lays out the form properly + } + + private void createVolumesTab(EntityGroup<Volume> volumes, TabFolder tabFolder, FormToolkit toolkit) { + Composite volumesTab = guiHelper.createTab(tabFolder, "Volumes", IImageKeys.VOLUMES); + VolumesPage page = new VolumesPage(volumesTab, SWT.NONE, volumes); + page.addDoubleClickListener(this); + } + + @Override + public void doubleClick(DoubleClickEvent event) { + NavigationView clusterView = (NavigationView) guiHelper.getView(NavigationView.ID); + if (clusterView != null) { + clusterView.selectEntity((Entity) ((StructuredSelection) event.getSelection()).getFirstElement()); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/GlusterServerTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/GlusterServerTabCreator.java new file mode 100644 index 00000000..3e92d9c9 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/GlusterServerTabCreator.java @@ -0,0 +1,243 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.layout.TableColumnLayout; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.ProgressBar; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.events.HyperlinkAdapter; +import org.eclipse.ui.forms.events.HyperlinkEvent; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.Hyperlink; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.GlusterServer.SERVER_STATUS; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.NetworkInterfaceTableLabelProvider; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.ServerDisksPage; +import com.gluster.storage.management.gui.views.details.ServerLogsPage; +import com.gluster.storage.management.gui.views.details.TabCreator; +import com.richclientgui.toolbox.gauges.CoolGauge; + +public class GlusterServerTabCreator implements TabCreator { + public enum NETWORK_INTERFACE_TABLE_COLUMN_INDICES { + INTERFACE, IP_ADDRESS, NETMASK, GATEWAY, PREFERRED + }; + + private static final String[] NETWORK_INTERFACE_TABLE_COLUMN_NAMES = { "Interface", "IP Address", "Netmask", + "Gateway", "Preferred?" }; + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + private void createServerSummarySection(GlusterServer server, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Summary", null, 2, false); + + toolkit.createLabel(section, "Preferred Network: ", SWT.NONE); + toolkit.createLabel(section, server.getPreferredNetworkInterface().getName(), SWT.NONE); + + boolean online = server.getStatus() == SERVER_STATUS.ONLINE; + + if (online) { + toolkit.createLabel(section, "Number of CPUs: ", SWT.NONE); + toolkit.createLabel(section, "" + server.getNumOfCPUs(), SWT.NONE); + + // toolkit.createLabel(section, "CPU Usage (%): ", SWT.NONE); + // toolkit.createLabel(section, online ? "" + server.getCpuUsage() : "NA", SWT.NONE); + + toolkit.createLabel(section, "% CPU Usage (avg): ", SWT.NONE); + CoolGauge gauge = new CoolGauge(section, guiHelper.getImage(IImageKeys.GAUGE_SMALL)); + gauge.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false)); + gauge.setGaugeNeedleColour(Display.getDefault().getSystemColor(SWT.COLOR_RED)); + gauge.setGaugeNeedleWidth(2); + gauge.setGaugeNeedlePivot(new Point(66, 65)); + + gauge.setPoints(getPnts()); + gauge.setLevel(server.getCpuUsage() / 100); + gauge.setToolTipText(server.getCpuUsage() + "%"); + + toolkit.createLabel(section, "Memory Usage: ", SWT.NONE); + ProgressBar memoryUsageBar = new ProgressBar(section, SWT.SMOOTH); + memoryUsageBar.setMinimum(0); + memoryUsageBar.setMaximum((int) Math.round(server.getTotalMemory())); + memoryUsageBar.setSelection((int) Math.round(server.getMemoryInUse())); + memoryUsageBar.setToolTipText("Total: " + server.getTotalMemory() + "GB, In Use: " + + server.getMemoryInUse() + "GB"); + + // toolkit.createLabel(section, "Memory Usage: ", SWT.NONE); + // final CoolProgressBar bar = new CoolProgressBar(section,SWT.HORIZONTAL, + // guiHelper.getImage(IImageKeys.PROGRESS_BAR_LEFT), + // guiHelper.getImage(IImageKeys.PROGRESS_BAR_FILLED), + // guiHelper.getImage(IImageKeys.PROGRESS_BAR_EMPTY), + // guiHelper.getImage(IImageKeys.PROGRESS_BAR_RIGHT)); + // bar.updateProgress(server.getMemoryInUse() / server.getTotalMemory()); + + // toolkit.createLabel(section, "Total Disk Space (GB): ", SWT.NONE); + // toolkit.createLabel(section, online ? "" + server.getTotalDiskSpace() : "NA", SWT.NONE); + // + // toolkit.createLabel(section, "Disk Space in Use (GB): ", SWT.NONE); + // toolkit.createLabel(section, online ? "" + server.getDiskSpaceInUse() : "NA", SWT.NONE); + + toolkit.createLabel(section, "Disk Usage: ", SWT.NONE); + ProgressBar diskUsageBar = new ProgressBar(section, SWT.SMOOTH); + diskUsageBar.setMinimum(0); + diskUsageBar.setMaximum((int) Math.round(server.getTotalDiskSpace())); + diskUsageBar.setSelection((int) Math.round(server.getDiskSpaceInUse())); + diskUsageBar.setToolTipText("Total: " + NumberUtil.formatNumber(server.getTotalDiskSpace()) + + "GB, In Use: " + NumberUtil.formatNumber(server.getDiskSpaceInUse()) + "GB"); + } + + toolkit.createLabel(section, "Status: ", SWT.NONE); + CLabel lblStatusValue = new CLabel(section, SWT.NONE); + lblStatusValue.setText(server.getStatusStr()); + lblStatusValue.setImage(server.getStatus() == GlusterServer.SERVER_STATUS.ONLINE ? guiHelper + .getImage(IImageKeys.STATUS_ONLINE) : guiHelper.getImage(IImageKeys.STATUS_OFFLINE)); + toolkit.adapt(lblStatusValue, true, true); + } + + private List<Point> getPnts() { + final List<Point> pnts = new ArrayList<Point>(); + pnts.add(new Point(47, 98)); + pnts.add(new Point(34, 84)); + pnts.add(new Point(29, 65)); + pnts.add(new Point(33, 48)); + pnts.add(new Point(48, 33)); + pnts.add(new Point(66, 28)); + pnts.add(new Point(83, 32)); + pnts.add(new Point(98, 47)); + pnts.add(new Point(103, 65)); + pnts.add(new Point(98, 83)); + pnts.add(new Point(84, 98)); + return pnts; + } + + private void createServerSummaryTab(GlusterServer server, TabFolder tabFolder, FormToolkit toolkit) { + String serverName = server.getName(); + Composite serverSummaryTab = guiHelper.createTab(tabFolder, serverName, IImageKeys.SERVER); + final ScrolledForm form = guiHelper.setupForm(serverSummaryTab, toolkit, "Server Summary [" + serverName + "]"); + createServerSummarySection(server, toolkit, form); + + if (server.getStatus() == SERVER_STATUS.ONLINE) { + Composite section = createNetworkInterfacesSection(server, toolkit, form); + } + + serverSummaryTab.layout(); // IMP: lays out the form properly + } + + private void setupNetworkInterfaceTable(Composite parent, Table table) { + table.setHeaderVisible(true); + table.setLinesVisible(false); + + TableColumnLayout tableColumnLayout = guiHelper.createTableColumnLayout(table, + NETWORK_INTERFACE_TABLE_COLUMN_NAMES); + parent.setLayout(tableColumnLayout); + + setColumnProperties(table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES.INTERFACE, SWT.CENTER, 70); + setColumnProperties(table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES.IP_ADDRESS, SWT.CENTER, 100); + setColumnProperties(table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES.NETMASK, SWT.CENTER, 70); + setColumnProperties(table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES.GATEWAY, SWT.CENTER, 70); + setColumnProperties(table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES.PREFERRED, SWT.CENTER, 70); + } + + /** + * Sets properties for alignment and weight of given column of given table + * + * @param table + * @param columnIndex + * @param alignment + * @param weight + */ + public void setColumnProperties(Table table, NETWORK_INTERFACE_TABLE_COLUMN_INDICES columnIndex, int alignment, + int weight) { + TableColumn column = table.getColumn(columnIndex.ordinal()); + column.setAlignment(alignment); + + TableColumnLayout tableColumnLayout = (TableColumnLayout) table.getParent().getLayout(); + tableColumnLayout.setColumnData(column, new ColumnWeightData(weight)); + } + + private TableViewer createNetworkInterfacesTableViewer(final Composite parent, GlusterServer server) { + TableViewer tableViewer = new TableViewer(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + // TableViewer tableViewer = new TableViewer(parent, SWT.FLAT | SWT.FULL_SELECTION | SWT.MULTI); + tableViewer.setLabelProvider(new NetworkInterfaceTableLabelProvider()); + tableViewer.setContentProvider(new ArrayContentProvider()); + + setupNetworkInterfaceTable(parent, tableViewer.getTable()); + tableViewer.setInput(server.getNetworkInterfaces().toArray()); + + return tableViewer; + } + + private Composite createTableViewerComposite(Composite parent) { + Composite tableViewerComposite = new Composite(parent, SWT.NO); + tableViewerComposite.setLayout(new FillLayout(SWT.HORIZONTAL)); + GridData tableLayoutData = new GridData(SWT.FILL, SWT.FILL, true, false); + tableLayoutData.widthHint = 400; + tableLayoutData.minimumWidth = 400; + // tableLayoutData.grabExcessHorizontalSpace = true; + tableViewerComposite.setLayoutData(tableLayoutData); + return tableViewerComposite; + } + + private Composite createNetworkInterfacesSection(GlusterServer server, FormToolkit toolkit, ScrolledForm form) { + final Composite section = guiHelper.createSection(form, toolkit, "Network Interfaces", null, 1, false); + createNetworkInterfacesTableViewer(createTableViewerComposite(section), server); + Hyperlink changePreferredNetworkLink = toolkit.createHyperlink(section, "Change Preferred Network", SWT.NONE); + changePreferredNetworkLink.addHyperlinkListener(new HyperlinkAdapter() { + + @Override + public void linkActivated(HyperlinkEvent e) { + new MessageDialog( + section.getShell(), + "Gluster Storage Platform", + guiHelper.getImage(IImageKeys.SERVER), + "This will show additional controls to help user choose a new network interface. TO BE IMPLEMENTED.", + MessageDialog.INFORMATION, new String[] { "OK" }, 0).open(); + } + }); + return section; + } + + private void createServerLogsTab(GlusterServer server, TabFolder tabFolder, FormToolkit toolkit) { + String serverName = server.getName(); + Composite serverLogsTab = guiHelper.createTab(tabFolder, "Logs", IImageKeys.SERVER); + ServerLogsPage logsPage = new ServerLogsPage(serverLogsTab, SWT.NONE, server); + + serverLogsTab.layout(); // IMP: lays out the form properly + } + + private void createServerDisksTab(GlusterServer server, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + Composite serverDisksTab = guiHelper.createTab(tabFolder, "Disks", IImageKeys.SERVER); + ServerDisksPage page = new ServerDisksPage(serverDisksTab, SWT.NONE, site, server.getDisks()); + + serverDisksTab.layout(); // IMP: lays out the form properly + } + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + GlusterServer server = (GlusterServer) entity; + + createServerSummaryTab(server, tabFolder, toolkit); + if (server.getStatus() == SERVER_STATUS.ONLINE) { + createServerDisksTab(server, tabFolder, toolkit, site); + createServerLogsTab(server, tabFolder, toolkit); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/PieChartViewerComposite.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/PieChartViewerComposite.java new file mode 100644 index 00000000..9ed179c6 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/PieChartViewerComposite.java @@ -0,0 +1,258 @@ +/*********************************************************************** + * Copyright (c) 2004, 2007 Actuate Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Actuate Corporation - initial API and implementation + ***********************************************************************/ + +package com.gluster.storage.management.gui.views.details.tabcreators; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.eclipse.birt.chart.api.ChartEngine; +import org.eclipse.birt.chart.device.IDeviceRenderer; +import org.eclipse.birt.chart.device.IUpdateNotifier; +import org.eclipse.birt.chart.exception.ChartException; +import org.eclipse.birt.chart.factory.GeneratedChartState; +import org.eclipse.birt.chart.factory.Generator; +import org.eclipse.birt.chart.model.Chart; +import org.eclipse.birt.chart.model.ChartWithoutAxes; +import org.eclipse.birt.chart.model.attribute.Bounds; +import org.eclipse.birt.chart.model.attribute.ChartDimension; +import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl; +import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl; +import org.eclipse.birt.chart.model.component.Series; +import org.eclipse.birt.chart.model.component.impl.SeriesImpl; +import org.eclipse.birt.chart.model.data.NumberDataSet; +import org.eclipse.birt.chart.model.data.SeriesDefinition; +import org.eclipse.birt.chart.model.data.TextDataSet; +import org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl; +import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl; +import org.eclipse.birt.chart.model.data.impl.TextDataSetImpl; +import org.eclipse.birt.chart.model.impl.ChartWithoutAxesImpl; +import org.eclipse.birt.chart.model.layout.Legend; +import org.eclipse.birt.chart.model.layout.Plot; +import org.eclipse.birt.chart.model.type.PieSeries; +import org.eclipse.birt.chart.model.type.impl.PieSeriesImpl; +import org.eclipse.birt.core.framework.PlatformConfig; +import org.eclipse.core.runtime.Platform; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +/** + * + */ +public final class PieChartViewerComposite extends Composite implements PaintListener, IUpdateNotifier { + + private IDeviceRenderer idr = null; + private Chart cm = null; + private GeneratedChartState gcs = null; + private boolean bNeedsGeneration = true; + + private static Logger logger = Logger.getLogger(PieChartViewerComposite.class.getName()); + + public static void main(String[] args) { + Display display = Display.getDefault(); + Shell shell = new Shell(display); + shell.setSize(800, 600); + shell.setLayout(new GridLayout()); + + // Data Set + String[] categories = new String[] { "New York", "Boston", "Chicago", "San Francisco", "Dallas" };//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + Double[] values = new Double[] { 54.65, 21d, 75.95, 91.28, 37.43 }; + + PieChartViewerComposite chartViewerComposite = new PieChartViewerComposite(shell, SWT.NO_BACKGROUND, + categories, values); + + GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); + data.widthHint = 250; + data.heightHint = 250; + chartViewerComposite.setLayoutData(data); + + shell.setText(chartViewerComposite.getClass().getName() + " [device=" //$NON-NLS-1$ + + chartViewerComposite.idr.getClass().getName() + "]");//$NON-NLS-1$ + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + display.dispose(); + } + + /** + * Get the connection with SWT device to render the graphics. + */ + PieChartViewerComposite(Composite parent, int style, String[] categories, Double[] values) { + super(parent, style); + try { + PlatformConfig config = new PlatformConfig(); + config.setBIRTHome(Platform.getInstallLocation().getURL().getPath()); + idr = ChartEngine.instance(config).getRenderer("dv.SWT");//$NON-NLS-1$ + } catch (ChartException ex) { + logger.log(Level.SEVERE, "Could not create Chart Renderer for SWT", ex); + } + addControlListener(new ControlListener() { + + public void controlMoved(ControlEvent e) { + bNeedsGeneration = true; + } + + public void controlResized(ControlEvent e) { + bNeedsGeneration = true; + } + }); + cm = createPieChart(categories, values); + addPaintListener(this); + } + + /** + * Creates a pie chart model as a reference implementation + * + * @return An instance of the simulated runtime chart model (containing filled datasets) + */ + public static final Chart createPieChart(String[] categories, Double[] values) { + ChartWithoutAxes pieChart = ChartWithoutAxesImpl.create(); + + // Plot + pieChart.setSeriesThickness(2); + pieChart.setDimension(ChartDimension.TWO_DIMENSIONAL_WITH_DEPTH_LITERAL); + pieChart.getBlock().setBackground(ColorDefinitionImpl.WHITE()); + Plot p = pieChart.getPlot(); + p.getClientArea().setBackground(null); + p.getClientArea().getOutline().setVisible(false); + p.getOutline().setVisible(false); + + // Legend + Legend lg = pieChart.getLegend(); + lg.getText().getFont().setSize(8); + lg.setBackground(null); + lg.getOutline().setVisible(false); + lg.setVisible(true); + + // Title + pieChart.getTitle().getLabel().getCaption().setValue("Pie Chart");//$NON-NLS-1$ + pieChart.getTitle().getOutline().setVisible(false); + pieChart.getTitle().setVisible(false); + + TextDataSet categoryValues = TextDataSetImpl.create(categories); + NumberDataSet seriesOneValues = NumberDataSetImpl.create(values); + + // Base Series + Series seCategory = SeriesImpl.create(); + seCategory.setDataSet(categoryValues); + + SeriesDefinition sd = SeriesDefinitionImpl.create(); + pieChart.getSeriesDefinitions().add(sd); + sd.getSeriesPalette().shift(0); + sd.getSeries().add(seCategory); + + // Orthogonal Series + PieSeries sePie = (PieSeries) PieSeriesImpl.create(); + sePie.setDataSet(seriesOneValues); + sePie.setSeriesIdentifier("Cities");//$NON-NLS-1$ + sePie.getTitle().setVisible(false); + sePie.setExplosion(2); + + SeriesDefinition seriesDefinition = SeriesDefinitionImpl.create(); + seriesDefinition.getQuery().setDefinition("query.definition");//$NON-NLS-1$ + sd.getSeriesDefinitions().add(seriesDefinition); + seriesDefinition.getSeries().add(sePie); + + return pieChart; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent) + */ + public final void paintControl(PaintEvent e) { + Rectangle d = ((Composite) e.getSource()).getBounds(); + Image imgChart = new Image(this.getDisplay(), d); + GC gcImage = new GC(imgChart); + idr.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, gcImage); + idr.setProperty(IDeviceRenderer.UPDATE_NOTIFIER, this); + + Bounds bo = BoundsImpl.create(0, 0, d.width, d.height); + bo.scale(58d / idr.getDisplayServer().getDpiResolution()); + + Generator gr = Generator.instance(); + if (bNeedsGeneration) { + bNeedsGeneration = false; + try { + gcs = gr.build(idr.getDisplayServer(), cm, bo, null, null, null); + } catch (ChartException ce) { + ce.printStackTrace(); + } + } + + try { + gr.render(idr, gcs); + GC gc = e.gc; + gc.drawImage(imgChart, d.x, d.y); + } catch (ChartException gex) { + logger.log(Level.SEVERE, "Exception while rendering pie chart [" + gex.getMessage() + "]", gex); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.birt.chart.device.IUpdateNotifier#getDesignTimeModel() + */ + public Chart getDesignTimeModel() { + return cm; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.birt.chart.device.IUpdateNotifier#getRunTimeModel() + */ + public Chart getRunTimeModel() { + return gcs.getChartModel(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.birt.chart.device.IUpdateNotifier#peerInstance() + */ + public Object peerInstance() { + return this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.birt.chart.device.IUpdateNotifier#regenerateChart() + */ + public void regenerateChart() { + redraw(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.birt.chart.device.IUpdateNotifier#repaintChart() + */ + public void repaintChart() { + redraw(); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ServerTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ServerTabCreator.java new file mode 100644 index 00000000..c630a964 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/ServerTabCreator.java @@ -0,0 +1,55 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.TabCreator; + +public class ServerTabCreator implements TabCreator { + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + private void createServerSummarySection(Server server, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Summary", null, 2, false); + + toolkit.createLabel(section, "Number of CPUs: ", SWT.NONE); + toolkit.createLabel(section, "" + server.getNumOfCPUs(), SWT.NONE); + +// toolkit.createLabel(section, "CPU Usage (%): ", SWT.NONE); +// toolkit.createLabel(section, "" + server.getCpuUsage(), SWT.NONE); + + toolkit.createLabel(section, "Total Memory (GB): ", SWT.NONE); + toolkit.createLabel(section, "" + server.getTotalMemory(), SWT.NONE); + +// toolkit.createLabel(section, "Memory in Use (GB): ", SWT.NONE); +// toolkit.createLabel(section, "" + server.getMemoryInUse(), SWT.NONE); + + toolkit.createLabel(section, "Total Disk Space (GB): ", SWT.NONE); + toolkit.createLabel(section, "" + NumberUtil.formatNumber(server.getTotalDiskSpace()), SWT.NONE); + +// toolkit.createLabel(section, "Disk Space in Use (GB): ", SWT.NONE); +// toolkit.createLabel(section, "" + server.getDiskSpaceInUse(), SWT.NONE); + } + + private void createServerSummaryTab(Server server, TabFolder tabFolder, FormToolkit toolkit) { + String serverName = server.getName(); + Composite serverSummaryTab = guiHelper.createTab(tabFolder, serverName, IImageKeys.SERVER); + final ScrolledForm form = guiHelper.setupForm(serverSummaryTab, toolkit, "Discovered Server Summary [" + serverName + "]"); + createServerSummarySection(server, toolkit, form); + + serverSummaryTab.layout(); // IMP: lays out the form properly + } + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createServerSummaryTab((Server) entity, tabFolder, toolkit); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/VolumeTabCreator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/VolumeTabCreator.java new file mode 100644 index 00000000..cba58703 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/details/tabcreators/VolumeTabCreator.java @@ -0,0 +1,251 @@ +package com.gluster.storage.management.gui.views.details.tabcreators; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchSite; +import org.eclipse.ui.forms.events.HyperlinkAdapter; +import org.eclipse.ui.forms.events.HyperlinkEvent; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.Hyperlink; +import org.eclipse.ui.forms.widgets.ScrolledForm; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.core.model.Volume.NAS_PROTOCOL; +import com.gluster.storage.management.core.model.Volume.VOLUME_TYPE; +import com.gluster.storage.management.core.utils.NumberUtil; +import com.gluster.storage.management.gui.IImageKeys; +import com.gluster.storage.management.gui.utils.GUIHelper; +import com.gluster.storage.management.gui.views.details.DisksPage; +import com.gluster.storage.management.gui.views.details.TabCreator; +import com.gluster.storage.management.gui.views.details.VolumeLogsPage; +import com.gluster.storage.management.gui.views.details.VolumeOptionsPage; + +public class VolumeTabCreator implements TabCreator { + private static final GUIHelper guiHelper = GUIHelper.getInstance(); + + private void createVolumePropertiesSection(final Volume volume, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Properties", null, 3, false); + + createVolumeTypeField(volume, toolkit, section); + + VOLUME_TYPE volumeType = volume.getVolumeType(); + if (volumeType == VOLUME_TYPE.DISTRIBUTED_MIRROR) { + createReplicaCountField(volume, toolkit, section); + } + + if (volumeType == VOLUME_TYPE.DISTRIBUTED_STRIPE) { + createStripeCountField(volume, toolkit, section); + } + + createNumOfDisksField(volume, toolkit, section); + createDiskSpaceField(volume, toolkit, section); + createTransportTypeField(volume, toolkit, section); + createNASProtocolField(volume, toolkit, section); + createAccessControlField(volume, toolkit, section); + createStatusField(volume, toolkit, section); + } + + private void createDiskSpaceField(final Volume volume, FormToolkit toolkit, Composite section) { + Label diskSpaceLabel = toolkit.createLabel(section, "Total Disk Space (GB): ", SWT.NONE); + diskSpaceLabel.setToolTipText("<b>bold</b>normal"); + toolkit.createLabel(section, "" + NumberUtil.formatNumber(volume.getTotalDiskSpace()), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createStatusField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Status: ", SWT.NONE); + + CLabel lblStatusValue = new CLabel(section, SWT.NONE); + lblStatusValue.setText(volume.getStatusStr()); + lblStatusValue.setImage(volume.getStatus() == Volume.VOLUME_STATUS.ONLINE ? guiHelper + .getImage(IImageKeys.STATUS_ONLINE) : guiHelper.getImage(IImageKeys.STATUS_OFFLINE)); + + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createTransportTypeField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Transport Type: ", SWT.NONE); + toolkit.createLabel(section, "" + volume.getTransportTypeStr(), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createNumOfDisksField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Number of Disks: ", SWT.NONE); + toolkit.createLabel(section, "" + volume.getNumOfDisks(), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createStripeCountField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Stripe Count: ", SWT.NONE); + toolkit.createLabel(section, "" + volume.getStripeCount(), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createReplicaCountField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Replica Count: ", SWT.NONE); + toolkit.createLabel(section, "" + volume.getReplicaCount(), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); // dummy + } + + private void createVolumeTypeField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Volume Type: ", SWT.NONE); + toolkit.createLabel(section, volume.getVolumeTypeStr(), SWT.NONE); + toolkit.createLabel(section, "", SWT.NONE); + } + + private void createVolumeAlertsSection(final Volume volume, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Alerts", null, 3, false); + toolkit.createLabel(section, "Volume related alerts will be displayed here"); + } + + private void createVolumeMountingInfoSection(final Volume volume, FormToolkit toolkit, final ScrolledForm form) { + Composite section = guiHelper.createSection(form, toolkit, "Mounting Information", null, 3, false); + toolkit.createLabel(section, "Information about mounting the\nvolume will be printed here"); + } + + private GridData createDefaultLayoutData() { + GridData layoutData = new GridData(); + layoutData.minimumWidth = 150; + layoutData.widthHint = 150; + return layoutData; + } + + private void createAccessControlField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "Access Control: ", SWT.NONE); + Text accessControlText = toolkit.createText(section, volume.getAccessControlList()); + accessControlText.setLayoutData(createDefaultLayoutData()); + accessControlText.setEnabled(false); + createChangeLinkForAccessControl(volume, toolkit, section, accessControlText); + } + + private void createChangeLinkForAccessControl(final Volume volume, FormToolkit toolkit, Composite section, + final Text accessControlText) { + final Hyperlink changeLink = toolkit.createHyperlink(section, "change", SWT.NONE); + changeLink.addHyperlinkListener(new HyperlinkAdapter() { + + private void finishEdit() { + // TODO: Update value to back-end + // TODO: Validation of entered text + volume.setAccessControlList(accessControlText.getText()); + accessControlText.setEnabled(false); + changeLink.setText("change"); + } + + private void startEdit() { + accessControlText.setEnabled(true); + changeLink.setText("update"); + } + + @Override + public void linkActivated(HyperlinkEvent e) { + if (accessControlText.isEnabled()) { + // we were already in edit mode. + finishEdit(); + } else { + // Get in to edit mode + startEdit(); + } + } + }); + } + + private void createNASProtocolField(final Volume volume, FormToolkit toolkit, Composite section) { + toolkit.createLabel(section, "NAS Protocols: ", SWT.NONE); + + Composite nasProtocolsComposite = toolkit.createComposite(section); + nasProtocolsComposite.setLayout(new FillLayout()); + + createCheckbox(toolkit, nasProtocolsComposite, "Gluster", true); + final Button nfsCheckBox = createCheckbox(toolkit, nasProtocolsComposite, "NFS", volume.getNASProtocols().contains(NAS_PROTOCOL.NFS)); + + createChangeLinkForNASProtocol(volume, toolkit, section, nfsCheckBox); + } + + private void createChangeLinkForNASProtocol(final Volume volume, FormToolkit toolkit, Composite section, + final Button nfsCheckBox) { + final Hyperlink changeLink = toolkit.createHyperlink(section, "change", SWT.NONE); + changeLink.addHyperlinkListener(new HyperlinkAdapter() { + + private void finishEdit() { + // TODO: Update value to back-end + if (nfsCheckBox.getSelection()) { + volume.enableNFS(); + } else { + volume.disableNFS(); + } + nfsCheckBox.setEnabled(false); + changeLink.setText("change"); + } + + private void startEdit() { + nfsCheckBox.setEnabled(true); + changeLink.setText("update"); + } + + @Override + public void linkActivated(HyperlinkEvent e) { + if (nfsCheckBox.isEnabled()) { + // we were already in edit mode. + finishEdit(); + } else { + // Get in to edit mode + startEdit(); + } + } + }); + } + + private Button createCheckbox(FormToolkit toolkit, Composite parent, String label, boolean selected) { + final Button checkBox = toolkit.createButton(parent, label, SWT.CHECK); + checkBox.setEnabled(false); + checkBox.setSelection(selected); + return checkBox; + } + + private void createVolumePropertiesTab(Volume volume, TabFolder tabFolder, FormToolkit toolkit) { + Composite volumeTab = guiHelper.createTab(tabFolder, volume.getName() + " - Properties", IImageKeys.VOLUME); + final ScrolledForm form = guiHelper.setupForm(volumeTab, toolkit, "Volume Properties [" + volume.getName() + "]"); + createVolumePropertiesSection(volume, toolkit, form); + createVolumeMountingInfoSection(volume, toolkit, form); + createVolumeAlertsSection(volume, toolkit, form); + + volumeTab.layout(); // IMP: lays out the form properly + } + + private void createVolumeLogsTab(Volume volume, TabFolder tabFolder, FormToolkit toolkit) { + Composite volumeTab = guiHelper.createTab(tabFolder, "Logs", IImageKeys.VOLUME); + VolumeLogsPage logsPage = new VolumeLogsPage(volumeTab, SWT.NONE, volume); + + volumeTab.layout(); // IMP: lays out the form properly + } + + private void createVolumeDisksTab(Volume volume, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + Composite volumeDisksTab = guiHelper.createTab(tabFolder, "Disks", IImageKeys.VOLUME); + DisksPage page = new DisksPage(volumeDisksTab, SWT.NONE, site, volume.getDisks()); + + volumeDisksTab.layout(); // IMP: lays out the form properly + } + + private void createVolumeOptionsTab(Volume volume, TabFolder tabFolder, FormToolkit toolkit) { + Composite volumeTab = guiHelper.createTab(tabFolder, "Options", IImageKeys.VOLUME); + VolumeOptionsPage page = new VolumeOptionsPage(volumeTab, SWT.NONE, volume); + + volumeTab.layout(); // IMP: lays out the form properly + } + + @Override + public void createTabs(Entity entity, TabFolder tabFolder, FormToolkit toolkit, IWorkbenchSite site) { + createVolumePropertiesTab((Volume) entity, tabFolder, toolkit); + createVolumeDisksTab((Volume) entity, tabFolder, toolkit, site); + createVolumeOptionsTab((Volume) entity, tabFolder, toolkit); + createVolumeLogsTab((Volume) entity, tabFolder, toolkit); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/ClusterAdapterFactory.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/ClusterAdapterFactory.java new file mode 100644 index 00000000..53a9ba3d --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/ClusterAdapterFactory.java @@ -0,0 +1,80 @@ +package com.gluster.storage.management.gui.views.navigator; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.model.IWorkbenchAdapter; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.gluster.storage.management.core.model.Cluster; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.GlusterDataModel; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IImageKeys; + +public class ClusterAdapterFactory implements IAdapterFactory { + private IWorkbenchAdapter entityAdapter = new IWorkbenchAdapter() { + + @Override + public Object getParent(Object o) { + return ((Entity) o).getParent(); + } + + @Override + public String getLabel(Object o) { + return ((Entity)o).getName(); + } + + @Override + public ImageDescriptor getImageDescriptor(Object object) { + String iconPath = null; + + if(object instanceof GlusterDataModel || object instanceof Cluster) { + iconPath = IImageKeys.CLUSTER; + } + + if(object instanceof EntityGroup) { + Class<? extends Entity> entityType = ((EntityGroup) object).getEntityType(); + if(entityType == Volume.class) { + iconPath = IImageKeys.VOLUMES; + } else { + iconPath = IImageKeys.SERVERS; + } + } + + if(object instanceof Volume) { + iconPath = IImageKeys.VOLUME; + } + + if(object instanceof Server || object instanceof GlusterServer) { + iconPath = IImageKeys.SERVER; + } + + return AbstractUIPlugin.imageDescriptorFromPlugin( + Application.PLUGIN_ID, iconPath); + } + + @Override + public Object[] getChildren(Object o) { + return ((Entity)o).getChildren().toArray(); + } + }; + + @Override + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adapterType == IWorkbenchAdapter.class) { + if (adaptableObject instanceof Entity) { + return entityAdapter; + } + } + return null; + } + + @Override + public Class[] getAdapterList() { + return new Class[] { IWorkbenchAdapter.class }; + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationTreeLabelDecorator.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationTreeLabelDecorator.java new file mode 100644 index 00000000..607cb3af --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationTreeLabelDecorator.java @@ -0,0 +1,68 @@ +package com.gluster.storage.management.gui.views.navigator; + +import org.eclipse.jface.viewers.IDecoration; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ILightweightLabelDecorator; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.gluster.storage.management.core.model.EntityGroup; +import com.gluster.storage.management.core.model.GlusterServer; +import com.gluster.storage.management.core.model.Server; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IImageKeys; + +public class NavigationTreeLabelDecorator implements ILightweightLabelDecorator { + + @Override + public void addListener(ILabelProviderListener listener) { + } + + @Override + public void dispose() { + } + + @Override + public boolean isLabelProperty(Object element, String property) { + return false; + } + + @Override + public void removeListener(ILabelProviderListener listener) { + } + + @Override + public void decorate(Object element, IDecoration decoration) { + if (element instanceof Volume) { + Volume volume = (Volume) element; + if (volume.getStatus() == Volume.VOLUME_STATUS.OFFLINE) { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_OFFLINE)); + } else { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_ONLINE)); + } + } + + if (element instanceof GlusterServer) { + GlusterServer server = (GlusterServer) element; + if (server.getStatus() == GlusterServer.SERVER_STATUS.OFFLINE) { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_OFFLINE)); + } else { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_ONLINE)); + } + } + + if (element instanceof Server) { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_STAR)); + } + + if(element instanceof EntityGroup && ((EntityGroup)element).getEntityType() == Server.class) { + decoration.addOverlay(AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, + IImageKeys.OVERLAY_STAR)); + } + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationView.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationView.java new file mode 100644 index 00000000..5d8efae0 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/NavigationView.java @@ -0,0 +1,61 @@ +package com.gluster.storage.management.gui.views.navigator; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.ui.model.BaseWorkbenchContentProvider; +import org.eclipse.ui.model.WorkbenchLabelProvider; +import org.eclipse.ui.part.ViewPart; + +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.GlusterDataModel; +import com.gluster.storage.management.core.model.GlusterDummyModel; + +public class NavigationView extends ViewPart { + public static final String ID = "com.gluster.storage.management.gui.views.navigator"; + private GlusterDataModel model; + private TreeViewer treeViewer; + private IAdapterFactory adapterFactory = new ClusterAdapterFactory(); + + public NavigationView() { + super(); + } + + @Override + public void createPartControl(Composite parent) { + model = GlusterDummyModel.getInstance().getModel(); + + treeViewer = new TreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL); + getSite().setSelectionProvider(treeViewer); + Platform.getAdapterManager().registerAdapters(adapterFactory, Entity.class); + treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); + treeViewer.setContentProvider(new BaseWorkbenchContentProvider()); + treeViewer.setInput(model); + treeViewer.expandAll(); + // select the first element by default + treeViewer.setSelection(new StructuredSelection(model.getChildren().get(0))); + + MenuManager menuManager = new MenuManager("&Gluster", "gluster.context.menu"); + Menu contextMenu = menuManager.createContextMenu(treeViewer.getControl()); + treeViewer.getTree().setMenu(contextMenu); + + getSite().registerContextMenu(menuManager, treeViewer); + } + + public void selectEntity(Entity entity) { + treeViewer.setSelection(new StructuredSelection(entity)); + treeViewer.reveal(entity); + setFocus(); // this ensures that the "selection changed" event gets fired + } + + + @Override + public void setFocus() { + treeViewer.getControl().setFocus(); + } +} diff --git a/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/RootAdapter.java b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/RootAdapter.java new file mode 100644 index 00000000..ff4840ff --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/navigator/RootAdapter.java @@ -0,0 +1,103 @@ +package com.gluster.storage.management.gui.views.navigator; + +import java.util.List; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.model.IWorkbenchAdapter; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.gluster.storage.management.core.model.Cluster; +import com.gluster.storage.management.core.model.Entity; +import com.gluster.storage.management.core.model.Volume; +import com.gluster.storage.management.gui.Application; +import com.gluster.storage.management.gui.IImageKeys; + +public class RootAdapter implements IWorkbenchAdapter { + public enum NODE_TYPE { + CLUSTER, SERVERS, VOLUMES, GSN + }; + + private Cluster cluster; + private static final String LABEL_SERVERS = "Servers"; + private static final String LABEL_VOLUMES = "Volumes"; + private static final String LABEL_GSN = "GSN"; + + public RootAdapter(Cluster cluster) { + this.cluster = cluster; + } + + @Override + public Object getParent(Object o) { + return cluster; + } + + @Override + public String getLabel(Object o) { + switch (getNodeType(o)) { + case CLUSTER: + return cluster.getName(); + case VOLUMES: + return LABEL_VOLUMES; + case SERVERS: + return LABEL_SERVERS; + case GSN: + return LABEL_GSN; + default: + return null; + } + } + + private NODE_TYPE getNodeType(Object obj) { + if(obj instanceof Cluster) { + return NODE_TYPE.CLUSTER; + } + + if (obj instanceof String) { + return NODE_TYPE.GSN; + } + + if (obj instanceof List) { + List<? extends Entity> list = (List<? extends Entity>) obj; + if (list.size() == 0) { + return null; + } + Entity firstEntity = list.get(0); + return ((firstEntity instanceof Volume) ? NODE_TYPE.VOLUMES + : NODE_TYPE.SERVERS); + } + + return null; + } + + @Override + public ImageDescriptor getImageDescriptor(Object object) { + String iconPath = null; + switch (getNodeType(object)) { + case CLUSTER: + iconPath = IImageKeys.CLUSTER; + case VOLUMES: + iconPath = IImageKeys.VOLUMES; + case SERVERS: + iconPath = IImageKeys.SERVERS; + case GSN: + iconPath = IImageKeys.GSN; + } + return AbstractUIPlugin.imageDescriptorFromPlugin( + Application.PLUGIN_ID, iconPath); + } + + @Override + public Object[] getChildren(Object o) { + /*switch (getNodeType(o)) { + case CLUSTER: + return new Object[] {cluster.getVolumes(), cluster.getServers(), "GSN"}; + case VOLUMES: + return cluster.getVolumes().toArray(); + case GLUSTER_SERVERS: + return cluster.getServers().toArray(); + default: + return null; + }*/ + return null; + } +} diff --git a/com.gluster.storage.management.gui/src/com/swtdesigner/ResourceManager.java b/com.gluster.storage.management.gui/src/com/swtdesigner/ResourceManager.java new file mode 100644 index 00000000..e171da70 --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/swtdesigner/ResourceManager.java @@ -0,0 +1,405 @@ +package com.swtdesigner; + +import java.io.File; +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.resource.CompositeImageDescriptor; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; +import org.osgi.framework.Bundle; + +/** + * Utility class for managing OS resources associated with SWT/JFace controls such as colors, fonts, images, + * etc. + * + * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the + * operating system resources managed by cached objects when those objects and OS resources are no longer + * needed (e.g. on application shutdown) + * + * This class may be freely distributed as part of any application or plugin. + * <p> + * + * @author scheglov_ke + * @author Dan Rubel + */ +public class ResourceManager extends SWTResourceManager { + //////////////////////////////////////////////////////////////////////////// + // + // Image + // + //////////////////////////////////////////////////////////////////////////// + private static Map<ImageDescriptor, Image> m_descriptorImageMap = new HashMap<ImageDescriptor, Image>(); + /** + * Returns an {@link ImageDescriptor} stored in the file at the specified path relative to the specified + * class. + * + * @param clazz + * the {@link Class} relative to which to find the image descriptor. + * @param path + * the path to the image file. + * @return the {@link ImageDescriptor} stored in the file at the specified path. + */ + public static ImageDescriptor getImageDescriptor(Class<?> clazz, String path) { + return ImageDescriptor.createFromFile(clazz, path); + } + /** + * Returns an {@link ImageDescriptor} stored in the file at the specified path. + * + * @param path + * the path to the image file. + * @return the {@link ImageDescriptor} stored in the file at the specified path. + */ + public static ImageDescriptor getImageDescriptor(String path) { + try { + return ImageDescriptor.createFromURL(new File(path).toURI().toURL()); + } catch (MalformedURLException e) { + return null; + } + } + /** + * Returns an {@link Image} based on the specified {@link ImageDescriptor}. + * + * @param descriptor + * the {@link ImageDescriptor} for the {@link Image}. + * @return the {@link Image} based on the specified {@link ImageDescriptor}. + */ + public static Image getImage(ImageDescriptor descriptor) { + if (descriptor == null) { + return null; + } + Image image = m_descriptorImageMap.get(descriptor); + if (image == null) { + image = descriptor.createImage(); + m_descriptorImageMap.put(descriptor, image); + } + return image; + } + /** + * Maps images to decorated images. + */ + @SuppressWarnings("unchecked") + private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated. + * @param decorator + * the {@link Image} to decorate the base image. + * @return {@link Image} The resulting decorated image. + */ + public static Image decorateImage(Image baseImage, Image decorator) { + return decorateImage(baseImage, decorator, BOTTOM_RIGHT); + } + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated. + * @param decorator + * the {@link Image} to decorate the base image. + * @param corner + * the corner to place decorator image. + * @return the resulting decorated {@link Image}. + */ + public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { + if (corner <= 0 || corner >= LAST_CORNER_KEY) { + throw new IllegalArgumentException("Wrong decorate corner"); + } + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner]; + if (cornerDecoratedImageMap == null) { + cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>(); + m_decoratedImageMap[corner] = cornerDecoratedImageMap; + } + Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage); + if (decoratedMap == null) { + decoratedMap = new HashMap<Image, Image>(); + cornerDecoratedImageMap.put(baseImage, decoratedMap); + } + // + Image result = decoratedMap.get(decorator); + if (result == null) { + final Rectangle bib = baseImage.getBounds(); + final Rectangle dib = decorator.getBounds(); + final Point baseImageSize = new Point(bib.width, bib.height); + CompositeImageDescriptor compositImageDesc = new CompositeImageDescriptor() { + @Override + protected void drawCompositeImage(int width, int height) { + drawImage(baseImage.getImageData(), 0, 0); + if (corner == TOP_LEFT) { + drawImage(decorator.getImageData(), 0, 0); + } else if (corner == TOP_RIGHT) { + drawImage(decorator.getImageData(), bib.width - dib.width, 0); + } else if (corner == BOTTOM_LEFT) { + drawImage(decorator.getImageData(), 0, bib.height - dib.height); + } else if (corner == BOTTOM_RIGHT) { + drawImage(decorator.getImageData(), bib.width - dib.width, bib.height - dib.height); + } + } + @Override + protected Point getSize() { + return baseImageSize; + } + }; + // + result = compositImageDesc.createImage(); + decoratedMap.put(decorator, result); + } + return result; + } + /** + * Dispose all of the cached images. + */ + public static void disposeImages() { + SWTResourceManager.disposeImages(); + // dispose ImageDescriptor images + { + for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();) { + I.next().dispose(); + } + m_descriptorImageMap.clear(); + } + // dispose decorated images + for (int i = 0; i < m_decoratedImageMap.length; i++) { + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; + if (cornerDecoratedImageMap != null) { + for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { + for (Image image : decoratedMap.values()) { + image.dispose(); + } + decoratedMap.clear(); + } + cornerDecoratedImageMap.clear(); + } + } + // dispose plugin images + { + for (Iterator<Image> I = m_URLImageMap.values().iterator(); I.hasNext();) { + I.next().dispose(); + } + m_URLImageMap.clear(); + } + } + //////////////////////////////////////////////////////////////////////////// + // + // Plugin images support + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps URL to images. + */ + private static Map<String, Image> m_URLImageMap = new HashMap<String, Image>(); + /** + * Provider for plugin resources, used by WindowBuilder at design time. + */ + public interface PluginResourceProvider { + URL getEntry(String symbolicName, String path); + } + /** + * Instance of {@link PluginResourceProvider}, used by WindowBuilder at design time. + */ + private static PluginResourceProvider m_designTimePluginResourceProvider = null; + /** + * Returns an {@link Image} based on a plugin and file path. + * + * @param plugin + * the plugin {@link Object} containing the image + * @param name + * the path to the image within the plugin + * @return the {@link Image} stored in the file at the specified path + * + * @deprecated Use {@link #getPluginImage(String, String)} instead. + */ + @Deprecated + public static Image getPluginImage(Object plugin, String name) { + try { + URL url = getPluginImageURL(plugin, name); + if (url != null) { + return getPluginImageFromUrl(url); + } + } catch (Throwable e) { + // Ignore any exceptions + } + return null; + } + /** + * Returns an {@link Image} based on a {@link Bundle} and resource entry path. + * + * @param symbolicName + * the symbolic name of the {@link Bundle}. + * @param path + * the path of the resource entry. + * @return the {@link Image} stored in the file at the specified path. + */ + public static Image getPluginImage(String symbolicName, String path) { + try { + URL url = getPluginImageURL(symbolicName, path); + if (url != null) { + return getPluginImageFromUrl(url); + } + } catch (Throwable e) { + // Ignore any exceptions + } + return null; + } + /** + * Returns an {@link Image} based on given {@link URL}. + */ + private static Image getPluginImageFromUrl(URL url) { + try { + try { + String key = url.toExternalForm(); + Image image = m_URLImageMap.get(key); + if (image == null) { + InputStream stream = url.openStream(); + try { + image = getImage(stream); + m_URLImageMap.put(key, image); + } finally { + stream.close(); + } + } + return image; + } catch (Throwable e) { + // Ignore any exceptions + } + } catch (Throwable e) { + // Ignore any exceptions + } + return null; + } + /** + * Returns an {@link ImageDescriptor} based on a plugin and file path. + * + * @param plugin + * the plugin {@link Object} containing the image. + * @param name + * the path to th eimage within the plugin. + * @return the {@link ImageDescriptor} stored in the file at the specified path. + * + * @deprecated Use {@link #getPluginImageDescriptor(String, String)} instead. + */ + @Deprecated + public static ImageDescriptor getPluginImageDescriptor(Object plugin, String name) { + try { + try { + URL url = getPluginImageURL(plugin, name); + return ImageDescriptor.createFromURL(url); + } catch (Throwable e) { + // Ignore any exceptions + } + } catch (Throwable e) { + // Ignore any exceptions + } + return null; + } + /** + * Returns an {@link ImageDescriptor} based on a {@link Bundle} and resource entry path. + * + * @param symbolicName + * the symbolic name of the {@link Bundle}. + * @param path + * the path of the resource entry. + * @return the {@link ImageDescriptor} based on a {@link Bundle} and resource entry path. + */ + public static ImageDescriptor getPluginImageDescriptor(String symbolicName, String path) { + try { + URL url = getPluginImageURL(symbolicName, path); + if (url != null) { + return ImageDescriptor.createFromURL(url); + } + } catch (Throwable e) { + // Ignore any exceptions + } + return null; + } + /** + * Returns an {@link URL} based on a {@link Bundle} and resource entry path. + */ + private static URL getPluginImageURL(String symbolicName, String path) { + // try runtime plugins + { + Bundle bundle = Platform.getBundle(symbolicName); + if (bundle != null) { + return bundle.getEntry(path); + } + } + // try design time provider + if (m_designTimePluginResourceProvider != null) { + return m_designTimePluginResourceProvider.getEntry(symbolicName, path); + } + // no such resource + return null; + } + /** + * Returns an {@link URL} based on a plugin and file path. + * + * @param plugin + * the plugin {@link Object} containing the file path. + * @param name + * the file path. + * @return the {@link URL} representing the file at the specified path. + * @throws Exception + */ + private static URL getPluginImageURL(Object plugin, String name) throws Exception { + // try to work with 'plugin' as with OSGI BundleContext + try { + Class<?> BundleClass = Class.forName("org.osgi.framework.Bundle"); //$NON-NLS-1$ + Class<?> BundleContextClass = Class.forName("org.osgi.framework.BundleContext"); //$NON-NLS-1$ + if (BundleContextClass.isAssignableFrom(plugin.getClass())) { + Method getBundleMethod = BundleContextClass.getMethod("getBundle", new Class[0]); //$NON-NLS-1$ + Object bundle = getBundleMethod.invoke(plugin, new Object[0]); + // + Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$ + Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class}); + Object path = pathConstructor.newInstance(new Object[]{name}); + // + Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$ + Class<?> PlatformClass = Class.forName("org.eclipse.core.runtime.Platform"); //$NON-NLS-1$ + Method findMethod = PlatformClass.getMethod("find", new Class[]{BundleClass, IPathClass}); //$NON-NLS-1$ + return (URL) findMethod.invoke(null, new Object[]{bundle, path}); + } + } catch (Throwable e) { + // Ignore any exceptions + } + // else work with 'plugin' as with usual Eclipse plugin + { + Class<?> PluginClass = Class.forName("org.eclipse.core.runtime.Plugin"); //$NON-NLS-1$ + if (PluginClass.isAssignableFrom(plugin.getClass())) { + // + Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$ + Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class}); + Object path = pathConstructor.newInstance(new Object[]{name}); + // + Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$ + Method findMethod = PluginClass.getMethod("find", new Class[]{IPathClass}); //$NON-NLS-1$ + return (URL) findMethod.invoke(plugin, new Object[]{path}); + } + } + return null; + } + //////////////////////////////////////////////////////////////////////////// + // + // General + // + //////////////////////////////////////////////////////////////////////////// + /** + * Dispose of cached objects and their underlying OS resources. This should only be called when the cached + * objects are no longer needed (e.g. on application shutdown). + */ + public static void dispose() { + disposeColors(); + disposeFonts(); + disposeImages(); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.gui/src/com/swtdesigner/SWTResourceManager.java b/com.gluster.storage.management.gui/src/com/swtdesigner/SWTResourceManager.java new file mode 100644 index 00000000..ef062c0b --- /dev/null +++ b/com.gluster.storage.management.gui/src/com/swtdesigner/SWTResourceManager.java @@ -0,0 +1,437 @@ +package com.swtdesigner; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Display; + +/** + * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. + * <p> + * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the + * operating system resources managed by cached objects when those objects and OS resources are no longer + * needed (e.g. on application shutdown) + * <p> + * This class may be freely distributed as part of any application or plugin. + * <p> + * @author scheglov_ke + * @author Dan Rubel + */ +public class SWTResourceManager { + //////////////////////////////////////////////////////////////////////////// + // + // Color + // + //////////////////////////////////////////////////////////////////////////// + private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>(); + /** + * Returns the system {@link Color} matching the specific ID. + * + * @param systemColorID + * the ID value for the color + * @return the system {@link Color} matching the specific ID + */ + public static Color getColor(int systemColorID) { + Display display = Display.getCurrent(); + return display.getSystemColor(systemColorID); + } + /** + * Returns a {@link Color} given its red, green and blue component values. + * + * @param r + * the red component of the color + * @param g + * the green component of the color + * @param b + * the blue component of the color + * @return the {@link Color} matching the given red, green and blue component values + */ + public static Color getColor(int r, int g, int b) { + return getColor(new RGB(r, g, b)); + } + /** + * Returns a {@link Color} given its RGB value. + * + * @param rgb + * the {@link RGB} value of the color + * @return the {@link Color} matching the RGB value + */ + public static Color getColor(RGB rgb) { + Color color = m_colorMap.get(rgb); + if (color == null) { + Display display = Display.getCurrent(); + color = new Color(display, rgb); + m_colorMap.put(rgb, color); + } + return color; + } + /** + * Dispose of all the cached {@link Color}'s. + */ + public static void disposeColors() { + for (Color color : m_colorMap.values()) { + color.dispose(); + } + m_colorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Image + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps image paths to images. + */ + private static Map<String, Image> m_imageMap = new HashMap<String, Image>(); + /** + * Returns an {@link Image} encoded by the specified {@link InputStream}. + * + * @param stream + * the {@link InputStream} encoding the image data + * @return the {@link Image} encoded by the specified input stream + */ + protected static Image getImage(InputStream stream) throws IOException { + try { + Display display = Display.getCurrent(); + ImageData data = new ImageData(stream); + if (data.transparentPixel > 0) { + return new Image(display, data, data.getTransparencyMask()); + } + return new Image(display, data); + } finally { + stream.close(); + } + } + /** + * Returns an {@link Image} stored in the file at the specified path. + * + * @param path + * the path to the image file + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(String path) { + Image image = m_imageMap.get(path); + if (image == null) { + try { + image = getImage(new FileInputStream(path)); + m_imageMap.put(path, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(path, image); + } + } + return image; + } + /** + * Returns an {@link Image} stored in the file at the specified path relative to the specified class. + * + * @param clazz + * the {@link Class} relative to which to find the image + * @param path + * the path to the image file, if starts with <code>'/'</code> + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(Class<?> clazz, String path) { + String key = clazz.getName() + '|' + path; + Image image = m_imageMap.get(key); + if (image == null) { + try { + image = getImage(clazz.getResourceAsStream(path)); + m_imageMap.put(key, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(key, image); + } + } + return image; + } + private static final int MISSING_IMAGE_SIZE = 10; + /** + * @return the small {@link Image} that can be used as placeholder for missing image. + */ + private static Image getMissingImage() { + Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + // + GC gc = new GC(image); + gc.setBackground(getColor(SWT.COLOR_RED)); + gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + gc.dispose(); + // + return image; + } + /** + * Style constant for placing decorator image in top left corner of base image. + */ + public static final int TOP_LEFT = 1; + /** + * Style constant for placing decorator image in top right corner of base image. + */ + public static final int TOP_RIGHT = 2; + /** + * Style constant for placing decorator image in bottom left corner of base image. + */ + public static final int BOTTOM_LEFT = 3; + /** + * Style constant for placing decorator image in bottom right corner of base image. + */ + public static final int BOTTOM_RIGHT = 4; + /** + * Internal value. + */ + protected static final int LAST_CORNER_KEY = 5; + /** + * Maps images to decorated images. + */ + @SuppressWarnings("unchecked") + private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @return {@link Image} The resulting decorated image + */ + public static Image decorateImage(Image baseImage, Image decorator) { + return decorateImage(baseImage, decorator, BOTTOM_RIGHT); + } + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @param corner + * the corner to place decorator image + * @return the resulting decorated {@link Image} + */ + public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { + if (corner <= 0 || corner >= LAST_CORNER_KEY) { + throw new IllegalArgumentException("Wrong decorate corner"); + } + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner]; + if (cornerDecoratedImageMap == null) { + cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>(); + m_decoratedImageMap[corner] = cornerDecoratedImageMap; + } + Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage); + if (decoratedMap == null) { + decoratedMap = new HashMap<Image, Image>(); + cornerDecoratedImageMap.put(baseImage, decoratedMap); + } + // + Image result = decoratedMap.get(decorator); + if (result == null) { + Rectangle bib = baseImage.getBounds(); + Rectangle dib = decorator.getBounds(); + // + result = new Image(Display.getCurrent(), bib.width, bib.height); + // + GC gc = new GC(result); + gc.drawImage(baseImage, 0, 0); + if (corner == TOP_LEFT) { + gc.drawImage(decorator, 0, 0); + } else if (corner == TOP_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, 0); + } else if (corner == BOTTOM_LEFT) { + gc.drawImage(decorator, 0, bib.height - dib.height); + } else if (corner == BOTTOM_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); + } + gc.dispose(); + // + decoratedMap.put(decorator, result); + } + return result; + } + /** + * Dispose all of the cached {@link Image}'s. + */ + public static void disposeImages() { + // dispose loaded images + { + for (Image image : m_imageMap.values()) { + image.dispose(); + } + m_imageMap.clear(); + } + // dispose decorated images + for (int i = 0; i < m_decoratedImageMap.length; i++) { + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; + if (cornerDecoratedImageMap != null) { + for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { + for (Image image : decoratedMap.values()) { + image.dispose(); + } + decoratedMap.clear(); + } + cornerDecoratedImageMap.clear(); + } + } + } + //////////////////////////////////////////////////////////////////////////// + // + // Font + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps font names to fonts. + */ + private static Map<String, Font> m_fontMap = new HashMap<String, Font>(); + /** + * Maps fonts to their bold versions. + */ + private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>(); + /** + * Returns a {@link Font} based on its name, height and style. + * + * @param name + * the name of the font + * @param height + * the height of the font + * @param style + * the style of the font + * @return {@link Font} The font matching the name, height and style + */ + public static Font getFont(String name, int height, int style) { + return getFont(name, height, style, false, false); + } + /** + * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline + * flags are also supported. + * + * @param name + * the name of the font + * @param size + * the size of the font + * @param style + * the style of the font + * @param strikeout + * the strikeout flag (warning: Windows only) + * @param underline + * the underline flag (warning: Windows only) + * @return {@link Font} The font matching the name, height, style, strikeout and underline + */ + public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { + String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; + Font font = m_fontMap.get(fontName); + if (font == null) { + FontData fontData = new FontData(name, size, style); + if (strikeout || underline) { + try { + Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ + Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ + if (logFont != null && logFontClass != null) { + if (strikeout) { + logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + if (underline) { + logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + } + } catch (Throwable e) { + System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + font = new Font(Display.getCurrent(), fontData); + m_fontMap.put(fontName, font); + } + return font; + } + /** + * Returns a bold version of the given {@link Font}. + * + * @param baseFont + * the {@link Font} for which a bold version is desired + * @return the bold version of the given {@link Font} + */ + public static Font getBoldFont(Font baseFont) { + Font font = m_fontToBoldFontMap.get(baseFont); + if (font == null) { + FontData fontDatas[] = baseFont.getFontData(); + FontData data = fontDatas[0]; + font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); + m_fontToBoldFontMap.put(baseFont, font); + } + return font; + } + /** + * Dispose all of the cached {@link Font}'s. + */ + public static void disposeFonts() { + // clear fonts + for (Font font : m_fontMap.values()) { + font.dispose(); + } + m_fontMap.clear(); + // clear bold fonts + for (Font font : m_fontToBoldFontMap.values()) { + font.dispose(); + } + m_fontToBoldFontMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Cursor + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps IDs to cursors. + */ + private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>(); + /** + * Returns the system cursor matching the specific ID. + * + * @param id + * int The ID value for the cursor + * @return Cursor The system cursor matching the specific ID + */ + public static Cursor getCursor(int id) { + Integer key = Integer.valueOf(id); + Cursor cursor = m_idToCursorMap.get(key); + if (cursor == null) { + cursor = new Cursor(Display.getDefault(), id); + m_idToCursorMap.put(key, cursor); + } + return cursor; + } + /** + * Dispose all of the cached cursors. + */ + public static void disposeCursors() { + for (Cursor cursor : m_idToCursorMap.values()) { + cursor.dispose(); + } + m_idToCursorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // General + // + //////////////////////////////////////////////////////////////////////////// + /** + * Dispose of cached objects and their underlying OS resources. This should only be called when the cached + * objects are no longer needed (e.g. on application shutdown). + */ + public static void dispose() { + disposeColors(); + disposeImages(); + disposeFonts(); + disposeCursors(); + } +}
\ No newline at end of file diff --git a/com.gluster.storage.management.server/.classpath b/com.gluster.storage.management.server/.classpath new file mode 100644 index 00000000..c96b5783 --- /dev/null +++ b/com.gluster.storage.management.server/.classpath @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_23"> + <attributes> + <attribute name="owner.project.facets" value="java"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0"> + <attributes> + <attribute name="owner.project.facets" value="jst.web"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> + <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> + <classpathentry combineaccessrules="false" kind="src" path="/com.gluster.storage.management.core"/> + <classpathentry kind="output" path="WebContent/WEB-INF/classes"/> +</classpath> diff --git a/com.gluster.storage.management.server/.project b/com.gluster.storage.management.server/.project new file mode 100644 index 00000000..cb36e33f --- /dev/null +++ b/com.gluster.storage.management.server/.project @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.gluster.storage.management.server</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.jsdt.core.jsNature</nature> + </natures> +</projectDescription> diff --git a/com.gluster.storage.management.server/.settings/.jsdtscope b/com.gluster.storage.management.server/.settings/.jsdtscope new file mode 100644 index 00000000..3a28de0c --- /dev/null +++ b/com.gluster.storage.management.server/.settings/.jsdtscope @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="WebContent"/> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> + <attributes> + <attribute name="hide" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> + <classpathentry kind="output" path=""/> +</classpath> diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.jdt.core.prefs b/com.gluster.storage.management.server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..476db350 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Dec 29 14:57:23 IST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.ltk.core.refactoring.prefs b/com.gluster.storage.management.server/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 00000000..5d9c71b6 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Mon Jan 31 15:29:36 IST 2011 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.component b/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.component new file mode 100644 index 00000000..bb2eaf45 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.component @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-modules id="moduleCoreId" project-version="1.5.0"> + <wb-module deploy-name="com.gluster.storage.management.server"> + <wb-resource deploy-path="/" source-path="/WebContent"/> + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/> + <property name="java-output-path" value="/com.gluster.storage.management.server/build/classes"/> + <property name="context-root" value="glustermc"/> + </wb-module> +</project-modules> diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.project.facet.core.xml b/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 00000000..307f3bb7 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<faceted-project> + <runtime name="Apache Tomcat v7.0"/> + <fixed facet="wst.jsdt.web"/> + <fixed facet="jst.web"/> + <fixed facet="java"/> + <installed facet="java" version="1.6"/> + <installed facet="jst.web" version="3.0"/> + <installed facet="wst.jsdt.web" version="1.0"/> +</faceted-project> diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.container b/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 00000000..3bd5d0a4 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.name b/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 00000000..05bd71b6 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window
\ No newline at end of file diff --git a/com.gluster.storage.management.server/.settings/org.eclipse.wst.ws.service.policy.prefs b/com.gluster.storage.management.server/.settings/org.eclipse.wst.ws.service.policy.prefs new file mode 100644 index 00000000..e5ca6272 --- /dev/null +++ b/com.gluster.storage.management.server/.settings/org.eclipse.wst.ws.service.policy.prefs @@ -0,0 +1,3 @@ +#Mon Jan 31 15:29:36 IST 2011 +eclipse.preferences.version=1 +org.eclipse.wst.ws.service.policy.projectEnabled=false diff --git a/com.gluster.storage.management.server/WebContent/META-INF/MANIFEST.MF b/com.gluster.storage.management.server/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0
+Class-Path:
+
diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/asm-3.1.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/asm-3.1.jar Binary files differnew file mode 100644 index 00000000..8217cae0 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/asm-3.1.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/com.gluster.storage.management.core_1.0.0.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/com.gluster.storage.management.core_1.0.0.jar Binary files differnew file mode 100644 index 00000000..2f689843 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/com.gluster.storage.management.core_1.0.0.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-core-asl-1.5.5.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-core-asl-1.5.5.jar Binary files differnew file mode 100644 index 00000000..a3248188 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-core-asl-1.5.5.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-jaxrs-1.5.5.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-jaxrs-1.5.5.jar Binary files differnew file mode 100644 index 00000000..faf12cf6 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-jaxrs-1.5.5.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-mapper-asl-1.5.5.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-mapper-asl-1.5.5.jar Binary files differnew file mode 100644 index 00000000..ca612580 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-mapper-asl-1.5.5.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-xc-1.5.5.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-xc-1.5.5.jar Binary files differnew file mode 100644 index 00000000..57c2c670 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jackson-xc-1.5.5.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-client-1.4.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-client-1.4.jar Binary files differnew file mode 100644 index 00000000..e7debb0f --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-client-1.4.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-core-1.4.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-core-1.4.jar Binary files differnew file mode 100644 index 00000000..ae78fe33 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-core-1.4.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-json-1.4.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-json-1.4.jar Binary files differnew file mode 100644 index 00000000..78c14c1b --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-json-1.4.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-server-1.4.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-server-1.4.jar Binary files differnew file mode 100644 index 00000000..c420a6d8 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jersey-server-1.4.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jettison-1.1.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jettison-1.1.jar Binary files differnew file mode 100644 index 00000000..e4e9c8c3 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jettison-1.1.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jsr311-api-1.1.1.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jsr311-api-1.1.1.jar Binary files differnew file mode 100644 index 00000000..ec8bc818 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/jsr311-api-1.1.1.jar diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/web.xml b/com.gluster.storage.management.server/WebContent/WEB-INF/web.xml new file mode 100644 index 00000000..36d65880 --- /dev/null +++ b/com.gluster.storage.management.server/WebContent/WEB-INF/web.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> + <display-name>com.gluster.storage.management.server</display-name> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + <welcome-file>index.htm</welcome-file> + <welcome-file>index.jsp</welcome-file> + <welcome-file>default.html</welcome-file> + <welcome-file>default.htm</welcome-file> + <welcome-file>default.jsp</welcome-file> + </welcome-file-list> + <servlet> + <servlet-name>Jersey REST Service</servlet-name> + <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> + <init-param> + <param-name>com.sun.jersey.config.property.packages</param-name> + <param-value>com.gluster.storage.management.server.services</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>Jersey REST Service</servlet-name> + <url-pattern>/services/*</url-pattern> + </servlet-mapping> +</web-app>
\ No newline at end of file diff --git a/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/AuthManager.java b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/AuthManager.java new file mode 100644 index 00000000..5dc4fdcf --- /dev/null +++ b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/AuthManager.java @@ -0,0 +1,63 @@ +package com.gluster.storage.management.server.services; + +import java.io.File; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Request; + +import com.gluster.storage.management.core.model.AuthStatus; +import com.gluster.storage.management.core.utils.FileUtil; +import com.gluster.storage.management.core.utils.MD5Crypt; +import com.gluster.storage.management.core.utils.ProcessResult; +import com.gluster.storage.management.core.utils.ProcessUtil; + +import com.sun.jersey.spi.container.ContainerRequest; + +@Path("/login") +public class AuthManager { + @Context + private Request request; + + /** + * Authenticates given user with given password for login on current system + * @param user + * @param password + * @return true is user can be successfully authenticated using given password, else false + */ + private boolean authenticate(String user, String password) { + String tmpFileName = "tmp"; + File saltFile = new File(tmpFileName); + ProcessResult result = new ProcessUtil().executeCommand("get-user-password.py", user, tmpFileName); + if (result.isSuccess()) { + String salt = new FileUtil().readFileAsString(saltFile); + String encryptedPassword = MD5Crypt.crypt(password, salt); + return encryptedPassword.equals(salt); + } + + return false; + } + + @GET + @Produces(MediaType.TEXT_XML) + public AuthStatus login() { + String user = null; + String password = null; + + if (request instanceof ContainerRequest) { + ContainerRequest containerRequest = (ContainerRequest) request; + MultivaluedMap<String, String> paramsMap = containerRequest.getQueryParameters(); + user = paramsMap.get("user").get(0); + password = paramsMap.get("password").get(0); + } + + AuthStatus authStatus = new AuthStatus(); + authStatus.setIsAuthenticated(authenticate(user, password)); + + return authStatus; + } +} diff --git a/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/Hello.java b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/Hello.java new file mode 100644 index 00000000..eea0a36f --- /dev/null +++ b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/services/Hello.java @@ -0,0 +1,32 @@ +package com.gluster.storage.management.server.services; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +//Sets the path to base URL + /hello +@Path("/hello") +public class Hello { + // This method is called if TEXT_PLAIN is request + @GET + @Produces(MediaType.TEXT_PLAIN) + public String sayPlainTextHello() { + return "Hello Jersey"; + } + + // This method is called if XMLis request + @GET + @Produces(MediaType.TEXT_XML) + public String sayXMLHello() { + return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>"; + } + + // This method is called if HTML is request + @GET + @Produces(MediaType.TEXT_HTML) + public String sayHtmlHello() { + return "<html> " + "<title>" + "Hello Jersey" + "</title>" + + "<body><h1>" + "Hello Jersey" + "</body></h1>" + "</html> "; + } +} diff --git a/com.sun.jersey/.classpath b/com.sun.jersey/.classpath new file mode 100644 index 00000000..f2d41466 --- /dev/null +++ b/com.sun.jersey/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry exported="true" kind="lib" path=""/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/com.sun.jersey/.project b/com.sun.jersey/.project new file mode 100644 index 00000000..52ec5691 --- /dev/null +++ b/com.sun.jersey/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>com.sun.jersey</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/com.sun.jersey/.settings/org.eclipse.jdt.core.prefs b/com.sun.jersey/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..1a662ced --- /dev/null +++ b/com.sun.jersey/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Dec 29 17:39:49 IST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.sun.jersey/META-INF/MANIFEST.MF b/com.sun.jersey/META-INF/MANIFEST.MF new file mode 100644 index 00000000..f3868345 --- /dev/null +++ b/com.sun.jersey/META-INF/MANIFEST.MF @@ -0,0 +1,42 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Jersey +Bundle-SymbolicName: com.sun.jersey +Bundle-Version: 1.4 +Bundle-Vendor: Oracle Corporation +Export-Package: com.sun.jersey.api.client, + com.sun.jersey.api.client.async, + com.sun.jersey.api.client.config, + com.sun.jersey.api.client.filter, + com.sun.jersey.api.representation, + com.sun.jersey.api.uri, + com.sun.jersey.client.impl, + com.sun.jersey.client.impl.async, + com.sun.jersey.client.osgi, + com.sun.jersey.client.proxy, + com.sun.jersey.client.urlconnection, + com.sun.jersey.core.header, + com.sun.jersey.core.header.reader, + com.sun.jersey.core.impl.provider.entity, + com.sun.jersey.core.impl.provider.header, + com.sun.jersey.core.impl.provider.xml, + com.sun.jersey.core.osgi, + com.sun.jersey.core.provider, + com.sun.jersey.core.provider.jaxb, + com.sun.jersey.core.reflection, + com.sun.jersey.core.spi.component, + com.sun.jersey.core.spi.component.ioc, + com.sun.jersey.core.spi.factory, + com.sun.jersey.core.spi.scanning, + com.sun.jersey.core.spi.scanning.uri, + com.sun.jersey.core.util, + com.sun.jersey.impl, + com.sun.jersey.localization, + com.sun.jersey.spi, + com.sun.jersey.spi.inject, + com.sun.jersey.spi.service, + com.sun.ws.rs.ext, + javax.ws.rs, + javax.ws.rs.core, + javax.ws.rs.ext +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/com.sun.jersey/META-INF/jersey-module-version b/com.sun.jersey/META-INF/jersey-module-version new file mode 100644 index 00000000..c068b244 --- /dev/null +++ b/com.sun.jersey/META-INF/jersey-module-version @@ -0,0 +1 @@ +1.4 diff --git a/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.properties b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.properties new file mode 100644 index 00000000..68b426b4 --- /dev/null +++ b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Sat Sep 11 22:30:48 CEST 2010 +version=1.4 +groupId=com.sun.jersey +artifactId=jersey-client diff --git a/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.xml b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.xml new file mode 100644 index 00000000..7ff98886 --- /dev/null +++ b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-client/pom.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + + The contents of this file are subject to the terms of either the GNU + General Public License Version 2 only ("GPL") or the Common Development + and Distribution License("CDDL") (collectively, the "License"). You + may not use this file except in compliance with the License. You can + obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + or packager/legal/LICENSE.txt. See the License for the specific + language governing permissions and limitations under the License. + + When distributing the software, include this License Header Notice in each + file and include the License file at packager/legal/LICENSE.txt. + + GPL Classpath Exception: + Oracle designates this particular file as subject to the "Classpath" + exception as provided by Oracle in the GPL Version 2 section of the License + file that accompanied this code. + + Modifications: + If applicable, add the following below the License Header, with the fields + enclosed by brackets [] replaced by your own identifying information: + "Portions Copyright [year] [name of copyright owner]" + + Contributor(s): + If you wish your version of this file to be governed by only the CDDL or + only the GPL Version 2, indicate your decision by adding "[Contributor] + elects to include this software in this distribution under the [CDDL or GPL + Version 2] license." If you don't indicate a single choice of license, a + recipient has the option to distribute your version of this file under + either the CDDL, the GPL Version 2 or to extend the choice of license to + its licensees as provided above. However, if you add GPL Version 2 code + and therefore, elected the GPL Version 2 license, then the option applies + only if the new code is made subject to such option by the copyright + holder. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-project</artifactId> + <version>1.4</version> + </parent> + <artifactId>jersey-client</artifactId> + <packaging>bundle</packaging> + <name>jersey-client</name> + + <dependencies> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.sun.net.httpserver</groupId> + <artifactId>http</artifactId> + <version>20070405</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>osgi_R4_core</artifactId> + <version>1.0</version> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-Activator>com.sun.jersey.client.osgi.Activator</Bundle-Activator> + <Import-Package>javax.mail.*;resolution:=optional, *</Import-Package> + <Private-Package>com.sun.jersey.client.osgi</Private-Package> + <Export-Package>com.sun.jersey.api.client.*,com.sun.jersey.client.*,com.sun.ws.rs.ext</Export-Package> + </instructions> + <unpackBundle>true</unpackBundle> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <links> + <link>https://jsr311.dev.java.net/nonav/releases/1.1</link> + </links> + <excludePackageNames>com.sun.jersey.client.impl com.sun.ws.rs.ex</excludePackageNames> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + </plugin> + + </plugins> + </build> +</project> + diff --git a/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.properties b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.properties new file mode 100644 index 00000000..9da26862 --- /dev/null +++ b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.properties @@ -0,0 +1,5 @@ +#Generated by org.apache.felix.bundleplugin +#Sat Sep 11 22:29:29 CEST 2010 +version=1.4 +groupId=com.sun.jersey +artifactId=jersey-core diff --git a/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.xml b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.xml new file mode 100644 index 00000000..c20ad376 --- /dev/null +++ b/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-core/pom.xml @@ -0,0 +1,228 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. + + The contents of this file are subject to the terms of either the GNU + General Public License Version 2 only ("GPL") or the Common Development + and Distribution License("CDDL") (collectively, the "License"). You + may not use this file except in compliance with the License. You can + obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + or packager/legal/LICENSE.txt. See the License for the specific + language governing permissions and limitations under the License. + + When distributing the software, include this License Header Notice in each + file and include the License file at packager/legal/LICENSE.txt. + + GPL Classpath Exception: + Oracle designates this particular file as subject to the "Classpath" + exception as provided by Oracle in the GPL Version 2 section of the License + file that accompanied this code. + + Modifications: + If applicable, add the following below the License Header, with the fields + enclosed by brackets [] replaced by your own identifying information: + "Portions Copyright [year] [name of copyright owner]" + + Contributor(s): + If you wish your version of this file to be governed by only the CDDL or + only the GPL Version 2, indicate your decision by adding "[Contributor] + elects to include this software in this distribution under the [CDDL or GPL + Version 2] license." If you don't indicate a single choice of license, a + recipient has the option to distribute your version of this file under + either the CDDL, the GPL Version 2 or to extend the choice of license to + its licensees as provided above. However, if you add GPL Version 2 code + and therefore, elected the GPL Version 2 license, then the option applies + only if the new code is made subject to such option by the copyright + holder. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-project</artifactId> + <version>1.4</version> + </parent> + <artifactId>jersey-core</artifactId> + <packaging>bundle</packaging> + <name>jersey-core</name> + <dependencies> + <dependency> + <groupId>javax.ws.rs</groupId> + <artifactId>jsr311-api</artifactId> + <version>1.1.1</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>osgi_R4_core</artifactId> + <version>1.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + + <resources> + <resource> + <directory>${basedir}/src/main/resources</directory> + </resource> + <resource> + <directory>${basedir}/src/main/java</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>${project.build.directory}/generated-sources/rsrc-gen</source> + <source>${project.build.directory}/generated-sources/jsr311</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> <!-- unpack sources from jsr311-api.jar --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>unpack</id> + <phase>generate-sources</phase> + <goals> + <goal>unpack</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>javax.ws.rs</groupId> + <artifactId>jsr311-api</artifactId> + <version>1.1.1</version> + <type>jar</type> + <classifier>sources</classifier> + <overWrite>false</overWrite> + <outputDirectory>${project.build.directory}/generated-sources/jsr311</outputDirectory> + <!--excludes> + **/CacheControl.java, + **/Cookie.java, + **/EntityTag.java, + **/MediaType.java, + **/NewCookie.java, + **/Variant.java, + **/Response.java, + **/UriBuilder.java + </excludes--> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + + + <plugin> + <groupId>com.sun.istack</groupId> + <artifactId>maven-istack-commons-plugin</artifactId> + <version>0.1</version> + <executions> + <execution> + <phase>generate-sources</phase> + <configuration> + <resources> + <directory>${basedir}/src/main/resources</directory> + <includes> + <include>**/*.properties</include> + </includes> + </resources> + <destDir>${project.build.directory}/generated-sources/rsrc-gen</destDir> + <localizationUtilitiesPkgName>com.sun.jersey.localization</localizationUtilitiesPkgName> + </configuration> + <goals> + <goal>rs-gen</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Export-Package>javax.ws.rs.*;-split-package:=merge-first,com.sun.jersey.*;-split-package:=merge-first</Export-Package> + <Import-Package>!javax.ws.rs.*,javax.mail.*;resolution:=optional, *</Import-Package> + <DynamicImport-Package>*</DynamicImport-Package> + <Private-Package>com.sun.jersey.core.osgi;-split-package:=merge-first</Private-Package> + <Bundle-Activator>com.sun.jersey.core.osgi.Activator</Bundle-Activator> + <Implementation-Title>jersey-core osgi</Implementation-Title> + <Implementation-Version>${project.version}</Implementation-Version> + <!--Embed-Dependency>jsr311-api;inline=true</Embed-Dependency--> + </instructions> + <unpackBundle>true</unpackBundle> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <links> + <link>https://jsr311.dev.java.net/nonav/releases/1.1</link> + </links> + <excludePackageNames>com.sun.jersey.core.impl:com.sun.jersey.impl</excludePackageNames> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + </plugin> + </plugins> + + </build> + +</project> diff --git a/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider b/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider new file mode 100644 index 00000000..4905c35f --- /dev/null +++ b/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider @@ -0,0 +1,9 @@ +com.sun.jersey.core.impl.provider.header.LocaleProvider +com.sun.jersey.core.impl.provider.header.EntityTagProvider +com.sun.jersey.core.impl.provider.header.MediaTypeProvider +com.sun.jersey.core.impl.provider.header.CacheControlProvider +com.sun.jersey.core.impl.provider.header.NewCookieProvider +com.sun.jersey.core.impl.provider.header.CookieProvider +com.sun.jersey.core.impl.provider.header.URIProvider +com.sun.jersey.core.impl.provider.header.DateProvider +com.sun.jersey.core.impl.provider.header.StringProvider diff --git a/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider b/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider new file mode 100644 index 00000000..c5ee8c2a --- /dev/null +++ b/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider @@ -0,0 +1,5 @@ +com.sun.jersey.core.impl.provider.xml.SAXParserContextProvider +com.sun.jersey.core.impl.provider.xml.XMLStreamReaderContextProvider +com.sun.jersey.core.impl.provider.xml.DocumentBuilderFactoryProvider +com.sun.jersey.core.impl.provider.xml.TransformerFactoryProvider + diff --git a/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader b/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader new file mode 100644 index 00000000..6114deff --- /dev/null +++ b/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader @@ -0,0 +1,27 @@ +com.sun.jersey.core.impl.provider.entity.StringProvider +com.sun.jersey.core.impl.provider.entity.ByteArrayProvider +com.sun.jersey.core.impl.provider.entity.FileProvider +com.sun.jersey.core.impl.provider.entity.InputStreamProvider +com.sun.jersey.core.impl.provider.entity.DataSourceProvider +com.sun.jersey.core.impl.provider.entity.RenderedImageProvider +com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider +com.sun.jersey.core.impl.provider.entity.FormProvider +com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General +com.sun.jersey.core.impl.provider.entity.ReaderProvider +com.sun.jersey.core.impl.provider.entity.DocumentProvider +com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader +com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader +com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader +com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$App +com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General +com.sun.jersey.core.impl.provider.entity.EntityHolderReader
\ No newline at end of file diff --git a/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter b/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter new file mode 100644 index 00000000..b0c37ec0 --- /dev/null +++ b/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter @@ -0,0 +1,22 @@ +com.sun.jersey.core.impl.provider.entity.StringProvider +com.sun.jersey.core.impl.provider.entity.ByteArrayProvider +com.sun.jersey.core.impl.provider.entity.FileProvider +com.sun.jersey.core.impl.provider.entity.InputStreamProvider +com.sun.jersey.core.impl.provider.entity.DataSourceProvider +com.sun.jersey.core.impl.provider.entity.RenderedImageProvider +com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider +com.sun.jersey.core.impl.provider.entity.FormProvider +com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text +com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General +com.sun.jersey.core.impl.provider.entity.ReaderProvider +com.sun.jersey.core.impl.provider.entity.DocumentProvider +com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider +com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter diff --git a/com.sun.jersey/build.properties b/com.sun.jersey/build.properties new file mode 100644 index 00000000..3a57c6a1 --- /dev/null +++ b/com.sun.jersey/build.properties @@ -0,0 +1,5 @@ +bin.includes = META-INF/,\ + javax/,\ + com/ +src.includes = com/,\ + javax/ diff --git a/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class b/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class Binary files differnew file mode 100644 index 00000000..58600b29 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class Binary files differnew file mode 100644 index 00000000..ba910086 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class Binary files differnew file mode 100644 index 00000000..50c441fb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class Binary files differnew file mode 100644 index 00000000..34988f43 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class Binary files differnew file mode 100644 index 00000000..3313c289 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class Binary files differnew file mode 100644 index 00000000..816c08ed --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class Binary files differnew file mode 100644 index 00000000..aaa12e92 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class Binary files differnew file mode 100644 index 00000000..03fa1179 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class Binary files differnew file mode 100644 index 00000000..4a24ec32 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class Binary files differnew file mode 100644 index 00000000..b5385c6c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class Binary files differnew file mode 100644 index 00000000..25ad096c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class Binary files differnew file mode 100644 index 00000000..157736c1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class Binary files differnew file mode 100644 index 00000000..77f5e26d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class Binary files differnew file mode 100644 index 00000000..11acbc18 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class Binary files differnew file mode 100644 index 00000000..c2506447 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$1.class b/com.sun.jersey/com/sun/jersey/api/client/Client$1.class Binary files differnew file mode 100644 index 00000000..5184a639 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$2.class b/com.sun.jersey/com/sun/jersey/api/client/Client$2.class Binary files differnew file mode 100644 index 00000000..98e7ff31 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$2.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$3.class b/com.sun.jersey/com/sun/jersey/api/client/Client$3.class Binary files differnew file mode 100644 index 00000000..079970d2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$3.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class b/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class Binary files differnew file mode 100644 index 00000000..c035f7fc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$4.class b/com.sun.jersey/com/sun/jersey/api/client/Client$4.class Binary files differnew file mode 100644 index 00000000..56291979 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$4.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class b/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class Binary files differnew file mode 100644 index 00000000..4ce999d3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class b/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class Binary files differnew file mode 100644 index 00000000..7c855aef --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class b/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class Binary files differnew file mode 100644 index 00000000..f4e095e2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/Client.class b/com.sun.jersey/com/sun/jersey/api/client/Client.class Binary files differnew file mode 100644 index 00000000..017e5349 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/Client.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class b/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class Binary files differnew file mode 100644 index 00000000..a3b061a9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class b/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class Binary files differnew file mode 100644 index 00000000..5c57825b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class b/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class Binary files differnew file mode 100644 index 00000000..f8927dbe --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class b/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class Binary files differnew file mode 100644 index 00000000..9664cc52 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class b/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class Binary files differnew file mode 100644 index 00000000..19fff847 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class b/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class Binary files differnew file mode 100644 index 00000000..90325dd7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class b/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class Binary files differnew file mode 100644 index 00000000..85204320 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class b/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class Binary files differnew file mode 100644 index 00000000..d225437f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class b/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class Binary files differnew file mode 100644 index 00000000..29f9e7b2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/GenericType.class b/com.sun.jersey/com/sun/jersey/api/client/GenericType.class Binary files differnew file mode 100644 index 00000000..8b7d80a0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/GenericType.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class b/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class Binary files differnew file mode 100644 index 00000000..b07f52ec --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class b/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class Binary files differnew file mode 100644 index 00000000..d434306b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter.class b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter.class Binary files differnew file mode 100644 index 00000000..fa11491d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterImpl.class b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterImpl.class Binary files differnew file mode 100644 index 00000000..2cca85df --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterImpl.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterListener.class b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterListener.class Binary files differnew file mode 100644 index 00000000..6ae5c5a6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler$RequestEntityWriterListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class Binary files differnew file mode 100644 index 00000000..20b29cf5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class b/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class Binary files differnew file mode 100644 index 00000000..b1b32877 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class b/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class Binary files differnew file mode 100644 index 00000000..b5b0f394 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class b/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class Binary files differnew file mode 100644 index 00000000..e35384ea --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class b/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class Binary files differnew file mode 100644 index 00000000..4a341092 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class b/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class Binary files differnew file mode 100644 index 00000000..e486e807 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class b/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class Binary files differnew file mode 100644 index 00000000..8f5fc486 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class b/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class Binary files differnew file mode 100644 index 00000000..1d7753ef --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class b/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class Binary files differnew file mode 100644 index 00000000..00ac95f6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/WebResource.class b/com.sun.jersey/com/sun/jersey/api/client/WebResource.class Binary files differnew file mode 100644 index 00000000..68c83842 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/WebResource.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class b/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class Binary files differnew file mode 100644 index 00000000..fb0d557e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class b/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class Binary files differnew file mode 100644 index 00000000..bb7c1c8b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class b/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class Binary files differnew file mode 100644 index 00000000..9d0b7114 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class b/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class Binary files differnew file mode 100644 index 00000000..f7b637e3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class b/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class Binary files differnew file mode 100644 index 00000000..fb3c0922 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class b/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class Binary files differnew file mode 100644 index 00000000..fd317ee3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class b/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class Binary files differnew file mode 100644 index 00000000..0ead0638 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class Binary files differnew file mode 100644 index 00000000..227adcfe --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class Binary files differnew file mode 100644 index 00000000..fefeafea --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class Binary files differnew file mode 100644 index 00000000..9233191b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class Binary files differnew file mode 100644 index 00000000..da67a440 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class Binary files differnew file mode 100644 index 00000000..f64d3ee0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class b/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class Binary files differnew file mode 100644 index 00000000..0d2d37e4 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class Binary files differnew file mode 100644 index 00000000..b568fb69 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class Binary files differnew file mode 100644 index 00000000..221ca517 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class Binary files differnew file mode 100644 index 00000000..d751a0e9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class Binary files differnew file mode 100644 index 00000000..79388ed9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class Binary files differnew file mode 100644 index 00000000..974266d7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class Binary files differnew file mode 100644 index 00000000..a6f0f719 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class Binary files differnew file mode 100644 index 00000000..be24d956 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class Binary files differnew file mode 100644 index 00000000..1da802fb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class Binary files differnew file mode 100644 index 00000000..1c045865 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class Binary files differnew file mode 100644 index 00000000..ba2088d1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class b/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class Binary files differnew file mode 100644 index 00000000..32b184cf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class Binary files differnew file mode 100644 index 00000000..89deca30 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class diff --git a/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class b/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class Binary files differnew file mode 100644 index 00000000..64ee817a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class diff --git a/com.sun.jersey/com/sun/jersey/api/representation/Form.class b/com.sun.jersey/com/sun/jersey/api/representation/Form.class Binary files differnew file mode 100644 index 00000000..f99d09cb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/representation/Form.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class b/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class Binary files differnew file mode 100644 index 00000000..c867dded --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class Binary files differnew file mode 100644 index 00000000..f35618b7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class Binary files differnew file mode 100644 index 00000000..79ea23fe --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class Binary files differnew file mode 100644 index 00000000..c63c7355 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class Binary files differnew file mode 100644 index 00000000..2565a916 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class Binary files differnew file mode 100644 index 00000000..ec3ae09b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class Binary files differnew file mode 100644 index 00000000..f1c18151 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class Binary files differnew file mode 100644 index 00000000..b06f5682 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class Binary files differnew file mode 100644 index 00000000..b3664214 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class Binary files differnew file mode 100644 index 00000000..ab1eebea --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class Binary files differnew file mode 100644 index 00000000..f2e324cb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class Binary files differnew file mode 100644 index 00000000..e9b0b99f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class Binary files differnew file mode 100644 index 00000000..fce9ac9f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class diff --git a/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class Binary files differnew file mode 100644 index 00000000..3e9bb61d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class diff --git a/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class b/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class Binary files differnew file mode 100644 index 00000000..905828d1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class diff --git a/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class b/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class Binary files differnew file mode 100644 index 00000000..c18ff51a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class diff --git a/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class b/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class Binary files differnew file mode 100644 index 00000000..ff92a936 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class diff --git a/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class b/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class Binary files differnew file mode 100644 index 00000000..3764669f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class diff --git a/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class b/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class Binary files differnew file mode 100644 index 00000000..6419cc7c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class diff --git a/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class b/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class Binary files differnew file mode 100644 index 00000000..e3af8c9f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class Binary files differnew file mode 100644 index 00000000..ce4e433c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class Binary files differnew file mode 100644 index 00000000..6d4226a2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class Binary files differnew file mode 100644 index 00000000..3779c03b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class Binary files differnew file mode 100644 index 00000000..dc10188e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class Binary files differnew file mode 100644 index 00000000..98797a7d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class diff --git a/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class Binary files differnew file mode 100644 index 00000000..585bd52b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class b/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class Binary files differnew file mode 100644 index 00000000..e63b5ea0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class b/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class Binary files differnew file mode 100644 index 00000000..1760ae06 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class b/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class Binary files differnew file mode 100644 index 00000000..5015705f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class b/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class Binary files differnew file mode 100644 index 00000000..32ab36fb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class b/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class Binary files differnew file mode 100644 index 00000000..d7a17f61 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class b/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class Binary files differnew file mode 100644 index 00000000..84aa33f3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class b/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class Binary files differnew file mode 100644 index 00000000..7d6534f7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class b/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class Binary files differnew file mode 100644 index 00000000..7a1a6af1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class b/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class Binary files differnew file mode 100644 index 00000000..3a155cee --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class b/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class Binary files differnew file mode 100644 index 00000000..842c3aca --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class b/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class Binary files differnew file mode 100644 index 00000000..23dd79cb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class b/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class Binary files differnew file mode 100644 index 00000000..d0b15244 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class b/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class Binary files differnew file mode 100644 index 00000000..b2725fa9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class b/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class Binary files differnew file mode 100644 index 00000000..2427d367 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class b/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class Binary files differnew file mode 100644 index 00000000..99d673bc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class Binary files differnew file mode 100644 index 00000000..b75bdca0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class Binary files differnew file mode 100644 index 00000000..03b32a96 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class Binary files differnew file mode 100644 index 00000000..7df61c5b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class Binary files differnew file mode 100644 index 00000000..356a4ab0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class Binary files differnew file mode 100644 index 00000000..a32bb01a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class b/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class Binary files differnew file mode 100644 index 00000000..134af00f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class b/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class Binary files differnew file mode 100644 index 00000000..2d4af172 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class b/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class Binary files differnew file mode 100644 index 00000000..924da501 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class b/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class Binary files differnew file mode 100644 index 00000000..e968ee69 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/Token.class b/com.sun.jersey/com/sun/jersey/core/header/Token.class Binary files differnew file mode 100644 index 00000000..2e6da4d8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/Token.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class Binary files differnew file mode 100644 index 00000000..d0a2d683 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class Binary files differnew file mode 100644 index 00000000..dba2f2de --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class Binary files differnew file mode 100644 index 00000000..9d1333c9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class Binary files differnew file mode 100644 index 00000000..163bea17 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class Binary files differnew file mode 100644 index 00000000..6013e680 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class Binary files differnew file mode 100644 index 00000000..8dce5fe1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class Binary files differnew file mode 100644 index 00000000..9bf3eef1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class Binary files differnew file mode 100644 index 00000000..a681932f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class Binary files differnew file mode 100644 index 00000000..3a74a48e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class Binary files differnew file mode 100644 index 00000000..4415d9f0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class Binary files differnew file mode 100644 index 00000000..dcb0adaa --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class Binary files differnew file mode 100644 index 00000000..0a97d4cf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class Binary files differnew file mode 100644 index 00000000..f72d7ae1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class Binary files differnew file mode 100644 index 00000000..97fc5478 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class Binary files differnew file mode 100644 index 00000000..81a68f2d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class Binary files differnew file mode 100644 index 00000000..3a36b517 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class Binary files differnew file mode 100644 index 00000000..06a8a5bf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class Binary files differnew file mode 100644 index 00000000..6277eb22 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class Binary files differnew file mode 100644 index 00000000..c10282b9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class Binary files differnew file mode 100644 index 00000000..5df876ed --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class Binary files differnew file mode 100644 index 00000000..1f6180e5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class Binary files differnew file mode 100644 index 00000000..7d4d7a9e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class Binary files differnew file mode 100644 index 00000000..50a7f741 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class Binary files differnew file mode 100644 index 00000000..c6820000 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class Binary files differnew file mode 100644 index 00000000..0bb510d6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class Binary files differnew file mode 100644 index 00000000..e2662263 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class Binary files differnew file mode 100644 index 00000000..7067fbc8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class Binary files differnew file mode 100644 index 00000000..cdb72bbc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class Binary files differnew file mode 100644 index 00000000..6ea2ddb6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class Binary files differnew file mode 100644 index 00000000..05150e90 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class Binary files differnew file mode 100644 index 00000000..9d6e40fc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class Binary files differnew file mode 100644 index 00000000..1aaf49e6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class Binary files differnew file mode 100644 index 00000000..a0bbcee6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class Binary files differnew file mode 100644 index 00000000..15d31e29 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class Binary files differnew file mode 100644 index 00000000..4bc63e70 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class Binary files differnew file mode 100644 index 00000000..6a413f8c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class Binary files differnew file mode 100644 index 00000000..7d0251a5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class Binary files differnew file mode 100644 index 00000000..86490777 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class Binary files differnew file mode 100644 index 00000000..78cc1aff --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class Binary files differnew file mode 100644 index 00000000..28967686 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class Binary files differnew file mode 100644 index 00000000..a11bd832 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class Binary files differnew file mode 100644 index 00000000..8cd64da9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class Binary files differnew file mode 100644 index 00000000..fbd60f63 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class Binary files differnew file mode 100644 index 00000000..9be4105d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class Binary files differnew file mode 100644 index 00000000..d5663d31 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class Binary files differnew file mode 100644 index 00000000..62801f56 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class Binary files differnew file mode 100644 index 00000000..6a1649d7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class Binary files differnew file mode 100644 index 00000000..617cb85c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class Binary files differnew file mode 100644 index 00000000..45660f7e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class Binary files differnew file mode 100644 index 00000000..266d2cb0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class Binary files differnew file mode 100644 index 00000000..5f11bb01 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class Binary files differnew file mode 100644 index 00000000..6d7f4bad --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class Binary files differnew file mode 100644 index 00000000..7afc31d8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class Binary files differnew file mode 100644 index 00000000..e637c7e2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class Binary files differnew file mode 100644 index 00000000..ca55f8be --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class Binary files differnew file mode 100644 index 00000000..787db96c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class Binary files differnew file mode 100644 index 00000000..3c43a2bd --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class Binary files differnew file mode 100644 index 00000000..5dc0628c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class Binary files differnew file mode 100644 index 00000000..fa160432 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class Binary files differnew file mode 100644 index 00000000..55954a54 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class Binary files differnew file mode 100644 index 00000000..3fd4b9e8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class Binary files differnew file mode 100644 index 00000000..504fb660 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class Binary files differnew file mode 100644 index 00000000..fd202a92 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class Binary files differnew file mode 100644 index 00000000..f7869733 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class Binary files differnew file mode 100644 index 00000000..375396b3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class Binary files differnew file mode 100644 index 00000000..b01a8b02 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class Binary files differnew file mode 100644 index 00000000..0bec6485 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class Binary files differnew file mode 100644 index 00000000..6555d983 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class Binary files differnew file mode 100644 index 00000000..113997ee --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class Binary files differnew file mode 100644 index 00000000..f7ec7374 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class Binary files differnew file mode 100644 index 00000000..6eece648 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class Binary files differnew file mode 100644 index 00000000..187f61ad --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class Binary files differnew file mode 100644 index 00000000..056a455e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class Binary files differnew file mode 100644 index 00000000..168f6b70 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class Binary files differnew file mode 100644 index 00000000..f217f744 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class Binary files differnew file mode 100644 index 00000000..18da992c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class Binary files differnew file mode 100644 index 00000000..803157be --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class Binary files differnew file mode 100644 index 00000000..5635c91e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class Binary files differnew file mode 100644 index 00000000..034120b3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class Binary files differnew file mode 100644 index 00000000..a61b1d31 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class Binary files differnew file mode 100644 index 00000000..a8076090 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class Binary files differnew file mode 100644 index 00000000..4b46a119 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class b/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class Binary files differnew file mode 100644 index 00000000..afb612d4 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class diff --git a/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class b/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class Binary files differnew file mode 100644 index 00000000..47d59840 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class b/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class Binary files differnew file mode 100644 index 00000000..e2aa7a34 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class b/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class Binary files differnew file mode 100644 index 00000000..7f5bc2a1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class b/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class Binary files differnew file mode 100644 index 00000000..9821ce55 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class Binary files differnew file mode 100644 index 00000000..11f19d4c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class Binary files differnew file mode 100644 index 00000000..b4025147 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class Binary files differnew file mode 100644 index 00000000..4bd4c2b7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class Binary files differnew file mode 100644 index 00000000..f6c36a93 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class b/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class Binary files differnew file mode 100644 index 00000000..813d0638 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class Binary files differnew file mode 100644 index 00000000..0d6a6064 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class Binary files differnew file mode 100644 index 00000000..142d0016 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class Binary files differnew file mode 100644 index 00000000..74bc6456 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class Binary files differnew file mode 100644 index 00000000..1ff70b87 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class Binary files differnew file mode 100644 index 00000000..7fd1c412 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class Binary files differnew file mode 100644 index 00000000..90dae632 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class Binary files differnew file mode 100644 index 00000000..308e27bb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class Binary files differnew file mode 100644 index 00000000..31dcf3ea --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class Binary files differnew file mode 100644 index 00000000..037d03e8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class Binary files differnew file mode 100644 index 00000000..5d190a1e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class Binary files differnew file mode 100644 index 00000000..0ceea9e8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class Binary files differnew file mode 100644 index 00000000..d6908782 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class Binary files differnew file mode 100644 index 00000000..147302e3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class Binary files differnew file mode 100644 index 00000000..98fd042b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class Binary files differnew file mode 100644 index 00000000..22359c01 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class diff --git a/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class Binary files differnew file mode 100644 index 00000000..3fb646a6 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class b/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class Binary files differnew file mode 100644 index 00000000..b6fb48f8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class Binary files differnew file mode 100644 index 00000000..a8533c0e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class Binary files differnew file mode 100644 index 00000000..4928edb9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class Binary files differnew file mode 100644 index 00000000..950e0843 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class Binary files differnew file mode 100644 index 00000000..5ed633f0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class Binary files differnew file mode 100644 index 00000000..217c933d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class Binary files differnew file mode 100644 index 00000000..3f39df39 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class Binary files differnew file mode 100644 index 00000000..2435af35 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class Binary files differnew file mode 100644 index 00000000..421094e8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class Binary files differnew file mode 100644 index 00000000..0d8c5dd3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class Binary files differnew file mode 100644 index 00000000..326514a0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class Binary files differnew file mode 100644 index 00000000..b4239c7d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class Binary files differnew file mode 100644 index 00000000..38f43710 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class Binary files differnew file mode 100644 index 00000000..8cab7b7f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class Binary files differnew file mode 100644 index 00000000..01dae0ec --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class Binary files differnew file mode 100644 index 00000000..b68722e9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class Binary files differnew file mode 100644 index 00000000..ba4c39a8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class Binary files differnew file mode 100644 index 00000000..91d315d9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class Binary files differnew file mode 100644 index 00000000..72caff57 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class Binary files differnew file mode 100644 index 00000000..d4877440 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class Binary files differnew file mode 100644 index 00000000..cec2a334 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class Binary files differnew file mode 100644 index 00000000..e75f214b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class Binary files differnew file mode 100644 index 00000000..bf27b4a3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class Binary files differnew file mode 100644 index 00000000..2f67924f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class Binary files differnew file mode 100644 index 00000000..b2831b34 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class Binary files differnew file mode 100644 index 00000000..ca566343 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class Binary files differnew file mode 100644 index 00000000..950a7e0e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class Binary files differnew file mode 100644 index 00000000..ffc961c2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class Binary files differnew file mode 100644 index 00000000..b2912b31 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class Binary files differnew file mode 100644 index 00000000..b6b0701a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class Binary files differnew file mode 100644 index 00000000..99acac56 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class Binary files differnew file mode 100644 index 00000000..f0d83a93 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class Binary files differnew file mode 100644 index 00000000..314f335a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class Binary files differnew file mode 100644 index 00000000..7dc36dff --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class Binary files differnew file mode 100644 index 00000000..b350eff0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class Binary files differnew file mode 100644 index 00000000..e1d446cf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class Binary files differnew file mode 100644 index 00000000..51d76996 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class Binary files differnew file mode 100644 index 00000000..1fe18ee3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class Binary files differnew file mode 100644 index 00000000..0b7075cd --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class Binary files differnew file mode 100644 index 00000000..c97a2753 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class Binary files differnew file mode 100644 index 00000000..0e6a5ea4 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class Binary files differnew file mode 100644 index 00000000..53d444b8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class Binary files differnew file mode 100644 index 00000000..731597e5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class Binary files differnew file mode 100644 index 00000000..d0874008 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class Binary files differnew file mode 100644 index 00000000..ff633f07 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class Binary files differnew file mode 100644 index 00000000..9c39d7fc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class Binary files differnew file mode 100644 index 00000000..21e5e0b3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class Binary files differnew file mode 100644 index 00000000..a3ba66be --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class Binary files differnew file mode 100644 index 00000000..a0d64941 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class Binary files differnew file mode 100644 index 00000000..62a5eba3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class Binary files differnew file mode 100644 index 00000000..bfce57b0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class Binary files differnew file mode 100644 index 00000000..3fd7259f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class Binary files differnew file mode 100644 index 00000000..b708d674 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class b/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class Binary files differnew file mode 100644 index 00000000..eb033e6a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class Binary files differnew file mode 100644 index 00000000..5a30c83e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class Binary files differnew file mode 100644 index 00000000..98e79dd1 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class Binary files differnew file mode 100644 index 00000000..4d22178b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class Binary files differnew file mode 100644 index 00000000..12b9a529 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class Binary files differnew file mode 100644 index 00000000..27ea2288 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class Binary files differnew file mode 100644 index 00000000..faefdc13 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class Binary files differnew file mode 100644 index 00000000..4ef58597 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class Binary files differnew file mode 100644 index 00000000..f79998ce --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class Binary files differnew file mode 100644 index 00000000..4b3f8fdf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class Binary files differnew file mode 100644 index 00000000..f0468de3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class Binary files differnew file mode 100644 index 00000000..b4eb37f8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class Binary files differnew file mode 100644 index 00000000..a0f39d8a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class Binary files differnew file mode 100644 index 00000000..3ca1f13e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class Binary files differnew file mode 100644 index 00000000..29b07645 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class Binary files differnew file mode 100644 index 00000000..01c78099 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class Binary files differnew file mode 100644 index 00000000..8a9068a8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class Binary files differnew file mode 100644 index 00000000..d22a9d89 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class Binary files differnew file mode 100644 index 00000000..82395e9a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class Binary files differnew file mode 100644 index 00000000..67a8d7b5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class Binary files differnew file mode 100644 index 00000000..6cb204db --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/Base64.class b/com.sun.jersey/com/sun/jersey/core/util/Base64.class Binary files differnew file mode 100644 index 00000000..33054bbb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/Base64.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class b/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class Binary files differnew file mode 100644 index 00000000..e9e41f9c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/Closing.class b/com.sun.jersey/com/sun/jersey/core/util/Closing.class Binary files differnew file mode 100644 index 00000000..2e629a3c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/Closing.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class b/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class Binary files differnew file mode 100644 index 00000000..0a902d2a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class Binary files differnew file mode 100644 index 00000000..0899be21 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class Binary files differnew file mode 100644 index 00000000..3ba7e94d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class Binary files differnew file mode 100644 index 00000000..93631d1c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class Binary files differnew file mode 100644 index 00000000..8496291c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class Binary files differnew file mode 100644 index 00000000..e86b5961 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class Binary files differnew file mode 100644 index 00000000..a159f74e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class Binary files differnew file mode 100644 index 00000000..ad9e114c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class Binary files differnew file mode 100644 index 00000000..98458a43 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class Binary files differnew file mode 100644 index 00000000..972babaa --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class Binary files differnew file mode 100644 index 00000000..692b1bbc --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class Binary files differnew file mode 100644 index 00000000..38218f3a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class Binary files differnew file mode 100644 index 00000000..087c1483 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class Binary files differnew file mode 100644 index 00000000..a331ec21 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class Binary files differnew file mode 100644 index 00000000..39b4c96d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class Binary files differnew file mode 100644 index 00000000..cf663b6a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class Binary files differnew file mode 100644 index 00000000..25a0a5a5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class b/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class Binary files differnew file mode 100644 index 00000000..97e3bdb4 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class b/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class Binary files differnew file mode 100644 index 00000000..33c7ffd5 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class b/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class Binary files differnew file mode 100644 index 00000000..0e452fb4 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class b/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class Binary files differnew file mode 100644 index 00000000..5d4ffd38 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class b/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class Binary files differnew file mode 100644 index 00000000..e37db9c2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class b/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class Binary files differnew file mode 100644 index 00000000..e48e8c8c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class b/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class Binary files differnew file mode 100644 index 00000000..14fb6dff --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class b/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class Binary files differnew file mode 100644 index 00000000..f1c4bca8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class diff --git a/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class b/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class Binary files differnew file mode 100644 index 00000000..cdf7ec05 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class diff --git a/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class b/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class Binary files differnew file mode 100644 index 00000000..0ac91f10 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class diff --git a/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class b/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class Binary files differnew file mode 100644 index 00000000..929247d2 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class diff --git a/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class b/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class Binary files differnew file mode 100644 index 00000000..54675b5e --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class diff --git a/com.sun.jersey/com/sun/jersey/impl/api.properties b/com.sun.jersey/com/sun/jersey/impl/api.properties new file mode 100644 index 00000000..f867e167 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/api.properties @@ -0,0 +1,40 @@ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. +# +# The contents of this file are subject to the terms of either the GNU +# General Public License Version 2 only ("GPL") or the Common Development +# and Distribution License("CDDL") (collectively, the "License"). You +# may not use this file except in compliance with the License. You can +# obtain a copy of the License at +# https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html +# or packager/legal/LICENSE.txt. See the License for the specific +# language governing permissions and limitations under the License. +# +# When distributing the software, include this License Header Notice in each +# file and include the License file at packager/legal/LICENSE.txt. +# +# GPL Classpath Exception: +# Oracle designates this particular file as subject to the "Classpath" +# exception as provided by Oracle in the GPL Version 2 section of the License +# file that accompanied this code. +# +# Modifications: +# If applicable, add the following below the License Header, with the fields +# enclosed by brackets [] replaced by your own identifying information: +# "Portions Copyright [year] [name of copyright owner]" +# +# Contributor(s): +# If you wish your version of this file to be governed by only the CDDL or +# only the GPL Version 2, indicate your decision by adding "[Contributor] +# elects to include this software in this distribution under the [CDDL or GPL +# Version 2] license." If you don't indicate a single choice of license, a +# recipient has the option to distribute your version of this file under +# either the CDDL, the GPL Version 2 or to extend the choice of license to +# its licensees as provided above. However, if you add GPL Version 2 code +# and therefore, elected the GPL Version 2 license, then the option applies +# only if the new code is made subject to such option by the copyright +# holder. +# + diff --git a/com.sun.jersey/com/sun/jersey/impl/impl.properties b/com.sun.jersey/com/sun/jersey/impl/impl.properties new file mode 100644 index 00000000..2ecf85a8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/impl.properties @@ -0,0 +1,63 @@ +error.marshalling.jaxb=Error marshalling JAXB object of type "{0}". +error.unmarshalling.jaxb=Error unmarshalling JAXB object of type "{0}". +unable.to.write.mimemultipart=Unable to write MimeMultipart content. +resource.method=Resource, {0}, with method, {1} +resource.not.acceptable={0}, is returning a MIME type, "{1}", that is not acceptable. +resource.mimetype.not.in.produceMime={0}, is returning a MIME type, "{1}", that is acceptable but not a member of @ProduceMime, {2}. +nested.error=NESTED ERROR: {0}. +failed.to.create.web.resource=Failed to create Web resource: {0}. +default.could.not.process.method=Default value, {0} could not be processed by method {1}. +default.could.not.process.constructor=Default value, {0} could not be processed by constructor {1}. +exception.invoking.resource.method=Exception invoking Web resource method. +illegal.initial.capacity=Illegal initial capacity: {0}. +illegal.load.factor=Illegal load factor: {0}. +error.processing.method=Error processing resource method, {0}, for ResourceMethodDispatchProvider, {1}. +generic.type.not.supported=Generic type, {0}, not support for parameter {1}. +not.valid.httpmethod=Method, {0}, annotated with {1} of resource, {2}, is not recognized as valid resource method. +not.valid.dynamicresolvingmethod=Method, {0}, annotated with URI template {1} of resource, {2}, is not recognized as valid Java method annotated with @Path. +quality.more.than.three=Quality value "{0}" has more than 3 digits after the decimal point. +quality.greater.than.one=Quality value "{0}" is greater than 1. +object.not.a.webResource=Object, "{0}": is not a Web resource since it is not annotated with @Path. +bad.uritemplate=Web resource, "{0}": URI template "{1}" of @Path could not be processed on Web resource. +bad.class.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on Web resource. +bad.class.producemime=Web resource, "{0}": MIME types "{1}" of @ProcudeMime could not be processed on Web resource. +bad.method.httpmethod=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource. +bad.consumemime=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource. +bad.method.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on method "{2} of Web Resource. +bad.method.producemime=Web resource, "{0}": MIME types "{1}" of @ProduceMime could not be processed on method "{2} of Web Resource. +illegal.config.syntax=Illegal configuration-file syntax. +illegal.provider.class.name=Illegal provider-class name: {0}. +provider.not.found=Provider {0} not found. +provider.could.not.be.created=Provider {0} could not be instantiated: {1} +no.webresourceclass.in.webxml=No "webresourceclass" specified in web.xml. +byte.array.cannot.be.null=data parameter, of type byte[], cannot be null. +bad.content.type=The HTTP header field "Content-Type" with value "{0}" could not be parsed. +bad.mime.type=The MIME type of the representation with value "{0}" could not be parsed. +bad.accept.field=The HTTP header field "Accept" with value "{0}" could not be parsed. +error.no.sub.res.method.locator.found=A resource class, {0}, does not have any resource method, sub-resource method, or sub-resource locator. +error.res.uri.path.required=A root resource class, {0}, MUST have a URI path. +error.res.uri.path.invalid=A root resource class, {0}, has an invalid URI path: {1}. +error.subres.loc.uri.path.invalid=A sub-resource locator, {0}, has an invalid URI path: {1} +error.subres.loc.has.entity.param=A sub-resource locator, {0}, can not have an entity parameter. Try to move the parameter to the corresponding resource method. +error.subres.method.uri.path.invalid=A sub-resource method, {0}, has an invalid URI path: {1} +error.get.returns.void=A HTTP GET method, {0}, MUST return a non-void type. +error.get.consumes.entity=A HTTP GET method, {0}, should not consume any entity. +error.subres.loc.returns.void=A sub-resource locator, {0}, MUST return a non-void type. +new.ar.created.by.introspection.modeler=A new abstract resource created by IntrospectionModeler: {0} +ambiguous.parameter=Parameter {1} of {0} MUST be only one of a path, query, matrix or header parameter. +non.pub.res.method=A resource method, {0}, MUST be public scoped otherwise the method is ignored +non.pub.sub.res.method=A sub-resource method, {0}, MUST be public scoped otherwise the method is ignored +non.pub.sub.res.loc=A sub-resource locator, {0}, MUST be public scoped otherwise the method is ignored +fatal.issues.found.at.res.class=Fatal issues found at class {0}. See logs for more details. +web.app.already.initiated=Web application is already initiated. +no.root.res.in.res.cfg=The ResourceConfig instance does not contain any root resource classes. +root.res.no.public.ctor=A root resource, {0}, MUST have a public constructor +ambiguous.ctors=A root resource, {0}, has ambiguous constructors to use for initialization +ambiguous.srls=A resource, {0}, has ambiguous sub-resource locator for URI template {1}, which matches with template {2} +ambiguous.rms.in=A resource, {0}, has ambiguous resource method for HTTP method {1} and input mime-type: {2}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {3} and {4}) are {5} and {6}. This could cause an error for conflicting output types! +ambiguous.rms.out=A resource, {0}, has ambiguous resource method for HTTP method {1} and output mime-type: {2}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {3} and {4}) are {5} and {6} +ambiguous.srms.in=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and input mime-type: {3}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {4} and {5}) are {6} and {7}. This could cause an error for conflicting output types! +ambiguous.srms.out=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and output mime-type: {3}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {4} and {5}) are {6} and {7} +multiple.http.method.designators=A (sub-)resource method, {0}, should have only one HTTP method designator. It currently has the following designators defined: {1} +ambiguous.rr.path=A root resource, {0}, has a non-unique URI template {1} +sub.res.method.treated.as.res.method=A sub-resource method, {0}, with URI template, "{1}", is treated as a resource method
\ No newline at end of file diff --git a/com.sun.jersey/com/sun/jersey/impl/spi.properties b/com.sun.jersey/com/sun/jersey/impl/spi.properties new file mode 100644 index 00000000..f604f53b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/impl/spi.properties @@ -0,0 +1,9 @@ +uritemplate.cannot.be.null=URI template cannot be null. +template.name.to.value.not.null=Template name to value map cannot be null. +illegal.config.syntax=Illegal configuration-file syntax. +illegal.provider.class.name=Illegal provider-class name: {0}. +provider.could.not.be.created=The class {0} implementing provider {1} could not be instantiated: {2} +provider.class.could.not.be.loaded=The class {0} implementing provider {1} could not be loaded: {2} +provider.not.found=The class {0} implementing the provider {1} is not found. The provider implementation is ignored. +dependent.class.of.provider.not.found=A dependent class, {0}, of the class {1} implementing the provider {2} is not found. The provider implementation is ignored. +dependent.class.of.provider.format.error={0}. A dependent class of the class {1} implementing the provider {2} is malformed. The provider implementation is ignored. Check if the malformed class is part of a stubbed jar that used for compiling only.
\ No newline at end of file diff --git a/com.sun.jersey/com/sun/jersey/localization/Localizable.class b/com.sun.jersey/com/sun/jersey/localization/Localizable.class Binary files differnew file mode 100644 index 00000000..bc20d1a0 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/localization/Localizable.class diff --git a/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class b/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class Binary files differnew file mode 100644 index 00000000..8b3b5e94 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class diff --git a/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class b/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class Binary files differnew file mode 100644 index 00000000..68c49f2b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class diff --git a/com.sun.jersey/com/sun/jersey/localization/Localizer.class b/com.sun.jersey/com/sun/jersey/localization/Localizer.class Binary files differnew file mode 100644 index 00000000..5354c871 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/localization/Localizer.class diff --git a/com.sun.jersey/com/sun/jersey/spi/CloseableService.class b/com.sun.jersey/com/sun/jersey/spi/CloseableService.class Binary files differnew file mode 100644 index 00000000..760065e7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/CloseableService.class diff --git a/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class b/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class Binary files differnew file mode 100644 index 00000000..bca6249b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class b/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class Binary files differnew file mode 100644 index 00000000..40cabfdf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class diff --git a/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class b/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class Binary files differnew file mode 100644 index 00000000..54226111 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class diff --git a/com.sun.jersey/com/sun/jersey/spi/StringReader.class b/com.sun.jersey/com/sun/jersey/spi/StringReader.class Binary files differnew file mode 100644 index 00000000..9e6ebc37 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/StringReader.class diff --git a/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class b/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class Binary files differnew file mode 100644 index 00000000..d016ed3f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class b/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class Binary files differnew file mode 100644 index 00000000..204116d3 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class b/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class Binary files differnew file mode 100644 index 00000000..4e3d7ff8 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class b/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class Binary files differnew file mode 100644 index 00000000..6743ad6b --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class b/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class Binary files differnew file mode 100644 index 00000000..ddc453bf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class Binary files differnew file mode 100644 index 00000000..4b8c38f7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class Binary files differnew file mode 100644 index 00000000..a423df1c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class Binary files differnew file mode 100644 index 00000000..e64473cf --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class Binary files differnew file mode 100644 index 00000000..2fda2bed --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class b/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class Binary files differnew file mode 100644 index 00000000..9d30638a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class b/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class Binary files differnew file mode 100644 index 00000000..6054dd79 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class b/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class Binary files differnew file mode 100644 index 00000000..27daeecb --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class Binary files differnew file mode 100644 index 00000000..b3a60da9 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class Binary files differnew file mode 100644 index 00000000..e7194e81 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class Binary files differnew file mode 100644 index 00000000..bf490a8f --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class b/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class Binary files differnew file mode 100644 index 00000000..b0f352a7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class b/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class Binary files differnew file mode 100644 index 00000000..7b31662d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class diff --git a/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class b/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class Binary files differnew file mode 100644 index 00000000..fbfcccc7 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class Binary files differnew file mode 100644 index 00000000..b70dd662 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class Binary files differnew file mode 100644 index 00000000..c2777c47 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class Binary files differnew file mode 100644 index 00000000..c8b50f3c --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class Binary files differnew file mode 100644 index 00000000..7a3f52df --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class Binary files differnew file mode 100644 index 00000000..e651416a --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class Binary files differnew file mode 100644 index 00000000..a9f39a49 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class Binary files differnew file mode 100644 index 00000000..21505f39 --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class diff --git a/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class Binary files differnew file mode 100644 index 00000000..160af76d --- /dev/null +++ b/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class diff --git a/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class b/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class Binary files differnew file mode 100644 index 00000000..692355dc --- /dev/null +++ b/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class diff --git a/com.sun.jersey/javax/ws/rs/ApplicationPath.class b/com.sun.jersey/javax/ws/rs/ApplicationPath.class Binary files differnew file mode 100644 index 00000000..2b095906 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ApplicationPath.class diff --git a/com.sun.jersey/javax/ws/rs/Consumes.class b/com.sun.jersey/javax/ws/rs/Consumes.class Binary files differnew file mode 100644 index 00000000..63c5dbad --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/Consumes.class diff --git a/com.sun.jersey/javax/ws/rs/CookieParam.class b/com.sun.jersey/javax/ws/rs/CookieParam.class Binary files differnew file mode 100644 index 00000000..5647b85b --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/CookieParam.class diff --git a/com.sun.jersey/javax/ws/rs/DELETE.class b/com.sun.jersey/javax/ws/rs/DELETE.class Binary files differnew file mode 100644 index 00000000..33f730b9 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/DELETE.class diff --git a/com.sun.jersey/javax/ws/rs/DefaultValue.class b/com.sun.jersey/javax/ws/rs/DefaultValue.class Binary files differnew file mode 100644 index 00000000..49654b8e --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/DefaultValue.class diff --git a/com.sun.jersey/javax/ws/rs/Encoded.class b/com.sun.jersey/javax/ws/rs/Encoded.class Binary files differnew file mode 100644 index 00000000..1b6e4d85 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/Encoded.class diff --git a/com.sun.jersey/javax/ws/rs/FormParam.class b/com.sun.jersey/javax/ws/rs/FormParam.class Binary files differnew file mode 100644 index 00000000..7ad8d5e5 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/FormParam.class diff --git a/com.sun.jersey/javax/ws/rs/GET.class b/com.sun.jersey/javax/ws/rs/GET.class Binary files differnew file mode 100644 index 00000000..a4f19c56 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/GET.class diff --git a/com.sun.jersey/javax/ws/rs/HEAD.class b/com.sun.jersey/javax/ws/rs/HEAD.class Binary files differnew file mode 100644 index 00000000..eab3fd3b --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/HEAD.class diff --git a/com.sun.jersey/javax/ws/rs/HeaderParam.class b/com.sun.jersey/javax/ws/rs/HeaderParam.class Binary files differnew file mode 100644 index 00000000..29d08136 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/HeaderParam.class diff --git a/com.sun.jersey/javax/ws/rs/HttpMethod.class b/com.sun.jersey/javax/ws/rs/HttpMethod.class Binary files differnew file mode 100644 index 00000000..4c0bddf0 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/HttpMethod.class diff --git a/com.sun.jersey/javax/ws/rs/MatrixParam.class b/com.sun.jersey/javax/ws/rs/MatrixParam.class Binary files differnew file mode 100644 index 00000000..ceb060bc --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/MatrixParam.class diff --git a/com.sun.jersey/javax/ws/rs/OPTIONS.class b/com.sun.jersey/javax/ws/rs/OPTIONS.class Binary files differnew file mode 100644 index 00000000..d4a2098f --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/OPTIONS.class diff --git a/com.sun.jersey/javax/ws/rs/POST.class b/com.sun.jersey/javax/ws/rs/POST.class Binary files differnew file mode 100644 index 00000000..98a052d9 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/POST.class diff --git a/com.sun.jersey/javax/ws/rs/PUT.class b/com.sun.jersey/javax/ws/rs/PUT.class Binary files differnew file mode 100644 index 00000000..3960d50c --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/PUT.class diff --git a/com.sun.jersey/javax/ws/rs/Path.class b/com.sun.jersey/javax/ws/rs/Path.class Binary files differnew file mode 100644 index 00000000..f43a2dae --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/Path.class diff --git a/com.sun.jersey/javax/ws/rs/PathParam.class b/com.sun.jersey/javax/ws/rs/PathParam.class Binary files differnew file mode 100644 index 00000000..e908d296 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/PathParam.class diff --git a/com.sun.jersey/javax/ws/rs/Produces.class b/com.sun.jersey/javax/ws/rs/Produces.class Binary files differnew file mode 100644 index 00000000..373c1e10 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/Produces.class diff --git a/com.sun.jersey/javax/ws/rs/QueryParam.class b/com.sun.jersey/javax/ws/rs/QueryParam.class Binary files differnew file mode 100644 index 00000000..ae7576f6 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/QueryParam.class diff --git a/com.sun.jersey/javax/ws/rs/WebApplicationException.class b/com.sun.jersey/javax/ws/rs/WebApplicationException.class Binary files differnew file mode 100644 index 00000000..79999dc1 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/WebApplicationException.class diff --git a/com.sun.jersey/javax/ws/rs/core/Application.class b/com.sun.jersey/javax/ws/rs/core/Application.class Binary files differnew file mode 100644 index 00000000..b004360b --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Application.class diff --git a/com.sun.jersey/javax/ws/rs/core/CacheControl.class b/com.sun.jersey/javax/ws/rs/core/CacheControl.class Binary files differnew file mode 100644 index 00000000..f761c8e4 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/CacheControl.class diff --git a/com.sun.jersey/javax/ws/rs/core/Context.class b/com.sun.jersey/javax/ws/rs/core/Context.class Binary files differnew file mode 100644 index 00000000..f088d489 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Context.class diff --git a/com.sun.jersey/javax/ws/rs/core/Cookie.class b/com.sun.jersey/javax/ws/rs/core/Cookie.class Binary files differnew file mode 100644 index 00000000..a95824d5 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Cookie.class diff --git a/com.sun.jersey/javax/ws/rs/core/EntityTag.class b/com.sun.jersey/javax/ws/rs/core/EntityTag.class Binary files differnew file mode 100644 index 00000000..9c186607 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/EntityTag.class diff --git a/com.sun.jersey/javax/ws/rs/core/GenericEntity.class b/com.sun.jersey/javax/ws/rs/core/GenericEntity.class Binary files differnew file mode 100644 index 00000000..392e9e56 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/GenericEntity.class diff --git a/com.sun.jersey/javax/ws/rs/core/HttpHeaders.class b/com.sun.jersey/javax/ws/rs/core/HttpHeaders.class Binary files differnew file mode 100644 index 00000000..1aa1fd90 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/HttpHeaders.class diff --git a/com.sun.jersey/javax/ws/rs/core/MediaType$1.class b/com.sun.jersey/javax/ws/rs/core/MediaType$1.class Binary files differnew file mode 100644 index 00000000..6a4f8465 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/MediaType$1.class diff --git a/com.sun.jersey/javax/ws/rs/core/MediaType.class b/com.sun.jersey/javax/ws/rs/core/MediaType.class Binary files differnew file mode 100644 index 00000000..3d177da7 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/MediaType.class diff --git a/com.sun.jersey/javax/ws/rs/core/MultivaluedMap.class b/com.sun.jersey/javax/ws/rs/core/MultivaluedMap.class Binary files differnew file mode 100644 index 00000000..9c327747 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/MultivaluedMap.class diff --git a/com.sun.jersey/javax/ws/rs/core/NewCookie.class b/com.sun.jersey/javax/ws/rs/core/NewCookie.class Binary files differnew file mode 100644 index 00000000..f1c23145 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/NewCookie.class diff --git a/com.sun.jersey/javax/ws/rs/core/PathSegment.class b/com.sun.jersey/javax/ws/rs/core/PathSegment.class Binary files differnew file mode 100644 index 00000000..3a9a747f --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/PathSegment.class diff --git a/com.sun.jersey/javax/ws/rs/core/Request.class b/com.sun.jersey/javax/ws/rs/core/Request.class Binary files differnew file mode 100644 index 00000000..3128417e --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Request.class diff --git a/com.sun.jersey/javax/ws/rs/core/Response$ResponseBuilder.class b/com.sun.jersey/javax/ws/rs/core/Response$ResponseBuilder.class Binary files differnew file mode 100644 index 00000000..f68fd9aa --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Response$ResponseBuilder.class diff --git a/com.sun.jersey/javax/ws/rs/core/Response$Status$Family.class b/com.sun.jersey/javax/ws/rs/core/Response$Status$Family.class Binary files differnew file mode 100644 index 00000000..d8354c12 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Response$Status$Family.class diff --git a/com.sun.jersey/javax/ws/rs/core/Response$Status.class b/com.sun.jersey/javax/ws/rs/core/Response$Status.class Binary files differnew file mode 100644 index 00000000..1e7d7159 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Response$Status.class diff --git a/com.sun.jersey/javax/ws/rs/core/Response$StatusType.class b/com.sun.jersey/javax/ws/rs/core/Response$StatusType.class Binary files differnew file mode 100644 index 00000000..564338de --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Response$StatusType.class diff --git a/com.sun.jersey/javax/ws/rs/core/Response.class b/com.sun.jersey/javax/ws/rs/core/Response.class Binary files differnew file mode 100644 index 00000000..8db94180 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Response.class diff --git a/com.sun.jersey/javax/ws/rs/core/SecurityContext.class b/com.sun.jersey/javax/ws/rs/core/SecurityContext.class Binary files differnew file mode 100644 index 00000000..b2433898 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/SecurityContext.class diff --git a/com.sun.jersey/javax/ws/rs/core/StreamingOutput.class b/com.sun.jersey/javax/ws/rs/core/StreamingOutput.class Binary files differnew file mode 100644 index 00000000..143416b1 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/StreamingOutput.class diff --git a/com.sun.jersey/javax/ws/rs/core/UriBuilder.class b/com.sun.jersey/javax/ws/rs/core/UriBuilder.class Binary files differnew file mode 100644 index 00000000..88c5d485 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/UriBuilder.class diff --git a/com.sun.jersey/javax/ws/rs/core/UriBuilderException.class b/com.sun.jersey/javax/ws/rs/core/UriBuilderException.class Binary files differnew file mode 100644 index 00000000..09dafc67 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/UriBuilderException.class diff --git a/com.sun.jersey/javax/ws/rs/core/UriInfo.class b/com.sun.jersey/javax/ws/rs/core/UriInfo.class Binary files differnew file mode 100644 index 00000000..d4251adb --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/UriInfo.class diff --git a/com.sun.jersey/javax/ws/rs/core/Variant$VariantListBuilder.class b/com.sun.jersey/javax/ws/rs/core/Variant$VariantListBuilder.class Binary files differnew file mode 100644 index 00000000..ab6e35ab --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Variant$VariantListBuilder.class diff --git a/com.sun.jersey/javax/ws/rs/core/Variant.class b/com.sun.jersey/javax/ws/rs/core/Variant.class Binary files differnew file mode 100644 index 00000000..29058fa6 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/core/Variant.class diff --git a/com.sun.jersey/javax/ws/rs/ext/ContextResolver.class b/com.sun.jersey/javax/ws/rs/ext/ContextResolver.class Binary files differnew file mode 100644 index 00000000..62facef5 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/ContextResolver.class diff --git a/com.sun.jersey/javax/ws/rs/ext/ExceptionMapper.class b/com.sun.jersey/javax/ws/rs/ext/ExceptionMapper.class Binary files differnew file mode 100644 index 00000000..38620d01 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/ExceptionMapper.class diff --git a/com.sun.jersey/javax/ws/rs/ext/FactoryFinder$1.class b/com.sun.jersey/javax/ws/rs/ext/FactoryFinder$1.class Binary files differnew file mode 100644 index 00000000..2452eca9 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/FactoryFinder$1.class diff --git a/com.sun.jersey/javax/ws/rs/ext/FactoryFinder.class b/com.sun.jersey/javax/ws/rs/ext/FactoryFinder.class Binary files differnew file mode 100644 index 00000000..3cc6f3fa --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/FactoryFinder.class diff --git a/com.sun.jersey/javax/ws/rs/ext/MessageBodyReader.class b/com.sun.jersey/javax/ws/rs/ext/MessageBodyReader.class Binary files differnew file mode 100644 index 00000000..bf2698fc --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/MessageBodyReader.class diff --git a/com.sun.jersey/javax/ws/rs/ext/MessageBodyWriter.class b/com.sun.jersey/javax/ws/rs/ext/MessageBodyWriter.class Binary files differnew file mode 100644 index 00000000..0d273c11 --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/MessageBodyWriter.class diff --git a/com.sun.jersey/javax/ws/rs/ext/Provider.class b/com.sun.jersey/javax/ws/rs/ext/Provider.class Binary files differnew file mode 100644 index 00000000..b9fb29ad --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/Provider.class diff --git a/com.sun.jersey/javax/ws/rs/ext/Providers.class b/com.sun.jersey/javax/ws/rs/ext/Providers.class Binary files differnew file mode 100644 index 00000000..5006e31d --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/Providers.class diff --git a/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate$HeaderDelegate.class b/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate$HeaderDelegate.class Binary files differnew file mode 100644 index 00000000..328c7c7d --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate$HeaderDelegate.class diff --git a/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate.class b/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate.class Binary files differnew file mode 100644 index 00000000..01ae8a5b --- /dev/null +++ b/com.sun.jersey/javax/ws/rs/ext/RuntimeDelegate.class |
