/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* 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
* 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.
*/
/**
* A cluster defines a homogeneous set of server instances that share the same
* applications, resources, and configuration.
*/
@SuppressWarnings("unused")
public interface Node extends ConfigBeanProxy, Injectable, Named, ReferenceContainer, RefContainer, Payload {
/**
* Sets the node name
* @param value node name
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* points to the parent directory of the node(s) directory.
*
* @return path location of node-dir
*/
/**
* Sets the value of the node-dir, top-level parent directory of node(s)
*
* @param value allowed object is
* {@link String }
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* points to a named host.
*
* @return a named host name
*/
/**
* Sets the value of the name property.
*
* @param value allowed object is
* {@link String }
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* points to a GlassFish installation root
*
* @return value of install-dir
*/
/**
* Sets the value of install-dir, the GlassFish installation root.
*
* @param value allowed object is
* {@link String }
* @throws PropertyVetoException if a listener vetoes the change
*/
@Attribute()
/**
* Sets the value of type of this node.
*
* @param value allowed object is
* {@link String }
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* specifies the windows domain if applicable
*
* @return the Windows domain name.
*/
/**
* Sets the value of the windows domain property.
*
* @param value allowed object is
* {@link String }
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* true if node is frozen and we should not allow new instances
* to be created on the nod.
*
* @return "true" if node is frozen
*/
/**
* Sets the value of the freeze
*
* @param value "true" to freeze node and not allow instances to be created
*
* @throws PropertyVetoException if a listener vetoes the change
*/
/**
* Returns the install dir with separators as forward slashes. This is needed to run commands
* over SSH tools on Windows where the backslashes are interpruted as escape chars.
*
* @return the install dir with separators as forward slashes
*/
/**
* Returns the node dir with separators as forward slashes. This is needed to run commands
* over SSH tools on Windows where the backslashes are interpruted as escape chars.
*
* @return the node dir with separators as forward slashes
*/
/**
* Returns the node dir as an absolute path. If the node dir path
* in the Node element is relative this will make it absolute relative
* to the node's installdir.
* @return the node's nodedir as an absolute path. Null if no nodedir.
*/
/**
* Is a node being used by any server instance?
* @return true if node is referenced by any server instance, else false.
*/
boolean nodeInUse();
/**
* True if this is the default local node. Example: localhost-domain1
* @return
*/
boolean isDefaultLocalNode();
/**
* True if the node's nodeHost is local to this
* @return
*/
boolean isLocal();
/**
* Does the node allow instance creation?
* @return true if node allows instance creation, else false
*/
boolean instanceCreationAllowed();
class Duck {
if (installDir == null)
return null;
}
return null;
}
// If nodedir is relative make it absolute relative to installRoot
return null;
if (nodeDirFile.isAbsolute()) {
return nodeDir;
}
// node-dir is relative. Make it absolute. We root it under the
// GlassFish root install directory.
return absoluteNodeDirFile.getPath();
}
if (nodeDirAbsolute == null)
return null;
}
return true;
}
return false;
}
// Short circuit common case for efficiency
return true;
}
return false;
}
}
//check if node is referenced by an instance
if (serverList != null) {
return true;
}
}
}
return false;
}
}
}
/**
* Decorates the newly CRUD created cluster configuration instance.
* tasks :
* - ensures that it references an existing configuration
* - creates a new config from the default-config if no config-ref
* was provided.
* - check for deprecated parameters.
*
* @param context administration command context
* @param instance newly created configuration element
* @throws TransactionFailure
* @throws PropertyVetoException
*/
public void decorate(AdminCommandContext context, final Node instance) throws TransactionFailure, PropertyVetoException {
new LocalStringManagerImpl(Node.class);
/* 16034: see if instance creation is turned off on node */
if (! nodes.nodeCreationAllowed()) {
"nodeCreationNotAllowed",
"Node creation is disabled. No new nodes may be created."));
}
// If these options were passed a value of the empty string then
// we want to make sure they are null in the Node. The
// admin console often passes the empty string instead of null.
// See bug 14873
//only create-node-ssh and update-node-ssh should be changing the type to SSH
return;
}
}
}
"Node.localhost",
throw new TransactionFailure(msg);
}
// See if any servers are using this node
int n = 0;
if (n > 0)
n++;
}
"Node.referencedByInstance",
"Node {0} referenced in server instance(s): {1}. Remove instances before removing node.", child.getName(), sb.toString());
throw new TransactionFailure(msg);
}
}
}
}