|
Glassfish example source code file (VirtualServer.java)
The Glassfish VirtualServer.java source code
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-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.
*/
package com.sun.enterprise.config.serverbeans;
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import com.sun.grizzly.config.dom.NetworkConfig;
import com.sun.grizzly.config.dom.NetworkListener;
import org.glassfish.api.admin.RestRedirect;
import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
import org.glassfish.config.support.datatypes.PositiveInteger;
import org.jvnet.hk2.component.Injectable;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.DuckTyped;
import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
/**
* Configuration of Virtual Server
*
* Virtualization in Application Server allows multiple URL domains to be served by the same HTTP server process, which
* is listening on multiple host addresses If an application is available at two virtual servers, they still share same
* physical resource pools, such as JDBC connection pools. Sun ONE Application Server allows a list of virtual servers,
* to be specified along with web-module and j2ee-application elements. This establishes an association between URL
* domains, represented by the virtual server and the web modules (standalone web modules or web modules inside the ear
* file)
*/
@Configured
@RestRedirects({
@RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-virtual-server"),
@RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-virtual-server")
})
public interface VirtualServer extends ConfigBeanProxy, Injectable, PropertyBag {
/**
* Gets the value of the id property.
*
* Virtual server ID. This is a unique ID that allows lookup of a specific virtual server. A virtual server ID
* cannot begin with a number.
*
* @return possible object is {@link String }
*/
@Attribute(key = true)
@NotNull
String getId();
/**
* Sets the value of the id property.
*
* @param value allowed object is {@link String }
*/
void setId(String value) throws PropertyVetoException;
/**
* Gets the value of the httpListeners property.
*
* Comma-separated list of http-listener id(s), Required only for a Virtual Server that is not the default virtual
* server.
*
* @return possible object is {@link String }
*/
@Attribute
@Deprecated
String getHttpListeners();
/**
* Sets the value of the httpListeners property.
*
* @param value allowed object is {@link String }
*/
@Deprecated
void setHttpListeners(String value) throws PropertyVetoException;
/**
* Gets the value of the httpListeners property.
*
* @return possible object is {@link String }
*/
@Attribute
String getNetworkListeners();
/**
* Sets the value of the httpListeners property.
*
* @param value allowed object is {@link String }
*/
void setNetworkListeners(String value) throws PropertyVetoException;
/**
* Gets the value of the defaultWebModule property.
*
* Stand alone web module associated with this virtual server by default
*
* @return possible object is {@link String }
*/
@Attribute
String getDefaultWebModule();
/**
* Sets the value of the defaultWebModule property.
*
* @param value allowed object is {@link String }
*/
void setDefaultWebModule(String value) throws PropertyVetoException;
/**
* Gets the value of the hosts property.
*
* A comma-separated list of values allowed in the Host request header to select current virtual server. Each
* Virtual Server that is configured to the same Connection Group must have a unique hosts value for that group.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "${com.sun.aas.hostName}")
@NotNull
String getHosts();
/**
* Sets the value of the hosts property.
*
* @param value allowed object is {@link String }
*/
void setHosts(String value) throws PropertyVetoException;
/**
* Gets the value of the state property.
*
* Determines whether Virtual Server is active(on) or inactive(off, disable) The default is on (active). When
* inactive, a Virtual Server does not service requests. off returns a 404: Status code (404) indicating that the
* requested resource is not available disabled returns a 403: Status code (403) indicating the server understood
* the request but refused to fulfill it.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "on")
@Pattern(regexp = "(on|off|disabled)")
String getState();
/**
* Sets the value of the state property.
*
* @param value allowed object is {@link String }
*/
void setState(String value) throws PropertyVetoException;
/**
* Gets the value of the docroot property.
*
* The location on the filesystem where the files related to the content to be served by this virtual server is
* stored.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "${com.sun.aas.instanceRoot}/docroot")
String getDocroot();
/**
* Sets the value of the docroot property.
*
* @param value allowed object is {@link String }
*/
void setDocroot(String value) throws PropertyVetoException;
/**
* Gets the value of the accesslog property.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "${com.sun.aas.instanceRoot}/logs/access")
String getAccessLog();
/**
* Sets the value of the accesslog property.
*
* @param value allowed object is {@link String }
*/
void setAccessLog(String value) throws PropertyVetoException;
/**
* Gets the value of the sso-enabled property. Possible values: true/false/inherit
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "inherit")
@Pattern(regexp = "(true|on|false|off|inherit)")
String getSsoEnabled();
/**
* Sets the value of the sso-enabled property.
*
* @param value allowed object is {@link String }
*/
void setSsoEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the enabled property. Possible values: true/false/inherit
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "inherit")
@Pattern(regexp = "(true|on|false|off|inherit)")
String getAccessLoggingEnabled();
/**
* Sets the value of the access logging enabled property.
*
* @param value allowed object is {@link String }
*/
void setAccessLoggingEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the logFile property.
*
* Specifies a log file for virtual-server-specific log messages. Default value is
* ${com.sun.aas.instanceRoot}/logs/server.log
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "${com.sun.aas.instanceRoot}/logs/server.log")
String getLogFile();
/**
* Sets the value of the logFile property.
*
* @param value allowed object is {@link String }
*/
void setLogFile(String value) throws PropertyVetoException;
/**
* Gets the value of the httpAccessLog property.
*
* @return possible object is {@link HttpAccessLog }
*/
@Element
HttpAccessLog getHttpAccessLog();
/**
* Sets the value of the httpAccessLog property.
*
* @param value allowed object is {@link HttpAccessLog }
*/
void setHttpAccessLog(HttpAccessLog value) throws PropertyVetoException;
/**
* Gets the Secure attribute of any JSESSIONIDSSO cookies associated with the web applications deployed to this
* virtual server. Applicable only if the sso-enabled property is set to true. To set the Secure attribute of a
* JSESSIONID cookie, use the cookieSecure cookie-properties property in the sun-web.xml file. Valid values: "true",
* "false", "dynamic"
*/
@Attribute(defaultValue = "dynamic")
@Pattern(regexp = "(true|false|dynamic)")
String getSsoCookieSecure();
void setSsoCookieSecure(String value);
@Attribute(defaultValue="false", dataType=Boolean.class)
String getSsoCookieHttpOnly();
void setSsoCookieHttpOnly(String value);
@DuckTyped
void addNetworkListener(String name) throws PropertyVetoException;
@DuckTyped
void removeNetworkListener(String name) throws PropertyVetoException;
@DuckTyped
NetworkListener findNetworkListener(String name);
@DuckTyped
List<NetworkListener> findNetworkListeners();
class Duck {
public static void addNetworkListener(VirtualServer server, String name) throws PropertyVetoException {
final String listeners = server.getNetworkListeners();
final String[] strings = listeners == null ? new String[0] : listeners.split(",");
final Set<String> set = new TreeSet
Other Glassfish examples (source code examples)Here is a short list of links related to this Glassfish VirtualServer.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.