public class NodeAccess
extends org.dataone.cn.ldap.LDAPService
Constructor and Description |
---|
NodeAccess() |
Modifier and Type | Method and Description |
---|---|
protected List<ModificationItem> |
calcListModifications(String attributeName,
HashMap<String,NamingEnumeration<?>> attributesMap,
Collection<String> newValues)
create ModificationItems for the named multi-value attribute.
|
protected List<ModificationItem> |
calcModifications(String attributeName,
HashMap<String,NamingEnumeration<?>> attributesMap,
String newValue)
create ModificationItems for the named single-value attribute.
|
protected List<ModificationItem> |
calcSubjectListModifications(String attributeName,
HashMap<String,NamingEnumeration<?>> attributesMap,
List<org.dataone.service.types.v1.Subject> newValues)
create ModificationItems for the named multi-value attribute.
|
protected void |
createNode(DirContext ctx,
org.dataone.service.types.v2.Node node)
create a DataONE Node
|
protected Boolean |
deleteNode(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
remove the node from LDAP, note all other dependent structures
have to be removed before this is called or it will fail.
|
protected Boolean |
getAggregateLogs(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
each MN Node will have a boolean associated with DataONE logAggregation
The field is hidden from the nodeList, it may only be manipulated by D1 processing
or a DataONE LDAP administrator
The LDAP attribute of the Node functionally a replicated lock.
|
protected org.dataone.service.types.v2.Node |
getApprovedNode(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
determine if an Administrator has approved the node after it was registered,
Then return the node if it is approved, otherwise throw a NotFound exception
|
protected List<org.dataone.service.types.v2.Node> |
getApprovedNodeList(DirContext ctx)
return a list of Nodes that are marked approved in LDAP
|
protected Date |
getDateLastHarvested(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
return the date the last time a node was harvested for log records
the date is not the time the harvesting ran, but
the latest dateLogged from the LogEvent records harvested
|
protected Date |
getLogLastAggregated(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
return the date the last time a node was harvested for log records
the date is not the time the harvesting ran, but
the latest dateLogged from the LogEvent records harvested
|
protected org.dataone.service.types.v2.Node |
getNode(DirContext dirContext,
org.dataone.service.types.v1.NodeReference nodeReference)
retrieve a complete DataONE Node from LDAP.
|
protected Boolean |
getNodeApproved(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeReference)
determine if an Administrator has approved the node after it was registered
|
protected Map<String,String> |
getNodeIdList(DirContext ctx)
retrieve mapping of all NodeReference values from LDAP
to their baseUrls
this should contain both approved and non approved ids
|
protected List<org.dataone.service.types.v1.NodeReference> |
getPendingNodeReferenceList(DirContext ctx)
get a list of NodeReferences that have yet to be approved by an
Administrator after the Nodes have been registered
|
protected Attributes |
mapNodeAttributes(org.dataone.service.types.v2.Node node)
from the provided Node instance, fill in the Attributes that will be used
to create the Node in LDAP.
|
protected void |
setAggregateLogs(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeIdentifier,
Boolean aggregateLogs)
update the aggregate Logs Boolean on a DataONE Node
|
protected void |
setDateLastHarvested(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeIdentifier,
Date lastDateNodeHarvested)
update the date a Member node was last Synchronized
Synchronization uses last harvested date to poll membernodes for new content
the date is the latest dateSysMetadataModified from the last batch of records
harvested
|
protected void |
setLogLastAggregated(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeIdentifier,
Date logAggregationDate)
update the date a DataONE Node was last Aggregated for Log records
LogAggregation uses last aggregated date to poll membernodes for new content
the date is the latest dateLogged from the LogEvent records harvested
|
protected void |
setNodeApproved(DirContext ctx,
org.dataone.service.types.v1.NodeReference nodeIdentifier,
Boolean approved)
update a registered DataONE Node to be approved (or unapproved if need be)
|
protected void |
updateNode(DirContext ctx,
org.dataone.service.types.v2.Node node)
update a DataONE Node
|
public static org.apache.commons.logging.Log log
public static final String DEFAULT_NON_HARVEST_DATE
public static final String NODE_APPROVED
public static final String LOG_LAST_AGGREGATED
public static final String AGGREGATE_LOGS
public static final String NODE_ID
public static final String NODE_NAME
public static final String NODE_DESCRIPTION
public static final String NODE_BASEURL
public static final String SYNC_SCHEDULE_SEC
public static final String SYNC_SCHEDULE_MIN
public static final String SYNC_SCHEDULE_HOUR
public static final String SYNC_SCHEDULE_MDAY
public static final String SYNC_SCHEDULE_MON
public static final String SYNC_SCHEDULE_WDAY
public static final String SYNC_SCHEDULE_YEAR
public static final String NODE_LAST_HARVESTED
public static final String NODE_LAST_COMPLETE_HARVEST
public static final String REP_POLICY_MAXOBJECTSIZE
public static final String REP_POLICY_SPACEALLOCATED
public static final String REP_POLICY_ALLOWEDNODE
public static final String REP_POLICY_ALLOWEDOBJECTFORMAT
public static final String PING_SUCCESS
public static final String PING_DATE_CHECKED
public static final String NODE_SUBJECT
public static final String NODE_CONTACT_SUBJECT
public static final String NODE_REPLICATE
public static final String NODE_SYNCHRONIZE
public static final String NODE_TYPE
public static final String NODE_STATE
protected Boolean deleteNode(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure
nodeReference
- org.dataone.service.exceptions.ServiceFailure
protected List<org.dataone.service.types.v2.Node> getApprovedNodeList(DirContext ctx) throws org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.ServiceFailure
protected Date getDateLastHarvested(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure
nodeReference
- org.dataone.service.exceptions.ServiceFailure
protected Date getLogLastAggregated(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure
nodeReference
- org.dataone.service.exceptions.ServiceFailure
protected org.dataone.service.types.v2.Node getNode(DirContext dirContext, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.NotFound, NamingException, NameNotFoundException
nodeDN
- Distinguished name of the DN, provided by buildNodeDNNamingException
org.dataone.service.exceptions.NotFound
NameNotFoundException
protected org.dataone.service.types.v2.Node getApprovedNode(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotFound
nodeIdentifier
- org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotFound
protected Boolean getNodeApproved(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- org.dataone.service.exceptions.ServiceFailure
protected Map<String,String> getNodeIdList(DirContext ctx) throws org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.ServiceFailure
protected List<org.dataone.service.types.v1.NodeReference> getPendingNodeReferenceList(DirContext ctx) throws org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.ServiceFailure
protected Boolean getAggregateLogs(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeReference) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- org.dataone.service.exceptions.ServiceFailure
protected Attributes mapNodeAttributes(org.dataone.service.types.v2.Node node)
node
- protected void setDateLastHarvested(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeIdentifier, Date lastDateNodeHarvested) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- lastDateNodeHarvested
- org.dataone.service.exceptions.ServiceFailure
protected void setLogLastAggregated(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeIdentifier, Date logAggregationDate) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- logAggregationDate
- org.dataone.service.exceptions.ServiceFailure
protected void setNodeApproved(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeIdentifier, Boolean approved) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- approved
- org.dataone.service.exceptions.ServiceFailure
protected void createNode(DirContext ctx, org.dataone.service.types.v2.Node node) throws org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotFound
node
- org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotFound
protected void updateNode(DirContext ctx, org.dataone.service.types.v2.Node node) throws org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotFound
node
- org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotFound
protected void setAggregateLogs(DirContext ctx, org.dataone.service.types.v1.NodeReference nodeIdentifier, Boolean aggregateLogs) throws org.dataone.service.exceptions.ServiceFailure
nodeIdentifier
- aggregateLogs
- org.dataone.service.exceptions.ServiceFailure
protected List<ModificationItem> calcModifications(String attributeName, HashMap<String,NamingEnumeration<?>> attributesMap, String newValue) throws NamingException
NamingException
protected List<ModificationItem> calcListModifications(String attributeName, HashMap<String,NamingEnumeration<?>> attributesMap, Collection<String> newValues) throws NamingException
E
- attributesMap
- newValues
- attributeName
- NamingException
protected List<ModificationItem> calcSubjectListModifications(String attributeName, HashMap<String,NamingEnumeration<?>> attributesMap, List<org.dataone.service.types.v1.Subject> newValues) throws NamingException
attributesMap
- newValues
- attributeName
- NamingException
Copyright © 2017. All rights reserved.