Class AuthManager
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.AbstractInitializableAttribute
-
- ptolemy.actor.lib.jjs.modules.iotAuth.AuthManager
-
- All Implemented Interfaces:
java.lang.Cloneable
,Initializable
,Changeable
,Debuggable
,DebugListener
,Derivable
,HierarchyListener
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class AuthManager extends AbstractInitializableAttribute
Download, build, start and stop the local authorization entity, Auth.This class requires access to the github repository for Auth.
The primary purpose of this class is to make it easy to download, build and start the Auth on a local machine. This is primarily useful for testing.
See org/terraswarm/accessor/accessors/web/net/authSetup for a shell script that does something similar.
- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Hokeun Kim
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description FileParameter
authSourceDirectory
The path to the Auth sources.Parameter
buildAuth
If true then build the local copy of the Auth.Parameter
cleanAuth
If true then remove the contents of the authSourceDirectory at the start of initialization.Parameter
isLocalAuth
Use a local version of Auth.Parameter
stopAuthInWrapup
If true, then stop Auth processes in wrapup().-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description AuthManager(CompositeEntity container, java.lang.String name)
Construct a AuthManager with a name and a container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
downloadAndBuild(FileParameter authSourceDirectoryParameter, boolean cleanAuth, boolean buildAuth)
Download and build Auth.void
initialize()
Initializes the AuthManager attribute.void
preinitialize()
Preinitialze the AuthManager attribute.void
wrapup()
Stop Auth processes.-
Methods inherited from class ptolemy.actor.AbstractInitializableAttribute
_getInitializableContainer, addInitializable, clone, hierarchyChanged, hierarchyWillChange, removeInitializable, setContainer
-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Field Detail
-
buildAuth
public Parameter buildAuth
If true then build the local copy of the Auth. The default value is the value true;
-
cleanAuth
public Parameter cleanAuth
If true then remove the contents of the authSourceDirectory at the start of initialization. The default value is the value false.
-
authSourceDirectory
public FileParameter authSourceDirectory
The path to the Auth sources. The default value is "$PTII/vendors/iotauth".
-
isLocalAuth
public Parameter isLocalAuth
Use a local version of Auth. The default value is true, meaning that the Auth will be downloaded, built, started and stopped.
-
stopAuthInWrapup
public Parameter stopAuthInWrapup
If true, then stop Auth processes in wrapup(). The default value is true, meaning that the daemons are stopped. If deleteAllGCLsInWrapup is true, the the value of this parameter is ignored and the Auth processes are always stopped in wrapup. Set this parameter to true to debug the daemons after running a model.
-
-
Constructor Detail
-
AuthManager
public AuthManager(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a AuthManager with a name and a container. The container argument must not be null, or a NullPointerException will be thrown. This actor will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.- Parameters:
container
- Container of this attribute.name
- Name of this attribute.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name coincides with an actor already in the container.
-
-
Method Detail
-
downloadAndBuild
public static void downloadAndBuild(FileParameter authSourceDirectoryParameter, boolean cleanAuth, boolean buildAuth) throws IllegalActionException, java.io.IOException
Download and build Auth.- Parameters:
authSourceDirectoryParameter
- The path to the Auth sources.cleanAuth
- True if Auth should be cleaned before installingbuildAuth
- True if Auth should be built and installed- Throws:
IllegalActionException
- If there are problems accessing the parameter.java.io.IOException
- If there are problems accessing or build the repositories.
-
initialize
public void initialize() throws IllegalActionException
Initializes the AuthManager attribute. The auth processes are started.- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractInitializableAttribute
- Throws:
IllegalActionException
- If thrown by a subclass.
-
preinitialize
public void preinitialize() throws IllegalActionException
Preinitialze the AuthManager attribute.- Specified by:
preinitialize
in interfaceInitializable
- Overrides:
preinitialize
in classAbstractInitializableAttribute
- Throws:
IllegalActionException
- If there are problems checking out the repositories while building and initializing Auth.
-
wrapup
public void wrapup() throws IllegalActionException
Stop Auth processes.- Specified by:
wrapup
in interfaceInitializable
- Overrides:
wrapup
in classAbstractInitializableAttribute
- Throws:
IllegalActionException
- If the parent class throws it of if there are problems terminating the processes
-
-